Question 1
The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are:
A
TCP, UDP, UDP and TCP
B
UDP, TCP, TCP and UDP
C
UDP, TCP, UDP and TCP
D
TCP, UDP, TCP and UDP
GATE CS 2013    Transport Layer    
Discuss it


Question 1 Explanation: 
TCP (Transmission Control Protocol) and UDP(User Datagram Protocol) are two main transport layer protocols. TCP is connection oriented and UDP is connectionless, this makes TCP more reliable than UDP. But UDP is stateless (less overhead), that makes UDP is suitable for purposes where error checking and correction is less important than timely delivery. For real time multimedia, timely delivery is more important than correctness. --> UDP For file transfer, correctness is necessary. --> TCP DNS, timely delivery is more important --> UDP Email again same as file transfer --> TCP
Question 2
Which of the following transport layer protocols is used to support electronic mail?
A
SMTP
B
IP
C
TCP
D
UDP
GATE CS 2012    Transport Layer    
Discuss it


Question 2 Explanation: 
E-mail uses SMTP as application layer protocol. TCP and UDP are two transport layer protocols. SMTP uses TCP as transport layer protocol as TCP is reliable.
Question 3
Consider an instance of TCP’s Additive Increase Multiplicative Decrease (AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.
A
8 MSS
B
14 MSS
C
7 MSS
D
12 MSS
GATE CS 2012    Transport Layer    
Discuss it


Question 3 Explanation: 
Question 4
A layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT
A
block entire HTTP traffic during 9:00PM and 5 :0OAM
B
block all ICMP traffic
C
stop incoming traffic from a specific IP address but allow outgoing traffic to the same IP address
D
block TCP traffic from a specific user on a multi-user system during 9:00PM and 5:00AM
GATE CS 2011    Transport Layer    
Discuss it


Question 4 Explanation: 
A.Can Block entire HTTP traffic by blocking TCP port 80 and it is possible because it is L4 firewall. D) As it is L4 firewall can not block packet based on user identity because it is the responsiblity of Application layer
Question 5
While opening a TCP connection, the initial sequence number is to be derived using a time-of-day(ToD) clock that keeps running even when the host is down. The low order 32 bits of the counter of the ToD clock is to be used for the initial sequence numbers. The clock counter increments once per millisecond. The maximum packet lifetime is given to be 64s. Which one of the choices given below is closest to the minimum permissible rate at which sequence numbers used for packets of a connection can increase?
A
0.015/s
B
0.064/s
C
0.135/s
D
0.327/s
GATE-CS-2009    Transport Layer    
Discuss it


Question 5 Explanation: 
The maximum packet lifetime is given to be 64 seconds in the question. Thus, a sequence number increments after every 64 seconds.
So, minimum permissible rate = 1 / 64 = 0.015 per second
 
Thus, option (A) is the answer.
 
Please comment below if you find anything wrong in the above post.
Question 6
Which of the following system calls results in the sending of SYN packets?
A
socket
B
bind
C
listen
D
connect
Transport Layer    GATE CS 2008    
Discuss it


Question 6 Explanation: 
socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it. bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address. listen() is used on the server side, and causes a bound TCP socket to enter listening state. connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection. When connect() is called by client, following three way handshake happens to establish the connection in TCP. 1) The client requests a connection by sending a SYN (synchronize) message to the server. 2) The server acknowledges this request by sending SYN-ACK back to the client. 3) The client responds with an ACK, and the connection is established. Sources: Berkeley socketsTCP Connection Establishment and Termination
Question 7
In the slow start phase of the TCP congestion control algorithm, the size of the congestion window
A
does not increase
B
increases linearly
C
increases quadratically
D
increases exponentially
Transport Layer    GATE CS 2008    
Discuss it


Question 7 Explanation: 
Question 8
Which one of the following uses UDP as the transport protocol?
A
HTTP
B
Telnet
C
DNS
D
SMTP
Transport Layer    GATE-CS-2007    
Discuss it


Question 8 Explanation: 
UDP is a stateless ,connectionless and unreliable protocol. HTTP needs connection to be established and thus,uses TCP. Telnet is a byte stream protocol which again needs connection establishment ,thus uses TCP. DNS needs request and response ,it needs a protocol in which a server can answer the small queries of large number of users. As UDP is fast and stateless it is the most suitable protocol and thus,it is used in DNS querying . SMTP needs reliability and thus,uses TCP. This solution is contributed by Shashank Shanker khare //.............// DNS uses UDP. HTTP, Telnet and SMTP uses TCP. Thus, C is the correct choice.
 
