Giter VIP home page Giter VIP logo

distance-vector-routing-protocol's Introduction

Distance-Vector-Routing-Protocol

Converging nodes to shortest paths by implementing Bellman Ford algorithm

The node class contains information about the nodes name, port number, neighbors, routing table, and a queue. Each node starts four threads.

1. broadcastThread:

Each node sends a packet to all its neighbors. The packet contains packet type and sending nodes name as header information. The distance vector, initially created from the nodes neighbors is added as the payload. Measures for Poison Reverse are taken here.

2. listenThread:

Each node is actively listening for any packet sent to its port number. On receiving a packet, it appends the packet to the queue. The queue stores packets it receives from its neighbors. These packets are then processed one by one by the processThread.

3. processThread:

The process thread checks if there is any unprocessed packet in the queue. If so it extracts senders name and packet type from the header. If packet type is ‘change’, the payload is forwarded to change function which extracts the cost changed along with its new value and updates it. If the packet type is ‘DV’, the payload is forwarded to updateRoutingTable function. This is where the Bellman-Ford algorithm works. It also updates the timeout value for the sender here since the fact it sent its distance vector means that the sender is active.

4. killDeadNodesThread:

This thread continuously checks if any neighbor node has exceeded its timeout value. If so, its cost is changed to infinity.

change.py:

This script provides an interface to change costs for a selected pair of nodes. It reads the configuration files and creates its list from there. Once a pair of nodes is selected, it sends neighboring nodes name and the new cost as a payload to the both the nodes. It adds packet type of ‘change’ as header information.

distance-vector-routing-protocol's People

Contributors

imaliazhar avatar

Watchers

James Cloos 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.