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

Question: can nfcapd collect flows on a TCP port ? #609

Open
nikita1211 opened this issue Mar 18, 2025 · 5 comments
Open

Question: can nfcapd collect flows on a TCP port ? #609

nikita1211 opened this issue Mar 18, 2025 · 5 comments
Assignees
Labels

Comments

@nikita1211
Copy link

Hi, I am looking for an IPFIX collector to receive traffic on a TCP port. I noticed that nfcapd uses a datagram socket to listen on a UDP port.

I want the channel to be a connection oriented one, any suggestions ? With socket changes will nfcapd be able to accept IPFIX traffic on a TCP port ?

Thank you!

@phaag phaag self-assigned this Mar 20, 2025
@phaag phaag added the question label Mar 20, 2025
@phaag
Copy link
Owner

phaag commented Mar 20, 2025

Well - IPFIX is not defined to be transported over TCP, as far as I know. However, you would need to change the socket code, in order to switch to TCP. Although this is not a big issue, you would need an exporter, which can send IPFIX over TCP.

@nikita1211
Copy link
Author

Thank you for your response! Yes I have an exporter sending IPFIX over TCP.
Other than the socket code in 'src/collector/nfnet.c', what other changes might be required, for example anything for extracting the TCP packet ? I'll try making the socket changes.

@matwei
Copy link

matwei commented Mar 20, 2025

Thank you for your response! Yes I have an exporter sending IPFIX over TCP. Other than the socket code in 'src/collector/nfnet.c', what other changes might be required, for example anything for extracting the TCP packet ? I'll try making the socket changes.

Please have a look at the section Template Management in RFC7011. There are differences in the template management between TCP, SCTP and UDP as transport protocol.

@phaag
Copy link
Owner

phaag commented Mar 21, 2025

Thanks @matwei . I'll have a look at that. I real life, I have never came across to SCTP or TCP, as almost no one implements that. If I am going to implement other protocols, I need to be able to test all those scenarios properly. So far I have no SCTP or TCP exporter an my fingers. Any pointers are welcome! If it turns out, that SCTP or TCP is a need, I am happy to implement that.

@nikita1211 Besides the socket code in nfnet.c, you need to change the data accept part in nfcapd.c - recvfrom needs to be replaced be proper protocol handling. Proper also means handling multiple streams etc.

@matwei
Copy link

matwei commented Mar 21, 2025

I also didn't see an IPFIX exporter using SCTP or TCP before.

After some searching I found ipfixprobe from CESNET, that seems to be able to use tcp.
I haven't had the time to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants