TCP stands for Transmission Control Protocol.
TCP Communication between source to destination computer:
When you want to load a web page, your computer sends TCP packets to the web server’s address. During this asking it to send the web page to you. The web server responds by sending a stream of TCP packets. This is your web browser sews up together to form the web page and display it to you.
When you click a link, sign in, post, or a comment, or do anything else, your web browser sends TCP packets to the server. In additionally, the server sends TCP packets back. TCP is not just one way communication. The remote system sends packets back to acknowledge it is received your packets.
TCP guarantees the recipient will receive the packets accordingly by numbering them. The recipient sends messages back to the sender saying it received the messages. If the sender does not get a correct response, it will resend the packets. This process is use to ensure the recipient received them.
Packets are also checked for errors. This reliability is that packets sent with TCP are tracked so no data is lost or corrupted in transit. This is why file downloads do not become corrupted even so there are network hiccups. If the recipient is completely offline, your computer will give up. Additionally you will see an error message saying it cannot communicate with the remote host.
UDP stands a datagram is the same thing as a packet of information. The UDP protocol works similarly to TCP, though it tosses all the error-checking stuff out. All the back-and-forth communication and deliverability guarantees slow things down.
UDP Communication between source to destination computer:
When using UDP, packets are just sent to the recipient. The sender will not wait to make sure the recipient received the packet; it will just continue sending the next packets. If you are the recipient and you miss some UDP packets, you cannot ask for those packets again. There is no guarantee you are getting all the packets and there is no way to ask for a packet again if you miss it. But losing all this overhead means the computers can communicate more quickly. UDP is used when speed is desirable and error correction is not necessary. For instance, it is frequently used for live broadcasts and online games.
TCP vs UDP or Difference between TCP and UDP protocol
TCP(Transmission Control Protocol)
- TCP establishes connection between the computers before transmitting the data
- Connection Oriented type protocol
- Speed is slow
- Highly Reliable
- Header size is 20Bytes
- It takes acknowledgement of data and has the ability to retransmit, if the user requests.
UDP(User Datagram Protocol)
- UDP stands the data directly to the destination computer without checking the system is ready or not.
- Connection type is connectionless
- Fast in speed
- Header is 8Bytes
- Neither it takes acknowledgement nor it retransmits the lost data.