📄 readme.txt
字号:
Simple Routing1. Compiling the program------------------------javac *.java2. Running the program----------------------The program has two components:1.RouterServer2.bfnode3.CommandThe following files should be present in the directory before running the programs:1. Topology Configuration File2. Router Location file3. Event FileStarting RouterServer: $java -classpath . RouterServerStarting bfnode: $java -classpath . bfnode <local-port> <neighbor1-port> <distance1> <neighbor2-port> <distance2> ... <last> <local-port>:The UDP listening port number of the node <neighbor#-port>:The UDP listening port number of one of the neighboring nodes <distance#>:The link distance to the <neighbor1-port> Keep listing the pair of <neighbor-port> and <distance> for all your neighboring nodes <last>:Indication of the last node information of the network. Upon the input of the command with this argument, the routing message exchanges among the nodes should kick in exit(ctrl-C):Exit the programStarting Command: $java -classpath . Command -f <ef> -l <rlf> -t <tcf> -o <log> -s The default values are: <ef>: ef.txt <rlf>: rlf.txt <tcf>: tcf.txt <log>: log.txtIt is advisable to use "-s" option for running Command. If it is not used, it might lead to undesirable results because the Command might request the Routers to display the Routing Tables even before the exchange of Distance Vectors is completed.3. About the Algorthm---------------------1. The Distance Vector Algorithm given in the *2nd edition* of the text book is implemented. So the format of the Routing Tables is according to the Figure 4.7 in the 2nd edition of the text book where:* There is a row corresponding to each destination in the network* There is a column corresponding to each neighbor of the given node.* An entry (i,j) gives the distance to the destination 'i' when the first hop on the path is neighbor 'j'2. For convenience, infinity is taken as 10000.The client has an easy-to-use Graphical User Interface (GUI) to the user.3. The operations performed by the Router for various commands are:*addRouter: returns true if its id matches (trivial)*deleteRouter: if the node is a neighbor, removes the corresponding row and column and updates the distance vector. if it is not a neighbor, ignores the command*update: if the node is not present in the routing table, adds a new row and column corresponding to the node. if the node is present and is a neighbor, it will modify the column corresponding to the node. if the node is present and is not a neighbor, it will add a column.*packets: return the packets and make packets 0*display: display the routing table*route: send the next hop*step: send the dv to its incoming neighbors4. Assumptions/Limitations--------------1. The algorithm does not implement Poisson Reverse. This might lead to a count-to-infinity problem.2. After finishing the program, the Routers have to be killed by hand.5. File Directory-----------------bfnode.java - program to get input information RouterServer.java - work as a router serverRouter.java - the code for RouterRouterThread.java - A thread that listens for packets from other routersCommandThread.java - a thread that listens for commands from Command programTopologyFileEntry.java - an entry in the topology fileTopology.java - the initial toplogyRouterLocationEntry.java - an entry in the Router Location FileRouterLocation.java - the router locationsRoutingTable.java - the routing tableCommand.java - the command programPacket.java - the distance vector packet
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -