Thanks for the reply.
However, I was more thinking how flow_sample->source_id, flow_sample->input, and flow_sample->output are used to determine the rate on a given interface.
The thing is that the frame rate reported by sFlowTrend is twice as high as the actual frame rate on the given port of the switch I'm monitoring.
It could be because the switch reports flow_sample->output = 0 (unknown output interface), when it Rx samples a frame. In such frames, flow_sample->input = flow_sample->source_id = ingress_port.
When the switch Tx samples, it also knows the ingress port and therefore sets flow_sample->input = ingress_port and flow_sample->output = flow_sample->source_id = egress_port.
Is this a malbehavior of the switch, and if so, what is the switch supposed to do?
Thanks,
René