Please comment below if you find anything wrong in the above post.
Question 9
Let the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum segment size used is 2 KB. The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is _________.
A
1100 to 1300
B
800 to 1000
C
1400 to 1600
D
1500 to 1700
Transport Layer    GATE-CS-2014-(Set-1)    
Discuss it


Question 9 Explanation: 
Current size of congestion window in terms of number of segments
                            = (Size in Bytes)/(Maximum Segment Size)
                            = 32KB / 2KB 
                            = 16 MSS
          
When timeout occurs, in TCP's Slow Start algorithm, threshold is 
reduced to half which is 16KB or 8MSS. Also, slow start phase begins 
where congestion window is increased twice. 
So from 1MSS to 8 MSS window size will grow exponentially. 
Congestion window becomes 2MSS after one RTT and becomes 4MSS after
2 RTTs and 8MSS after 3 RTTs.  At 8MSS, threshold is reached and
congestion avoidance phase begins.  In congestion avoidance phase,
window is increased linearly. So to cover from 8MSS to 16MSS, it needs
8 RTTs

Together, 11RTTs are needed (3 in slow start phase and 8 in congestion
avoidance phase).
Question 10
Which one of the following socket API functions converts an unconnected active TCP socket into a passive socket.
A
connect
B
bind
C
listen
D
accept
Transport Layer    GATE-CS-2014-(Set-2)    
Discuss it


Question 10 Explanation: 
listen() marks the socket referred to by sockfd as a passive socket, that is, as a socket that will be used to accept incoming connection requests using accept(). Source: http://linux.die.net/man/2/listen
Question 11
Packets of the same session may be routed through different paths in
A
TCP, but not UDP
B
TCP and UDP
C
UDP, but not TCP
D
Neither TCP, nor UDP
Transport Layer    GATE-CS-2005    
Discuss it


Question 11 Explanation: 
Question 12
The maximum window size for data transmission using the selective reject protocol with n-bit frame sequence numbers is:
A
2^n
B
2^(n-1)
C
2^n – 1
D
2^(n-2)
Transport Layer    GATE-CS-2005    
Discuss it


Question 12 Explanation: 
In Selective Reject (or Selective Repeat), maximum size of window must be half of the maximum sequence number.
Question 13
Which of the following functionalities must be implemented by a transport protocol over and above the network protocol ?
A
Recovery from packet losses
B
Detection of duplicate packets
C
Packet delivery in the correct order
D
End to end connectivity
Transport Layer    GATE-CS-2003    
Discuss it


Question 13 Explanation: 
End to end connectivity is the required functionality provided by Trnasport protocol. UDP of transport layer protocol that doesn't implement other three functionalities, they are implemented only in TCP.
Question 14
Which of the following is not true about User Datagram Protocol in transport layer?
A
Works well in unidirectional communication, suitable for broadcast information.
B
It does three way handshake before sending datagrams
C
It provides datagrams, suitable for modeling other protocols such as in IP tunneling or Remote Procedure Call and the Network File System
D
The lack of retransmission delays makes it suitable for real-time applications
Transport Layer    GATE-CS-2015 (Mock Test)    
Discuss it


Question 14 Explanation: 
// UDP is a connectioness protocol, so it doesn't establish connection. Three way handshake is done by transport layer. A- UDP is a stateless protocol thus, useful in servers which answer small queries of large number of clients as it doesn’t need to store the state for each client. Thus, UDP is suitable for broadcast and unidirectional communication. B- Three way handshake is performed by TCP before establishing the connection in which it first sends SYN packet then SYN-ACK is received,then ACK packet is sent. UDP is a connectionless protocol and thus,doesn’t to perform 3-way handshake. C- IP tunneling is a communication channel between two different kind of networks .It is used to connect islands of IPv6 across the IPV internet by encapsulating the packets in the frame format of IPV4 . Remote procedure call is when a program causes a subroutine to run in another address space .This address space can be on server.It is a request response protocol and thus,UDP is suitable for it. Datagrams are also useful as UDP is a packet stream protocol. D- TCP retransmits the errorneous packets from source to destination while UDP discards them. This solution is contributed by Shashank Shanker khare
Question 15
Suppose two hosts use a TCP connection to transfer a large file. Which of the following statements is/are False with respect to the TCP connection?
1. If the sequence number of a segment is m, then the sequence 
   number of the subsequent segment is always m+1.
