Questions tagged [udp]

User Datagram Protocol is one of the messaging protocols of the IP protocol stack. With UDP, computer applications can send messages to other hosts on an Internet Protocol (IP) network without requiring prior communications to set up special transmission channels or data paths.

UDP uses a simple transmission model without implicit handshaking dialogues for providing reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagrams may arrive out of order, appear duplicated, or go missing without notice.

UDP assumes that error checking and correction is either not necessary or performed in the application or at the hardware level (layer 1 and 2), avoiding the overhead of such processing at the network interface level.

Time-sensitive applications often use UDP because dropping packets is preferable to waiting for delayed packets, which may not be an option in a real-time system.

There is more information at the Wikipedia article on UDP.

10654 questions
352
votes
17 answers

Can two applications listen to the same port?

Can two applications on the same machine bind to the same port and IP address? Taking it a step further, can one app listen to requests coming from a certain IP and the other to another remote IP? I know I can have one application that starts off…
nadiv
  • 3,531
  • 3
  • 16
  • 4
339
votes
24 answers

When is it appropriate to use UDP instead of TCP?

Since TCP guarantees packet delivery and thus can be considered "reliable", whereas UDP doesn't guarantee anything and packets can be lost. What would be the advantage of transmitting data using UDP in an application rather than over a TCP stream?…
Jeff L
  • 6,108
  • 3
  • 23
  • 29
244
votes
13 answers

What is the largest Safe UDP Packet Size on the Internet

I've read a number of articles about UDP packet sizes but have been unable to come to a conclusion on whats correct. A number of services restrict the largest UDP packet to 512 bytes (like dns) Given the minimum MTU on the internet is 576 , and the…
K M
  • 3,224
  • 3
  • 21
  • 17
223
votes
14 answers

UDP vs TCP, how much faster is it?

For general protocol message exchange, which can tolerate some packet loss. How much more efficient is UDP over TCP?
Net Citizen
  • 5,174
  • 8
  • 38
  • 50
189
votes
6 answers

How do ports work with IPv6?

Conventional IPv4 dotted quad notation separates the address from the port with a colon, as in this example of a webserver on the loopback interface: 127.0.0.1:80 but with IPv6 notation the address itself can contain colons. For example, this is…
Peter Wone
  • 17,965
  • 12
  • 82
  • 134
170
votes
5 answers

How is TeamViewer so fast?

Sorry about the length, it's kinda necessary. Introduction I'm developing a remote desktop software (just for fun) in C# 4.0 for Windows Vista/7. I've gotten through basic obstacles: I have a robust UDP messaging system, relatively clean program…
Jason
  • 6,878
  • 5
  • 41
  • 55
162
votes
2 answers

How do I publish a UDP Port on Docker?

How do I forward a UDP port from my Docker container to the host machine?
Nick Woodhams
  • 11,977
  • 10
  • 50
  • 52
158
votes
13 answers

Difference between TCP and UDP?

What is the difference between TCP and UDP? I know that TCP is used in the case of non-time critical applications, and UDP is used for games or applications that require fast transmission of data. I know that TCP is used for HTTP, HTTPs, FTP, SMTP,…
user749414
  • 1,597
  • 2
  • 10
  • 4
155
votes
6 answers

How to send only one UDP packet with netcat?

I want to send only one short value in a UDP packet, but running the command echo -n "hello" | nc -4u localhost 8000 I can see that the server is getting the hello stuff but I have to press Ctrl+c to quit the netcat command. How can I make it quit…
Janne H
  • 1,573
  • 2
  • 10
  • 6
136
votes
2 answers

Can TCP and UDP sockets use the same port?

First of all, is there any problem with using both UDP and TCP on the same server? Secondly, can I use the same port number?
user800799
  • 2,883
  • 7
  • 31
  • 36
134
votes
15 answers

Does HTTP use UDP?

This might be a silly question: Does HTTP ever use the User Datagram Protocol? For example: If one is streaming MP3 or video using HTTP, does it internally use UDP for transport?
Sesh
  • 5,993
  • 4
  • 30
  • 39
111
votes
13 answers

TCP vs UDP on video stream

I just came home from my exam in network-programming, and one of the question they asked us was "If you are going to stream video, would you use TCP or UDP? Give an explanation for both stored video and live video-streams". To this question they…
Alxandr
  • 12,345
  • 10
  • 59
  • 95
105
votes
15 answers

What do you use when you need reliable UDP?

If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them? Please…
Len Holgate
  • 21,282
  • 4
  • 45
  • 92
104
votes
2 answers

Why does sending via a UdpClient cause subsequent receiving to fail?

I'm trying to create a UDP server which can send messages to all the clients that send messages to it. The real situation is a little more complex, but it's simplest to imagine it as a chat server: everyone who has sent a message before receives all…
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
102
votes
1 answer

Does WebRTC use TCP or UDP?

I have some questions about WebRTC: Does WebRTC use TCP or UDP as its peer-to-peer transport? How can I know? I read that there are reliability mode and DTLS agreement, how does these affect? Is this transport the same for both Media and…
onmyway133
  • 45,645
  • 31
  • 257
  • 263
1
2 3
99 100