TCP/UDP Services and Ports MCQs: 12 Solved Questions with Explanations

Solve 12 transport-layer MCQs on port and socket addressing, socket operations, TCP and UDP guarantees, application choices and TCP state.

KnowledgeGate Team

Exam prep & CS education

Updated 7 Nov 20268 min read
TCP/UDP Services and Ports MCQs: 12 Solved Questions with Explanations

Transport-layer MCQs often look like memory questions, but their traps come from mixing host-to-host delivery with process-to-process delivery, a port with a socket address, or normal protocol behaviour with an absolute guarantee. Service-point addressing, socket operations, TCP/UDP guarantees, application choices and TCP state each require a different governing rule. Choose an option and write one governing rule before reading each explanation.

Place services, ports and TCP/UDP in the wider syllabus through CS Fundamentals for Exams & Placements.

Transport services, ports and sockets: four checks before the MCQs

Transport-layer map from host and process delivery to ports, socket addresses, and TCP or UDP behavior.

Term

Exam rule

Network layer

Identifies a host and supports host-to-host delivery.

Transport layer

Identifies a process and supports process-to-process delivery.

Port

A 16-bit service-point address.

Socket address

An IP address plus a port number.

Suppose client socket address 192.0.2.10:53000 contacts server socket address 198.51.100.20:80. The two socket addresses form the endpoint pair. For TCP, the connection is identified by 192.0.2.10, 53000, 198.51.100.20 and 80, together with the transport protocol.

Many clients can use the same server port because TCP distinguishes each connection by its full endpoint pair, not by the destination port alone. That full context matters in MCQs.

A connectionless UDP server can serve many clients through a single bound server socket. A TCP server keeps one listening socket and adds one connected socket per accepted client after accept().

TCP supplies a connection-oriented, ordered byte stream with retransmission and flow and congestion control. UDP supplies connectionless datagrams without built-in delivery, order or retransmission guarantees. Applications choose between these contracts according to their needs: bulk or ordered transfer leans towards TCP, while short or time-sensitive exchanges lean towards UDP.

Transport service and addressing MCQs 1-3

Question 1 (UP LT Grade 2026)

In the TCP/IP protocol suite, what is the main function of the transport layer?

  • A. Synchronization

  • B. Updating and maintenance of routing tables

  • C. Process-to-process delivery

  • D. Node-to-Node delivery

Correct answer: C. Process-to-process delivery.

Routing tables support the network layer, while node-to-node delivery belongs lower in the stack. The transport layer uses ports to carry data between application processes, so C is correct.

Question 2 (UGC NET 2015)

The combination of an IP address and a port number is known as _____

  • A. network number

  • B. socket address

  • C. subnet mask number

  • D. MAC address

Correct answer: B. socket address.

In 192.0.2.10:53000, the IP locates the host interface and the port identifies the process endpoint. That pair is a socket address. The other options describe different addressing concepts.

Question 3 (UP Police Computer Operator 2013)

Port address in TCP/IP is ________ bits long.

  • A. 32

  • B. 48

  • C. 16

  • D. None of the above

Correct answer: C. 16.

The TCP and UDP port field is 16 bits. Since 2^16 = 65,536, its values run from 0 to 65,535. Do not confuse it with an IP or MAC address width.

Server ports and socket-operation MCQs 4-6

Question 4 (NIACL AO IT Specialist 2017)

In networking, the server uses _______ port and the client uses _______ port.

  • A. a well-known, an ephemeral

  • B. a well-known, a well-known

  • C. an ephemeral, an ephemeral

  • D. unknown, unknown

Correct answer: A. a well-known, an ephemeral.

In the conventional pattern tested here, the server listens on a stable, well-known port. The client gets a short-lived ephemeral port, like server :80 and client :53000.

Question 5

The BIND primitive in a TCP socket is used to

  • A. Send data

  • B. Receive data

  • C. Release the connection

  • D. Attach local address

Correct answer: D. Attach local address.

bind() associates a socket with its local IP or interface and port. Sending, receiving and closing use other operations. For this item, continue through the Services, Ports & UDP/TCP PYQ Questions hub for more socket-operation practice.

Question 6 (UP LT Grade 2022)

UDP uses one socket for 100 sessions; TCP uses one listening plus 100 accepted sockets, totaling 101.

Suppose there are two servers S₁ and S₂. S₁ is a UDP server and S₂ is a TCP server. Both servers are simultaneously maintaining 100 sessions, each with different clients. The number of sockets at both S₁ and S₂ are:

  • A. 100,100

  • B. 100,1

  • C. 1,100

  • D. 1,101

Correct answer: D. 1,101.

UDP multiplexes 100 clients on one bound socket. TCP keeps one listening socket plus 100 accepted sockets: 1 + 100 = 101. The ordered pair is 1,101.

TCP and UDP service-contract MCQs 7-9

Question 7 (UP LT Grade 2023)

Which of the given options best describes the truthfulness of the following statements?

i) In connectionless services of transport layer protocol, the packets are sent from one party to another with no need for connection establishment or connection release.

