LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2004, 12:41 PM   #1
Denes
Member
 
Registered: Mar 2004
Distribution: CentOS 4.3/4.5
Posts: 72

Rep: Reputation: 15
Udp Performance


I am developing a UDP based client on Redhat Linux 8 that needs to communicate as quickly as possible with a server (using an embedded real time OS). This product is only destined for local LAN's where I can assume no packets will come in out of order and will not be dropped by a router.

Basic client/server communications work fine but when I increase the speed at which the server responds to a request from the client occasionally I get an EAGAIN error on the recvfrom call at which point I call recvfrom until it recovers. The problem is that when this happens, the packet I was supposed to receive is dropped. I know it came into the linux box (I have ethereal running which indicates it was received okay) but the packet never gets all the way to the recvfrom call.

Additionally, packets are sometimes dropped without any indication at all (again I have ethereal running so I know that the packet was received).

The client program consists of three threads using the pthreads library. A main thread which sends and waits for packets, a send thread which sends packets (no problems occur sending packets), and a receive thread which gets the packets and notifies the main thread when info arrives via a pthread condition.

I am compiling with the -D_REENTRANT and -D_THREAD_SAFE options. I have set the socket to be non-blocking and use a select / recvfrom pair to receive the packets. I have tried using a blocking recvfrom call without a select but this also drops packets.

I am using a RealTek RTL-8139, SMC EZ card but also have tried an Intel EtherExpressPro 100B.

I have tried increasing /proc/sys/net/core/rmem_default and rmem_max to 256k (is this only for tcp anyway?).
I have also increased /proc/sys/net/core/netdev_max_backlog to 2000.

I am only getting responses to packets that I have sent out so there is synchronization going on and it is about 1.2 - 1.7 millisecs between each loop of two sent packets and two received packets (each less than 200 bytes a piece).

I am planning on making TCP an option as well for applictions not requiring as much speed which I know will solve these problems but will be less efficient (I need it to be as efficient as possible). Can anyone give me any other suggestions as to what I can do to increase reliability?
 
Old 03-03-2004, 01:44 PM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
I have had one time a similar problem: the program was not so complex, but I lost packets I solved the problem by modifying the length of the driver reception queue... It's very simple to do: just a #define value to modify and a driver to recompile
Hope this'll help you
 
  


Reply


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
tcp/udp and c++ Kroenecker Programming 1 05-10-2005 11:56 AM
RFC 868 udp 37 time-udp gpl SUSE / openSUSE 2 03-31-2005 10:07 AM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
UDP Performance jmarsh Linux - Networking 1 01-31-2004 04:36 PM
TCP vs. UDP mikeshn Linux - Networking 5 05-17-2003 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:25 AM.

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