Transition to the Network Access Layer

Figure 12-19 shows the code flow diagram of the ip_output function that splits the route into two parts, depending on whether a packet needs to be fragmented or not.

19A different output routine is used when, for example, IP packets are tunneled inside IP packets. This is a very special application that is rarely needed.

20Generation of IP checksums is time-critical and can be highly optimized by modern processors. For this reason, the various architectures provide fast assembly language implementations of their own in ip_fast_csum.

Figure 12-19: Code flow diagram for ip_output.

First of all, the netfilter hook nf_ip_post_routing is called, followed by ip_finish_output. I first examine the situation in which the packet fits into the MTU of the transmission medium and need not be fragmented. In this case, ip_finish_output2 is directly invoked. The function checks whether the socket buffer still has enough space for the hardware header to be generated. If necessary, skb_realloc_headroom adds extra space. To complete transition to the network access layer, the dst->neighbour->output function set by the routing layer is invoked, normally using dev_queue_xmit .21

Continue reading here: Packet Fragmenting

Was this article helpful?

0 0