Quiz 5 (L22-25) - L4:UDP + L3:addressing) Flashcards
(41 cards)
What are the key differences between UDP and TCP?
UDP is connectionless, unreliable (no ACKs/retransmissions), preserves message boundaries, and has minimal overhead. TCP is connection-oriented, reliable, ensures ordered delivery, and includes flow/congestion control.
How do you calculate the UDP length field for 100 bytes of application data?
Length = Application data size + 8 bytes (UDP header) = 100 + 8 = 108.
What is the purpose of the UDP pseudo-header, and why does it violate layering principles?
The pseudo-header includes source/destination IPs, protocol (17), and UDP length. It ensures checksum verification of correct delivery. It violates layering by using network-layer information (IP addresses) in the transport layer.
When should UDP be used instead of TCP?
Use UDP for real-time applications (e.g., VoIP, gaming, DNS) where speed and low latency are prioritized over reliability.
Name three applications that use UDP and three that use TCP.
UDP: DNS, DHCP, VoIP.
TCP: HTTP, SMTP, FTP.
How can applications add reliability to UDP?
By implementing application-level mechanisms like ACKs, sequence numbers, retransmissions, and timeouts (e.g., QUIC, RTP/RTCP).
List the basic UDP socket operations for a server and client.
Server: socket(), bind(), recvfrom(), sendto(), close(). Client: socket(), sendto(), recvfrom(), close().
Why is the pseudo-header necessary for UDP checksum calculation?
It ensures the checksum includes IP addresses, preventing misdelivery to incorrect hosts. Without it, checksums wouldn’t detect IP errors.
How can an application use both UDP and TCP?
Example: A video game uses UDP for real-time actions (low latency) and TCP for chat messages (reliability).
Why does TCP need congestion control in addition to flow control?
Flow control prevents overwhelming the receiver; congestion control prevents network congestion (router overload and packet loss).
What is the congestion window (CWND), and how does it affect TCP’s effective window size?
CWS limits data “in flight.” Effective window = min(CWS, receiver window, sender window).
Calculate the new data a sender can transmit if EffectiveWindowSize = 10 KB and LastByteSent – LastByteAcked = 3 KB.
New data = 10 KB – 3 KB = 7 KB.
Explain how the AIMD algorithm regulates the congestion window.
Additive Increase (+1 segment/RTT) during no loss; Multiplicative Decrease (halve CWND) on loss. Creates a “sawtooth” pattern.
Describe the exponential growth phase of TCP slow start.
Starts with CWS=1. Doubles CWS per RTT (1→2→4→8). Speeds up initial data transfer.
When does TCP transition from slow start to congestion avoidance?
When CWND reaches the slow start threshold (ssthresh) or on packet loss.
What is the CWND size after 3 RTTs in slow start?
After 3 RTTs: CWND = 8 (1→2→4→8).
How does TCP differentiate between timeout-based loss and duplicate ACK-based loss?
Timeout resets CWND to 1 (slow start). Three duplicate ACKs trigger Fast Retransmit (immediate retransmission) and halve CWND (congestion avoidance).
What are the benefits of Fast Retransmit and Fast Recovery?
Reduces latency by retransmitting lost packets immediately without waiting for timeouts.
Why is TCP CUBIC better for high bandwidth-delay networks?
Uses a cubic function for aggressive yet stable window growth, improving scalability and fairness.
What fundamental problems does the Network Layer solve?
Global addressing, scalability, heterogeneity, and path selection.
What are the two main services provided by the Network Layer?
Addressing (unique IDs) and routing (path selection).
Why must network addresses be globally unique?
To avoid ambiguity (e.g., two devices with the same IP cannot coexist).
Why is hierarchical addressing necessary for Internet scalability?
Enables route aggregation, manageable routing tables, and administrative boundaries (e.g., postal system hierarchy).
Convert 192.168.1.100 to binary.
11000000.10101000.00000001.01100100.