Networking Forums

Networking Forums > Computer Networking > Linux Networking > recvfrom():how to receive multiple UDP packets.

Reply
Thread Tools Display Modes

recvfrom():how to receive multiple UDP packets.

 
 
aakashrajvanshi@gmail.com
Guest
Posts: n/a

 
      07-31-2006, 02:06 PM
Hello All,

I am working on a embedded system which should be capable of receiving
UDP packets from
multicasting server sending packets at around 80Mbps. I am losing
packets between the two recvfrom() api calls.
my thread just receives a packet, strip out some of the details and
copy the data to a buffer through memcpy and again go to recvfrom()
call.
This thread works fine at bit rates of around 20Mbps but at 80 Mbps
many packets are
getting lost.
It is very clear that at higher bit rates my user level thread is not
fast enough to cope up with the high rate of incoming packets.
I think since in present condition one call of recvfrom() api would
read only 1 packet from the ethernet incoming buffer rather than
copying all. Now this recvfrom() api is in user space which will take a
longer time to go into the kernel space and returning from there.

So is there a socket API which can receive multiple UDP packets with
one call.

This should help me because in that case i have to call only once from
user space to receive "n" packets rather than "n" recvfrom() calls from
userspace.

Thanks,
Aakash

 
Reply With Quote
 
 
 
 
Rick Jones
Guest
Posts: n/a

 
      07-31-2006, 05:55 PM
Do you think your application is too slow to keep-up on a _sustained_
basis or is it perhaps the case that it is only occasionally getting
behind?

If the latter you could try increasing the SO_RCVBUF size with a
setsockopt() call (and perhaps a sysctl to raise the "hard" limit)

What happens to the data you memcpy? Can that work be done using the
buffer(s) you passed to recvfrom()?

rick jones
--
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Receive All Packets ( Opposite of SendAll from Beej tutorials ) Sonny Linux Networking 0 09-27-2007 11:11 AM
NICs can't receive inbound packets at boot Electronic Workplace Windows Networking 3 08-13-2007 09:13 PM
send and receive raw packets with PF_PACKET and bypassing the kernel nehavrce@yahoo.co.in Linux Networking 0 01-06-2005 07:37 AM
I can send packets but I receive nothing, routing problem riviereg Linux Networking 8 09-06-2004 12:49 PM
I can send packets but I receive nothing, routing problem riviereg Linux Networking 0 09-03-2004 09:44 AM



1 2 3 4 5 6 7 8 9 10 11