GATE Questions & Answers of TCP/UDP and Sockets

What is the Weightage of TCP/UDP and Sockets in GATE Exam?

Total 22 Questions have been asked from TCP/UDP and Sockets topic of Computer Networks subject in previous GATE papers. Average marks 1.41.

Match the followin

                   Field Length in bits
P. UDP Header’s Port Number     I. 48
Q. Ethernet MAC Address     II. 8
R. IPv6 Next Header    III. 32
S. TCP Header’s Sequence Number    IV. 16


Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits-persecond). The session starts with a sequence number of 1234. The minimum time (in seconds, rounded to the closest integer) before this sequence number can be used again is _______.

Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value stored in the first fragment is 0.
The fragmentation offset value stored in the third fragment is _______.

Consider a TCP client and a TCP server running on two different machines.  After completing  data transfer, the TCP client calls close to terminate the connection  and a FIN segment is sent to the  TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which  state does the client-side TCP connection wait for the FIN from the server-side TCP?

Consider socket API on a Linux machine that supports connected UDP sockets. A connected UDP socket is a UDP socket on which connect function has already benn called. Which of the following statement is/are CORRECT?

I. A coonected UDP socket can be used to communicate with multiple peers simultaneously.

II. A process can successfully call connect function again for an already connected UDP socket.

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?

I. If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1.
II. 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.
III. The size of the advertised window never changes during the curse of the TCP connection.
IV. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.

Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes).Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How many total number of IP fragments will be transmitted and what will be the contents of offset field in the last fragment?

Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let α be the value of RIT 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

Consider the following statements

I. TCP connections are full duplex
II. TCP has no option for selective acknowledgment
III. TCP connections are message streams

Identify the correct order in which the following actions take place in an interaction between a web browser and a web server.
             1. The web browser requests a webpage using HTTP.
             2. The web browser establishes a TCP connection with the web server.
             3. The web server sends the requested webpage using HTTP.
             4. The web browser resolves the domain name using DNS.

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

Which one of following socket API functions converts an unconnected active TCP socket into a passive socket?

Consider the store and forward packet switched network given below. Assume that the bandwidth of each link is 106 bytes / sec. A user on host A sends a file of size 103 bytes to host B through routers R1 and R2 in three different ways. In the first case a single packet containing the completea file is transmitted from A to B. In the second case, the file is split into 10 equal parts, and these packets are transmitted from A to B. In the third case, the file is split into 20 equal parts and these packets are sent from A to B. Each packet contains 100 bytes of header information along with the user data. Consider only transmission time and ignore processing, queuing and propagation delays. Also assume that there are no errors during transmission. Let T1, T2 and T3 be the times taken to transmit the file in the first, second and third case respectively. Which one of the following is CORRECT?

A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the output bit-string after stuffing is 01111100101, then the input bit-string is

The transport layer protocols used for real time multimedia, file transfer, DNS and email,respectively are

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 layer-4 firewall (a device that can look at all protocol headers up to the transport layer) CANNOT

One of the header fields in an IP datagram is the Time to Live (TTL) field. Which of the following statements best explains the need for this field?

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?

What is the maximum size of data that the application layer can pass on to the TCP layer below?

In the slow start phase of the TCP congestion control algorithm, the size of the congestion window

A client process P needs to make a TCP connection to a server process S. Consider the following situation: the server process S executes a socket (), a bind () and a listen () system call in that order, following which it is preempted. Subsequently, the client process P executes a socket () system call followed by connect () system call to connect to the server process S. The server process has not executed any accept () system call. Which one of the following events could take place?