Friday, 15 March 2013

networking - Can I lose datagrams in the socket receive buffer and how can it happen when I use UDP? -



networking - Can I lose datagrams in the socket receive buffer and how can it happen when I use UDP? -

i want utilize udp sockets under reliable transport in c-programm, , want know more packet can lost also.

as known udp not reliable protocol. mean that:

if info packet lost in low-level protocol, not sent again data packet can lost in receive buffer, illustration if receive buffer overflowing

i'm interested in sec case - how work? in receive buffer datagrams recorded along size of datagrams, because udp guarantees preservation of message boundaries. , when receive buffer overflowing, first datagram remove:

read first 8 bytes head of ring buffer (receive buffer), contain datagram size move head of ring buffer amount equal size of message - i.e. move head next datagram if free space in ring buffer plenty new received datagram, write ring buffer , move tail end of it, else goto 1 step

i.e. mean when phone call read socket, happens scheme call, access such ring buffer in kernel space, reads first 8 bytes datagram size, , reads datagram size, isn't it?

is right?

os: linux x86_64 (redhat 6)

and when receive buffer overflowing, [the] first datagram [is] remove[d]

no. when datagram arrives , receive buffer full, new datagram dropped. processing of buffer doesn't occur @ all.

sockets networking udp ethernet tcp-ip

No comments:

Post a Comment