🎓 BookMCQ
← Back to 24. Transport Layer Protocols

📝 TCP windows flow control (36 MCQs)

Receiver-Advertised Window for Buffer Protection

TCP flow control prevents a sender from overwhelming the receiving endpoint's buffer. The receiver advertises available space in the 16-bit Window field, called the receive window or rwnd. The sender limits unacknowledged data according to this advertised capacity, while a separate congestion window controls how much data may be placed into the network. It defines the boundary between application processes and packet delivery.

Why a Fast Sender Must Respect Receiver Capacity

A sender can produce data faster than an application reads it from the socket, causing the receiver's buffer to fill. Without feedback, incoming data could be discarded and recovery traffic would increase. TCP flow control communicates buffer availability so the sender can slow or stop its stream until the receiver has room again.

Window Advertisement and Sliding Byte Range

The receiver reports a window beginning at the next expected byte. As bytes are acknowledged and application data is consumed, the advertised right edge may advance. The sender may transmit within the permitted range, subject also to congestion control. Window scaling, negotiated during setup, extends the usable receive-window range beyond the 16-bit unscaled value.

A Receiver Reduces Its Advertised Window

Suppose the receiver expects byte 4000 and advertises rwnd of 6000 bytes. The sender may have data outstanding up to byte 9999, subject to cwnd. If the receiver later advertises 2000 bytes, the sender must respect the updated right edge for new data, even if its congestion window is larger.

Throughput, Buffer Sizing and Zero-Window Behaviour

A receive window that is too small can limit throughput on high-bandwidth, long-delay paths. A zero advertised window pauses ordinary new data until space becomes available; TCP uses persist mechanisms to probe for window updates that may have been lost. Flow control protects receiver memory but does not measure router or link congestion.

Separating Receiver Flow Control from Congestion Control

'The advertised window measures network congestion' is false: it reports receiver buffer capacity. 'A zero window means the connection has failed' is false: the receiver may simply be busy. 'The congestion window is sent in the TCP header' is false: cwnd is sender-side state, while the header carries the receiver's advertised window.

Exam Focus: Window Arithmetic and Sender Limits

Distinguish rwnd from cwnd and explain which endpoint maintains each value. Given a receiver's next expected byte and advertised window, calculate the right edge of the permitted range. Explain zero-window behaviour, persist probing, and the purpose of window scaling when a 16-bit window field would otherwise restrict high-bandwidth transfers. Use the assumptions stated in each question when calculating.

Key Terms for TCP Windows and Flow Control

  • rwnd - Receiver-advertised available buffer space.
  • cwnd - Sender limit based on network congestion.
  • Window edge - Last permitted byte position.
  • Zero window - Receiver reports no buffer space.
  • Persist timer - Triggers zero-window probes.
  • Window scaling - Extends advertised window beyond 16-bit range.
14
Easy
12
Medium
10
Hard

📝 All TCP windows flow control MCQs

Q1. What is the primary purpose of a TCP window?

A.To manage routing paths
B.To control flow of data ✅
C.To encrypt packets
D.To assign IP addresses
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The TCP window defines how many bytes a sender may transmit before receiving an acknowledgment, thereby regulating data flow between endpoints. It does not involve routing decisions, encryption, or IP address assignment, which are responsibilities of other layers. By limiting unacknowledged data, the window prevents buffer overflow and ensures reliable transmission.

Q2. If a sender's TCP window size is reduced from 64 KB to 16 KB during a connection, which effect is most likely?

A.Increase in throughput
B.Decrease in round‑trip time
C.Reduction in congestion window growth ✅
D.Higher probability of packet loss
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A smaller window limits the amount of outstanding data, causing the congestion control algorithm to grow the congestion window more slowly. This throttles the sender’s ability to increase its sending rate, so the primary observable effect is a reduction in the growth of the congestion window, potentially lowering overall throughput.

Q3. How does the sliding‑window mechanism differ from stop‑and‑wait ARQ in terms of channel utilization?

A.Sliding window keeps the channel busy by allowing multiple unacknowledged packets ✅
B.Stop‑and‑wait sends larger packets
C.Both use identical acknowledgment timing
D.Sliding window requires no acknowledgments
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Sliding‑window permits several packets to be transmitted before an acknowledgment is required, keeping the transmission medium occupied and improving efficiency. In contrast, stop‑and‑wait sends one packet and waits for its ACK, leaving the channel idle during the round‑trip, which results in lower utilization.

