-
Assuming we have two machines connected with Gigabit Ethernet interfaces, what is the maximum expected throughput in kilo-bytes?
-
For the following task you'll need two machines, or a partner:
Machine/s Command Notes A + B sar -n DEV 2Write down the receive/transmit packets/KB per-second. Keep this running for the entire length of the task A + B sar -n EDEV 2These are the error statistics, read about them in man 1 sar. Keep this running for the entire length of the taskA ip aWrite down A's IP address A iperf -sThis will start a server for our little benchmark B iperf -c <A's address> -t 30Start the benchmark client for 30 seconds A iperf -suReplace the previous TCP server with a UDP one B iperf -c 172.30.0.251 -u -b 1000M -l 8kRepeat the benchmark with UDP traffic - When running the client on B, use
sardata to determine A's link utilization (in %, assuming Gigabit Ethernet)? - What are the major differences between TCP and UDP traffic observable with
sar? - Start to decrease the UDP buffer length (ie. from
8kto4k,2k,1k,512,128,64).- Does the throughput in KB increase or decrease?
- What about the throughput in packets?
- Look carefully at the
iperfclient and server report. Can you see any packet loss? Can you also see them inifconfig?
- When running the client on B, use
While Linux provides multiple metrics for network errors including- collisions, errors, and packet drops, the kernel documentation indicates that these metrics meaning is driver specific, and tightly coupled with your underlying networking layers.
- Most tools use
/proc/net/devto fetch network device information.- For example, try running
sar -n DEV <interval> <count>
- For example, try running
- Connection information for TCP, UDP and raw sockets can be fetched using
/proc/net/tcp,/proc/net/udp,/proc/net/raw- For parsed socket information use
netstat -tuwnp-t,-u,-w: TCP, UDP and raw sockets-n: no DNS resolving-p: the process owning this socket
- For parsed socket information use
- The most comprehensive command-line utility is
netstat, covering metrics from interface statistics to socket information. - Check
iptraffor interactive traffic monitoring (no socket information) - Finally,
nethogsprovides atop-like experience, allowing you to find which process is taking up the most bandwidth (TCP only)
- What could be the reasons for packet drops? Which of these reasons can be measured on the receiving side?
- Why can't you see the
%ifutilvalue on EC2?- Hint: Network device speed is usually found in
/sys/class/net/<dev>/speed - Workaround: The
nicstatutility allows you to specify the speed and duplex of your network interface from the command line:nicstat -S eth0:1000fd -n 2
- Hint: Network device speed is usually found in