Skip to main content
Version: 7.26

packet-template


tool/traffic-generator/packet-template​

Type: Directory
Builds the packet content of a stream from header parameters: MAC, VLAN, IPv4/IPv6, UDP and TCP fields, plus the payload. Many header values are assumed when they can be derived; assumed values are read-only and are re-derived when the template is edited. See the Traffic Generator guide.

ArgumentTypeDescription
namestringDescriptive name of the packet template.
header-stackmulti { header: enum (mac | vlan | ip | udp | raw | ipv6 | tcp) { mac:1, vlan:2, ip:3, udp:4, raw:5, ipv6:6, tcp:7 } }Sequence of headers in the generated packet: mac (Ethernet, 14 bytes), vlan (802.1Q tag, 4 bytes), ip (IPv4, 20 bytes), udp (UDP, 8 bytes), raw (arbitrary bytes as a hex string), ipv6 (IPv6, 40 bytes), tcp (TCP). Most header types may appear several times; there can be at most two IP headers and one UDP header per packet. Sequence limitations follow protocol rules (for example a VLAN header can follow only a mac header or another VLAN header).
portenumName of the port (from the port menu) the packets are sent out through. Mutually exclusive with interface; the port can also be set in the stream.
interfaceiface_enumInterface the packets are sent out through. Mutually exclusive with port; convenient for quick tests since a port entry is then created dynamically.
mac-srcmulti { array-id, array-id, mac-mask: composite { mac: macAddr , mask: [ macAddr] } }Source MAC address(es), with optional masks, of the Ethernet header.
mac-dstmulti { array-id, array-id, mac-mask: composite { mac: macAddr , mask: [ macAddr] } }Destination MAC address(es), with optional masks, of the Ethernet header.
mac-protocolmulti { protocol: alt { protocol-name: enum () , protocol-number: num [ .. 65535] } }EtherType of the Ethernet frame, by name or by protocol number (0-65535).
vlan-prioritymulti { priority: num [ .. 7] }VLAN priority (0-7) of the 802.1Q tag.
vlan-idmulti { id: num [ .. 4095] }VLAN ID (0-4095) of the 802.1Q tag.
vlan-protocolmulti { protocol: alt { protocol-name: enum () , protocol-number: num [ .. 65535] } }VLAN protocol, by name or by EtherType number (0-65535).
ip-dscpmulti { dscp: num [ .. 255] }DS Field value(s) (0-255) of the IPv4 header (DS Field holds the DSCP and ECN values).
ip-idmulti { id: num [ .. 65535] }IPv4 identification value(s) (0-65535).
ip-frag-offmulti { frag-off: num [ .. 65535] }IPv4 fragmentation offset(s) (0-65535).
ip-ttlmulti { ttl: num [ .. 255] }IPv4 time-to-live value(s) (0-255).
ip-srcmulti { array-id, array-id, ip-range: ipRange }Source IPv4 address(es), with optional masks, of the IPv4 header.
ip-dstmulti { array-id, array-id, ip-range: ipRange }Destination IPv4 address(es), with optional masks, of the IPv4 header.
ip-protocolmulti { protocol-name: enum () }IPv4 protocol, for example tcp, udp or icmp.
ip-gatewayipAddrNext-hop IPv4 address. When the sender and the receiver are the same device the next hop cannot be derived from ip-dst; when ip-gateway is set, the destination MAC is assumed from the resolved gateway.
udp-src-portmulti { array-id, array-id, port-range: range [ .. 65535] }UDP source port(s) or port range(s) (0-65535).
udp-dst-portmulti { array-id, array-id, port-range: range [ .. 65535] }UDP destination port(s) or port range(s) (0-65535).
udp-checksummulti { array-id, checksum: num [ .. 65535] }UDP checksum value(s) (0-65535).
raw-headermulti { raw-header: string }Raw header bytes as a hexadecimal string.
ipv6-srcmulti { array-id, array-id, ipv6-mask: ip6Prefix }Source IPv6 address(es), with optional masks, of the IPv6 header.
ipv6-dstmulti { array-id, array-id, ipv6-mask: ip6Prefix }Destination IPv6 address(es), with optional masks, of the IPv6 header.
ipv6-next-headermulti { protocol: enum () }IPv6 Next Header protocol.
ipv6-gatewayip6AddrNext-hop IPv6 address; the destination MAC is assumed from the resolved gateway.
ipv6-traffic-classmulti { traffic-class: num [ .. 255] }IPv6 traffic class value(s) (0-255).
ipv6-flow-labelmulti { flow-label: num [ .. 0xfffff] }IPv6 flow label value(s) (0-1048575).
ipv6-hop-limitmulti { hop-limit: num [ .. 255] }IPv6 hop limit value(s) (0-255).
tcp-src-portmulti { array-id, array-id, port-range: range [ .. 65535] }TCP source port(s) or port range(s) (0-65535).
tcp-dst-portmulti { array-id, array-id, port-range: range [ .. 65535] }TCP destination port(s) or port range(s) (0-65535).
tcp-synmulti { array-id, array-id, syn-range: range }TCP sequence number value(s), can be a range.
tcp-ackmulti { array-id, array-id, ack-range: range }TCP acknowledgement number value(s), can be a range.
tcp-data-offsetmulti { data-offset: num [ .. 15] }TCP data offset (0-15, in 32-bit words).
tcp-flagsmulti { flags: ubit (fin, syn, rst, psh, ack, urg, ece, cwr, ns, res0, res1, res2) }TCP flag bits to set: fin, syn, rst, psh, ack, urg, ece, cwr, ns, res0, res1, res2.
tcp-window-sizemulti { window-size: num [ .. 65535] }TCP window size value(s) (0-65535).
tcp-urgent-pointermulti { urgent-pointer: num [ .. 65535] }TCP urgent pointer value(s) (0-65535).
dataenum (uninitialized | random | specific-byte | incrementing) { uninitialized:0, random:1, specific-byte:2, incrementing:3 }How the packet payload (after the header) is filled: uninitialized (not zeroed; fastest), specific-byte (with data-byte), incrementing (bytes 00 01 02 ...), random (random bytes; slowest).
data-bytenumByte used to fill the payload when data=specific-byte.
random-byte-offsets-and-masksmulti { array-id, array-id, offset-and-mask: composite { offset: num [ .. 256] , mask: num [ .. 255] } }Byte offsets in the packet, each with a bit mask, that are filled with random values.
random-rangesobject { random-range: super { offset: num [ .. 256] , [width] :enum (8 | 16 | 32) { 8:8, 16:16, 32:32 } , [range] :range } }Fields at given byte offsets that are filled with random values: width sets the field size (8, 16 or 32 bits) and range the range of the values.
boolWhether a special footer is appended to the generated packets.
compute-checksum-from-offsetnumByte offset from which the 2-byte checksum is calculated; for example 14 skips the Ethernet header. no-checksum disables the checksum.
Read-only ArgumentTypeDescription
assumed-portenum (none) { none:0xffffffff }Assumed port the packets are sent out through, derived when only an interface is set.
assumed-interfaceiface_enumAssumed interface the packets are sent out through.
assumed-mac-srcmulti { mac: macAddr }Assumed source MAC address (the MAC address of the interface).
assumed-mac-dstmulti { mac: macAddr }Assumed destination MAC address, derived from ip-dst or from resolving ip-gateway.
assumed-mac-protocolmulti { protocol: alt { protocol-name: enum () , protocol-number: num } }Assumed EtherType, derived from the header stack (for example ip).
assumed-vlan-prioritymulti { priority: num }Assumed VLAN priority of the 802.1Q tag.
assumed-vlan-idmulti { priority: num }Assumed VLAN ID of the 802.1Q tag.
assumed-vlan-protocolmulti { protocol: alt { protocol-name: enum () , protocol-number: num } }Assumed VLAN protocol of the 802.1Q tag.
assumed-ip-dscpmulti { dscp: num }Assumed IPv4 DS Field value.
assumed-ip-idmulti { id: num }Assumed IPv4 identification value.
assumed-ip-frag-offmulti { frag-off: num }Assumed IPv4 fragmentation offset.
assumed-ip-ttlmulti { ttl: num }Assumed IPv4 time-to-live value (for example 64).
assumed-ip-srcmulti { assumed-ip-src: ipAddr }Assumed source IPv4 address (an address of the interface).
assumed-ip-dstmulti { assumed-ip-dst: ipAddr }Assumed destination IPv4 address.
assumed-ip-protocolmulti { ip-protocol: enum () }Assumed IPv4 protocol, derived from the header stack (for example udp).
assumed-udp-src-portmulti { port: num }Assumed UDP source port.
assumed-udp-dst-portmulti { port: num }Assumed UDP destination port.
assumed-udp-checksummulti { checksum: num }Assumed UDP checksum value.
assumed-raw-headermulti { assumed-raw-header: string }Assumed raw header bytes, as a hexadecimal string.
assumed-ipv6-srcmulti { ip: ip6Addr }Assumed source IPv6 address (an address of the interface).
assumed-ipv6-dstmulti { ip: ip6Addr }Assumed destination IPv6 address.
assumed-ipv6-next-headermulti { ip-protocol: enum () }Assumed IPv6 Next Header protocol.
assumed-ipv6-traffic-classmulti { traffic-class: num }Assumed IPv6 traffic class value.
assumed-ipv6-flow-labelmulti { flow-label: num }Assumed IPv6 flow label value.
assumed-ipv6-hop-limitmulti { hop-limit: num }Assumed IPv6 hop limit value.
assumed-tcp-src-portmulti { port: num }Assumed TCP source port.
assumed-tcp-dst-portmulti { port: num }Assumed TCP destination port.
assumed-tcp-synmulti { syn: num }Assumed TCP sequence number.
assumed-tcp-ackmulti { ack: num }Assumed TCP acknowledgement number.
assumed-tcp-data-offsetmulti { data-offset: num }Assumed TCP data offset.
assumed-tcp-flagsmulti { flags: num }Assumed TCP flags.
assumed-tcp-window-sizemulti { window-size: num }Assumed TCP window size.
assumed-tcp-urgent-pointermulti { urgent-pointer: num }Assumed TCP urgent pointer value.