## Name

nexp-ether — Ethernet support for Network Expect

## Synopsis

PDU definition:

`ether` ( [`src`=`MAC addr`,] [`dst`=`MAC addr`,] [`proto`=`num`] )

PDU decoding:

`$ether(src)`, `$ether(dst)`, `$ether(type)`

## PDU Definition

The following parameters allow to define the different parts of an Ethernet protocol data unit (PDU) in Network Expect:

`src` = `MACADDR`

  Specifies the source MAC address. `MACADDR` is the MAC address in aa:bb:cc:dd:ee:ff format. Default: MAC address of egress interface.

`dst` = `NUMSPEC`

  Specifies the destination MAC address. `MACADDR` is the MAC address in aa:bb:cc:dd:ee:ff format.

`proto` = `NUMSPEC`

  Specifies the type of payload that the Ethernet frame is carrying. `NUMSPEC` is a numeric specification. You should only use this option if you are not specifying a higher layer protocol like ARP, IPv4 or IPv6, and want to inject a raw Ethernet payload.

## PDU Decoding

The following Tcl variables are available to Tcl scripts after any Network Expect command that reads and decodes packets has decoded a packet. Commands that read and decode packets include the expect_network family of commands as well as the pdu decode command.

$ether(src)

  The source MAC address of the received Ethernet frame.

$ether(dst)

  The destination MAC address of the received Ethernet frame.

$ether(type)

  The 16-bit `ethertype` field of the received Ethernet frame.

## send_expect Support

Network Expect Ethernet PDUs support the send_expect command.

The hash of an Ethernet PDU is the 16-bit Ethernet type, in network byte order.

A received Ethernet PDU is considered to be a response to an injected stimulus if the hash of the received Ethernet frame is the same to that of the injected stimulus and the Ethernet type is the same in both the received and injected frames.

## Examples

1. A simple Ethernet frame:

       ether(dst = 00:11:22:33:44:55, proto = 6)

2. An Ethernet frame carrying an IPv4 packet with simple options:

       ether(dst = 00:11:22:33:44:55)/ip(dst = www.netexpect.org, \
                                         options(nop, nop, nop, eol) )

## VERSION

This man page is correct for version 1.0 of Network Expect.

## SEE ALSO

nexp(1), nexp-numspec(1)

## AUTHOR

Ethernet support for Network Expect was written by Eloy Paris <peloy@netexpect.org>. The "Send and Expect" functionality of the Ethernet module was borrowed from Scapy, the packet manipulation program written in Python by Philippe Biondi.

This man page was written by Eloy Paris.