CS FundamentalsModerateProduct-company placement · TCS NQT
A TCP server listens on port 80. Three clients connect and the server accept()s all of them. How many TCP sockets does the server process now hold, and what local port do the connected ones use?
- A. 4 sockets, all with local port 80
- B. 3 sockets, each on a new ephemeral port
- C. 4 sockets: the listener on 80, the others on ephemeral ports
- D. 1 socket on port 80 shared by all three connections
Correct answer: A. 4 sockets, all with local port 80
accept() returns a new connected socket for each client while the listening socket stays open, so there are 1 + 3 = 4. Connected sockets keep local port 80; they are told apart by the full 4-tuple (local IP, local port, remote IP, remote port).
More Computer Networks questions
- Karn's algorithm is applied to TCP's RTT estimation. Which statement is correct?
- The data 1001101110 is protected by a CRC with generator x⁴ + x + 1. What check bits are appended to it?
- A block code must correct every pattern of up to 2 bit errors and, at the same time, detect (without miscorrecting) every pattern of up to…
- Data is sent as a block of bits with an even-parity bit for every row and every column (two-dimensional parity). How many of these…
- An HDLC sender bit-stuffs the payload 0111111111111101111101111110 (a 0 after every five consecutive 1s, counting restarting after each…
- Stations on a 56 kbps pure-ALOHA channel send 1000-bit frames, and together they generate 21 frames per second (new plus retransmitted…