Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge vpn performancev2 #221

Merged
merged 15 commits into from
Jul 2, 2014
Merged

Commits on Jun 26, 2014

  1. Add capability to recycle objects to class.lua

    The creation of instance objects should be avoided in packet
    processing loops to reduce garbage collection overhead.  class.lua now
    supports a simple mechanism where an app can declare an object to no
    longer be in use.  This object is then put on a list in the
    corresponding class and will be re-used by the constructor method
    instead of allocating a new object.
    
    The class API has been changed slightly to no longer require the
    declaration of constructor methods.  Any method can act as a
    constructor or extend the standard constructor by calling the new()
    method of the super class.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    da22a6f View commit details
    Browse the repository at this point in the history
  2. Adapt lib/protocol and apps/vpn to the new class.lua semantics

    Also includes some minor bug fixes here and there.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    97241c2 View commit details
    Browse the repository at this point in the history
  3. Fix bug in ipv6:ntop()

    The conversion from numeric to printable for ipv6 addresses was
    seriously broken.  The fix includes a redefinition of the source and
    destination address in the ipv6 header as uint8_t.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    c6da968 View commit details
    Browse the repository at this point in the history
  4. Add a simple interface to libpcap's packet filter

    lib/pcap/filter.lua provides a facility to compile an arbitrary
    libpcap filter expression and apply it to a data packet for efficient
    classification.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    0a6c926 View commit details
    Browse the repository at this point in the history
  5. Add functionality to the datagram module

    The new method parse_match() allows the parsing and matching of a
    single protocol header without having to allocate a table, which can
    help to avoid garbage.
    
    The new method parse_n() parses exactly n protocol headers without
    applying any additional checks.
    
    Also new is the pop_raw() method that pops a protocol header without
    parsing it.  This requires the application to already know the type
    and size of the next header.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    145a937 View commit details
    Browse the repository at this point in the history
  6. Add support for the new pcap filter module to vpws and ns_responder

    Both apps use the efficient filter module to avoid garbage during
    packet classification.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    26c99eb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ce22d3d View commit details
    Browse the repository at this point in the history
  8. Full support for GRE and ICMPv6 checksum

    The vpws and ns_responder apps now handle checksums correctly in all cases.
    
    The GRE key field is now supported correctly as well.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    3dff243 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ba90499 View commit details
    Browse the repository at this point in the history
  10. Fix initialization bug in buffer.new_buffer()

    The origin.type member of a newly allocated buffer needs to be set
    explicitely after receiving a memory block with undefined contents
    from malloc(3).
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    18a8155 View commit details
    Browse the repository at this point in the history
  11. Tunings to reduce garbage and eliminate NYIs

    lib/protocol/datagram.lua: pre-allocate the _packet variable upon
    instantiation as ctype "struct packet *[1]" to avoid boxing.  This
    appears to eliminate the bulk of garbage in the datagram class.
    
    lib/protocol/icmp/: pre-define pointer ctypes in various classes to
    avoid NYIs due to unsupported FastFunc ffi.typeof.
    
    lib/protocol/ipv6.lua: pre-allocate a pseudo-header for every ipv6
    object to avoid another NYI.
    
    lib/protocol/header.lua and all module that touch the _header instance
    variable: create _header as array of a single pointer to the actual
    header, just like in datagram.lua.  The cast operation in
    new_from_mem() will update the array rather than create a new boxed
    pointer.
    alexandergall committed Jun 26, 2014
    Configuration menu
    Copy the full SHA
    5c4f12c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    92a5087 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2014

  1. Use a better way to deal with variable-size protocol headers

    A previous commit that reduces garbage in the lib/protocol code broke
    the handling of variable-sized protocol headers, specifically gre.
    The gre code and the generic code in lib/protocol/header.lua has bee
    rewritten to use subclasses in such a case.  This makes the code
    cleaner and allows proper recycling of objects on a per header-type
    basis.
    alexandergall committed Jun 27, 2014
    Configuration menu
    Copy the full SHA
    17bf5fc View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2014

  1. Configuration menu
    Copy the full SHA
    a6b0a9b View commit details
    Browse the repository at this point in the history
  2. Replace compile-time '-lpcap' with runtime 'ffi.load("pcap",true)'

    Libpcap will be dynamically found and linked at runtime if/when the
    lib.pcap.filter module is loaded.
    lukego committed Jul 2, 2014
    Configuration menu
    Copy the full SHA
    f0edb8c View commit details
    Browse the repository at this point in the history