OTS/9000 will always check to see if it has a Destination system entry
(either dynamically or statically created) for a given NSAP first. If no such
entry exists, it will try to determine which subnetwork the destination may
be reached on. This is accomplished using the Network ID field on the LAN
(802.3 or FDDI) subnetwork configuration screens. If the destination can be
reached on the LAN subnetwork, (the Network ID is matched) OTS will
either send the packet to an IS on the LAN, or, if no IS is present, use the
Query configuration function to resolve the route.
If OTS cannot determine the outgoing subnetwork, it then looks at the
configured routes to see if the destination NSAP matches one of the
configured Network IDs (the front portion of the NSAP matches the
Network ID). If a Network ID matches, the configured IS is used to route
information to the destination NSAP. Since Network IDs vary in length,
OTS will check them using a longest-length-first search order. For instance,
if two route entries have been created, 4901 and 490101, and the NSAP OTS
is trying to route to is 4901010001, the route associated with the Network ID
490101 will be selected.
More precisely, Network IDs are checked using a most-1-bits-in-mask
search. The route entries with the greatest number of 1s in their
route_id_mask are considered first. Since the default is to set the mask to a
string of Fs as long as the Network ID, this results in a longest-length-first
search. However, if you edit the ots_routes file directly and create custom
masks, you must keep the actual search algorithm in mind.