GateAI
TCP Flow and Congestion Control

GATE CSE 2017 Set 2 · Q18

MCQ1 markMedium

Time

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 been called. Which of the following statements is/are CORRECT? I. A connected 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.

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) II only

TCP Flow and Congestion Control

In BSD/Linux socket programming with UDP (SOCK_DGRAM):

  1. Statement I is incorrect: Calling connect() on a UDP socket associates the socket with a specific foreign IP address and port number. Once connected:

    • The socket will only receive datagrams arriving from that specific peer address.

    • Datagrams sent using write() or send() will automatically be transmitted to that specific peer.

    • Thus, a connected UDP socket cannot be used to communicate with multiple peers simultaneously.

  2. Statement II is correct: Unlike TCP sockets (where connect() can only be called once to establish a 3-way handshake), a UDP socket can call connect() multiple times:

    • To reassign/reconnect to a new peer address and port.

    • To unconnect/dissociate the socket by setting the address family to AF_UNSPEC.

Therefore, only statement II is correct.

Hence, (B) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This TCP Flow and Congestion Control previous year question is Q18 of the GATE CSE 2017 Set 2 paper. Find more GATE CSE PYQs on TCP Flow and Congestion Control in Computer Networks, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related TCP Flow and Congestion Control PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

TCP Flow and Congestion Control in GATE CSE

TCP Flow and Congestion Control has 23 GATE CSE PYQs across 21 papers from 2012 to 2026. 10 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2017 Set 2.

How GATE tests TCP Flow and Congestion Control

More from GATE CSE 2017 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2017 Set 2 · Q18 · MCQ

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 been called. Which of the following statements is/are CORRECT? I. A connected 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.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.