Whenever a computer wants to communicate with another computer, the communication between those two computers needs to be good and reliable, so it can guarantee that the data is received correctly. for example, once you want to view a web page, or download a file, or check out an email, you’d expect to view the web page intact and in order, with nothing missing. Or if you’re downloading a file, you’d want the whole file and not just a part of the file, because if data is missing or out of order, then it wouldn’t be of any benefit to you.
So this is where TCP comes in. TCP stands for Transmission Control Protocol and this is often one of the most protocols used in a TCP/IP Network, and TCP is what’s used to guarantee that all the data is received and in order, because without TCP, then a number of the data might be missing or out of order because if you view a web page without TCP, your website might be all messed up. the pictures might be missing or the text might be backward and out of order. Or if you download a file, then you would possibly not get the whole file, otherwise, you could get the file out of order, which might render the file useless.
This is where TCP comes in. Now TCP is a connection-oriented protocol, which basically means it must first acknowledge a session between the 2 computers that are communicating.
So, the 2 computers verify a connection before any communication takes place. And it does this by using a three-way handshake. the first step is that a computer will send a message called an SYN.
Then the receiving computer will send back an acknowledgment message telling the sender that it’s received the message, then finally the sender computer sends another acknowledgment message back to the receiver. then once this has taken place data can be delivered.
Another important thing to remember about TCP is that it guarantees the delivery of the info. So, if a data packet goes astray and doesn’t arrive, then TCP will resend it. Now UDP is extremely almost like TCP. UDP is additionally for sending and receiving data. But the most difference is that UDP is connection-less. this means that it doesn’t establish a session and it doesn’t guarantee data delivery.
when a computer sends their data, it doesn’t really care if the info is received at the opposite end, and that is why UDP is known as the “fire-and-forget” protocol, because it sends data, and it doesn’t really care what happens to it as this demonstration will show. Another point to remember is because of the less overhead that’s involved in not guaranteeing data delivery, UDP is faster than TCP.