2. If the estimated round trip time at any given point of time
   is t sec, the value of the retransmission timeout is always
   set to greater than or equal to t sec.
3. The size of the advertised window never changes during the 
   course of the TCP connection.
4. The number of unacknowledged bytes at the sender is always 
   less than or equal to the advertised window 
A
3 only
B
1 and 3 only
C
1 and 4 only
D
2 and 4 only
Transport Layer    GATE-CS-2015 (Set 1)    
Discuss it


Question 15 Explanation: 
TCP sequence number of a segment is the byte number of the first byte in the segment. For example, if the segment contains 500 bytes which are from 1000 to 1499, then sequence number of the segment would be 1000 and sequence number of next segment would be 1500. Receiver window changes when TCP data is processed by application layer of receiver side.
Question 16
A link has a transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume that the acknowledgment has negligible transmission delay, and that its propagation delay is the same as the data propagation delay. Also assume that the processing delays at nodes are negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the one-way propagation delay (in milliseconds) is ___________.
A
4
B
8
C
12
D
16
Transport Layer    GATE-CS-2015 (Set 2)    
Discuss it


Question 16 Explanation: 
In stop and wait, protocol next packet is sent only when 
acknowledgement of previous packet is received.  This 
causes poor link utilization. 

Tansmission speed = 106

Time to send a packet = (1000 * 8) bits / 106
                      = 8 miliseconds
                      
Since link utilization or efficiency is 25%, total time 
taken for 1 packet is 8 * 100/25 = 32 miliseconds.

Total time is twice the one way propagation delay plus 
transmission delay. Propagation delay has to be considered 
for packet and ack both.  
Transmission delay is considered only for packet as the 
question says that trans. time for ack is negligible.

Let propagation delay be x.
2x + 8 = 32.
x = 12.
Question 17
Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIX socket API.
A
listen, accept, bind recv
B
bind, listen, accept, recv
C
bind, accept, listen, recv
D
accept, listen, bind, recv
Transport Layer    GATE-CS-2015 (Set 2)    
Discuss it


Question 17 Explanation: 
bind, listen, accept and recv are server side socket API functions.

bind() associates a socket with a socket address structure, 
i.e. a specified local port number and IP address.

listen() causes a bound TCP socket to enter listening state.

accept() accepts a received incoming attempt to create a new
TCP connection from the remote client, 

recv() is used to receive data from a remote socket. 
A server must first do bind() to tell operating system the port number on which it would be listing, then it must listen to receive incoming connection requests on the bound port number. Once a connection comes, the server accepts using accept(), then starts receiving data using recv().
Question 18
Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let α be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let β be the maximum possible window size with window scale option. Then the values of α and β are.
A
63 milliseconds 65535 × 214
B
63 milliseconds 65535 × 216
C
500 milliseconds 65535 × 214
D
500 milliseconds 65535 × 216
Transport Layer    GATE-CS-2015 (Set 2)    
Discuss it


Question 18 Explanation: 
Since sequence number in TCP header is limited to 16 bits, the maximum window size is limited. When bandwidth delay product of a link is high, scaling is required to efficiently use link. TCP allows scaling of windows when bandwidth delay product is greater than 65,535 (Refer this). The bandwidth delay product for given link is 1048560 * α. Window scaling is needed when this value is more than 65535 bytes, i.e., when α is greater than 65535 * 8 / 1048560 or 0.5 seconds. Scaling is done by specifying a one byte shift count in the header options field. The true receive window size is left shifted by the value in shift count. A maximum value of 14 may be used for the shift count value. Therefore maximum window size with scaling option is 65535 × 214.
Question 19
Consider the following statements.
I. TCP connections are full duplex.
II. TCP has no option for selective acknowledgment
III. TCP connections are message streams.
A
Only I is correct
B
Only I and II are correct
C
Only II and III are correct
D
All of I, II and III are correct
Transport Layer    GATE-CS-2015 (Set 3)    
Discuss it


