Info about UDP and TCP required

Status
Not open for further replies.

rachitar

Journeyman
Hi
Can anyone please tell me about UDP and TCP?
Or is there a tutorial available on this board or somewhere.
If possible does someone have a C or C++ code for UDP/TCP that they can provide.
Thanks
 

tuXian

In the zone
basic diff - TCP is connection oriented and UDP connection less protocol.

what kinda code??
 
OP
R

rachitar

Journeyman
TuxiaN said:
basic diff - TCP is connection oriented and UDP connection protocol.

what kinda code??

Code - C++/C Program for implementation of UDP/TCP interface on 2 machines one as a server and the other as client and both are connected through lan
 

digen

Youngling
As tuxian has already said TCP is a connection orriented protocol while UDP is a connectionless.
Let me explain this a bit.TCP is virtually what is called a three way handshake.The analogy here is,when you want to make a telephone call you first dial the number[intiatiating the connection] with the appropriate prefix code ,the call takes place[connection],the person at the other end picks up the phone & you say hello.[connection made,send data]
Analogy w.r.t UDP,consider calling someone in a busy market,there is simply no guarantee that the other person will hear you.
The analogies I've given above,you'll find these in a variety of books.
TCP produces much overhead than UDP.UDP is deployed where the delivery of the chunks of data is not guranteed & fast delievery of data is utmost required where as in TCP the data is transfered to the other end & is checked whether the proper data[CRC check] has arrived then it is assembled in a proper sequence.If any part of the data is missing the host at the other end requests for sending of the data again.

So if you are a programmer two things to keep in mind,if data delivery is not important then opt of UDP or else stick with TCP.
 

tuXian

In the zone
refer some good unix network programming books like Richard Stevens Network Programming.

BTW I will search my computer I think I have got some code like that somewhere in my system its of echoing a server and client and some more progs. Since its late night I will search my computer and tell u tommorrow.

Until then this link might be of help to you its got link to some source code too

*www.cs.buffalo.edu/~milun/unix.programming.html

*www-net.cs.umass.edu/ntu_socket/
 
Status
Not open for further replies.
Top Bottom