📄 rfc1433.txt
字号:
Garrett, Hagan & Wong [Page 6]RFC 1433 Directed ARP March 1993 the ARP Request. But if the Target IP address is not the router's address, the router may forward the ARP Request back through the same interface it was received from, addressed to a Link Level Address that corresponds to an ARP Helper Address in the router's routing table. The procedures used to process an ARP Request are described via C pseudo-code below. The function Receive() describes procedures followed by hosts and routers, and the function Direct() describes additional procedures followed by routers. In addition, the following low level functions are also used: Is_Local_IP_Add(IP_Add,Phys_Int) returns TRUE if Phys_Int has been assigned IP address, IP_Add. Otherwise, returns FALSE. Do_ARP_Processing(ARP_Request,Interface) processes ARP_Request using ARP procedures described in [2]. I_Am_Router returns TRUE if device is a router and False if device is a host. Target_IP(ARP_Request) returns the Target IP address from ARP_Request. Filter(ARP_Request,Phys_Int) returns TRUE if ARP_Request passes filtering constraints, and FALSE if filtering constraints are not passed. See section 3.4. Forward(Packet,Link_Level_Add,Phys_Int) fragments Packet (if needed), and encapsulates Packet in one or more Link Level Frames addressed to Link_Level_Add, and forwards the frame(s) through interface, Phys_Int. Look_Up_Next_Hop_Route_Table(IP_Add) returns a pointer to the routing table entry with the next-hop field that matches IP_Add. If no matching entry is found, NULL is returned. Look_Up_Dest_Route_Table(IP_Add) returns a pointer to the routing table entry with the destination field that best matches IP_Add. If no matching entry is found, NULL is returned. Link_Level_ARP_Req_Add(IP_Add,Phys_Int) returns the link level address to which an ARP Request to resolve IP_Add should be forwarded. If ARP is not used to perform local address resolution of IP_Add, NULL is returned. Local_Add_Res(IP_Add,Phys_Int) returns a pointer to the Link Level address associated with IP_Add, using address resolution procedures associated with address, IP_Add, and interface, Phys_Int. If address resolution is unsuccessful, NULL isGarrett, Hagan & Wong [Page 7]RFC 1433 Directed ARP March 1993 returned. Note that different address resolution procedures may be used for different IP networks. Next_Hop(Entry) returns the IP address in the next-hop field of (routing table) Entry. Interface(Entry) returns the physical interface field of (routing table) Entry. ARP_Helper_Add(Entry) returns the IP address in the ARP Helper Address field of (routing table) Entry. Source_Link_Level(ARP_Request) returns the link level address of the sender of ARP_Request. Receive(ARP_Request,Interface) { If (Is_Local_IP_Add(Target_IP(ARP_Request),Interface)) Do_ARP_Processing(ARP_Request,Interface); else /* Not my IP Address */ If (I_Am_Router) /* Hosts don't Direct ARP Requests */ If (Filter(ARP_Request,Interface)) /* Passes Filter Test */ /* See Section 3.4 */ Direct(ARP_Request,Interface); /* Directed ARP Procedures */ Return; } Figure 3: C Pseudo-Code for Receiving ARP Requests.Garrett, Hagan & Wong [Page 8]RFC 1433 Directed ARP March 1993 Direct(ARP_Request,Phys_Int) { Entry = Look_Up_Next_Hop_Route_Table(Target_IP(ARP_Request)); If (Entry == NULL) /* Target_IP Address is not a next-hop */ { /* in Routing Table */ Entry = Look_Up_Dest_Route_Table(Target_IP(ARP_Request)); If (Entry == NULL) /* Not a destination either */ Return; /* Discard ARP Request */ else If (Next_Hop(Entry) != NULL) /* Not a next-hop and Not local */ Return; /* Discard ARP Request */ } If (Interface(Entry) != Phys_Int) /* Must be same physical interface */ Return; /* Discard ARP Request */ If (ARP_Helper_Add(Entry) != NULL) { L_L_ARP_Helper_Add = Resolve(ARP_Helper_Add(Entry),Phys_Int,NULL); If (L_L_ARP_Helper_Add != NULL) Forward(ARP_Request,L_L_ARP_Helper_Add,Phys_Int); /* Forward ARP_Request to ARP Helper Address */ Return; } else /* Do local address resolution. */ { L_L_ARP_Req_Add = Link_Level_ARP_Req_Add(Target_IP(ARP_Request),Phys_Int); If (L_L_ARP_Req_Add != NULL) { /* Local address resolution procedure is ARP. */ /* Forward ARP_Request. */ Forward(ARP_Request,L_L_ARP_Req_Add,Phys_Int); Return; } else { /* Local address resolution procedure is not ARP. */ /* Do "published ARP" on behalf of Target IP Address */ Target_Link_Level = Local_Add_Res(Target_IP(ARP_Request),Phys_Int); If (Target_Link_Level != NULL) /* Resolved Address */ { Forward(ARP_Response,Source_Link_Level(ARP_Request),Phys_Int); } Return; } } } Figure 4: C Pseudo_Code for Directing ARP Requests.Garrett, Hagan & Wong [Page 9]RFC 1433 Directed ARP March 19933.4 Filtering Procedures A router performing Directed ARP procedures must filter the propagation of ARP Request packets to constrain the scope of potential "ARP floods" caused by misbehaving routers or hosts, and to terminate potential ARP loops that may occur during periods of routing protocol instability or as a result of inappropriate manual configurations. Specific procedures to filter the propagation of ARP Request packets are beyond the scope of this document. The following procedures are suggested as potential implementations that should be sufficient. Other procedures may be better suited to a particular implementation. To control the propagation of an "ARP flood", a router performing Directed ARP procedures could limit the number of identical ARP Requests (i.e., same Source IP address and same Target IP address) that it would forward per small time interval (e.g., no more than one ARP Request per second). This is consistent with the procedure suggested in [5] to prevent ARP flooding. Forwarding of ARP Request packets introduces the possibility of ARP loops. The procedures used to control the scope of potential ARP floods may terminate some ARP loops, but additional procedures are needed if the time required to traverse a loop is longer than the timer used to control ARP floods. A router could refuse to forward more than N identical ARP Requests per T minutes, where N and T are administered numbers. If T and N are chosen so that T/N minutes is greater than the maximum time required to traverse a loop, such a filter would terminate the loop. In some cases a host may send more than one ARP Request with the same Source IP address,Target IP address pair (i.e., N should be greater than 1). For example, the first ARP Request might be lost. However, once an ARP Response is received, a host would normally save the associated information, and therefore would not generate an identical ARP Request for a period of time on the order of minutes. Therefore, T may be large enough to ensure that T/N is much larger than the time to traverse any loop. In some implementations the link level destination address of a frame used to transport an ARP Request to a router may be available to the router's Directed ARP filtering process. An important class of simple ARP loops will be prevented from starting if a router never forwards an ARP Request to the same link level address to which the received ARP Request was addressed. Of course, other procedures such as the one described in the paragraph above will stop all loops, and are needed, even if filters are implemented that prevent some loops from starting.Garrett, Hagan & Wong [Page 10]RFC 1433 Directed ARP March 1993 Host requirements [5] specify that "the packet receive interface between the IP layer and the link layer MUST include a flag to indicate whether the incoming packet was addressed to a link-level broadcast address." An important class of simple ARP floods can be eliminated if routers never forward ARP Requests that were addressed to a link-level broadcast address.4. Use of Directed ARP by Routing The exchange and use of routing information is constrained by available address resolution procedures. A host or router can not use a next-hop IP address learned via dynamic routing procedures if it is unable to resolve the next-hop IP address to the associated link level address. Without compatible dynamic address resolution procedures, a router may not advertise a next-hop address that is not on the same IP network as the host or router receiving the advertisement. Directed ARP is a procedure that enables a router that advertises routing information to make the routing information useful by also providing assistance in resolving the associated next-hop IP addresses. The following subsections describe the use of Directed ARP to expand the scope of ICMP Redirects [6], distance-vector routing protocols (e.g., BGP [3]), and link-state routing protocols (e.g., OSPF [4]).4.1 ICMP Redirect If a router forwards a packet to a next-hop address that is on the same link level network as the host that originated the packet, the router may send an ICMP Redirect to the host. But a host can not use a next-hop address advertised via an ICMP Redirect unless the host has a procedure to resolve the advertised next-hop address to its associated link level address. Directed ARP is a procedure that a host could use to resolve an advertised next-hop address, even if the host does not have an address on the same IP network as the advertised next-hop address. A host that implements Directed ARP procedures includes an ARP Helper Address with each routing table entry. The ARP Helper Address associated with an entry learned via an ICMP Redirect is NULL if the associated next-hop address matches a routing table entry with a NULL next-hop and a NULL ARP Helper Address (i.e., the host already knows how to resolve the next-hop address). Otherwise, the ARP Helper Address is the IP address of the router that sent the ICMP Redirect. Note that the router that sent the ICMP Redirect is the current next-hop to the advertised destination [5]. Therefore, the host should have an entry in its address resolution table for the new ARP Helper Address. If the host is unable to resolve the next-hop IPGarrett, Hagan & Wong [Page 11]RFC 1433 Directed ARP March 1993 address advertised in the ICMP Redirect (e.g., because the associated ARP Helper Address is on a foreign IP network; i.e., was learned via an old ICMP Redirect, and the address resolution table entry for that ARP Helper Address timed out), the host must flush the associated routing table entry. Directed ARP procedures do not recursively use Directed ARP to resolve an ARP Helper Address. A router that performs Directed ARP procedures might advertise a foreign next-hop to a host that does not perform Directed ARP. Following existing procedures, the host would silently discard the ICMP Redirect. A router that does not implement Directed ARP should not advertise a next-hop on a foreign IP network, as specified by existing procedures. If it did, and the ICMP Redirect was received by a host that implemented Directed ARP procedures, the host would send an ARP Request for the foreign IP address to the advertising router, which would silently discard the ARP Request. When address resolution fails, the host should flush the associated entry from its routing table. For various reasons a host may ignore an ICMP Redirect and may continue to forward packets to the same router that sent the ICMP Redirect. For example, a host that does not implement Directed ARP procedures would silently discard an ICMP Redirect advertising a next-hop address on a foreign IP network. Routers should implement constraints to control the number of ICMP Redirects sent to hosts. For example, a router might limit the number of repeated ICMP Redirects sent to a host to no more than N ICMP Redirects per T minutes, where N and T are administered values.4.2 Distance Vector Routing Protocol A distance-vector routing protocol provides procedures for a router to advertise a destination address (e.g., an IP network), an associated next-hop address, and other information (e.g., associated metric). But a router can not use an advertised route unless the router has a procedure to resolve the advertised next-hop address to its associated link level address. Directed ARP is a procedure that a router could use to resolve an advertised next-hop address, even if the router does not have an address on the same IP network as the advertised next-hop address. The following procedures assume a router only accepts routing updates if it knows the IP address of the sender of the update, can resolve the IP address of the sender to its associated link level address, and has an interface on the same link level network as the sender. A router that implements Directed ARP procedures includes an ARP Helper Address with each routing table entry. The ARP Helper AddressGarrett, Hagan & Wong [Page 12]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -