XNSRouter.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, June 5, 1986 10:11:12 pm PDT
XNS routing is currently the same as Pup routing. It's 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 [Address, 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.Address, -- socket is null
time: CARDINAL ];
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 routine table entries with delay 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.
Fast: PROC [XNS.Net] RETURNS [yes: BOOL];
Phone lines aren't fast. Directly connected ethernets are.
}.