TCP Connection Termination | FIN Segment (2024)

Spread the love


Three Way Handshake-

Before you go through this article, make sure that you have gone through the previous article on Three Way Handshake.

We have discussed-

  • TCP uses Three Way Handshake to establish a connection between the sender and receiver.
  • Connection establishment using Three Way Handshake involves the steps as shown-

TCP Connection Termination | FIN Segment (1)

Also Read- TCP Retransmission

In this article, we will discuss how a TCP connection is terminated.

TCP Connection Termination-

ATCP connection is terminated using FIN segment where FIN bit is set to 1.

Consider-

  • There is a well established TCP connection between the client and server.
  • Client wants to terminate the connection.

The following steps are followed in terminating the connection-

Step-01:

For terminating the connection,

  • Client sends a FIN segment to the server with FIN bit set to 1.
  • Client enters the FIN_WAIT_1 state.
  • Client waits for an acknowledgement from the server.

TCP Connection Termination | FIN Segment (2)

Step-02:

After receiving the FIN segment,

  • Server frees up its buffers.
  • Server sends an acknowledgement to the client.
  • Server enters the CLOSE_WAIT state.

TCP Connection Termination | FIN Segment (3)

Step-03:

After receiving the acknowledgement, client enters the FIN_WAIT_2 state.

Now,

  • The connection from client to server is terminated i.e. one way connection is closed.
  • Client can not send any data to the server since server has released its buffers.
  • Pure acknowledgements can still be sent from the client to server.
  • The connection from server to client is still open i.e. one way connection is still open.
  • Server can send both data and acknowledgements to the client.

TCP Connection Termination | FIN Segment (4)

Step-04:

Now, suppose server wants to close the connection with the client.

For terminating the connection,

  • Server sends a FIN segment to the client with FIN bit set to 1.
  • Server waits for an acknowledgement from the client.

TCP Connection Termination | FIN Segment (5)

NOTE

If server wanted,

It could have sent the FIN segment along with the previous acknowledgment that it sent to the client.

Step-05:

After receiving the FIN segment,

  • Client frees up its buffers.
  • Client sends an acknowledgement to the server (not mandatory).
  • Client enters the TIME_WAIT state.

TCP Connection Termination | FIN Segment (6)

TIME_WAIT State-

  • The TIME_WAIT state allows the client to resend the final acknowledgement if it gets lost.
  • The time spent by the client in TIME_WAIT state depends on the implementation.
  • The typical values are 30 seconds, 1 minute and 2 minutes.
  • After the wait, the connection gets formally closed.

Next Article- Practice Problems On TCP

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Summary

TCP Connection Termination | FIN Segment (7)

Article Name

TCP Connection Termination | FIN Segment

Description

TCP Connection Termination- A TCP connection is terminated using FIN segment where FIN bit is set to 1. Three Way Handshake is used to establish a TCP Connection. The steps involved in terminating a TCP Connection are described.

Author

Akshay Singhal

Publisher Name

Gate Vidyalay

Publisher Logo

TCP Connection Termination | FIN Segment (8)


Spread the love

TCP Connection Termination | FIN Segment (2024)
Top Articles
Frequently Asked Questions & Advice
European Health Insurance Options
Barstool Sports Gif
Skylar Vox Bra Size
Faint Citrine Lost Ark
Mileage To Walmart
Coindraw App
Myhr North Memorial
Celsius Energy Drink Wo Kaufen
Watch TV shows online - JustWatch
Craigslist Motorcycles Orange County Ca
Nebraska Furniture Tables
Fairy Liquid Near Me
Alejos Hut Henderson Tx
Maplestar Kemono
Byte Delta Dental
Race Karts For Sale Near Me
Costco Great Oaks Gas Price
Blue Rain Lubbock
Rufus Benton "Bent" Moulds Jr. Obituary 2024 - Webb & Stephens Funeral Homes
Conan Exiles Sorcery Guide – How To Learn, Cast & Unlock Spells
Unionjobsclearinghouse
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Free Personals Like Craigslist Nh
Best Sports Bars In Schaumburg Il
E32 Ultipro Desktop Version
Watertown Ford Quick Lane
Nottingham Forest News Now
Jackass Golf Cart Gif
Our Leadership
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Storelink Afs
Chapaeva Age
Baldur's Gate 3 Dislocated Shoulder
Capital Hall 6 Base Layout
Domino's Delivery Pizza
Nobodyhome.tv Reddit
Elgin Il Building Department
Tillman Funeral Home Tallahassee
Wunderground Orlando
Firestone Batteries Prices
Karen Wilson Facebook
Www.craigslist.com Waco
Pgecom
How To Get To Ultra Space Pixelmon
Craiglist.nj
Fredatmcd.read.inkling.com
O.c Craigslist
Suzanne Olsen Swift River
Psalm 46 New International Version
Morgan State University Receives $20.9 Million NIH/NIMHD Grant to Expand Groundbreaking Research on Urban Health Disparities
Haunted Mansion Showtimes Near The Grand 14 - Ambassador
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5501

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.