Neighboring Subsystem

来源:互联网 发布:js style属性值 编辑:程序博客网 时间:2024/05/22 10:55

The terms L2 address, hardware address, MAC address are commonly used to refer to the same concept.

A host is your neighbor if it is connected to the same LAN (i.e., you are directly connected to it through either a shared medium or a point-to-point link) and it is configured on the same L3 network.

Hosts that are not neighbors must communicate through a gateway or router.

The neighboring protocol chooses the L2 address corresponding to the L3 address in the packet.

To keep changes isolated from both the L2 and L3 layers, a protocol is needed to manage the association of L3 to L2 addresses. That is the neighboring protocol.

Sometimes there is no need for any protocol to resolve the L3 address to an L2 address. These cases include the following:

  1. There is only one host that data can be sent to on a point-to-point medium, such as a dial-up connection or a cable connecting a system temporarily to one that an administrator wants to monitor. Here, there is no addressing scheme at all at the L2 level. (However, even point-to-point media use L2 addresses in some contexts.)
  2. There may be special L3 addresses whose associated L2 addresses can be obtained with a simple formula; because there is no ambiguity and no dynamic allocation, no protocol is needed.
  3. Multicast addresses can be statically translated without any protocol. On IPv4/ARPnetworks, multicast addresses are resolved without any protocol, as explained here:
    1. The most-significant 24 bits are assigned the static value 01:00:5E allocated by IANA.
    2. Bit 23 (the most-significant bit of the lower 24) is set to 0.
    3. The least-significant 23 bits are copied from the least-significant 23 bits of the IP address.
    Note that the same Ethernet multicast address can be assigned to multiple IP addresses (because the most-significant 9 bits of the IP address are not used).

  4. Broadcast addresses (IPsubnet broadcasts) are statically resolved to the link layer broadcast address (FF:FF:FF:FF:FF:FF for Ethernet). The L2 broadcast address of each device can also be explicitly configured, if needed.

When transmitting a packet, the following steps take place:


  1. The routing subsystem of the local host selects the L3 destination address (the next hop).
  2. If according to the routing table, this hop is on the same network (if, that is, the next hop is a neighbor), the neighboring layer resolves the destination’s L3 address to its L2 address. This association is cached for future use. Thus, if one application sends several packets of data in a short amount of time to another application, the  neighboring protocol is used only once, to send the first packet.
  3. Eventually, a function such as dev_queue_xmit takes care of the transmission, handing the packet to the Traffic Control or Quality of Service (QoS) layer.

Two protocols are in use in IPnetworks today. The vast majority of systems use ARP with IPv4. A more general-purpose protocol called Neighbor Discovery (ND) was developed for IPv6.

the factors that lead a host to send out a solicitation request:

the most-common factors that determine whether a request is processed by the Linux host that receives it:

When bridging is enabled, solicitation requests are not processed by the receiving host, but are instead forwarded (bridged) to the right interfaces according to the bridging configuration. Bridging takes place before the neighboring protocol has a chance to look at the ingress packets. In other words, as the figure shows, bridging is handled before proxying in the Linux implementation of handling solicitation requests.

Neighbor States and Network Unreachability Detection (NUD)

L3-to-L2 address resolution steps

States of an L3-to-L2 mapping


0 0
原创粉丝点击