Connection-oriented protocol: Establishes a connection, and uses this to ensure that all data has been properly transmitted
A connection at the transport layer implies that every segment of data sent is acknowledged, this way both ends of the connection always knows which bits of data have definitely been delivered to the other side and which haven’t.
Data could be loss during protocols due to many reasons. Resending data is up to TCP to determine when to resend this data. Since TCP expects an ACK for every bit of data it sends, it’s in the best position to know what data successfully got delivered and can make the decision to resent a segment if needed. This is another reason why sequence numbers are so important.
While TCP will generally send all segments in sequential order, they may not always arrive in that order. If some of the segments had to be resent due to errors at lower layers, it doesn’t matter if they arrive slightly out of order. This is because sequential numbers allow for all of the data to be put back together in the right order.
But TCP comes at a cost of lots of overhead. You can compare this with connectionless protocols, the most common of these known as User Datagram Protocol (UDP).
Unlike TCP, UDP doesn’t rely on connections and it doesn’t even support the concept of an acknowledgement. With UDP, you just set a destination port and send the packet. This is useful for messages that aren’t super important, a great example of UDP is streaming video
For the best viewing experience, you might hope that every single frame makes it to the viewer, but it doesn’t really matter if a few get lost along the way. A video will still be pretty watchable unless it’s missing lots.
By getting rid of all the overhead of TCP, you might actually be able to send higher quality video with UDP. That’s because you’ll saving more of the available bandwidth for actual data transfer instead of the overhead of establishing connections and acknowledging delivered data segments.