« Back to the main CSCI1680 website

Homework 3

Due Monday, October 31, 2022 at 11:59PM EST

Meta-note

  • You are welcome (and encouraged!) to collaborate with your peers, though the answers you write down must be your own
  • When you are done, please upload a PDF of your work to Gradescope under the assignment labeled "Homework 3". If you have issues accessing Gradescope, please contact the course staff

Problem 1: FTP vs NAT

Network Address Translation (NAT) allows multiple clients in a private network to share a single public IP address (on the NAT gateway).

Suppose a router performing NAT with public address 205.10.2.5 is operating on behalf of the nodes in your home, which are part of the internal network 192.168.100.0/24.

Part A

When a client with address 192.168.100.2 sends a TCP packet to an outside server at 134.21.4.10 (as shown in the table below), how does NAT modify the packet?

To express your answer, fill in the table with the translated version of the packet header and explain your reasoning below. When writing the packet fields, be as specific as you can—if there are multiple options for certain fields, just choose an arbitrary value.

Original packet (before NAT):

Source Destination
IP 192.168.100.2 134.21.4.10
TCP Port 5555 20

After NAT:

Source Destination
IP
TCP Port

Part B

What information does the router need to keep internally in order to properly translate and forward the server’s response?

Assume that the response packet has the same IPs and ports as the server receives, with the roles of source and destination reversed. You don’t need to precisely describe what data structures the router is using—just specify what information it will need to store to forward the response.

Part C

FTP (File Transfer Protocol) is a protocol that runs on top of TCP, and needs two parallel connections: one for commands, and one for data. The relevant parts of the protocol work as follows:

  • First, a client opens an FTP control connection to a server on port 20. * Then, the client sends a PORT command to the server, which includes the client’s IP address (as known by the client) and the port the client is listening on (say, port 7000).
  • The server then opens a data connection to the client on that IP and port.

In our example, the client would open a connection to 134.21.4.10 on port 20 and would send a command PORT 192.168.100.2,7000 to the server. Since our client is behind a NAT gateway, the data connection does not work. Why not?

Part D

Suppose the FTP client is smart and is able to determine NAT’s outside IP address. Thus, it instead sends the command PORT 205.10.2.5, 7000 to the server, but this still does not work. Why not?

Part E

Based on its description in this problem, why does FTP’s PORT command violate good principles of layering in network protocols?

Bonus

If you can change the router’s NAT implementation (including understanding the FTP protocol and potentially modifying the the FTP messages), how could you make the data connection work?

Problem 2: Distance Vector

Consider the following topology in a distance vector routing protocol, such as RIP, that does not use poison reverse or split horizon.

Part a

Suppose the A-B link is disconnected. Describe a sequence of events (eg. A announces a distance of X, B adds route for A with cost X+1, etc.) that leads to a count-to-infinity scenario.

Part b

In this topology, does using split horizon (ie, when you don't advertise routes learned from some neighbor router X back to X) prevent count to infinity to happening? Why or why not?

Part c

Why can't count-to-infinity happen in a link state routing protocol?

Part d

Why can't count-to-infinity happen in a path vector protocol (like BGP)?

Problem 3: BGP - AS relationships and Gao-Rexford principles

Consider the figure below, where nodes represent ASes and arrows represent customer-provider AS relationships. Note that the arrows do not constrain the direction of trafficthey only relate to the BGP announcements!

For this problem, assume that ASes follow the Gao-Rexford model we discussed in class, and that ASes A and B eventually learn all of the advertisments that the other one makes via their respective providers.

Part a

What is the largest prefix that A can advertise to its providers, given that it has two customers X and Y, with prefixes as shown in the figure?

Part b

True or False: If B and A decide to become peers, B will start advertising Y's prefix. Explain your reasoning.

Part c

If X decides to also become a customer of B (creating the dashed line in the figure), what new prefix will B advertise to its providers?

Part d

Normally, X receives BGP announcements about Y from A, which allows nodes in X to know how to reach nodes in Y. If X becomes a customer of B (ie, when the dashed line is created), does B receive a route to reach Y via X? Why or why not?

Part e

Say the administrators of X were considering becoming a customer of B, but then decided not to do so (ie, no dashed line). B's administrators get mad and advertise X's prefix anyway, even though they have no link to X. What happens to traffic sent to or from X?