Git Product home page Git Product logo

routing-protocols's Introduction

Routing-Protocols

We simulated two routing protocols, distance vector and link state, as a computer assignment for computer networks course.

How to run

run the following commands in terminal:

make
./main.out

Commands

topology

With this command, you can define a new topology. this definition includes the nodes and the edges. the format is as follows:

topology s1-d1-c1 s2-d2-c2 ...

where $s_n$ and $d_n$ are nodes and $c_n$ is the cost of the edge that connects them. note that the graph is undirected. example:

topology 1-2-19 1-3-9 2-4-3

show

This commant prints the adjacency matrix of the graph. the number on row $i$ and column $j$ shows the cost of the edge from $i$ to $j$, this number would be $-1$ if no edge connects $i$ and $j$. the format is as follows:

show

sample output:

u|v |   1|   2|   3|   4|
-------------------------
   1|   0|  19|   9|  -1|
   2|  19|   0|  -1|   3|
   3|   9|  -1|   0|  -1|
   4|  -1|   3|  -1|   0|

remove

This command removes the edge between two nodes. the format is as follows:

remove s-d

where $s$ and $d$ are the nodes whose connection we want to remove. example:

remove 1-3

modify

This command modifies the cost of an edge. if no edge exists between given nodes, a new one will be created. the format is as follows:

modify s-d-c

where $(s,d)$ is the edge we want to change and $c$ is the new cost. example:

modify 1-3-4

lsrp

This command runs the link state routing protocol on the network for a given node and prints the nodes table after each iteration. the final tables shows the shortest path from given node to all nodes in network. the format is as follows:

lsrp s

where s is the source node. example:

lsrp 1

output:

   |Iter 1:
Dest|   1|   2|   3|   4|
Cost|   0|  19|   9|  -1|
-------------------------
   |Iter 2:
Dest|   1|   2|   3|   4|
Cost|   0|  19|   9|  -1|
-------------------------
   |Iter 3:
Dest|   1|   2|   3|   4|
Cost|   0|  19|   9|  22|
-------------------------

Path: [s] -> [d]         Min-Cost         Shortest Path
---------------------------------------------------------
    [1] -> [2]              19             1 -> 2
    [1] -> [3]              9              1 -> 3
    [1] -> [4]              22             1 -> 2 -> 4

dvrp

This command runs the distance vector routing protocol on the network for a given node. the printed tables shows the shortest path from given node to all nodes in network. the format is as follows:

dvrp s

where s is the source node. example:

dvrp 1

output:

Dest         NextHop         Dist         Shortest Path
---------------------------------------------------------
2              2              19          1 -> 2
3              3              9           1 -> 3
4              2              22          1 -> 2 -> 4

routing-protocols's People

Contributors

daneshvar-amrollahi avatar kymmt80 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.