CSC 175 Assignment and Lab Due Wednesday 3/4 ----------------------- INDIVIDUAL HOMEWORK: read sections 4.1 and 4.2 of text, do chapter 4 exercises 21, 40, 45, 47 and 48. Problems 22 and 46 are similar and have solutions in the back of the book. ----------------------- Routing Workshop Warning: you are not allowed to use the graphical network configuration tool in Fedora. If you are found using it you will get a zero immediately. You must use the ip link, ip addr and ip route tools. See the utility manual on the web page for full details. Before you begin, you should study the iproute utility document, and the man page for ping (know how to use ping with the -s, -R and -M options). Make sure that your network settings are restored to its original configuration, before the first lab (for this you can use the graphical tool if you want). *** You are REQUIRED to record the sequence of commands you used to effect each setup. Specifically, for each part of the assignment, record what you did to complete it in addition to answering the questions that are posed. Read the assignment carefully so as not to miss anything. *** For this assignment, do not use names such as "starbase," use IP addresses directly. 1. Issue the command echo 1 > /proc/sys/net/ipv4/ip_forward. This enables your host as a router. Issue the commands "ip addr flush eth0" and "ip route flush all", which will clear the routing table. At this point, you should be stuck! 2. Use the ip addr command to reassign the correct IP to your eth0. (We used this command to add an additional IP in the first lab) write down the command that worked for you: 3. We're now going to create a virtual "ring" with our hosts. Each group will set their default route to their right neighbor: 10.1.0.1 -> 10.1.0.5 -> 2 -> 8 -> 9 -> 10.1.0.1 Though not numerically in order, this ring reflects the physical arrangement of the lab. 10.1.0.2 (deepdish) is under my control and will be configured by me. Remember, in order to name a router (default or otherwise), you need to first describe how to find it (over what interface). That is, remember to add the network before the router to the routing table. You must configure your machine to route all outgoing IP packets to your right neighbor. You should be able to ping everyone on the ring BUT NOT OUTSIDE THE RING. Try pinging 10.1.0.3 (thincrust). If you got a response then you DID NOT DO THIS PART CORRECTLY. I'll bet you a piece of chocolate you didn't do the above part correctly. To understand why, examine your routing table, arp cache, and ping a host on the ring more than one "hop" away from you with the -R option, which shows you the route that the ping packet took. It's not what you expected, is it? See, it's a bit more subtle than it may appear, so STOP FOLLOWING INSTRUCTIONS BLINDLY AND THINK!! Hint: to do this part correctly, you may have to delete one of the routing table entries. WHEN YOU'VE SET YOUR ROUTING TABLE ACCORDINGLY, put up your sticker. We know that the entire ring is correctly configured if you can ping -R your upstream (left) neighbor with the desired effects (you can also use "traceroute"). 4. This part of the assignment asks you to change the mtu of your eth0, and use wireshark to discover some more details about ip routing. You can use ip link and ping -s as instruments. Determine the following, AND DESCRIBE HOW YOU DETERMINED IT!!! i. When an ip packet is a fragment of a larger packet, what is the value of the 16-bit "total length" field of the packet? Is it the the length of the current fragment, or the length of the overall logical packet? ii. A packet could become fragmented multiple times. For example, a 2000 byte packet may be fragmented into two 1000 byte packets when going through a 1500 mtu link, but then these packets can become fragmented again when going through, say, 500 mtu links. Cooperating with another group (make friends), construct a situation where double fragmentation occurs. Is it possible to tell if a packet has been fragmented twice? Are there any special difficulties when reassembling fragments that has been fragmented multiple times? (hint: pay attention to what happens to the identifier). 5. This part of the assignment asks you to do "path mtu discovery". Ping the host that's farthest away from you on the ring (your left neighbor). Using the appropriate values for the -s and -M options of ping, along with wireshark if you want, you should be able to determine the MTU of the ring - that is, the largest packet that can traverse the ring without fragmentation. Your answer should be accurate to within 64 bytes. Were you also able to determine *which* host had the smallest mtu? How? Remember to explain in detail what you did. PLEASE DO NOT CONTINUE TO THE NEXT PART UNTIL INSTRUCTED: 6. Clear your routing tables again. This time, we're going to divide the class into two small subnets: 10.1.0.0/29 and 10.1.0.8/29 a. Figure out which subnet your host belongs to. b. Add a dev eth0 route to your subnet. The route should not be for anything wider than this specific subnet! c. At this point, try the following: ip route add default via 10.1.0.98 If you succeeded then you FAILED! Why? 7. If starbase (10.1.0.98) is also to be placed in a subnet with a 29 bit mask, what would it be? Add a route to starbase's 29bit subnet. Set your default route to 10.1.0.98. Now it should work. EXPLAIN why. 8. Now we're one big happy family again? Well, not quite. Clear your ARP cache with "ip neigh flush all". Ping some host on the OTHER subnet. What do you see in your arp cache? EXPLAIN what's happening. Figure out the TIGHTEST subnet that all our hosts, including starbase belongs to, and set you routing table accordingly. 9. Source Address Routing So far, the decision as to how to route a packet is made solely on the destination ip address of the packet. This is the norm, and is used by not only every router but also every end-host on the Internet. However, advanced routers can define more sophisticated routing policies. On linux it is also possible to decide how to route a packet based on its source ip address. Read chapter 4 of the "advanced routing howto" document to learn how to create additional routing policies via "ip rule". Create a new routing table, then route all packets coming from the host 10.1.0.3 through 10.1.0.2.