You are free to design the format and structure of the routing table kept locally by each node and exchanged among neighboring nodes.
1. Upon the activation of the program, each node should construct the initial routing table and keep it locally.
2. Once the link and distance information for all the nodes are specified, the routing table information will be exchanged among network neighbors. Each node should send its routing table information to its neighbors at least once. (See the command syntax section for more detail on how the process starts.)
3. Using the Bellman-Ford algorithm, each node will keep updating its routing table as long as neighboring nodes send their updated routing tables information.
4. If there is any change in the routing table, a node should send the updated information to its neighbors.
Due to the nature of the UDP protocol, packets may be lost or delivered out of order to the application. Thus you may consider to add some kind of time stamp or sequence information to each packet (i.e. each routing table), so that each node can update its own routing table accordingly. Note that if the process is implemented properly, the routing information exchange should converge (stop) as soon as all nodes in the network obtain the routing tables with the shortest pathes information.