Cisco 8000 Packet Generator
Introduction
This article aims to document Cisco 8000 and Silicon One packet generator functionality introduced in IOS XR 24.2.11. The built-in packet generator can be used for troubleshooting purposes or to perform network diagnostics without the need of external traffic generator.
Implementation
Cisco 8000 Packet Generator leverages Silicon One ASIC NPU Host. This component is typically used for OAM features (TWAMP, SRv6 IPM, BFD, CFM etc.). NPU host is built with its own Network Processor Engine (NPE) and can access all NPU slices.
It provides true hardware assisted packet generation without involving device CPU. Performance are the following:
- It supports a rate of 13.7 Mpps and a maximum bandwidth of 66.4 Gbps per NPU
- On Silicon One Q100 and Q200, maximum supported packet size is 608B
- On Silicon One K100 nd P100, maximum supported packet size is 4000B
Configuration and Verification
The CCO configuration and command reference guides list the multiple options available and how to configure them. For this article demo, a simple unidirectional traffic flow is generated using IPv6 traffic for an infinite period of time at a rate of 100 pps.
The CLI prompts provides several examples:
RP/0/RP0/CPU0:8000#diagnostic packet-generator create P2P rate 100 duration infinite packet ?
packet General:
Packet can be a hex string or scapy script. If provided as a hex string, ensure it is a valid byte string (even length, in hexadecimal).
Packet provided to CLI cannot go over 255 characters, for longer packets please use the "file" option.
ingress:
If user packet doesn't have Ether header, it's added with src mac 00:00:00:00:00:01, dst
mac as the ingress interface mac (not supported if packet is in hex format).
Note: the packet must be injected from the LC where the interface resides.
Example 1 - inject IPv6 packets
diagnostic packet-generator create T1 packet IPv6(src="sip",dst="dip",hlim=64)/Raw(load="f"*200) ingress interface BE115.15 location 0/0/CPU0
egress:
Example 2 - Send packets from Hu0/0/0/10
diagnostic packet-generator create T2 packet Ether(src="smac",dst="dmac")/IP(src="sip",dst="dip",ttl=64)/Raw(load="f"*200) egress interface HundredGigE0/0/0/10 lo
cation 0/RP0/CPU0
First, the packet must be created/forged and following information are entered:
- SRC and DST MAC
- SRC and DST IPv6
- Payload is raw 900 x ‘f’
- Rate is 100 pps
- Egress interface is HundredGigE0/0/0/17
- Egress mode: skips RxPP lookups and TxPP encaps, sends the packet as-it-is on egress slice and interface
- Injected from a fixed system (i.e single NPU, location 0/RP0/CPU0)
Scapy expression is used to forge/build the packet. If the packet description is too complex (i.e too many parameters to enter inside the CLI), user must instead use a file (pcap file with .pcap suffix or a text file with scapy script or hex string).
diagnostic packet-generator create P2P rate 100 duration infinite packet Ether(src="a0:bc:6f:75:2e:14",dst="40:06:d5:05:28:60")/IPv6(src="2001:db8:1337:2604::26",dst="2001:db8:1337:2604::04",hlim=64)/Raw(load="f"*900) egress interface HundredGigE0/0/0/17 location 0/rp0/CPU0
Fri May 16 07:16:22.347 PDT
OK
RP/0/RP0/CPU0:8000#
System returns ‘OK’ if the Scapy expression is correct. If not, an error is returned (Invalid Scapy expression) and syntax must be corrected.
After configuration, the flow can be verified:
RP/0/RP0/CPU0:8000#sh diagnostic packet-generator status P2P location 0/RP0/CPU0
Fri May 16 07:19:10.925 PDT
0/RP0/CPU0:
Name Run_State Type Capture Set_Rate(pps) Applied_Rate(pps) Duration(sec) TC Phy_Interface NPU Slice IFG Packets Bytes
================================================================================================================================================================
P2P Stopped Egress False 100 100 Infinite 0 Hu0/0/0/17 0 0 0 0 0
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Packet Details:
###[ Ethernet ]###
dst = 40:06:d5:05:28:60
src = a0:bc:6f:75:2e:14
type = IPv6
###[ IPv6 ]###
version = 6
tc = 0
fl = 0
plen = 900
nh = No Next Header
hlim = 64
src = 2001:db8:1337:2604::26
dst = 2001:db8:1337:2604::4
###[ Raw ]###
load = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
RP/0/RP0/CPU0:8000#
Then it can be started:
RP/0/RP0/CPU0:8000#diagnostic packet-generator start P2P location 0/RP0/CPU0
Fri May 16 07:20:34.230 PDT
OK
Verification is done again: the flow is running and number of packets and bytes increase:
RP/0/RP0/CPU0:8000#sh diagnostic packet-generator status P2P location 0/RP0/CPU0
Fri May 16 07:20:55.812 PDT
0/RP0/CPU0:
Name Run_State Type Capture Set_Rate(pps) Applied_Rate(pps) Duration(sec) TC Phy_Interface NPU Slice IFG Packets Bytes
================================================================================================================================================================
P2P Running Egress False 100 100 Infinite 0 Hu0/0/0/17 0 0 0 2256 2240208
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Packet Details:
###[ Ethernet ]###
dst = 40:06:d5:05:28:60
src = a0:bc:6f:75:2e:14
type = IPv6
###[ IPv6 ]###
version = 6
tc = 0
fl = 0
plen = 900
nh = No Next Header
hlim = 64
src = 2001:db8:1337:2604::26
dst = 2001:db8:1337:2604::4
###[ Raw ]###
load = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
RP/0/RP0/CPU0:8000#
Moreover, by checking interface statistics, it can observed packets are leaving the interface at the expected rate of 100 pps:
RP/0/RP0/CPU0:8000#sh int Hu0/0/0/17
Fri May 16 07:23:58.312 PDT
HundredGigE0/0/0/17 is up, line protocol is up
Interface state transitions: 9
Hardware is HundredGigE, address is a0bc.6f75.2e14 (bia a0bc.6f75.2e14)
Description: to T9
Internet address is Unknown
MTU 9200 bytes, BW 100000000 Kbit (Max: 100000000 Kbit)
reliability 255/255, txload 0/255, rxload 0/255
Encapsulation ARPA,
Full-duplex, 100000Mb/s, 100GBASE-SR-BD, link type is force-up
output flow control is off, input flow control is off
Carrier delay (up) is 200 msec
loopback not set,
Last link flapped 04:58:48
Last input 00:00:00, output 00:00:00
Last clearing of "show interface" counters never
30 second input rate 30000 bits/sec, 33 packets/sec
30 second output rate 771000 bits/sec, 106 packets/sec
1519550 packets input, 171035060 bytes, 0 total input drops
0 drops for unrecognized upper-level protocol
Received 0 broadcast packets, 1155054 multicast packets
0 runts, 0 giants, 0 throttles, 0 parity
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
460366 packets output, 208884462 bytes, 0 total output drops
Output 0 broadcast packets, 31144 multicast packets
0 output errors, 0 underruns, 0 applique, 0 resets
0 output buffer failures, 0 output buffers swapped out
9 carrier transitions
If a parameter must be changed (e.g rate), the flow must be deleted and created again:
RP/0/RP0/CPU0:8000#diagnostic packet-generator create P2P rate max duration infinite packet Ether(src="a0:bc:6f:75:2e:14",dst="40:06:d5:05:28:60")/IPv6(src="2001:db8:1337:2604::26",dst="2$
Fri May 16 07:24:51.154 PDT
Operation failed, packet generator already exists.
Here, asking the system to generate as much as traffic as possible (rate max):
diagnostic packet-generator create P2P rate max duration infinite packet Ether(src="a0:bc:6f:75:2e:14",dst="40:06:d5:05:28:60")/IPv6(src="2001:db8:1337:2604::26",dst="2001:db8:1337:2604::04",hlim=64)/Raw(load="f"*900) egress interface HundredGigE0/0/0/17 location 0/rp0/CPU0
RP/0/RP0/CPU0:8000#sh diagnostic packet-generator status P2P location 0/RP0/CPU0
Fri May 16 07:27:27.385 PDT
0/RP0/CPU0:
Name Run_State Type Capture Set_Rate(pps) Applied_Rate(pps) Duration(sec) TC Phy_Interface NPU Slice IFG Packets Bytes
================================================================================================================================================================
P2P Running Egress False Max 12292793 Infinite 0 Hu0/0/0/17 0 0 0 106890310 106142077830
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Packet Details:
###[ Ethernet ]###
dst = 40:06:d5:05:28:60
src = a0:bc:6f:75:2e:14
type = IPv6
###[ IPv6 ]###
version = 6
tc = 0
fl = 0
plen = 900
nh = No Next Header
hlim = 64
src = 2001:db8:1337:2604::26
dst = 2001:db8:1337:2604::4
###[ Raw ]###
load = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
RP/0/RP0/CPU0:8000#
Note: At this time there is no YANG model available to configure or monitor packet generator feature.
Conclusion & Use cases
This feature has been recently used inside one customer network during Early Field Trial. This customer was testing 800G ZR+ optics and wanted to validate the long-distance link between 2 x Cisco 8000 routers. It was not possible to reroute customer traffic nor interconnecting a regular traffic generator. Cisco 8000 embedded traffic generator functionality was leveraged to validate correct long distance transmission across the 2 endpoints. Other customers are using this feature during their provisionning routine to validate massive ECMP fabrics and make sure all links are error-free before going into production. Another use case is to craft specific packets to test Segment Routing policies. Unlimited possibilities!
Leave a Comment