blank.gif (43 bytes)

Church Of The
Swimming Elephant

Search:
6.3. Pseudo-Algol Routing Algorithm Connected: An Internet Encyclopedia
6.3. Pseudo-Algol Routing Algorithm

Up: Connected: An Internet Encyclopedia
Up: Requests For Comments
Up: RFC 922
Up: 6. Gateways and Broadcasts
Prev: 6.2. Multi-subnet broadcasts
Next: 7. Broadcast IP Addressing - Conventions

6.3. Pseudo-Algol Routing Algorithm

6.3. Pseudo-Algol Routing Algorithm This is a pseudo-Algol description of the routing algorithm a gateway should use. The algorithm is shown in figure 1. Some definitions are:

      RouteLink(host)

         A function taking a host address as a parameter and returning
         the first-hop link from the gateway to the host.

      RouteHost(host)

         As above but returns the first-hop host address.

      ResolveAddress(host)

         Returns the hardware address for an IP host.

      IncomingLink

         The link on which the packet arrived.

      OutgoingLinkSet

         The set of links on which the packet should be sent.

      OutgoingHardwareHost

         The hardware host address to send the packet to.

      Destination.host

         The host-part of the destination address.

      Destination.subnet

         The subnet-part of the destination address.

      Destination.ipnet

         The IP-network-part of the destination address.

Figure 1: Pseudo-Algol algorithm for routing broadcasts by gateways

BEGIN
   IF Destination.ipnet IN AllLinks THEN
      BEGIN
         IF IsSubnetted(Destination.ipnet) THEN
            BEGIN
               IF Destination.subnet = BroadcastSubnet THEN
                  BEGIN      /* use Reverse Path Forwarding algorithm */
                     IF IncomingLink = RouteLink(Source) THEN
                        BEGIN IF Destination.host = BroadcastHost THEN
                              OutgoingLinkSet <- AllLinks -
                           IncomingLink;
                           OutgoingHost <- BroadcastHost;
                           Examine packet for possible internal use;
                        END
                     ELSE  /* duplicate from another gateway, discard */
                        Discard;
                  END
               ELSE
                  IF Destination.subnet = IncomingLink.subnet THEN
                     BEGIN           /* forwarding would cause a loop */
                        IF Destination.host = BroadcastHost THEN
                           Examine packet for possible internal use;
                        Discard;
                     END
                  ELSE BEGIN    /* forward to (possibly local) subnet */
                        OutgoingLinkSet <- RouteLink(Destination);
                        OutgoingHost <- RouteHost(Destination);
                     END
            END
         ELSE BEGIN         /* destined for one of our local networks */
               IF Destination.ipnet = IncomingLink.ipnet THEN
                  BEGIN              /* forwarding would cause a loop */
                     IF Destination.host = BroadcastHost THEN
                        Examine packet for possible internal use;
                     Discard;
                  END
               ELSE BEGIN                     /* might be a broadcast */
                     OutgoingLinkSet <- RouteLink(Destination);
                     OutgoingHost <- RouteHost(Destination);
                  END
            END
      END
   ELSE BEGIN                    /* forward to a non-local IP network */
         OutgoingLinkSet <- RouteLink(Destination);
         OutgoingHost <- RouteHost(Destination);
      END
   OutgoingHardwareHost <- ResolveAddress(OutgoingHost);
END


Next: 7. Broadcast IP Addressing - Conventions

Connected: An Internet Encyclopedia
6.3. Pseudo-Algol Routing Algorithm

Cotse.Net

Protect yourself from cyberstalkers, identity thieves, and those who would snoop on you.
Stop spam from invading your inbox without losing the mail you want. We give you more control over your e-mail than any other service.
Block popups, ads, and malicious scripts while you surf the net through our anonymous proxies.
Participate in Usenet, host your web files, easily send anonymous messages, and more, much more.
All private, all encrypted, all secure, all in an easy to use service, and all for only $5.95 a month!

Service Details

 
.
www.cotse.com
Have you gone to church today?
.
All pages ©1999, 2000, 2001, 2002, 2003 Church of the Swimming Elephant unless otherwise stated
Church of the Swimming Elephant©1999, 2000, 2001, 2002, 2003 Cotse.com.
Cotse.com is a wholly owned subsidiary of Packetderm, LLC.

Packetderm, LLC
210 Park Ave #308
Worcester, MA 01609