Questions tagged [datagram]

A datagram is a unitary message delivered entire over a network, typically via UDP, and typically with no guarantee on order or reliability of message delivery.

Datagrams support connection-less messages of a fixed maximum length. While datagrams allow for a bi-directional data flow, the order and reliability of message delivery is not guaranteed. A process receiving datagrams may find messages duplicated or missing or in an order different than the order sent. However, record boundaries in data are respected. Datagrams closely model the facilities found in many contemporary packet-switched networks.

630 questions
9
votes
5 answers

Packet loss while receiving UDP broadcast in android device

For receiving UDP broadcast packets from the server to an android device, i used a service class and listen for packets in a thread. It receives the packet successfully. The problem is that if multiple packets are being sent from the server in the…
George Thomas
  • 4,566
  • 5
  • 30
  • 65
9
votes
3 answers

Building OpenSSL on Android NDK

I want to use DTLS (on OpenSSL) using JNI on Android 2.1/2.2. Can someone help me get started (tutorials, howto, pointers etc) with building OpenSSL for Android (2.1/2.2) using the Android NDK? Anything important that I should be aware of before…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
9
votes
2 answers

How to achieve timeout handling in blocking DatagramChannel without using selectors

I get a feeling that I am missing something really obvious here. The overall structure of my system makes me want to use a blocking DatagramChannel without Selectors, in order to keep things simple. I am trying to achieve timeout handling by setting…
9
votes
4 answers

TCP/IP packets and datagrams

Is it true that upon receiving a segment from Transport Layer(TCP) towards Network Layer(IP) the resulting data unit will be a packet. Whereas when receiving a user datagram from Transport Layer(UDP) the resulting data unit will be a datagram?
user1927452
  • 93
  • 1
  • 1
  • 4
9
votes
4 answers

JAVA set / choose specific NIC from multiple (UDP)

I am trying to send UDP with datagram in JAVA and my machine have several NIC with different IP's. How can I set which NIC I want my packet to be sent from ?? (assuming I have more than one on the machine ??) EDIT I I am not using Socket, I am using…
user1722362
  • 91
  • 1
  • 1
  • 3
8
votes
1 answer

java.net.SocketException: Not a multicast address

I was working with a MulticastSocket and when ever I tried to join a group, it would never work when I was running the group on the "localhost" ip. However, I found this article http://lycog.com/programming/multicast-programming-java/ that stated…
swrap
  • 314
  • 1
  • 3
  • 11
8
votes
1 answer

VoIP RTP Streaming from/to server (in Java) to/from android

My target is to have a push-to-talk chat app in GSM/UMTS/LTE networks; initially I wanted use multicast addresses and peer-to-peer without overload the server; unfortunatly, after deep investigation, I discovered that multicast is not allowed in…
Fausto70
  • 541
  • 5
  • 20
8
votes
2 answers

Java, DatagramPacket receive, how to determine local ip interface

Here's simple case when binding to all ip interfaces and specific udp port: int bindPort = 5555; // example, udp port number DatagramSocket socket = new DatagramSocket(bindPort); byte[] receiveData = new byte[1500]; DatagramPacket receivePacket =…
Igor Delac
  • 175
  • 2
  • 9
8
votes
2 answers

What is the default size of datagram queue length in Unix Domain Sockets (AF_UNIX)? Is it configurable?

I know the maximum length of a datagram queue length can be found using "cat /proc/sys/net/unix/max_dgram_qlen". I wanted to know how to find the default value that is set on boot up (like in case of the /proc/sys/net/core/wmem_default for the…
user3184348
  • 81
  • 1
  • 1
  • 3
8
votes
1 answer

Discovering the router by sending broadcast packet using UPnP doesn't work

I'm trying to implement a simple library that can discover the router through UPnP protocol if the application is running in a NAT environment. I have tried two ways, multi-cast and datagram, for sending the discovery packet to the router, and try…
user1802604
  • 396
  • 3
  • 14
7
votes
4 answers

Automated naming of AF_UNIX local datagram sockets?

I'm implementing a simple service using datagrams over unix local sockets (AF_UNIX address family, i.e. not UDP). The server is bound to a public address, and it receives requests just fine. Unfortunately, when it comes to answering back, sendto…
JB.
  • 40,344
  • 12
  • 79
  • 106
7
votes
1 answer

How to read /dev/log?

I would like to directly access to syslog messages from Python by reading /dev/log. My (very limited) understanding is that the correct way is to read from there is to bind a datagram socket. import socket sock = socket.socket(socket.AF_UNIX,…
WoJ
  • 27,165
  • 48
  • 180
  • 345
6
votes
1 answer

Any suggestions on how to wait for an unknown length packet on a socket, and do some processing with its payload bytes as efficiently as possible?

I need to write an UDP server which will wait for packets from uncorrelated devices (max 10000 of them) sending small packets periodically; do some processing with the payload and write the results on SQL. Now I'm done with the SQL part through…
V4R15
  • 97
  • 1
  • 7
6
votes
6 answers

DatagramPacket to string

Trying to convert a received DatagramPacket to string, but I have a small problem. Not sure what's the best way to go about it. The data I'll be receiving is mostly of unknown length, hence I have some buffer[1024] set on my receiving side. The…
user1105216
  • 69
  • 1
  • 1
  • 2
6
votes
2 answers

size of the next queued datagram - UDP

I am using System.Net.Sockets Socket class to receive UDP datagrams. I wanted to know the exact length of the datagram received in order to check the validity of the datagram. Socket.Receive(Byte()) method documentation says: If you are using a…
Anniffer
  • 99
  • 1
  • 6
1
2
3
41 42