Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
mscom_network_start [2014/04/02 18:26] beckmanf added ethtool settings |
mscom_network_start [2014/05/15 16:09] beckmanf tcp configuration |
||
---|---|---|---|
Line 5: | Line 5: | ||
Details regarding tcp testing are here: [[http://www.linuxfoundation.org/collaborate/workgroups/networking/tcp_testing]]. | Details regarding tcp testing are here: [[http://www.linuxfoundation.org/collaborate/workgroups/networking/tcp_testing]]. | ||
+ | ==== Setup of the Linux test platform / USB Stick ==== | ||
- | ==== Setup Ubuntu installation for Network analysis ==== | + | Network tests are done with a network of Ubuntu Linux computers which are connected via an ethernet switch. Students laptops will be part of the setup. If you have a native linux installation, you can use that directly. Follow the steps in [[mscom_linux_setup|Master COM Linux test setup / USB Stick]]. If have a laptop which does not have a native linux installation, then you can use a bootable USB Stick which we provide. |
- | The network throughput analysis is done with different tools. | + | ==== Laboratory expirements ==== |
- | + | ||
- | * iperf Performance Measurement | + | |
- | * Wireshark Packet Tracing | + | |
- | * [[http://www.linuxfoundation.org/collaborate/workgroups/networking/netem|netem]] Network emulation | + | |
- | * tcp_probe Kernel module (see [[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_probe.c|tcp_probe.c]]) | + | |
- | * tftp tiny file transfer protocol | + | |
- | * ethtool for network card settings | + | |
- | + | ||
- | + | ||
- | Here is the guide for creating a usb live boot stick: [[https://help.ubuntu.com/community/LiveCDCustomization]] | + | |
- | + | ||
- | <code> | + | |
- | sudo apt-get install git iperf wireshark gnuplot tftp ethtool | + | |
- | </code> | + | |
+ | * [[mscom_lab1|Master COM Lab 1 - Ethernet Measurements]] | ||
+ | * [[mscom_lab2|Master COM Lab 2 - tftp Measurements]] | ||
==== TCP Throughput test with iperf ==== | ==== TCP Throughput test with iperf ==== | ||
Line 135: | Line 124: | ||
==== Adding tcpprobe traffic log ==== | ==== Adding tcpprobe traffic log ==== | ||
+ | |||
+ | The tcp_probe module can trace the state of a tcp connection. | ||
+ | |||
+ | <code> | ||
+ | sudo modprobe tcp_probe port=5001 | ||
+ | sudo chmod a+r /proc/net/tcpprobe | ||
+ | </code> | ||
+ | |||
+ | In order to store the log data in file test.log: | ||
+ | |||
+ | <code> | ||
+ | cat /proc/net/tcpprobe > test.log | ||
+ | </code> | ||
+ | |||
+ | tcp_probe only adds a log entry, when the contention window size changes. In order to have a log entry for every received packet | ||
+ | |||
+ | <code> | ||
+ | sudo modprobe tcp_probe port=5001 full=1 | ||
+ | </code> | ||
+ | |||
+ | The Ubuntu 12.04 LTS is based on linux kernel 3.11. The tcp_probe kernel module source code can be viewed on the [[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_probe.c?id=v3.11|linux kernel git server]]. | ||
+ | |||
+ | To unload the module: | ||
+ | |||
+ | <code> | ||
+ | sudo modprobe -r tcp_probe | ||
+ | </code> | ||
+ | |||
+ | The log file from tcp_probe contains lines with the log information | ||
+ | |||
+ | <code> | ||
+ | 1 2 3 4 5 6 7 8 9 10 | ||
+ | 7.768727538 192.168.178.33:51715 192.168.178.27:5001 32 0xe656e892 0xe6568e12 16 2147483647 42248 1 | ||
+ | |||
+ | 1: Time in seconds | ||
+ | 2: Source IP:Port | ||
+ | 3: Destination IP:Port | ||
+ | 4: Packet length in bytes | ||
+ | 5: snd_nxt: Sequence Number of the next packet to send | ||
+ | 6: snd_una: Sequence Number of the first unacknowledged packet | ||
+ | 7: snd_cwnd: Contention Window | ||
+ | 8: ssthr: Slow Start Threshold (-1 => not known yet) | ||
+ | 9: snd_wnd: Send Window size in Bytes | ||
+ | 10: srtt: Averaged round trip time estimation | ||
+ | </code> | ||
+ | |||
+ | The data from the log file can be plotted with gnu plot | ||
+ | |||
+ | <code> | ||
+ | gnuplot | ||
+ | gnuplot> plot "test.log" using 1:7 title "cwnd", "test.log" using 1:($8 > 20000000 ? 0 : $8) title "ssthr" | ||
+ | </code> | ||
+ | |||
+ | ==== TCP configuration ==== | ||
+ | |||
+ | Set the maximum write window size for tcp connections | ||
+ | <code> | ||
+ | sudo sh -c "echo 512000 > /proc/sys/net/core/wmem_max" | ||
+ | sudo sh -c "echo 512000 > /proc/sys/net/core/wmem_default" | ||
+ | sudo sh -c "echo 512000 512000 512000 > /proc/sys/net/ipv4/tcp_wmem" | ||
+ | sudo sh -c "echo 512000 512000 512000 > /proc/sys/net/ipv4/tcp_rmem" | ||
+ | </code> | ||
+ | |||
+ | |||