MPI-SWS

Create your own traffic shaping test with Glasnost

* Home * Glasnost Tests * Create a new test * Run your own server * Results * Contact *

Example: Creating a test for web traffic step-by-step

In this example, we will create a Glasnost test for web traffic. First, we will show how to collect a trace of web traffic that we will then convert into a Glasnost test that can be uploaded and run in Glasnost.

To collect a trace of web traffic, we use tcpdump (you can also use wireshark to do this).
The following will configure tcpdump to capture all TCP traffic on port 80 and save the full packets to a file called "web.pcap".

tcpdump -i en1 -s 0 -w web.pcap "tcp port 80"

You might need to adjust this example to work for your purpose. For example, you likely need to adjust the interface (here "en1") tcpdump should capture packet on. Do not forget to use the "-s 0" option to capture the full packet payload, as this is needed to generate an accurate Glasnost test.

Now that we have a packet trace of web traffic, we can run trace-emulate to create a Glasnost test:

python trace-emulate.py tcp.port80.pcap

trace-emulate parses the traces, and outputs something like this on the console:

...
Found new connection: 192.168.2.2:63050 <–> 213.92.49.28:80
Found new connection: 192.168.2.2:63051 <–> 213.92.49.28:80
Found new connection: 192.168.2.2:63052 <–> 213.92.49.28:80
Found new connection: 192.168.2.2:63053 <–> 213.92.49.28:80
Found new connection: 192.168.2.2:63054 <–> 74.125.43.101:80
Found new connection: 192.168.2.2:63055 <–> 209.85.129.164:80
Found new connection: 192.168.2.2:63056 <–> 213.92.49.28:80

Found 63 connections:

59 connections were correctly opened
47 connections were correctly closed
59 connections were correclty opened and transferred some data, tests have been created for them

Trace-emulate lists the connections found in the trace with the respective endpoints. It also outputs a summary with the number of connections correctly opened, closed, and that contained some payload. Note that out of the 63 connections in this trace, ptrace-emulate could see a correct SYN/ACK exchange for only 59 of them (the remaining 4 were likely opened before Tcpdump was run). Trace-emulate needs to see the SYN/ACK exchange to produce a test for a connection.
Trace-emulate generates a file per transfer found in the packet trace. Each file's name contains the endpoints of the corresponding connection. For example, the file "tcp.port80.pcap-client-192.168.2.2-62996-server-209.85.129.99-80.gtest" contains a test generated from the transfer that was originally sent from a host with IP 192.168.2.2 on port 62996 to a server with IP 209.85.129.99 on port 80.

The generated file will look similar to this:

[protocol:tcp.port80.pcap–client–192.168.2.2–62996–server–209.85.129.99–80]

# generated by trace–emulate.py on Wed Oct 7 21:41:27 2009
# from the pcap file: "tcp.port80.pcap"

# connection 3
# clientIP 192.168.2.2 clientPort 62996
# serverIP 209.85.129.99 serverPort 80
# captured on Wed Oct 7 21:40:35 2009 timestamp: 1254944435
# client sent 3280 bytes
# server sent 167531 bytes

...

Trace-emulate calls "client" whatever host initiated the connection, and server the other host. The header also contains more information like the time at which the trace was collected and the total bytes sent by the client and the server.
This test file is ready to be uploaded to Glasnost and run in the measurement server.

 

In case you have questions about this tool or our research, please contact us: broadband @at@ mpi-sws mpg de




Imprint / Data Protection