During simulations, processor models reference the routing tables to send messages through the simulated networks. Building a routing table prior to simulation is more efficient than searching for pathways at runtime, because it finds all the paths once, instead of repetitively.
This ROUTER is based on a breadth-first version of the Dijkstra shortest distance search algorithm. It is efficient, rapid, and general-pupose.
Several heuristical improvements have been incorporated to balance usage of network resources. The ROUTER keeps track of how many paths have used each link. When two otherwise-equivalent pathways are found between PE's, the ROUTER chooses the least used path. This avoids the pathological case of mapping all routes to only one of multiple equidistant paths.
After determining the routing table, the ROUTER produces a usage summary of statistics on how well the paths were balanced. It shows what links, if any, were not used in any path; what links were used by the most paths (potential hot-spots); and the average, peak, and minimum the number of paths using a given link.
For many uses and architectures, the paths found by the automatic router are sufficient without further optimization. However for special cases, the resulting routing table can be manually edited. It is produced in an easy-to-read ASCII format. The ROUTER utility is a convenient starting-point for building optimal routing tables.
Example:
Example:
Example:
This produces the netinfo.rte file containing the routing table.
ROUTE_TABLE[ source, destination, hop ]
The pathway from each source device to each destination device is listed in the routing table as follows:
alt src_dev - dst_dev : x1 x2 x3 x4 x5This line specifies that the sequence of ports to pass-through to send a message from src_dev to dst_dev is {x1 x2 x3 x4 x5}, where x1 x2 x3 x4 x5 are the respective port numbers on the intermediate network elements. The first item on the line, alt, is the alternate path number. The primary path from a given source to a given destination is alternate path 0. If there are multiple pathways between a given source and destination, the alternate paths can be listed with lines having distinct alternate path numbers. Alternate pathways are described further below.
The entry can be interpreted as,
To send a message from src_dev to dst_dev, go through port x1, then port x2, ... and finally through port x5.
router -alt 5 netinfofinds as many as five (5) alternate paths, if they exist.
The ROUTER generates a routing table containing four (4) indices, which can be thought of conceptually as the following multi-dimensional array:
ROUTE_TABLE[ alternate, source, destination, hop ]
The corresponding entry in the routing table for the hops in the given path, from a source, and to a destination is listed in the routing table as:
alternate src_dev - dst_dev : x1 x2 x3 x4 x5The ROUTER orders the paths found according to their distance goodness or in other words, routing-cost. For example, if the ROUTER is instructed to find the 5-best paths, and for a given source-destination pair it finds:
The link-costs can be specified with the CSIM GUI. The cost is specifiable individually for each direction on each link. If the cost is identical in both directions, you only need to enter one number. If it is non-symmetrical, specify the two costs with a space between them.
The link costs can be used to control the routing-paths chosen. For example, you may wish to avoid a particular link from being used. Then set its routing-cost to infinity (a large number). Conversely, you may not want an intermediate link to be considered as part of the routing-cost. Then set its cost to zero.
There are various ways to create custom routing tables. One way is to edit the routing-table file directly, since it is editable. However, this is usually very tedious because routing files can be very large. Another way is to write an adhoc program that explicitly writes the routings you wish to use for your architecture. However, we will look at a more automatic method that exploits spoofing the router by editing the netinfo file. This is much more managable than editing the routing-table.
Because the router is a drone that simply finds the shortest way to get from point A to point B in any arbitrary network, there are often convenient and clever ways to trick the router to produce just the routes you want.
For example, in the control/data example above, if you want all control messages to flow over a VME bus, but no application data should flow over the VME bus. Then create two copies of the netinfo file. Call them: netinfo_Control and netinfo_Data. To avoid the data messages from traversing the VME bus, remove the VME bus from the netinfo_Data file and run the ROUTER on it instead of the original netinfo file. Because you have broken the VME path, the router will find alternate pathways through which to route all data-messages.
A convenient way of removing unique keywords is through the grep -v command which returns all lines from a file except those that contain a specified search-string. For example,
grep -v VME netinfo > netinfo_Datawould build the netinfo_Data file. Such procedures can be put into a Make.com command script for automatically configuring the routing files whenever you change your model architecture.
Likewise, dedicated pathways for the control messages can be forced by cutting any critical links that would otherwise provide shorter paths through links that are to be data-dedicated. Note that not-all the data-dedicated paths need to be cut as long as there is a shorter control-path to get to the same place. The router will simply ignore any paths that are longer.
Devices that can not be used as a source or destination, may be classified as such, thus reducing the size of the routing file. To classify a device as a non-source, non-destination or as both a non-source and destination, insert one of the following lines in the device behavioral description following the line
DEFINE_DEVICE_TYPE: <device_type> DEVICE_CLASS=(nosource); DEVICE_CLASS=(nodest); DEVICE_CLASS=(nosrcdst);
Path 233 586 0: <233 4> <231 3> ... <45 2>
The tags in this format are easily parsed by user-scripts. For example, you can search for
any route which ran through, say, device <231 and device < 45,
and then, perhaps substitute a preferred route-segment for that segment of the route.
When invoked, this option prints a message telling you the name of the file it saves
the explicit format to, such as netinfo.fullpath.
Note that the fullpath file is approximately four times (4x) larger than the normal (.rte) routing file, due to the extra tag-characters and device numbers for each hop in the paths.
The syntax is:
Path #1 #2 #3: <#4 #5> ... <#6 #7>Where:
#1 = Source device number. #2 = Destination device number. #3 = Alternate path number. #4 = First device in path (same as #1). #5 = First port number in path. ... = All the intermediate hops. #6 = Last device hop in path (same as #2). #7 = Last port number in path.
Note that path-hops through un-numbered ports of devices, which do not apear in the normal .rte files, will appear in the fullpaths file, but with negative port-numbers. The negative value is a place-holder for indicating an otherwise un-numbered port.
If you alter the paths in the netinfo.fullpaths file, you can translate the format back to the normal .rte format with the translate_paths.c program.