• Aucun résultat trouvé

5. INTERNET LAYER - FORWARDING

5.2 FORWARDING WALK-THROUGH

5.3.5 Forwarding of Internet Layer Broadcasts

There are two major types of IP broadcast addresses; limited broadcast and directed broadcast. In addition, there are three subtypes of directed broadcast; a broadcast directed to a

specified network, a broadcast directed to a specified subnetwork, and a broadcast directed to all subnets of a specified network.

Classification by a router of a broadcast into one of these categories depends on the broadcast address and on the router’s understanding (if any) of the subnet structure of the destination network. The same broadcast will be classified differently by different routers.

A limited IP broadcast address is defined to be all-ones: { -1, -1 } or 255.255.255.255.

A net-directed broadcast is composed of the network portion of the IP address with a local part of all-ones, { <Network-number>, -1 }. For example, a Class A net broadcast address is

net.255.255.255, a Class B net broadcast address is net.net.255.255 and a Class C net broadcast address is net.net.net.255 where net is a byte of the network address.

An all-subnets-directed broadcast is composed of the network part of the IP address with a subnet and a host part of all-ones, { <Network-number>, -1, -1 }. For example, an all-subnets broadcast on a subnetted class B network is net.net.255.255. A network must be known to be subnetted and the subnet part must be all-ones before a broadcast can be classified as all-subnets-directed.

A subnet-directed broadcast address is composed of the network and subnet part of the IP address with a host part of all-ones, { <Network-number>, <Subnet-number>, -1 }. For example, a directed broadcast to subnet 2 of a class B network might be net.net.2.255 (if the subnet mask was 255.255.255.0) or

net.net.1.127 (if the subnet mask was 255.255.255.128). A network must be known to be subnetted and the net and subnet part must not be all-ones before an IP broadcast can be classified as directed.

As was described in Section [4.2.3.1], a router may encounter certain non-standard IP broadcast addresses:

o 0.0.0.0 is an obsolete form of the limited broadcast address o { broadcast address.

o { broadcast address.

o { form of a subnet-directed broadcast address.

As was described in that section, packets addressed to any of these addresses SHOULD be silently discarded, but if they are not, they MUST be treated in accordance with the same rules that apply to packets addressed to the non-obsolete forms of the broadcast addresses described above. These rules are described in the next few sections.

5.3.5.1 Limited Broadcasts

Limited broadcasts MUST NOT be forwarded. Limited broadcasts MUST NOT be discarded. Limited broadcasts MAY be sent and SHOULD be sent instead of directed broadcasts where limited broadcasts will suffice.

DISCUSSION:

Some routers contain UDP servers which function by resending the requests (as unicasts or directed broadcasts) to other servers. This requirement should not be interpreted as prohibiting such servers. Note, however, that such servers can easily cause packet looping if misconfigured. Thus, providers of such servers would probably be well-advised to document their setup carefully and to consider carefully the TTL on packets which are sent.

5.3.5.2 Net-directed Broadcasts

A router MUST classify as net-directed broadcasts all valid, directed broadcasts destined for a remote network or an attached nonsubnetted network. A router MUST forward directed broadcasts. Net-directed broadcasts MAY be sent.

A router MAY have an option to disable receiving net-directed broadcasts on an interface and MUST have an option to disable forwarding net-directed broadcasts. These options MUST default to permit receiving and forwarding net-directed broadcasts.

DISCUSSION:

There has been some debate about forwarding or not

forwarding directed broadcasts. In this memo we have made the forwarding decision depend on the router’s knowledge of the subnet mask for the destination network. Forwarding decisions for subnetted networks should be made by routers with an understanding of the subnet structure. Therefore, in general, routers must forward directed broadcasts for networks they are not attached to and for which they do not understand the subnet structure. One router may interpret and handle the same IP broadcast packet differently than another, depending on its own understanding of the structure of the destination (sub)network.

5.3.5.3 All-subnets-directed Broadcasts

A router MUST classify as all-subnets-directed broadcasts all valid directed broadcasts destined for a directly attached subnetted network which have all-ones in the subnet part of the address. If the destination network is not subnetted, the broadcast MUST be treated as a net-directed broadcast.

A router MUST forward an all-subnets-directed broadcast as a link level broadcast out all physical interfaces connected to the IP network addressed by the broadcast, except that:

o A router MUST NOT forward an all-subnet-directed broadcast that was received by the router as a Link Layer broadcast, unless the router is forwarding the broadcast in accordance with [INTERNET:3] (see below).

o If a router receives an all-subnets-directed broadcast over a network which does not indicate via Link Layer framing whether the frame is a broadcast or a unicast, the packet MUST NOT be forwarded to any network which likewise does not indicate whether a frame is a broadcast.

o A router MUST NOT forward an all-subnets-directed broadcast if the router is configured not to forward such broadcasts.

A router MUST have a configuration option to deny forwarding of all-subnets-directed broadcasts. The configuration

option MUST default to permit forwarding of directed broadcasts.

EDITOR’S COMMENTS:

The algorithm presented here is broken. The working group explicitly desired this algorithm, knowing its failures.

The second bullet, above, prevents All Subnets Directed Broadcasts from traversing more than one PPP (or other

serial) link in a row. Such a topology is easily conceived.

Suppose that some corporation builds its corporate backbone out of PPP links, connecting routers at geographically dispersed locations. Suppose that this corporation has 3 sites (S1, S2, and S3) and there is a router at each site (R1, R2, and R3). At each site there are also several LANs connected to the local router. Let there be a PPP link connecting S1 to S2 and one connecting S2 to S3 (i.e. the links are R1-R2 and R2-R3). So, if a host on a LAN at S1 sends a All Subnets Directed Broadcast, R1 will forward the broadcast over the R1-R2 link to R2. R2 will forward the

broadcast to the LAN(s) connected to R2. Since the PPP does not differentiate broadcast from non-broadcast frames, R2 will NOT forward the broadcast onto the R2-R3 link.

Therefore, the broadcast will not reach S3.

[INTERNET:3] describes an alternative set of rules for

forwarding of all-subnets-directed broadcasts (called subnet-broadcasts in that document). A router MAY IMPLEMENT that alternative set of rules, but MUST use the set of rules described above unless explicitly configured to use the [INTERNET:3] rules. If routers will do [INTERNET:3]-style forwarding, then the router MUST have a configuration option which MUST default to doing the rules presented in this document.

DISCUSSION:

As far as we know, the rules for multi-subnet broadcasts described in [INTERNET:3] have never been implemented, suggesting that either they are too complex or the utility of multi-subnet broadcasts is low. The rules described in this section match current practice. In the future, we expect that IP multicast (see [INTERNET:4]) will be used to better solve the sorts of problems that multi-subnets

broadcasts were intended to address.

We were also concerned that hosts whose system managers neglected to configure with a subnet mask could

unintentionally send multi-subnet broadcasts.

A router SHOULD NOT originate all-subnets broadcasts, except as required by Section [4.3.3.9] when sending ICMP Address Mask Replies on subnetted networks.

DISCUSSION:

The current intention is to decree that (like 0-filled IP broadcasts) the notion of the all-subnets broadcast is obsolete. It should be treated as a directed broadcast to the first subnet of the net in question that it appears on.

Routers may implement a switch (default off) which if turned on enables the [INTERNET:3] behavior for all-subnets

broadcasts.

If a router has a configuration option to allow for

forwarding all-subnet broadcasts, it should use a spanning tree, RPF, or other multicast forwarding algorithm (which may be computed for other purposes such as bridging or OSPF)

to distribute the all-subnets broadcast efficiently. In general, it is better to use an IP multicast address rather than an all-subnets broadcast.

5.3.5.4 Subnet-directed Broadcasts

A router MUST classify as subnet-directed broadcasts all valid directed broadcasts destined for a directly attached subnetted network in which the subnet part is not all-ones. If the destination network is not subnetted, the broadcast MUST be treated as a net-directed broadcast.

A router MUST forward subnet-directed broadcasts.

A router MUST have a configuration option to prohibit

forwarding of subnet-directed broadcasts. Its default setting MUST permit forwarding of subnet-directed broadcasts.

A router MAY have a configuration option to prohibit forwarding of subnet-directed broadcasts from a source on a network on which the router has an interface. If such an option is provided, its default setting MUST permit forwarding of subnet-directed broadcasts.