• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Efficient UDP processing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficient UDP processing


  • Subject: Re: Efficient UDP processing
  • From: "Peter Sichel" <email@hidden>
  • Date: Sun, 22 Jan 2006 09:12:44 -0500

On 1/21/06, Laurence Flath wrote:

>GEV data transport is via UDP;  the majority of packets must be
>processed thus:
>
>   1.  Wait for next packet
>   2.  Confirm it's an image data packet
>   3.  Calculate what part of image the data came from (no in-order
>guarantee in UDP)
>   4.  Move the data into a memory buffer (user-space malloc'd)
>   5.  Go to 1.
>
>For GigE, MTU = 1500B, the above must be accomplished ~ 10usec to
>keep up.
>
>Unfortunately, I'm having a difficult time on my PBG4 (1GHz) even
>keeping-up with 100Base-T.  My program is currently in user space,
>using the standard socket APIs.

>Can anyone give me any guidance as to how to efficiently perform the
>above operations?

The first thing I would try is to process multiple packets each time
your app is scheduled.  As a rough approximation, a user space app is
scheduled about 50-100 times per second.  In order to handle 100BaseT,
you should be processing about 2 Mbits or 250 KB each time your process
wakes up.  At MTU = 1500, you should be reading over 100 packets each
time your App is scheduled.  You'll probably need to increase the
default socket buffer to collect this much data.

To approach GigE speeds, you really want a network card that can support
jumbo frames (up to 16K) and interrupt coalescing so the CPU isn't
interrupted for every packet.

>  Do I need to packet-filter in a NKE?

If the data needs to end up in user space, you'll just end up re-
implementing that part of the network stack.  I would try tuning the
existing implementation first.  As speed increases, careful tuning
becomes more important.

Kind Regards,

- Peter


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Efficient UDP processing (From: Laurence Flath <email@hidden>)

  • Prev by Date: Re: AirPort WPA Code?
  • Next by Date: Why would CFReadStreamSetProperty return FALSE?
  • Previous by thread: Re: Efficient UDP processing
  • Next by thread: Why would CFReadStreamSetProperty return FALSE?
  • Index(es):
    • Date
    • Thread