Final Exam Revision Flashcards
Suppose Alice, with a Web-based email account (such as Hotmail or gmail), sends a message to Bob, who accesses his email from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application layer protocols that are used to move the message between the two hosts.
Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.
What is meant by a handshaking protocol?
A protocol uses handshaking if the two communicating entities first exchange control packets before sending data to each other. SMTP uses handshaking at the application layer whereas HTTP does not.
In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval. Will Bob necessarily return the favor and provide chunks to Alice in this same interval? Why or why not?
It is not necessary that Bob will also provide chunks to Alice. Alice has to be in the top 4 neighbors of Bob for Bob to send out chunks to her; this might not occur even if Alice is provides chunks to Bob throughout a 30-second interval. (see lecture note 2, p.74-76)
Consider a new peer Alice that joins BitTorrent without processing any chunks. Without any chunks, she cannot become a top-four uploader for any of the other peers, since she has nothing to upload. How then will Alice get her first chunk?
Alice will get her first chunk as a result of her being selected by one of her neighbors as a result of an “optimistic unchoke,” for sending out chunks to her. (see lecture note 2, p.74-76)
Explain how sequence numbers and acknowledgement numbers are used in TCP. Illustrate you answer with an example data exchange in a telnet session.
The sequence number for a segment is the byte-stream number of the first byte in the segment. The acknowledgment number in a segment is the sequence number of the next byte the host sending the segment is expecting from the receiving host. An example of a telnet session is shown below, where we suppose the starting sequence numbers are 42 and 79 for the client and server, respectively. (See textbook, p. 245- 248)


Suppose that a web server runs in Host C on port 80. Suppose this web server uses persistent connections, and is currently receiving requests from two different hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through different sockets, do both of the sockets have port 80? Discuss and explain.
For each persistent connection, the Web server creates a separate “connection socket”. Each TCP connection socket is identified with a four-tuple: (source IP address, source port number, destination IP address, destination port number). When host C receives and IP datagram, it examines these four fields in the datagram/segment to determine to which socket it should pass the payload of the TCP segment. Thus, the requests from A and B pass through different sockets. The identifier for both of these sockets has 80 for the destination port; however, the identifiers for these sockets have different values for source IP addresses.
In rdt protocols, why do we need to have sequence numbers?
Sequence numbers are required for a receiver to find out whether an arriving packet contains new data or is a retransmission.
What is the difference between persistent HTTP with pipelining and persistent HTTP without pipelining?
With persistent HTTP connection, the http server leaves the TCP connection open after sending a response. Subsequent requests and responses can be made using the same TCP connection. With pipelining, subsequent requests can be made back-to- back, without waiting for replies to earlier requests. When a server receives the back- to-back requests, it sends the objects back-to-back. When pipelining is not used, the client sends a new request only after it obtains a response to its earlier request.
Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up to and including byte 248. Suppose that Host A then sends two segments to Host B back-to-back. The first and second segments contain 40 and 60 bytes of data, respectively. In the first segment, the sequence number is 249, source port number is 503, and the destination port number is 80. Host B sends an acknowledgement whenever it receives a segment from host A.
a) In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?
b) If the first segment arrives before the second segment, in the acknowledgement of the first arriving segment, what is the acknowledgement number, the source port number, and the destination port number?
c) If the second segment arrives before the first segment, in the acknowledgement of the first arriving segment, what is the acknowledgement number?
d) Suppose that the two segments sent by A arrive in order at B. The first acknowledgement is lost and the second acknowledgment arrives after the first timeout interval, as shown in the figure below. Complete the diagram, showing all other segments and acknowledgements sent. (Assume there is no additional packet loss). For each segment you add to the diagram, provide the sequence number and number of bytes of data; for each acknowledgement that you add, provide the acknowledgement number.
a) In the second segment from Host A to B, the sequence number is 289, source port number is 503 and destination port number is 80.
b) If the first segment arrives before the second, in the acknowledgement of the first arriving segment, the acknowledgement number is 289, the source port number is 80 and the destination port number is 503.
c) If the second segment arrives before the first segment, in the acknowledgement of the first arriving segment, the acknowledgement number is 249, indicating that it is still waiting for bytes 249 and onwards.
d)
Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110.
a) How much data is in the first segment?
b) Suppose the first segment is lost but the second segment arrives at B. In the acknowledgment that B sends to A, what will be the acknowledgment number?
a) 20 bytes b) Ack number = 90
Suppose that the UDP receiver computes the Internet checksum for the received UDP segment and finds that it matches the value carried in the checksum field. Can the receiver be absolutely certain that no bit errors have occurred? Explain.
No, the receiver cannot be absolutely certain that no bit errors have occurred. This is because of the manner in which the checksum for the packet is calculated. If the corresponding bits (that would be added together) of two 16-bit words in the packet were 0 and 1 then even if these get flipped to 1 and 0 respectively, the sum still remains the same. Hence, the 1s complement the receiver calculates will also be the same. This means the checksum will verify even if there was transmission error.
What is the sequence of messages for acquiring an IP via DHCP?
The sequence are: (a) host broadcasts “DHCP discover”msg, (b) DHCP server responds with “DHCP offer”msg, (c) host requests IP address: “DHCP request”msg, (d) DHCP server sends address: “DHCP ack”msg. See diagram in lecture note 4, p.36.
What is network address translation (NAT)? In what situation do you need to use NAT?
NAT allows many devices to be connected using just one IP address. It uses the NAT translation table to map a single IP address to many local private addresses by taking advantage of the 16 bits port number. The situations where one uses NAT is when you have only one IP address but with many devices in a home network trying to access the internet.
Discuss how a hierarchical organization of the internet (i.e., through hierarchical routing) has made it possible to scale to millions of users.
Routers are aggregated into autonomous systems (ASs). Within an AS, all routers run the same intra-AS routing protocol. Special gateway routers in the various ASs run the inter-autonomous system routing protocol that determines the routing paths among the ASs. The problem of scale is solved since an intra-AS router need only know about routers within its AS and the gateway router(s) in its AS.
Suppose a peer with username Alice discovers through querying that a peer with username Bob has a file it wants to download. Also suppose that Alice and Bob are both behind a NAT. Can you devise a technique that will allow Alice to establish a TCP connection with Bob without application-specific NAT configuration? If you have difficulty devising such a technique, discuss why.
It is not possible to devise such a technique. In order to establish a direct TCP connection between Alice and Bob, either Alice or Bob must initiate a connection to the other. But the NATs covering Alice and Bob drop SYN packets arriving from the

WAN side. Thus neither Alice nor Bob can initiate a TCP connection to the other if they are both behind NATs. This is one of the impacts of NAT on P2P applications.