Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
48 stars 5 forks source link

Experiment: factor vlan processing into separate app #184

Closed wingo closed 8 years ago

wingo commented 8 years ago

In retrospect, adding vlan support to the lwaftr really complicated its inner workings. It would have been much nicer if we instead added and removed vlan tags with separate apps. Of course this could add inefficiencies, but maybe not so much, and you'd only pay for it if you use vlans... and if you use vlans and ran into perf problems, perhaps you could use vmdq to remove the vlans on the hardware side. Dunno. We should see what the performance penalty would be for factoring out vlan support and if it's low enough we should pay it.

kbara commented 8 years ago

Unless we can avoid effectively memcopying everything, I'd say the cost is too high. Some of the packet+offset musings at the SDN workshop could make it affordable; dunno about vmdq.

Vlan support doesn't actually complicate the inner workings that much; the main problem is that it composes awkwardly with almost everything, and gets touched in a lot of places.

Architecturally, I'd like to have it be in a separate app; practically, I'd be surprised if it was a reasonable thing to do. I'd like to be surprised, though!

lukego commented 8 years ago

In the big picture for Snabb Switch I think we have to deal with awkwardly inconsistent packet formats e.g. untagged / 802.1Q tag / QinQ tag / etc. Certain programs may be able to avoid this in the short term e.g. with an app or VMDq to insert/remove tags at the edges but this won't be a winning strategy in the long term.

Snabb NFV will have to deal with this soon e.g. we want to make the L2TPv3 tunnel app support multiple tunnels each mapped onto an 802.1Q VLAN ID from the VM perspective.

Indeed this could be the trigger for using one of the tricks we discussed for updating the packet struct to support more efficient hacking of the start of packets. (That could in turn trigger the hardcore memcpy optimizations to try and re-simplify the packet struct while keeping the performance that applications have come to depend on.)

wingo commented 8 years ago

Fixed in #195 / #197. There are soft vlan tagger / untagger apps, but we'll take advantage of hardware if it's there.