Both TCP and UDP are protocols which are used for sending bits of data called as packets over the Internet. They both are built on top of the Internet protocol. In other words, whether you are sending a packet via TCP or UDP, that packet is sent to an IP address. These packets are treated similarly, as they are forwarded from your computer to an intermediary router and then on to the destination.
TCP UDP TCP stands for Transmission Control Protocol. UDP stands for User Datagram Protocol. TCP is connection oriented, which means there is a sequence of operations to be followed by the users.
These are: Connection is established.Information is sent. and Connection is released.
UDP is connectionless, which means the data is transferred
in one direction from source to destination without
checking that destination is still there or not or if it prepared to accept the message.
TCP rearranges the data packets in the order specified. There is an absolute guarantee that the data transferred remains intact (ACK) and arrives in the same order in which it was sent. UDP does error checking but simply discards erroneous packets. Error recovery is not attempted. TCP performs flow control. UDP does not have an option of flow control. Examples: DNS, DHCP, TFTP