Hot Downloads

Welcome, Guest
Username: Password: Remember me

TOPIC: four-way TCP termination

four-way TCP termination 11 years 1 month ago #9436

  • x1ng
  • x1ng's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
hi there,
if there is a host "A" and host "B" and A wants to terminate a TCP connection with "B"

ACK,FIN SEQ=1000
A
>B

ACK ACK=1001
A<
B

ACK,FIN ACk=1001
A<
B
SEQ=1470

ACK ACK=1470
A
>B

Connection Terminated
<
>

my question is why host "B" has sent two segments (one with ACK and the another with ACK+FIN+SEQ)why he didnt send one segment contain (ack,FIN flag and SEQ)?
The administrator has disabled public write access.

Re: four-way TCP termination 11 years 1 month ago #9512

  • x1ng
  • x1ng's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
is that question is not clear or somthing?,
i am sure there is somthing wrong with that question.. :roll: :roll:
The administrator has disabled public write access.

Re: four-way TCP termination 11 years 1 month ago #9513

  • jwj
  • jwj's Avatar
  • Offline
  • Senior Member
  • Posts: 350
  • Karma: 0
Your question was good, x1ng.

My best guess as to why it was designed this way is to allow the tcp connection to be half closed. If host A closes it's side of the connection, it can not send any more packets as that specific connection, it would have to create an entirely new one with host B. However, if host B is still open to host A, it can still send packets as part of that connection.

Here's a quote about this from the TCP article here on firewall.cx:

"If you're wondering why this procedure is required, then you may need to recall that TCP is a Full Duplex connection, meaning that there are two directions of data flow. In our example this is the connection flow from Host A to Host B and vice versa. In addition, it requires both hosts to close the connection from their side, hence the reason behind the fact that both hosts must send a FIN flag and the other host must ACKnowledge it."

I hopes this clears things up.
-Jeremy-
The administrator has disabled public write access.

Re: four-way TCP termination 11 years 1 month ago #9520

  • x1ng
  • x1ng's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
1st thank you jwj for you replay .but i have a comment
My best guess as to why it was designed this way is to allow the tcp connection to be half closed. If host A closes it's side of the connection, it can not send any more packets as that specific connection, it would have to create an entirely new one with host B. However, if host B is still open to host A, it can still send packets as part of that connection.

i dont know what you mean by half closed.you mean that if "A" wants to terminate a connection with "B" it will not be a full termination and if "A" wants to send more packets to "B" it will use the same connection.and is this means that there is a half termination and a full termination?or its all half termination and what is the use of half termination? is that to save a throughput by using the same TCP connection after termination?!!
i think I or you missunderstood you or me :roll: :roll:

i have a comment i have got it from a friend about the four-tcp termination

STEP 1: "A" sends a message to say 'I am closing the link. Here is the last of my data'

STEP 2, 3: "B" sends back "okay,( I got the data), (you can close the link)'
"Its two segments"

STEP 4: "A" sends 'okay, I know you got the data and that you are happy for me to close the link (ACK)'

i think host "B"when receive a FIN flag he must ACKnowledg 1st
the data(i go the data) to make sure that no data lost .then it will send the FIN flag to "A" to agree with the termination..
The administrator has disabled public write access.

Re: four-way TCP termination 11 years 1 month ago #9525

  • jwj
  • jwj's Avatar
  • Offline
  • Senior Member
  • Posts: 350
  • Karma: 0
Remember that TCP is a full duplex protocol.
you mean that if "A" wants to terminate a connection with "B" it will not be a full termination and if "A" wants to send more packets to "B" it will use the same connection.

If "A" terminates it's side of the connection, it will need to start all over again, that is three way handshake. "B" will still be able to use it's side of the connection since it's still up. Half-closed connections are not very desirable, and shouldn't happen in most normal connections.

Here is the actual "teardown" steps:

1.) Host "A" ACKnowledges the previous data sent from "B" and is initiating the termination process with the FIN flag.

2.) "B" ACKnowledges that message.

3.) "B" sends it's termination message, FIN and ACK flags set.

4.) "A" ACKnowledges the termination.

Connection is fully closed.
-Jeremy-
The administrator has disabled public write access.
Time to create page: 0.082 seconds

CCENT/CCNA

Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V

Linux

  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup