Giter Site home page Giter Site logo

elvissmog / dccrip-routersim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caiozanatelli/dccrip-routersim

0.0 0.0 0.0 61 KB

A router simulator that implements a distance-vector routing protocol with network load balance, routing measures, and some optizations.

License: GNU General Public License v3.0

Python 93.35% Shell 6.65%

dccrip-routersim's Introduction

DCCRIP-RouterSim

Description

This work tackles the creation of a router simulator that implements a distance-vector routing protocol with network load balance, routing measures, and some optimizations.

Message Types

Message transmission is performed using UDP (User Datagran Protocol) and packets are encoded in JSON (JavaScript Object Notation) in order to allow future extensions of funcionality and also for usage simplicity. All types of message contain as default the following fields: source, destination, and type, where type indicates the message type, which can be:

  • data: data message;
  • update: route update message;
  • trace: trace message.

Data Message

Data messages have an additional field named payload whose type is string. The simulator displays this field every time a data message reaches a router.

Trace Message

Trace messages have an additional field named distances containing a dictionnary with the minimum known distance to some destination IP.

Route Update Message

Route update messages have an additional field named hops that contain a list of IPs indicating all the routers the message have passed through. When the message arrives at the destination, it is encoded in JSON format and inserted into a data message. The new message then returns to the source.

Router Features

As said above, the router simulator presented in this project implements a distance-vector routing protocol with network load balance. We show below all the implemented features.

Links

Links between routers are stored in a dictionnary where addresses of adjacent routers are the keys and the stored value represents the cost.

Routes

Routes are stored in a dictionnary where the router's destination address is the key and the stored value is a list of tuples containing the addresses of the router that informed both route and cost.

Periodic Updates

Periodic updates are performed every π seconds, where π is update period parameter. Internally, this is implemented using a timer that sends an update message every π seconds.

Split Horizon

Update messages that have been sent contain the routes learnt by the router. In order to reduce chances of counting infinity, sent routes ignore those to the router to which the message is destined as well as all routes learnt by it.

Network Load Balance

In cases where there exist multiple routes with the minimum cost, the decision is made in a random way. We chose this strategy because load balance implemented through round-robin would not make sense due to the dynamism inherent to the topology.

Immediate Re-Routing

Routes evaluation is performed immediately before sending each message, and hence topology changes will not impact message transmissions.

Out-of-Date Routes Removal

If a router does not send update messages for a period of 4π seconds, every route that has been learnt so far will be removed. This is also implemented using a timer.

Usage

In the project root directory, use the following command in order to run the software:

python3 routersim.py --addr ADDR --update-period PERIOD [--startup-commands FILE]

dccrip-routersim's People

Contributors

brenoam avatar caiozanatelli 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.