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 SendDataRecords to IPFIX Exporter #391

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

antoninbas
Copy link
Member

As a more efficient and covenient alternative to SendSet.

  • SendDataRecords takes a list of data Records (for the same template ID), and breaks them up into multiple IPFIX messages (with one data Set per message) as needed.
  • SendDataRecords can take a reusable buffer as a parameter, to avoid repeated memory allocations.

We also introduce the MaxMsgSize input for the Exporter. It will be used by SendDataRecords to determine how to break up the list of Records into multiple messages. When using UDP, MaxMsgSize should be set based on the PMTU (Path MTU) to avoid fragmentation.

As a more efficient and covenient alternative to SendSet.

* SendDataRecords takes a list of data Records (for the same template
  ID), and breaks them up into multiple IPFIX messages (with one data
  Set per message) as needed.
* SendDataRecords can take a reusable buffer as a parameter, to avoid
  repeated memory allocations.

We also introduce the MaxMsgSize input for the Exporter. It will be used
by SendDataRecords to determine how to break up the list of Records into
multiple messages. When using UDP, MaxMsgSize should be set based on the
PMTU (Path MTU) to avoid fragmentation.

Signed-off-by: Antonin Bas <[email protected]>
pkg/exporter/process.go Show resolved Hide resolved
pkg/exporter/msg.go Show resolved Hide resolved
Copy link
Contributor

@yuntanghsu yuntanghsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antoninbas antoninbas merged commit 23e5f35 into vmware:main Jan 2, 2025
8 checks passed
@antoninbas antoninbas deleted the add-SendDataRecords-to-exporter branch January 2, 2025 18:55
antoninbas added a commit to antoninbas/vmware-go-ipfix that referenced this pull request Jan 14, 2025
SendDataRecords was added in vmware#391 as a way to export data records more
efficiently. However, this method is not convenient to use for clients
which need to mutate the records after sending them (as is the case when
aggregation is used). To work around this issue, we introduce a buffered
exporter. The buffered exporter wraps the standard exporter
process. Whenever a data record is added, it is serialized to a byte
buffer immediately, and the buffer is sent when it reaches the maximum
message size.

Signed-off-by: Antonin Bas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants