Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-13-2006, 10:38 AM   #1
LQ Newbie
Registered: Jul 2006
Posts: 2

Rep: Reputation: 0
How to reliably detect UDP packet loss.

Hi there,

My understanding is that given reliable transmission (ie no tx buffer overrun), UDP packets may be lost on three levels:

1. On the wire if your ethernet is suspect.
2. In the ethernet driver if there are not enough Rx buffer descriptors.
3. In the IP stack if the UDP socket buffers are to small and not serviced fast enough by your application.

My question is how do you reliably tell where packets get lost?

netstat -su will give you packet receive errors

This supposedly is an indication of the number of packets lost by means of (3).

I have a very good ethernet, but maybe packets are lost in my switch? How to detect this?

I have a good ethernet device (Intel e1000) and driver with 4096 rx buffer descriptors. How do I detect buffer overrun?

Is netstat -su a reliable counter for socket buffer overrun?

Old 07-13-2006, 12:58 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
I dont' understand why you're trying to use UDP when what you
want are features of TCP. UDP is by definition connection-
less and doesn't implement those checks.

Old 07-14-2006, 03:50 AM   #3
LQ Newbie
Registered: Jul 2006
Posts: 2

Original Poster
Rep: Reputation: 0
There are reasons to use UDP instead of TCP.

1. The source of the UDP data is an embedded device streaming data at a steady rate of up to 256Mb/s over gigabit ethernet as 128 streams of UDP datagrams. The device does not have the resources to do this using TCP.

2. The data flows over gigE LAN as follows: Device -> switch -> Consumer (High-end Linux server). Technically if there are no significant additional traffic switched to the Consumer, and the Consumer processes the UDP frames fast enough it should all work fine. This is the case most of the time.

I have configured 1 second worth of buffering per UDP socket receiving each one of the above mentioned UDP streams. Once every couple of hours there seems to be a glitch where upto a couple of hundred frames are lost (I know this since I put sequence nrs in the UDP packets).

I am simply trying to find out if there is an easy way to check whether I have overrun in my socket buffers. Increasing the buffers might alter my results but it is not conclusive.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
packet loss. bruse Linux - Networking 1 09-01-2005 08:24 AM
70% packet loss bingviini Linux - Networking 5 11-18-2004 11:35 AM
50% packet loss only with Linux alexdanoob Linux - Networking 2 04-21-2004 05:24 AM
What can cause packet loss? Micah Linux - Hardware 8 03-15-2004 12:31 AM
90% packet loss to router? OatBran Linux - Networking 7 11-19-2001 01:54 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration