Chapter 2 Questions
Chapter 2 Questions
Answer: The Web: HTTP; file transfer: FTP; remote login: Telnet; e-mail: SMTP; BitTorrent file sharing:
BitTorrent protocol
Answer: Network architecture refers to the organization of the communication process into layers (e.g.,
the five-layer Internet architecture). Application architecture, on the other hand, is designed by an
application developer and dictates the broad structure of the application (e.g., client-server or P2P).
For a communication session between a pair of processes, which process is the client and which is the
server? -
Answer: The process which initiates the communication is the client; the process that waits to be
contacted is the server.
For a P2P file-sharing application, do you agree with the statement, "There is no notion of client and
server sides of a communication session"? Why or why not? -
Answer: No. In a P2P file-sharing application, the peer that is receiving a file is typically the client and the
peer that is sending the file is typically the server.
What information is used by a process running on one host to identify a process running on another
host? -
Answer: The IP address of the destination host and the port number of the socket in the destination
process.
Suppose you wanted to do a transaction from a remote client to a server as fast as possible. Would you
use UDP or TCP? Why? -
Answer: You would use UDP. With UDP, the transaction can be completed in one roundtrip time (RTT) -
the client sends the transaction request into a UDP socket, and the server sends the reply back to the
client's UDP socket. With TCP, a minimum of two RTTs are needed - one to set-up the TCP connection,
and another for the client to send the request, and for the server to send back the reply.
Referring to Figure 2.4, we see that none of the applications listed in Figure 2.4 requires both no data
loss and timing. Can you conceive of an application that requires no data loss and that is also highly
time-sensitive? -
Answer: One such example is remote word processing, for example, with Google docs. However,
because Google docs runs over the Internet (using TCP), timing guarantees are not provided.
List the four broad classes of services that a transport protocol can provide. For each of the service
classes, indicate if either UDP or TCP (or both) pro- vides such a service. -
Answer: a) Reliable data transfer TCP provides a reliable byte-stream between client and server but UDP
does not.
c) A guarantee that data will be delivered within a specified amount of time Neither
Recall that TCP can be enhanced with SSL to provide process-to-process security services, including
encryption. Does SSL operate at the transport layer or the application layer? If the application developer
wants TCP to be enhanced with SSL, what does the developer have to do? -
Answer: SSL operates at the application layer. The SSL socket takes unencrypted data from the
application layer, encrypts it and then passes it to the TCP socket. If the application developer wants TCP
to be enhanced with SSL, she has to include the SSL code in the application.
Handshaking is the process that establishes communication between two networking devices.
Answer: 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.
It’s confusing, but it’s more appropriate to say TCP does the handshake and HTTP is a protocol layer above TCP that doesn’t think or
worry about handshaking etc.
HTTP isn’t a “handshaking protocol” not because a handshake doesn’t happen, but because it’s not in HTTP’s protocol, but TCP’s.
Why do HTTP, FTP, SMTP, and POP3 run on top of TCP rather than on UDP? - simply, because of the reliability.
Answer: The applications associated with those protocols require that all application data be received in
the correct order and without gaps. TCP provides this service whereas UDP does not.
Consider an e-commerce site that wants to keep a purchase record for each of its customers. Describe
how this can be done with cookies. -
Answer: When the user first visits the site, the server creates a unique identification number, creates an
entry in its back-end database, and returns this identification number as a cookie number. This cookie
number is stored on the user's host and is managed by the browser. During each subsequent visit (and
purchase), the browser sends the cookie number back to the site. Thus the site knows when this user
(more precisely, this browser) is visiting the site.
Describe how Web caching can reduce the delay in receiving a requested object. Will Web caching
reduce the delay for all objects requested by a user or for only some of the objects? Why? -
Answer: Web caching can bring the desired content "closer" to the user, possibly to the same LAN to
which the user's host is connected. Web caching can reduce the delay for all objects, even objects that
are not cached, since caching reduces the traffic on links.
Telnet into a Web server and send a multiline request message. Include in the request message the If-
modified-since: header line to force a response message with the 304 Not Modified status code. -
Answer: Telnet is not available in Windows 7 by default. to make it available, go to Control Panel,
Programs and Features, Turn Windows Features On or Off, Check Telnet client. To start Telnet, in
Windows command prompt, issue the following command > telnet webserverver 80
where "webserver" is some webserver. After issuing the command, you have established a TCP
connection between your client telnet program and the web server. Then type in an HTTP GET message.
An example is given below:
--------------------------------------
Host: utopia.poly.edu
ETag: "1631-3a3-3c6d478b'
-------------------------------------------
Since the index.html page in this web server was not modified since Fri, 18 May 2007 09:23:34 GMT, and
the above commands were issued on Sat, 19 May 2007, the server returned "304 Not Modified". Note
that the first 4 lines are the GET message and header lines inputed by the user, and the next 4 lines
(starting from HTTP/1.1 304 Not Modified) is the response from the web server.
Answer: FTP uses two parallel TCP connections, one connection for sending control information (such as
a request to transfer a file) and another connection for actually transferring the file.
Because the control information is not sent over the same connection that the file is sent over, FTP
sends control information out of band.
Suppose Alice, with a Web-based e-mail account (such as Hotmail or gmail), sends a message to Bob,
who accesses his mail 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. -
Answer: The message is first 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.
Print out the header of an e-mail message you have recently received. How many Received: header lines
are there? Analyze each of the header lines in the message. -
Answer: Received:
Received:
from hotmail.com ([65.55.135.106]) by bay0-omc3-s3.bay0.hotmail.com with Microsoft
SMTPSVC(6.0.3790.2668); Sat, 19 May 2007 16:52:42 -0700
Received:
from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 19 May 2007 16:52:41 -0700
Message-ID: <[email protected]>
Bcc:
Return-Path: [email protected]
Received: This header field indicates the sequence in which the SMTP servers send and receive the mail
message including the respective timestamps. In this example there are 4 "Received:" header lines. This
means the mail message passed through 5 different SMTP servers before being delivered to the
receiver's mail box. The last (forth) "Received:" header indicates the mail message flow from the SMTP
server of the sender to the second SMTP server in the chain of servers. The sender's SMTP server is at
address 65.55.135.123 and the second SMTP server in the chain is by130fd.bay130.hotmail.msn.com.
The third "Received:" header indicates the mail message flow from the second SMTP server in the chain
to the third server, and so on. Finally, the first "Received:" header indicates the flow of the mail
messages from the forth SMTP server to the last SMTP server (i.e. the receiver's mail server) in the
chain.
From: This indicates the email address of the sender of the mail. In the given example, the sender is
"[email protected]"
To: This field indicates the email address of the receiver of the mail. In the example, the receiver is
"[email protected]"
Subject: This gives the subject of the mail (if any specified by the sender). In the example, the subject
specified by the sender is "Test mail"
Date: The date and time when the mail was sent by the sender. In the example, the sender sent the mail
on 19th May 2007, at time 23:52:36 GMT.
Mime-version: MIME version used for the mail. In the example, it is 1.0.
Content-type: The type of content in the body of the mail message. In the example, it is "text/html".
Return-Path: This specifies the email address to which the mail will be sent if the receiver of this mail
wants to reply to the sender. This is also used by the sender's mail server for bouncing back
undeliverable mail messages of mailer-daemon error messages. In the example, the return path is
"[email protected]".
From a user's perspective, what is the difference between the download-and- delete mode and the
download-and-keep mode in POP3? -
Answer: With download and delete, after a user retrieves its messages from a POP server, the messages
travelling
are deleted. This poses a problem for the nomadic user, who may want to access the messages from
many different machines (office PC, home PC, etc.). In the download and keep configuration, messages
are not deleted after the user retrieves the messages. This can also be inconvenient, as each time the
user retrieves the stored messages from a new machine, all of non-deleted messages will be transferred
to the new machine (including very old messages).
Is it possible for an organization's Web server and mail server to have exactly the same alias for a
hostname (for example, foo.com)? What would be the type for the RR that contains the hostname of
the mail server? -
Answer: Yes an organization's mail server and Web server can have the same alias for a host name. The
MX record is used to map the mail server's host name to its IP address.
Look over your received emails, and examine the header of a message sent from a user with an .edu
email address. Is it possible to determine from the header the IP address of the host from which the
message was sent? Do the same for a message sent from a gmail account. -
Answer: You should be able to see the sender's IP address for a user with an .edu email address. But you
will not be able to see the sender's IP address if the user uses a gmail account.
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? -
Answer: 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 provides chunks to
Bob throughout a 30-second interval.
Consider a new peer Alice that joins BitTorrent without possessing 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? -
Answer: Recall that in BitTorrent, a peer picks a random peer and optimistically unchokes the peer for a
short period of time. Therefore, Alice will eventually be optimistically unchoked by one of her neighbors,
during which time she will receive chunks from that neighbor.
What is an overlay network? Does it include routers? What are the edges in the overlay network? -
Answer: The overlay network in a P2P file sharing system consists of the nodes participating in the file
sharing system and the logical links between the nodes. There is a logical link (an "edge" in graph theory
terms) from node A to node B if there is a semi-permanent TCP connection between A and B. An overlay
network does not include routers.
Consider a DHT with a mesh overlay topology (that is, every peer tracks all peers in the system). What
are the advantages and disadvantages of such a design? What are the advantages and disadvantages of
a circular DHT (with no shortcuts)? -
Answer: Mesh DHT: The advantage is in order to a route a message to the peer (with ID) that is closest
to the key, only one hop is required; the disadvantage is that each peer must track all other peers in the
DHT. Circular DHT: the advantage is that each peer needs to track only a few other peers; the
disadvantage is that O(N) hops are needed to route a message to the peer that is closest to the key.
List at least four different applications that are naturally suitable for P2P architectures. (Hint: File
distribution and instant messaging are two.) -
b) Instant Messaging
c) Video Streaming
d) Distributed Computing
In Section 2.7, the UDP server described needed only one socket, whereas the TCP server needed two
sockets. Why? If the TCP server were to support n simultaneous connections, each from a different
client host, how many sockets would the TCP server need? -
Answer: With the UDP server, there is no welcoming socket, and all data from different clients enters
the server through this one socket. With the TCP server, there is a welcoming socket, and each time a
client initiates a connection to the server, a new socket is created. Thus, to support n simultaneous
connections, the server would need n+1 sockets.
For the client-server application over TCP described in Section 2.7, why must the server program be
executed before the client program? For the client- server application over UDP, why may the client
program be executed before the server program? -
Answer: For the TCP application, as soon as the client is executed, it attempts to initiate a TCP
connection with the server. If the TCP server is not running, then the client will fail to make a
connection. For the UDP application, the client does not initiate connections (or attempt to
communicate with the UDP server) immediately upon execution
The number of objects in a Web page which consists of 4 jpeg images and HTML text is
________
a) 4
b) 1
c) 5
d) 7
The time taken by a packet to travel from client to server and then back to the client is called
__________
a) STT
b) RTT
c) PTT
d) JTT
The values GET, POST, HEAD etc are specified in ____________ of HTTP message
a) Request line
b) Header line
c) Status line
d) Entity body
The __________ method when used in the method field, leaves entity body empty.
a) POST
b) SEND
c) GET
d) PUT
The HTTP response message leaves out the requested object when ____________ method is
used
a) GET
b) POST
c) HEAD
d) PUT
Which of the following is present in both an HTTP request line and a status line?
a) HTTP version number
b) URL
c) Method
d) None of the mentioned
UDP provides a reliable byte-stream between client and server but TCP does not.
True
False
To deliver a message to the correct application program running on a host, the _______ address must be
consulted.
a. port
b. IP
c. physical
d. none of the above