TCP and UDP utilize the two connection types. Connection-oriented and connectionless. TCP is considered connection-oriented. This means it uses a system to provide reliable delivery of traffic. TCP utilizes a system known as the three way handshake to establish connections.
Before a connection is considered established both hosts need to send and receive a send packet, and an ACK packet. Technically this could be four separate messages, but one of these transmissions can include both a send and an ACK, thus we have a three way handshake.
you may also like: ARP
Connection-oriented and Connectionless Protocols
The client host will initiate the interaction to the server by sending a send packet. The client then waits for a response. The server responds to the client by sending a send ACK packet. The client then completes the handshake by returning an ACK. The ACK packet is part of the positive acknowledgement system of TCP. Once enough information is sent TCP will wait for an ACK or acknowledgement. The amount of information that can be sent before a response is necessary is known as the Window size. If no ACK is returned then the previous information must have been lost in transit and is resent.
The resending of packets is known as retransmission. Packets also contain a sequence number, this allows the receiving host to determine if it missed any packets. If it determines that it has, it will request the sender to retransmit the missing information. TCP is especially useful for unreliable or often congested networks. This was very important in the early days with half-duplex networks producing collisions, resulting in lost packets. There are some cases where a reliable delivery isn’t necessary, and for this UDP is used.
With UDP, when information is sent, it is done so with no acknowledgements, no ordering, and no duplication protection. This means UDP can transmit information far faster than TCP. It no longer waits for ACKs,which on far flowing networks, reduces delays. The headers are also streamlined further improving throughput. This speed does mean that an occasional dropped packet will happen, but services that use UDP generally prefer speed over 100% reliability.
VoIP and video streaming are far more concerned with getting the packets there in a timely manner, as opposed to missing an occasional packet.Remember, it’s TCP for reliability, and UDP for speed.
Latest posts by Hamza Arif (see all)
- Wide area networks (WAN) & Metropolitan area networks (MAN) - August 18, 2018
- Understanding the Internet, intranets, and extranets - August 17, 2018
- Exploring network collisions, CSMA/CD, and CSMA/CA - August 16, 2018