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
23
votes
2 answers

UDP Multicast over the internet?

I'm not sure how best to approach my problem. I have a service with runs on a remote machine with receives and process UDP packets. I want the service to be able to re-send these packets to anyone that happens to want them (could be no-one, will…
Barg
  • 2,968
  • 7
  • 26
  • 28
22
votes
4 answers

How to set the source port in the UDP socket in c?

Can any one tell me how to set the Source port address in the UDP socket ?. My client application needs to send the Packets from the 57002 port to the server port 58007 .
Balamurugan
  • 2,259
  • 8
  • 33
  • 48
22
votes
1 answer

How do I make a UDP Server in C#?

Possible Duplicate: C# How to make a simple UDP server I want to make a UDP server in C#. How do I do that? How can I customize which port it listens on (namely 1212)?
Saeed
  • 7,262
  • 14
  • 43
  • 63
22
votes
5 answers

What is the Significance of Pseudo Header used in UDP/TCP

Why is the Pseudo header prepended to the UDP datagram for the computation of the UDP checksum? What's the rational behind this?
Priyanka Mishra
  • 10,400
  • 18
  • 62
  • 75
22
votes
4 answers

Sending string over UDP in C++

I would like to send a string: "Jane Doe" to intranet ip 192.168.0.4 to port 9000 over UDP. I have done this many times via UDP and TCP by Java, but now I have to do it with standard C++ libraries and I can't find any samples only topics where…
Yoda
  • 17,363
  • 67
  • 204
  • 344
22
votes
1 answer

Sending and receiving UDP packets?

I have made a program to send an UDP packets from a client to a server. Here is the transmitter code: import java.io.IOException; import java.net.*; public class JavaApplication9 { public static void main(String[] args) throws…
21
votes
3 answers

UDP Packet drop - INErrors Vs .RcvbufErrors

I wrote a simple UDP Server program to understand more about possible network bottlenecks. UDP Server: Creates a UDP socket, binds it to a specified port and addr, and adds the socket file descriptor to epoll interest list. Then its epoll waits for…
Bala
  • 357
  • 1
  • 4
  • 12
21
votes
2 answers

Errno: 11, Resource Temporarily Unavailable

I am using c sockets to implement a reliable UDP protocol. I am using the following code to set a timeout on a socket in which I'm waiting for an acknowledgement. I am not sure why I am getting errno 11, resource temporarily unavailable. …
rharrison33
  • 1,252
  • 4
  • 18
  • 34
20
votes
3 answers

Java DatagramPacket (UDP) maximum send/recv buffer size

In Java when using DatagramPacket suppose you have a byte[1024*1024] buffer. If you just pass that for the DatagramPacket when sending/receiving will a Java receive call for the DatagramPacket block until it has read the entire megabyte? I'm asking…
rbeede
  • 303
  • 1
  • 3
  • 9
20
votes
2 answers

UDP Hole Punching Algorithm

Can anyone give an example of a UDP Hole Punching ? Actually, I want to write a chat program with which people can chat when they know each other's IP. But both the machines will be behind a firewalled router. So, I need to punch a hole in order to…
user1151738
20
votes
2 answers

An existing connection was forcibly closed by the remote host

I need to obtain UDP datagram from Asynchronous Socket Server but an exception occurred in my application : Problem appear there : Byte[] receiveBytes = udpClient.Receive(ref RemoteIpEndPoint); The full source code: class Program { …
Johnny
  • 555
  • 1
  • 5
  • 22
20
votes
3 answers

Network UDP broadcast design?

I am working on a C++ server/.NET client applications couple in which my server (which runs the c++ on linux) broadcasts a message to show it's alive to the whole network and my .NET program listens for packets and parses to get the uptime of the…
Andrei Zisu
  • 4,292
  • 4
  • 21
  • 32
20
votes
3 answers

Develop a basic DNS server (in C#)

I am developing a very basic DNS server for my own purpose. The way I understand it, the DNS server receives UDP packets containing the requested domain name and returns the corresponding IP under some kind of standard form. There is a standard…
Régis B.
  • 10,092
  • 6
  • 54
  • 90
20
votes
5 answers

C# UDP Socket: Get receiver address

I have an asynchronous UDP server class with a socket bound on IPAddress.Any, and I'd like to know which IPAddress the received packet was sent to (...or received on). It seems that I can't just use the Socket.LocalEndPoint property, as it always…
chezy525
  • 4,025
  • 6
  • 28
  • 41
20
votes
1 answer

c - udp send and receive on the same socket

I would like to send and receive packets on the same socket, is it possible or I have to create two socket, one to send and one to receive? If yes, can you give me an example? Another question: how can I get the source ip from a received packet?…
user3574984
  • 453
  • 2
  • 6
  • 16