remaining layer 4 Flashcards

(55 cards)

1
Q

What are the three phases of TCP connection management?

A
  1. Connection establishment (setup)
  2. Data transfer
  3. Connection termination (teardown)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the steps of the TCP three-way handshake?

A

SYN (x)
SYN (y) + ACK (x+1)
ACK (y+1)

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

What does the client send first in the three-way handshake?

A

A segment with the SYN flag set and an initial sequence number (ISN).

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

What does the server send in response to the client’s SYN?

A

A segment with SYN and ACK flags

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

What does the client send to complete the three-way handshake?

A

An ACK with ack = server ISN + 1.

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

Why is a two-way handshake insufficient in TCP?

A

It can’t confirm that the client received the server’s ISN or that the client is reachable.

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

Why is a four-way handshake unnecessary for TCP?

A

The third ACK can carry data

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

What are the steps of the TCP four-way handshake for connection termination?

A
  1. FIN: Client sends a segment with the FIN flag set
  2. ACK: Server acknowledges the FIN
  3. FIN: Server sends its own FIN when it’s ready to close
  4. ACK: Client acknowledges the server’s FIN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why are four steps required for TCP connection termination?

A

Because each direction must be closed independently.

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

What is the purpose of the TIME-WAIT state?

A

To ensure the final ACK is received and allow old duplicate segments to expire.

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

What is the typical duration of the TIME-WAIT state?

A

2 times the Maximum Segment Lifetime (2MSL).

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

What are the main TCP control flags used in connection management?

A
  • SYN (Synchronize): Initiates a connection
  • ACK (Acknowledgment): Acknowledges received data
  • FIN (Finish): Initiates the connection termination
  • RST (Reset): Abruptly terminates the connection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the SYN flag do?

A

It initiates a connection.

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

What does the ACK flag do?

A

It acknowledges received data.

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

What does the FIN flag do?

A

It initiates connection termination.

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

What does the RST flag do?

A

It abruptly resets the connection.

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

When is a TCP connection reset (RST) used?

A
  • segment arrives for a non-existent connection
  • host crashes and restarts
  • host receives unexpected data or control flags
  • host wants to abort a connection immediately
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does the client-side TCP state CLOSED mean?

A

No connection exists.

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

What does the client-side TCP state SYN_SENT mean?

A

Sent SYN, waiting for SYN-ACK

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

What does the client-side TCP state ESTABLISHED mean?

A

Connection established

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

What does the server-side TCP state LISTEN mean?

A

Waiting for incoming connections.

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

What does the server-side TCP state SYN_RCVD mean?

A

Received SYN, sent SYN-ACK, waiting for ACK

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

What transition happens on the client during connection establishment?

A

CLOSED → SYN_SENT → ESTABLISHED.

24
Q

What transition happens on the server during connection establishment?

A

CLOSED → LISTEN → SYN_RCVD → ESTABLISHED.

25
What are the client’s termination states in order?
ESTABLISHED → FIN_WAIT_1 → FIN_WAIT_2 → TIME_WAIT → CLOSED.
26
What are the server’s termination states in order?
ESTABLISHED → CLOSE_WAIT → LAST_ACK → CLOSED.
27
What are the three main goals of TCP’s sliding window?
* reliable delivery * data is delivered in order * flow control between sender and receive
28
What is the advertised window in TCP?
The amount of buffer space available at the receiver
29
What is the effective window size?
The minimum of the receiver window size and the sender window size.
30
What happens when the receiver’s buffer is full?
It advertises a window size of 0.
31
What is Zero Window Probing?
When the sender sends 1 byte to check if the receiver’s window has reopened after advertising 0.
32
Why is Zero Window Probing necessary?
Because the receiver only advertises a non-zero window in an ACK
33
What principle does Zero Window Probing follow?
“smart sender/dumb receiver”
34
What is Silly Window Syndrome?
A condition where small segments are sent repeatedly
35
What causes Silly Window Syndrome?
The receiver advertises small windows
36
What is the receiver-side fix for Silly Window Syndrome?
Delay ACKs until the window is at least MSS or a short timeout occurs.
37
What is the sender-side fix for Silly Window Syndrome?
Use Nagle’s Algorithm to avoid sending tiny segments.
38
What is Nagle’s Algorithm?
An algorithm that limits sending small data when unacknowledged data is in flight.
39
When does Nagle’s Algorithm allow sending small data?
When there is no unacknowledged data in flight.
40
How can applications disable Nagle’s Algorithm?
By using the TCP_NODELAY socket option.
41
What kind of applications might disable Nagle’s Algorithm?
Interactive applications that need low latency
42
What is the Maximum Segment Size (MSS)?
The largest amount of data that can be sent in a single TCP segment.
43
What is the Maximum Segment Lifetime (MSL)?
The longest time a TCP segment can exist in the network.
44
What are the three pointers on the sender side?
- LastByteWritten: last byte written by the application – LastByteSent: last byte sent to the network – LastByteAcked: last byte acknowledged by receiver
45
What are the three pointers on the receiver side?
– LastByteRcvd: last byte received from the network – LastByteAcked: last in-order byte that has been acknowledged (in the textbook, this is tracked as NextByteExpected, which would be LastByteAcked + 1) – LastByteRead: last byte read by the application
46
What relationship must hold for sender-side pointers?
LastByteAcked ≤ LastByteSent ≤ LastByteWritten.
47
What relationship must hold for receiver-side pointers?
LastByteRead ≤ LastByteAcked ≤ LastByteRcvd.
48
What is the Bandwidth-Delay Product (BDP)?
The amount of data that can be in flight to fully utilize a network link.
49
Why is the 16-bit TCP window field a problem in high-speed networks?
- limits the maximum window size to 65,535 bytes. - For a connection to utilize full network capacity, the window size must be at least as large as the bandwidth-delay product (BDP)
50
What triggers TCP to send data?
- Size-based: collected MSS (Maximum Segment Size) bytes - Push operation: sending application explicitly requests transmission - Timer-based: A timer fires, causing TCP to send whatever data is currently buffered
51
What is the original TCP timeout estimation formula?
EstimatedRTT = α × EstimatedRTT + (1 - α) × SampleRTT.
52
What timeout does the original algorithm use?
Timeout = 2 × EstimatedRTT.
53
What problem does the original algorithm have with retransmissions?
It cannot tell whether the ACK is for the original segment or the retransmission.
54
What does the Karn/Partridge algorithm change?
It avoids measuring RTT for retransmitted segments and uses exponential backoff for timeouts.
55
What is exponential backoff in TCP?
Doubling the timeout value with each retransmission.