How to enable the traffic statistics for the Next Hop ID on Trio.
By default, on the Trinity platform, only MPLS related traffic statistics are maintained and the rest of the protocols statistics are not maintained. This is as per design. If statistics are enabled for every protocols, more counters are required to store the statistics and consequently more memory. So, by default, statistics are disable on all Next Hops, except MPLS, to save memory.
ce1-----pe1---ldp------p1-----rsvp-----p2------ldp----pe2----ce2 ce1--pe1 - MX80-1 ce2--pe2 - MX80-2 p1 - p2 - MX240-4
Case 1 – Statistics for MPLS Next Hops (enabled by default):
The trace from CE1 to CE2 picks a label value on the transit hop:
sco@mx80-1# run traceroute 192.168.10.2 logical-system lsys1 source 192.168.10.1 no-resolve traceroute to 192.168.10.2 (192.168.10.2) from 192.168.10.1, 30 hops max, 40 byte packets 1 10.100.1.1 7.336 ms 0.337 ms 0.330 ms 2 10.22.101.2 1.577 ms 0.578 ms 0.557 ms MPLS Label=299792 CoS=0 TTL=1 S=0 MPLS Label=300064 CoS=0 TTL=1 S=1 3 10.3.22.2 0.563 ms 0.549 ms 0.555 ms MPLS Label=299776 CoS=0 TTL=1 S=0 MPLS Label=300064 CoS=0 TTL=2 S=1 4 10.3.126.3 0.532 ms 0.459 ms 0.456 ms MPLS Label=300064 CoS=0 TTL=1 S=1 5 192.168.10.2 0.486 ms 0.470 ms 0.468 ms
The 299792 label value for route lookup on the transit node (MX240-4):
sco@mx-240-4-re0# run show route forwarding-table label 299792 Routing table: default.mpls Logical system: marton Routing table: default.mpls MPLS: Destination Type RtRef Next hop Type Index NhRef Netif 299792 user 0 ulst 1048586 2 10.3.22.2 Swap 299776 811 1 ge-2/0/1.0 10.8.22.2 Swap 299776, Push 299792(top) 830 1 ge-2/0/0.0
Checking the statistics on the PFE:
NPC2(mx-240-4-re0 vty)# show nhdb id 811 statistics Nexthop Statistics: Interface NH ID Next Hop Addr Output Pkts Pkt Rate Output Bytes Byte Rate ------------ ------- --------------- ------------ -------- --------------- ---------- ge-2/0/1.0 811 - 16929 1 50638179 3005
Statistics after sending the 10 ping packets from CE1 to CE2:
NPC2(mx-240-4-re0 vty)# show nhdb id 811 statistics Nexthop Statistics: Interface NH ID Next Hop Addr Output Pkts Pkt Rate Output Bytes Byte Rate ------------ ------- --------------- ------------ -------- --------------- ---------- ge-2/0/1.0 811 - 16944 0 50682999 0
The packet count incremented by 15; the additional 5 packets are from the underlying protocol that is running over MPLS.
Case 2 – Statistics for IPv4 Next Hop (needs to explicitly enabled):
A loopback IP address is assigned to P2:
sco@mx-240-4-re0# run show route 172.17.0.3 logical-system marton inet.0: 19 destinations, 19 routes (18 active, 0 holddown, 1 hidden) + = Active Route, - = Last Active, * = Both 172.17.0.3/32 *[IS-IS/18] 1w6d 21:26:42, metric 1000 > to 10.3.22.2 via ge-2/0/1.0 inet.3: 6 destinations, 9 routes (3 active, 0 holddown, 5 hidden) + = Active Route, - = Last Active, * = Both 172.17.0.3/32 *[RSVP/7/1] 1w6d 21:26:24, metric 1000 > to 10.3.22.2 via ge-2/0/1.0, label-switched-path x1-TO-x2 to 10.8.22.2 via ge-2/0/0.0, label-switched-path Bypass->10.3.22.2 [LDP/9] 5d 18:45:47, metric 1000 > to 10.3.22.2 via ge-2/0/1.0, label-switched-path x1-TO-x2 to 10.8.22.2 via ge-2/0/0.0, label-switched-path x1-TO-x2 sco@mx-240-4-re0# run show route forwarding-table destination 172.17.0.3 Logical system: marton Routing table: default.inet Internet: Destination Type RtRef Next hop Type Index NhRef Netif 172.17.0.3/32 user 1 10.3.22.2 ucst 804 11 ge-2/0/1.0
By default, the output on the PFE does not display the statistics for the NHID:
NPC2(mx-240-4-re0 vty)# show nhdb id 804 statistics Nexthop Statistics: Interface NH ID Next Hop Addr Output Pkts Pkt Rate Output Bytes Byte Rate ------------ ------- --------------- ------------ -------- --------------- ---------- ge-2/0/1.0 804 10.3.22.2 0 0 0 0
After the statistics for IPv4 traffic is enabled, the packets increment:
NPC2(mx-240-4-re0 vty)# debug nhdb hw count 804 NPC2(mx-240-4-re0 vty)# show nhdb id 804 statistics Nexthop Statistics: Interface NH ID Next Hop Addr Output Pkts Pkt Rate Output Bytes Byte Rate ------------ ------- --------------- ------------ -------- --------------- ---------- ge-2/0/1.0 804 10.3.22.2 206 99 10712 5178
Disabling the hw counter for IP traffic statistics collection:
NPC2(mx-240-4-re0 vty)# undebug nhdb hw count 804 NPC2(mx-240-4-re0 vty)# show nhdb id 804 statistics Nexthop Statistics: Interface NH ID Next Hop Addr Output Pkts Pkt Rate Output Bytes Byte Rate ------------ ------- --------------- ------------ -------- --------------- ---------- ge-2/0/1.0 804 10.3.22.2 0 0 0 0