5 Other Features
bandwidth is computed using the full physical layer packet, and includes preamble/SFD/padding/FCS in
the byte count.
Use ”
help inject
” to list all parameters.
Using the command may drop packets coming from the opposite source port. The injection logic will wait
until transmission is turned off, then it will inject the packet, and fully drop any other packets from the
opposite port.
Example
# Inject a packet that starts with a AB:CD:12:34:56 dest. MAC,
# the rest of the packet filled with 0s, on port A (into the
# stream of traffic flowing from B to A):
inject A ABCD123456
See
help
output for advanced parameters that control repeating, raw output (your own preamble), and
so on.
5.11 Blocking Ports
The
block_ports
command blocks all traffic through the device in a specific direction:
Command
Effect
block_ports A
Block traffic from B→A, unblock A→B
block_ports B
Block traffic from A→B, unblock B→A
block_ports AB
Block all traffic
block_ports none
Unblock all traffic
This command uses the same hardware logic as the
disrupt
command (basically it’s just a simpler version
of the same command). Using either resets the state set by the other command.
5.12 Packet Disruption
The
disrupt
command can be used to drop or to destroy some or all packets in a certain direction. This
is a form of error injection suited for testing reliability of low level protocols. It can either flip a single bit
in a packet at a user-chosen byte offset, or discard entire packets.
(Restriction: cannot drop specific packet according to filter-like matching criteria etc.)
Use
disrupt_stop
to disable disruption again. Use
hw_info
to check whether it’s currently enabled.
Example
# Disrupt a number of packets for a short time:
# B
on port B (traffic flowing from A to B)
# --mode drop
just drop the packets (instead of creating CRC errors)
# --num 20
drop 20 packets in total
# --skip 10
drop only every 10th packet (this makes it active for ~200 packets)
disrupt B --mode drop --num 20 --skip 10
(The syntax changed in host tool v1.2.)
24