NetSys / bess

BESS: Berkeley Extensible Software Switch
Other
313 stars 156 forks source link

Add ifIndex and RPF checks #1022

Open kot-begemot-uk opened 4 years ago

kot-begemot-uk commented 4 years ago

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.