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

Sampler Address #98

Open
mugugnu opened this issue Apr 23, 2021 · 3 comments
Open

Sampler Address #98

mugugnu opened this issue Apr 23, 2021 · 3 comments

Comments

@mugugnu
Copy link

mugugnu commented Apr 23, 2021

Hello,
i'm investigating a little bit on this SamplerAddress attribute, as my concern is that it is getting overwritten when passing through a NAT.
It is not read from the netflow payload but from the packet header, isn't it ? I can't find any reference of this attribute in the netflow protocol format...but it seems weird that it was not included...am i right or am i missing something ?

@saymonaraujo
Copy link

Hello,

Should not be overwritten.
The NAT/PAT overwrite the source IP address of the packet in the Layer3.
The flow information its on the packet data as a exemple

image

In the field: Agent Address will be the IP of the SamplerAddress(At least shold be) if the GoFlow daemon parse the source-ip in the layer3 as the SamplerAddress this is a bug and must be fixed.

@mugugnu
Copy link
Author

mugugnu commented Apr 28, 2021

Hello, the screenshot you provided shows, as far as i understand, traffic from sFlow protocol. I'm actually using netflow v5.
Is it possibile that they are actually different and netflow5 lacks the agent address field, so that goflow has no other options than using the layer3 source ip ?

The code in goflow, for netflow v5, seems to do this, but i might be wrong:

`func (s *StateNetFlow) DecodeFlow(msg interface{}) error {

pkt := msg.(BaseMessage)

buf := bytes.NewBuffer(pkt.Payload)
key := pkt.Src.String()

samplerAddress := pkt.Src

if samplerAddress.To4() != nil {

samplerAddress = samplerAddress.To4()

}`

@saymonaraujo
Copy link

Sorry for this,
I don't think Netflow has this field. But to be shure you will have to do a tcpdump and analyze the packet.

tgragnato pushed a commit to tgragnato/goflow that referenced this issue Aug 14, 2024
* netflow: Add observation domain and point to message

The ObservationDomainID and ObservationPointID are two IPFIX fields that
identify the entity that is capturing flows and can be used to enrich
the context around a specific sample.

Parse these fields from the sample and add them to the FlowMessage.

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

No branches or pull requests

2 participants