-
Notifications
You must be signed in to change notification settings - Fork 20
Specification of Teardown
The Client can close a connection and the server can request closing of the connection. Closing of the connection by the client will be described first.
We will first consider case, where client closes connection. Teardown was inspired again by DCCP protocol. If client wants to close connection, then this client can't share any data on server (client has to be unsubscribed from all data). Client only receive keep alie packets from server in this situation. Client start teardown switching from state OPEN to state CLOSING. Client sends payload packets with flag FIN in state CLOSING. Client send these packet repeately until it receive acknowledge packet of FIN packet. Such packet is called FIN-ACK. Other packets then FIN-ACK are ignored by client. When client receive packet FIN-ACK, then client is switched to state CLOSED. Teardown is ilustrated on following picture:
client server
o o
| |
OPEN + + OPEN
| |
| FIN pay_id=X |
CLOSING +------------------------------------------->+----+
| | |
| FIN pay_id=Y ack_id=Z ack=X | V
CLOSED +<-------------------------------------------+ CLOSED (LISTEN)
| |
. .
. .
Following picture includes all possible scenarios during teardown:
client server
o o
| |
OPEN + + OPEN
| |
| FIN pay_id=X |
CLOSING +------------------------------------>X |
| |
| |
| |
| |
| FIN pay_id=X |
timeout +------------------------------------------->+----+
| | |
| FIN pay_id=Y ack_id=Z ack=X | V
| X<--------------------------------------+ CLOSED (LISTEN)
| |
| FIN pay_id=X |
timeout +------------------------------------------->+----+
| | |
| | |
| | |
| | |
| FIN pay_id=X | |
timeout +------------------------------------------->+----+----+
| | | |
| FIN pay_id=Y ack_id=Z ack=X | | |
CLOSED +<-------------------------------------------+<---+ |
| | |
| FIN pay_id=Y ack_id=Z ack=X | |
drop +<-------------------------------------------+<--------+
| |
. .
. .
Notes:
- Client has to consider case, where server can die during teardown. It means, that client can not send FIN packet infinity long, when there is no response from server. Client has to automaticaly switch from state CLOSING to state CLOSED in such situation after expiration of some timeout.
- Server can deallocate system reources used for resend mechanism, when server is switched to state closed, but it has to respond on FIN packets. Client can free system resources, when it is switched to state CLOSING.
client server
o o
| |
OPEN + + OPEN
| |
| FIN pay_id=W |
+----+<-------------------------------------------+ CLOSEREQ
| | |
V | FIN pay_id=X |
CLOSING +------------------------------------------->+----+
| | |
| FIN pay_id=Y ack_id=Z ack=X | V
CLOSED +<-------------------------------------------+ CLOSED (LISTEN)
| |
. .
. .
- Home
- C/C++ API
- Basic Functions
- Node Functions
- Tag Functions
- Layer Functions
- Python API
- Session Methods
- Node Methods
- Tag Group Methods
- Tag Methods
- Layer Mehods
- Specification
- Data Types
- Transport Layer
- Security
- Structure of Packet and Message
- User Authentication
- Negotiation
- Handshake of Datagrame Connection
- Teardown of Datagrame Connection
- Resend Mechanism
- Congestion Control
- Flow Control
- TCP Variant
- Websocket Variant
- Node Commands
- Tag Group Commands
- Tag Commands
- Layer Commands