• Aucun résultat trouvé

5. INTERNET LAYER - FORWARDING

5.2 FORWARDING WALK-THROUGH

5.2.4 Determining the Next Hop Address

5.2.4.3 Next Hop Address

EDITOR’S COMMENTS:

Note that this section has been extensively rewritten. The original document indicated that Phil Almquist wished to revise this section to conform to his "Ruminations on the Next Hop" document. I am under the assumption that the working group generally agreed with this goal; there was an editor’s note from Phil that remained in this document to that effect, and the RoNH document contains a "mandatory RRWG algorithm".

So, I have taken said algorithm from RoNH and moved it into here.

Additional useful or interesting information from RoNH has been extracted and placed into an appendix to this note.

The router applies the algorithm in the previous section to determine if the Immediate Destination Address is adjacent. If so, the next hop address is the same as the Immediate

Destination Address. Otherwise, the packet must be forwarded through another router to reach its Immediate Destination. The selection of this router is the topic of this section.

If the packet contains an SSRR, the router MUST discard the packet and reply with an ICMP Bad Source Route error.

Otherwise, the router looks up the Immediate Destination Address in its routing table to determine an appropriate next hop address.

DISCUSSION:

Per the IP specification, a Strict Source Route must specify a sequence of nodes through which the packet must traverse;

the packet must go from one node of the source route to the next, traversing intermediate networks only. Thus, if the router is not adjacent to the next step of the source route, the source route can not be fulfilled. Therefore, the ICMP Bad Source Route error.

The goal of the next-hop selection process is to examine the entries in the router’s Forwarding Information Base (FIB) and select the best route (if there is one) for the packet from those available in the FIB.

Conceptually, any route lookup algorithm starts out with a set of candidate routes which consists of the entire contents of the FIB. The algorithm consists of a series of steps which discard routes from the set. These steps are referred to as Pruning Rules. Normally, when the algorithm terminates there is exactly one route remaining in the set. If the set ever becomes empty, the packet is discarded because the destination is unreachable. It is also possible for the algorithm to

terminate when more than one route remains in the set. In this case, the router may arbitrarily discard all but one of them, or may perform "load-splitting" by choosing whichever of the routes has been least recently used.

With the exception of rule 3 (Weak TOS), a router MUST use the following Pruning Rules when selecting a next hop for a packet.

If a router does consider TOS when making next-hop decisions, the Rule 3 must be applied in the order indicated below. These

rules MUST be (conceptually) applied to the FIB in the order that they are presented. (For some historical perspective, additional pruning rules, and other common algorithms in use, see Appendix E).

DISCUSSION:

Rule 3 is optional in that Section [5.3.2] says that a router only SHOULD consider TOS when making forwarding decisions.

(1) Basic Match

This rule discards any routes to destinations other than the Immediate Destination Address of the packet. For example, if a packet’s Immediate Destination Address is 36.144.2.5, this step would discard a route to net 128.12.0.0 but would retain any routes to net 36.0.0.0, any routes to subnet 36.144.0.0, and any default routes.

More precisely, we assume that each route has a destination attribute, called route.dest, and a

corresponding mask, called route.mask, to specify which bits of route.dest are significant. The Immediate Destination Address of the packet being forwarded is ip.dest. This rule discards all routes from the set of candidate routes except those for which (route.dest &

route.mask) = (ip.dest & route.mask).

(2) Longest Match

Longest Match is a refinement of Basic Match, described above. After Basic Match pruning is performed, the remaining routes are examined to determine the maximum number of bits set in any of their route.mask attributes.

The step then discards from the set of candidate routes any routes which have fewer than that maximum number of bits set in their route.mask attributes.

For example, if a packet’s Immediate Destination Address is 36.144.2.5 and there are {route.dest, route.mask}

pairs of {36.144.2.0, 255.255.255.0}, {36.144.0.5,

255.255.0.255}, {36.144.0.0, 255.255.0.0}, and {36.0.0.0, 255.0.0.0}, then this rule would keep only the first two pairs; {36.144.2.0, 255.255.255.0} and {36.144.0.5, 255.255.0.255}.

(3) Weak TOS

This algorithm has two distinct disadvantages. Presumably, a router implementor might develop techniques to deal with these disadvantages and make them a part of the Vendor Policy pruning rule.

(1) IS-IS and OSPF route classes are not directly handled.

(2) Path properties other than type of service (e.g. MTU) are ignored.

It is also worth noting a deficiency in the way that TOS is supported: routing protocols which support TOS are implicitly preferred when forwarding packets which have non-zero TOS values.

The Basic Match and Longest Match pruning rules generalize the treatment of a number of particular types of routes. These routes are selected in the following, decreasing, order of preference:

(1) Host Route: This is a route to a specific end system.

(2) Subnetwork Route: This is a route to a particular subnet of a network.

(3) Default Subnetwork Route: This is a route to all subnets of a particular net for which there are not (explicit) subnet routes.

(4) Network Route: This is a route to a particular network.

(5) Default Network Route (also known as the default route):

This is a route to all networks for which there are no explicit routes to the net or any of its subnets.

If, after application of the pruning rules, the set of routes is empty (i.e., no routes were found), the packet MUST be discarded and an appropriate ICMP error generated (ICMP Bad Source Route if the Immediate Destination Address came from a source route option; otherwise, whichever of ICMP Destination Host Unreachable or Destination Network Unreachable is

appropriate, as described in Section [4.3.3.1]).