For this assignment, you will implement a distance vector routing algorithm using cnet. You may work alone or with one or two other people.
Use CNET_write_physical_reliable to do your transmission of data. This provides you with a simulation of a reliable data link layer protocol like stop and wait, without having to actually include the stop and wait code.
The first thing you need to do is implement a system of periodic updates. That is, every N milliseconds or so, each node should send out a description of itself on all of its outgoing links. In the first stage of your development, this self-description could consist entirely of the node's address, which the receiving nodes would record in a table. Later, the description will include all of the node's distance vector entries.
You may not assume that each node knows the identities of all the other nodes on the network. You only become aware of remote nodes as the updates of your neighbors include entries for those nodes. You may, however, assume some moderate upper limit of nodes--say, 20--but don't assume their addresses are 0 through 19 or anything so convenient as that.
Include an event handler for EV_DEBUG1. This handler should dump the node's distance vector information to standard output (standard output is the destination for printf).
Early on, go ahead and assume that the nodes will never fail, but try to plan for testing your code with positive values of the mtbf (mean time between failures) and mttr (mean time to repair) node attributes. I will test your code both ways.
Your distance vector updating should be based on total propagation delay rather than hop count. So linkinfo[i].propagationdelay is relevant.
The main test of your code will be to run it for a long time, transmitting lots of messages to their destination application layers without any incorrect message deliveries.
That incremental design plan is still a good idea. Make a list of baby steps, along with your plan for testing each step. After each step, do the test and save a copy of the code before moving on to the next step.
Have fun.