CS 422: Lecture Notes (12/07/04 - 12/09/04)

- By Gaurav Ganesh


Date: 12/07/04

Network Address Translation (NAT)

   

 

   

  1. L1 tries to connect to I1 which is a web server. L1 sends a SYN packet to start a connection. The connection params will be <L1, Q1, I1, P1>.
  2. The NAT box receives the packet and substitutes the IP source (L1) by its own IP address (N1). It also generates a new port number (Q1') and substitutes Q1 by Q1'. Then it sends the packet to I1. The new params in the packet will be <N1, Q1', I1, P1>.
  3. The NAT box will also record in a table, a new mapping that relates Q1' to <L1, Q1>. This mapping will be used when a reply comes back from I1, to replace the destination and destination port back to <L1, Q1>.

   

  1. When a reply is sent from I1, it will go to the NAT box and the params in the packet will be <I1, P1, N1, Q1'>.
  2. The NAT box receives the packet and looks up Q1' in the NAT table. It finds the pair <L1, Q1> that corresponds to Q1'. The NAT box substitutes the destination N1 by L1 and destination port Q1' by Q1. The new params of the packet are now <I1, P1, L1, Q1>.
  3. L1 receives the packet transparently i.e. L1 never knows that the NAT box performed a translation.
  4. The NAT box will now use the translation Q1' ↔ <L1, Q1> for all packets of the same connection.
  5. The mapping Q1' ↔ <L1, Q1> will be removed a few minutes after the connection is closed.
  6. When a packet comes from the Internet to the NAT box, and no mapping exists for that destination port, the packet will be dropped.

   

  1. Let's assume that a hacker in H2 tries to connect to port Q2 in N1. N1 will not have a mapping Q2' in the NAT table so it silently drops the packet. H2 will not get any feedback. This is how firewalls work.
  2. The drawback is that no application that starts a connection from the outside will get through. For ex. you will not be able to telnet/ssh to a computer in your home network or run a web server, internet phone, remote desktop, VNC, having the client in the Internet.
  3. To get around this problem you can add a static mapping in the NAT table so the NAT box will translate incoming packets to a machine and port in the home network. For ex. add a static mapping 80→<I5, 8080>. This will tell the NAT box to translate packets directed to NAT box port 80 to be sent to computer I5, port 8080, in your home network.

   


Date: 12/09/04

Virtual Private Networks (VPN)

   

   

  1. C wants to send a packet IPA to N1 in the remote network. C uses the VPN interface to send the packet IPA.
  2. The drivers for the VPN interface encrypt IPA and put it on top of another packet IPB. The destination of IPB is the VPN router R.

   

  1. When R receives the packet, it decrypts IPA and sends it to its original destination N1.
  2. Everything will be transparent to both C and N1.
  3. If N1 sends a reply back to C, it will also be encapsulated in the same way.

    VPN is now widely used to:

Using SSH to provide a Secure Channel

   

 

Review for the Final

Routing

Protocols and Layering

Internet Protocol (IP)

Address Resolution Protocol (ARP)

IP Fragmentation & Reassembly

ICMP

Transport Protocols

TCP

NAT & VPN

Final Distribution

    70% Notes

    30% Projects