Re: NIPS solutions

From: Mike Frantzen (frantzen_at_nfr.com)
Date: 04/21/04

  • Next message: .Bob Bradley: "RE: NIPS solutions"
    Date: Wed, 21 Apr 2004 12:00:55 -0400
    To: Andreas Hess <hess@tkn.tu-berlin.de>
    
    

    > Especially I wonder if either single processor or multiple processor
    > machines are used?

    Either one. Locking is easy. You just need to be careful about the
    cache affects so multiple processor aren't constantly having to steal
    each others cache lines; make sure your pool or slab allocator does
    coloring and per cpu magazines.

    > I just explain my point of view. I realized a simple NIPS that is
    > running on a linux machine. The intrusion prevention system is running
    > as a thread in kernel space. So, each packet that is arriving at the
    > network interface triggers an hardware interrupt that is instantly
    > processed by the Linux OS. Consequently the intrusion prevention thread
    > is interrupted and the higher the traffic load the more often an
    > interrupt occurs.

    You *really* don't want to run any more than necessary in an interrupt
    handler. if you must handle it in kernel, queue the packet and process
    it in a soft interrupt. There are two significant problems of doing
    things in a hard interrupt:
      1) you may not be able to service another packet from the NIC while
         you are still processing the previous. Many NICs have very small
         fifos so you'll be dropping packets.
      2) you are typically *VERY* limited in what memory allocations you can
         do in a hard interrupt. I don't know Linux's VM/PMAP
         implementation but in BSD land you are not allowed to wire memory
         (that means back it with a physical memory page). So you are
         limited to only allocating from a very small map of pre-wired
         memory (kmem_map: typically only 64meg). There may also be other
         side affects of violating the splimp().

    It is a good idea to have some type of hardlimit and drop mechanism on
    the soft interrupt packet queue. This is more often seen on a streams
    based OS like Solaris where you're queueing packets faster than you can
    service them. So you may have a few millions packets in the queue which
    will takes a while to process. TCP will start retransmitting after the
    RTT is exceeded which grows your queue more... All the while the
    administrator can't connect to the IPS to diagnose and fix the problem.

    > An IPS solution that is running on a dual or multiple processor machine
    > would not suffer under this limitation. But it is a real hassle to get
    > useful information from manufacturers.

    Do it in userland. You'll save yourself a major headache and you will
    be able to contain the security implications of a vulnerability in your
    IPS itself. Latency isn't even measurable if you have a good mechanism
    to transport packets to and fro userland. Plus you get to make obscure
    wisecracks in the code about walking to and fro in the earth and walking
    up and down it.

    .mike
    frantzen@(nfr.com | cvs.openbsd.org | w4g.org)
    PGP: CC A4 E2 E8 0C F8 42 F0 BC 26 85 5B 6F 9E ED 28

    ---------------------------------------------------------------------------

    ---------------------------------------------------------------------------


  • Next message: .Bob Bradley: "RE: NIPS solutions"

    Relevant Pages

    • Re: IF_HANDOFF vs. IFQ_HANDOFF
      ... There should be a nearly-complete interrupt ... > an interrupt after every packet. ... interrupt mark on fragments in the middle of a packet. ... before sending frames in sk_start if number of available Tx descriptors ...
      (freebsd-net)
    • Re: RFC: issues concerning the next NAPI interface
      ... If NAPI disables interrupts and keeps them disabled while there are more packets arriving or more transmits being completed, why do hardware interrupt mitigation / coalescing features of the network silicon help? ... dominates the packet processing costs. ... A driver's poll() would set an internal flag and record the current jiffies value when finding workdone=0 rather than doing an immediate napi_complete. ...
      (Linux-Kernel)
    • Re: [PATCH 7/14] random: Remove SA_SAMPLE_RANDOM from network drivers
      ... The PHY of the network card has some tiny delays internal ... and if a free packet buffer is available, ... If the chip has hw interrupt mitigation enabled, ...
      (Linux-Kernel)
    • Re: very busy syslog server
      ... For the syslog daemon, I have chosen rsyslogd, and the backend is mysql. ... broadcast/multicast datagrams dropped due to no socket ->>> 123677 dropped due to full socket buffers 0 not for hashed pcb ... than one packet per interrupt. ...
      (freebsd-performance)
    • Re: Changes in the network interface queueing handoff model
      ... bouncing around for some time is a restructuring of the network interface packet transmission API to reduce the number of locking operations and allow network device drivers increased control of the queueing behavior. ... to "start" output by the driver. ... encapsulation and wrapping, and notifies the hardware. ... The ifnet layer send queue is becoming decreasingly useful over time. ...
      (freebsd-arch)

  • Quantcast