TCP vs UDP Comparison

TCP vs UDP Comparison

TCP vs UDP Comparison
Fig 1: TCP vs UDP Comparison

Transmission Control Protocol

Let’s take a look at TCP versus a UDP comparison. We're going to dive right into what those are, why they’re needed why they're used. So when one computer or device on a network wants to communicate with another computer or device, we have to have a way to guarantee that the communication is reliable and that the data is received correctly. If you want to look at a web page or an email or download a file, for instance, you want to be able to view that web page, email or file with everything intact. Nothing missing or in the wrong place. You also want to make sure you're getting the entire web page, email or file and not just parts of it or a partial segment of it. This is where TCP and UDP are used in computer networks. TCP stands for Transmission Control Protocol. In a TCP/IP network, TCP is one of the primary protocols used. It's used to guarantee that all of the data is received and that it's received in the correct order. If you don't have TCP, you may get a file or web page out of order or you may never get it at all. TCP is referred to as a "connection-oriented protocol" which means the 2 computers or devices that are communicating on the network have to first have an acknowledged session established.  Let me break that down a little for you, the 2 computers have to first verify a connection with each other before they can communicate with each other. TCP does a three-way handshake. The first of those three steps is called a SYN. The computer initiating the connection will send the second computer a SYN. The receiving computer (the second computer) will send back a SYN ACK which is short for SYN Acknowledgement. That's an acknowledgement verifying that it did receive the first message.  Then that first sending computer will then send an ACK or an acknowledgement message indicating it’s about to send a message or the data. Once those three steps have been completed data can be sent from the first to the second computer and sent more securely knowing that it's going to be almost guaranteed to get there. TCP essentially guarantees delivery of the data meaning if a data packet is lost or corrupted, TCP will resend it from the sending computer.

User Datagram Protocol

The other type of sending protocol is called UDP which stands for User Datagram Protocol. UDP is much like TCP.  It's also for sending and receiving data. The primary difference between UDP and TCP is that UDP is what is called a connection less oriented protocol. With UDP there is no session established and there is no guarantee of data delivery. The sending computer using UDP doesn't need to know if the receiving computer received the data on the other end of the connection. With UDP the sending computer simply sends data and doesn't care what happens to the data. UDP is also faster than TCP because as you can only imagine there is less bandwidth being used to verify a connection.  You will often see UDP used on things like live video broadcast or audio broadcasting whereby if data is lost it doesn't really matter because we’re "moving on" in other words or "moving on" so to speak. So that is the TCP versus UDP comparison.

Post a Comment

0 Comments