udpsimulationomnet++packetwireless

Simulation of Wired Network in OMNET++ using INET framework - UDP


So, I am trying to do a very basic wired network simulation (later on I will add wireless nodes) in OMNET++: packet type: UDP Traffic Type: Video Streaming OMNET version:6.0.1 INET version: 4.5

The simulation ends without running properly and it just says "simulation timed ended" when I run it. There is no error. Thus, no results are being recorded either. enter image description here

The log also shows me this:

INFO (Tcp)GiB.standardHost1[20].tcp: GiB.standardHost1[20].tcp: finishing with 0 connections open. INFO (Tcp)GiB.standardHost1[21].tcp: GiB.standardHost1[21].tcp: finishing with 0 connections open. INFO (Tcp)GiB.standardHost1[22].tcp: GiB.standardHost1[22].tcp: finishing with 0 connections open. INFO (Tcp)GiB.standardHost1[23].tcp: GiB.standardHost1[23].tcp: finishing with 0 connections open. INFO (Tcp)GiB.standardHost1[24].tcp: GiB.standardHost1[24].tcp: finishing with 0 connections open. INFO (Tcp)GiB.server.tcp: GiB.server.tcp: finishing with 0 connections open.

here is my .NED file:

import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.ethernet.EthernetSwitch;
import inet.node.inet.StandardHost;
import ned.DatarateChannel;

//WIRED-SCENARIO
network GiB
{
    parameters:
        int numHosts;
        @display("bgb=650,520");
        @statistic[endToEndDelay](title="end-to-end delay"; source="messageAge(rcvdPk)"; unit=s; record=histogram,vector; interpolationmode=none);
        @statistic[throughput](title="throughput"; unit=bps; source="throughput(rcvdPk)"; record=histogram,vector);

    types:
        channel Ether1000m extends DatarateChannel
        {
            datarate = 1000Mbps;
            delay = 0.1us;
        }
    submodules:
        standardHost[numHosts]: StandardHost {
            @display("p=85,179");
        }
        standardHost1[numHosts]: StandardHost {
            @display("p=302,374");
        }
        server: StandardHost {
            @display("p=531,67;i=device/server");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=46,39");
        }
        centerSwitch: EthernetSwitch {
            @display("p=418,146");
        }
        ethernetSwitch1: EthernetSwitch {
            @display("p=256,146");
            
                
        }
        ethernetSwitch2: EthernetSwitch {
            @display("p=341,260");
            
        }
    connections:
        server.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        ethernetSwitch1.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        ethernetSwitch2.ethg++ <--> Ether1000m <--> centerSwitch.ethg++;
        for i=0..numHosts-1 {
            ethernetSwitch1.ethg++ <--> Ether1000m <--> standardHost[i].ethg++;
            standardHost1[i].ethg++ <--> Ether1000m <--> ethernetSwitch2.ethg++;
        }
        
}

and ini file:

[General]
network = GiB
#wiredscenario
sim-time-limit = 5400s

**.numHosts = ${5..25 step 10}
*.*.numUdpApps = 1

**.channel.throughput.statistic-recording = true
**.channel.throughput.result-recording-modes = all
**.*.vector-recording = true
**.*.vector-recording-intervals = 0..900
**.*.scalar-recording = true

[Config UDP]

**.standardHost[*].udpApp[*].typename = "UdpVideoStreamClient"
**.standardHost[*].udpApp[*].serverAddress = "server"
**.standardHost[*].udpApp[*].serverPort = 1000
**.standardHost[*].udpApp[*].startTime = 5s


**.standardHost1[*].udpApp[*].typename = "UdpVideoStreamClient"
**.standardHost1[*].udpApp[*].serverAddress = "server"
**.standardHost1[*].udpApp[*].serverPort = 1000

**.server.udpApp[*].typename = "UdpVideoStreamServer"
**.server.udpApp[*].localPort = 1000
**.server.udpApp[*].sendInterval = 0.001s
**.server.udpApp[*].packetLen = 1400B
**.server.udpApp[*].videoSize = 1Gb

  1. Am I doing it right?
  2. If yes, then please guide how to fix this scenario
  3. If no, then please correct.

Please I need help. Thank you :)


Solution

  • There are two problems in your omnetpp.ini:

    1. INET uses numApps instead of numUdpApps or numTcpApps.
    2. StandardHost has app[] for storing application - neither udpApp[] nor tcpApp[].

    Reference: INET NED Documentation - StandardHost

    So the corrected omnetpp.ini should look like this:

    [General]
    network = GiB
    sim-time-limit = 5400s
    
    **.numHosts = ${5..25 step 10}
    
    **.channel.throughput.statistic-recording = true
    **.channel.throughput.result-recording-modes = all
    **.*.vector-recording = true
    **.*.vector-recording-intervals = 0..900
    **.*.scalar-recording = true
    
    [Config UDP]
    **.standardHost[*].numApps = 1
    **.standardHost[*].app[*].typename = "UdpVideoStreamClient"
    **.standardHost[*].app[*].serverAddress = "server"
    **.standardHost[*].app[*].serverPort = 1000
    **.standardHost[*].app[*].startTime = 5s
    
    **.standardHost1[*].numApps = 1
    **.standardHost1[*].app[*].typename = "UdpVideoStreamClient"
    **.standardHost1[*].app[*].serverAddress = "server"
    **.standardHost1[*].app[*].serverPort = 1000
    
    **.server.numApps = 1
    **.server.app[*].typename = "UdpVideoStreamServer"
    **.server.app[*].localPort = 1000
    **.server.app[*].sendInterval = 0.001s
    **.server.app[*].packetLen = 1400B
    **.server.app[*].videoSize = 1Gb
    

    Moreover, in your NED file I suggest removing @display for hosts, because it results in displaying all hosts in the same place:

    submodules:
     standardHost[numHosts]:  StandardHost;
     standardHost1[numHosts]: StandardHost;