- •4 Osi Transport Layer
- •4.0 Chapter Introduction
- •4.0.1 Chapter Introduction Page 1:
- •4.1 Roles of the Transport Layer
- •4.1.1 Purpose of the Transport Layer Page 1:
- •Identifying the Applications
- •4.1.2 Controlling the Conversations Page 1:
- •4.1.3 Supporting Reliable Communication Page 1:
- •4.1.5 Port Addressing Page 1:
- •Identifying the Conversations
- •4.1.4 Tcp and udp Page 1:
- •4.1.6 Segmentation and Reassembly - Divide and Conquer Page 1:
- •4.2 The tcp Protocol - Communicating with Reliability
- •4.2.2 Tcp Server Processes Page 1:
- •4.2.3 Tcp Connection Establishment and Termination Page 1:
- •4.2.4 Tcp Three-Way Handshake Page 1:
- •4.2.5 Tcp Session Termination Page 1:
- •4.3 Managing tcp Sessions
- •4.3.1 Tcp Segment Reassembly Page 1:
- •4.3.2 Tcp Acknowledgement with Windowing Page 1:
- •4.3.3 Tcp Retransmission Page 1:
- •4.3.4 Tcp Congestion Control - Minimizing Segment Loss Page 1:
- •4.4 The udp Protocol - Communicating with Low Overhead
- •4.4.2 Udp Datagram Reassembly Page 1:
- •4.4.3 Udp Server Processes and Requests Page 1:
- •4.4.4 Udp Client Processes Page 1:
- •4.5 Lab Activities
- •4.5.1 Observing tcp and udp using Netstat Page 1:
- •4.5.2 Tcp/ip Transport Layer Protocols, tcp and udp Page 1:
- •4.5.3 Application and Transport Layer Protocols Page 1:
- •4.6 Chapter Summary
- •4.6.1 Summary and Review Page 1:
- •4.7 Chapter Quiz
- •4.7.1 Chapter Quiz Page 1:
4.2.5 Tcp Session Termination Page 1:
To close a connection, the FIN (Finish) control flag in the segment header must be set. To end each one-way TCP session, a two-way handshake is used, consisting of a FIN segment and an ACK segment. Therefore, to terminate a single conversation supported by TCP, four exchanges are needed to end both sessions. Note: In this explanation, the terms client and server are used in this description as a reference for simplicity, but the termination process can be initiated by any two hosts that complete the session:
1. When the client has no more data to send in the stream, it sends a segment with the FIN flag set.
2. The server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server.
3. The server sends a FIN to the client, to terminate the server to client session.
4. The client responds with an ACK to acknowledge the FIN from the server.
When the client end of the session has no more data to transfer, it sets the FIN flag in the header of a segment. Next, the server end of the connection will send a normal segment containing data with the ACK flag set using the acknowledgment number, confirming that all the bytes of data have been received. When all segments have been acknowledged, the session is closed.
The session in the other direction is closed using the same process. The receiver indicates that there is no more data to send by setting the FIN flag in the header of a segment sent to the source. A return acknowledgement confirms that all bytes of data have been received and that session is, in turn, closed.
As shown in the figure, the FIN and ACK control flags are set in the segment header, thereby closing a HTTP session.
It is also possible to terminate the connection by a three-way handshake. When the client has no more data to send, it sends a FIN to the server. If the server also has no more data to send, it can reply with both the FIN and ACK flags set, combining two steps into one. The client replies with an ACK.
4.2.5 - TCP Session Termination The diagram depicts a Wireshark screenshot of an Ethernet frame showing the TCP session termination request (FIN) and the resulting ACK to acknowledge the receipt of the FIN to terminate the session from the client to the server. In the screenshot, various information lines are highlighted: FIN Frame 20: The protocol analyzer shows details of frame 20, the TCP FIN request, including the destination and source ports and the header field contents and values. ACK Frame 20: Source IP 192.168.254.254, Destination IP 10.1.1.1. FIN Frame 20 detail: Transmission Control Protocol, Source Port: http (80), Destination Port: 1069 (1069) Seq: 440, Ack: 414, Len: 0. Flags: 0x11 (FIN, ACK). 00010000=Acknowledgment: Set. 00000001=Fin: Set. ACK Frame 21: The protocol analyzer shows details of frame 21, the TCP ACK response, including the destination and source ports and the header field contents and values. ACK Frame 21: Source IP 10.1.1.1, Destination IP 192.168.254.254. ACK Frame 21 detail: Transmission Control Protocol, Source Port: 1069 (1069), Destination Port: http (80) Seq: 414, Ack: 440, Len: 0. Flags: 0x10 (ACK) 00010000=Acknowledgment: Set [SEQ/ACK analysis] [This is an ACK to the segment in frame: 20]
Page 2:
In this activity, you will study the TCP 3-way handshake for session establishment and the TCP process for session termination. Many application protocols use TCP, and visualizing the session establishment and termination processes with Packet Tracer will deepen your understanding.
Click the Packet Tracer icon to launch the Packet Tracer activity.
4.2.5 - TCP Session Termination Link to Packet Tracer Exploration: TCP Session Establishment and Termination. In this activity, you study the TCP three-way handshake for session establishment and the TCP process for session termination. Many application protocols use TCP. Visualizing the session establishment and termination processes with Packet Tracer will deepen your understanding.
