aboutsummaryrefslogtreecommitdiff
path: root/tools/tools/ether_reflect/ether_reflect.1
blob: 704a4b0e58e3c27179f47b0706e30b13b24e8e46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" Copyright (c) 2008 George V. Neville-Neil
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 23, 2008
.Dt ether_reflect 1
.Os
.Sh NAME
.Nm ether_reflect
.Nd "reflect ethernet packets"
.Sh SYNOPSIS
.Nm
.Op Fl a Ar ethernet address
.Op Fl e Ar ethertype
.Op Fl i Ar interface
.Op Fl t Ar timeout
.Op Fl p
.Op Fl d
.Sh DESCRIPTION
The 
.Nm
command implements a simple ethernet packet reflector using the
.Xr PCAP 3
library and
.Xr bpf 4 ,
the Berkeley Packet Filter.  The program is useful primarily to test
the low level round trip time of packets through an Ethernet interface
and/or a switch.  Network protocols, such as IP, and the network stack
in general are never invoked, only the device driver that implements
the particular interface is executed.  As the
.Nm
command uses the
.Xr bpf 4
device the user must have root privileges to execute this program.
.Pp
The options are as follows:
.Bl -tag -width ".Fl d Ar argument"
.It Fl a Ar address
Instead of reversing the ethernet destination and source addresses
supply a different destination ethernet address for each packet
received.
.It Fl e Ar ether type
Use a different ethertype than the default, 0x8822, which is the IEEE
ether type for driver testing.
.It Fl i Ar interface
Network interface, which can be found with ifconfig(1).
.It Fl t Ar timeout
The time, in milliseconds, to wait for a packet.  Lower times decrease
latency at the cost of CPU.
.It Fl p
Set the device into promiscuous mode before testing.  This is not
usually necessary.
.It Fl d
Debug output.  Print various small pieces of debug information.
.El
.Sh EXAMPLES
The following is an example of a typical usage
of the
.Nm
command:
.Pp
.Dl "ether_reflect -i em0 -t 1"
.Pp
Reflect all test packets, those with an ether type of 0x8822, which
are seen on ineterface em0.  The timeout is 1 millisecond.
.Pp
.Dl "ether_reflect -i em0 -a 00:00:00:aa:bb:cc -t 1"
.Pp
Rewrite the destination address in each packet to 00:00:00:aa:bb:cc
before reflecting the packet.
.Sh SEE ALSO
.Xr ifconfig 8 ,
.Xr tcpdump 1 ,
.Xr pcap 4 ,
.Xr bpf 2 .
.Sh HISTORY
The
.Nm
program first appeared in
.Fx 8.0 .
.Sh AUTHORS
This
manual page was written by
.An George V. Neville-Neil Aq gnn@FreeBSD.org .
.Sh BUGS
Should be reported to the author or to net@freebsd.org.