A router entry indicates a type of router, gives its routing table, and sets the number of router buffers. Routers can output several different kinds of trace information, and the type and amount of tracing is specified here too. The format of the entry is:
router <type> <name>; rtable = <destination> <next hop>, <destination> <next hop>,... ; args = <arg>, <arg>, ... ;
The router line specifies the type of network. Only one type is supported at present: FCFS. The router's name must match that used in the net entry.
The rtable line specifies the routing table. The
destination is the network portion of a packet's IP address and the next hop is where the router should send a packet with that network destination. If the next hop has no host address, then it is assumed that the router is directly connected to the destination network and it should send the packet to the final destination host. Note that the entries specified on the rtable line are scanned in order by the simulator. In other words, if multiple
next hops are present for a particular destination, the router sends the packet to the first one listed. This fact becomes important when using shortcuts to set up a routing table, as described below.
The simulator interprets a few IP addresses in a nonstandard way. This is done to make it easier to configure a large internetwork. If IP addresses are chosen so that networks with similar IP addresses are near each other in an internetwork, then routing tables can be specified quickly and easily by using the special addresses as ``destinations'' in the routing table. Given a packet with destination IP address of the form a.b.c.d, the following IP addresses have special meaning when used in the destination field:
The c in all of the above relations refers to the third component in the packet's destination address, a.b.c.d. Clearly, these special addresses are most useful if all networks in a simulation are uniquely identified by their c components.
For example, consider the following entry in a routing table:
router FCFS r1; rtable = 3.1.5.0 192.1.10.100, 0.0.0.0 192.1.20.100;
Packets with IP destination address of the form a.b.c.d will be
routed to 192.1.10.100 if . Therefore, a packet
destined to 192.12.3.79 will be sent there, but 192.12.6.3 will not.
The latter packet falls through to the last entry, which routes that
packet to 192.1.20.100.
The args line of the router entry contains parameters for the router. These parameters set the number of router buffers and select trace options. Parameters for the FCFS router are listed in Section 3.4.1. A syntactic point to be aware of is that no spaces should be included anywhere between the argument and its value; e.g., buf=30.