Nothing Special   »   [go: up one dir, main page]

TCP Udp

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

TCP UDP

User Datagram Protocol or Universal


Acronym for Transmission Control Protocol
Datagram Protocol
Transmission Control Protocol is a User Datagram Protocol is a
Connection
connection-oriented protocol. connectionless protocol.
UDP is also a protocol used in
As a message makes its way message transport or transfer. This is
across the internet from one not connection based which means that
Function
computer to another. This is one program can send a load of
connection based. packets to another and that would be
the end of the relationship.
UDP is suitable for applications that
TCP is suited for applications that need fast, efficient transmission, such
require high reliability, and as games. UDP's stateless nature is
Usage
transmission time is relatively less also useful for servers that answer
critical. small queries from huge numbers of
clients.
Use by other HTTP, HTTPs, FTP, SMTP, DNS, DHCP, TFTP, SNMP, RIP,
protocols Telnet VOIP.
UDP has no inherent order as all
Ordering of data TCP rearranges data packets in the packets are independent of each other.
packets order specified. If ordering is required, it has to be
managed by the application layer.
UDP is faster because error recovery is
The speed for TCP is slower than
Speed of transfer not attempted. It is a "best effort"
UDP.
protocol.
There is absolute guarantee that
There is no guarantee that the
the data transferred remains intact
Reliability messages or packets sent would reach
and arrives in the same order in
at all.
which it was sent.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
Common Header Source port, Destination port, Source port, Destination port, Check
Fields Check Sum Sum
Packets are sent individually and are
checked for integrity only if they
Data is read as a byte stream, no
arrive. Packets have definite
distinguishing indications are
Streaming of data boundaries which are honored upon
transmitted to signal message
receipt, meaning a read operation at
(segment) boundaries.
the receiver socket will yield an entire
message as it was originally sent.
TCP is heavy-weight. TCP UDP is lightweight. There is no
Weight
requires three packets to set up a ordering of messages, no tracking
socket connection, before any user connections, etc. It is a small transport
data can be sent. TCP handles layer designed on top of IP.
reliability and congestion control.
TCP does Flow Control. TCP
requires three packets to set up a
UDP does not have an option for flow
Data Flow Control socket connection, before any user
control
data can be sent. TCP handles
reliability and congestion control.
TCP does error checking and error
UDP does error checking but simply
recovery. Erroneous packets are
Error Checking discards erroneous packets. Error
retransmitted from the source to
recovery is not attempted.
the destination.
1. Sequence Number, 2. AcK
number, 3. Data offset, 4.
Reserved, 5. Control bit, 6.
1. Length, 2. Source port, 3.
Fields Window, 7. Urgent Pointer 8.
Destination port, 4. Check Sum
Options, 9. Padding, 10. Check
Sum, 11. Source port, 12.
Destination port
Acknowledgement Acknowledgement segments No Acknowledgment
No handshake (connectionless
Handshake SYN, SYN-ACK, ACK
protocol)

You might also like