Download Solution Manual for Computer Networking A Top Down Approach 4E Kurose, Ross and more Exercises Computer Networks in PDF only on Docsity!
Computer Networking: A Top-Down Approach
Featuring the Internet, 4
th
Edition
Solutions to Review Questions and Problems
Version Date: June 21, 2007
Chapter 1 Review Questions
- There is no difference. Throughout this text, the words “host” and “end system” are used interchangeably. End systems include PCs, workstations, Web servers, mail servers, Internet-connected PDAs, WebTVs, etc.
- Suppose Alice, an ambassador of country A wants to invite Bob, an ambassador of country B, over for dinner. Alice doesn’t simply just call Bob on the phone and say, “come to our dinner table now”. Instead, she calls Bob and suggests a date and time. Bob may respond by saying he’s not available that particular date, but he is available another date. Alice and Bob continue to send “messages” back and forth until they agree on a date and time. Bob then shows up at the embassy on the agreed date, hopefully not more than 15 minutes before or after the agreed time. Diplomatic protocols also allow for either Alice or Bob to politely cancel the engagement if they have reasonable excuses.
- A networking program usually has two programs, each running on a different host, communicating with each other. The program that initiates the communication is the client. Typically, the client program requests and receives services from the server program.
- Dial-up modem over telephone line: residential; 2. DSL over telephone line: residential or small office; 3. Cable to HFC: residential; 4. 100 Mbps switched Etherent: company; 5. Wireless LAN: mobile; 6. Cellular mobile access (for example, WAP): mobile
- HFC bandwidth is shared among the users. On the downstream channel, all packets emanate from a single source, namely, the head end. Thus, there are no collisions in the downstream channel.
- Current possibilities include: dial-up; DSL; cable modem; fiber-to-the-home.
- Ethernet LANs have transmission rates of 10 Mbps, 100 Mbps, 1 Gbps and 10 Gbps. For an X Mbps Ethernet (where X = 10, 100, 1,000 or 10,000), a user can continuously transmit at the rate X Mbps if that user is the only person sending data. If there are more than one active user, then each user cannot continuously transmit at X Mbps.
- Ethernet most commonly runs over twisted-pair copper wire and “thin” coaxial cable. It also can run over fibers optic links and thick coaxial cable.
- Dial up modems: up to 56 Kbps, bandwidth is dedicated; ISDN: up to 128 kbps, bandwidth is dedicated; ADSL: downstream channel is .5-8 Mbps, upstream channel
d) Probability that all three users are transmitting simultaneously = 3 ( 1 ) 33 3
p p
= (0.2) 3 = 0.008_._ Since the queue grows when all the users are transmitting, the fraction of time during which the queue grows (which is equal to the probability that all three users are transmitting simultaneously) is 0.008.
- The delay components are processing delays, transmission delays, propagation delays, and queuing delays. All of these delays are fixed, except for the queuing delays, which are variable.
- Java Applet
- 10msec; d/s; no; no
- a) 500 kbps b) 62.5 seconds c) 100kbps; 312.5 seconds
- End system A breaks the large file into chunks. To each chunk, it adds header generating multiple packets from the file. The header in each packet includes the address of the destination: end system B. The packet switch uses the destination address to determine the outgoing link. Asking which road to take is analogous to a packet asking which outgoing link it should be forwarded on, given the packet’s address.
- Java Applet
- Five generic tasks are error control, flow control, segmentation and reassembly, multiplexing, and connection setup. Yes, these tasks can be duplicated at different layers. For example, error control is often provided at more than one layer.
- The five layers in the Internet protocol stack are – from top to bottom – the application layer, the transport layer, the network layer, the link layer, and the physical layer. The principal responsibilities are outlined in Section 1.5.1.
- Application-layer message: data which an application wants to send and passed onto the transport layer; transport-layer segment: generated by the transport layer and encapsulates application-layer message with transport layer header; network-layer datagram: encapsulates transport-layer segment with a network-layer header; link- layer frame: encapsulates network-layer datagram with a link-layer header.
- Routers process layers 1 through 3. (This is a little bit of a white lie, as modern routers sometimes act as firewalls or caching components, and process layer four as well. ) Link layer switches process layers 1 through 2. Hosts process all five layers.
- a) Virus
Requires some form of human interaction to spread. Classic example: E-mail viruses.
b)Worms No user replication needed. Worm in infected host scans IP addresses and port numbers, looking for vulnerable processes to infect.
c) Trojan horse Hidden, devious part of some otherwise useful software.
- Creation of a botnet requires an attacker to find vulnerability in some application or system (e.g. exploiting the buffer overflow vulnerability that might exist in an application). After finding the vulnerability, the attacker needs to scan for hosts that are vulnerable. The target is basically to compromise a series of systems by exploiting that particular vulnerability. Any system that is part of the botnet can automatically scan its environment and propagate by exploiting the vulnerability. An important property of such botnets is that the originator of the botnet can remotely control and issue commands to all the nodes in the botnet. Hence, it becomes possible for the attacker to issue a command to all the nodes, that target a single node (for example, all nodes in the botnet might be commanded by the attacker to send a TCP SYN message to the target, which might result in a TCP SYN flood attack at the target).
- Trudy can pretend to be Bob to Alice (and vice-versa) and partially or completely modify the message(s) being sent from Bob to Alice. For example, she can easily change the phrase “Alice, I owe you $1000” to “Alice, I owe you $10,000”. Furthermore, Trudy can even drop the packets that are being sent by Bob to Alice (and vise-versa), even if the packets from Bob to Alice are encrypted.
Chapter 1 Problems:
Problem 1.
There is no single right answer to this question. Many protocols would do the trick. Here's a simple answer below:
Messages from ATM machine to Server Msg name purpose
HELO Let server know that there is a card in the ATM machine ATM card transmits user ID to Server PASSWD User enters PIN, which is sent to server BALANCE User requests balance WITHDRAWL User asks to withdraw money BYE user all done
need not worry greatly about the overhead costs of setting up and tearing down a circuit connection, which are amortized over the lengthy duration of a typical application session.
b) Given such generous link capacities, the network needs no congestion control mechanism. In the worst (most potentially congested) case, all the applications simultaneously transmit over one or more particular network links. However, since each link offers sufficient bandwidth to handle the sum of all of the applications' data rates, no congestion (very little queuing) will occur.
Problem 3.
a) We can n connections between each of the four pairs of adjacent switches. This gives a maximum of 4n connections. b) We can n connections passing through the switch in the upper-right-hand corner and another n connections passing through the switch in the lower-left-hand corner, giving a total of 2n connections.
Problem 4.
Tollbooths are 100 km apart, and the cars propagate at 100km/hr. A tollbooth services a car at a rate of one car every 12 seconds. a) There are ten cars. It takes 120 seconds, or two minutes, for the first tollbooth to service the 10 cars. Each of these cars has a propagation delay of 60 minutes before arriving at the second tollbooth. Thus, all the cars are lined up before the second tollbooth after 62 minutes. The whole process repeats itself for traveling between the second and third tollbooths. Thus the total delay is 124 minutes. b) Delay between tollbooths is 7*12 seconds plus 60 minutes, i.e., 61 minutes and 24 seconds. The total delay is twice this amount, i.e., 122 minutes and 48 seconds.
Problem 5
a) d (^) prop = m / s seconds.
b) d (^) trans = L / R seconds.
c) d (^) end − to − end =( m / s + L / R )seconds.
d) The bit is just leaving Host A. e) The first bit is in the link and has not reached Host B. f) The first bit has reached Host B. g) Want
( 2. 5 10 ) 893 28 10
= RS = × 3 × =
L
m km.
Problem 6
Consider the first bit in a packet. Before this bit can be transmitted, all of the bits in the packet must be generated. This requires
×
sec=6msec.
The time required to transmit the packet is
×
sec= 384 μsec.
Propagation delay = 2 msec. The delay until decoding is
6msec + 384 μsec + 2msec = 8.384msec
A similar analysis shows that all bits experience a delay of 8.384 msec.
Problem 7
a) 10 users can be supported because each user requires one tenth of the bandwidth. b) p = 0. 1.
c) (^ )^ n n p p n
− ⎟⎟ − ⎠
d) (^) ∑ ( )
− ⎟⎟ − ⎠
9
0
40 1
n
n n p p n
We use the central limit theorem to approximate this probability. Let X (^) j be independent
random variables such that P (^ Xj = 1 ) = p.
P^ ( “11 or more users” )^ ⎟⎟ ⎠
= − ∑ ≤
40
j 1
P Xj
∑ ∑
= = 40 0.^10.^9
40 (^401)
1
j j j
j
X
P X P
( 3. 16 )
- 6
≈ P Z ≤ PZ
when Z is a standard normal r.v. Thus P ( “10 or more users” ) ≈ 0. 001.
Problem 13
It takes LN / R seconds to transmit the N packets. Thus, the buffer is empty when a batch of N packets arrive.
The first of the N packets has no queuing delay. The 2nd packet has a queuing delay of L / R seconds. The n th^ packet has a delay of ( n − 1 ) L / R seconds.
The average delay is
1 0
∑ −^ = ∑ =
−
= =
N
R
N N L
RN
L
n RN
L
n L R N
N
n
N
n
Problem 14
a) The transmission delay is L / R. The total delay is
I
L R
R
L
R I
IL
b) Let x = L / R.
Total delay = ax
x 1 −
Problem 15
a) There are Q nodes (the source host and the N − 1 routers). Let d qproc denote the
processing delay at the q th node. Let R q be the transmission rate of the q th link and let q q d (^) trans = L / R. Let q d (^) prop be the propagation delay across the q th link. Then
∑^ [^ ]
=
Q
q
q prop
q trans
q d (^) end toend dproc d d 1
b) Let d (^) queueq denote the average queueing delay at node q. Then
∑^ [^ ]
=
Q
q
q queue
q prop
q trans
q d (^) end toend dproc d d d 1
Problem 16
The command:
traceroute -q 20 www.eurecom.fr
will get 20 delay measurements from the issuing host to the host, www.eurecom.fr. The average and standard deviation of these 20 measurements can then be collected. Do you see any differences in your answers as a function of time of day?
Problem 17
Throughput = min{Rs , Rc, R/M}
Problem 18
a) 40,000 bits b) 40,000 bits
c) The bandwidth-delay product of a link is the maximum number of bits that can be in the link d) 1 bit is 250 meters long, which is longer than a football field
e) s/R
Problem 19
25 bps
Problem 20
a) 40,000,000 bits b) 400,000 bits c) .25 meters
Problem 21
a) t (^) trans + t (^) prop = 400 msec + 40 msec = 440 msec b) 10 * ( t (^) trans + 2 t (^) prop ) = 10*(40 msec + 80 msec) = 1.2 sec
Problem 22
a) 150 msec b) 1,500,000 bits c) 600,000,000 bits
Problem 23
Let’s suppose the passenger and his/her bags correspond to the data unit arriving to the top of the protocol stack. When the passenger checks in, his/her bags are checked, and a tag is attached to the bags and ticket. This is additional information added in the Baggage layer if Figure 1.20 that allows the Baggage layer to implement the service or separating the passengers and baggage on the sending side, and then reuniting them (hopefully!) on the destination side. When a passenger then passes through security, and additional stamp is often added to his/her ticket, indicating that the passenger has passed
Chapter 2 Review Questions
- The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; e-mail: SMTP.
- 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)
- The process which initiates the communication is the client; the process that waits to be contacted is the server.
- No. As stated in the text, all communication sessions have a client side and a server side. 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.
- The IP address of the destination host and the port number of the destination socket.
- 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.
- There are no good examples of an application that requires no data loss and timing. If you know of one, send an e-mail to the authors.
- a) Reliable data transfer TCP provides a reliable byte-stream between client and server but UDP does not.
b) A guarantee that a certain value for throughput will be maintained Neither
c) A guarantee that data will be delivered within a specified amount of time Neither
d) Security Neither
- 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.
- 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.
- 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.
- When the user first visits the site, the site returns 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.
- Web caching can bring the desired content “closer” to the user, perhaps 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.
- Issued the following command (in Windows command prompt) followed by the HTTP GET message to the “utopia.poly.edu” web server:
telnet utopia.poly.edu 80
Since the index.html page in this web server was not modified since Fri, 18 May 2007 09:23:34 GMT, the following output was displayed when the above commands were issued on Sat, 19 May 2007. Note that the first 4 lines are the GET message and header lines input by the user and the next 4 lines (starting from HTTP/1.1 304 Not Modified) is the response from the web server.
- 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.
s3.bay0.hotmail.com. Message-id is a unique string assigned by the mail system when the message is first created.
From: This indicates the email address of the sender of the mail. In the given example, the sender is “prithuladhungel@hotmail.com”
To: This field indicates the email address of the receiver of the mail. In the example, the receiver is “prithula@yahoo.com”
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 “prithuladhungel@hotmail.com”.
- With download and delete, after a user retrieves its messages from a POP server, the messages 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).
- 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.
- 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.
- Alice will get her first chunk as a result of she being selected by one of her neighbors as a result of an “optimistic unchoke,” for sending out chunks to her.
- 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. With Gnutella, when a node wants to join the Gnutella network, it first discovers (“out of band”) the IP address of one or more nodes already in the network. It then sends join messages to these nodes. When the node receives confirmations, it becomes a member of the of Gnutella network. Nodes maintain their logical links with periodic refresh messages.
- It is a hybrid of client server and P2P architectures: a) There is a centralized component (the index) like in the case of a client server system. b) Other functions (except the indexing) do not use any kind of central server. This is similar to what exists in a P2P system.
- Whenever a user, say Alice wants to locate another user in the instant messaging system, say Bob, her node would send out a query message asking for the (unique) username (Bob) into the overlay network, which would be flooded into the network in the same manner a query requesting the location of a resource (eg: a file in Gnutella network) is flooded. If the user with the username (Bob) is online, as the query reaches the node where the user is online from, the node sends back the query response to the original query source (Alice). In this way, Alice locates the IP address of the node Bob is currently at in the instant messaging system. The advantage of such a design is that there is no centralized component in the system and hence no single point of failure. The disadvantage however, is that the flooding of each such request into the overlay network results in huge traffic in the network. One option is to have limited scope query as in Gnutella. However, with this approach, the user might not be located even if she is online.
- a) User location b) NAT traversal
- a) File Distribution b) Instant Messaging c) Video Streaming d) Distributed Computing
- 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.
that carried the HTTP GET request) to answer this question.
Problem 5
a) The status code of 200 and the phrase OK indicate that the server was able to locate the document successfully. The reply was provided on Tuesday, 07 Mar 2006 12:39: Greenwich Mean Time.
b) The document index.html was last modified on Saturday 10 Dec 2005 18:27:46 GMT.
c) There are 3874 bytes in the document being returned.
d) The first five bytes of the returned document are : <!doc. The server agreed to a persistent connection, as indicated by the Connection: Keep-Alive field
Problem 6
a) Persistent connections are discussed in section 8 of RFC 2616 (the real goal of this question was to get you to retrieve and read an RFC). Sections 8.1.2 and 8.1.2.1 of the RFC indicate that either the client or the server can indicate to the other that it is going to close the persistent connection. It does so by including the including the connection-token "close" in the Connection-header field of the http request/reply. b) HTTP does not provide any encryption services.
Problem 7
The total amount of time to get the IP address is RTT 1 (^) + RTT 2 +Λ+ RTT n.
Once the IP address is known, RTTO elapses to set up the TCP connection and another
RTT O elapses to request and receive the small object. The total response time is 2 RTTo + RTT 1 + RTT 2 +Λ+ RTT n
Problem 8
a) RTT 1 (^) + Λ + RTTn + 2 RTTo + 3 ⋅ 2 RTT o = 8 RTT (^) o + RTT 1 +Λ+ RTT n.
b) RTT 1 (^) + Λ + RTTn + 2 RTTo + 2 RTT o = 4 RTT (^) o + RTT 1 +Λ+ RTT n.
c) RTT 1 (^) + Λ + RTTn + 2 RTTo + RTT o
= 3 RTT (^) o + RTT 1 +Λ+ RTTn.
Problem 9
a) The time to transmit an object of size L over a link or rate R is L/R. The average time is the average size of the object divided by R :
Δ= (900,000 bits)/(1,500,000 bits/sec) = .6 sec
The traffic intensity on the link is (1.5 requests/sec)(.6 msec/request) = .9. Thus, the average access delay is (.6 sec)/(1 - .9) = 6 seconds. The total average response time is therefore 6 sec + 2 sec = 8 sec.
b) The traffic intensity on the access link is reduced by 40% since the 40% of the requests are satisfied within the institutional network. Thus the average access delay is (.6 sec)/[1 – (.6)(.9)] = 1.2 seconds. The response time is approximately zero if the request is satisfied by the cache (which happens with probability .4); the average response time is 1.2 sec + 2 sec = 3.2 sec for cache misses (which happens 60% of the time). So the average response time is (.4)(0 sec) + (.6)(3.2 sec) = 1.92 seconds. Thus the average response time is reduced from 8 sec to 1.92 sec.
Problem 10
Parallel download would only share the 100K bandwidth among the 10 connections (each getting just 10K bits/sec) thus, there is no significant advantage here. With persistent HTTP we avoid the SYN and SYNACK exchange but that only requires 2 seconds ( second to send the 100 bit SYN message over the 100 bps link, and 1 second to receive the ACK). Given that each object takes 101 seconds to send and receive the ACK, the use of pipelining gives only a 2 percent gain.
Problem 11
TCPServer.java
import java.io.; import java.net.;
class TCPServer { public static void main(String argv[]) throws Exception { String clientSentence; ServerSocket welcomeSocket = new ServerSocket(6789); while(true) { Socket connectionSocket = welcomeSocket.accept();