XNSRouter.mesa
Copyright Ó 1986, 1989, 1991 by Xerox Corporation. All rights reserved.
Demers, June 5, 1986 10:11:12 pm PDT
Tim Diebert: November 29, 1989 10:57:23 am PST
XNS routing is very simple: shortest path, each gateway counts as 1 hop. Each gateway periodically broadcasts its routing table. Each client selects the best path. Gateways use the same algorithim.
DIRECTORY
XNS USING [Net];
XNSRouter: CEDAR DEFINITIONS ~ {
Routing
maxHops: NAT ~ 15;
unreachable: NAT ~ maxHops+1;
Anything more than maxHops away is unreachable.
Hops: TYPE ~ [0..maxHops+1];
RoutingTableEntry: TYPE ~ RECORD [
hops: Hops, -- 0 => directly connected
immediate: XNS.Net, -- local net on which packets to a given remote net will be sent
delay: CARD -- estimated delay, msec
];
GetHops: PROC [XNS.Net] RETURNS [Hops];
GetRouting: PROC [XNS.Net] RETURNS [RoutingTableEntry];
Enumerate: PROC [low: Hops ¬ 0, high: Hops ¬ unreachable,
proc: PROC [XNS.Net, RoutingTableEntry] ];
Enumerate routing table entries with distance between low and high, inclusive, calling proc on each of them. Client may abort the enumeration by raising an exception in proc and catching it in the caller of Enumerate. It's okay for proc to send/receive packets.
}.