Is there a good overview of tcp data path in Linux (2.6, not 2.4 if the path actually differ)? Where is a packet on different stages of tcp/ip stack handling?
How packet is packed to tcp segment, then ip packet. How it is transmitted to network card? (with series of I/O regs write and DMA?) Is it transmitted to network card in the “write” syscall handler (with some deep callstack) or is it transmitted at some other moment?
http://www.linuxfoundation.org/collaborate/workgroups/networking/kernel_flow
I think this is what you want. It shows the process all the way from sendmsg() to dev_hard_start_xmit(), which is where the net stack passes the packet off to the NIC driver.