Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+16 votes

What are the main differences between TCP and UDP for the Transport Layer of networking? What are some pros and cons to each protocol?

asked in CSC335_Spring2019 by (1 point)

1 Answer

+9 votes
 
Best answer

There are many differences when it comes to TCP vs. UDP and they are articulated in an article I read earlier today.

TCP - Is a connection-oriented protocol which enforces a policy that devices should and must establish a connection before data can be transmitted followed by a termination of that connection.

UDP - Is a data-gram-oriented protocol which doesn't have to worry much about the establishment, maintaining of, and termination of a connection it is best used in a broadcast or multi-cast network transmission

Another big difference between the two is that TCP has an additional feature in which data is guaranteed to be delivered by receiving and 'ACK' from the destination end. While this is only every other packet, this doesn't mean that it waits to continue transmitting packets to the destination but if 'ACK' isn't received then the packet is resent.

TCP is regards to speed is far slower than UDP as there is more overhead for keeping track of the order in which packets are sent/recevied as well as the header sizes (20 bytes). TCP is considered heavy-weight but is a main component in: HTTP, HTTPS, FTP, SMTP, and Telnet.

UDP is far faster than TCP as there is no order in sequencing as packets are sent but if ordering is required then the application layer would take responsibility of this. The header size is 8 bytes and is used in the following: DNS, DHCP, TFTP, SNMP, RIP, and VoIP (Voice over IP).

If anyone would like to add to this or correct something I may have spoken incorrectly on please do!

answered by (1 point)
selected by
+7

Thanks for your answer, Dylan! Much appreciated :)

...