Fragment questions

John-Mark Gurney jmg at funkthat.com
Wed Mar 25 20:12:11 UTC 2015


Hans Petter Selasky wrote this message on Fri, Mar 20, 2015 at 19:56 +0100:
> On 03/20/15 19:02, Adrian Chadd wrote:
> > On 20 March 2015 at 10:58, Hans Petter Selasky <hps at selasky.org> wrote:
> >> On 03/20/15 14:31, Emeric POUPON wrote:
> >>>
> >>> - in the ip_newid macro, we do "htons(V_ip_id++))" if we do not use
> >>> randomized id.
> >>
> >>> In multi core systems, we may emit successive packets with the same id.
> >>
> >> Will using a mutex or an atomic macro fix this issue when incrementing the
> >> V_ip_id ?
> >
> > It will, but it'll ping-pong between multiple cores and slow things
> > down at high pps.
> 
> Maybe we can have the V_ip_id per CPU and use the lower 8-bits as random 
> CPU core number?

ip id's only need to be unique for fragments to a specific source
address/destination address/protocol tuple... so, using different id
buckets per above hash would be best...

Take a look at:
https://tools.ietf.org/html/rfc6864

Which is a good read for addressing this issue...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-net mailing list