Network performance analysis represents one of the most challenging aspects of Linux system monitoring due to numerous influencing factors including latency, congestion, collisions, and packet loss. External networking equipment such as routers, switches, and wireless interference further complicate diagnostics by introducing variables that are difficult to isolate from the host system.
Modern network interfaces operate in auto-negotiation mode, automaticallly adapting to different speeds and duplex settings based on connected devices. The ethtool utility provides detailed information about current network configuration:
# Display current network interface settings
ethtool eth0
To manually configure a network adapter to operate at a specific speed:
# Force interface to 1000Mbps full duplex
ethtool -s eth0 speed 1000 duplex full autoneg off
Traffic Analysis Tools
Real-time Bandwidth Monitoring
Interactive traffic visualization can be achieved using tools that measure throughput between systems. For continuous real-time monitoring of interface activity:
# Monitor ethernet interface traffic in real-time
iptraf -d eth0
Comprehensive Performance Testing
Network performence benchmarking requires client-server architecture tools like netperf. Initialize the server componant first:
# Start network performance server
netserver
Execute throughput measurements from the client side:
# Run 10-second TCP stream test
netperf -H target_ip -l 10
For transaction-based testing that measures request-response cycles:
# Test TCP request/response rate with custom buffer sizes
netperf -t TCP_RR -H target_ip -l 10 -- -r 2048,32768
Multi-point Bandwidth Assessment
Iperf provides similar functionality with enhanced interval reporting capabilities. Launch the server daemon:
# Start iperf server in background
iperf -s -D
Conduct time-series bandwidth sampling from client:
# Test for 30 seconds with 5-second intervals
iperf -c server_ip -t 30 -i 5
Packet-level Analysis
Deep packet inspection requires capture and post-processing tools. Capture raw network traffic for later analysis:
# Record all packets to binary file
tcpdump -w capture_file.pcap
Process captured data to extract connection statistics:
# Analyze packet capture file
tcptrace capture_file.pcap
Advanced filtering capabilities allow targeted investigation of problematic connections:
# Find connections with excessive retransmissions
tcptrace -f'rexmit_segs>100' capture_file.pcap
Detailed connection analysis for specific sessions:
# Generate detailed report for connection #10
tcptrace -o10 capture_file.pcap
Time-series analysis of network behavior:
# Create temporal segmentation data
tcptrace -xslice capture_file.pcap
The resulting slice data file contains timestamped metrics showing network activity patterns over time.