Ref: 11640120
Title: Broadcasting with TCP/IP
Date: 5/8/90

Copyright 3Com Corporation, 1991.  All rights reserved.

DEFINITIONS:

Limited Broadcast:   A packet sent to the IP address 255.255.255.255
                     or 0.0.0.0.  In a local broadcast packet, the
                     network identifer portion and host identifer
                     portion of the destination address is either all
                     1's (255.255.255.255) or all 0's (0.0.0.0)

Directed Broadcast:  A packet sent to a destination IP address where
                     only the host portion of the IP address is either
                     all 1's or all 0's (for example, 180.100.255.555 or
                     180.100.0.0)

Limited broadcasts should never pass through a router.  The only devices
limited broadcasts should ever traverse are repeaters and MAC layer
bridges.


NON-SUBNETTED ENVIRONMENT:

In an environment where subnetting is not being utilized, a directed
broadcast can traverse a router if the receiving router has a route to
the destination network (specified by the network portion of the IP
address.)  For example, suppose you have three class B networks tied
together like this (router interface names are in parentheses):


     Network X             Network Y             Network Z
     128.1.x.x             128.2.x.x             128.3.x.x
         |                     |                     |
         |                     |                     |
 Node1---|             Node2---|             Node3---|
128.1.5.8|            128.2.6.8|            128.3.7.8|
         |                     |                     |
         |                     |                     |
         | (RtrA1)             | (RtrB1)             |
         |128.1.5.1            |128.2.6.2            |
         |-------RouterA-------|-------RouterB-------|
         |            128.2.6.1|            128.3.7.1|
         |             (RtrA2) |             (RtrB2) |
         |                     |                     |
         |                     |                     |
 Node4---|             Node5---|             Node6---|
128.1.5.9|            128.2.6.9|            128.3.7.9|
         |                     |                     |
         |                     |                     |

Each of the routers knows about three networks (X, Y and Z.)  Consider
the following table which enumerates the recipients of various broadcast
datagrams.

   Sender  |  Destination IP Address  |  Recipients
------------------------------------------------------------
    Node1  |   255.255.255.255        |  Node1, Node4, RtrA1
    Node1  |   128.1.255.255          |  Node1, Node4, RtrA1
    Node1  |   128.2.255.255          |  Node2, Node5, RtrA2, RtrB1
    Node1  |   128.3.255.255          |  Node3, Node6, RtrB2
    Node2  |   255.255.255.255        |  Node2, Node5, RtrA2, RtrB1
    Node2  |   128.1.255.255          |  Node1, Node4, RtrA1
    Node2  |   128.2.255.255          |  Node2, Node5, RtrA2, RtrB1
    Node2  |   128.3.255.255          |  Node3, Node6, RtrB2
    Node3  |   255.255.255.255        |  Node3, Node6, RtrB2
    Node3  |   128.1.255.255          |  Node1, Node4, RtrA1
    Node3  |   128.2.255.255          |  Node2, Node5, RtrA2, RtrB1
    Node3  |   128.3.255.255          |  Node3, Node6, RtrB2



SUBNETTED ENVIRONMENT:

A directed broadcast can be sent to a specific subnet.  A directed
broadcast CANNOT be sent to ALL subnets.  To send a datagram to all subnets,
one would have to allow forwarding of limited broadcasts across a router.
Remember that a subnetwork is created by extending the network identifier
portion of the IP address into bit positions normally used for host
identification.  A limited broadcast is one where both the network
identifier portion of the broadcast address is all 1's or all 0's and the
host portion of the address is also all 1's or 0's.  However, in a subnetted
environment, for a broadcast datagram to be considered a directed broadcast,
the subnet bits that occupy positions that are normally part of the host
identifier CANNOT be all 1's or 0's.  For example, given a Class B address
with 8 bits of subnetting in the third octet and an IP network number of
128.1.<subnet>.<host>, a directed broadcast CANNOT be of the form
128.1.255.255, 128.1.0.255, 128.1.255.0, 128.1.0.0.

Using a modified version of the topology from above and assuming a
subnet mask of 255.255.255.0 (again 8 bits in the 3rd octet).  For some
nodes we will again look at a few broadcasts.

     Sub-Net 1             Sub-Net 2             Sub-Net 3
     128.1.1.x             128.1.2.x             128.1.3.x
         |                     |                     |
         |                     |                     |
 Node1---|             Node2---|             Node3---|
128.1.1.8|            128.1.2.8|            128.1.3.8|
         |                     |                     |
         |                     |                     |
         | (RtrA1)             | (RtrB1)             |
         |128.1.1.1            |128.1.2.2            |
         |-------RouterA-------|-------RouterB-------|
         |            128.1.2.1|            128.1.3.1|
         |             (RtrA2) |             (RtrB2) |
         |                     |                     |
         |                     |                     |
 Node4---|             Node5---|             Node6---|
128.1.1.9|            128.1.2.9|            128.1.3.9|
         |                     |                     |
         |                     |                     |

Each of the routers knows about three sub-networks (1, 2 and 3).  Consider
the following table which enumerates the recipients of various broadcast
datagrams.

   Sender  |  Destination IP Address  |  Recipients
------------------------------------------------------------
    Node1  |   255.255.255.255        |  Node1, Node4, RtrA1
    Node1  |   128.1.1.255            |  Node1, Node4, RtrA1
    Node1  |   128.1.2.255            |  Node2, Node5, RtrA2, RtrB1
    Node1  |   128.1.3.255            |  Node3, Node6, RtrB2
    Node2  |   255.255.255.255        |  Node2, Node5, RtrA2, RtrB1
    Node2  |   128.1.1.255            |  Node1, Node4, RtrA1
    Node2  |   128.1.2.255            |  Node2, Node5, RtrA2, RtrB1
    Node2  |   128.1.3.255            |  Node3, Node6, RtrB2
    Node3  |   255.255.255.255        |  Node3, Node3, RtrB2
    Node3  |   128.1.1.255            |  Node1, Node4, RtrA1
    Node3  |   128.1.2.255            |  Node2, Node5, RtrA2, RtrB1
    Node3  |   128.1.3.255            |  Node3, Node6, RtrB2

