Download Context and Requirements of Programs in Computer Networks | CMSC 417 and more Assignments Computer Systems Networking and Telecommunications in PDF only on Docsity! cmsc 417 programming assignment two September 25, 2006 Your task in this assignment will be to build and maintain a neighbor table from multicast “hello” messages. 1 Context A “hello” message tells the receiver “I’m alive.” A recipient uses this hello message to construct soft state: a cached view of reality that can be reconstructed should the machine fail or reboot. (Contrast “hard” state written to disk.) This soft state will consist of a list or table of immediate neighbors and how to reach them. 2 Deadline DUE: Oct 13. That’s a friday. The late deadline will be Monday, Oct 16; you have only one late deadline to play with this semester. I will be out of touch that weekend. 3 Requirements The program should do the following. • Use as the source address on each packet the address: ( getpid() << 16 ) + (last two digits of id << 8) + ( an arbitrary 8-bit number. ), ntohl’d of course. (The destination address can remain zero; it does not matter.) • Send a message every 25 seconds to the multicast address. It can be a protocol one message with the payload “hello” if you like. It doesn’t matter, so long as the packet is valid.1 • Maintain a list of known and valid neighbors. • Expire neighbors after 2 minutes of inactivity. • Upon the command “print neighbor table” on stdin it should print, separated by commas and optional spaces, a table with the following fields in order: IP address, Port (integer), Network address (integer from the header), Account ID, Is Alive? (Y or N), Time Remaining (seconds) It is fine to print only “Y”s and never print N’s. N’s are optional, for your debugging of time compar- isons. • When stdin is closed, terminate. • When the command “quit” is given, terminate. 1Appreciation, but no bonus points, for writing parody lyrics inspired by pink floyd’s comfortably numb as payload. 1