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

Add ifIndex and RPF checks #1022

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kot-begemot-uk
Copy link
Contributor

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.

Anton Ivanov added 2 commits October 7, 2020 08:20
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 <[email protected]>
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.

1 participant