Getting Packets

FMADIO LXC system high level architecture is shown below.

FMADIO LXC Architecture

This provides a full lossless filtered version of data directly into the LXC container for processing.

Backpressure is provided thru the LXC Ring structure, allowing the application to consume data as fast or slow as possible without dropping anything.

Sending Data to LXC Offline

During development its typically easiest to send data into the LXC container in a one time replay operation. This allows sending the same data repeatedly to the application allow the engineers to debug and test the code.

In this example we will use the application "fmadio2pcap" which converts the LXC ring into a standard PCAP formatted stream of data.

Its recommended to start the data consumer aka LXC application first, then start the replay.

Consumer - fmadio2pcap tcpdump

Run the following on the LXC container to generate TCPDUMP output thru the lxc ring named "general"

It will look similar to the following on startup, it stops because no packets have been sent to the ring.

Producer - stream_cat sending to LXC ring

On the FMADIO Host system find a capture you want to replay. In this example we are using capture named "inetsample_20230615_1513" filename can be found using "stream_dump"

The command is as follows

Example output of the command shown below

And on the LXC client side the output will show ICMP packets printed in tcpdump format as shown below

Custom Application

For a custom application to directly ingest data, the following reference code is provided

Primary header file with all functions and strcutures inline

https://github.com/fmadio/platform/blob/main/include/fmadio_packet.h

Core example code to retreive packets

https://github.com/fmadio/platform/blob/main/fmadio2pcap/main.c#L160-L185

Core loop snippet, this converts from LXC Ring into standard PCAP Packet format

Last updated

Was this helpful?