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
19
votes
1 answer

Why traceroute sends UDP packets and not ICMP ones?

According to the Stevens (TCP/IP Illustrated) the traceroute program sends UDP packets to the destination host with an incremental TTL (1, 2, 3, etc) to get the intermediate hops info from the ICMP TTL EXPIRED messages. The "destination reached"…
sergico
  • 2,595
  • 2
  • 29
  • 40
18
votes
1 answer

boost::asio UDP broadcasting

I want to broadcast UDP messages to all computers in a local network using boost::asio. Working through the examples I came up with try { socket.open(boost::asio::ip::udp::v4()); boost::asio::socket_base::broadcast option(true); …
nikolas
  • 8,707
  • 9
  • 50
  • 70
18
votes
3 answers

Is it possible to use UDP in Flash/ActionScript?

Quick question: is there possibility to do UDP datagram sockets in Flash/ActionScript?
the dude
  • 233
  • 1
  • 2
  • 5
18
votes
4 answers

How to set up a Winsock UDP socket?

I want to create a Winsock UDP socket that only sends data to a client. I want the kernel to choose an available port for me. On the other hand, I want to indicate which local IP to use, since I'm running a few nics. I've tried combing through the…
axs6791
  • 687
  • 1
  • 6
  • 12
18
votes
3 answers

Non-blocking UDP I/O vs blocking UDP I/O in Java

Non-blocking TCP/IP SocketChannels and Selector in NIO help me to handle many TCP/IP connections with small number of threads. But how about UDP DatagramChannels? (I must admit that I'm not very familiar with UDP.) UDP send operations don't seem…
trustin
  • 12,231
  • 6
  • 42
  • 52
18
votes
2 answers

Sending UDP packets from the iPhone

Does anyone have any good tutorials on sending UDP packets from the iPhone SDK? EDIT: Was actually really easy to do this... RTFM! After including AsyncUdpSocket just add this in header: AsyncUdpSocket *socket; And in main: NSData *data = ...…
ingh.am
  • 25,981
  • 43
  • 130
  • 177
18
votes
3 answers

Reliability of UDP on localhost

I know that UDP is inherently unreliable, but when connecting to localhost I would expect the kernel handles the connection differently since everything can be handled internally. So in this special case, is UDP considered a reliable protocol, or…
Bryan Ward
  • 6,443
  • 8
  • 37
  • 48
18
votes
3 answers

UDP Hole Punching Java Example

I want to do UDP Hole Punching with two clients with the help of a server with a static IP. The server waits for the two clients on port 7070 and 7071. After that it sends the IP address and port to each other. This part is working fine. But I'm not…
Crossader
  • 316
  • 1
  • 2
  • 9
18
votes
2 answers

Error receiving in UDP: Connection refused

I am trying to send a string HI to a server over UDP in a particular port and then to receive a response. However, after I try to get the response using recvfrom() I was stuck in blocking state. I tried using connected UDP but I got: Error…
sfactor
  • 12,592
  • 32
  • 102
  • 152
18
votes
3 answers

How to send a UDP Packet with Web RTC - Javascript?

How do you send a UDP Packet using Web RTC?
Taurian
  • 1,660
  • 7
  • 20
  • 28
17
votes
2 answers

How do I get amount of queued data for UDP socket?

To see how well I'm doing in processing incoming data, I'd like to measure the queue length at my TCP and UDP sockets. I know that I can get the queue size via SO_RCVBUF socket option, and that ioctl(, SIOCINQ, &) tells me the…
che
  • 12,097
  • 7
  • 42
  • 71
17
votes
12 answers

What should i know about UDP programming?

I don't mean how to connect to a socket. What should I know about UDP programming? Do I need to worry about bad data in my socket? I should assume if I send 200bytes I may get 120 and 60 bytes separately? Should I worry about another connection…
user34537
17
votes
1 answer

socket_create vs. fsockopen php

The hosting service that I use currently does not let me use sockets, probably for good reason on their part. They do, however, let me use fsockopen. I was wondering what the difference is, because some scripts that worked with socket_create and…
Samuel
  • 16,923
  • 6
  • 62
  • 75
17
votes
2 answers

C# How to make a simple UDP server

Can I make UDP server and client using UdpClient class? And I need to send an Image from the server to all Clients. Can some show me a code sample. I'm new to this.
Mafahir Fairoze
  • 697
  • 2
  • 9
  • 21
17
votes
2 answers

Receiving RTP packets after RTSP setup

I'm trying to stream RTP packets from an IP camera using Python. I am able to send the describe, setup & play commands using RTSP protocol, however, I am unable to start streaming the actual videostream using RTP. Here is the code: import socket…
El Sampsa
  • 1,673
  • 3
  • 17
  • 33