Computer Networks

COS 461, Princeton University Spring 2015


Assignment 2: Internet Router

Due 11:59 p.m. Monday, April 6, 2015

Network Address Translation

For the extra credit we will now consider how to make it appear that all traffic to and from the HTTP servers is coming from the same IP address. To do so, the router performs network address translation (NAT) to translate the IP address to a common IP address for all machines within its network. In this case, within its network, the router will only have one external port, eth3. All machines connected to the router at all other ports should be considered part of the internal network. The router will perform NAT on traffic heading in both directions.

Consider the desired behavior for both outbound and inbound traffic, as described below.

Outgoing traffic
If a machine on the internal network sends a packet to a destination that is external to the router's network, the router will perform the following NAT-based actions:
Incoming traffic
Given a packet the router with dest_IP and dest_port:

We only expect your NAT to handle traffic for connections that hosts on the internal network originate. We do not expect your NAT to handle cases where external hosts attempt to initiate connections to internal hosts.

Setup

We have provided a similar topology to above, but now the two servers would be clients and the client would be a server.

You can download the relevant topology files here. To use the files that we have provided, edit run_mininet.sh to use the script lab3_extra.py. Make sure that IP_CONFIG_EXTRA is in the same directory. Make a copy of the original rtable with the assigment and copy rtable_extra into rtable before running the run_pox.sh script. Also make sure that the included http_server directory is in the same directory as the run_mininet script. The set up instructions should work as in the original assignment.

Note that because Mininet assigns addresses to the hosts in the topology from private address space by default (i.e., 10.0.0.0/8), the internal network hosts need to be numbered from a different internal address space. The IP_CONFIG_EXTRA file makes sure that hosts are numbered appropriately.