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

Will Socket deliver IP fragmented packets as one reassembled UDP packet?

When receiving TCP packets, Socket will give me reassembled packets, in case they got IP fragmented, as I'm guaranteed to get an ordered, gap-free stream of bytes. When receiving UDP packets, where I may receive packets in a different order than…
Evgeniy Berezovsky
  • 18,571
  • 13
  • 82
  • 156
3
votes
0 answers

How to send UDP packets between an Android tablet and Raspberry Pi?

I need to establish wireless communication between an Android tablet and a Raspberry Pi. To do this, I have been writing an Android application that will serve as the client, and I have C code running on the Raspberry Pi for it to be the server. I…
user3795482
  • 31
  • 1
  • 4
3
votes
2 answers

How to bind socket to more than one port, NodeJS

I have set up a node application which receives packets from a Port at an IP address and serves the contents to a web-page. This IP address has traffic going through two ports, 9999 and 10000. My application has the following code: var PORT_ONE…
jdpena
  • 43
  • 1
  • 5
3
votes
3 answers

Sending structs over a UDP winsock connection, size of struct?

I'll try to keep this short. So I'm making a network interface which, inherently will be used for creating simple video games. I initially began designing it in TCP but I found it to be too slow so I switched to UDP. My current idea is this: I want…
3
votes
0 answers

Is there a benefit using PACKET_MMAP? (Linux)

I'm struggeling with why I should try the multi packet send PACKET_MMAP method. I got a data mass of around 3 milion bytes every 20ms that i'm going to send over a 10gbps interface. I need to process all data in an packet so the data is going to be…
Anders Cedronius
  • 2,036
  • 1
  • 23
  • 29
3
votes
2 answers

c++ UDP socket error 10045

SOLVED The error was assuming that UDP and TCP have same structure of connection and initialization. Here I get more information about it: http://bit.kuas.edu.tw/~csshieh/teach/np/winsock/ Hope it helps to everyone in my situation Question Im trying…
Bardo91
  • 585
  • 2
  • 7
  • 17
3
votes
3 answers

Reconstruct image from RTP packets

I am trying to stream a user's webcam over the network to a C-based server. I have used Janus gateway. I created a small plugin which is heavily based on the echotest demo example : I have my browser connecting to my janus server via WebRTC…
nschoe
  • 1,967
  • 1
  • 19
  • 26
3
votes
1 answer

Android : Listener for incoming UDP messages?

I have an application android who send data to the server (PC) but I don't receive any data from the PC to the application. And, how can I do a listener for incoming UDP messages ? because I need an app to be running all the time even if the app is…
user3654295
  • 45
  • 2
  • 8
3
votes
2 answers

UDP sockets in D Programming Language

I'm attempting to convert a python program to D; the program is for sending Art-Net DMX packets. Python: import sys, socket, math, time from ctypes import * class ArtNetDMXOut(LittleEndianStructure): PORT = 0x1936 _fields_ = [("id", c_char…
Jeremy
  • 443
  • 1
  • 7
  • 18
3
votes
2 answers

Does recv() always return a complete data packet which has the expected length?

I have a question regarding recv (C, Android). Is recv guaranteed to return a complete UDP datagram when it returns? In my case I am using recv to read RTP packets from a socket. The expected length of each RTP packet is 172 (160 bytes for payload…
user1884325
  • 2,530
  • 1
  • 30
  • 49
3
votes
1 answer

C# UDP Server Asynchronous Multiple Clients | SocketException When Client Disconnect

I've been working on a socket server program in C# (I was inspired from this post) and my problem is that when a client disconnects an exception "An existing connection was forcibly closed by the remote host" appears when the call EndReceiveFrom()…
user3626081
  • 31
  • 1
  • 1
  • 4
3
votes
4 answers

Is bind() necessary if I want to receive data from a server using UDP?

Is it necessary to have in the client bind, if I want to receive data from a server? I've seen a schema (look at the image below), and it seems that it's not necessary. But from what I know, bind is necessary to give an address to a socket. If I…
testermaster
  • 1,031
  • 6
  • 21
  • 40
3
votes
2 answers

Filtering UDP packets accidentally sent to my port

I am designing a simple protocol on top of UDP and now I've realized that someone else can send a packet to the port I'm listening on. Such packet will obviusly be incorrect for my application (I'm not concerned about security now) Is there the way…
cube
  • 3,867
  • 7
  • 32
  • 52
3
votes
1 answer

No reply to UDP broadcast, only unicast

In my Android app I'm sending a UDP broadcast to address 255.255.255.255, port 6400. I use the PC program Packet Sender to act as a UDP server that automatically sends a reply. When I'm listening for this reply in the Android app, it never receives…
gosr
  • 4,593
  • 9
  • 46
  • 82
3
votes
1 answer

Which adapter did I just receive this UDP packet on?

I'm trying to write a BOOTP server in c#. I'm receiving and parsing the BOOTP packet from the client and I need to reply with my server IP address. The problem is: The computer can have multiple network adapters The client doesn't yet have an IP…
Tim
  • 7,746
  • 3
  • 49
  • 83