Nothing Special   »   [go: up one dir, main page]

Mid Term 2018 Sol

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Computer Network Midterm 2018

Question 1: ``Quickies''
(45%) Answer each of the following questions briefly, i.e., in at most a few sentences.
a) (10%) What does it mean for a protocol to be stateful? What does it mean for a
protocol to be stateless? Give an example one stateful protocol and one stateless
protocol.
A protocol is stateful if it maintains information about an on-going connection
with the other side(s) over the course of a number of message exchanges. If no
such information is maintained, and each new arriving message is handled
completely separately from previous messages, the protocol is stateless. HTTP is
stateless, FTP is stateful.
b) (10%) List four factors that contribute to the end-to-end delay in a
packet-switched network. Which of these are constant and which of these
depend on the load in the network?
Ans: - processing delay : load-dependent( or load-independent: all correct)
- queueing delay: load-dependent
- transmission delay: load–indep.
- propagation delay: load-indep.
c) (10%) Suppose a web server has 500 ongoing TCP connections. How many
server-side sockets are used? How many server-side port numbers are used?
(Hint: remember the server implements fork() as introduced in lectures)
Ans: If there are 500 ongoing connections, and nothing else happening on the
server, there will 501 sockets in use – the single welcoming socket and the 800
sockets in use for server-to-client communication. The ONLY server-sideport
number in use at the server will be the single port number associated with the
welcoming socket, e.g., port 80 on a web server).
d) (5%) What is the purpose/use of the UDP checksum?
Answer: to detect bit error, i.e., flipped bits, in the UDP segment.

e) (10%) Suppose you would like to urgently deliver 50 terabytes data from Boston
to Los Angeles. You have available a 1Gbps dedicated link for data transfer. Would
you prefer to transmit the data via this link or instead use Fedex overnight
delivery? Explain.
Ans: 50TB * 1000 (converts to Gigabytes) * 1000 (converts to Megabytes) =

50,000,000 / 125 (1Gbps / 8 to put into Megabytes) = 400,000. 400,000 / 86,400

(seconds per day) = ~4.6 days. That is not even close to urgently. That also doesn't

include the overhead for the protocols used Fedex is better.


Question 2: DNS service
(15%) Suppose you open a startup company “sky” and want to set up your company
network. Your network has the following servers:
1. DNS server: “dns1.sky.com” with IP as “140.112.12.40”
2. Web server: “sky.com” with two IP as “140.112.12.55” and “140.112.12.56”.
The web server also has a name as “www.sky.com”.
3. Email server: “galaxy.sky.com” with IP as “140.112.12.60”
Your company’s email address is “username@sky.com”.
a. (5%) What resource records (RRs) do you need to provide to the upper-level
“.com” Registrar?
(sky.com, dns1.sky.com, NS)
(dns1.sky.com, 140.112.12.40, A)

b. (10%) What RRs do you need to put in your company’s DNS server?
(sky.com, 140.112.12.55, A)
(sky.com, 140.112.12.56, A)
(www.sky.com, sky.com, CNAME)
(galaxy.sky.com, 140.112.12.60, A)
(sky.com, galaxy.sky.com, MX)

Question 3: ``Web''
(20%) Consider an http client that wants to retrieve a WWW document at a given
URL. The IP address of the http server is initially unknown. The WWW object at the
URL has one embedded GIF image that resides at the same server as the original
object.
a. (10%) What transport and application layer protocols besides http are
needed in this scenario?
Ans: DNS is needed to determine the 32-bit IP address of the server. TCP is used
to carry the HTTP request; UDP is used to transport the DNS messages.

b. (10%) Suppose that the time needed to contact and receive a reply from
any server (for any protocol) is RTT, and the time to transmit the WWW
object and GIF image is T. How much time (in RTT and T) is needed from
when the user first enters the URL until the complete document is
displayed? Assume that non-persistent http is used. Consider the delays of
all protocols in your answer, not just those of http.
Ans: one RTT to do DNS, one RTT set up 1st TCP connection to WWW server;
one RTT+T to get object, one RTT to set up 2nd TCP connection to WWW server,
one RTT+T to get GIF image

Question 4: ``Socket Programming''


(6%)Please fill the corresponding system call(socket(), listen(), connect(), bind(),
accept(), send(), recv(), close()) into (a) – (f), so we can create the socket between
cline and server.(You don’t have to draw the graph)

Answer: (a) socket() (b) connect() (c) socket() (d) bind() (e) listen() (f)
accept()

Question 5: ``Homework Review


These problems are not the same as homework, which means that we have modified
some description. Please be careful when answering.

(12%)Suppose users share a 6 Mbps link. Also suppose each user requires 100 kbps
when transmitting, but each user transmits only 20 percent of the time.
a. (3%)When circuit switching is used, how many users can be supported?
Answer: 60 users
b. (3%)For the remainder of this problem, suppose packet switching is used.
Find the probability that a given user is transmitting.
Answer: 0.2
c. (3%)Suppose there are 120 users. Find the probability that at any given time,
exactly n users are transmitting simultaneously. (Hint: Use the binomial
distribution.)
Answer:
d. (3%)Find the probability that there are 21 or more users transmitting
simultaneously.
Answer:

(12%)True or False
e. (3%)A user requests a Web page that consists of some text and three images.
For this page, the client will send four request message and receive four
response messages.
Answer: 因為在考試時沒說明清楚此題是只考慮存取 object 所需要發出/
接收的 request/response message,而不考慮建立連線時所發出的請求,因
此寫 True 或 False 都算對。
f. (3%)With non-persistent connections between browser and origin server, it
is possible for a single TCP segment to carry two distinct HTTP request
messages.
Answer: False.
In a non-persistent connection, the connection closes after each connection.
In this case, the connection will close once the first message is received, and
there will be a new connection opened to send the second message.
g. (3%)HTTP response messages can have an empty message body.
Answer: True
Some HTTP response messages have an empty message body. For example,
HTTP Status-Code of 204 and 304 MUST NOT include a message body. (RFC
2616)
h. (3%)The Date: header in the HTTP response message indicates when the
object in the response was last modified.
Answer: False
The “Date:” is the time at which the request was created and not when the
object was last modified.

You might also like