This is an old revision of the document!


03. [??p] Packets, where are you?

Earlier in Ex. 1, we mentioned that eBPF is used for more than traffic filtering. Some of you may have heard of the eXpress Data Path (XDP) or the more recent eXpress Resubmission Path (XRP). Both of these are eBPF-powered shunts of kernel data paths that are used to optimize the system for very specific types of workloads. We'll return to these in a future lecture (and maybe a lab as well) since they can be considered advanced topics. For now, we'll focus on the third purpose eBPF can serve: execution tracing.

pwru is a tool created by Cilium to help trace network packets in the kernel's network stack and debug network connectivity issues. It does this by attaching simple eBPF programs to certain function entry points. These programs can report back to a userspace process different kinds of information, including the function that was reached, the arguments that were passed, and a CPU clock timestamp. The method used for instrumenting kernel code is based on kprobes. Ask your assistant for more information.

The Task(s)

Install pwru on your system. Check that the minimum requirements stated on the Github page are met. Note that this tool is already provided by some public package repos (e.g.: pacman: extra/).

Now, trace all outgoing DNS queries to the Google DNS (i.e.: 8.8.8.8) and perform one using dig. Analyze the call path in the kernel network stack. Explain each step of the packet's journey. Also, add relative timestamps to each entry in the generated trace, to get an idea what the computational cost of each operation actually is. Check out this map of the kernel subsystems, but note that the best source of information is always RTFS.

Be careful of local DNS caches, especially on Ubuntu.

Finally, insert an iptables rule on the OUTPUT chain that drops DNS queries to 8.8.8.8. Check where the packet's path is cut short.

ep/labs/04/contents/tasks/ex3.1698605085.txt.gz ยท Last modified: 2023/10/29 20:44 by radu.mantu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0