Question 19 Explanation: 
 
  1. In TCP, as sender and receiver can send segments at the same time, It is FULL-DUPLEX.
  2. TCP has options for selective acknowledgement. With selective acknowledgments (SACKs), the data receiver can inform the sender about all segments that have arrived successfully, so the sender need retransmit only the segments that have actually been lost.
  3. As each BYTE is counted in TCP segment, and Sequence number of First BYTE is kept into header, TCP is BYTE stream protocol.
So, only 1st is correct and other incorrect. Reference : https://tools.ietf.org/html/rfc2018 This solution is contributed by sandeep pandey.  
Question 20
Consider a network connecting two systems located 8000 kilometers apart. The bandwidth of the network is 500 × 106 bits per second. The propagation speed of the media is 4 × 106 meters per second. It is needed to design a Go-Back-N sliding window protocol for this network. The average packet size is 107 bits. The network is to be used to its full capacity. Assume that processing delays at nodes are negligible. Then, the minimum size in bits of he sequence number field has to be ________.
A
2
B
4
C
8
D
16
Transport Layer    GATE-CS-2015 (Set 3)    
Discuss it


Question 20 Explanation: 
Propagation time = (8000 * 1000)/ (4 * 10^6)
                 = 2 seconds

Total round trip propagation time = 4 seconds

Transmission time for one packet = (packet size) / (bandwidth)
                                 = (10^7) / (500 * 10^6)
                                 = 0.02 seconds

Total number of packets that can be transferred before an 
acknowledgement comes back = 4 / 0.02 = 200

Maximum possible window size is 200.  

In Go-Back-N, maximum sequence number should be one more than
window size.

So total 201 sequence numbers are needed. 201 different sequence
numbers can be represented using 8 bits.
Question 21
On a TCP connection, current congestion window size is Congestion Window = 4 KB. The window size advertised by the receiver is Advertise Window = 6 KB. The last byte sent by the sender is LastByteSent = 10240 and the last byte acknowledged by the receiver is LastByteAcked = 8192. The current window size at the sender is  
A
2048 bytes
B
4096 bytes
C
6144 bytes
D
8192 bytes
Transport Layer    Gate IT 2005    
Discuss it


Question 21 Explanation: 
Congestion Window: It is the factor which tells how much maximum byte can be sent through network in TCP connection. It is dynamic in TCP. Receiver Advertised Window: It is the factor which tells what is the maximum capacity of receiver to receive the data in bytes. Total amount of maximum bytes that can be send by receiver at any time is called receiver window size. At any time receiver can send minimum of Congestion Window and Receiver Advertised Window. Thus current window size=min(congestion window ,receiver advertised window) =min(4KB,6KB) =4KB =4*1024 bytes=4096bytes But this is confusing question In my opinion 4KB will be for first time. After that Receiver Window Size will be =  buffered data(unacknowledged) + min(congestion window ,receiver advertised window) = Unacknowledged data= (10240-8192)bytes=2048 bytes. = (4096+2048) bytes=6144 bytes   This solution is contributed by Abhishek Kumar.
Question 22
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per second. Tokens arrive at a rate to sustain output at a rate of 10 megabytes per second. The token bucket is currently full and the machine needs to send 12 megabytes of data. The minimum time required to transmit the data is _________________ seconds.
A
1.1
B
0.1
C
2.1
D
2.0
Transport Layer    GATE-CS-2016 (Set 1)    
Discuss it


Question 22 Explanation: 
Token bucket is a congestion control algorithm for data transfer. It takes tokens to synchronize between the rate of incoming and outgoing data.
According to the token bucket algorithm, the minimum time required 
to send 1 MB of data or the maximum rate of data transmission is 
given by:

   S = C / (M - P)

Where, 
M = Maximum burst rate,
P = Rate of arrival of a token,
C = capacity of the bucket

token-bucket-resize
Using the above formula for the given question we can say that:
M = 20 MB
P = 10 MB
C = 1 MB
S = 1 / (20- 10) = 0.1 sec 
Since, the bucket is initially full, it already has 1 MB to transmit so it will be transmitted instantly. So, we are left with only (12 - 1), i.e. 11 MB of data to be transmitted. Time required to send the 11 MB will be 11 * 0.1 = 1.1 sec The above image is adopted from here. This explanation is contributed by Namita Singh.
Question 23
Consider the following statements about the timeout value used in TCP. i. The timeout value is set to the RTT (Round Trip Time) measured during TCP connection establishment for the entire duration of the connection. ii. Appropriate RTT estimation algorithm is used to set the timeout value of a TCP connection. iii. Timeout value is set to twice the propagation delay from the sender to the receiver. Which of the following choices hold?
A
(i) is false, but (ii) and (iii) are true
B
(i) and (iii) are false, but (ii) is title
C
(i) and (ii) are false, but (iii) is true
D
(i), (ii) and (iii) are false
Transport Layer    Misc Topics in Computer Networks    Gate IT 2007    
Discuss it