ii) In connection-oriented service of transport layer protocol, a connection is first established between the sender and the receiver.

iii) The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol.

  • A. i-True, ii-True, iii-True

  • B. i-False, ii-True, iii-True

  • C. i-True, ii-False, iii-True

  • D. i-False, ii-False, iii-False

Correct answer: A. i-True, ii-True, iii-True.

A connectionless service needs no setup or release, while a connection-oriented service establishes state first. UDP has no built-in delivery guarantee. Here, unreliable means best effort, so all three statements are true.

Question 8 (GATE 2004)

Which one of the following statements is FALSE?

  • A. TCP guarantees a minimum communication rate

  • B. TCP ensures in-order delivery

  • C. TCP reacts to congestion by reducing sender window size

  • D. TCP employs retransmission to compensate for packet loss

Correct answer: A. TCP guarantees a minimum communication rate.

TCP orders delivery, retransmits lost data and reduces sending pressure during congestion. It neither reserves bandwidth nor promises a minimum rate. A is false; B, C and D describe TCP behaviour. This GATE 2004 question also opens TCP and UDP MCQs: 12 Solved Transport Layer Questions, where it anchors a broad transport-layer set; here it tests the narrower rule that TCP does not guarantee throughput.

Question 9 (ISRO 2017)

Generally, TCP is reliable and UDP is not reliable. DNS, which has to be reliable, uses UDP because

  • A. UDP is slower

  • B. DNS servers have to keep connections

  • C. DNS requests are generally very small and fit well within UDP segments

  • D. None of these

Correct answer: C. DNS requests are generally very small and fit well within UDP segments.

A small DNS query and response can fit in a UDP exchange without connection setup. DNS is not UDP-only: larger, truncated or other exchanges can use TCP. A is backwards, and B contradicts connectionless operation.

Application choice and TCP-state MCQs 10-12

Question 10 (NIACL AO IT Specialist 2017)

_______ protocol is not desirable for real-time streaming because it follows the policy of retransmission during errors.

  • A. UDP

  • B. TCP

  • C. RIP

  • D. SIP

Correct answer: B. TCP.

TCP retransmission and ordering can hold later bytes behind a missing portion, adding unwanted delay. Some streaming systems use TCP, but this item tests retransmission against timeliness, not an absolute ban.

Question 11 (UP Police Computer Operator 2013)

Which of the following services use TCP?

i) DHCP

ii) SMTP

iii) HTTP

iv) TFTP

v) FTP

  • A. i) and ii)

  • B. ii), iii) and v)

  • C. i), ii) and iv)

  • D. i), iii) and iv)

Correct answer: B. ii), iii) and v).

DHCP uses UDP, SMTP uses TCP, HTTP uses TCP in this exam context, TFTP uses UDP and FTP uses TCP. Thus the TCP set is ii), iii) and v). This is not a claim about every modern HTTP version.

Question 12 (GATE 2015)

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 course of the TCP connection.

IV. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.

  • A. III only

  • B. I and III only

  • C. I and IV only

  • D. II and IV only

Correct answer: B. I and III only.

I is false because sequence numbers count bytes, so the next segment begins at m + payload bytes, not always m + 1. II is true because the timeout adds a safety allowance to estimated round-trip time. III is false because available receiver buffer changes. IV is true because unacknowledged data stays within the advertised flow-control window. The false pair is I and III.

Services, ports and TCP/UDP traps

Trap

Questions and correction

Host delivery versus process delivery

Transport provides process-to-process delivery; the network layer provides host-to-host delivery. (Q1)

Port versus socket address

A port is a 16-bit number; a socket address combines an IP address and port. (Q2, Q3)

Stable server versus temporary client endpoint

Servers use well-known ports; clients use temporary ephemeral ports. (Q4)

One bound socket versus accepted TCP sockets

UDP can use one bound socket; TCP adds one connected socket per accepted client. (Q5, Q6)

Connectionless does not mean incorrect by design

Small DNS queries suit UDP, though DNS can also use TCP. (Q7, Q9)

Reliability is not every guarantee

TCP orders and retransmits, but guarantees no minimum rate and has no fixed window. (Q8, Q10, Q12)

Classify each stem as an address, API primitive, guarantee or mapping. Write IP + port for socket items, translate unreliable as no built-in guarantee, and challenge always, never and guarantees.

For the full concept sequence, use TCP vs UDP: Transport Layer Explained.

Services, ports and TCP/UDP: the next practice step

Redo Questions 2, 4, 6, 8, 11 and 12 without looking. The key topics are endpoint construction, client and server ports, socket counts, TCP guarantees, application mappings and byte-oriented sequence state. Write one short rule beside each answer: IP + port, server stable/client temporary, UDP 1 versus TCP 1 + n, TCP has no minimum rate, DHCP/TFTP UDP, or sequence number advances by payload bytes. A guessed letter without its rule does not count.

Use GATE Guidance by Sanchit Sir for an exam-oriented Computer Networks route. The short version: ports identify processes, socket addresses identify endpoints, TCP trades extra state and recovery for ordered delivery, and UDP leaves recovery and timing policy to the application.