Difference between TCP and UDPThere are two types of internet protocol (IP) traffic, and both have very different uses.
I have heard different things about udp and don't understand exactly what
the real thing is. A couple things i have heard is that udp is faster, tcp
is more dependable.
I have created a simple tcpClient and a server in cSharp that allows me to
talk in the client and have a text string sent to the server. The server
evaluates the string and then replies with a message accordingly. The
connection remains open the whole time.
I found an example on the net with a udpClient and Server.
I'm working on building an mmorpg and I have figured out what data I need to
send byte per byte in order to keep stuff syncronized with the server. From
what I have heard udp is the best to use.
Can anyone tell me what benefits or drawbacks might be associated with using
one over the other and give me an idea of why? I have heard different things about udp and don't understand exactly what
the real thing is. A couple things i have heard is that udp is faster, tcp
is more dependable.
I have created a simple tcpClient and a server in cSharp that allows me to
talk in the client and have a text string sent to the server. The server
evaluates the string and then replies with a message accordingly. The
connection remains open the whole time.
I found an example on the net with a udpClient and Server.
I'm working on building an mmorpg and I have figured out what data I need to
send byte per byte in order to keep stuff syncronized with the server. From
what I have heard udp is the best to use.
Can anyone tell me what benefits or drawbacks might be associated with using
one over the other and give me an idea of why?
Simple answer is TCP is Connection-Oriented and UDP is Connectionless. More information can be found when researched.
TCP - Connection-Oriented means it keep track of the data transmitted & received to make sure all information went through. Examples: Surfing websites, downloading files
UDP - Connectionless means it does not check to make sure all data is received. A few data packet loss would not really affect the program. Examples: Streaming live videos, online video gaming, VOIP/Voice calls.
TCP is a connection protocol and UDP is a connection-less protocol.
TCP are used when you want to control the quality to the receiver.
I.e. you send the package and the receiver acknowledge that the package is received ok. FTP and HTTP are two examples.
With UDP you just send the data to whoever requests it, it can even be to multiple users.
For example, video streaming.
UDP is much faster then TCP.
Both the protocols differ in the way they carry out the action of communicating. A TCP protocol establishes a two way connection between a pair of computers , while the UDP protocol is one-way message sender. The common analogy is that TCP is like making a phone call and carrying on a two-way communication, while UDP is like mailing a letter.
Both the protocols differ in the way they carry out communication , also both are network layer protocols . A TCP protocol establishes a two way connection between a pair of computers , while the UDP protocol is one-way message sender. That is in TCP, Acknowledgement is also sent after receiving the message while there is no such acknowledgement sent after receiving the message in UDP.
the main difference between UDP and TCP is that UDP is not a reliable protocol.
in udp there is no check for error detection as well as the packect has reached to destination or not. where as tcp takes care of all this that's why it is slower than udp.
TCP is the protocol of network layer, It is connection oriented protocol. UDP is the protocol of network layer, It is connection less protocol.
TCP and UDP are both communication network protocols. TCP protocol in its essence is to guarantee delivery of information, and in the order sent. UDP protocol is lighter, by fact of not checking for the connection to be ready to receive on the other end, not checking if the information getting to the other end is correctly received.
UDP
UDP and TCP both are transport layer protocols. UDP is connection less and TCP is connection oriented. UDP is preferred over TCP when large amount data is to be sent like on skype or video conferencing .
TCP
An important difference is that TCP includes mechanisms for reliable data communication (lost parts of the communication are re-sent), UDP doesn't. TCP is used when such a reliable communication is important. When speed is more important than reliability, UDP is used instead. This is the case with phone or video communication over the Internet.An important difference is that TCP includes mechanisms for reliable data communication (lost parts of the communication are re-sent), UDP doesn't. TCP is used when such a reliable communication is important. When speed is more important than reliability, UDP is used instead. This is the case with phone or video communication over the Internet.An important difference is that TCP includes mechanisms for reliable data communication (lost parts of the communication are re-sent), UDP doesn't. TCP is used when such a reliable communication is important. When speed is more important than reliability, UDP is used instead. This is the case with phone or video communication over the Internet.An important difference is that TCP includes mechanisms for reliable data communication (lost parts of the communication are re-sent), UDP doesn't. TCP is used when such a reliable communication is important. When speed is more important than reliability, UDP is used instead. This is the case with phone or video communication over the Internet.
TCP and UDP are two different layer 4 protocols. TCP reliably sends data with acknowledgments and UDP sends data without checking if the destination received it. Skype uses UDP while email uses TCP.
In the commonly used TCP/IP communications, that would either be a TCP header, or a UDP header.In the commonly used TCP/IP communications, that would either be a TCP header, or a UDP header.In the commonly used TCP/IP communications, that would either be a TCP header, or a UDP header.In the commonly used TCP/IP communications, that would either be a TCP header, or a UDP header.
UDP is alot faster than TCP. So if its realtime obviously it has to be fast, thus UDP. The only problem is UDP isn't as reliable or as secure as TCP. But it does have the speed advantage.
It depends on whether you want speed (UDP) or reliability (TCP).