Open
Conversation
Copy was copying only data, losing all metadata in the process. This resulted in very erratic behaviour of Replicate in a pipeline which relies on metadata to identify packets.
This is a set of basic functionality which is present in all switching and forwarding frameworks. They all set/keep packet origin in the packet metadata. The reason is that knowing your "in" interface is essential for most forwarding decisions. Example - you cannot implement even a basic hub without knowing your "in" interface, because you are not supposed to send packets to the interface which originated them. There are similar requirements for forwarding, security, acls, etc. This changeset adds the following functionality: 1. Each port gets an ifIndex similar to ifIndex in SNMP assigned on creation. 2. PortInc now always sets an integer metadata called ifIndex with the ifIndex value. 3. PortOut now can optionally check if the packet is being sent out from its arrival port and drop it. The default behavious is rpf check off - to emulate previous BESS behaviour. Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a basic requirement for most switching/routing algorithms.
Example - most trivial possible "hub" - two ports wired to a replicator and two Linux instances off them:
UnixSocketPort(name='u0', path="/var/tmp/uml-test-0")
UnixSocketPort(name='u1', path="/var/tmp/uml-test-1")
PortInc(port="u0") -> repl::Replicate(gates=[0,1])
PortInc(port="u1") -> repl
repl:0 -> PortOut(port="u0")
repl:1 -> PortOut(port="u1")
This behaves pretty badly with BESS as is because the packets sent out of port 0 are also received on port 0 and vice versa.
Adding this change and enabling it results in the correct expected behaviour and correct high throughput.
UnixSocketPort(name='u0', path="/var/tmp/uml-test-0")
UnixSocketPort(name='u1', path="/var/tmp/uml-test-1")
PortInc(port="u0") -> repl::Replicate(gates=[0,1])
PortInc(port="u1") -> repl
repl:0 -> PortOut(port="u0", rpfcheck=1)
repl:1 -> PortOut(port="u1", rpfcheck=1)
I have tried to preserve packet batching to the extent possible for packets being sent. As a result of the "drops" the batches may now be a bit smaller, but it will still batch.
A.