diagnostic packet-generator create
To create an instance of the inbuilt traffic generator, use the command diagnostic packet-generator create in EXEC mode.
diagnostic packet-generator create traffic-generator-name { duration traffic-duration | rate packet-rate | filename packet-file | packet packet-details | traffic-class traffic-class } { ingress interface ingress-interface-name [ member bundle-member-interface ] | | egress interface egress-interface-name [ [ npu npu ] | | [ slice slice ] ] | | raw } capture location location
Syntax Description
traffic-generator-name |
Specify a name for the traffic generator instance |
duration traffic-duration |
Specify the traffic duration in seconds |
rate packet-rate |
Specify the traffic-rate in pps |
filename packet-file |
Specify the file with the packet details. The file can be a pcap file with .pcap suffix or a text file with scapy script or hex string. |
packet packet-details |
Specify the packet details directly at command-line Maximum length for packets provided at command line is 255 characters. For larger packets, use the filename packet-file option. |
traffic-class traffic-class |
Specify the traffic-class |
ingress |
Specify the traffic generator instance to inject ingress packets |
interface ingress-interface-name |
Specify the ingress interface for packet injection |
member bundle-member-interface |
If the ingress interface is a bundle-interface, specify the member interface for packet injection. If nothing is provided, one of the existing members in the target location will be selected to inject packets. |
egress |
Specify the traffic generator instance to inject egress packets |
interface egress-interface-name |
Specify the egress interface for packet injection |
npu npu |
Specify the npu from which the packet will be injected. Default value: 0 |
slice slice |
Specify the slice from which the packet will be injected. Default value: 0 |
raw |
Specify the traffic generator instance to inject raw packets |
capture |
Enable packet capture |
location location |
Specify the slot location where you will create the traffic generator instance |
Command Default
While creating an ingress traffic generator instance, if you did not specify the ethernet header of the packet to be injected, the software will generate a default ethernet header with the following source and destination MAC addresses:
-
A default source MAC address of 00:00:00:00:00:01.
-
The MAC address of the ingress interface as the destination MAC address.
If you provided a subinterface as the ingress interface, the software will include the VLAN header after the ethernet header.
Command Modes
XR EXEC modeCommand History
Release | Modification |
---|---|
Release 24.2.11 |
This command was introduced. |
Usage Guidelines
Caution |
Don’t run the inbuilt traffic generator on a live network unless you are fully aware of the impact of packets injected. Injecting packets into a live network may result in network outages. |
Caution |
Raw traffic generator mode should be executed only by Cisco engineers. Improper use of raw mode could cause unexpected behavior, such as NPU lock-up. |
Task ID
Task ID | Operation |
---|---|
diag |
execute |
root-system |
execute |
root-lr |
execute |
cisco-support |
read, execute |
Example
The following example shows how to create a traffic generator instance in ingress mode:
Router# diagnostic packet-generator create t1 rate 100 duration 60 packet IP(src="32.0.0.1",dst="22.0.0.1",ttl=64)/UDP()/Raw(load="a"*100) ingress interface FourHundredGigE0/0/0/1 capture location 0/RP0/CPU0
OK
The following example shows how to create a traffic generator instance in egress mode:
Router# diagnostic packet-generator create t1 rate 100 duration 60 packet Ether(src="A:B:C:D:E:F",dst="1:2:3:4:5:6")/IP(src="32.0.0.1",dst="109.0.0.101",ttl=64)/Raw(load="f"*100) egress interface fourHundredGigE0/0/0/0 capture location 0/RP0/CPU0
OK