Skip to content

probaldhar/linkState-routing

Repository files navigation

Link State Routing & Forwarding Tables

link state algorithm & forwarding table

Usage -

1. go to the folder using terminal/shell
2. make
3. ./node <routerLabel> <portNum> <totalNumRouters> <discoverFile> [-dynamic]

Here, routerLabel is a one word label describing the router itself, portNum is the port number on which the router receives and sends data, totalNumRouters is an integer for the total number of routers in the network, discoveryFile refers to the text file that contains neighbor information including the router’s own label, and the optional parameter –dynamic indicates if the router runs a dynamic network whose cost on a link may change.

The File Format -

The neighbor discovery file must be formatted such that each neighbor of a router is described by a one word label, an IP address (or hostname), a port number, and a cost value as comma separate values on a single line. All neighbors of a router are listed line-by-line. The following describes the format where <routerLabel> is the label of the router, <IP_address/hostname> is the IP address or host name of the router, <portNumber> is the port number of the router, <cost> is the cost of the link.

<routerLabel>,<IP_address/hostname>,<portNumber>,<cost>
<routerLabel>,<IP_address/hostname>,<portNumber>,<cost>
<routerLabel>,<IP_address/hostname>,<portNumber>,<cost>

For example, a router A may have the following links indicating that the router has the neighbors B and C with respective costs of 8 and 2:

B,cs-ssh1.github.io,60005,8
C,cs-ssh2.github.io,60008,2

For simplicity, routerLabel should be contain only one character and capital letter (A-Z).

About

link state algorithm & forwarding table

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published