CMPE 150/L - Fall'17 Sample questions #5 solution 1. What is the difference between routing and forwarding? Routing means finding a suitable path for a packet from sender to destination and forwarding is the process of sending the packet toward the destination based on routing information. 2. In a Virtual circuit (VC) network, Alice wants to send data to Bob. i. What needs to happen before Alice can start sending data to Bob? Explain. The network needs to reserve resources for the communication between Alice and Bob by establishing a virtual circuit (VC) between their hosts. ii. How long does it take before the first piece of data can be transmitted from Alice to Bob? Explain. It takes 1 RTT which is the time to set up the VC from source to destination end-to-end and a confirmation that the VC has been established from the destination back to the source. iii. If Alice and Bob were connected through a datagram network, how long does it take before Alice can transmit the first piece of data to Bob? Explain. On a datagram network, Alice can start transmitting packets to Bob as soon as there is data to be transmitted. 3. A NAT device typically sits at the ``entrance/exit'' of an organization's network. Describe what the NAT device does, including information it needs to maintain, when: i. A host within the organization's network sends traffic to another host within the network. Because both hosts are in the same subnet, the traffic between the two hosts will not hit the NAT device (no need for network address translation). ii. A host within the organization's network sends traffic to a host on the Internet. In this case, the NAT box will replace the source address in the packets originating from the host with a “routable” IP address, e.g., the NAT box’ IP address. The source port number will also be replaced with a port number chosen by the NAT box. This address translation will also cause an entry to be added to the NAT’s box address translation table, mapping the newly assigned port number to the original (source IP address, port number) tuple. iii. How do you think NAT addresses the problem of IP address depletion? NAT allows multiple hosts to share the same outfacing IP address, acting as if it were multiplying the number of available IP addresses. At the limit, an entire organization’s network can be using a single routable IP address. iv. Explain how NAT handles incoming traffic in response to traffic originating within the organization's network. It uses the destination port number, which was the source port number assigned by the NAT box when translating the original (source IP address, port number), to look up its address translation table. The original (source IP address, source port number) ls retrieved and the NAT box uses that to replace the destination IP address and port number in the packet. The packet is then forwarded back to the host which originated the request. v. What is the NAT traversal problem? The NAT traversal problem refers to the problem of forwarding traffic which originates from outside of a network to a host within the network which is behind a NAT box, and therefore is not assigned a routable IP address. 4. Consider the network topology shown in slide 24 of lecture notes 14. In that configuration the subnet mask is /24. i. How many different subnets can be used? This question can have multiple interpretations. For example, based on the diagram, one can say that there are 3 subnets. Another possible answer is to look at the subnets and the addressing scheme and assume that from the 3 bytes used for the subnet mask, the least significant byte is used as the subnet number (given that the different subnets are 223.1.*) and consequently there can be 2^8 different subnets. ii. How many different hosts can be connected to each subnet? 32-24 = 8 bits Number of hosts= 2^(8) - 2 = 254 hosts iii. If a new host wants to connect to subnet 223.1.2.0/24, what range of IP addresses can be assigned to the host? 223.1.2.1 - 223.1.2.254 iv. Suppose each subnet needs to accommodate 1,000 different hosts. How can this be accomplished? 2^(9) = 510 hosts only But 2^(10) = 1022 hosts So we need a subnet mask of 22 at least to accommodate 1000 hosts. 5. A router has the following (CIDR) entries in its routing table: Address/mask Next hop 135.46.56.0/22 Interface 0 135.46.60.0/22 Interface 1 192.53.40.0 Interface 2 default Interface 3 For each of the following IP addresses, how does the router forward a packet it receives with that address? (a) 135.46.63.10 Interface 1 (b) 135.46.57.14 Interface 0 (c) 135.46.52.2 Interface 3 (d) 192.53.40.7 Interface 3 (e) 192.53.56.7 Interface 3