Question 23 Explanation: 
  Time-out timer in TCP: One can’t use static timer used in data link layer (DLL), which is HOP to HOP connection, since nobody knows how many hops are there in the path form sender to receiver as it uses IP service and path may vary time to time. So, dynamic timers are used in TCP. Time-out timer should increase or decrease depending on traffic to avoid unnecessary congestion due to retransmissions. There are three algorithms are for this purpose: 1. Basic algorithm 2. Jacobson’s algorithm 3. Karl’s modification. Solution:
  1. The timeout value is set to the RTT (Round Trip Time) measured during TCP connection establishment for the entire duration of the connection.- FALSE The timeout value can’t be fixed for entire duration as it will turn timer to static timer, we need dynamic timer for timeout.
  1. Appropriate RTT estimation algorithm is used to set the timeout value of a TCP connection.-TRUE Yes, all three algorithm are appropriate RTT estimation algorithm used to set timeout value dynamically.
  1. Timeout value is set to twice the propagation delay from the sender to the receiver.-FALSE This statement is false because, timeout value is set to twice the propagation delay in data link layer where, hop to hop distance is known, not in TCP layer.
This solution is contributed by Sandeep pandey.
Question 24
Consider a TCP connection in a state where there are no outstanding ACKs. The sender sends two segments back to back. The sequence numbers of the first and second segments are 230 and 290 respectively. The first segment was lost, but the second segment was received correctly by the receiver. Let X be the amount of data carried in the first segment (in bytes), and Y be the ACK number sent by the receiver. The values of X and Y (in that order) are
A
60 and 290
B
230 and 291
C
60 and 231
D
60 and 230
Transport Layer    Gate IT 2007    
Discuss it


Question 24 Explanation: 
data in 1st segment is from byte number 230 to byte number 289, that is 60 bytes As 1st is lost so, TCP will send ACK for the next in-order segment receiver is expecting. So it will be for 230.
Question 25
Which of the following statements are TRUE?
(S1) TCP handles both congestion and flow control
(S2) UDP handles congestion but not flow control
(S3) Fast retransmit deals with congestion but not flow control
(S4) Slow start mechanism deals with both congestion and flow control
A
S1, S2 and S3 only
B
S1 and S3 only
C
S3 and S4 only
D
S1, S3 and S4 only
Transport Layer    Gate IT 2008    
Discuss it


Question 25 Explanation: 
1: with the help of TCP window=>flow control and with the help of congestion window=> Congestion control
2: No field are there in UDP header to control flow or congestion
3: It is used by TCP to overcome the problem of out of order segments by re-transmission
4: Slow start, nothing to do with flow control
Question 26
The three way handshake for TCP connection establishment is shown below.

2008_69
Which of the following statements are TRUE?
(S1) Loss of SYN + ACK from the server will not establish a connection
(S2) Loss of ACK from the client cannot establish the connection
(S3) The server moves LISTEN → SYN_RCVD → SYN_SENT → ESTABLISHED in the state machine on no packet loss
(S4) The server moves LISTEN → SYN_RCVD → ESTABLISHED in the state machine on no packet loss.
A
S2 and S3 only
B
S1 and S4
C
S1 and S3
D
S2 and S4
Transport Layer    Gate IT 2008    
Discuss it


Question 26 Explanation: 
Before Three Way Hand Shake both client and server are in closed state for start sending or receiving both client and server comes in Listen state. Steps: 1) Client sent SYN packet which will be received by the server. 2) Server will SYN + ACK packet so as to establish the connection of client. Now Client is ready to send the data. 3) Then Client will send ACK packet to server when this packet is received by server the server will also be in established state. Loss of SYN + ACK will not result in connection establishment of Client and thus it will not be able to send data to server. While ACK from client is not necessary because if client will send data packet immediately, it will considered as acknowledgement for the server . tcp This explanation has been contributed by Abhishek Kumar.
There are 26 questions to complete.

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.