Download this is netwrok practic and more Exercises Network Programming in PDF only on Docsity!
CMPSC-F375 - solution
Problems for Final Exam Preparation
(Note: The following practice questions are intended to help you prepare for the exam. Be sure to also review class examples and homework assignments for comprehensive study.)
- A typical router in the core of the Internet has: (a) multiple network interfaces, each with its own IP address (b) a switching fabric between its input ports and output ports (c) buffers to hold a queue of packets at input or output ports (d) a scheduling algorithm to determine which queued packet goes next (e) all of the above
- Switched Ethernet is superior to shared Ethernet because: (a) it isolates each station into its own collision domain (b) each LAN segment can have different link speeds (c) the Ethernet switch does selective forwarding between LAN segments (d) the Ethernet switch understands and uses CSMA/CD on each LAN segment (e) all of the above
- In the Internet Protocol (IPv4), datagrams can be: (a) lost on the way to their destination (b) delayed on the way to their destination (c) corrupted on the way to their destination (d) successfully delivered to their destination (e) all of the above
- For each of the following pairs of terms, explain each term, making sure to identify the similarities (if any) and the key differences between the two terms. (a) (3 points) “DNS” and “ARP” DNS: Domain Name Service - application-layer protocol - maps names to IP addresses - typically uses UDP ARP: Address Resolution Protocol - low layer (link layer) protocol - maps IP addresses to MAC addresses - uses link-layer frames (b) (3 points) “IPv4 address” and “MAC address” IPv4: Internet Protocol (v4) - 32-bit address - network-layer address - software assigned - locally unique - hierarchical structure (network ID + host ID) MAC: Medium Access Control - 48-bit address - datalink-layer address - assigned by manufacturer - globally unique - flat address space
(c) (3 points) “Internet checksum” and “Cyclic Redundancy Check (CRC)” Internet Checksum:
- used by IP (network layer), TCP/UDP (TL)
- 16-bit arithmetic sum with wraparound carryover
- rather weak error detection CRC:
- used by Ethernet and WiFi (link layer)
- uses polynomial code to compute R from M/G using modulo-2 (XOR)
- extremely strong error detection!
- The goal of Internet routing is to deliver IP datagrams from a source host to a destination host. In class, we discussed the logical separation of the Network layer into the data-plane and the control-plane. Use your knowledge of the Network layer to answer the following questions. (a) (3 points) What is the data plane? What key function(s) take place in the data plane? At what time scale does it operate?
- lower-level function in network layer routers that deals with the movement of datagrams from the input ports to the proper output ports (forwarding)
- uses forwarding table (routing table); does lookup for each datagram to make forwarding decision; done at every router, in hardware
- operates at link speed (e.g., microseconds) (b) (3 points) What is the control plane? What key function(s) take place in the control plane? At what time scale does it operate?
- higher-level function in network layer routers that determines the network path to be used for the routing of datagrams
- routing decisions made here; can be local/global decisions using centralized/distributed algorithms; done in software in each router or using SDN controller; produces routing tables to use
- usually operates at time scales of minutes or hours
- Within the Data Link Layer, we studied a variety of Medium Access Control (MAC) protocols to regulate access to a broadcast channel shared by many stations. For each of the following MAC protocols, provide a brief description (either algorithmic or conceptual) of how it works. Where possible, clarify the new features in each protocol that improve upon the MAC protocols earlier in the list. (a) (3 points) Pure ALOHA
- send when ready!
- very low channel access delay (zero), but prone to collisions
- max effective throughput is 1/2e = 18% (b) (3 points) Slotted ALOHA
- improves upon ALOHA by providing timing synchronization (slots)
- when ready, wait until next slot boundary before sending
- slightly higher channel access delay, but fewer collisions
- reduces vulnerable period from two frame times to one frame time
- max effective throughput is 1/e = 37% (c) (3 points) CSMA
- Carrier Sense Multiple Access; requires carrier-sense capability
- listen to the channel before sending
- if channel idle, then send, else defer (wait until idle before sending)
- reduces collisions by a lot (but does not completely eliminate them)
- Consider the network scenario shown below. Client C1, servers S1 and S2, and routers R1 through R4 are all part of the same autonomous system (e.g., the UMass network) and are connected to other ASs in the rest of the Internet via router R4.
a) [4 points] Suppose the user at C1 enters a URL into the browser for a document at S1 and refers to S1 by its name (e.g., S1.cs.umass.edu). The document stored in S1 and returned to the user at C1 contains an embedded URL that is at another site outside the autonomous system shown above (e.g., www.remotesite.com). Which of the elements C1, S1, R1 – R4 will make a query to DNS server S2 to resolve the name S1.cs.umass.edu? The client C1 will need to contact the DNS in order to get the IP address of HTTP server S b) Which of the elements C1, S1, R1 – R4 (if any) will make a query to DNS server S2 to resolve the name www.remotesite.com? Client C1 will contact DN server S2 in order to resolve the name www.remotesite.com c) If S2 does not know the IP address corresponding to www.remotesite.com, which of C1, S1, S2, R1 – R4 will contact an external DNS server, assuming recursive queries? S2 will contact an external DNS server, under recursive DNS queries. d) [4 points] Which of C1, S1, S2, R1 – R4 must be running the TCP protocol? Explain your answer. C1 and S1 are known to be running HTTP, which requires TCP. R4 must be running BGP (the only interdomain protocol being used in the Internet) in order for the BGP speaker in R4 to talk to the BGP speaker on the other side of the ISP access link, in order to get and advertise BGP tables. Hence R4 must also be
running TCP. DNS uses UDP, so server S2 need not run TCP. If the intradomain routers were running OSPF, they would not need to run TCP to exchange tables. e) [4 points] Identify the individual subnets (in an IP addressing sense) in the figure above. Specify an internet address for one interface in each of the subnets. As shown in the figure above, there are six subnets. Each subnet must have a different subnet part of the IP address. In the solution above, the first 24 bits are the subnet address, and they must be different from one subnet to another. f) [3 points] Which of C1, S1, S2, R1 – R4 run an intra-domain routing protocol? All of these must run the intradomain routing protocol g) [3 points] Which of C1, S1, S2, R1 – R4 run an inter-domain routing protocol? Given your answer in e), what address prefix is advertised to ASs outside this network? R4. The prefix 11.11/16 could be advertised to the outside world, since all IP addresses within the network fall within this range. h) [3 points] Assume that the client and servers are connected to R1 using Ethernet, and that the routers are interconnected using a point-to-point protocol. Which of C1, S1, S2, R1 – R4 must be running the ARP protocol? Explain your answer. Any device connected to an Ethernet must be running ARP, so C1, S1, S2, and R must be running ARP
- Consider the network below. a. Show the forwarding table in router A, such that all traffic destined to host H is forwarded through interface 3. Data destined to host H3 is forwarded through Interface 3
Destination Address Link Interface H3 3
b. Can you write down a forwarding table in router A, such that all traffic from H1 destined to host H3 is forwarded through interface 3, while all traffic from H2 destined to host H3 is forwarded through interface 4? No, because the forwarding rule is only based on the destination address (and not the source address).
- Consider a datagram network using 8-bit host addresses. Suppose a router uses longest prefix matching and has the following forwarding table:
Prefix match Interface
- Using link state algorithm , and showing your work, compute the shortest path from G to all other nodes in the network shown below. Use the provided table.
A D F
9 C 3 8
B E G
3 2
Step N’ A B C D E F 0 1 2 3 4 5 6
Step N’ A B C D E F 0 G (^) 5,G 2,G 8,G 1 G E (^) 5,E 8,E 5,G*^ 8,G 2 G EB#^ 14,B 8,E 5,G 8,G 3 G EB D 11,D 8,E 8,G (^4) G EB D C^ 10,C 8,G 5 G EB D CF 10,C 6 G EB D CF A
- Consider the five-node topology shown below, where numbers across the links represent the link costs. Using the distance vector algorithm , compute the distance tables at the nodes A, B, C, D, E in the first three steps (the initialization step and two additional steps) of the algorithm. Use the table provided below. Step 0 of node A’s table is already filled in for you.