Skip to content

atykwonderland/networkRouting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simulate Link State Routing Protocol with Java Socket Programming

A pure user-space program which simulates the major functionalities of a routing device running a simplified Link State Routing protocol.

How To Run:

$mvn compile assembly:single
$java -cp target/COMP535-1.0-SNAPSHOT-jar-with-dependencies.jar socs.network.Main conf/router1.conf

Supported Commands:

Command Description
attach processIP processPort simulatedIP weight
  • attach the link to the remote router, identified by the given simulated ip;
  • weight is the cost to transmitting data through the link
NOTE1: processIP should always be localhost (i.e. 127.0.0.1) since this is a simulation on our own machines.
NOTE2: processPort must match the corresponding port as listed in the conf files.
start Client side: broadcast HELLO to all links
  • through a socket connection, send HELLO packets to all linked routers;
  • waits for response from each link;
  • sets status of the linked router to TWO_WAY and sends another HELLO
  • neighbor relationship is established
Server side: waits for packets to arrive
  • receives a HELLO packet and sets router state to INIT
  • returns a HELLO packet to the source IP address
  • neighbor relationship established
neighbors output the neighbors of the routers
detect simulatedIP output the shortest path from current router to the target router with their weights
update processIP processPort simulatedIP weight update the weight between the path from processIP to simulatedIP
connect processIP processPort simulatedIP weight similar to attach command, but directly trigger the database synchronization without the necessity to run start on the origin router
NOTE: destination router must still run start before it can be detected.
disconnect port remove the link between this router and the remote one which is connected at port
quit exit the program

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages