Junos
Junos

Defference in "show interfaces" between "Traffic Statistics > Input Bytes" and "MAC Statistics > Total Octets (Receive)"

‎08-23-2019 06:09 AM

Hello

 

when using "show interface extensive" there is a difference in the value shown at "Traffic Statistics > Input Bytes" and "MAC Statistics > Total Octets (Receive)". Can some explain where this comes from?

This link is part of a LAG with LACP and EBGP. I'm not sure which value I should use for traffic accounting - and the difference  between those two values is quite significant for us:

"Traffic Statistics > Input Bytes": 6597869222239

 "MAC Statistics > Total Octets (Receive)": 6881577177559

 

root@router> show interfaces extensive xe-11/0/1
Physical interface: xe-11/0/1, Enabled, Physical link is Up
  Interface index: 341, SNMP ifIndex: 628, Generation: 344
  Link-level type: Ethernet, MTU: 1514, MRU: 1522, LAN-PHY mode, Speed: 10Gbps, BPDU Error: None, Loop Detect PDU Error: None, MAC-REWRITE Error: None, Loopback: None,
  Source filtering: Disabled, Flow control: Disabled
  Pad to minimum frame size: Disabled
  Device flags   : Present Running
  Interface flags: SNMP-Traps Internal: 0x4000
  Link flags     : None
  CoS queues     : 8 supported, 8 maximum usable queues
  Schedulers     : 0
  Hold-times     : Up 0 ms, Down 0 ms
  Damping        : half-life: 30 sec, max-suppress: 600 sec, reuse: 1000, suppress: 4000, state: unsuppressed
  Current address: 00:21:59:01:51:c1, Hardware address: 00:21:59:01:51:11
  Last flapped   : 2019-05-07 15:54:04 CEST (15w2d 23:02 ago)
  Statistics last cleared: Never
  Traffic statistics:
   Input  bytes  :        6597869222239             19240552 bps
   Output bytes  :       22184318864414             84493952 bps
   Input  packets:          14435205156                 8909 pps
   Output packets:          21400051428                11293 pps
   IPv6 transit statistics:
    Input  bytes  :                3470
    Output bytes  :                   0
    Input  packets:                  55
    Output packets:                   0
  Dropped traffic statistics due to STP State:
   Input  bytes  :                    0
   Output bytes  :                    0
   Input  packets:                    0
   Output packets:                    0
  Input errors:
    Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0
  Output errors:
    Carrier transitions: 1, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
  Egress queues: 8 supported, 4 in use
  Queue counters:       Queued packets  Transmitted packets      Dropped packets
    0                      21386551212          21386551212                    0
    1                                0                    0                    0
    2                                0                    0                    0
    3                         22815438             22815438                    0
  Queue number:         Mapped forwarding classes
    0                   best-effort
    1                   expedited-forwarding
    2                   assured-forwarding
    3                   network-control
  Active alarms  : None
  Active defects : None
  PCS statistics                      Seconds
    Bit errors                             0
    Errored blocks                         1
  MAC statistics:                      Receive         Transmit
    Total octets                 6881577177559   22584100805735
    Total packets                  14435204768      21409378595
    Unicast packets                14425882148      21400050973

 

2 REPLIES 2
Junos

Re: Defference in "show interfaces" between "Traffic Statistics Traffic Statistics > Input Bytes" and "MAC Statistics > Total Octets (Receive)"

‎08-23-2019 06:56 AM

Hi!

 

You need to take the decission based on whether you want to count headers or not. 

Here is the link that explains the difference.

 

 

https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/show-interfaces-g...

 

Traffic statistics

Number and rate of bytes and packets received and transmitted on the physical interface.

  • Input bytes—Number of bytes received on the interface. The value in this field also includes the Layer 2 overhead bytes for ingress traffic on Ethernet interfaces if you enable accounting of Layer 2 overhead at the PIC level or the logical interface level.

  • Output bytes—Number of bytes transmitted on the interface. The value in this field also includes the Layer 2 overhead bytes for egress traffic on Ethernet interfaces if you enable accounting of Layer 2 overhead at the PIC level or the logical interface level.

 

MAC statistics

Receive and Transmit statistics reported by the PIC's MAC subsystem, including the following:

  • Total octets and total packets—Total number of octets and packets. For Gigabit Ethernet IQ PICs, the received octets count varies by interface type. For more information, see Table 31 under the show interfacescommand.Tra

 

 

For Gigabit Ethernet IQ PICs, traffic and MAC statistics output varies. The following table describes the traffic and MAC statistics for two sample interfaces, each of which is sending traffic in packets of 500 bytes (including 478 bytes for the Layer 3 packet, 18 bytes for the Layer 2 VLAN traffic header, and 4 bytes for cyclic redundancy check [CRC] information). The ge-0/3/0 interface is the inbound physical interface, and the ge-0/0/0 interface is the outbound physical interface. On both interfaces, traffic is carried on logical unit .50 (VLAN 50).

Table 2: Gigabit and 10 Gigabit Ethernet IQ PIC Traffic and MAC Statistics by Interface Type

Interface Type

Sample Command

Byte and Octet Counts Include

Comments

Inbound physical interface

show interfaces ge-0/3/0 extensive

Traffic statistics:

Input bytes: 496 bytes per packet, representing the Layer 2 packet

MAC statistics:

Received octets: 500 bytes per packet, representing the Layer 2 packet + 4 bytes

The additional 4 bytes are for the CRC.

Inbound logical interface

show interfaces ge-0/3/0.50 extensive

Traffic statistics:

Input bytes: 478 bytes per packet, representing the Layer 3 packet

 

Outbound physical interface

show interfaces ge-0/0/0 extensive

Traffic statistics:

Input bytes: 490 bytes per packet, representing the Layer 3 packet + 12 bytes

MAC statistics:

Received octets: 478 bytes per packet, representing the Layer 3 packet

For input bytes, the additional 12 bytes include 6 bytes for the destination MAC address plus 4 bytes for VLAN plus 2 bytes for the Ethernet type.

Outbound logical interface

show interfaces ge-0/0/0.50 extensive

Traffic statistics:

Input bytes: 478 bytes per packet, representing the Layer 3 packet

 

 

 

Hope this helps!

 

Regards

Arpit 

 


+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !

Junos

Re: Defference in "show interfaces" between "Traffic Statistics > Input Bytes" and "MAC Statistics > Total Octets (Receive)"

[ Edited ]
‎08-23-2019 08:19 PM

Hello,

What product is it - MX, by any chance? Judging by slot number 11, it is either MX960 or MX2020.

AFAIK, MX Trio cards count all overhead starting with IFG+preamble+SFD.

Let's do some basic math, shall we?

 


@ka_ge wrote:
  MAC statistics:                      Receive         Transmit
    Total octets                 6881577177559   22584100805735
    Total packets                  14435204768      21409378595
    Unicast packets                14425882148      21400050973

 


Total bytes / total packets :   6881577177559  / 14435204768  = 476.71 B average packet size

 

 


@ka_ge wrote:

 

 

  Traffic statistics:
   Input  bytes  :        6597869222239             19240552 bps
   Output bytes  :       22184318864414             84493952 bps
   Input  packets:          14435205156                 8909 pps
   Output packets:          21400051428                11293 pps
  

 

Input bytes / input packets = 6597869222239  /  14435205156   =  457.06 B average packet size

 

476.71 - 457.06 = 19.65 B difference

Which is awfully close to IFG (12 B) + preamble (7 B) + SFD (1 B) = 20 B.

 

HTH

Thx

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !