Interaction Between Neighboring Protocols and L3 Transmission Functions
We saw in Chapter
21 that packet transmission in the IPv4 subsystem ends with a call to ip_finish_output2, which passes the packet down to the L2
layer. In this section, we'll see how this function interacts with the neighboring
subsystem. The function that has a similar name and task within the IPv6 subsystem behaves
the same way, except that it calls the ND protocol instead of IPv4's ARP protocol.
The input skb buffer, ip_finish_output2, includes the packet data (but without an L2 header), along
with information such as the device to use for transmission and the routing table cache
entry (dst) that was used by the kernel to make the
forwarding decision. As we saw in Figure
27-1, that dst entry includes a pointer to the
neighbour entry associated with the next hop (which
can be either a router or the final destination itself). The decisions made by ip_finish_output2 that are of interest to us in this chapter
are summarized in Figure 27-12.
If a cached L2 header is available (hh is not
NULL), it is copied into the skb buffer. (skb->data points to the start of the user data, which is
where the L2 header should be placed.) Finally, hh_output is invoked.
If no cached L2 header is available, ip_finish_output2 invokes the neigh->output method. As explained earlier in this chapter, the precise
function associated with neigh->output depends on
the state of the neighbour entry. If the L2 address is ready, the function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access