David Lamparter [Sat, 18 Aug 2018 16:03:16 +0000 (18:03 +0200)]
vtysh: make RPKI node non-conditional
Whether or not RPKI is enabled during build shouldn't really influence
vtysh; the user can always manually install bgpd_rpki.so later and it
should work. This also means that the behaviour of "RPKI module not
loaded" is consistent regardless of whether it was a compile-time or
runtime decision.
Signed-off-by: David Lamparter <equinox@diac24.net>
David Lamparter [Sun, 2 Sep 2018 18:36:20 +0000 (20:36 +0200)]
build: fix & clean up *SAN flags
ASAN/MSAN/TSAN flags need to be in CFLAGS and LDFLAGS; the latter links
the correct compiler-dependent library. Also, the configure switch was
broken (--disable-... would enable the sanitizer.)
Signed-off-by: David Lamparter <equinox@diac24.net>
David Lamparter [Sat, 8 Sep 2018 18:18:30 +0000 (20:18 +0200)]
bfdd: fix garbage "port" string
bfd_recv_ipv4() is getting an uninitialized buffer passed in as port,
and then checks it without clearing it first. Thus we can end up
leaving garbage data in it.
Signed-off-by: David Lamparter <equinox@diac24.net>
Donald Sharp [Fri, 7 Sep 2018 18:30:24 +0000 (14:30 -0400)]
vtysh: Actually make the new_completion function match
The new_completion function was not declared the same
way the rl_attempted_completion_function pointer was.
The only difference was a 'const char *' -vs- 'char *'
So convert it over.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Fri, 7 Sep 2018 17:50:57 +0000 (13:50 -0400)]
vtysh: Add code to isolate append_history
The append_history function in lib readline appears to
not be universally available across all of the esoteric
platforms we may want to compile on. As such
provide a way to gracefully do nothing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 6 Sep 2018 22:26:04 +0000 (18:26 -0400)]
zebra: Modify nexthop checks to report inactive a bit more
Debugging inactive nexthops in zebra can be quite difficult
and non-obvious what has gone wrong. Add detailed rib
debugs for the cases where we decide that a nexthop is
inactive so that we can more easily debug a reason
for the failure.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 5 Sep 2018 00:56:42 +0000 (20:56 -0400)]
zebra: Fix _route_entry_dump to handle nexthop family as appropriate
The _route_entry_dump function was not handling the nexthop as passed
in from an upper level protocol appropriate and as such not displaying
the v4/v6 nexthop right in the case where we have both going.
Additionally dump the nexthop vrf as well.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Rafael Zalamena [Wed, 5 Sep 2018 15:29:14 +0000 (12:29 -0300)]
bfdd: fix crash when receiving invalid echo packet
The log function would improperly format a string using an integer
causing a crash. This situation was found when switching echo mode with
a active connection.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
fabricd: add support for completely unnumbered operation
With this commit, fabricd can run without any IPv4 addresses configured
except on loopback. There are two changes to achieve this:
a) If a circuit has no IPv4 address configured, fabricd will resort to
advertise the routers loopback IP in the OpenFabric hellos.
b) All the routes from OpenFabric are sent with ZEBRA_FLAG_ONLINK set,
so that zebra will install them into the fib without checking whether
the nexthop is reachable
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
zebra: add a ZEBRA_FLAG_ONLINK so that routes bypass the is-unnumbered check
For OpenFabric operation, we need to be able to install routes via
interfaces without any IPv4 addresses configured. Introduce a flag
ZEBRA_FLAG_ONLINK which upper protocols can set on a route they send
towards zebra, to force the nexthops to be considered onlink.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
fabricd: Remove processing for unneded PDUs and TLVs
The OpenFabric draft prescribes that any IS-IS PDUs not needed for
OpenFabric operation MUST be ignored. So this commit makes fabricd
ignore any LAN IIHs and any L1 LSPs.
Also the draft specifies that any reachabilities given as narrow-metric
TLVs SHALL be ignored, so adhere to that too.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Fri, 25 May 2018 12:31:59 +0000 (14:31 +0200)]
tests/isisd: remove auth when fuzzing
Our "deserialize, reserialize, check-equality" test fails when the
fuzzer produces PDUs with incorrect cryptographic checksums.
While the most realistic solution would be to validate the
cryptographic checksums in the test program, that seems very silly,
given that we don't want to fuzz our cryptographic auth.
Given that, removing auth during fuzzing seems the next best solution.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 10 May 2018 11:10:59 +0000 (13:10 +0200)]
fabricd: build a list of neighbors and neighbors neighbors
OpenFabric uses a list of neighbors and neighbors neighbors to calculate
a set of designated reflooders.
While the draft prescribes that these lists should be built whenever an
LSP needs to be flooded, this implementation opted to build them only
when we ran an spf, given that they will only change when the topology
changes.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 10 May 2018 18:02:04 +0000 (20:02 +0200)]
fabricd: add field with first and second nexthop to SPF paths
OpenFabric requires knowledge of the first two hops on each path
calculated by spf to implement its flooding optimization. Extend the
hopcount-spf to build such a datastructure.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
fabricd: support transmission/reception of circuit-scoped LSPs
OpenFabric makes use of flooding scope LSPs to reduce the amount of
reflooding caused by the update process. Implement transmission and
reception of such PDUs.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 10 May 2018 15:37:05 +0000 (17:37 +0200)]
fabricd: reimplement LSP transmission logic
Before this commit, isisd/fabricd maintained a bitfield for each LSP
to track the SRM bit for each circuit, which specifies whether an LSP
needs to be sent on that circuit. Every second, it would scan over all
LSPs in `lsp_tick` and queue them up for transmission accordingly.
This design has two drawbacks: a) it scales poorly b) it adds
unacceptable latency to the update process: each router takes a random
amount of time between 0 and 1 seconds to forward an update. In a
network with a diamter of 10, it might already take 10 seconds for an
update to traverse the network.
To mitigate this, a new design was chosen. Instead of tracking SRM in a
bitfield, have one tx_queue per circuit and declare that an LSP is in
that queue if and only if it would have SRM set for that circuit.
This way, we can track SRM similarly as we did before, however, on
insertion into the LSP queue, we can add a timer for (re)transmission,
alleviating the need for a periodic scan with LSP tick and reducing the
latency for forwarding of updates.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Wed, 23 May 2018 13:37:45 +0000 (15:37 +0200)]
fabricd: implement asymmetric metric for tier 0 as per Section 6.2
To avoid passing of traffic via leaf nodes in the fabric, OpenFabric
specifies that all links towards tier 0 nodes should be advertised with
a very high metric.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
If an OpenFabric router doesn't have its tier number configured
manually, try to execute the fabric locality calculation algorithm
whenever we have run spf.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 10 May 2018 17:05:40 +0000 (19:05 +0200)]
fabricd: allow to configure tier-level advertisement
While OpenFabric calculates most tier numbers automatically by the
fabric locality calculation algorithm, that algorithm requires two
systems to be manually configured as tier 0, so it has reference points.
Also, completely manual configuration is possible.
To support this, introduce appropriate CLI commands and flood the
configured information.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
fabricd: Add support for TLV 150 (Spine-Leaf-Extension)
To flood the tier calculated by the fabric locality detection,
OpenFabric makes use of TLV 150, defined in
draft-shen-isis-spine-leaf-ext-06, so add support for that TLV.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 10 May 2018 16:52:17 +0000 (18:52 +0200)]
isisd: move spf datastructures to a header, to share with fabricd
By moving the spf datastructures to a header, fabricd can access the
results of the spf run for flooding optimization or fabric locality
calculation.
While this was deemed a sensible choice in this case, when compared with
the option of adding a lot of OpenFabric specific code to isis_spf.c,
the datastructures should still not be accessed randomly all over the
code base. To make this more clear, the new header was called
isis_spf_private.h (Think of a friend class)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
fabricd: adjacency formation optimization as per section 2.4
OpenFabric changes IS-IS's initial database synchronization. While
regular IS-IS will simultaneuously exchange LSPs with all neighboring
routers during startup, this is considered too much churn for a densely
connected fabric.
To mitigate this, OpenFabric prescribes that a router should only
bring up an adjacency with a single neighbor and perform a full
synchronization with that neighbor, before bringing up further
adjacencies.
This is implemented by having a field `initial_sync_state` in the
fabricd datastructure which tracks whether an initial sync is still
pending, currently in progress, or complete.
When an initial sync is pending, the state will transition to the
in-progress state when the first IIH is received.
During this state, all IIHs from other routers are ignored. Any
IIHs transmitted on any link other than the one to the router with
which we are performing the initial sync will always report the far
end as DOWN in their threeway handshake state, avoiding the formation of
additional adjacencies.
The state will be left if all the SRM and SSN flags on the
initial-sync circuit are cleared (meaning that initial sync has
completed). This is checked in `lsp_tick`. When this condition occurrs,
we progress to the initial-sync-complete state, allowing other
adjacencies to form.
The state can also be left if the initial synchronization is taking too
long to succeed, for whatever reason. In that case, we fall back to the
initial-sync-pending state and will reattempt initial synchronization
with a different neighbor.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 22 Mar 2018 13:58:53 +0000 (14:58 +0100)]
fabricd: adjust IS-IS defaults as per draft
OpenFabric specifies that it should always be run with wide metrics via
P2P links and only as Level-2. Implement this as default and remove all
the knobs from fabricd which allow other configuration.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Christian Franke [Thu, 22 Mar 2018 13:44:01 +0000 (14:44 +0100)]
isis: Cleanup CLI, split into parts which are shared, fabricd and isisd
Remove isis_vty.c and create three new files isis_vty_common.c,
isis_vty_fabricd.c and isis_vty_isisd.c which are built into both
daemons, only fabricd and only isisd, respectively.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>