TCP Vs UDP

Overview

TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client re-requests the packet from the server until the whole packet is complete and is identical to its original.

UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality.

There are two types of Internet Protocol (IP) traffic. They are TCP or Transmission Control Protocol and UDP or User Datagram Protocol. TCP is connection oriented – once a connection is established, data can be sent bidirectional. UDP is a simpler, connectionless Internet protocol. Multiple messages are sent as packets in chunks using UDP.

Comparison chart

TCP UDP
Reliability: There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent. There is no guarantee that the messages or packets sent would reach at all.
Data Flow Control: TCP does Flow Control. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. UDP does not have an option for flow control
Connection Reliable: Two way Connection reliable one way Connection Reliable
Streaming of data: Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries. Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent.
Acronym for: Transmission Control Protocol User Datagram Protocol or Universal Datagram Protocol
Function: As a message makes its way across the internet from one computer to another. This is connection based. UDP is also a protocol used in message transport or transfer. This is not connection based which means that one program can send a load of packets to another and that would be the end of the relationship.
Usage: TCP is used in case of non-time critical applications. UDP is used for games or applications that require fast transmission of data. UDP’s stateless nature is also useful for servers that answer small queries from huge numbers of clients.
Header Size: TCP header size is 20 bytes UDP Header size is 8 bytes.
Weight: TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. UDP is lightweight. There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP.
Error Checking: TCP does error checking UDP does not have an option for error checking.
Ordering: TCP rearranges data packets in the order specified. UDP does not order packets. If ordering is required, it has to be managed by the application layer.
Examples: HTTP, HTTPs, FTP, SMTP Telnet etc… DNS, DHCP, TFTP, SNMP, RIP, VOIP etc…
Speed of transfer in mbps: The speed for TCP in comparison with UDP is slower. UDP is faster because there is no error-checking for packets.

 

Differences in how TCP and UDP work

A TCP connection is established via a three way handshake, which is a process of initiating and acknowledging a connection. Once the connection is established data transfer can begin. After transmission, the connection is terminated by closing of all established virtual circuits.

UDP uses a simple transmission model without implicit hand-shaking dialogues for guaranteeing reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagrams may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level. Unlike TCP, UDP is compatible with packet broadcasts (sending to all on local network) and multicasting (send to all subscribers).

 

Different Applications of TCP and UDP

Web browsing, email and file transfer are common applications that make use of TCP. TCP is used to control segment size, rate of data exchange, flow control and network congestion. TCP is preferred where error correction facilities are required at network interface level. UDP is largely used by time sensitive applications as well as by servers that answer small queries from huge number of clients. UDP is compatible with packet broadcast – sending to all on a network and multicasting – sending to all subscribers. UDP is commonly used in Domain Name System, Voice over IP, Trivial File Transfer Protocol and online games.

 

Source:

http://www.diffen.com/difference/TCP_vs_UDP

http://www.skullbox.net/tcpudp.php

You can leave a response, or trackback from your own site.

5 Responses to “TCP Vs UDP”

  1. vintage prom dresses under says:

    This is a great article. It¡¯s not only well-written, it¡¯s interesting and you have expressed your views beautifully. You have struck gold with this content.

  2. nootropics says:

    Real good information can be found on this web site.

  3. rift platinum says:

    Very interesting info!Perfect just what I was looking for!

  4. aion kinah says:

    bonjour appreciate your time have a look of mine

  5. Logo Design London says:

    Very interesting info!Perfect just what I was searching for!

Leave a Reply

Designed for Ares Galaxy in Collaboration with Hostgator coupons and Popular Wordpress Themes and unlock iphone 5