Transport Layer ll Flashcards

1
Q

What is TCP?

A

A connection-oriented transport protocol providing reliable, in-order and flow-controlled data delivery between processes on different hosts

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 a 4-tuple: 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: For reliable data transfer
  • 16-bit receive window: For flow control
  • 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, other ACKs
  2. Other host sends FIN, first host 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 byte stream
  • Cumulative ACks: Ack next expected byte
  • Retransmissions: On timeout or 3 duplicate ACKs (fast retransmit)
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

Available buffer space at receiver: rwnd = rcvBuffer - (lastByteRcvd - lastByteRead)

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 on 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