]>
Commit | Line | Data |
---|---|---|
7aa697dd BP |
1 | .SS "OFPROTO COMMANDS" |
2 | These commands manage the core OpenFlow switch implementation (called | |
3 | \fBofproto\fR). | |
876b0e1c | 4 | . |
7aa697dd BP |
5 | .IP "\fBofproto/list\fR" |
6 | Lists the names of the running ofproto instances. These are the names | |
7 | that 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 | 13 | Traces the path of an imaginary packet through \fIswitch\fR and |
aee0979b BP |
14 | reports the path that it took. The initial treatment of the packet |
15 | varies based on the command: | |
16 | . | |
17 | .RS | |
18 | .IP \(bu | |
19 | \fBofproto/trace\fR looks the packet up in the OpenFlow flow table, as | |
20 | if 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 | |
25 | in an OpenFlow ``packet-out'' request. | |
26 | .RE | |
27 | . | |
28 | .IP | |
29 | The packet's headers (e.g. source and destination) and metadata | |
30 | (e.g. input port), together called its ``flow,'' are usually all that | |
31 | matter for the purpose of tracing a packet. You can specify the flow | |
32 | in 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, | |
38 | which is the common case, then you can omit \fIdpname\fR, but if you | |
39 | have 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 | |
45 | OpenFlow flow: besides other differences, it never contains | |
46 | wildcards.) \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" | |
55 | When the traced flow triggers conntrack actions, \fBofproto/trace\fR | |
56 | will automatically trace the forked packet processing pipeline with | |
57 | user specified ct_state. This option sets the ct_state flags that the | |
58 | conntrack module will report. The \fIflags\fR must be a comma- or | |
59 | space-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 | |
82 | changed. | |
83 | . | |
84 | .IP \(bu | |
85 | \fBsnat\fR: Include to indicate a packet whose source IP address has been | |
86 | changed. | |
87 | . | |
88 | .RE | |
89 | . | |
90 | .IP | |
91 | When --ct-next is unspecified, or when there are fewer --ct-next options than | |
92 | ct actions, the \fIflags\fR default to trk,new. | |
93 | . | |
94 | .RE | |
95 | . | |
96 | .IP | |
50aa28fd AW |
97 | Most commonly, one specifies only a flow, using one of the forms |
98 | above, but sometimes one might need to specify an actual packet | |
99 | instead of just a flow: | |
100 | . | |
8b3b8dd1 | 101 | .RS |
50aa28fd AW |
102 | .IP "Side effects." |
103 | Some actions have side effects. For example, the \fBnormal\fR action | |
104 | can update the MAC learning table, and the \fBlearn\fR action can | |
aee0979b | 105 | change OpenFlow tables. The trace commands only perform side |
50aa28fd AW |
106 | effects when a packet is specified. If you want side effects to take |
107 | place, then you must supply a packet. | |
108 | . | |
8b3b8dd1 | 109 | .IP |
50aa28fd | 110 | (Output actions are obviously side effects too, but |
aee0979b | 111 | the trace commands never execute them, even when one specifies a |
50aa28fd | 112 | packet.) |
876b0e1c | 113 | . |
50aa28fd AW |
114 | .IP "Incomplete information." |
115 | Most of the time, Open vSwitch can figure out everything about the | |
116 | path of a packet using just the flow, but in some special | |
117 | circumstances it needs to look at parts of the packet that are not | |
118 | included in the flow. When this is the case, and you do not supply a | |
aee0979b | 119 | packet, then a trace command will tell you it needs a packet. |
876b0e1c | 120 | .RE |
50aa28fd | 121 | . |
876b0e1c | 122 | .IP |
aee0979b BP |
123 | If you wish to include a packet as part of a trace operation, there |
124 | are two ways to do it: | |
50aa28fd AW |
125 | . |
126 | .RS | |
127 | .IP \fB\-generate\fR | |
128 | This option, added to one of the ways to specify a flow already | |
129 | described, causes Open vSwitch to internally generate a packet with | |
130 | the flow described and then to use that packet. If your goal is to | |
131 | execute side effects, then \fB\-generate\fR is the easiest way to do | |
132 | it, but \fB\-generate\fR is not a good way to fill in incomplete | |
133 | information, because it generates packets based on only the flow | |
134 | information, which means that the packets really do not have any more | |
135 | information than the flow. | |
136 | . | |
137 | .IP \fIpacket\fR | |
138 | This form supplies an explicit \fIpacket\fR as a sequence of hex | |
139 | digits. An Ethernet frame is at least 14 bytes long, so there must be | |
140 | at least 28 hex digits. Obviously, it is inconvenient to type in the | |
141 | hex digits by hand, so the \fBovs\-pcap\fR(1) and | |
142 | \fBovs\-tcpundump\fR(1) utilities provide easier ways. | |
876b0e1c | 143 | .IP |
50aa28fd AW |
144 | With this form, packet headers are extracted directly from |
145 | \fIpacket\fR, so the \fIodp_flow\fR or \fIbr_flow\fR should specify | |
146 | only metadata. The metadata can be: | |
147 | .RS | |
148 | .IP \fIskb_priority\fR | |
149 | Packet QoS priority. | |
1362e248 JG |
150 | .IP \fIpkt_mark\fR |
151 | Mark of the packet. | |
07659514 JS |
152 | .IP \fIct_state\fR |
153 | Connection state of the packet. | |
154 | .IP \fIct_zone\fR | |
155 | Connection tracking zone for packet. | |
8e53fe8c JS |
156 | .IP \fIct_mark\fR |
157 | Connection mark of the packet. | |
9daf2348 JS |
158 | .IP \fIct_label\fR |
159 | Connection label of the packet. | |
50aa28fd AW |
160 | .IP \fItun_id\fR |
161 | The tunnel ID on which the packet arrived. | |
162 | .IP \fIin_port\fR | |
163 | The port on which the packet arrived. | |
164 | .RE | |
aee0979b | 165 | .RE |
50aa28fd | 166 | . |
aee0979b | 167 | .IP |
50aa28fd AW |
168 | The in_port value is kernel datapath port number for the first format |
169 | and OpenFlow port number for the second format. The numbering of these | |
170 | two 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 | |
175 | rejects \fIactions\fR that are inconsistent with the specified packet. | |
176 | (An example of an inconsistency is attempting to strip the VLAN tag | |
177 | from a packet that does not have a VLAN tag.) Open vSwitch ignores | |
178 | most forms of inconsistency in OpenFlow 1.0 and rejects | |
179 | inconsistencies in later versions of OpenFlow. The option is | |
180 | necessary because the command does not ordinarily imply a particular | |
181 | OpenFlow version. One exception is that, when \fIactions\fR includes | |
182 | an 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 | |
189 | 00:00:5E:00:53:01\fR | |
190 | .RS 4 | |
191 | .nf | |
192 | ofproto/trace br in_port=1,icmp,icmp_type=8,\\ | |
193 | dl_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 | |
198 | 00:00:5E:00:53:01\fR | |
199 | .RS 4 | |
200 | .nf | |
201 | ofproto/trace br in_port=1,icmp,icmp_type=0,\\ | |
202 | dl_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 | |
209 | ofproto/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 | |
216 | ofproto/trace br in_port=1,arp,arp_op=2 | |
217 | .fi | |
218 | .RE | |
219 | .RE |