Search code examples
network-programmingtcp

purpose of TCP connection teardown


TCP is a connection oriented protocol and by connection oriented what we really mean is the virtual connection.Then why do we need to terminate the connection on completion of the data exchange?


Solution

  • TCP is a byte stream and the peers need to know when the byte stream ends. This is what TCP FIN segments are for - to tell the peer that it has received all data in the stream and that no more data will follow.