[[mscom_network_start]]

This is an old revision of the document!


Details for traffic shaping are in http://lartc.org.

Details regarding tcp testing are here: http://www.linuxfoundation.org/collaborate/workgroups/networking/tcp_testing.

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 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.

Setup a server on one computer

iperf -s

Run a client on a second computer. The client will send data to the server.

iperf -c SERVERIP -i 1

Option -i will show intermediate bandwidth results every second.

In the following example an additional 100 ms delay to the outgoing traffic is added.

sudo tc qdisc add dev eth0 root netem delay 100ms

Show the current traffic shaper

tc qdisc show

Remove a traffic shaper

sudo tc qdisc del dev eth0 root

For limiting the bandwidth a token bucket shaper can be used. In the example below the packet is delayed by 100 ms with the netem shaper and the goes to the token bucket shaper. See http://lartc.org/howto/lartc.qdisc.classless.html#AEN690.

sudo tc qdisc add dev eth0 root handle 1: netem delay 100ms
sudo tc qdisc add dev eth0 parent 1:1 handle 10: tbf rate 256kbit buffer 1600 limit 300
tc -s qdisc

Ethernet card parameters can be configured with ethtool.

fritz@ubuntu:~$ ethtool eth0
Settings for eth0:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: off
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
fritz@ubuntu:~$ 

ethtool DEVICENAME will show you the current settings of the ethernet card. In the example above the link speed is for example 1GBit/s. In order to modify the speed settings and set it to 100 MBit/s full duplex mode do:

sudo ethtool -s eth0 speed 100 duplex full

Modern network cards can do TCP segmentation in hardware. This is called TCP segmentation offloading (TSO), which offloads the packet segmentation from the cpu. To show the offload parameters do:

fritz@ubuntu:~$ ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: off
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off
rx-vlan-offload: on
tx-vlan-offload: on
ntuple-filters: off
receive-hashing: off
fritz@ubuntu:~$ 

In the example above the tcp segmentation offloading is activated. This will result in wireshark showing longer TCP packets than allowed according to Maximum Transmit Unit size (MTU) which is typically 1500 Bytes. You can check the MTU value with “ifconfig”.

In order to switch TSO offloading off, you can do

sudo ethtool -K eth0 tso off
  • mscom_network_start.1396530767.txt.gz
  • Last modified: 2014/04/03 15:12
  • by beckmanf