Q4. Given a network with a bandwidth of 10 Mbps and a round‑trip time (RTT) of 250 ms, what minimum TCP window size should be configured to fully utilize the link?

A.625 KB
B.156 KB
C.1 MB
D.312 KB ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: To fully utilize the path, the TCP window should match the bandwidth‑delay product: BDP=bandwidth×RTT=10 Mbps×0.25 s=2.5 Mbit=312.5 kB\text{BDP}= \text{bandwidth} \times \text{RTT}=10\,\text{Mbps}\times0.25\,\text{s}=2.5\,\text{Mbit}=312.5\,\text{kB}. The nearest option is 312 KB, ensuring the sender can keep the pipe full.

Q5. When a TCP receiver advertises a zero window size, what immediate behavior should the sender exhibit?

A.Pause transmission until a non‑zero window is advertised ✅
B.Continue sending at full rate
C.Close the connection
D.Switch to UDP
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A zero‑window advertisement signals that the receiver’s buffer is full. The sender must halt sending new data and periodically probe the receiver (using a zero‑window probe) until a non‑zero window is advertised, after which transmission can resume.

Q6. Which of the following best explains why TCP uses a dynamic window size rather than a fixed one?

A.Fixed windows simplify error detection
B.Dynamic windows adapt to varying network congestion ✅
C.Fixed windows increase security
D.Dynamic windows reduce header size
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Network conditions such as congestion, latency, and available bandwidth fluctuate over time. A dynamic window allows TCP to increase the window when the path can handle more data and shrink it when congestion is detected, optimizing throughput and minimizing packet loss compared to a static, inflexible window.

Q7. In the context of TCP, how does the advertised window interact with the congestion window to determine the effective send window?

A.Effective window equals the sum of advertised and congestion windows
B.Effective window is the larger of the two
C.Effective window is the minimum of the two ✅
D.Advertised window overrides congestion window
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: TCP uses both flow control (advertised window) and congestion control (congestion window). The sender may transmit only up to the smaller of the two limits, ensuring it does not exceed the receiver’s buffer capacity while also respecting network congestion constraints.

Q8. Suppose a TCP connection experiences intermittent packet loss causing the congestion window to halve repeatedly. How would this pattern affect the average throughput over a long period, assuming constant RTT?

A.Throughput would increase linearly
B.Throughput remains unchanged
C.Throughput would oscillate but converge to a lower steady‑state value ✅
D.Throughput would become zero
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Repeated halving of the congestion window reduces the amount of data that can be in flight, causing periodic drops in sending rate. Over time the system stabilizes at a lower average window size, yielding a reduced but non‑zero steady‑state throughput.

Q9. If the receiver’s advertised window is larger than the sender’s congestion window, which window limits the amount of data in transit?

A.The congestion window ✅
B.The advertised window
C.Both equally
D.Neither
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: When the advertised window exceeds the congestion window, the sender is constrained by its own congestion control parameters. Therefore, the congestion window becomes the limiting factor, dictating the maximum number of unacknowledged bytes that may be outstanding.

Q10. Compare the impact of increasing the initial TCP window size from 2 segments to 10 segments on the connection’s startup phase in a high‑latency environment.

A.Larger initial window reduces the number of slow‑start rounds, improving latency ✅
B.Larger initial window causes immediate congestion collapse
C.Both sizes behave identically during startup
D.Smaller initial window yields higher throughput
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: In high‑latency networks, each round‑trip incurs significant delay. Starting with a larger window allows the sender to transmit more data before waiting for ACKs, shortening the slow‑start phase and reducing overall connection setup latency, provided the network can accommodate the burst.

Q11. How does TCP’s selective acknowledgment (SACK) option improve the efficiency of the sliding‑window protocol when multiple packets are lost?

A.SACK forces the sender to retransmit the entire window
B.SACK allows the receiver to inform the sender exactly which blocks were received, enabling targeted retransmission ✅
C.SACK eliminates the need for acknowledgments
D.SACK doubles the window size automatically
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: SACK enables the receiver to convey the ranges of data that have arrived successfully, so the sender can retransmit only the missing segments rather than the whole window. This targeted recovery reduces unnecessary traffic, speeds up loss recovery, and improves overall throughput.

