• No results found

Section #6: Addressing

N/A
N/A
Protected

Academic year: 2021

Share "Section #6: Addressing"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

Section #6: Addressing

Problem 1: Routing entries

Consider the following routing table for router A, given in CIDR (“slash-n”) notation: 56.162.0.0/15: Port 0

56.164.0.0/15: Port 1 56.166.0.0/16: Port 2 56.167.0.0/16: Port 3 Default: Port 4

a) What is the range of IP addresses in each of the subnets? Convert each to binary representation and identify what the network prefix is, as well as the subnet mask. 56.162.0.0/15:

Binary Representation: 00111000.10100010.0000000.00000000 Subnet Mask: 11111111.11111110.00000000.00000000 (255.254.0.0) Address Range: 56.162.0.0 to 56.163.255.255 (inclusive)

56.164.0.0/15:

Binary Representation: 00111000.10100100.0000000.00000000 Subnet Mask: 11111111.11111110.00000000.00000000 (255.254.0.0) Address Range: 56.164.0.0 to 56.165.255.255 (inclusive)

56.166.0.0/16:

Binary Representation: 00111000.10100110.0000000.00000000 Subnet Mask: 11111111.11111111.00000000.00000000 (255.255.0.0) Address Range: 56.166.0.0 to 56.166.255.255 (inclusive)

56.167.0.0/16:

Binary Representation: 00111000.10100111.0000000.00000000 Subnet Mask: 11111111.11111111.00000000.00000000 (255.255.0.0) Address Range: 56.167.0.0 to 56.167.255.255 (inclusive)

(2)

b) Suppose a packet arrives to router A with destination 56.163.17.8. What port will router A send the packet out on?

Port 0

c) Draw the LPM (longest prefix match) tree1 for router A.

For brevity, only the 2nd octet is shown in the tree. The 1st octet is 00111000, as above, and the 3rd and 4th octets are wild cards.

1

(3)

d) Now suppose that Router A is advertising its routes to another router, router B (shown in the diagram below). What routes will Router A advertise? Remember to aggregate routes, if possible.

The routing entrys for 56.166.0.0/16 and 56.167.0.0/16 can be aggregated into a single

advertisement for 56.166.0.0/15 (in the tree, this is equivalent to combining the two bottom right leafs into their parent node). Then, 56.166.0.0/16 can be combined with 56.164.0.0/16 to create a single advertisement for 56.164.0.0/15. The last subnet cannot be aggregated, leaving

56.164.0.0/14 and 56.162.0.0/15.

Problem 2: Network Address Translation and DHCP: What’s the difference?

You’ve been hired by Scott Shenker to set up a network for use by his 32 graduate students. a) Suppose Scott wants to assign each graduate student their own, unique address. What is the smallest address space that will accommodate all of his graduate students? Give an example subnet, in CIDR notation, that will allow exactly one address per graduate student. Scott needs 2^5 = 32 unique addresses, which corresponds to a /27 subnet. Any /27 subnet is an acceptable answer here; for example, 42.76.3.224/27.

b) Money is tight and Scott decides to sell half of his address space.

i) Assuming Scott owns the subnet you named in part (a), what subnet(s) can Scott sell? Scott can sell either of the /28 subnets associated with the /27 subnet named above. For the example given here, Scott can sell 42.76.3.224/28 or 42.76.3.240/28.

ii) Scott insists that he still wants each of his graduate students to get their own, publicly accessible IP address when they are using the network. He also mentions that no more

(4)

than half of his graduate students are using the network at any given time. How can you set up his network to meet these requirements?

You should set up Scott’s network to use DHCP. DHCP assigns temporary addresses to hosts while they are using the network (see lecture slides for details).

c) Scott hires a new professor in his lab, Sylvia Ratnasamy. Sylvia needs network addresses for her graduate students, so in his infinite generosity, Scott decides to give all but one of his IP addresses to Sylvia. What should you do now to allow all of Scott’s graduate students to

access the internet?

You should recommend to 31 of Scott’s students that they switch advisor to Sylvia.

