CSE561 Project #3

out: Friday November 22nd, 2013
due: Tuesday December 10th, 2013 by 5:00pm.

[ summary | overview | NAT logic | turn-in | grading ]

Summary

In this project you will be writing a simple NAT that can handle TCP. It will implement a subset of the functionality specified by RFC5382. You can refer to the RFC for what is expected of NATs.

Overview

Before beginning this lab, it is crucial that you:

We will create a NAT that sits in Mininet between the app servers and the client. The internal interface of the NAT faces the client, while the external interfaces are connected to app servers. The app servers are "outside" the NAT, while the client is "inside."

The topology of NAT is as follows, where the NAT's internal interface (eth1) faces the client and its external interface (eth2) has two application servers connected with a switch:

alt text

You first need to set up the NAT environment in mininet. Download the tarball in the mininet virtual machine under your home directory:

wget http://courses.cs.washington.edu/courses/csep561/13au/projects/setup.tgz
tar xzvf setup.tgz
To start the mininet, run:
sudo ./run_mininet.py --arp --mac --cip=<Your controller IP addr>
Option description:

Feel free to look inside the script and customize it in whatever way suits your implementation. Some tips/notes about the environment:

These are the major parts of the assignment:

A correct implementation should support the following operations from the emulated client host:

NAT Logic

When an internal host opens a TCP connection to an external host, your NAT must rewrite the packet so that it appears as if it is coming from the NAT's external address. This requires allocating a globally unique port, under a set of restrictions as detailed below. The requirements for your NAT are a subset of those in specified in RFC5382; in some cases they are more restrictive. Refer to the RFC for details on the terms used. Your NAT has the following requirements:

As noted above, mappings should be Endpoint Independent. Once a mapping is made between an internal host's (ip, port) pair to an external port in the NAT, any traffic from that host's (ip, port) directed to any external host, and any traffic from any external host to the mapped external port will be rewritten and forwarded accordingly.

Cleaning up defunct mappings

Your NAT must clean up defunct mappings. Your NAT must periodically timeout idle TCP connections. Once all connections using a particular mapping are closed or timed out, the mapping should be cleared. Once cleared, a mapping can be reused in new connections.

The periodic function that handles timeouts should use the following timeout intervals:

TCP Established Idle Timeout applies to TCP connections in the established (data transfer) state. TCP Transitory Idle Timeout applies to connections in other states (e.g. LISTEN). Refer to the TCP state diagram.

Tracking Connections

You do not need to keep lots of state per connection. For example, there is no need to track seqnos or window values or ensure TCP packets are in proper order to the end hosts. Keep only the information that is useful to the NAT for establishing or clearing mappings.

Each time the controller receives a new TCP flow, it should install a new rule to the NAT which modifies a few fields in data link, network and transport headers. The OpenFlow switch will automatically update the IP and TCP checksums.

Optional

A few optional functions of the NAT for extra credit:

Tips for Floodlight Users

A few hints for flooding users:

Turn in instructions

Please turn in a tarball or a zip file at https://catalyst.uw.edu/collectit/dropbox/summary/arvindk/29361.
The archive should have following files:

Grading

We will be basing your grade on several elements: