ObjectivesWe will learn how Routing Information Protocol works by investigating the convergence of the routing tables over time. We will also learn packet processing basics by using the Scapy packet manipulation and analysis tool. ExperimentRIP Implementation in MininetChapter 18 of [dor19] has a slightly simplified (no poison reverse or triggered updates) but a quite realistic Routing Information Protocol (RIP) implementation. The implementation is in the Python3 file rip.py. We run it in each router participating in the distance-vector routing table updates. We quote the operational summary of the algorithm from the book as follows: Most of the time, the program waits to read update messages from other routers. Every UPDATE_INTERVAL seconds the program sends out its own update messages to the neighbours. The update messages are placed in UDP packets, and sent to a special IP multicast address: The official RIP multicast address 224.0.0.9. Port 520 is used for both sending and receiving. To keep the implementation simple, rather than creating separate threads for receiving and sending, a short (one second) recv() timeout is configured, and then after each timeout we check whether it is time to send the next update. An update can be up to one second late with this approach, but this does not matter. The program maintains a “shadow” copy RTable of the real system forwarding table, with an added cost column. The real table is updated whenever a route in the shadow table changes. In the program, RTable is a dictionary mapping TableKey values (consisting of the IP address and mask) to TableValue objects containing the interface name, the cost, and the next_hop. You can refer to Section 18.5 of [dor19] if you would like to learn more about the implementation details. Convergence of RIPWe will use the topology we have been using in our distance-vector algorithm lectures (instead of letters to idenfity the routers we use numbers though to make scripting the topology easier):
Packet Analysis with ScapyAs we mention above, Scapy is a software tool for packet manipulation and analysis. It allows one to send, sniff, dissect and even forge network packets. we will only use its packet analysis capabilities. Here are some useful functions:
See parse_rip.py for extracting information from a RIP packet. For further information you can refer to its documentation. Now, we are ready to examine some packets:
R1 (time) IP Netmask Metric NextHop 172.16.34.0 255.255.255.0 4 172.16.13.3 ... ... ... ... ... ... ... ... Don't forget to show the running script to your lab demonstrator. Your ReportAfter finishing your experiments, you will need to prepare a short (maximum two pages, 10 pt Times-Roman font) report summarizing the key points you have learned in this exercise. Please convert your report to PDF (no other formats will be accepted), zip your report with all the Python code you have written for the experiment, and upload all as a single zip file to the unit's Moodle site before the due date (we will post the deadlines at the unit's Moodle site). References
|