Monitoring Network Packets Drops in Kernel
script examples
network profiling
examples of SystemTap scripts
network profiling
network profiling
examples of SystemTap scripts
probably http://sourceware.org/systemtap/examples/network/nettop.stp
profiling the network
examples of SystemTap scripts
network traffic, monitoring
examples of SystemTap scripts
tracepoint
The network stack in Linux
can discard packets for various reasons. Some Linux kernels include a
tracepoint, kernel.trace("kfree_skb"), which easily tracks where packets
are discarded. uses kernel.trace("kfree_skb") to trace
packet discards; the script summarizes which locations
discard packets every five-second interval.
dropwatch.stp
The kernel.trace("kfree_skb") traces which places
in the kernel drop network packets. The
kernel.trace("kfree_skb") has two arguments: a pointer to the
buffer being freed ($skb) and the location in kernel code the
buffer is being freed ($location).
Running the dropwatch.stp script 15 seconds would result in output similar in
. The output lists the number of misses for
tracepoint address and the actual address.
Sample Output
Monitoring for dropped packets
51 packets dropped at location 0xffffffff8024cd0f
2 packets dropped at location 0xffffffff8044b472
51 packets dropped at location 0xffffffff8024cd0f
1 packets dropped at location 0xffffffff8044b472
97 packets dropped at location 0xffffffff8024cd0f
1 packets dropped at location 0xffffffff8044b472
Stopping dropped packet monitor
To make the location of packet drops more meaningful, refer to the
/boot/System.map-`uname -r` file. This file lists the
starting addresses for each function, allowing you to map the
addresses in the output of to a specific
function name. Given the following snippet of the /boot/System.map-`uname -r` file,
the
address 0xffffffff8024cd0f maps to the function
unix_stream_recvmsg and the address 0xffffffff8044b472 maps
to the function arp_rcv:
[...]
ffffffff8024c5cd T unlock_new_inode
ffffffff8024c5da t unix_stream_sendmsg
ffffffff8024c920 t unix_stream_recvmsg
ffffffff8024cea1 t udp_v4_lookup_longway
[...]
ffffffff8044addc t arp_process
ffffffff8044b360 t arp_rcv
ffffffff8044b487 t parp_redo
ffffffff8044b48c t arp_solicit
[...]