$30
• In this programming assignment, you are to build a simple Distance Vector program that will communicate with N partners.
o DV program
§ You will run N instances on your machine
§ Each instance will run on a different port (instance 1 will run on port
18181, instance 2 on port 18182, instance 3 on port 18183, etc),
§ The program will start by reading in the appropriate neighbors file and vector file.
§ The program will ONLY read vectors where the fromNode is equal to that node. For instance, node 1 will only read in vectors where node1 is the fromNode.
§ The program will read in the should support the following requests from clients:
• Show files at the server’s current directory: ‘print’ o This will print the current vector table on a node.
o ONLY print valid vectors (don’t print uninitialized ones)
• Download files: ‘refresh’ o This will force the current node to send it’s vector table to all it’s neighbors.
• Upload files: ‘update o This will be of the form: Update fromNode toNode cost o Update checks that the toNode is the current node
§ If it is not it is ignored o Update then checks if the toNode-fromNode exists in vector table. If it does not it is added and neighbors are notified
o If the pair is in the table, the if the new cost is less than the old cost, that cost is stored and the neighbors are notified.
o Programming environment
§ All programs should be written C or C++ and run on UNIX like platform.
§ The starter code works on Mac and should work on linux
§ All connections between a server and clients should be TCP/IP socket.
§ I have included a makefile and all the required templates
o Required Skills
o Everyone is expected to know following skills and knowledge in order to complete this programming assignment.
§ TCP/IP Socket programming
§ Understanding UNIX like Operating System
§ Creating/invoking processes in UNIX like environment
§ Makefile
§ C or C++