Quiz 5 (L22-25) - L4:UDP + L3:addressing) Flashcards

(41 cards)

1
Q

What are the key differences between UDP and TCP?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you calculate the UDP length field for 100 bytes of application data?

A

Length = Application data size + 8 bytes (UDP header) = 100 + 8 = 108.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of the UDP pseudo-header, and why does it violate layering principles?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When should UDP be used instead of TCP?

A

Use UDP for real-time applications (e.g., VoIP, gaming, DNS) where speed and low latency are prioritized over reliability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name three applications that use UDP and three that use TCP.

A

UDP: DNS, DHCP, VoIP.
TCP: HTTP, SMTP, FTP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can applications add reliability to UDP?

A

By implementing application-level mechanisms like ACKs, sequence numbers, retransmissions, and timeouts (e.g., QUIC, RTP/RTCP).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List the basic UDP socket operations for a server and client.

A

Server: socket(), bind(), recvfrom(), sendto(), close(). Client: socket(), sendto(), recvfrom(), close().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why is the pseudo-header necessary for UDP checksum calculation?

A

It ensures the checksum includes IP addresses, preventing misdelivery to incorrect hosts. Without it, checksums wouldn’t detect IP errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can an application use both UDP and TCP?

A

Example: A video game uses UDP for real-time actions (low latency) and TCP for chat messages (reliability).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why does TCP need congestion control in addition to flow control?

A

Flow control prevents overwhelming the receiver; congestion control prevents network congestion (router overload and packet loss).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the congestion window (CWND), and how does it affect TCP’s effective window size?

A

CWS limits data “in flight.” Effective window = min(CWS, receiver window, sender window).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Calculate the new data a sender can transmit if EffectiveWindowSize = 10 KB and LastByteSent – LastByteAcked = 3 KB.

A

New data = 10 KB – 3 KB = 7 KB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain how the AIMD algorithm regulates the congestion window.

A

Additive Increase (+1 segment/RTT) during no loss; Multiplicative Decrease (halve CWND) on loss. Creates a “sawtooth” pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe the exponential growth phase of TCP slow start.

A

Starts with CWS=1. Doubles CWS per RTT (1→2→4→8). Speeds up initial data transfer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When does TCP transition from slow start to congestion avoidance?

A

When CWND reaches the slow start threshold (ssthresh) or on packet loss.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the CWND size after 3 RTTs in slow start?

A

After 3 RTTs: CWND = 8 (1→2→4→8).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does TCP differentiate between timeout-based loss and duplicate ACK-based loss?

A

Timeout resets CWND to 1 (slow start). Three duplicate ACKs trigger Fast Retransmit (immediate retransmission) and halve CWND (congestion avoidance).

18
Q

What are the benefits of Fast Retransmit and Fast Recovery?

A

Reduces latency by retransmitting lost packets immediately without waiting for timeouts.

19
Q

Why is TCP CUBIC better for high bandwidth-delay networks?

A

Uses a cubic function for aggressive yet stable window growth, improving scalability and fairness.

20
Q

What fundamental problems does the Network Layer solve?

A

Global addressing, scalability, heterogeneity, and path selection.

21
Q

What are the two main services provided by the Network Layer?

A

Addressing (unique IDs) and routing (path selection).

22
Q

Why must network addresses be globally unique?

A

To avoid ambiguity (e.g., two devices with the same IP cannot coexist).

23
Q

Why is hierarchical addressing necessary for Internet scalability?

A

Enables route aggregation, manageable routing tables, and administrative boundaries (e.g., postal system hierarchy).

24
Q

Convert 192.168.1.100 to binary.

A

11000000.10101000.00000001.01100100.

25
Identify the network and host parts of 172.16.50.100.
Class B → Network: 172.16.0.0, Host: 50.100.
26
Determine the class of 192.168.1.50.
First byte = 192 (binary 110xxxxx) → Class C.
27
Calculate the number of networks and hosts for Class B.
Networks: 2¹⁴ = 16,384; Hosts: 2¹⁶ – 2 = 65,534.
28
What are the network and broadcast addresses for 192.168.1.50?
Network: 192.168.1.0; Broadcast: 192.168.1.255.
29
What is the purpose of the loopback address (127.0.0.1)?
Used for testing network software locally without external traffic.
30
Compare Class A, B, and C in terms of use cases.
Class A (large orgs, e.g., ISPs), Class B (medium orgs, e.g., universities), Class C (small orgs, e.g., home networks).
31
What were the limitations of classful addressing?
Inflexible network/host splits caused address waste (e.g., 300 hosts requiring a Class B block).
32
What were the two main limitations of classful addressing?
Inefficient address utilization (rigid classes) and scalability issues.
33
What does CIDR notation "192.168.1.0/24" represent?
The first 24 bits are the network part; the remaining 8 bits are the host part.
34
Convert /26 to a network mask.
255.255.255.192.
35
Calculate usable hosts for a /26 CIDR block.
2^(32 – 26) – 2 = 64 – 2 = 62 hosts.
36
Determine the network and broadcast addresses for 192.168.10.50/26.
Network: 192.168.10.0; Broadcast: 192.168.10.63.
37
What CIDR prefix length is needed for 1000 hosts?
Solve 2^b – 2 ≥ 1000 → b=10 → /22.
38
Find the CIDR block for 1000 hosts starting at 140.20.5.10.
Use 140.20.8.0/22 (range: 140.20.8.1–140.20.15.254).
39
How do Class A, B, and C map to CIDR?
Class A = /8, Class B = /16, Class C = /24.
40
Define subnetting.
Dividing a network into smaller subnets for efficient address use and management.
41
What are the benefits of CIDR over classful addressing?
Efficient address allocation, flexible subnetting, and reduced routing table sizes via aggregation.