What is the difference between TCP and UDP ?

Answer Posted / surendran

1. TCP(Transmission Control Protocol). TCP is a
connection-oriented protocol, a connection can be made from
client to server, and from then on any data can be sent
along that connection.
o Reliable - when you send a message along a TCP
socket, you know it will get there unless the connection
fails completely. If it gets lost along the way, the server
will re-request the lost part. This means complete
integrity, things don't get corrupted.
o Ordered - if you send two messages along a
connection, one after the other, you know the first message
will get there first. You don't have to worry about data
arriving in the wrong order.
o Heavyweight - when the low level parts of the
TCP "stream" arrive in the wrong order, resend requests
have to be sent, and all the out of sequence parts have to
be put back together, so requires a bit of work to piece
together.
2. UDP(User Datagram Protocol). A simpler message-
based connectionless protocol. With UDP you send messages
(packets) across the network in chunks.
o Unreliable - When you send a message, you don't
know if it'll get there, it could get lost on the way.
o Not ordered - If you send two messages out, you
don't know what order they'll arrive in.
o Lightweight - No ordering of messages, no tracking
connections, etc. It's just fire and forget! This means
it's a lot quicker, and the network card / OS have to do
very little work to translate the data back from the
packets.

Is This Answer Correct ?    78 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is network programming in java?

575


Explain look for local ports?

582


What is jhttp web server?

771


What is socket in java?

634


What is the use of network interface?

507






If you do not want your program to halt while it waits for a connection, put the call to accept( ) in a separate thread?

555


What do you understand by the term network?

580


Where is the network interface card located?

532


What is cookies in networking ?

623


What is a client tester?

588


What is the Difference between socket and servlet?

798


What are the advantages and disadvantages of java sockets.

618


What is a listener in networking?

595


To create a socket, you need to know the internet host to which you want to connect?

541


What is an http server?

550