Re: Seeing large amounts of data on udp recv-q, only sending 1 byte of data



On May 25, 12:26 am, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:
On May 24, 1:38 pm, "ssuss...@xxxxxxxxxxxxxxxxxxx" <s...@xxxxxxxxxxx>
wrote:

Hi all,

I have 2 simple little apps, running on 2 different dell 1950's both
running 2.6.18 debian linux kernel. The first app sends a user defined
size of data on a udp socket and the other app recvs it. The strange
thing I am seeing is that on the receive side if I comment out the
actual recvfrom and let that 1 packet sit in the recv-q buffer the
netstat screen shows a total of 272 bytes on the queue. When I
reenable the recvfrom and dump how much data i received from the call
it matches what I requested to be sent. I also put up a sniffer on the
recv side and the udp packet there had just the data I sent. So where
is this extra data coming from? Has anyone else seen anything like
this before that might have a clue for me.

The extra data is the source of the payload. When you call 'recvfrom',
you get more than just the payload, you get the source IP, source
port, and so on. More than one byte of the receive buffer is needed to
contain this datagram even though it only contains one byte of data.

DS

I had that thought as well, but even the headers wouldn't account for
the extra data.

IP Hdr - 20 bytes
UDP Hdr - 8 bytes
payload - 1 byte

272-29 = 243 bytes remaining.

also if I up the payload to 10 bytes the amount of data on the recv
queue doubles to 544 bytes. The amount of overhead data should not
increase with a minimal amount of payload increases.

Scott

.



Relevant Pages

  • Re: udp and dst port 1026
    ... > Payload are two bytes with value zero. ... seeing 0x0000 payloads delivered to UDP 135 and UDP 1026-1031. ... hosts on my network were targeted and the scans began to strongly favor UDP ...
    (Incidents)
  • Re: Non-blocking sockets
    ... Let's assume that the payload is less than 4 bytes ... when issuing a HEAD request). ... mean the 'recv' will block trying to receive 8 bytes, no, it will not. ... which way from a TCP connection, ...
    (comp.unix.programmer)
  • Re: recv:transport endpoint not connected
    ... > i am trying to send and recv between 3 processes using udp. ... > but send runs and recv gets transport endpoint not connected error ... Did you open socket as SOCK_DGRAM? ...
    (comp.unix.programmer)
  • Re: tcludp - bug when closing 1-of-2 listening ports
    ... It is indeed linked with zero-sized UDP packets. ... Listening on udp port: 1300 ... recv at 1300: 4 ...
    (comp.lang.tcl)
  • Re: sockets -- basic udp client
    ... > a blank string to be sent to the client. ... signals that the other side has closed the connection, but being UDP it cannot happen. ... sendall and recv are not used for UDP; sendto and recvfrom are used instead. ... Translate an Internet service name and protocol name to a port number ...
    (comp.lang.python)