CS 39006: Networks Lab Assignment 4

$30.00

Download Details:

  • Name: Asgn-4-5fwzfc.zip
  • Type: zip
  • Size: 260.92 KB

Category:

Description

5/5 - (1 vote)

Network Namespace and Routes In this assignment, you have to construct three network topologies (using shell scripts) and perform a set of experiments. Part A also contains a brief tutorial on how to construct the routes. The details follow. PART – A: Create four network namespaces and connect them with virtual ethernet (veth) interfaces as shown in Fig 1. Fig 1. Assign ip address to the interfaces as follows: v1: 10.0.10.X v2: 10.0.10.(X+1) v3: 10.0.20.X v4: 10.0.20.(X+1) v5: 10.0.30.X v6: 10.0.30.(X+1) Where X is the last two digits of your roll number. Make sure all the interfaces are up. At this point, you will find some routes already added in each of the namespaces. For example: In N1 you will find: (considering X = 1) In N2 you will find: Therefore, from N2, 10.0.10.1 (of N1) will be reachable, as well as 10.0.20.2 (of N3) will be reachable. This is because, from the routes of N2, we see that there are correct rules to forward the packets in v2 and v3, for networks 10.0.10.0/24 and 10.0.20.0/23 respectively. But, we cannot reach 10.0.30.1 from N2, because there are no valid routes for the same. To add a route for 10.0.30.0/24 in N2, we have to forward it to 10.0.20.2 (i.e. next hop) through the interface v3. ip route add 10.0.30.0/24 via 10.0.20.2 dev v3 Now, the routing table of N2 knows where to send packets going to 10.0.30.0/24. But, ping 10.0.30.2 (N4) will now work since N4 does not have the routes to send the echo reply back to N2. To enable that, you have to run the following in N4: ip route add 10.0.20.0/24 via 10.0.30.1 dev v6 Similarly, configure all the required routes so that all interfaces (irrespective of network namespace) can be pinged from every namespace. Include the ping commands in the script. Use, ping -c 3 so that it only repeats 3 times. You need to submit this shell script with name assignment4_partA.sh. PART – B: Write a shell script to create a virtual network topology as in Fig 2. Fig 2. Here H1, H2,… , R1, R2,…, are network namespaces and they are connected using virtual ethernet interfaces v1 …. v12: Assign ip address to the interfaces as follows: v1: 10.0.10.X v2: 10.0.10.X+1 v3: 10.0.20.X v4: 10.0.20.X+1 v5: 10.0.30.X v6: 10.0.30.X+1 v7: 10.0.40.X v8: 10.0.40.X+1 v9: 10.0.50.X v10: 10.0.50.X+1 v11: 10.0.60.X v12: 10.0.60.X+1 Where X is the last two digits of your roll number. Configure all the required routes so that all interfaces (irrespective of network namespace) can be pinged from every namespace. Include the ping commands in the script. Use, ping -c 3 so that it only repeats 3 times. Use traceroute to show the hops from H1 to H4, H3 to H4 , and H4 to H2 You need to submit this shell script with name assignment4_partB.sh. PART – C: Write a shell script to create a virtual network topology as in Fig 2. Fig 3. Assign ip address to the interfaces as follows: v1: 10.0.10.X v2: 10.0.10.X+1 v3: 10.0.20.X v4: 10.0.20.X+1 v5: 10.0.30.X v6: 10.0.30.X+1 v7: 10.0.40.X v8: 10.0.40.X+1 v9: 10.0.50.X v10: 10.0.50.X+1 v11: 10.0.60.X v12: 10.0.60.X+1 Where X is the last two digits of your roll number. Configure the routes such that the packet moves only in clockwise direction in the ring. That is, N1->N2->N3->N4->N5->N6->N1->N2 …. (You can ignore the adjacent namespaces which are directly connected via an virtual ethernet interface ) Therefore, a packet from N1 may move to N6 through v12->v11, but a packet from N1 to N5 will move as N1->N2->N3->N4->N5 Use traceroute to show the hops from N1 to N5, N3 to H5 , and N3 to N1 You need to submit this shell script with name assignment4_partC.sh. Submission Instruction: You need to submit the three shell scripts, enclosed in a zip file named assignment4_.zip via Moodle by the deadline. Your shell scripts should have sufficient comments explaining the steps you have used in the code. Tips: Use the sysctl command to set net.ipv4.ip_forward=1 Enable loopback interface lo to check if you can ping a namespace’s own interfaces (sanity check).