]> git.proxmox.com Git - mirror_ovs.git/blame - ofproto/ofproto-unixctl.man
dpif-netdev: Calculate rxq cycles prior to compare_rxq_cycles calls.
[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.
0f2f05bb
YHW
9.IP "\fBofproto/trace\fR [\fIdpname\fR] \fIodp_flow\fR [\fIOPTIONS\fR] [\fB\-generate \fR| \fIpacket\fR]"
10.IQ "\fBofproto/trace\fR \fIbridge\fR \fIbr_flow\fR [\fIOPTIONS\fR] [\fB\-generate \fR| \fIpacket\fR]"
11.IQ "\fBofproto/trace\-packet\-out\fR [\fB\-consistent\fR] [\fIdpname\fR] \fIodp_flow\fR [\fIOPTIONS\fR] [\fB\-generate \fR| \fIpacket\fR] \fIactions\fR"
12.IQ "\fBofproto/trace\-packet\-out\fR [\fB\-consistent\fR] \fIbridge\fR \fIbr_flow\fR [\fIOPTIONS\fR] [\fB\-generate \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
YHW
51.RS
52\fBofproto/trace\fR supports the following options:
53.
54.IP "--ct-next \fIflags\fR"
55When the traced flow triggers conntrack actions, \fBofproto/trace\fR
56will automatically trace the forked packet processing pipeline with
57user specified ct_state. This option sets the ct_state flags that the
58conntrack module will report. The \fIflags\fR must be a comma- or
59space-separated list of the following connection tracking flags:
60.
61.RS
62.IP \(bu
63\fBtrk\fR: Include to indicate connection tracking has taken place.
64.
65.IP \(bu
66\fBnew\fR: Include to indicate a new flow.
67.
68.IP \(bu
69\fBest\fR: Include to indicate an established flow.
70.
71.IP \(bu
72\fBrel\fR: Include to indicate a related flow.
73.
74.IP \(bu
75\fBrpl\fR: Include to indicate a reply flow.
76.
77.IP \(bu
78\fBinv\fR: Include to indicate a connection entry in a bad state.
79.
80.IP \(bu
81\fBdnat\fR: Include to indicate a packet whose destination IP address has been
82changed.
83.
84.IP \(bu
85\fBsnat\fR: Include to indicate a packet whose source IP address has been
86changed.
87.
88.RE
89.
90.IP
91When --ct-next is unspecified, or when there are fewer --ct-next options than
92ct actions, the \fIflags\fR default to trk,new.
93.
94.RE
95.
96.IP
50aa28fd
AW
97Most commonly, one specifies only a flow, using one of the forms
98above, but sometimes one might need to specify an actual packet
99instead of just a flow:
100.
8b3b8dd1 101.RS
50aa28fd
AW
102.IP "Side effects."
103Some actions have side effects. For example, the \fBnormal\fR action
104can update the MAC learning table, and the \fBlearn\fR action can
aee0979b 105change OpenFlow tables. The trace commands only perform side
50aa28fd
AW
106effects when a packet is specified. If you want side effects to take
107place, then you must supply a packet.
108.
8b3b8dd1 109.IP
50aa28fd 110(Output actions are obviously side effects too, but
aee0979b 111the trace commands never execute them, even when one specifies a
50aa28fd 112packet.)
876b0e1c 113.
50aa28fd
AW
114.IP "Incomplete information."
115Most of the time, Open vSwitch can figure out everything about the
116path of a packet using just the flow, but in some special
117circumstances it needs to look at parts of the packet that are not
118included in the flow. When this is the case, and you do not supply a
aee0979b 119packet, then a trace command will tell you it needs a packet.
876b0e1c 120.RE
50aa28fd 121.
876b0e1c 122.IP
aee0979b
BP
123If you wish to include a packet as part of a trace operation, there
124are two ways to do it:
50aa28fd
AW
125.
126.RS
127.IP \fB\-generate\fR
128This option, added to one of the ways to specify a flow already
129described, causes Open vSwitch to internally generate a packet with
130the flow described and then to use that packet. If your goal is to
131execute side effects, then \fB\-generate\fR is the easiest way to do
132it, but \fB\-generate\fR is not a good way to fill in incomplete
133information, because it generates packets based on only the flow
134information, which means that the packets really do not have any more
135information than the flow.
136.
137.IP \fIpacket\fR
138This form supplies an explicit \fIpacket\fR as a sequence of hex
139digits. An Ethernet frame is at least 14 bytes long, so there must be
140at least 28 hex digits. Obviously, it is inconvenient to type in the
141hex digits by hand, so the \fBovs\-pcap\fR(1) and
142\fBovs\-tcpundump\fR(1) utilities provide easier ways.
876b0e1c 143.IP
50aa28fd
AW
144With this form, packet headers are extracted directly from
145\fIpacket\fR, so the \fIodp_flow\fR or \fIbr_flow\fR should specify
146only metadata. The metadata can be:
147.RS
148.IP \fIskb_priority\fR
149Packet QoS priority.
1362e248
JG
150.IP \fIpkt_mark\fR
151Mark of the packet.
07659514
JS
152.IP \fIct_state\fR
153Connection state of the packet.
154.IP \fIct_zone\fR
155Connection tracking zone for packet.
8e53fe8c
JS
156.IP \fIct_mark\fR
157Connection mark of the packet.
9daf2348
JS
158.IP \fIct_label\fR
159Connection label of the packet.
50aa28fd
AW
160.IP \fItun_id\fR
161The tunnel ID on which the packet arrived.
162.IP \fIin_port\fR
163The port on which the packet arrived.
164.RE
aee0979b 165.RE
50aa28fd 166.
aee0979b 167.IP
50aa28fd
AW
168The in_port value is kernel datapath port number for the first format
169and OpenFlow port number for the second format. The numbering of these
170two types of port usually differs and there is no relationship.
aee0979b
BP
171.
172.IP
173\fBofproto\-trace\-packet\-out\fR accepts an additional
174\fB\-consistent\fR option. With this option specified, the command
175rejects \fIactions\fR that are inconsistent with the specified packet.
176(An example of an inconsistency is attempting to strip the VLAN tag
177from a packet that does not have a VLAN tag.) Open vSwitch ignores
178most forms of inconsistency in OpenFlow 1.0 and rejects
179inconsistencies in later versions of OpenFlow. The option is
180necessary because the command does not ordinarily imply a particular
181OpenFlow version. One exception is that, when \fIactions\fR includes
182an action that only OpenFlow 1.1 and later supports (such as
183\fBpush_vlan\fR), \fB\-consistent\fR is automatically enabled.
27e3debd
TR
184.
185.IP "Usage examples:"
186.RS 4
187.PP
188\fBTrace an unicast ICMP echo request on ingress port 1 to destination MAC
18900:00:5E:00:53:01\fR
190.RS 4
191.nf
192ofproto/trace br in_port=1,icmp,icmp_type=8,\\
193dl_dst=00:00:5E:00:53:01
194.RE
195.fi
196.PP
197\fBTrace an unicast ICMP echo reply on ingress port 1 to destination MAC
19800:00:5E:00:53:01\fR
199.RS 4
200.nf
201ofproto/trace br in_port=1,icmp,icmp_type=0,\\
202dl_dst=00:00:5E:00:53:01
203.fi
204.RE
205.PP
206\fBTrace an ARP request on ingress port 1\fR
207.RS 4
208.nf
209ofproto/trace br in_port=1,arp,arp_op=1
210.fi
211.RE
212.PP
213\fBTrace an ARP reply on ingress port 1\fR
214.RS 4
215.nf
216ofproto/trace br in_port=1,arp,arp_op=2
217.fi
218.RE
219.RE