You are on page 1of 4

TUTORIAL 1: CHAPTER 2

1. Many networks, including the Internet, provide more than one transport-layer
protocol. When you develop an application, you must choose one of the
available transport-layer protocols. How do you make this choice? What
parameters do you have to take into considerations?
2. 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 Alices host to Bobs host. List the
series of application layer protocols that are used to move the message
between the two hosts.
3. Consider a short, 10-meter link, over which a sender can transmit at a rate of
150 bits/sec in both directions. Suppose that a packets containing data are
100,000 bits long, and packets containing only control (e.g ACK or
handshaking) are 200 bits long. Assume that N parallel connections each get
1/N of the link bandwidth. Now consider the HTTP protocol, and suppose that
each downloaded object is 100 Kbits long, and that the initial downloaded
object contains 10 referenced objects from the same sender. Would parallel
downloads via parallel instances of non-persistent HTTP make sense in this
case? Now consider persistent HTTP. Do you expect significant gains over the
non-persistent case? Justify and explain your answer.
4. Explain the difference between control and data connection in FTP.
5. How does SMTP differ from HTTP in terms of data format?
6. Consider what happens when a browser (that is, an HTTP client), running on
some users host, requests the URL www.somesite.com/index.html. In order
for the users host to be able to send an HTTP request message to the Web
server www.somesite.com, the users host must first obtain the IP address of
www.somesites.com. Explain the steps through which the IP address for such
a hostname is obtained by the client.
7. Say you have installed and compiled the programs TCPClient and UDPClient
on one host ad TCPServer and UDPServer on another host.
a) Suppose you run TCPClient before you run TCPServer. What
happens? Why?
b) Suppose you run UDPClient before you run UDPServer. What
happens? Why?
c) What happens if you use different port numbers for the client and
server sides?
8. Suppose that in UDPClient.c, after we create the socket, we add the line:
clientSocket_bind (5432)

Will it become necessary to change UDPServer.c? What are the port numbers
for the sockets in and UDPServer? What were they before making this
change?

SOLUTION: TUTORIAL 1
1. Parameters to consider:
a) Data loss can the application tolerate some loss?
b) Timing does the application require low delay?
c) Throughput what is the min. amount of throughput requires or the
application can make use whatever throughput they get.
d) Security does the transport layer protocol can provide encryption?
2. The message is first sent from Alices host to her mail server over HTTP.
Alices mail server then sends the message to Bobs mail server over SMTP.
Bob then transfers the message from his mail server to his host over POP3.
3. Note that each downloaded object can be completely put into one data
packet. Let Tp denote the one-way propagation delay between the client and
the server.
First consider parallel downloads using non-persistent connections. Parallel
downloads would allow 10 connections to share the 150 bits/sec bandwidth,
giving each just 15 bits/sec. Thus, the total time needed to receive all objects
is given by:

(200/150+Tp + 200/150 +Tp + 200/150+Tp + 100,000/150+ Tp )


+ (200/(150/10)+Tp + 200/(150/10) +Tp + 200/(150/10)+Tp + 100,000/(150/10)+ Tp )
= 7377 + 8*Tp (seconds)
Now consider a persistent HTTP connection. The total time needed is given
by:

(200/150+Tp + 200/150 +Tp + 200/150+Tp + 100,000/150+ Tp )


+ 10*(100,000/150+ Tp )
=7337 + 14*Tp (seconds)
Assuming the speed of light is 3*10 8 m/sec, then Tp=10/(3*108)=0.03
microsec. Tp is therefore negligible compared with transmission delay.
Thus, we see that persistent HTTP is not significantly faster (less than 1
percent) than the non-persistent case with parallel download.
4. Control connection is used for sending control information between two hosts
information such as user ID, password, commands to change remote
directory, and commands to put and get files.
Data connection is used to send file.

5. SMTP uses a line containing only a period to mark the end of a message body.
HTTP uses Content-Length header field to indicate the length of a message
body.
HTTP cannot use the method used by SMTP, because HTTP message could be
binary data, whereas in SMTP, the message body must be in 7-bit ASCII
format.
6. Steps:
a) The browser extract hostname, www.somesites.com, from the URL
and passes the hostname to the client side of the DNS application.
b) The DNS client sends a query containing the hostname to a DNS
server.
c) The DNS client receives a reply, which includes the IP address for
the hostname.
d) Once the browser receives the IP address from DNS, it can initiate a
TCP connection to the HTTP server process located at port 80 at the
IP address.
7. a) If you run TCPClient first, then the client will attempt to make a TCP
connection with a non-existent server process. A TCP connection will not be
made.
b) UDPClient doesn't establish a TCP connection with the server. Thus,
everything should work fine if you first run UDPClient, then run UDPServer,
and then type some input into the keyboard.
c) If you use different port numbers, then the client will attempt to establish a
TCP connection with the wrong process or a non-existent process. Errors will
occur.
8. In the original program, UDPClient does not specify a port number when it
creates the socket. In this case, the code lets the underlying operating
system choose a port number. With the additional line, when UDPClient is
executed, a UDP socket is created with port number 5432 .
UDPServer needs to know the client port number so that it can send packets
back to the correct client socket. Glancing at UDPServer, we see that the
client port number is not hard-wired into the server code; instead,
UDPServer determines the client port number by unraveling the datagram it
receives from the client. Thus UDP server will work with any client port
number, including 5432. UDPServer therefore does not need to be modified.
Before:
Client socket = x (chosen by OS)
Server socket = 9876
After:
Client socket = 5432