Most of the networking code resides at user-level. The user-level code does two key things: managing routes/interfaces and implementing tcp/ip. The tcp/ip implementation is beyond the scope of this document. Usefull examples are in bin/webserver/httpd and bin/videod and the base tcp/ip library lib/xio.
bin/icmpd/icmpd.c is a fairly simple stand-along example of how to write network programs. It uses DPF, packet rings, routes, interfaces, and the packet sending interfaces.