]> git.proxmox.com Git - mirror_ovs.git/blame - ofproto/ofproto-unixctl.man
ovsdb: Use column diffs for ovsdb and raft log entries.
[mirror_ovs.git] / ofproto / ofproto-unixctl.man
CommitLineData
7aa697dd
BP
1.SS "OFPROTO COMMANDS"
2These commands manage the core OpenFlow switch implementation (called
3\fBofproto\fR).
876b0e1c 4.
7aa697dd
BP
5.IP "\fBofproto/list\fR"
6Lists the names of the running ofproto instances. These are the names
7that may be used on \fBofproto/trace\fR.
876b0e1c 8.
b490b189
BP
9.IP "\fBofproto/trace\fR [\fIoptions\fR] [\fIdpname\fR] \fIodp_flow\fR [\fIpacket\fR]
10.IQ "\fBofproto/trace\fR [\fIoptions\fR] \fIbridge\fR \fIbr_flow\fR [\fIpacket\fR]]
11.IQ "\fBofproto/trace\-packet\-out\fR [\fIoptions\fR] [\fIdpname\fR] \fIodp_flow\fR [\fIpacket\fR] \fIactions\fR"
e86ec1e7 12.IQ "\fBofproto/trace\-packet\-out\fR [\fIoptions\fR] \fIbridge\fR \fIbr_flow\fR [\fIpacket\fR] \fIactions\fR"
50aa28fd 13Traces the path of an imaginary packet through \fIswitch\fR and
aee0979b
BP
14reports the path that it took. The initial treatment of the packet
15varies based on the command:
16.
17.RS
18.IP \(bu
19\fBofproto/trace\fR looks the packet up in the OpenFlow flow table, as
20if the packet had arrived on an OpenFlow port.
21.
22.IP \(bu
23\fBofproto/trace\-packet\-out\fR applies the specified OpenFlow
24\fIactions\fR, as if the packet, flow, and actions had been specified
25in an OpenFlow ``packet-out'' request.
26.RE
27.
28.IP
29The packet's headers (e.g. source and destination) and metadata
30(e.g. input port), together called its ``flow,'' are usually all that
31matter for the purpose of tracing a packet. You can specify the flow
32in the following ways:
50aa28fd 33.
7aa697dd 34.RS
50aa28fd
AW
35.IP "\fIdpname\fR \fIodp_flow\fR"
36\fIodp_flow\fR is a flow in the form printed by \fBovs\-dpctl\fR(8)'s
37\fBdump\-flows\fR command. If all of your bridges have the same type,
38which is the common case, then you can omit \fIdpname\fR, but if you
39have bridges of different types (say, both \fBovs-netdev\fR and
40\fBovs-system\fR), then you need to specify a \fIdpname\fR to disambiguate.
41.
42.IP "\fIbridge\fR \fIbr_flow\fR"
43\fIbr_flow\fR is a flow in the form similar to that accepted by
44\fBovs\-ofctl\fR(8)'s \fBadd\-flow\fR command. (This is not an
45OpenFlow flow: besides other differences, it never contains
46wildcards.) \fIbridge\fR names of the bridge through which
47\fIbr_flow\fR should be traced.
dc29f566 48.RE
50aa28fd 49.
876b0e1c 50.IP
0f2f05bb 51.RS
b490b189
BP
52These commands support the following options:
53.IP \fB\-\-generate\fR
54Generate a packet from the flow (see below for more information).
55.
6f068379
BP
56.IP "\fB\-\-l7 \fIpayload\fR"
57.IQ "\fB\-\-l7\-len \fIlength\fR"
58Accepted only with \fB\-\-generate\fR (see below for more
59information).
60.
b490b189
BP
61.IP \fB\-\-consistent\fR
62Accepted by \fBofproto\-trace\-packet\-out\fR only. With this option,
63the command rejects \fIactions\fR that are inconsistent with the
64specified packet. (An example of an inconsistency is attempting to
65strip the VLAN tag from a packet that does not have a VLAN tag.) Open
66vSwitch ignores most forms of inconsistency in OpenFlow 1.0 and
67rejects inconsistencies in later versions of OpenFlow. The option is
68necessary because the command does not ordinarily imply a particular
69OpenFlow version. One exception is that, when \fIactions\fR includes
70an action that only OpenFlow 1.1 and later supports (such as
71\fBpush_vlan\fR), \fB\-\-consistent\fR is automatically enabled.
0f2f05bb 72.
5eabc1c9 73.IP "\fB\-\-ct-next\fR \fIflags\fR"
0f2f05bb
YHW
74When the traced flow triggers conntrack actions, \fBofproto/trace\fR
75will automatically trace the forked packet processing pipeline with
76user specified ct_state. This option sets the ct_state flags that the
77conntrack module will report. The \fIflags\fR must be a comma- or
78space-separated list of the following connection tracking flags:
79.
80.RS
81.IP \(bu
82\fBtrk\fR: Include to indicate connection tracking has taken place.
83.
84.IP \(bu
85\fBnew\fR: Include to indicate a new flow.
86.
87.IP \(bu
88\fBest\fR: Include to indicate an established flow.
89.
90.IP \(bu
91\fBrel\fR: Include to indicate a related flow.
92.
93.IP \(bu
94\fBrpl\fR: Include to indicate a reply flow.
95.
96.IP \(bu
97\fBinv\fR: Include to indicate a connection entry in a bad state.
98.
99.IP \(bu
100\fBdnat\fR: Include to indicate a packet whose destination IP address has been
101changed.
102.
103.IP \(bu
104\fBsnat\fR: Include to indicate a packet whose source IP address has been
105changed.
106.
107.RE
108.
109.IP
5eabc1c9
IM
110When \fB\-\-ct-next\fR is unspecified, or when there are fewer
111\fB\-\-ct-next\fR options than ct \fIactions\fR, the \fIflags\fR default to
112\fBtrk,new\fR.
0f2f05bb
YHW
113.
114.RE
115.
116.IP
50aa28fd
AW
117Most commonly, one specifies only a flow, using one of the forms
118above, but sometimes one might need to specify an actual packet
119instead of just a flow:
120.
8b3b8dd1 121.RS
50aa28fd
AW
122.IP "Side effects."
123Some actions have side effects. For example, the \fBnormal\fR action
124can update the MAC learning table, and the \fBlearn\fR action can
aee0979b 125change OpenFlow tables. The trace commands only perform side
50aa28fd
AW
126effects when a packet is specified. If you want side effects to take
127place, then you must supply a packet.
128.
8b3b8dd1 129.IP
418a7a84
BP
130(Output actions are obviously side effects too, but
131the trace commands never execute them, even when one specifies a
132packet.)
876b0e1c 133.
50aa28fd
AW
134.IP "Incomplete information."
135Most of the time, Open vSwitch can figure out everything about the
136path of a packet using just the flow, but in some special
137circumstances it needs to look at parts of the packet that are not
138included in the flow. When this is the case, and you do not supply a
aee0979b 139packet, then a trace command will tell you it needs a packet.
876b0e1c 140.RE
50aa28fd 141.
876b0e1c 142.IP
aee0979b
BP
143If you wish to include a packet as part of a trace operation, there
144are two ways to do it:
50aa28fd
AW
145.
146.RS
b490b189 147.IP \fB\-\-generate\fR
50aa28fd
AW
148This option, added to one of the ways to specify a flow already
149described, causes Open vSwitch to internally generate a packet with
150the flow described and then to use that packet. If your goal is to
b490b189
BP
151execute side effects, then \fB\-\-generate\fR is the easiest way to do
152it, but \fB\-\-generate\fR is not a good way to fill in incomplete
50aa28fd
AW
153information, because it generates packets based on only the flow
154information, which means that the packets really do not have any more
155information than the flow.
6f068379
BP
156.IP
157By default, for protocols that allow arbitrary L7 payloads, the
158generated packet has 64 bytes of payload. Use \fB\-\-l7\-len\fR to
159change the payload length, or \fB\-\-l7\fR to specify the exact
160contents of the payload.
50aa28fd
AW
161.
162.IP \fIpacket\fR
163This form supplies an explicit \fIpacket\fR as a sequence of hex
164digits. An Ethernet frame is at least 14 bytes long, so there must be
165at least 28 hex digits. Obviously, it is inconvenient to type in the
166hex digits by hand, so the \fBovs\-pcap\fR(1) and
167\fBovs\-tcpundump\fR(1) utilities provide easier ways.
876b0e1c 168.IP
50aa28fd
AW
169With this form, packet headers are extracted directly from
170\fIpacket\fR, so the \fIodp_flow\fR or \fIbr_flow\fR should specify
171only metadata. The metadata can be:
172.RS
173.IP \fIskb_priority\fR
174Packet QoS priority.
1362e248
JG
175.IP \fIpkt_mark\fR
176Mark of the packet.
07659514
JS
177.IP \fIct_state\fR
178Connection state of the packet.
179.IP \fIct_zone\fR
180Connection tracking zone for packet.
8e53fe8c
JS
181.IP \fIct_mark\fR
182Connection mark of the packet.
9daf2348
JS
183.IP \fIct_label\fR
184Connection label of the packet.
50aa28fd
AW
185.IP \fItun_id\fR
186The tunnel ID on which the packet arrived.
187.IP \fIin_port\fR
188The port on which the packet arrived.
189.RE
aee0979b 190.RE
50aa28fd 191.
aee0979b 192.IP
50aa28fd
AW
193The in_port value is kernel datapath port number for the first format
194and OpenFlow port number for the second format. The numbering of these
195two types of port usually differs and there is no relationship.
aee0979b 196.
27e3debd
TR
197.
198.IP "Usage examples:"
199.RS 4
200.PP
201\fBTrace an unicast ICMP echo request on ingress port 1 to destination MAC
20200:00:5E:00:53:01\fR
203.RS 4
204.nf
205ofproto/trace br in_port=1,icmp,icmp_type=8,\\
206dl_dst=00:00:5E:00:53:01
207.RE
208.fi
209.PP
210\fBTrace an unicast ICMP echo reply on ingress port 1 to destination MAC
21100:00:5E:00:53:01\fR
212.RS 4
213.nf
214ofproto/trace br in_port=1,icmp,icmp_type=0,\\
215dl_dst=00:00:5E:00:53:01
216.fi
217.RE
218.PP
219\fBTrace an ARP request on ingress port 1\fR
220.RS 4
221.nf
222ofproto/trace br in_port=1,arp,arp_op=1
223.fi
224.RE
225.PP
226\fBTrace an ARP reply on ingress port 1\fR
227.RS 4
228.nf
229ofproto/trace br in_port=1,arp,arp_op=2
230.fi
231.RE
232.RE