When you loaded this webpage today, you used an application like a phone app or a web browser. The application then needs to transport the web page information held on web-servers likely states away. Your computer uses either the transport protocol TCP or UDP to transport effectively.
TCP stands for Transmission Control Protocol. TCP is the most used protocol for web browsing, checking social media, and online shopping.
The reason TCP is most used is because of its reliability and has few errors. When you first click a link, you ask the web server holding the website for access to the web page. The web server then acknowledges this by sending a stream of TCP packets. Which you can think of as little fragments of the website, that must be rebuilt when it reaches you.
To ensure the reliability of the stream of packets, they are numbered and error checked. So, after you receive packet 1 you send a message back saying you received it, and you can now take packet 2. If packet 2 gets lost on the way back, you will not send a message back acknowledging you received it. The web server notices this error and will retry until you acknowledge you received packet 2. You can then continue the process until all the packets are sent and rebuilt in your web browser.
A good example of how a TCP conversation takes place.
A con of TCP is it’s too slow for real-time information because of the back and forth acknowledgements. For communications that need to be quick, we use UDP. UDP stands for User Datagram Protocol. A datagram is essentially a packet.
To increase communication speeds, UDP cut out the packet numbering and acknowledgments. The back and forth increases the latency of communication.
Instead of loading a webpage, let’s say you are watching Netflix. When you start a movie the Netflix server holding the movie starts streaming UDP packets to you. This is great because you can view 4k video without having to wait hours for it to download.
But, when a group of packets gets lost, you then get a buffering loading screen or the video gets choppy. Once the UDP packets find you again the stream will restart.
UDP is also used in online video games. You can tell when something is wrong with a player’s UDP stream if, they lag around the map.
Thank you for reading!Leave a comment below or contact me forquestions, ideas, or concerns!-Tristian