You should set up Scott’s network to use network address translation (NAT). A NAT box that sits between Scott’s graduate students and the internet assigns each user an internal IP address (there are special IP address blocks designated for internal addressing, e.g. 10.0.0.0/8). When internal users send packets out into the internet, a NAT box translates internal addresses to external addresses using a port mapping. For example, assume the one address Scott kept is 42.76.3.224. If Panda sends a packet from internal address 10.0.0.5, port 33122, the NAT box assigns a port to this connection, e.g., port 100. The NAT box assigns unique ports to each client connection. After choosing a port, the NAT box re-writes the source address in Panda’s packet to be 42.76.3.224:100 (IP address 42.76.3.224, port 100), stores this mapping, and sends the packet on its way. When the NAT box receives incoming packets to 42.76.3.224:100, it looks up this address in its map of external to internal addresses, and then rewrites the destination address to be the corresponding internal address, 10.0.0.5:33122. d) Panda, one of Scott’s graduate students, likes to run an internet chat application (Panda-chat) to chat with other graduate students when he is in the office. Panda-chat listens for incoming chats on port 33122 and displays them on the screen. If the user replies to a chat received using Panda-chat, Panda-chat sends the reply to the IP address and port given in the original chat.

i) After you’ve implemented your solution in part (c), Panda sends a chat to Colin, who also runs Panda-chat. Colin is not on Scott’s network, and has a public IP address (164.23.1.8). Will Panda be able to send a chat message to Colin? If so, explain how this will work. If not, explain why not.

Yes. Panda sends the chat to 164.23.1.8:33122, which is a public address. Colin is running Panda-chat on port 33122, so receives the message.

ii) Colin replies to Panda’s chat. Will Panda receive the reply? If so, explain how this will work. If not, explain why not.

Yes. When Panda sent the chat in part (i), the NAT that you configured assigns a public IP address and port to the connection. For example, if Panda’s internal address is

(5)

10.0.0.5, the NAT might map internal address 10.0.0.5:33122 to external address 42.76.3.224:100 (as in the example in part (c)). When Colin replies to the chat, Panda-chat sends Colin’s reply to 42.76.3.224:100. The NAT translates this address to 10.0.0.5:33122, which is where Panda-chat is listening for new chats on Panda’s machine, so Panda receives the message.

iii) Later, Thurston attempts to send a chat to Panda. Thurston also has a public IP address (123.4.5.6). Will Thurston be able to send a chat message to Panda? If so, explain how this will work. If not, explain why not.

No, because Thurston has no way of knowing which port to use to send packets to Panda’s chat client. The only way Thurston can find this out is if Panda initiates a connection with Thurston (as in part ii).

iv) How can you re-configure the network to allow Panda to use Panda-chat? You can set up a port mapping in the NAT box such that packets to port 33122 are always directed to port 33122 on Panda’s machine.

References

Related documents

The course focuses on advanced internet protocol (IP) addressing techniques (Network Address Translation [NAT], port address translation [PAT]) and dynamic host

In Provider Interface Settings, select Static IP Address (the most common configuration), or DHCP if a DHCP server assigns the 5300-S internal address.. Enter an

While the DHCP server automatically assigns the IP address of the IP-PT, the subnet mask address, and the default gateway address to the IP-PT, the PBX’s IP address must be

While the DHCP server automatically assigns the IP address of the IP-PT, the subnet mask address, and the default gateway address to the IP-PT, the PBX’s IP address must be

-Dynamic NAT – Dynamic NAT intercepts traffic from a host on the internal network and maps it to an externally registered Internet Protocol (IP) address available from a pool

The load balancer must be in a NAT configuration (internal and external sub nets) with the real servers using the load balancers internal Floating IP address as their default

The firewall's NAT module replaces the original source address with one of the IP addresses from the pool, records the original and replacement IP addresses in a translation table,

• Configure a router to use network address translation (NAT) to convert internal IP addresses, typically private addresses, into outside public addresses.. • Configure static