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

Nokia BNG NAT logging support #533

Closed
anetrjuns opened this issue May 24, 2024 · 11 comments
Closed

Nokia BNG NAT logging support #533

anetrjuns opened this issue May 24, 2024 · 11 comments
Assignees
Labels
Feature request Feature request

Comments

@anetrjuns
Copy link

Is it possible to add support for NAT logging for Nokia BNG ?
https://infocenter.nokia.com/public/7750SR227R1A/index.jsp?topic=%2Fcom.nokia.Multiservice_ISA_and_ESA_Guide%2Flsn_and_l2-awar-d1085e11672.html

Example capture and nfcapd is attached
nokia_cflow_example.zip

@phaag phaag self-assigned this May 24, 2024
@phaag phaag added the Feature request Feature request label May 24, 2024
@phaag
Copy link
Owner

phaag commented May 24, 2024

Thanks for the sample! I will check.

@gabrielmocan
Copy link

Nokia being Nokia.

They're putting the pre-NAT IP address in a proprietary field...

image

@gabrielmocan
Copy link

gabrielmocan commented May 25, 2024

Another funny fact: records does not explicitly says if they are ADD ou DEL event. [1]

One has to imply that by the presence (or absence) of flowStartMilliseconds and flowEndMilliseconds.

For ADD events, flow records comes with flowStartMilliseconds field while for DEL events, flowEndMilliseconds is available.

Nokia being Nokia.

[1] https://infocenter.nokia.com/public/7750SR227R1A/topic/com.nokia.Multiservice_ISA_and_ESA_Guide/template_format-d1085e12219.html

@phaag
Copy link
Owner

phaag commented May 26, 2024

So it's about the 3 missing and Nokia specific elements? @anetrjuns, @gabrielmocan - as of NAT logging - does that work for you? Honestly, I don't see much NAT stuff thee?

@gabrielmocan
Copy link

@phaag that's Nokia way of doing things. They always just ignore standards, most likely to sell their proprietary monitoring stuff.

But well, in regards to NAT logging, we would need 2 things:

  • Imply if the flow record is a ADD or DEL event (based on the logic that I described in my previous message) to fill natEvent field;
  • Extract pre-NAT IP address that's stored within type 93 proprietary field - aluNatSubString.

@anetrjuns for your use case you would need types 91 and 92 fields? aluInsideServiceID and aluOutsideServiceID

@anetrjuns
Copy link
Author

anetrjuns commented May 27, 2024

@gabrielmocan I added another file from the vendor

  • for ADD and DEl action Nokia had two different template set, snd page in attached document
  • extract only IP address from type 93 proprietary field (source IP stored with LSN session number LSNxxx@ipaddress)
    IPFIX-NAT_Logging V1.pptx

For my use case type 93 field extraction enough

phaag added a commit that referenced this issue Jun 2, 2024
@phaag
Copy link
Owner

phaag commented Jun 2, 2024

The Nokia nat records are now decoded in the master repo.
See also nfconf.dist for a possible output format an nfdump(1) for the new definitions:

nfdump -r tmp -o 'fmt:%ts %te %flid %pr %sap -> %dap %isid %osid %nats'

The Nokia elements are listed in raw, fmt and json

As Nokia does not send NAT events for ADD/DELETE and uses different templates for each, there are no NAT event records available. To add them as a best guess of what was sent is too risky and may lead to unwanted results with data from other exporters. Therefore it is left to the user to evaluate correctly the appropriate events.

@gabrielmocan
Copy link

@phaag can we have this extensions for go-nfdumpas well?

@phaag
Copy link
Owner

phaag commented Jun 2, 2024

@phaag can we have this extensions for go-nfdumpas well?

Done!

@phaag phaag closed this as completed Jun 2, 2024
@anetrjuns
Copy link
Author

@phaag many thanks, unbelivable, it's working :)

Only one question about date/time
For the one flow we have duplicate entries: the first one has "Date first seen" filed with right value and 0-s for "Date last seen"
and for second one the values reversed.
Is this expected behaviour?
The screenshot is attached.
nfdump_nokia_bng_duplicate

@gabrielmocan
Copy link

@anetrjuns this seems fine to me.

First entry is the ADD event, second entry is the DEL event.

You'll have to imply this logic wherever you're going to use these information.

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

No branches or pull requests

3 participants