Sie sind auf Seite 1von 1

Difference between TCP and UDP

TCP UDP

Reliability: TCP is connection-oriented protocol. When a Reliability: UDP is connectionless protocol.


file or message sent from sender, it will require the When you a send a data or message, you
receiver to send back an OK signal. If it didnt receive it dont know if itll get there, it could get lost
within a time frame, the sender will send the file or on the way. There may be corruption while
message again. So, there is no corruption while transferring a message.
transferring a message.

Ordered: If you send two messages along a connection, Unordered: If you send two messages out,
one after the other, you know the first message will get you dont know what order theyll arrive in
there first. You dont have to worry about data arriving in i.e. no ordered
the wrong order.

Heavyweight: Lightweight:
when the low level parts of the TCP stream arrive in -No ordering of messages, no tracking
the wrong order, connections, etc.
-resend requests have to be sent - Just fire and forget!
-so requires a bit of work to piece together. - A lot quicker!
-20 bytes header size - 8 bytes header size

Streaming: Data is read as a stream, with nothing Datagrams: Packets are sent individually
distinguishing where one packet ends and another and are guaranteed to be whole if they
begins. There may be multiple packets per read call. arrive. One packet per one read call.

Examples: World Wide Web (Apache TCP port 80), e-mail Examples: Domain Name System (DNS
(SMTP TCP port 25 Postfix MTA), UDP port 53), Voice over IP (VoIP) such as
Skype, WhatsApp Call etc,) and online
multiplayer games etc

Das könnte Ihnen auch gefallen