Neighbor subsystem of the linux protocol stack (overview 1)

  
 

One: Neighbor Subsystem Overview Neighbor subsystems are physically referred to as terminals in the same LAN. From the structure of the network topology, it means that the distance between them is only one hop, they belong to the same sub-domain neighbor subsystem: it provides address mapping for the Layer 3 protocol and the Layer 2 protocol. Provide neighbor header cache to speed up packet sending. Second: When the neighbor subsystem sends data in the whole protocol stack, it needs to perform route lookup on the local machine. If there is a path to the destination address, check whether there is a corresponding in the arp cache. Mapping relationship, if not, create a new neighbor item. Determine if the neighbor entry is available. If not available. Save skb to the neighbor send pair and send the arp request. If an arp response is received. The corresponding neighbor item is made available. If a response packet is received at the end of the specified time, the corresponding neighbor entry is set to an invalid state. If the neighbor changes to the available state, the data packet in the skb pair column corresponding to the neighbor entry is sent out three: the process overview; the delivery process. Let's take the udp data as an example to see how it is associated with the neighbor subsystem. Sendmsg() à ip_route_output() (to find the destination exit in the route cache) à ip_route_output_slow (if there is no destination in the cache, then Look in the routing table) à ip_build_xmit() à output_maybe_reroute à skb->dst->output() If the route is found at the time, assign a dst_entry according to the routing information, and call arp_bind_neighbour to bind the neighbor. The output pointer is assigned the value ip_output

go to execute ip_outputip_output à __ip_finish_output() -à ip_finish_output2() à dst->neighbour->output() now goes to the exit function of the neighbor item. Regarding the above detailed process, how will Neighbour->output be treated in the future? We look at the initialization time

Copyright © Windows knowledge All Rights Reserved