Transport Layer ll Flashcards

(14 cards)

1
Q

What is TCP?

A

A reliable, connection-based way to send data — in order and with flow control

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

How is a TCP connection identified?

A

By 4 values: source IP, source port, destination IP, destination port

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

What are key fields in a TCP header?

A
  • Sequence/Ack numbers: Tracks and confirms data
  • 16-bit receive window: Controls how much data to send
  • Flags (SYN, ACK, FIN, RST): Connection management
  • Checksum: Error detection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is the MSS determined?

A

MSS = MTU (link layer frame size) - TCP/IP header (40 bytes)

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

Describe the 3-way handshake

A
  1. Client -> Server: SYN (seq=client_isn)
  2. Server -> Client: SYN-ACK (seq=server_isn, ack=client_isn+1)
  3. Client -> Server: ACK (ack=server_isn+1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is a TCP connection terminated?

A
  1. One host sends FIN, gets ACKs
  2. Other host sends FIN, gets ACKs
  3. Wait for timeout (2*MSL) to ensure all segments die
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does TCP ensure reliability?

A
  • Sequence numbers: Track bytes
  • Cumulative ACKs: Confirm delivery
  • Retransmissions: If data is missing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What triggers fast retransmit?

A

Receiving 3 duplicate ACKs for the same segment

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

What is the receive window (rwnd)?

A

How much space is left in the receiver’s buffer: Free space = total buffer - what’s already received

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

How does the sender avoid overflow?

A

Sends only up to min(cwnd, rwnd) unacknowledged bytes

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

How does TCP detect congestion?

A

Packet loss (timeout/duplicate ACKs) or delayed ACKs

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

What is AIMD?

A

Additive Increase: Increase cwnd by 1 MSS/RTT
Multiplicative Decrease: Halve cwnd if there’s loss

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

When to use UDP over TCP?

A

For real-time apps (low latency, tolerant to loss), no connection overhead or many clients

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

Key trade-offs

A
  • UDP: No reliability/flow control, low overhead
  • TCP: Reliable but slower (handshake, congestion control)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly