Lnx File specification

Lnx files are specified by a series of directives, one per line. Comments are denoted with #. Lines beginning with # are ignored. On any other line, any text after a # is also ignored. The next few sections define the syntax for each directive.

interface

Format:

interface <name> <virtual IP address>/<prefix> <UDP address>:<UDP port>

This directive may appear multiple times, one for each interface.

Parameter Example Description
name if0 Name for this interface
virtual IP address 10.0.0.1 Virtual IP address assigned to this interface
prefix 24 Integer 0-32 that defines the size of the network, together with the address. For example, 10.0.0.1/24 means that this interface has address 10.0.0.1 on the network 10.0.0.0/24 (ie, netmask 255.255.255.0).
UDP address 127.0.0.1 Bind address for the UDP socket used to send/receive packets on this interface.
Note: Must be an IPv4 address–the current version doesn’t support using hostnames (ie, localhost) here
UDP port 5000 Port for the UDP socket for this interface

neighbor

The neighbor defines how to reach other nodes on the same network. Thus, every node always knows the IP addresses and link-layer info for how to reach its neighbors (since we have no such thing as ARP).

Format:

neighbor <virtual IP> <UDP address>:<UDP port> via <interface>

This directive may appear multiple times, one for each neighbor. On networks with hosts (eg rX-hosts), an interface may have more than one neighbor.

Parameter Example Description
virtual IP 10.0.0.1 IP of a neighboring node
UDP address:port 127.0.0.1:5000 UDP Address and port for where to send a packet to reach this node. This is the virtual link-layer equivalent of a mac address.
interface if0 Interface where this neighbor can be reached. This should be the interface used when sending packets to this neighbor.
Note: Interface must have previously been declared with an interface directive.
Example

Here’s one of the interface/neighbor directives for r2:

interface if1 10.2.0.1/24 127.0.0.1:5004 # to network r2-hosts
neighbor 10.2.0.2 at 127.0.0.1:5005 via if1 # h2
neighbor 10.2.0.3 at 127.0.0.1:5006 via if1 # h3

This says that r2 knows about two nodes reachable on if1: one at 10.2.0.2 (h2) and another at 10.2.0.3 (h3).

routing

Format:

routing <rip|static>

This defines the routing mode. There are two modes, rip and static.

If no routing directive is specified, the default is static. This directive should only appear once per lnx file.

Mode Description
rip Advertise known routes and learn new routes via RIP. Used for routers.
static (Default) Don’t use RIP and operate only on local and manually-specified routes.
This is normally used for hosts. It can also be used on routers for testing purposes, like to make sure things work even without RIP.

rip advertise-to

Format:

rip advertise-to <virtual IP>

If this node is using RIP, this is used to specify IP addresses of other routers that should receive RIP messages (ie. RIP requests, periodic updates, triggered updates).

<virtual IP> MUST be a neighboring node. In other words, it must be a neighbor IP address defined with a neighbor directive.

This directive may appear multiple times to specify multiple neighboring routers that use RIP.

Example

rip advertise-to 10.0.0.1
rip advertise-to 10.0.0.2

This states that the node should send RIP updates to neighboring routers at 10.0.0.1 and 10.0.0.2.

rip periodic-update-rate

Format:

rip periodic-update-rate <milliseconds>

This directive specifies the rate (in milliseconds) at which periodic updates should be sent. If unspecified, the default is 5000 milliseconds (5 seconds).

<milliseconds> can be any positive integer. A value of zero MAY disable periodic updates.

rip route-timeout-threshold

Format:

rip route-timeout-threshold <milliseconds>

This directive specifies number of milliseconds after which a route can be expired if an update is not received from the router that sent it. If unspecified, the default is 12000 milliseconds (12 seconds).

<sec> can be any positive integer. A value of zero MAY disable route expiration.

Note: This value only specifies a lower bound on when routes can be deleted. In other words, it is NOT necessary to delete a route after exactly <route-timeout-thredhold> milliseconds have elapsed.

For grading purposes, we will assume that routes MUST be deleted after 2*<route-timeout-threshold> milliseconds have elapsed. When testing, we will choose expiration times to ensure your program can reach a quiescent state after a timeout has occurred.

route

Format:

route <prefix> via <virtual IP>

This directive is used to manually add a route to a node’s route table, called a static route.

Example 1 (Default route)

route 0.0.0.0/0 via 10.0.0.1

This states that packets matching the prefix 0.0.0.0/0 (ie. all traffic) should be routed to 10.0.0.1. This is a default route, which sends all traffic that doesn’t match other routes to a specific destination.

Example 2

route 10.5.0.0/24 via 10.1.0.1

This routes traffic in 10.5.0.0/24 to 10.1.0.1.

tcp rto-min

Format:

tcp rto-min <milliseconds>

This directive specifies minimum RTO value for TCP (in milliseconds). This value should be used at the minimum value when computing RTO updates.

<milliseconds> can be any positive integer.

tcp rto-max

Format:

tcp rto-max <milliseconds>

This directive specifies maximum RTO value for TCP (in milliseconds). This value should be used as the maximum value when computing RTO updates.

<milliseconds> can be any positive integer.