1e39eeac7SGeorge V. Neville-Neil.\" Copyright (c) 2008 George V. Neville-Neil
2e39eeac7SGeorge V. Neville-Neil.\" All rights reserved.
3e39eeac7SGeorge V. Neville-Neil.\"
4e39eeac7SGeorge V. Neville-Neil.\" Redistribution and use in source and binary forms, with or without
5e39eeac7SGeorge V. Neville-Neil.\" modification, are permitted provided that the following conditions
6e39eeac7SGeorge V. Neville-Neil.\" are met:
7e39eeac7SGeorge V. Neville-Neil.\" 1. Redistributions of source code must retain the above copyright
8e39eeac7SGeorge V. Neville-Neil.\"    notice, this list of conditions and the following disclaimer.
9e39eeac7SGeorge V. Neville-Neil.\" 2. Redistributions in binary form must reproduce the above copyright
10e39eeac7SGeorge V. Neville-Neil.\"    notice, this list of conditions and the following disclaimer in the
11e39eeac7SGeorge V. Neville-Neil.\"    documentation and/or other materials provided with the distribution.
12e39eeac7SGeorge V. Neville-Neil.\"
13e39eeac7SGeorge V. Neville-Neil.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14e39eeac7SGeorge V. Neville-Neil.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e39eeac7SGeorge V. Neville-Neil.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e39eeac7SGeorge V. Neville-Neil.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17e39eeac7SGeorge V. Neville-Neil.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e39eeac7SGeorge V. Neville-Neil.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e39eeac7SGeorge V. Neville-Neil.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e39eeac7SGeorge V. Neville-Neil.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e39eeac7SGeorge V. Neville-Neil.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e39eeac7SGeorge V. Neville-Neil.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e39eeac7SGeorge V. Neville-Neil.\" SUCH DAMAGE.
24e39eeac7SGeorge V. Neville-Neil.\"
25e39eeac7SGeorge V. Neville-Neil.Dd December 23, 2008
26a6d11f71SRuslan Ermilov.Dt ETHER_REFLECT 1
27e39eeac7SGeorge V. Neville-Neil.Os
28e39eeac7SGeorge V. Neville-Neil.Sh NAME
29e39eeac7SGeorge V. Neville-Neil.Nm ether_reflect
30e39eeac7SGeorge V. Neville-Neil.Nd "reflect ethernet packets"
31e39eeac7SGeorge V. Neville-Neil.Sh SYNOPSIS
32e39eeac7SGeorge V. Neville-Neil.Nm
33e39eeac7SGeorge V. Neville-Neil.Op Fl a Ar ethernet address
34e39eeac7SGeorge V. Neville-Neil.Op Fl e Ar ethertype
35e39eeac7SGeorge V. Neville-Neil.Op Fl i Ar interface
36e39eeac7SGeorge V. Neville-Neil.Op Fl t Ar timeout
37e39eeac7SGeorge V. Neville-Neil.Op Fl p
38e39eeac7SGeorge V. Neville-Neil.Op Fl d
39e39eeac7SGeorge V. Neville-Neil.Sh DESCRIPTION
40e39eeac7SGeorge V. Neville-NeilThe
41e39eeac7SGeorge V. Neville-Neil.Nm
42e39eeac7SGeorge V. Neville-Neilcommand implements a simple ethernet packet reflector using the
4314e3d324SJens Schweikhardt.Xr pcap 3
44e39eeac7SGeorge V. Neville-Neillibrary and
45e39eeac7SGeorge V. Neville-Neil.Xr bpf 4 ,
46812b0903SGordon Berglingthe Berkeley Packet Filter.
47812b0903SGordon BerglingThe program is useful primarily to test the low level round trip time
48812b0903SGordon Berglingof packets through an Ethernet interface and/or a switch.
49812b0903SGordon BerglingNetwork protocols, such as IP, and the network stack in general are never
50812b0903SGordon Berglinginvoked, only the device driver that implements the particular interface
51812b0903SGordon Berglingis executed.
52812b0903SGordon BerglingAs the
53e39eeac7SGeorge V. Neville-Neil.Nm
54e39eeac7SGeorge V. Neville-Neilcommand uses the
55e39eeac7SGeorge V. Neville-Neil.Xr bpf 4
56e39eeac7SGeorge V. Neville-Neildevice the user must have root privileges to execute this program.
57e39eeac7SGeorge V. Neville-Neil.Pp
58e39eeac7SGeorge V. Neville-NeilThe options are as follows:
59e39eeac7SGeorge V. Neville-Neil.Bl -tag -width ".Fl d Ar argument"
60e39eeac7SGeorge V. Neville-Neil.It Fl a Ar address
61e39eeac7SGeorge V. Neville-NeilInstead of reversing the ethernet destination and source addresses
62e39eeac7SGeorge V. Neville-Neilsupply a different destination ethernet address for each packet
63e39eeac7SGeorge V. Neville-Neilreceived.
64e39eeac7SGeorge V. Neville-Neil.It Fl e Ar ether type
65e39eeac7SGeorge V. Neville-NeilUse a different ethertype than the default, 0x8822, which is the IEEE
66e39eeac7SGeorge V. Neville-Neilether type for driver testing.
67e39eeac7SGeorge V. Neville-Neil.It Fl i Ar interface
68e39eeac7SGeorge V. Neville-NeilNetwork interface, which can be found with ifconfig(1).
69e39eeac7SGeorge V. Neville-Neil.It Fl t Ar timeout
70812b0903SGordon BerglingThe time, in milliseconds, to wait for a packet.
71812b0903SGordon BerglingLower times decrease latency at the cost of CPU.
72e39eeac7SGeorge V. Neville-Neil.It Fl p
73812b0903SGordon BerglingSet the device into promiscuous mode before testing.
74812b0903SGordon BerglingThis is not usually necessary.
75e39eeac7SGeorge V. Neville-Neil.It Fl d
76812b0903SGordon BerglingDebug output.
77812b0903SGordon BerglingPrint various small pieces of debug information.
78e39eeac7SGeorge V. Neville-Neil.El
79e39eeac7SGeorge V. Neville-Neil.Sh EXAMPLES
80e39eeac7SGeorge V. Neville-NeilThe following is an example of a typical usage
81e39eeac7SGeorge V. Neville-Neilof the
82e39eeac7SGeorge V. Neville-Neil.Nm
83e39eeac7SGeorge V. Neville-Neilcommand:
84e39eeac7SGeorge V. Neville-Neil.Pp
85e39eeac7SGeorge V. Neville-Neil.Dl "ether_reflect -i em0 -t 1"
86e39eeac7SGeorge V. Neville-Neil.Pp
87e39eeac7SGeorge V. Neville-NeilReflect all test packets, those with an ether type of 0x8822, which
88812b0903SGordon Berglingare seen on ineterface em0.
89812b0903SGordon BerglingThe timeout is 1 millisecond.
90e39eeac7SGeorge V. Neville-Neil.Pp
91e39eeac7SGeorge V. Neville-Neil.Dl "ether_reflect -i em0 -a 00:00:00:aa:bb:cc -t 1"
92e39eeac7SGeorge V. Neville-Neil.Pp
93e39eeac7SGeorge V. Neville-NeilRewrite the destination address in each packet to 00:00:00:aa:bb:cc
94e39eeac7SGeorge V. Neville-Neilbefore reflecting the packet.
95e39eeac7SGeorge V. Neville-Neil.Sh SEE ALSO
96e39eeac7SGeorge V. Neville-Neil.Xr tcpdump 1 ,
9791dba0daSJens Schweikhardt.Xr bpf 4 ,
9891dba0daSJens Schweikhardt.Xr pcap 3 ,
99068b48d6SJoel Dahl.Xr ifconfig 8
100e39eeac7SGeorge V. Neville-Neil.Sh HISTORY
101e39eeac7SGeorge V. Neville-NeilThe
102e39eeac7SGeorge V. Neville-Neil.Nm
103e39eeac7SGeorge V. Neville-Neilprogram first appeared in
104e39eeac7SGeorge V. Neville-Neil.Fx 8.0 .
105e39eeac7SGeorge V. Neville-Neil.Sh AUTHORS
106e39eeac7SGeorge V. Neville-NeilThis
107e39eeac7SGeorge V. Neville-Neilmanual page was written by
108bd0891ceSBaptiste Daroussin.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org .
109e39eeac7SGeorge V. Neville-Neil.Sh BUGS
110bd0891ceSBaptiste DaroussinShould be reported to the author or to
111bd0891ceSBaptiste Daroussin.Aq Mt net@FreeBSD.org .
112