TCP Protocol - sarahduv-401-advanced-javascript/seattle-javascript-401d32 GitHub Wiki
TCP Protocol
What is it?
- TCP (Transmission Control Protocol) is a standard that defines how to establish and maintain a network conversation via which application programs can exchange data. TCP works with the Internet Protocol (IP), which defines how computers send packets of data to each other.
How does it work?
- TCP is a connection-oriented protocol, this means that a connection is established and maintained until the application programs at each end have finished exchanging messages.
- It determines how to break application data into packets that networks can deliver, sends packets to and accepts packets from the network layer, manages flow control, and—because it is meant to provide error-free data transmission—handles retransmission of dropped or garbled packets as well as acknowledgement of all packets that arrive.
Example
- A Web server sends an HTML file to a client, and it uses the HTTP protocol to do so.
- The HTTP program layer asks the TCP layer to set up the connection and send the file.
- The TCP stack divides the file into packets, numbers them and then forwards them individually to the IP layer for delivery. Although each packet in the transmission will have the same source and destination IP addresses, packets may be sent along multiple routes.
- The TCP program layer in the client computer waits until all of the packets have arrived, then acknowledges those it receives and asks for the retransmission on any it does not (based on missing packet numbers), then assembles them into a file and delivers the file to the receiving application.
Source: https://searchnetworking.techtarget.com/definition/TCP