Test 3 Review A: Questions

R3a.1.

Explain as best you can how the IP address 209.65.57.4 comes to be allocated to ozark.hendrix.edu.

R3a.2.

What is an authoritative nameserver in DNS?

R3a.3.

Explain the purpose of reverse DNS.

R3a.4.

Why do TCP and UDP introduce ports into their protocols rather than simply using the computers' IP addresses?

R3a.5.

Give two reasons why a programmer might opt for UDP over TCP, even though UDP does not ensure reliable delivery as TCP does.

R3a.6.

Why does TCP include a sequence number in the header of each packet it sends?

R3a.7.

Explain what slow start means in the context of TCP.

R3a.8.

Suppose two hosts are communicating using TCP with a 10-millisecond latency across a 48 megabit-per-second link. If each packet is 1,000 bytes, how big should the window size be?

R3a.9.

Explain what fast retransmit is in the context of TCP.

R3a.10.

How does a TCP client determine the appropriate duration to timeout when awaiting an acknowledgement?

R3a.11.

Why does TCP start with a random sequence number rather than always starting from 0?

R3a.12.

Traditionally one reads a file by repeatedly reading a sequence of bytes into a buffer, with each read returning the next group of bytes from the file. More recently, operating systems have supported memory-mapped I/O, where a portion of the virtual address space can be dedicated to refer to the contents of a file. Explain two advantages of memory-mapped I/O.

Test 3 Review A: Solutions

R3a.1.

An international agency called ICANN allocates blocks of addresses to a regional Internet registry, in this case ARIN, which represents North America. Each such block is a “/8” block — 209.0.0.0/8 in this example. ARIN allocates addresses within this block to organizations. In this case, they may have given AT&T all addresses of the form 209.65.0.0/16, who ther divvies their range of addresses among customers, such as Hendrix College. Thus, Hendrix College ends up receiving the 209.65.56.0/22 block, and Hendrix's IT department decides to dedicate a subrange of that — 209.65.57.0/26 — to the computer science network. The network administrator decides how to assign addresses within that block to individual computers such as ozark.

R3a.2.

For a particular domain name, an authoritative nameserver is the DNS server that is the official authority on the host names and subdomain nameservers for that domain. This distinguishes it from a caching name server, which caches local copies of hostnames and domain as retrieved from other DNS servers so that local hosts can query the caching name server rather than find this information for themselves.

R3a.3.

Reverse DNS takes a query including an IP address, and it determines which hostname corresponds to that address. For example, given 209.65.57.4, reverse DNS would find the hostname ozark.cs.hendrix.edu.

R3a.4.

A port number, allocated uniquely on the computer for each program running, allows a sender to identify the particular program on the destination computer that should receive the message.

R3a.5.
  • TCP involves opening a “connection” between two computers, which is unnecessary overhead when there is no extended communication between the two endpoints, particularly when a server anticipates responding to requests at a high frequency. (This is why DNS usually uses UDP.)

  • In some applications, a packet's data is useless if it does not arrive to the destination the first time. This could be true for voice-over-IP (voIP) applications, where an audio snippet should be played upon receipt. Stock market quotations are another application where only the most up-to-date information is useful.

R3a.6.

Because packets sometimes arrive out of order, or arrive multiple times, or never arrive at all, the receiving computer needs some way of identifying each packet sent. The sequence number allows the receiving computer to know where each packet lies in the overall sequence of packets sent by the sender.

R3a.7.

When the connection is first established, or when a packet times out due to no acknowledgement received, the window size goes to one packet. If that packet is sent and acknowledged, the window size is doubled to two packets. If both are sent and acknowledged, the window size doubles again to four packets. Until it reaches a threshold, it continues doubling the window size as the current window is found to be adequate.

R3a.8.
First we compute how many packets can be delivered per second: 48 × 106 (bits/s) / (8,000 bits/packet) = 6 × 103 packets/s. From this we can compute how many packets can be delivered during the round-trip time between the two hosts: (6 × 103 packets/s) × (20 × 10−3 s) = 120 packets.
R3a.9.

If the sender has sent several packets in the window and receives three acknowledgements in a row with the same acknowledgement number, it concludes that the first unacknowledged packet was not delivered (but at least two subsequent packets were), and so it retransmits that packet withut waiting for a timeout. This allows for faster identification of lost packets and avoids setting the window size back to 1.

R3a.10.

Initially, it assumes a relatively large amount of time — often a few seconds. But as we send packets, we track when they are sent, and upon receiving an acknowledgement, we update our estimate of the average time for an acknowledgment. We also maintain an estimate of the “deviation” — the typical difference between average time and the actual time. The timeout is then computed as the average time plus four deviations.

R3a.11.

If host A always started from 0, then when it communicated with B, another malicious host C could easily guess the current sequence number and send its own packets to B, though labeled as coming from A, and B could not distinguish the genuine packet from A from the spoofed packet. Starting with a random sequence number makes C's job much more difficult.

R3a.12.
  • The traditional technique involves a system call each time we want to read more bytes, and system calls are themselves relatively slow. Memory-mapped I/O does not require system calls.
  • The traditional technique copies data from the operating system's memory into the user process's buffer, and the copying takes time. By contrast, memory-mapped I/O can be implemented so that the program is directly accessing the OS memory for representing the file.
  • Memory-mapped I/O is quite a bit simpler when the program jumps around the file; in the traditional technique, each jump has a system call of its own, called a seek.
  • Two processes can open up the same memory-mapped file, and any changes by one process would be seen immediately by the other. This provides a way that processes can have shared-memory concurrency, even though the processes themselves actually have distinct addresses spaces.