TCP Finite State Machine States, Events and Transitions Flashcards

1
Q

The default state that each connection starts in before the process of establishing it begins. This state is called “fictional” in the standard because this state represents the situation in which there is no connection between devices. It either hasn’t been created yet or has just been destroyed.

A

CLOSED

Event and Transition
Passive Open: A server begins the process of connection setup by doing a passive open on a TCP port. At the same time, it sets up the data structure (transmission control block, or TCP) that it needs in order to manage the connection. It then transitions to the LISTEN state.

Active open, send SYN: A client begins the connection setup by sending a SYN message, and it sets up a TCB for this connection. It them transitions to the SYN-SENT state.

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

A device (normally a server) is waiting to receive a SYN message from a client. It has not yet sent its own SYN message.

A

LISTEN

Event and transition:
Receive client SYN, send SYN+ACK: The server device receives a SYN from a client. It sends back a message that contains its own SYN and acknowledges the one it received. The server moves to the SYN-RECEIVED state.

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

The device (normally a client) has sent a SYN message and is waiting for a matching SYN from the other device (usually a server)

A

SYN-SENT

Receive SYN, Send ACK: If the device that has sent its SYN message receives a SYN from the other device but not an ACK for its own SYN, it acknowledges the SYN it receives and then transitions to SYN-RECEIVED in order to wait for the acknowledgement to its own SYN.

Receives SYN+ACK, Send ACK: If the device that sent the SYN receives both an acknowledgement to its SYN and a SYN from the other device, it acknowledges the SYN received and then moves straight to the ESTABLISHED state.

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

The device has received a SYN (connection request) from its partner and sent its own SYN. It is now waiting for an ACK to its SYN in order to finish the connection setup.

A

SYN-RECEIVED

Receive ACK: When the device receives the ACK to the SYN that it sent, it transitions to the ESTABLISHED state.

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

The steady state of an open TCP connection. Both devices can exchange data freely once both devices in the connection enter this state. This will continue until they close the connection.

A

ESTABLISHED

Close, send FIN: A device can close the connection by sending a message with the FIN bit sent, and then it can transition to the FYN-WAIT-1 state.

Receive FIN: A device may receive a FIN message from its connection partner asking that the connection be closed. It will acknowledge this message and transition to the CLOSE-WAIT state.

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

The device has received a close request (FIN) from the other device. It must now wait for the application on the local device to acknowledge this request and generate a matching request.

A

CLOSE-WAIT

Close, send FIN: The application using TCP, having been informed that the other process wants to shut down, sends a close request to the TCP layer on the machine it is running. TCP then sends a FIN to the remotedevice that already asked to terminate the connection. This device now transitions to LAST-ACK.

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

A device that has already received a close request and acknowledged has sent its own FIN and is waiting for an ACK to this request.

A

LAST-ACK

Receive ACK for FIN: The device receives an acknowledgement for its close request. We have now sent our FIN and had it acknowledged, and received the other device’s FIN and acknowledged it, so we go straight to the CLOSED state.

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

A device in this state is waiting for an ACK for a FIN it has sent, or is waiting for a connection termination request from the other device.

A

FIN-WAIT-1

Receive ACK for FIN: The device receives an acknowledgement for its close request. It transitions to the FIN-WAIT-2 state.

Receive FIN, send ACK: The device does not receive an ACK for its own FIN, but receives a FIN from the other device. It acknowledges it and then moves to the CLOSING state.

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

A device in this state has received an ACK for its request to terminate the connection and is now waiting for a matching FIN from the other device

A

FIN-WAIT-2

Receive FIN, send ACK: The device receives a FIN from the other device. It acknowledges it and then moves to the TIME-WAIT state.

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

The device has received a FIN from the other device and has sent an ACK for it, but has not yet received an ACK for its own FIN message.

A

CLOSING

Receive ACK for FIN: The device receives an acknowledgement for its close request. It transitions to the TIME-WAIT state.

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

The device has now received a FIN from the other device and acknowledged it, and sent its own FIN and received an ACK for it. We are finished, except for waiting to ensure the ACK is received and preventing potential overlap with new connections.

A

TIME-WAIT

Timer Expiration: After a designated wait period, the device transitions to the CLOSED state.

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