TWiki home TWiki > Simulation > SimulationWebHome > Tutorials > ANetworkOf4HostsAnd2PacketSwitches TWiki webs:
Main | TWiki | Know | Sandbox
Simulation . { Changes | Index | Search | Go }

Simulation of Packet-Switching Networks

By doing the previous tutorials we have learnt a great deal of stuff on using OMNeT++ for modeling and simulation. But, we only dealt with small scale models, the methods we use do not capture some important elements of packet-switched network dynamics, and some methods we used are clearly not scalable. Some important issues we need to address are

A Packet-switching network of two routers and four hosts

Let's create a packet switching network of 2 routers and 4 hosts (as shown in the following diagram).

4hosts2routers.png
The NED files are:

The C++ implementations of the simple modules are:

And others required to complete the simulation model:

Observing and recording the statistics

I have included quite a few number of statistics collection facilities of OMNeT++ (which we have learned about them in the TicToc 11 tutorial) in the C++ code of the simple modules. We can observe the following when we run the simulations (see the figure below):

  1. Output queue lengths
  2. Output queue length distribution histograms
  3. Output queue length Vs time plots
  4. Number of packets generated and received by hosts
  5. Packet size distribution histograms at the receivers (sinks)
  6. Hop count distribution histograms of the packets received at the sinks
  7. End-to-end packet delay distribution histograms at the sinks
pkswitch_net_stats.png
The histogram plots and graphs are accessible by double clicking on the icon of a simple module and choosing the "contents" tab (you need to double click on the variable you want to observe).

For postprocessing, the simulation will also record two files: omnetpp.vec and omnetpp.sca. you will find in the code that I ask OMNeT++ to record the progression of queue lengths and statistics on number of generated and received packets in each host, end-to-end packet delays, packet sizes and hop counts. When the simulation ends, in the working directory there should be two files created:

  1. omnetpp.vec the queue size progression data, and
  2. omnetpp.sca the collected statistics on various network data, such as average end-to-end delays, number of generated and received packets etc.
They are ordinary text files, you can look into them, process them through perl, awk, sed or similar tools to extract and/or combine data. You can also use OMNeT++'s own scalars and plove tools (as introduced in the TicToc tutorials). Let's first investigate the contents of the scalars.sca file by issuing this command: scalars omnetpp.sca. You will see that there are lots of things we can check. Let's say we are particularly interested in the number of packets generated by each host. We choose #received as the scalar name of interest, then "apply filter" to reduce the list. Afterwards, if click on the "bar chart" icon at the top, we get the following graph:
no_of_received_packets.png
The graph shows the number packets generated by the app_gen module of each host. As one can expect, the number of generated packets for each host is pretty close.

In the next tutorial we will use this network to run a series of simulations to generate a graph of offered traffic Vs average end-to-end delay.

Topic ANetworkOf4HostsAnd2PacketSwitches . { Edit | Attach | Ref-By | Printable | Diffs | r1.18 | > | r1.17 | > | r1.16 | More }
Revision r1.18 - 17 Aug 2011 - 01:28 GMT - AhmetSekercioglu
Parents: SimulationWebHome > Tutorials
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.