GithubHelp home page GithubHelp logo

Comments (6)

pawmal avatar pawmal commented on May 27, 2024 1

I've tested with Aritsta EOS, sampling configured ingress+egress on peering ports, prints 'i' and 'e' as expected, thank you.

from pmacct.

paololucente avatar paololucente commented on May 27, 2024

Hi Pawel ( @pawmal ),

Thanks for reporting this. I verified the issue occurring still in master code and fixed it with the commit referenced above. Interestingly, sFlow Flow Samples do not have a direct way to detect the sampling direction so the field does not really apply to sfacctd and it will print always u, unknown.

Paolo

from pmacct.

pawmal avatar pawmal commented on May 27, 2024

It is a bit confusing, as "pretag.map.example" provides "direction" matcher.

While it uses IPFIX (61) direction field, it is allowed to be used by sfacctd as well, where it has value derived from "source_id".
Therefore I assumed aggregate by sampling_direction for sFlow will expose same 0 or 1 value, as pretag.map refers to.

in sFlow v2/v4/v5 this returns a positive match if: 1) source_id equals to input interface and this 'direction' key is set to '0' or 2) source_id equals to output interface and this 'direction' key is set to '1'.

Even more confusing, it is unspecified how "source_id" is filled for sFlow. :)

from pmacct.

paololucente avatar paololucente commented on May 27, 2024

Hi Pawel,

Thanks for insisting on this. I effectively had to refresh my memory and re-look at code. To your points:

  1. I have aligned behavior of sampling_direction primitive to direction key in pre_tag_map. So, effectively, sampling direction is now supported on sFlow;

  2. sFlow and source_id: this is how it is traditionally (we'll come back on the traditionally part later) populated, and i have added a comment in both sections of the code: "In the standard sFlow data model, every measurement comes from a particular datasource defined by agent IP address, ds_class and ds_index, and written as agent>ds_class:ds_index. For example the interface counters for interface 17 on switch 10.1.2.3 come from datasource 10.1.2.3>0:17".

So what now happens in both points of the code is that, say, input interface of a flow sample is 17 and ds_index (the last number of source id) is 17 then it is inferred that sampling direction is ingress. Similarly if 17 is output interface of a flow sample and that matches the ds_index, it is inferred that sampling direction is egress. Hope this explains & makes sense.

This all said, coming back on the traditionally part, the whole scheme here holds up to the moment in which things are encoded in the source ID as expected.

Paolo

from pmacct.

pawmal avatar pawmal commented on May 27, 2024

Thanks, this clarifies how it works. :)
My understanding is there are 3 values possible: in (0), out(1) and unknown(u).

from pmacct.

paololucente avatar paololucente commented on May 27, 2024

3 values, exactly right! ingress (i), egress (e), unknown (u).

from pmacct.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.