sflowtool
sflowtool copied to clipboard
sflowtool 接收到数据,是如何来计算源IP到目的IP地址的流量?How to calculate the traffic from the source IP to the destination IP address after receiving data?
场景:
- SW--->sflowtool--->kafka<----python去消费数据,现在的问题就是能提取出具体的五元组信息,但是不知道如何计算这个带宽是多少?
Generating an estimate of the traffic total between IP addresses (or other potential keys) is outside the scope of sflowtool. There is an ecosystem of other tools that do this. However it's worth linking from here to documents that explain the principles.
Summary: The simplest way is to scale by the indicated sampling-rate, but this assumes the switch is actually sampling at that rate and that there is no packet loss. The more robust approach is to compute the effective sampling rate by observing the delta in the sample_pool field, and then scale by that. Statistically what you get is a best-estimate with a confidence-interval.
Here are the relevant documents: http://www.sflow.org/packetSamplingBasics/index.htm http://www.inmon.com/pdf/sFlowBilling.pdf