On current ONUs, you can query packet statistics of a port but cannot directly query traffic of a port. To obtain traffic of a port, you can collect the number of frames received or transmitted by the port in a period of time as follows:
- Query the number of frames received or transmitted by a port at two different time points by running the following commands for different scenarios:
- On a GPON uplink port, run the interface gponnni command to enter the GPONNNI mode, and then run the display gpon-port statistics command to query the number of frames received or transmitted by a port.
- On other ports, run the display interface [ interface-type [ interface-number ] ] command to query the number of received or transmitted by the ports.
- Use the following formula to calculate the number of frames received or transmitted by a port between two time points: Number of frames collected the second time - Number of frames collected the first time.
- Use the following formula to calculate the traffic on the port: Number of frames x Bytes per frame.
For example, the number of frames on a port are collected at two time points within 30s, and the number of frames between the two time points is 85734 (786687061 - 786601327). Assume that the length of a frame is about 1500 bytes. The traffic on the port within 30s is 981 Mbits (85734 x 1500 x 8= 1,028,808,000 bits), or 122.6 Mbytes.
No comments:
Post a Comment