2010
05.27

TRPR (TRace Plot Real-time) is a program which analyzes output from various sources and creates output suitable for plotting.

It can analyze output files from:

  • tcpdump
  • Network Simulator 2
  • mgen

TRPR is able to prepare IP QoS metrics such as:

  • mean rate of packets stream
  • differential interarrival packet delays
  • transmission delay
  • packet loss
  • end other

TRPR can distinguish each flow according to: source and destination IP, source and destination port, flow id and type of transmission (TCP or UDP).

Example:

./trpr latency drec input input.drc auto X,X,192.168.10.116/4000 output output.txt

  • input.drc: output file from mgen
  • 192.168.10.116/4000: destination IP and port which identifies flow
  • output.txt: file ready for plotting
  • information about other parameters can be found here.

What if I wanted to have mean values of metrics in given flow?

Linux awk tool can be used for providing metrics from output.txt.

First of all we have to remove from our file few lines from the beginning, which are used for plotting.

Awk script for getting mean value can look like (2nd column in our file is one with latencies):

BEGIN { FS = " "} {
allV = $2 + allV;
all = all+1;
} END {
mean = allV/all
print "Mean Latency: " mean
}

After executing:

awk -f script.awk output.txt

we should get mean delay of our flow.

What is important: source and destination MUST BE synchronized if metrics such as latency and interarrival time are important for us. It would be fine even if one of them would be source of time for another.

2010
05.05

Multi Generator is one of  free traffic generators.  Current release is mgen 4.2b4. Source could be downloaded here. I installed it on fresh and default Centos 5.3 (2.6.18-128.el5) linux. In order  to work mgen properly, libstdc++.so.5 must be installed:

yum install libstdc++.so.5

and after according to manual:

tar -xvf src-mgen-4.2b6.tgz
cd mgen-4.2b6/unix/
make –f Makefile.linux mgen

and add directory to PATH:

export PATH=$PATH:/path/to/mgen-4.2b6/mgen

Mgen can sent and receive traffic. That’s why one host acts as sender and other as receiver

Now we can make a test:

Create script on sender side: test_input.mgn with:

0.0 ON 1 UDP DST 192.168.10.116/4000 PERIODIC [10.0 1024] TOS 0x10
10.0 OFF 1

It says that we send to 192.168.10.116 on port 4000 PERIODIC traffic. Each packet is 1024 bytes long and in one second 10 packets are sent. What is more, we set on each packet ToS = 0×10. Notice, that 1024B includes IP header. Mgen stops sending packets after 10s.

On receiver side mgen must listen on given port. In order to do this we create script test_listen.mgn:

LISTEN UDP 4000

Please remember to allow traffic to go through your firewall! Or simply type:

service iptables stop

First we must start listening on receiver side:

mgen input test_listen.mgn output test_output.drc

In test_output.drc would be stored captured data for using with TRPR in order to provide QoS metrics.

Now we can start sending packets. We do it on sender side by:

mgen input test_input.mgn

After 10s mgen terminates itself and we can prepare other things with test_output.drc, which would be shown in next posts.

It is worth to read about other avaliable options in mgen. According to particular needs they might be very useful.