[[mscom_network_start]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mscom_network_start [2014/04/03 15:04]
beckmanf added linux link and lab1 link
mscom_network_start [2016/03/16 09:01] (current)
beckmanf [Setup of the Linux test platform / USB Stick] - removed student laptop
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 of the Linux test platform ====
- +
-[[mscom_linux_setup|Master COM Linux test setup / USB Stick]]+
  
 +Network tests are done with a network of Ubuntu Linux computers which are connected via an ethernet switch. ​
 ==== Laboratory expirements ==== ==== Laboratory expirements ====
  
   * [[mscom_lab1|Master COM Lab 1 - Ethernet Measurements]]   * [[mscom_lab1|Master COM Lab 1 - Ethernet Measurements]]
- +  ​* [[mscom_lab2|Master COM Lab 2 - tftp Measurements]]
- +
-==== Setup Ubuntu installation for Network analysis ==== +
- +
-The network throughput analysis is done with a collection of tools.  +
- +
-  * 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 +
- +
-These tools are installed on top of [[http://​releases.ubuntu.com/​12.04/​ubuntu-12.04.4-desktop-amd64.iso|ubuntu-12.04.4-desktop-amd64.iso]] installation form Ubuntu +
- +
-<​code>​ +
-sudo apt-get install git iperf wireshark gnuplot ​tftp ethtool +
-</​code>​ +
- +
-=== Live CD Creation === +
- +
-For the lab I have bootable usb sticks which contain the Ubuntu live system plus a persistent storage which already contains the additional installed packages and the home directory files.  +
- +
-Here is the guide for creating a usb live boot stick: [[https://​help.ubuntu.com/​community/​LiveCDCustomization]] +
- +
-The steps to produce such a bootable usb stick are +
- +
-  - Create a FAT partition of approx. 4 GB size with the Ubuntu disk utility on the usb stick +
-  - Start the graphical "​Startup Disk Creator",​ select the iso image [[http://​releases.ubuntu.com/​12.04/​ubuntu-12.04.4-desktop-amd64.iso|ubuntu-12.04.4-desktop-amd64.iso]] and choose "​Documents and Settings will be stored in reserved extra space" with size of approx. 1GB. Select the USB Device you have in the usb slot.  +
-  - Create the USB Stick with "Make Startup Disk"  +
-  - Eject the stick and inject it again. This will mount the stick and you can look at the file contents.  +
-  - You need to change the file /​boot/​grub/​grub.cfg due to a bug. Add the word "​persistent"​ to the linux parameter of "Try Ubuntu"​. See below for the corrected part of grub.cfg. ​  +
-  - Now boot your computer with the stick. You should boot from a computer which is connected via ethernet such that you have internet connection.  +
-  - Install the packages you need and add the files you want to the home directory. I added the socket programming source files. These changes are persistently stored now.  +
-  +
-Her is the corrected extract from the grub.cfg file:  +
-<​code>​ +
-... +
-menuentry "Try Ubuntu without installing"​ { +
- set gfxpayload=keep +
- linux /​casper/​vmlinuz.efi ​ file=/​cdrom/​preseed/​ubuntu.seed boot=casper persistent quiet splash -- +
- initrd /​casper/​initrd.lz +
-+
-... +
-</​code>​ +
- +
-=== Copy the USB stick === +
- +
-In order to avoid problems with the USB stick copy step, the size of the initial FAT32 partition should be smaller than the maximum size of the USB stick. I selected 4 GB for the FAT 32 which includes the 1GB persistent caspar-rw file. The stick size is 16GB. I had success with copying the first 4 GB (in fact 5GB) from the stick to a file with  +
- +
-<​code>​ +
-sudo dd if=/dev/sdb of=mscom.iso bs=1M count=5000 +
-</​code>​ +
- +
-That produces an mscom.iso file with size 5,2 GB which is well above the 4 GB. Maybe count could have been smaller... Now you can copy that to a new USB stick with  +
- +
-<​code>​ +
-sudo dd if=mscom.iso of=/dev/sdb bs=1M +
-</​code>​ +
- +
-**IF YOUR USB STICK IS AT /dev/sdb AND NOT YOUR HARDDISK....** +
 ==== TCP Throughput test with iperf ==== ==== TCP Throughput test with iperf ====
  
Line 185: Line 123:
  
 ==== 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 ====
 +
 +=== Local memory restrictions ===
 +Set the maximum window sizes for tcp connections to 512000 Bytes. ​
 +
 +<​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 > /​proc/​sys/​net/​core/​rmem_max"​
 +sudo sh -c "echo 512000 > /​proc/​sys/​net/​core/​rmem_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>​
 +
 +=== Initial TCP contention window size ===
 +
 +The following section shows how to change the initial contention window size to to 1 MSS. 
 +
 +<​code>​
 +fritz@ubuntu:​~$ ip route show
 +default via 192.168.178.1 dev eth0  proto static ​
 +169.254.0.0/​16 dev eth0  scope link  metric 1000 
 +192.168.178.0/​24 dev eth0  proto kernel ​ scope link  src 192.168.178.33 ​ metric 1 
 +fritz@ubuntu:​~$ sudo ip route change default via 192.168.178.1 dev eth0 proto static initcwnd 1
 +fritz@ubuntu:​~$ ip route show
 +default via 192.168.178.1 dev eth0  proto static ​ initcwnd 1
 +169.254.0.0/​16 dev eth0  scope link  metric 1000 
 +192.168.178.0/​24 dev eth0  proto kernel ​ scope link  src 192.168.178.33 ​ metric 1 
 +fritz@ubuntu:​~$ ​
 +</​code>​
 +
 +=== TCP Congestion avoidance algorithm selection ===
 +
 +The linux kernel provides several algorithms for tcp congestion avoidance. The following code shows how to figure out the available algorithms (here cubic and reno) and set and control the setting. In this example the congestion avoidance algorithm is switched from "​cubic"​ to "​reno"​. ​
 +
 +<​code>​
 +fritz$ cd /​proc/​sys/​net/​ipv4/​
 +fritz$ cat tcp_available_congestion_control ​
 +cubic reno
 +fritz$ cat tcp_congestion_control ​
 +cubic
 +fritz$ sudo sh -c "echo reno > tcp_congestion_control"​
 +fritz$ cat tcp_congestion_control ​
 +reno
 +</​code>​
 +
 +
  
  • mscom_network_start.1396530282.txt.gz
  • Last modified: 2014/04/03 15:04
  • by beckmanf