|
TCP
|
UDP
|
Full Form
|
Transmission
Control Protocol
|
User Datagram
Protocol
|
Function
|
Connection
based protocol which is used to transport message across the internet from
one computer to another
|
Non-Connection
based protocol used in message transport or transfer
|
Working
|
TCP connection
is established via a three way handshake, which is a process of initiating
and acknowledging a connection.
|
UDP uses a
simple transmission model without implicit handshaking dialogues for
guaranteeing reliability, ordering, or data integrity
|
Example
|
HTTP, HTTPS,
FTP, SMTP, Telnet, etc.
|
DNS, DHCP,
FTP, SNMP, RIP, VOIP, etc.
|
Usage
|
TCP is used in
case of non-time critical applications
|
UDP is used
for games or applications that require fast transmission of data
|
Ordering
|
TCP rearranges
data packets in the order specified
|
UDP has
inherent order as all packets are independent of each other. If ordering is
required, it has to be managed by the application layer
|
Transfer Speed (mbps)
|
Slower than
the speed of UDP
|
It is faster
than TCP because there is no error-checking for packets
|
Error Checking
|
TCP does error
checking
|
UDP does error
checking, but no recovery options
|
Reliability
|
Guarantees
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
|
Connection Reliability
|
Two way
connection reliable
|
One way
Connection Reliable
|
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 connection, etc.
It is a small transport layer designed on top of IP
|
Data Flow Control
|
TCP does Flow
Control
|
No flow
control
|
Header Size
|
20 bytes
|
8 bytes
|
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
|
Application
|
Web browsing,
email and file transfer are common application 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 connection facilities are required at network interface level
|
UDP is
commonly used in Domain Name System, Voice over IP, Trivial File Transfer
Protocol and Online Games.
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.
|
hookup ur code with us
Comments
Post a Comment