-
Notifications
You must be signed in to change notification settings - Fork 0
17 Transmission Control Protocol
Defined by the Internet Engineering Task Force (IETF) in the Request for Comment (RFC) standards document number 793.
TCP is a connection-oriented network protocol that is used in the transmission of data over networks.
-
Connection-oriented: a connection is established and maintained until the application programs are each end have finished exchanging messages.
-
Protocol: set of rules and procedures that govern hown the transmission of data is carried out so that everyone in the whole world, independent of the location, software or hardware used, does the thing the same way.
TCP works together with IP (Internet Protocol) in a well-known duo called TCP/IP.
- IP deals with the addressing and forwarding of data packets from source to destination
- TCP manages the reliability of the transmission
Controls the transfer of data such that it is reliable.
Data is transmitted in packets, and reassembled once they reach the destination to give back the original data.
Transmission of data on a network is done in layers, each protocol on one layer doing something complementary with what the others are doing. This set of layers is called a protocol stack.
A reliabile data transmission is one in which the following requirements are met.
- all the packets reach the destination, no packet is lost
- no such delay that would affect data quality
- all data packets are reassembled in order
TCP labels packets with numbers. It also makes sure they have a deadline to reach the destination (time-out). For each packet recieved, the sending device is notified through a packet called acknowledgment. If after the time-out, no acknowledgment is received, the source sends another copy of the probably missing or delayed packets. Out-of-order packets are also not acknowledged. This way, all packets are always assembled in order, without holes and within a predetermined acceptable delay.
TCP has no elaborate addressing system unlike IP with IP addresses. TCP does not need one. It only uses numbers provided by the device it is working on to identify where it is receiving and sending packets for which service. These numbers are called ports. For example, web browsers use the port 80 for TCP. Port 25 is used for email. The port number is often coupled with the IP address for a service, e.g. 192.168.66.5**:80**
Retransmissions and the need to reorder packets after they arrive can introduce latency in a TCP stream. Highly time-sensitive applications like voice over IP (VoIP) and streaming video generally rely on a transport like User Datagram Protocol (UDP) that reduces latency and jitter (variation in latency) by not worrying about reordering packets or getting missing data retransmitted.