Introduction to Computer Networking Netkit lab Routing protocols: RIP and OSPF Simon Liénardy and Yves Vanaubel Academic year 2016 2017 1 Introduction This lab session tackles routing protocols. First, you will study the behavior of the Routing Information Protocol (RIP) in a simple scenario. Second, you will focus on Open Shortest Path First (OSPF), a link state routing algorithm. OSPF is an interior gateway protocol, such as RIP and IS-IS. You will study how OSPF spreads routing information among routers, and how it reacts when the topology changes, or when a failure occurs in the network. As usual, you are asked to return a handwritten report. Question are colored in blue and are listed in section 4 for your convenience 1. Plagiarism is forbidden, in line with the policy of the university ( http://www.ulg.ac.be/ plagiat). Discussion and exchange of ideas between teams is a good thing but you must write your own answers, that are the reflection of your own understanding of the subject. Contents 1 Introduction 1 2 The Routing Information Protocol (RIP) 2 3 Open Shortest Path First (OSPF) 4 3 Packets exchanged and impact on forwarding tables.................. 4 3 Reaction to failures..................................... 5 3.3 OSPFD internals [If enough time]............................. 5 4 List of all questions 6 1 This practical exercise was highly inspired by student Netkit labs of the University of Rome III (http://www.uniroma3.it/). 1
2 The Routing Information Protocol (RIP) The Netkit configuration files for this exercise are available in rip directory. 0.0/24 A eth3 R1 0.0.0/30 E 3.9 0.02/30 H B 0.0/24 R2.5 0.0.8/30 G 4 eth3 8 R4 D 0.4.0/24 F 0.0.4/30.6 eth3 0 I 0.06/30 7 R3 C 0.3.0/24 Figure 1 Topology for RIP network Consider the network topology in Figure 1. In this Netkit environment, routers use the daemons zebra and ripd in order to run RIP. These daemons are not run automatically when you launch Netkit. 1. On each router, run the daemons using the command: ri:# /etc/init.d/zebra start At each step, observe the forwarding table of r1 (command: ip route). Are all destinations directly available? Is this instantaneous? Why? 2. Sniff RIP packets on the interface of r4 using the command 2 r4:# tcpdump -i -v -s 0 where -v enables the verbose mode, and -s 0 enables to sniff the entire Ethernet packet (not only the first 68 bytes, as by default). Does it confirm what you expected 3? 3. Run traceroute from r2 to the interface of r4 and observe the path chosen by RIP. 2 You could also display the sniffed packed in wireshark but it would take more time 3 What did you expect? See the reminder if you thirst for refreshing your memory. 2
4. Shut down the interface of r3 using the command: r3:# ip link set down Run again traceroute from r2 to r4. Does it work directly? How long (approximately) does RIP need to recover the failure? Is it what you expected? Check the forwarding table of r2 to check if it was correctly updated after a while. 5. Re-activate the interface of r3 using the command r3:# ip link set up Wait until RIP updates the different routing tables. Then, crash r3. To do so, use the command host$ lcrash r3 in the host terminal. Do again the same traceroute as previously. How long does it take to RIP to update the routing tables? Do you see any difference with the link failure? Explain. 3
3 Open Shortest Path First (OSPF) The different Netkit files needed for this lab are available in the ospf directory. The topology of the network is available in Figure 2. The red values represent the OSPF costs to exit the interface. In this Netkit environment, routers use the zebra and ospfd daemons in order to run OSPF. These daemons are not run automatically when you launch Netkit. Area 0.0.0.0 bb1.0.0.0/24 Collision Domain A bb2 45 Collision Domain D.0.3.0/24 bb0 21 36.3.3 Collision Domain B.0.0/24 bb4 7 Collision Domain C.0.0/24 bb3 Figure 2 Topology of the network 3 Packets exchanged and impact on forwarding tables 1. Run tcpdump on the interface of bb4: bb4:# tcpdump -i -s 0 proto ospf & # Use '-v' for more details Run then zebra on each router successively, starting from bb0 to bb4, using the command: bbi:# /etc/init.d/zebra start Which packets are exchanged by the different routers? Try to explain their role briefly (1 or 2 sentences). Hints: (a) There are 5 kinds of OSPF packets to observe. If you miss some packets, you might have to crash and restart the lab. (b) The IP addresses 224.0.0.5 and 224.0.0.6 are used to address a group of routers (respectively All OSPF routers and All OSPF DRs ) and are called multicast addresses. These are beyond the scope of this introductory course. 4
2. Run traceroute from bb1 to.0. What is the path chosen by the probes? And the ICMP replies? Explain why. 3 Reaction to failures 3. Run tcpdump on the interface of bb0. Bring then down the interface of bb2 using bb2:# ip link set down How long does it take to OSPF to update the routing tables? notification is propagated in the collision domain A. Describe how the failure 4. Re-activate the interface on bb2. After a while, crash bb2 using the command host$ lcrash bb2 in the host terminal. How long does it take to OSPF to update the routing tables? Is OSPF faster than RIP? 3.3 OSPFD internals [If enough time] You should crash and restart the lab. When the lab is started, run zebra on each router. In order to access the ospfd daemon of a device, use the command (in the device terminal): bbi:# telnet localhost ospfd You are asked to enter a password. This is Sparta. You enter then an environment enabling you to display useful information, such as the OSPF daemon state. To quit, use the command exit. 5. Display the OSPF database on the different routers using the following command in the environment: ospfd> show ip ospf database What do you observe in the OSPF database? Explain. 6. Select a router and execute the following commands: ospfd> show ip ospf neighbor ospfd> show ip ospf route ospfd> show ip ospf interface What kind of information do they display? 5
4 List of all questions 1. RIP 1. Are all destinations directly available? Is this instantaneous? Why? 1. Does your observation with tcpdump confirm what you expected? 1.3. Observe the path chosen by RIP. 1.4. Does it work directly? How long (approximately) does RIP need to recover the failure? Is it what you expected? 1.5. How long does it take to RIP to update the routing tables? Do you see any difference with the link failure? Explain. 2. OSPF 2. Which packets are exchanged by the different routers? Try to explain their role briefly. 2. What is the path chosen by the probes? And the ICMP replies? Explain why. 2.3. When a link goes down, how long does it take to OSPF to update the routing tables? Describe how the failure notification is propagated in the collision domain A. 2.4. When a node goes down, how long does it take to OSPF to update the routing tables? Is OSPF faster than RIP? 2.5. What do you observe in the OSPF databases? Explain. 2.6. What kind of information do the commands neighbor, route, interface display? 6