Chapter 3 Review Questions On Tansport Layer
Chapter 3 Review Questions On Tansport Layer
SECTIONS 3.1–3.3
R1. Suppose the network layer provides the following service. The network layer in the source host
accepts a segment of maximum size 1,200 bytes and a destination host address from the transport layer.
The network layer then guarantees to deliver the segment to the transport layer at the destination host.
Suppose many network application processes can be running at the destination host.
a. Design the simplest possible transport-layer protocol that will get application data to the desired
process at the destination host. Assume the operating system in the destination host has assigned a 4-byte
port number to each running application process.
b. Modify this protocol so that it provides a “return address” to the destination process.
c. In your protocols, does the transport layer “have to do anything” in the core of the computer network
a) The Simple Transport Protocol takes data not exceeding 1196 bytes at the sender side.
The Simple Transport Protocol creates application data, source and destination port numbers in the
segment. It sends the destination host address to the network layer. Then, The Simple Transport Protocol
is receiving host address and provides the process the source port number and the application data.
The reason is that, the transport layer "lives" in the end systems.
R2. Consider a planet where everyone belongs to a family of six, every family lives in its own house,
each house has a unique address, and each person in a given house has a unique name. Suppose this
planet has a mail service that delivers letters from source house to destination house. The mail service
requires that (1) the letter be in an envelope, and that (2) the address of the destination house (and nothing
more) be clearly written on the envelope. Suppose each family has a delegate family member who
collects and distributes letters for the other family members. The letters do not necessarily provide any
indication of the recipients of the letters.
a. Using the solution to Problem R1 above as inspiration, describe a protocol that the delegates can use to
deliver letters from a sending family member to a receiving family member.
b. In your protocol, does the mail service ever have to open the envelope and examine the letter in order
to provide its service?
a)
Sender has to provide the address of the destination name. It is written by the delegate to the
planet’s mail service..
After receive the destination address, the envelop the written on the top details.
b) No. The mail service ever have not to open the envelope and examine the letter in order to provide its
service.
R3. Consider a TCP connection between Host A and Host B. Suppose that the TCP segments traveling
from Host A to Host B have source port number x and destination port number y. What are the source and
destination port numbers for the segments traveling from Host B to Host A?
The source and destination port numbers for the segments travelling from Host B to Host A: Source port
number y and destination port number x.
R4. Describe why an application developer might choose to run an application over UDP rather than
TCP.
The TCP’(transmission control protocol) can choke the application’s sending rate at times of bottleneck.
The UDP( user datagram protocol) does not keep joining state and does not track any of the limits.
Even though data transfer by TCP is dependable, some applications do not need dependable TCP data
transfer. So, UDP (user datagram protocol) rather than TCP (transmission control protocol):
R5. Why it is that voice and video traffic is often sent over TCP rather than UDP in today’s Internet?
(Hint: The answer we are looking for has nothing to do with TCP’s congestion-control mechanism.)
Most firewalls are configured to block UDP traffic, using TCP for video and voice traffic lets the traffic
though the firewalls. So, that voice and video traffic is often sent over TCP rather than UDP in today’s
Internet.
R6. Is it possible for an application to enjoy reliable data transfer even when the application runs over
UDP? If so, how? Yes. The application developer can put consistent data transfer into the application
layer protocol. It contains a significant amount of work and debugging.
R7. Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and
Host B each send a UDP segment to Host C with destination port number 6789. Will both of these
segments be directed to the same socket at Host C? If so, how will the process at Host C know that these
two segments originated from two different hosts?
Suppose a process in Host C has a UDP socket with port number 6789. Sup- pose both Host A and Host
B each send a UDP segment to Host C with desti- nation port number 6789. Will both of these segments
be directed to the same socket at Host C? If so, how will the process at Host C know that these two
segments originated from two different hosts?
Yes. For each received segment, at the socket interface, the operating system will provide the process
with the IP addresses to determine the origins of the individual segments.
R8. 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 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. Unlike UDP, when the transport layer passes a TCP segment’s payload to the application
process, it does not specify the source IP address, as this is implicitly specified by the socket identifier
SECTION 3.4
R9. In our rdt protocols, why did we need to introduce sequence numbers?
Sequence numbers are necessary for a receiver to find out whether an arriving packet contains new data
or is a retransmission in our rdt protocols.
To handle losses in the channel. If the ACK for a transmitted packet is not received within the
duration of the timer for the packet, the packet (or its ACK or NACK) is assumed to have been lost.
Hence, the packet is retransmitted.
R11. Suppose that the roundtrip delay between sender and receiver is constant and known to the sender.
Would a timer still be necessary in protocol rdt 3.0, assuming that packets can be lost? Explain.
Reason: Assume the packet is loss, the sender knows the round trip delay time. It is used for estimate the
transfer packet time
R12. Visit the Go-Back-N interactive animation at the companion Web site.
a. Have the source send five packets, and then pause the animation before any of the five packets reach
the destination. Then kill the first packet and resume the animation. Describe what happens.
b. Repeat the experiment, but now let the first packet reach the destination and kill the first
acknowledgment. Describe again what happens.
A. Have the source send five packets, and then pause the animation before and of the five packet
reach the destination. Then kill the first packet and resume the animation. Describe what happens.
-The packets were received out of order and no packets were acknowledged. The packets were then
retransmitted. Once they were retransmitted and received and ACK was sent to the sender.
B. Repeat the experiment, but now let the first packet reach the destination and kill the first ACK.
Describe what happens.
-The first ACK was lost but the others made it to the sender and their timers were stopped.
-It only lets you send 5 packets out at once. Before the sixth packet can be sent you must wait for
the first packet to finish the ACK
R13. Repeat R12, but now with the Selective Repeat interactive animation. How are Selective Repeat and
Go-Back-N DIFFERENT?
If sender sent more than one packet, it reaches the destination might be one packet is killed and
other packets stored in buffer at end receiver.
The receiver send acknowledgement to sender, but the sender does not receiver
acknowledgement.
Go-Bank-N protocol:
If sender sent more than one packet, it reaches the destination might be one packet is killed and
other packets reached destination without buffering.
The receiver does not send acknowledgement to sender, but the sender receive
acknowledgement.
SECTION 3.5
a. Host A is sending Host B a large file over a TCP connection. Assume Host B has no data to send Host
A. Host B will not send acknowledgments to Host A because Host B cannot piggyback the
acknowledgments on data.
b. The size of the TCP rwnd never changes throughout the duration of the connection.
c. Suppose Host A is sending Host B a large file over a TCP connection. The number of unacknowledged
bytes that A sends cannot exceed the size of the receive buffer.
d. Suppose Host A is sending a large file to Host B over a TCP connection. If the sequence number for a
segment of this connection is m, then the sequence number for the subsequent segment will necessarily be
m + 1.
f. Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The current value of
TimeoutInterval for the connection will necessarily be Ú 1 sec.
g. Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over a TCP
connection to Host B. In this same segment, the acknowledgment number is necessarily 42.
R15. 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.
b. Suppose that the first segment is lost but the second segment arrives at
B. In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number?
=20
b) Consider the first segment is lost but the second segment arrives at B. In the acknowledgment that Host
B sends to Host A, then the acknowledgment number will be first segment of sequence number, that is
90.
R16. Consider the Telnet example discussed in Section 3.5. A few seconds after the user types the letter
‘C,’ the user types the letter ‘R.’ After typing the letter ‘R,’ how many segments are sent, and what is put
in the sequence number and acknowledgment fields of the segments?
SECTION 3.7
R17. Suppose two TCP connections are present over some bottleneck link of rate R bps. Both connections
have a huge file to send (in the same direction over the bottleneck link). The transmissions of the files
start at the same time. What transmission rate would TCP like to give to each of the connections?
Consider data,: Two TCP connections are present over some bottleneck link of rate R bps. Both
connections have a huge file to send. Transmissions of the files start at the same time.
Transmission rate would TCP like to give to each of the connections= R/2.
R18. True or false? Consider congestion control in TCP. When the timer expires at the sender, the value
of ssthresh is set to one half of its previous value.
False. The slow start threshold(ssthresh) is set to one half of its previous value in the congestion window .
R19. In the discussion of TCP splitting in the sidebar in Section 3.7, it was claimed that the response time
with TCP splitting is approximately 4 # RTTFE + RTTBE + processing time. Justify this claim.
Consider the delay in receiving a response for a search query. In slow start, the server requires three TCP
windows to deliver the response.
Thus, the time from when an end system initiates a TCP connection until the time when it receives the
last packet of the response is roughly 4*round trip time (RTT).
One RTT is used to set up the TCP connection and three RTTs are used for the three windows of data
plus the processing time in the data center. These RTT delays can lead to a noticeable delay in returning
search results for a significant fraction of queries.
Moreover, there can be significant packet loss in access networks, leading to TCP retransmissions and
even larger delays.
Improve the user-perceived performance is to utilize TCP splitting by breaking the TCP connection at
the front-end server.
The client establishes a TCP connection to the nearby front-end, and the front-end maintains a persistent
TCP connection to the data center with a very large TCP congestion window with TCP splitting.
Hence, it is justified that the response time roughly becomes 4*RTTFE +RTTBE + processing time.
Where, RTTFE is the round-trip time between client and front-end server, and RTTBE is the round-trip
time between the front-end server and the data center (back-end server).
Problems
P1. Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also
initiates a Telnet session with Server S. Provide possible source and destination port numbers for
e. If A and B are different hosts, is it possible that the source port number in the segments from A to S is
the same as that from B to S?
a)
467 23
A S
b)
e) Yes 513 23
B S
f) No
c)
23 467
S A
d)
23 513
S B
Assume the IP addresses of the hosts A, B, and C are a, b, c, respectively. (Note that a, b, c are distinct.)
To host A: Source port =80, source IP address = b, destination port = 26145, destination IP
address = a
To host C, left process: Source port =80, source IP address = b, dest port = 7532, destination IP
address = c
To host C, right process: Source port =80, source IP address = b, dest port = 26145, destination IP
address = c
P3. UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit
bytes: 01010011, 01100110, 01110100. What is the 1s complement of the sum of these 8-bit bytes? (Note
that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being
asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum;
that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is
it possible that a 1-bit error will go undetected? How about a 2-bit error?
01010011
01100110
01110100
0 1 0 1 0 0 1 1
0 1 1 0 0 1 1 0
1 0 1 1 1 0 0 1
1 0 1 1 1 0 0 1
0 1 1 1 0 1 0 0
1 0 0 1 0 1 1 0 1
0 0 1 0 1 1 0 1
1
0 0 1 0 1 1 1 0
The sum three 8-bit bytes is 00101110. Invert all the bits to get the check sum.
Now calculate the 1’s compliment of the sum. Convert all 0’s to 1’s and vice versa to find the 1’s
compliment.
It is clear that the 1’s compliment and the checksum are same.
User Datagram Protocol (UDP) uses the 1’s complement as it is same as the checksum of the sum.
The checksum is used by the receiver (host) to identify the errors in the segment.
The receiver performs the following steps at the receiver end to identify the errors in the segment.
Using 1’s compliment method, it is possible to detect all the 1-bit errors.
Using 1’s compliment method, there is a possibility that some 2-bit errors are left undetected.
P4. a. Suppose you have the following 2 bytes: 01011100 and 01100101. What is the 1s complement of
the sum of these 2 bytes?
b. Suppose you have the following 2 bytes: 11011010 and 01100101. What is the 1s complement of the
sum of these 2 bytes?
c. For the bytes in part (a), give an example where one bit is flipped in each of the 2 bytes and yet the 1s
complement doesn’t change.
01011100
+ 01100101
11011010
+01100101
00111111
(c)
11011100
+11100101
Running checksums at multiple levels throughout the network is not a waste. Because flipped bits can be
so easily missed, this redundancy is the best chance of catching errors.
P5. 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.
The receiver in the UDP (User Datagram Protocol) verifies the received segment by calculating internet
checksum and comparing it with the value in the checksum field.
The 1’s compliment of the sum is considered as checksum. So, when this check sum is used to
detect the errors in the packet, the errors remain in under cover.
In case, if two 16-bit words are added, then there is a scope for flipping the 0’s and 1’s. If the bits
are flipped, the sum will be same and error can’t detected.
Therefore, it is not possible to the receiver in UDP to be sure that there are no bit errors have
occurred.
P6. Consider our motivation for correcting protocol rdt2.1. Show that the receiver, shown in Figure 3.60,
when operating with the sender shown in Figure 3.11, can lead the sender and receiver to enter into a
deadlock state, where each is waiting for an event that will never occur
Therefore, the sender repeats the sending packet with sequence number 1 and the receiver sends
NAK again to sender. This raises a deadlock stage for both sender and the receiver.