G22.2262: Data Communications and Network Design

Homework 1

Due Date: Thursday, October 25, 2001

This homework assignment has two parts:

 

Part I:

 

Write a program that implements IP routing!

 

The program should take the following arguments:

 

For example, the program can be invoked as follows:

 

iproute 169.124.21.23 ipaddrfile table1

 

Suppose ipaddrfile had the following lines:

 

169.124.34.2  255.255.255.0
169.124.21.19 255.255.255.0
198.11.109.8  0

 

In the above case, your code would assume the machine has three IP address:

         169.124.34.2 (with subnet mask 255.255.255.0),

         169.124.21.19 (with subnet mask 255.255.255.0), and

         198.11.109.8 (with the default subnet mask).

 

The routing table should contain the following columns:

 

For example, the you can have a routing table as follows:

169.124.34.0   169.124.34.2   1
169.124.21.0   169.124.21.19  2
198.11.109.0   198.11.109.8   3
169.124.25.0   169.124.34.19  1
169.124.30.0   169.124.34.19  1
169.124.29.0   169.124.34.22  1
168.34.0.0     169.124.21.22  2
205.2.4.0      198.11.109.27  3
0.0.0.0        198.11.109.19  3

 
The program should print out one of the following:

 

Deliver directly over interface X
or
Deliver to IP_address over interface X
or
Deliver to myself
or
Network is unreachable
 

Here are some example runs:

 

$ iproute 169.124.21.23 ipaddrfile table1
Deliver directly over interface 2
 
$ iproute 169.124.25.19 ipaddrfile table1
Deliver to 169.124.34.19 over interface 1

 

$ iproute 198.11.109.27 ipaddrfile table1
Deliver directly over interface 3

 

$ iproute 205.2.4.25 ipaddrfile table1
Deliver to 198.11.109.27 over interface 3 

 

$ iproute 199.34.12.134 ipaddrfile table1
Deliver to 198.11.109.19 over interface 3

 

Part II:

 

In the textbook, please read the following chapters:

 

Chapter 8: Internet Protocol: Routing IP Datagrams and

Chapter 10: Classless and Subnet Address Extensions

 

After reading that chapter, please answer the following questions:

 

1.        Why do we need CIDR?

2.        Suppose we were using CIDR and had a routing table that had the following entries:
 
163.19.3.0                     163.19.3.12    1
192.19.3.0                     192.19.3.4     2
198.15.3.0                     192.19.3.5     2
204.10.10.1                 163.19.3.5     1
10.1.0.0                             192.19.3.17    2
53.19.5.0                         192.19.3.17    2
 
Using the algorithm in Section 10.22.2, how many comparisons would be required to find the router for 198.15.3.14?  For 204.10.10.1? For 11.19.20.3?
3.        Draw the binary trie structure for the routing table in Question 2.
4.        The existing traceroute operates by sending out a packet with a Time To Live (TTL) of 1.   The first hop then sends back an ICMP error message indicating that the packet could not be forwarded because the TTL expired.  The packet is then resent with a TTL of 2, and the second hop returns the TTL expired.  This process continues until the destination is reached, allowing the sender to figure the route to a host. That said, please answer the following:
a.        What happens if the route changes while traceroute is running?
b.       If a user uses traceroute to figure out the route from A to B, does the user know the route that B takes to get to A?  Why or why not?
5.        Consider a fixed subnet partition of a class B network number that will accommodate at least 121 networks.  What is the contiguous subnet mast that will accommodate that? How many hosts can be on each number?
6.        Consider an organization that wants to subnet their class B address to hold 127 hosts on each subnet.  What continuous subnet mask should they use?
7.        Does it make sense to subnet a class D address?  Why or why not?
8.        If a host contains a default route in the IP routing table, will IP ever generate a “destation unreachable” message?  Why or why not?

 

 NOTE:

Students with last names starting with A through H should e-mail their homework to Aristotle Tsirigos tsirigos@cs.nyu.edu

Students with last names starting with I through N should e-mail their homework to Vikram Sharma sharma@cs.nyu.edu

Students with last names starting with O through S should e-mail their homework to Lenny Satya  ls548@nyu.edu

Students with last names starting with T through Z should e-mail their homework to Yongchun Zhao  yz266@nyu.com