0% found this document useful (0 votes)
921 views11 pages

Chapter 3 Review Questions On Tansport Layer

This document contains a review of questions from Sections 3.1-3.3 of a chapter on computer networking. [1] It describes simple transport layer protocols for delivering data to destination processes over a network and discusses whether the transport layer needs to do anything within the network core. [2] It also discusses a hypothetical planet's mail delivery system and how port numbers allow a process to distinguish between UDP segments from different hosts.

Uploaded by

fikadu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
921 views11 pages

Chapter 3 Review Questions On Tansport Layer

This document contains a review of questions from Sections 3.1-3.3 of a chapter on computer networking. [1] It describes simple transport layer protocols for delivering data to destination processes over a network and discusses whether the transport layer needs to do anything within the network core. [2] It also discusses a hypothetical planet's mail delivery system and how port numbers allow a process to distinguish between UDP segments from different hosts.

Uploaded by

fikadu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

COMUPUTER NETWORKING

Chapter 3 Review Questions

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.

 It accepts four byte of destination port number and host address.


 The Simple Transport Protocol gives the destination host address and the resulting segment to the
network layer.
 The network layer sends the segment to Simple Transport Protocol at the destination host.
 The Simple Transport Protocol observes the port number.
 Abstracts the data from the segment in the Simple Transport Protocol.
 Finally, send the data to the process recognized by the port number. 

b) Consider the two header fields in the segment:

1. Source port field


2. Destination port field

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.

c) No, the transport layer does not have to do anything in the core.

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.

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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?

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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.

R10. In our rdt protocols, why did we need to introduce timers

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.

Yes, a timer still is necessary in protocol rdt 3.0.

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.

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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.

c. Finally, try sending six packets. 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.

C. Finally, try sending six packets. What happens?

-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?

Selective Repeat java applet protocol:

 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

R14. True or false?

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.

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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.

e. The TCP segment has a field in its header for rwnd.

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.

a) False b) False c) True d) False e) True f) False g) False

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.

a. How much data is in the first segment?

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?

a) Consider sequence numbers ,First segment=90

                                               Second segment=110

                                               Data in the first segment=110-90

                                                                                      =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?

Segment Sequence number Acknowledgment field

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

First segment seq = 43 ack=80


Second segment seq = 80 ack=44
Third segment seq = 44 ack=81

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).

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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

a. The segments sent from A to S.

b. The segments sent from B to S.

c. The segments sent from S to A.

d. The segments sent from S to B.

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?

f. How about if they are the same host?

serial                port number Destination port number

 
a)  
467 23
A   S
b)  
e) Yes 513 23
B     S
f) No
c)  
23 467
S     A
d)  
23 513
S   B

P2. Consider Figure 3.5. What are the source and


destination port values in the segments flowing from the server back to the clients’ processes? What are
the IP addresses in the network-layer datagrams carrying the transport-layer Segments?

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

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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?

Given 8-bit bytes are as follows:

        01010011

        01100110

        01110100

Calculate the sum of the given 3 bytes.

Add first two 8-bit bytes:

0 1 0 1 0 0 1 1        
0 1 1 0 0 1 1 0
1 0 1 1 1 0 0 1   

Now add the result with the 3rd byte.

  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  

Wrap around the extra bit.     

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.

Check sum is 11010001. 

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

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.

The 1’s compliment of (sum) 00101110 is 11010001.

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 process of detecting errors by the receiver:

The receiver performs the following steps at the receiver end to identify the errors in the segment.

 Add all the bytes including checksum.


 Observe the sum.
o If it contains all 1’s then the segment has errors.
o If it contains 1 or more 0’s then the segment contains errors.

Error types that are identified using 1’s compliment method:

 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.

(a)Consider 2 bytes: 01011100 and 01100101 adding the two bytes:

       01011100

    + 01100101

       11000001 The 1s complement of the sum of these 2 bytes: 11000001

b)Consider 2 bytes: 11011010 and 01100101

             11011010

          +01100101

            00111111

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

The 1s complement of the sum of these 2 bytes: 00111111

(c)

               11011100

              +11100101

                11000001     <-- Same 1s complement answer

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.

Certainty of no bit errors at receiver end using checksum using UDP:

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

Prepared by Fikadu M email address<[email protected]> 2021


COMUPUTER NETWORKING

Consider the states of sender and receiver as follows:

Sender state as “wait for call 1 from above”.

Receiver state as “wait for 1 from below”.

 Initially sender sends a packet with sequence number 1.


 After sending the packet, the state of the sender will be “wait for ACK or NAK 1” (indicates that
sender waits for acknowledgement ACK or NAK from receiver).
 The receiver receives the packet 1 and sends the ACK.
 After acknowledging the packet, the state of the receiver is “wait for 0 from below” (indicates
that the receiver is waiting for packet 0).
 Assume that sender receives the corrupted ACK sent by the receiver for packet 1.
 Since the sender received the corrupted ACK, it transmits the packet 1 again.
 The receiver sends a NAK as it received packet with sequence number 1 again instead of packet
with sequence number 0.
 The sender sends the packet with sequence number 1 again.
 The receiver sends NAK again to sender.

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.

Prepared by Fikadu M email address<[email protected]> 2021

You might also like