So, what's the point of using UDP over IP? Well, for the following two reasons!
A UDP packet specifies two destination identifiers, the IP address which identifies the computer, and the port number which identifies the application on said computer.
So what is this checksum method for checking data integrity during transfers used by UDP?
Checksums are often used to detect errors in data transmission, as a small change in the input data will result in a different checksum value. However, checksums are not designed to be secure against deliberate tampering, as it is easy to generate a new input with the same checksum value.
Checksums is just one of many other error detection techniques, but what makes it special is its simplicity and efficiency. It is used often in various applications including computer networks, storage systems, and file transfer protocols.
The above meme is a classic among a gazillion others on UDP. You get the idea. TCP is more a handshake that needs both sides to be in agreement about the exchange. UDP, on the other hand, is a connectionless protocol that sends without asking. The sender has no idea if all the data made it to the other side, or if the data made it there at all, or if the other side is there to receive it.
Basically you would more often choose UDP over TCP when speed is of paramount importance. TCP you'd use for slower but reliable transfers, typically for email and web browsing. UDP you'd want to be using for fast, but non-guaranteed transfers ("best effort"), typically for real-time services like music streaming and VoIP (Voice over IP) which is primarily concerned with keeping the stream going, as fast as possible.
TCP and IP are two separate computer network protocols. IP is the part that obtains the address to which data is sent. TCP handles data delivery once that IP address has been found. The two terms are sandwiched together and referred to as one unified framework ("TCP/IP model") since they're generally used in tandem.
The purpose of a TCP/IP socket is to identify the computer or network server's unique IP address, along with its port number.
For a detailed comparison click here.
Or at least how our favorite study buddy describes it:
TCP (Transmission Control Protocol) and IP (Internet Protocol) are two separate protocols that work together to enable communication over the internet. TCP provides reliable, ordered, and error-checked delivery of a stream of packets from one program on one computer to another program on another computer. IP is responsible for routing the packets between different networks.
Let's say you want to send an email from your computer to a friend's computer. Here is how TCP and IP work together to accomplish this task:
Your email client (such as Gmail or Outlook) breaks down the email message into smaller packets of data, each with a header that contains information such as the source and destination addresses, sequence number, and checksum.
The packets are then handed over to TCP, which divides the data into segments and assigns a sequence number to each segment. TCP also ensures that the segments are delivered in the correct order and retransmits any lost or corrupted packets.
TCP then hands over the segments to IP, which adds its own header with information such as the source and destination IP addresses, time-to-live (TTL) value, and protocol number (which in this case is TCP).
IP then determines the best route for the packets to take to reach the destination computer. This is done by consulting a routing table that contains information about the various networks and their connections.
Once the packets arrive at the destination computer, IP removes its header and hands over the data to TCP.
TCP then reassembles the segments in the correct order, checks for any missing packets or errors, and delivers the complete message to the email client on the destination computer.
The destination email client then sends an acknowledgment back to the source email client using the same process, but in reverse.
Overall, TCP and IP work together to ensure that data is transmitted reliably and efficiently over the internet. TCP provides reliable data transfer by dividing data into segments, assigning sequence numbers, and retransmitting any lost or corrupted packets. IP provides routing of packets by adding its own header and consulting a routing table to determine the best path for the packets to take. Together, TCP and IP form the backbone of internet communication, allowing us to send and receive data across the globe.
What is TCP/IP?
TCP vs. UDP
TCP/IP and UDP Comparison
TCP vs. UDP in VoIP