Q12. When a TCP sender receives a duplicate ACK indicating a missing segment, what standard algorithm does it typically invoke?

A.Fast retransmit ✅
B.Three‑way handshake
C.Checksum verification
D.Window scaling
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A duplicate ACK signals that a segment was likely lost. TCP’s fast retransmit algorithm reacts by retransmitting the suspected missing segment without waiting for the retransmission timer to expire, thereby accelerating loss recovery and maintaining data flow.

Q13. Evaluate the trade‑off between using a large TCP window size and the risk of buffer overflow in routers. Which statement best captures this relationship?

A.Larger windows always improve performance without drawbacks
B.Larger windows can cause router buffers to fill, leading to increased packet loss and retransmissions ✅
C.Smaller windows guarantee zero packet loss
D.Window size does not affect router behavior
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A large window permits more data to be in flight, which can saturate intermediate router buffers during congestion. If buffers overflow, packets are dropped, prompting retransmissions and potentially degrading performance. Hence, while larger windows can boost throughput, they must be balanced against the risk of inducing buffer overflows.

Q14. What role does the TCP window scale option play in modern high‑speed networks?

A.It encrypts the window size
B.It allows the window size to exceed the 65,535‑byte limit by using a scaling factor ✅
C.It reduces the window size to improve reliability
D.It disables flow control
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The window scale option extends the 16‑bit window field by applying a power‑of‑two multiplier, enabling window sizes far larger than 65 535 bytes. This capability is essential for high‑bandwidth, high‑latency links where the traditional limit would otherwise restrict throughput.

Q15. What range of port numbers is designated as well‑known ports?

A.0‑1023 ✅
B.1024‑49151
C.49152‑65535
D.All ports
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Well‑known ports are defined by ICANN as the range from 0 to 1023. This range is reserved for standard services like HTTP (80) and DNS (53). Because it is centrally managed, these ports are universally recognized and cannot be arbitrarily assigned to other applications.

Q16. In UNIX systems, which file typically contains the mapping of service names to well‑known ports?

A./etc/passwd
B./etc/services ✅
C./etc/hosts
D./etc/resolv.conf
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The file /etc/services stores static associations between symbolic service names and their corresponding port numbers. It is consulted by utilities such as grep to locate the port for a given service. The other listed files serve different purposes like user accounts, host resolution, or DNS configuration.

Q17. Which port number does the Trivial File Transfer Protocol (TFTP) commonly use?

A.53
B.69 ✅
C.80
D.443
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: TFTP is a simple file‑transfer protocol that traditionally operates on port 69. It can use either UDP or TCP, but UDP is most common. The other ports listed correspond to DNS (53), HTTP (80), and HTTPS (443), which are unrelated to TFTP.

Q18. If a server mistakenly registers a port in the well‑known range that is already assigned to another service, what is the most likely immediate effect on network traffic?

A.Traffic will be routed to the new service
B.Both services will share the traffic equally
C.Clients will receive a port‑conflict error ✅
D.The operating system will block the registration
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: When two services attempt to bind to the same well‑known port, the operating system typically prevents the second binding and returns an error. Clients trying to connect will encounter a failure, often reported as a port‑conflict, because the expected service is unavailable.

Q19. Suppose an application moves from using a registered port (e.g., 15000) to a dynamic port (e.g., 50000) without updating its firewall rules. What inference can be drawn about subsequent connection failures?

A.Failures are likely due to firewall blocking the new dynamic port ✅
B.The OS will automatically open the new port
C.Clients will ignore the port change
D.The application will fallback to the registered port
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Firewalls commonly have explicit rules for registered ports but may deny traffic to dynamic ports by default. When the application switches to a dynamic port without adjusting those rules, inbound packets are dropped, leading to connection failures. The OS does not auto‑open ports, and the application does not revert automatically.

Q20. Given that ICANN does not control dynamic ports, why might a security audit flag the use of port 50000 for a critical service?

A.Because dynamic ports are always insecure
B.Because the port can be easily spoofed and is not registered ✅
C.Because the port number is reserved for system use
D.Because the port is outside the IPv6 range
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Dynamic ports are not registered with ICANN, so they lack a globally recognized identity. An attacker can choose the same number for a malicious service, increasing the risk of spoofing or accidental collisions. Auditors therefore highlight unregistered ports for critical services as a potential security weakness.

