Commit Graph

11 Commits

Author SHA1 Message Date
Vincent Bernat
45ab047c80 config: also listen to 4739 for IPFIX
This is the port defined in RFC 7011.
2025-08-29 08:12:30 +02:00
Vincent Bernat
736c4da8a0 outlet/routing: add an option to tune TCP receive buffer for BMP
The default value is quite low. This is a bit of a stop gap. The
alternative would be to maintain a circular buffer of the same size
inside the outlet for each connection and ensure there is no lock in the
path. But doing it in the kernel means almost no code, even if it is a
bit complex for the user.

Fix #1461
2025-08-17 15:13:49 +02:00
Vincent Bernat
756e4a8fbd */kafka: switch to franz-go
The concurrency of this library is easier to handle than Sarama.
Notably, it is more compatible with the new model of "almost share
nothing" we use for the inlet and the outlet. The lock for workers in
outlet is removed. We can now use sync.Pool to allocate slice of bytes
in inlet.

It may also be more performant.

In the future, we may want to commit only when pushing data to
ClickHouse. However, this does not seem easy when there is a rebalance.
In case of rebalance, we need to do something when a partition is
revoked to avoid duplicating data. For example, we could flush the
current batch to ClickHouse. Have a look at the
`example/mark_offsets/main.go` file in franz-go repository for a
possible approach. In the meantime, we rely on autocommit.

Another contender could be https://github.com/segmentio/kafka-go. Also
see https://github.com/twmb/franz-go/pull/1064.
2025-07-27 21:44:28 +02:00
Vincent Bernat
ac68c5970e inlet: split inlet into new inlet and outlet
This change split the inlet component into a simpler inlet and a new
outlet component. The new inlet component receive flows and put them in
Kafka, unparsed. The outlet component takes them from Kafka and resume
the processing from here (flow parsing, enrichment) and puts them in
ClickHouse.

The main goal is to ensure the inlet does a minimal work to not be late
when processing packets (and restart faster). It also brings some
simplification as the number of knobs to tune everything is reduced: for
inlet, we only need to tune the queue size for UDP, the number of
workers and a few Kafka parameters; for outlet, we need to tune a few
Kafka parameters, the number of workers and a few ClickHouse parameters.

The outlet component features a simple Kafka input component. The core
component becomes just a callback function. There is also a new
ClickHouse component to push data to ClickHouse using the low-level
ch-go library with batch inserts.

This processing has an impact on the internal representation of a
FlowMessage. Previously, it was tailored to dynamically build the
protobuf message to be put in Kafka. Now, it builds the batch request to
be sent to ClickHouse. This makes the FlowMessage structure hides the
content of the next batch request and therefore, it should be reused.
This also changes the way we decode flows as they don't output
FlowMessage anymore, they reuse one that is provided to each worker.

The ClickHouse tables are slightly updated. Instead of using Kafka
engine, the Null engine is used instead.

Fix #1122
2025-07-27 21:44:28 +02:00
Vincent Bernat
4a9430e74b inlet/metadata: merge SNMP communities and USM into credentials
This unifies both structure and allows a user to define exception for
some specific subnets. See #1606.
2025-01-18 17:05:43 +01:00
Francois Espinet
87a57bf82e Do geoip enrich in clickhouse instead of inlet
One solution to https://github.com/akvorado/akvorado/issues/62
2024-03-11 15:29:09 +01:00
Vincent Bernat
c2a6589598 inlet/geoip: by default use a separate database for ASN and countries
Currently, the lookups are done separately and we can lookup an ASN but
no country or a country but not an ASN.
2023-08-07 13:42:21 +02:00
Vincent Bernat
b2bec3506c docker: switch to IPinfo database by default
This is useful as it is CC-BY-SA 4.0 licensed and it is OK to share my access token.

Fix #455
2023-08-05 17:46:40 +02:00
Vincent Bernat
7e3ca930ad inlet/metadata: introduce metadata component with pluggable providers
SNMP is the first (and default) provider. Further commits should add:

- [ ] SNMP coalescing (or at the metadata level?)
- [ ] Configuration conversion
- [ ] At least one other provider (static one?)
2023-05-28 14:37:02 +02:00
Vincent Bernat
190375d805 config: listen on "*" instead of "0.0.0.0" to help IPv6 users 2023-05-05 08:10:25 +02:00
Vincent Bernat
e148a8d2c9 docker-compose: move configuration files to config/ 2023-02-13 23:32:45 +01:00