G22.2262: Data Communications and Network Design
Homework 1

 

Due Date: Thursday, October 21, 1999

This homework assignment has two parts:
 

Part I:

In the textbook, please read the following chapter:

Chapter 8: Internet Protocol: Routing IP Datagrams
 

After reading that chapter, please answer the following questions and hand in your typewritten answers:

8.1 8.3 8.4 8.5 8.8.
10.5 10.6 10.16
Part II:

Write a program that implements IP routing.

The program should take the following arguments:

For example, the program can be invoked as follows:

iproute table1 169.124.21.23 \
                     169.124.34.2 255.255.255.0 \
                     169.124.21.19 255.255.255.0 \
                     198.11.109.08 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.08 (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 table1 169.124.21.23 \
                    169.124.34.2 255.255.255.0 \
                    169.124.21.19 255.255.255.0 \
                    198.11.109.08 0
Deliver directly over interface 2
 
$ iproute table1 169.124.25.19 \
                               169.124.34.2 255.255.255.0 \
                               169.124.21.19 255.255.255.0 \
                               198.11.109.08 0
Deliver to 169.124.34.19 over interface 1

$ iproute table1 198.11.109.27 \
                               169.124.34.2 255.255.255.0 \
                               169.124.21.19 255.255.255.0 \
                               198.11.109.08 0
Deliver directly over interface 3

$ iproute table1 205.2.4.25 \
                               169.124.34.2 255.255.255.0 \
                               169.124.21.19 255.255.255.0 \
                               198.11.109.08 0
Deliver to 198.11.109.27 over interface 3
 

$ iproute table1 199.34.12.134 \
                                   169.124.34.2 255.255.255.0 \
                                   169.124.21.19 255.255.255.0 \
                                   198.11.109.08 0
Deliver to 198.11.109.19 over interface 3