Q21. If a network administrator observes that both TCP and UDP traffic are arriving on port 69, what deduction can be made about the underlying protocol usage?

A.Only TCP is being used
B.Only UDP is being used
C.Both TCP and UDP are being used by TFTP ✅
D.Port 69 is misconfigured
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Port 69 is the standard port for TFTP, which primarily uses UDP, but it is also permitted on TCP. Seeing traffic on both transport protocols indicates that the service is accepting connections via both UDP and TCP, suggesting a configuration that supports both variants of the protocol.

Q22. Assume two services, Service X on port 161 (SNMP) and Service Y on port 162, are both configured to listen on UDP. If a packet is sent to port 161 using TCP, what is the expected outcome?

A.Service X will process the packet
B.Service Y will process the packet
C.Both services will ignore the packet
D.The packet will be dropped because the protocol does not match ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: SNMP and SNMP‑TRAP are defined to operate over UDP. When a packet arrives using TCP, the operating system does not deliver it to a UDP socket, so the packet is discarded. Neither service can process the mismatched transport protocol, resulting in the packet being dropped.

Q23. When a new application is deployed and requests a port number in the range 49,152–65,535, what can be concluded about the registration status of that port?

A.It is a dynamic, unregistered port ✅
B.It must be registered with ICANN
C.It is a well‑known port
D.It is reserved for future use
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Ports from 49,152 to 65,535 are defined as dynamic ports. They are not controlled or registered by ICANN, allowing applications to use them temporarily or privately without needing an official assignment. Consequently, the requested port is unregistered and falls into the dynamic category.

Q24. If a firewall rule permits traffic to registered ports but denies dynamic ports, how will traffic to port 50,000 be treated?

A.Allowed because it is within the registered range
B.Denied because it falls in the dynamic range ✅
C.Allowed only for TCP
D.Denied only for UDP
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Port 50,000 lies within the dynamic range (49,152–65,535). Since the firewall explicitly denies dynamic ports, any packet destined for that port—regardless of protocol—will be blocked, resulting in a denied connection.

Q25. Consider a scenario where a client resolves a service name to port 8080 using /etc/services. What logical error might arise if the administrator later changes the service to use port 8081 without updating the file?

A.Clients will automatically detect the change
B.The service will bind to both ports
C.Clients will attempt to connect to the old port and fail ✅
D.The OS will redirect traffic to the new port
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The /etc/services file provides a static mapping. If the underlying service moves to a new port but the file is not updated, clients continue to request the old port (8080). Because the service no longer listens there, connection attempts fail until the mapping is corrected.

Q26. Compare the security implications of using a well‑known port versus a dynamic port for a proprietary service.

A.Well‑known ports are always more secure
B.Dynamic ports can obscure the service from generic scanners ✅
C.Both have identical security profiles
D.Well‑known ports guarantee encryption
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Dynamic ports are less likely to be targeted by automated scanners that focus on well‑known ports (0‑1023). By placing a proprietary service on a dynamic port, it gains a degree of obscurity, reducing the chance of opportunistic attacks, although it does not replace proper security controls.

Q27. Evaluate the impact on network manageability when an organization standardizes all internal services to use only registered ports instead of dynamic ports.

A.Increased flexibility but reduced predictability
B.Simpler firewall rules but higher risk of port collisions
C.No effect on manageability
D.Easier documentation and firewall configuration at the cost of limiting port availability ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Limiting services to the registered range (1024‑49,151) creates a predictable set of ports, simplifying documentation and firewall rule creation. However, the finite pool may become crowded, forcing administrators to negotiate port assignments and potentially limiting the number of distinct services that can coexist without conflict.

Q28. Differentiate between the role of /etc/services and the IANA registry in assigning port numbers.

A.Both are identical databases
B.IANA assigns only dynamic ports
C.IANA defines well‑known and registered ranges, while /etc/services provides local name‑to‑port mappings ✅
D.The /etc/services file registers ports with IANA
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: IANA (via ICANN) defines the official numerical ranges and assigns specific well‑known and registered ports. The /etc/services file, maintained locally on UNIX systems, maps human‑readable service names to those numbers for convenience. It does not perform registration; it merely reflects the assignments defined by the global registry.

