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

L2 VPN take 2 #138

Merged
merged 10 commits into from Apr 17, 2014
Merged

L2 VPN take 2 #138

merged 10 commits into from Apr 17, 2014

Conversation

alexandergall
Copy link
Contributor

This pull request incorporates all changes I've made sine the first request. I have also made more sensible commits this time which hopefully make it easier to understand.

Up front: please let's not waste time again on the class.lua thing. I acknowledge that it's controversial. It's still there because Luke asked me to keep it. Whether we need a convention for OOP in this project or not and how it should look like should better be discussed elsewhere. It should have little to no impact on the main purpose of this pull request.

The gist of it is to see whether we can have the cake and it, too. I.e. whether we can have higher-level, reusable code for packet handling without dramatic loss of performance. The current code clearly falls short of that. Getting rid of the "NYIs" was fairly easy but the real challenge is to avoid GC. The encapsulation is not that bad (however still not quite acceptable, in particular due to the jitter that it induces in the forwarding path) but the packet matching for decapsulation sucks big time. Let's find out if this can be made to work or whether we need something entirely different.

I have some interesting real-life performance figures to share, but I'll take that to the mailing list.

make test on chur fails for core.lib and apps.vhost.vhost_user, but it does so on the master branch as well.

I have also included workarounds for bugs related to the transmission of multi-buffer packets. Those are not proposed fixes, of course.

A basic framework for classes with single inheritance is provided in
src/lib/lua/class.lua, which is required by core/main.lua by default.

The new directory src/lib/lua is intended to be used to store common
low-level Lua code.  In that spirit, src/strict.lua has been moved
there as well.
core.packet.prepend_iovec() adds a buffer to the front of the iovecs
core.packet.coalesce() attempts to coalesce all buffers into a single one
The set of classes in src/lib/protocol provide basic mechanisms for
parsing, building and manipulating a hierarchy of protocol headers and
associated payload contained in a data packet.  In particular, it
supports

   * Parsing and in-place manipulation of protocol headers in a
     received packet

   * In-place decapsulation by removing leading protocol headers

   * Adding encapsulation headers to an existing packet

   * Creation of a new packet
The RawSocket app provided in src/apps/socket can be used to read and
write bare packets from regular network devices.  It can be used to
access NICs for which no native Snabb Switch driver exists.  It can
also facilitate debugging with, e.g., tcpdump, which is not straight
forward to use with the native driver.  The app is not recommended for
handling traffic with high demands on performance.
RawVhost provides the same functionality as RawSocket but should have
better performance.  However, performance is actually worse :( It
could be worth while to understand why.  Or maybe this is not a useful
thing at all.
The app provides the bare minimum needed for address resolution of
remote hosts on the same subnet.  It filters out NS for a single
pre-defined IPv6 target address and responds with a NA that provides a
pre-defined link-layer address.
A simple string as argument to an app's new() method makes it
difficult to implement non-trivial configurations.  The downside is
that it's harder to detect when the configuration has changed and the
app needs to be reconfigured.
The intel10g and vhost drivers don't handle multi-buffer packets on
transmit correctly.  vhost also ignores iovec.offset.
lukego added a commit that referenced this pull request Apr 17, 2014
Merged Alex Gall's VPN app and datagram support.
@lukego lukego merged commit 6dd9a29 into snabbco:master Apr 17, 2014
@lukego
Copy link
Member

lukego commented Apr 17, 2014

Great! and nicely rebased :-)

@alexandergall alexandergall deleted the vpnv2 branch September 8, 2014 14:51
dpino pushed a commit to dpino/snabb that referenced this pull request Dec 7, 2015
Backport: IPv6 fragmentation: don't leak memory/packets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants