Configuring the Device to Count the IFG and Preamble Traffic Statistics
Context
You can run the display interface command to view the running status and traffic statistics on an interface. The Last 300 seconds input rate or Last 300 seconds output rate field in the command output indicates the inbound or outbound traffic rate on the interface in the last 300 seconds.
If you want to obtain the total number of bytes passing through an interface in a period, configure the device to count the bytes in the interframe gap (IFG) and preamble when collecting traffic statistics on the interface. The interface traffic rate is as follows:
Interface traffic rate = (Original packet length + IFG + Preamble) x Number of packets passing through the interface every second
If you want to obtain only the number of packet bytes passing through an interface in a period, configure the device not to count the bytes in the IFG and preamble when collecting traffic statistics on the interface. The interface traffic rate is as follows:
Interface traffic rate = Original packet length x Number of packets passing through the interface every second
By default, the IFG has a fixed value of 12 bytes and the preamble has a fixed value of 8 bytes. You can run the ifg command to configure the IFG.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Run set flow-statistics include-interframe
The device is configured to count the bytes in the IFG and preamble when collecting traffic statistics on the interface.
By default, traffic statistics on an interface contain the IFG and preamble. You can run the display interface command to view the running status and traffic statistics on an interface. The Last 300 seconds input rate or Last 300 seconds output rate field in the command output indicates the rate of incoming or outgoing traffic on the interface in the last 300 seconds.