Q29. Which of the following best explains why a well‑known port (e.g., 80) cannot be freely chosen for a new proprietary protocol?

A.Because it is already reserved for HTTP and would cause conflicts ✅
B.Because it is outside the ICANN range
C.Because dynamic ports must be used for proprietary protocols
D.Because the OS blocks all well‑known ports
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Port 80 is officially assigned to HTTP. Selecting it for a different protocol would cause immediate conflicts with existing web traffic, leading to ambiguous routing and service disruption. Well‑known ports are reserved to ensure interoperability, so new protocols must choose unassigned ports.

Q30. Assess the advantage of registering a port in the registered range (1024‑49,151) for a commercial application versus using a dynamic port.

A.Registration guarantees higher bandwidth
B.It prevents duplication and eases firewall configuration ✅
C.Dynamic ports provide better performance
D.Registered ports are automatically encrypted
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Registering a port provides a unique identifier that prevents accidental duplication across the Internet. It also allows network operators to create stable firewall rules, knowing the port will remain associated with the application. Dynamic ports lack this guarantee, making policy management more complex.

Q31. Identify the primary difference between a well‑known port and a dynamic port regarding control by ICANN.

A.Both are controlled by ICANN
B.Only dynamic ports are controlled
C.Well‑known ports are unregulated
D.Well‑known ports are assigned and controlled; dynamic ports are neither controlled nor registered ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: ICANN (through IANA) assigns and manages the well‑known (0‑1023) and registered (1024‑49,151) ranges. Dynamic ports (49,152‑65,535) are left unregulated, allowing applications to select them without a formal registration process.

Q32. Given two services, one using port 161/UDP (SNMP) and another using port 162/UDP (SNMP‑TRAP), what can be inferred about their functional relationship?

A.They serve identical purposes ✅
B.Port numbers indicate unrelated services
C.Both are used for TCP connections
D.Port 162 is for IPv6 only
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Port 161 is the standard SNMP agent port, while port 162 is reserved for SNMP trap messages. Both belong to the same protocol family and are defined by IANA, indicating a closely related functional relationship—one for queries, the other for asynchronous notifications.

Q33. If an organization decides to migrate its legacy service from port 69 (TFTP) to a custom port 21000, what potential benefit does this migration provide?

A.It eliminates the need for firewall rules
B.It automatically encrypts the traffic
C.It reduces the likelihood of accidental interference from other TFTP clients ✅
D.It makes the service compatible with IPv6
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Changing to a non‑standard port moves the service out of the well‑known range that many generic TFTP clients scan by default. This reduces the chance that another application will unintentionally bind to the same port, decreasing accidental collisions and improving operational stability.

Q34. Apply the principle of port range allocation: which range would you select for a temporary testing service that does not require registration?

A.49,152–65,535 ✅
B.0–1023
C.1024–49,151
D.All ports
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A temporary or private service typically uses a dynamic port because it does not need to be registered and can be allocated quickly. The dynamic range (49,152–65,535) is intended for such short‑lived or experimental uses, avoiding the need for formal assignment.

Q35. Synthesize a policy that restricts outbound traffic to well‑known ports only. Which of the following statements best describes the effect on typical web browsing?

A.Web browsing would be blocked because it uses dynamic ports
B.Web browsing would work because HTTP and HTTPS use well‑known ports 80 and 443 ✅
C.All traffic would be allowed
D.Only DNS queries would be permitted
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Web browsers primarily use HTTP (port 80) and HTTPS (port 443), both of which are well‑known ports. Restricting outbound traffic to well‑known ports therefore permits normal web browsing while potentially blocking applications that rely on higher‑numbered ports.

Q36. Explain why a network engineer might prefer to map a service name to a registered port in /etc/services rather than a dynamic port.

A.Dynamic ports are faster
B.Registered ports are encrypted by default
C.Service names cannot be used with dynamic ports
D.Registered ports are documented and avoid accidental collisions ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Using a registered port provides a stable, documented identifier that other administrators and tools can rely on. It reduces the risk of two applications inadvertently choosing the same port, which is more likely with dynamic ports that have no central coordination.

🔗 Related Topics (MCQs)