When a client needs to connect with a remote server using
TCP/IP: Refer to Article
What is TCP (Transmission Control Protocol)
- First, the client must contact the server and request a connection.
- After the connection is established, various control parameters for the connection are negotiated.
- After data transmission begins, a sliding window flow-control scheme is used to manage data transfer.
A connection is established via a
three-way handshake.
This handshake helps define the start of a new TCP connection, and prevents a host from being confused by duplicate packets generated by a previous connection that arrives late.
- Host A (the sender) sends a TCP segment to Host B with the SYN flag set to 1 and the ACK flag set to 0.
- Host B returns a segment to Host A in which both the SYN and ACK flags are set to 1.
- Host A can now acknowledge to Host B that it received its ACK. It sends a segment in which ACK=1 and SYN=0.
Included these steps, is a negotiation of an initial
sequence number for the client and for the server (each uses its own sequence number scheme). Host A sends its starting number to Host B and Host B acknowledges that number by incrementing it and returning the number to Host A. The same process is used to negotiate host B's starting sequence number.
After data is transmitted, the session is terminated:
- Host A sends a FIN=1 to host B.
- Host B then responds with ACK=1 and FIN=1 and host A responds to that with ACK=1.
TCP uses a
keep-alive feature to keep connections open and manage connections. Keep-alive verifies that the computer at the other end of a connection is still available. Refer to Article
How does the TCP KeepAlive mechanism work? A single host can set up multiple connections over the TCP/IP network at any time. This is called multiplexing. If multiple applications or network processes are running, each may set up a connection to a different computer.
For example, you can simultaneously open multiple Web Browsers and connect to multiple sites.
TCP uses flow controls, sliding windows, and various other mechanisms to manage sessions.
These are discussed further under the following general headings:
- "Connection Establishment"
- "Flow-Control Mechanisms"
- "Congestion Control Mechanism"
The topic congestion control discusses techniques that TCP uses to control congestion. Specifically, TCP relies on dropped packets as a signal that the receiver or network is overloaded. Much work has gone into improving this technique. A number of IETF Working Groups are developing extensions to TCP or working on updates.
Refer to the IETF Web site (
https://www.ietf.org/) , specifically the Transport Area Working Group
https://datatracker.ietf.org/wg/tsvwg/documents