blob: 3dd93d72ee48b8fa1e918d66ccb1c8ad9142ddb7 [file] [log] [blame]
Matteo Scandoloa229eca2017-08-08 13:05:28 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
ShreyaPandita6fbff252012-11-13 16:56:48 -050017"""These tests fall under Conformance Test-Suite (OF-SWITCH-1.0.0 TestCases).
18 Refer Documentation -- Detailed testing methodology
19 <Some of test-cases are directly taken from oftest> """
20
21"Test Suite 6 --> Flow Matches"
22
23
24import logging
25
26import unittest
27import random
28
Rich Lanecd97d3d2013-01-07 18:50:06 -080029from oftest import config
ShreyaPandita6fbff252012-11-13 16:56:48 -050030import oftest.controller as controller
Rich Laned7b0ffa2013-03-08 15:53:42 -080031import ofp
ShreyaPandita6fbff252012-11-13 16:56:48 -050032import oftest.dataplane as dataplane
ShreyaPandita6fbff252012-11-13 16:56:48 -050033import oftest.parse as parse
34import oftest.base_tests as base_tests
35import time
36
37from oftest.testutils import *
38from time import sleep
39from FuncUtils import *
40
ShreyaPanditaefdff312012-11-21 13:35:34 -050041
ShreyaPandita6fbff252012-11-13 16:56:48 -050042
43class AllWildcardMatch(base_tests.SimpleDataPlane):
44
45 """Verify for an all wildcarded flow all the injected packets would match that flow"""
46
47 def runTest(self):
48
49 logging.info("Running All Wildcard Match test")
50
51 of_ports = config["port_map"].keys()
52 of_ports.sort()
53 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
54
55 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -080056 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -050057
58 logging.info("Inserting an all wildcarded flow and sending packets with various match fields")
59 logging.info("Expecting all sent packets to match")
60
Rich Lanee4b384d2013-09-13 14:33:40 -070061 in_port = of_ports[0]
62 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -050063
ShreyaPandita6fbff252012-11-13 16:56:48 -050064 #Insert an All Wildcarded flow.
65 wildcard_all(self,of_ports)
66
67 #check for different match fields and verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -070068 pkt1 = str(simple_tcp_packet(eth_src="00:01:01:01:01:01"))
69 self.dataplane.send(in_port, pkt1)
70 verify_packets(self, pkt1, [egress_port])
ShreyaPanditaefdff312012-11-21 13:35:34 -050071
Rich Lanee4b384d2013-09-13 14:33:40 -070072 pkt2 = str(simple_tcp_packet(eth_dst="00:01:01:01:01:01"))
73 self.dataplane.send(in_port, pkt2)
74 verify_packets(self, pkt2, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -050075
Rich Lanee4b384d2013-09-13 14:33:40 -070076 pkt3 = str(simple_tcp_packet(ip_src="192.168.2.1"))
77 self.dataplane.send(in_port, pkt3)
78 verify_packets(self, pkt3, [egress_port])
ShreyaPanditaefdff312012-11-21 13:35:34 -050079
Rich Lanee4b384d2013-09-13 14:33:40 -070080 pkt4 = str(simple_tcp_packet(ip_dst="192.168.2.2"))
81 self.dataplane.send(in_port, pkt4)
82 verify_packets(self, pkt4, [egress_port])
ShreyaPanditaefdff312012-11-21 13:35:34 -050083
Rich Lanee4b384d2013-09-13 14:33:40 -070084 pkt5 = str(simple_tcp_packet(ip_tos=2))
85 self.dataplane.send(in_port, pkt5)
86 verify_packets(self, pkt5, [egress_port])
ShreyaPanditaefdff312012-11-21 13:35:34 -050087
Rich Lanee4b384d2013-09-13 14:33:40 -070088 pkt6 = str(simple_tcp_packet(tcp_sport=8080))
89 self.dataplane.send(in_port, pkt6)
90 verify_packets(self, pkt6, [egress_port])
ShreyaPanditaefdff312012-11-21 13:35:34 -050091
Rich Lanee4b384d2013-09-13 14:33:40 -070092 pkt7 = str(simple_tcp_packet(tcp_dport=8081))
93 self.dataplane.send(in_port, pkt7)
94 verify_packets(self, pkt7, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -050095
96
97
98class EthernetSrcAddress(base_tests.SimpleDataPlane):
99
100 """Verify match on single header field -- Ethernet Src Address """
101
102 def runTest(self):
103
104 logging.info("Running Ethernet Src Address test")
105
106 of_ports = config["port_map"].keys()
107 of_ports.sort()
108 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
109
110 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800111 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500112
Rich Lanee4b384d2013-09-13 14:33:40 -0700113 in_port = of_ports[0]
114 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500115
ShreyaPandita6fbff252012-11-13 16:56:48 -0500116 logging.info("Inserting a flow with match on Ethernet Source Address ")
117 logging.info("Sending matching and non-matching ethernet packets")
118 logging.info("Verifying only matching packets implements the action specified in the flow")
119
120 #Insert a Match On Ethernet Src Address flow
121 (pkt,match) = match_ethernet_src_address(self,of_ports)
122
123 #Sending packet matching the flow, verify it implements the action
Rich Lanee4b384d2013-09-13 14:33:40 -0700124 self.dataplane.send(in_port, str(pkt))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500125
126 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700127 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500128
129 #Sending non matching packet , verify Packetin event gets triggered.
Rich Laned0478ff2013-03-11 12:46:58 -0700130 pkt2 = simple_eth_packet(eth_src='00:01:01:01:01:02');
Rich Lanee4b384d2013-09-13 14:33:40 -0700131 self.dataplane.send(in_port, str(pkt2))
132 verify_packet_in(self, str(pkt2), in_port, ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500133
134class EthernetDstAddress(base_tests.SimpleDataPlane):
135
136 """Verify match on single Header Field Field -- Ethernet Dst Address """
137
138 def runTest(self):
139
140 logging.info("Running Ethernet Dst Address test")
141
142 of_ports = config["port_map"].keys()
143 of_ports.sort()
144 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
145
146 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800147 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500148
Rich Lanee4b384d2013-09-13 14:33:40 -0700149 in_port = of_ports[0]
150 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500151
ShreyaPandita6fbff252012-11-13 16:56:48 -0500152 logging.info("Inserting a flow with match on Ethernet Destination Address ")
153 logging.info("Sending matching and non-matching ethernet packets")
154 logging.info("Verifying only matching packets implements the action specified in the flow")
155
156 #Insert a Match on Destination Address flow
157 (pkt,match) = match_ethernet_dst_address(self,of_ports)
158
159 #Send Packet matching the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700160 self.dataplane.send(in_port, str(pkt))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500161
162 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700163 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500164
165 #Send Non-matching packet
Rich Laned0478ff2013-03-11 12:46:58 -0700166 pkt2 = simple_eth_packet(eth_dst='00:01:01:01:01:02');
Rich Lanee4b384d2013-09-13 14:33:40 -0700167 self.dataplane.send(in_port, str(pkt2))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500168
169 #Verify PacketIn event gets triggered
Rich Lanee4b384d2013-09-13 14:33:40 -0700170 verify_packet_in(self, str(pkt2), in_port, ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500171
172
173class EthernetType(base_tests.SimpleDataPlane):
174
175 """Verify match on single header field -- Ethernet Type """
176
177 def runTest(self):
178
179 logging.info("Running Ethernet Type test")
180
181 of_ports = config["port_map"].keys()
182 of_ports.sort()
183 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
184
185 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800186 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500187
Rich Lanee4b384d2013-09-13 14:33:40 -0700188 in_port = of_ports[0]
189 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500190
ShreyaPandita6fbff252012-11-13 16:56:48 -0500191 logging.info("Inserting a flow with match on Ethernet Type ")
192 logging.info("Sending matching and non-matching ethernet packets")
193 logging.info("Verifying only matching packets implements the action specified in the flow")
194
195 #Insert a Match on Ethernet-Type flow
196 (pkt,match) = match_ethernet_type(self,of_ports)
197
198 #Sending packet matching the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700199 self.dataplane.send(in_port, str(pkt))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500200
201 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700202 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500203
204 #Sending non matching packet ,
Rich Laned0478ff2013-03-11 12:46:58 -0700205 pkt2 = simple_eth_packet(eth_type=0x0806);
Rich Lanee4b384d2013-09-13 14:33:40 -0700206 self.dataplane.send(in_port, str(pkt2))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500207
208 #verify Packetin event gets triggered.
Rich Lanee4b384d2013-09-13 14:33:40 -0700209 verify_packet_in(self, str(pkt2), in_port, ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500210
211
212class IngressPort(base_tests.SimpleDataPlane):
213
214 """Verify match on single Header Field Field -- In_port """
215
216 def runTest(self):
217
218 logging.info("Running Ingress Port test")
219
220 of_ports = config["port_map"].keys()
221 of_ports.sort()
222 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
223
224 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800225 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500226
Rich Lanee4b384d2013-09-13 14:33:40 -0700227 in_port = of_ports[0]
228 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500229
ShreyaPandita6fbff252012-11-13 16:56:48 -0500230 logging.info("Inserting a flow with match on Ingress Port ")
231 logging.info("Sending matching and non-matching packets")
232 logging.info("Verifying only matching packets implements the action specified in the flow")
233
234 #Insert a Match on Ingress Port FLow
235 (pkt,match) = wildcard_all_except_ingress(self,of_ports,priority=0)
236
237 #Send Packet matching the flow i.e on in_port specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700238 self.dataplane.send(in_port, str(pkt))
ShreyaPandita6fbff252012-11-13 16:56:48 -0500239
240 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700241 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500242
243 #Send Non-Matching Packet
244 self.dataplane.send(of_ports[1],str(pkt))
245
246 #Verify PacketIn event gets triggered
Rich Lane4c504f32013-06-07 17:24:14 -0700247 verify_packet_in(self, str(pkt), of_ports[1], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500248
249class VlanId(base_tests.SimpleDataPlane):
250
251 """Verify match on single Header Field Field -- Vlan Id """
252
253 def runTest(self):
254
255 of_ports = config["port_map"].keys()
256 of_ports.sort()
257 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
258
259 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800260 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500261
Rich Lanee4b384d2013-09-13 14:33:40 -0700262 in_port = of_ports[0]
263 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500264
ShreyaPandita6fbff252012-11-13 16:56:48 -0500265 logging.info("Inserting a flow with match on VLAN ID ")
266 logging.info("Sending matching and non-matching tagged packets")
267 logging.info("Verifying matching packets implements the action specified in the flow")
268
269 #Create a flow with match on Vlan Id
270 (pkt,match) = match_vlan_id(self,of_ports)
271
272 #Send tagged packet matching the flow i.e packet with same vlan id as in flow
273 self.dataplane.send(of_ports[0], str(pkt))
274
275 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700276 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500277
278 #Send Non-matching packet, i.e packet with different Vlan Id
Rich Laned0478ff2013-03-11 12:46:58 -0700279 pkt2 = simple_tcp_packet(dl_vlan_enable=True,vlan_vid=4);
ShreyaPandita6fbff252012-11-13 16:56:48 -0500280 self.dataplane.send(of_ports[0], str(pkt2))
281
282 #Verify PacketIn event gets triggered
Rich Lane4c504f32013-06-07 17:24:14 -0700283 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500284
285class VlanPCP(base_tests.SimpleDataPlane):
286
287 """"Verify match on single Header Field Field -- Vlan Priority"""
288
289 def runTest(self):
290
291 logging.info("Running VlanPCP1 test")
292
293 of_ports = config["port_map"].keys()
294 of_ports.sort()
295 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
296
297 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800298 delete_all_flows(self.controller)
ShreyaPanditaefdff312012-11-21 13:35:34 -0500299
Rich Lanee4b384d2013-09-13 14:33:40 -0700300 in_port = of_ports[0]
301 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500302
ShreyaPandita6fbff252012-11-13 16:56:48 -0500303 logging.info("Inserting a flow with match on VLAN Priority ")
304 logging.info("Sending matching and non-matching tagged packets")
305 logging.info("Verifying matching packet implements the action specified in the flow")
306
307 #Create a flow matching on VLAN Priority
308 (pkt,match) = match_vlan_pcp(self,of_ports)
309
310 #Send tagged Packet matching the flow
311 self.dataplane.send(of_ports[0], str(pkt))
312
313 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700314 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500315
316 #Send tagged packet with same vlan_id but different vlan priority
Rich Laned0478ff2013-03-11 12:46:58 -0700317 pkt2 = simple_tcp_packet(dl_vlan_enable=True,vlan_vid=1,vlan_pcp=20);
ShreyaPanditaefdff312012-11-21 13:35:34 -0500318 self.dataplane.send(of_ports[0], str(pkt2))
319
320 #Verify Packet_In event gets triggered
Rich Lane4c504f32013-06-07 17:24:14 -0700321 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500322
323class MultipleHeaderFieldL2(base_tests.SimpleDataPlane):
324
325 """Verify match on multiple header field -- Ethernet Type, Ethernet Source Address, Ethernet Destination Address """
326
327 def runTest(self):
328
329 logging.info("Running Multiple Header Field L2 test")
330
331 of_ports = config["port_map"].keys()
332 of_ports.sort()
333 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
334
335 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800336 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500337
Rich Lanee4b384d2013-09-13 14:33:40 -0700338 in_port = of_ports[0]
339 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500340
ShreyaPandita6fbff252012-11-13 16:56:48 -0500341 logging.info("Inserting a flow with match on Multiple Header Fields in L2 ")
342 logging.info("Sending matching and non-matching packets")
343 logging.info("Verifying matching packets implements the action specified in the flow")
344
345 (pkt,match) = match_mul_l2(self,of_ports)
346
Rich Laned0478ff2013-03-11 12:46:58 -0700347 #Send eth packet matching the eth_type field, verify it implements the action
ShreyaPandita6fbff252012-11-13 16:56:48 -0500348 self.dataplane.send(of_ports[0], str(pkt))
349
350 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700351 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500352
Rich Laned0478ff2013-03-11 12:46:58 -0700353 #Sending non matching packet (only eth_dst is different) , verify Packetin event gets triggered.
354 pkt2 = simple_eth_packet(eth_type=0x88cc,eth_src='00:01:01:01:01:01',eth_dst='00:01:01:02:01:01');
ShreyaPandita6fbff252012-11-13 16:56:48 -0500355 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700356 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500357
Rich Laned0478ff2013-03-11 12:46:58 -0700358 #Sending non matching packet (only eth_src is different) , verify Packetin event gets triggered.
359 pkt2 = simple_eth_packet(eth_type=0x88cc,eth_src='00:01:01:01:01:02',eth_dst='00:01:01:01:01:02');
ShreyaPandita6fbff252012-11-13 16:56:48 -0500360 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700361 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500362
363 #Sending non matching packet (only ether_type is different) , verify Packetin event gets triggered.
Rich Laned0478ff2013-03-11 12:46:58 -0700364 pkt2 = simple_eth_packet(eth_type=0x0806,eth_src='00:01:01:01:01:01',eth_dst='00:01:01:01:01:02');
ShreyaPandita6fbff252012-11-13 16:56:48 -0500365 self.dataplane.send(of_ports[0], str(pkt2))
366
ShreyaPanditaefdff312012-11-21 13:35:34 -0500367 #Verify packet_in event gets triggered
Rich Lane4c504f32013-06-07 17:24:14 -0700368 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500369
370class IpTos(base_tests.SimpleDataPlane):
371
372 """"Verify match on single Header Field Field -- Type of service"""
373
374 def runTest(self):
375
376 logging.info("Running Ip_Tos test")
377
378 of_ports = config["port_map"].keys()
379 of_ports.sort()
380 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
381
382 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800383 delete_all_flows(self.controller)
ShreyaPanditaefdff312012-11-21 13:35:34 -0500384
Rich Lanee4b384d2013-09-13 14:33:40 -0700385 in_port = of_ports[0]
386 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500387
ShreyaPandita6fbff252012-11-13 16:56:48 -0500388 logging.info("Inserting a flow with match on Ip_Tos ")
389 logging.info("Sending matching and non-matching tcp/ip packets")
390 logging.info("Verifying only matching packets implements the action specified in the flow")
391
392 #Create a flow matching on VLAN Priority
393 (pkt,match) = match_ip_tos(self,of_ports)
394
395 #Send Packet matching the flow
396 self.dataplane.send(of_ports[0], str(pkt))
397
398 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700399 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500400
401 #Create a non-matching packet , verify packet_in get generated
Rich Laneb5c73792012-12-03 17:12:32 -0800402 pkt2 = simple_tcp_packet(ip_tos=4);
ShreyaPandita6fbff252012-11-13 16:56:48 -0500403 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700404 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500405
406class IpProtocol(base_tests.SimpleDataPlane):
407
408 """"Verify match on single Header Field Field -- Ip Protocol"""
409
410 def runTest(self):
411
412 logging.info("Running Ip Protocol test")
413
414 of_ports = config["port_map"].keys()
415 of_ports.sort()
416 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
417
418 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800419 delete_all_flows(self.controller)
ShreyaPanditaefdff312012-11-21 13:35:34 -0500420
Rich Lanee4b384d2013-09-13 14:33:40 -0700421 in_port = of_ports[0]
422 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500423
ShreyaPandita6fbff252012-11-13 16:56:48 -0500424 logging.info("Inserting a flow with match on Ip Protocol ")
425 logging.info("Sending matching and non-matching tcp/ip packets")
426 logging.info("Verifying only matching packets implements the action specified in the flow")
427
428 #Create a flow matching on VLAN Priority
429 (pkt,match) = match_ip_protocol(self,of_ports)
430
431 #Send Packet matching the flow
432 self.dataplane.send(of_ports[0], str(pkt))
433
434 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700435 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500436
437 #Create a non-matching packet , verify packet_in get generated
438 pkt2 = simple_icmp_packet();
439 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700440 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500441
442
443class TcpSrcPort(base_tests.SimpleDataPlane):
444
445 """Verify match on Single header field -- Tcp Source Port, """
446
447 def runTest(self):
448
449 logging.info("Running Tcp Src Port test")
450
451 of_ports = config["port_map"].keys()
452 of_ports.sort()
453 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
454
455 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800456 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500457
Rich Lanee4b384d2013-09-13 14:33:40 -0700458 in_port = of_ports[0]
459 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500460
ShreyaPandita6fbff252012-11-13 16:56:48 -0500461 logging.info("Inserting a flow with match on Tcp Tcp Source Port ")
462 logging.info("Sending matching and non-matching tcp packets")
463 logging.info("Verifying matching packets implements the action specified in the flow")
464
465 (pkt,match) = match_tcp_src(self,of_ports)
466
467 #Sending packet matching the tcp_sport, verify it implements the action
468 self.dataplane.send(of_ports[0], str(pkt))
469
470 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700471 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500472
473 #Sending non matching packet , verify Packetin event gets triggered.
474 pkt2 = simple_tcp_packet(tcp_sport=540);
475 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700476 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500477
478class TcpDstPort(base_tests.SimpleDataPlane):
479
480 """Verify match on Single header field -- Tcp Destination Port """
481
482 def runTest(self):
483
484 logging.info("Running Tcp Destination Port test")
485
486 of_ports = config["port_map"].keys()
487 of_ports.sort()
488 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
489
490 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800491 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500492
Rich Lanee4b384d2013-09-13 14:33:40 -0700493 in_port = of_ports[0]
494 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500495
ShreyaPandita6fbff252012-11-13 16:56:48 -0500496 logging.info("Inserting a flow with match on Tcp Destination Port ")
497 logging.info("Sending matching and non-matching packets")
498 logging.info("Verifying matching packets implements the action specified in the flow")
499
500 (pkt,match) = match_tcp_dst(self,of_ports)
501
502 #Sending packet matching the tcp_dport, verify it implements the action
503 self.dataplane.send(of_ports[0], str(pkt))
504
505 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700506 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500507
508 #Sending non matching packet , verify Packetin event gets triggered.
509 pkt2 = simple_tcp_packet(tcp_dport=541);
510 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700511 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500512
Shudong Zhouc2f18762013-01-11 00:12:44 -0800513class UdpSrcPort(base_tests.SimpleDataPlane):
514
515 """Verify match on Single header field -- Udp Source Port, """
516
517 def runTest(self):
518
519 logging.info("Running Udp Src Port test")
520
521 of_ports = config["port_map"].keys()
522 of_ports.sort()
523 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
524
525 #Clear Switch State
526 delete_all_flows(self.controller)
527
Rich Lanee4b384d2013-09-13 14:33:40 -0700528 in_port = of_ports[0]
529 egress_port = of_ports[1]
Shudong Zhouc2f18762013-01-11 00:12:44 -0800530
531 logging.info("Inserting a flow with match on Udp Udp Source Port ")
532 logging.info("Sending matching and non-matching tcp packets")
533 logging.info("Verifying matching packets implements the action specified in the flow")
534
535 (pkt,match) = match_udp_src(self,of_ports)
536
537 #Sending packet matching the tcp_sport, verify it implements the action
538 self.dataplane.send(of_ports[0], str(pkt))
539
540 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700541 verify_packets(self, pkt, [egress_port])
Shudong Zhouc2f18762013-01-11 00:12:44 -0800542
543 #Sending non matching packet , verify Packetin event gets triggered.
544 pkt2 = simple_udp_packet(udp_sport=540);
545 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700546 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhouc2f18762013-01-11 00:12:44 -0800547
548class UdpDstPort(base_tests.SimpleDataPlane):
549
550 """Verify match on Single header field -- Udp Destination Port """
551
552 def runTest(self):
553
554 logging.info("Running Udp Destination Port test")
555
556 of_ports = config["port_map"].keys()
557 of_ports.sort()
558 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
559
560 #Clear Switch State
561 delete_all_flows(self.controller)
562
Rich Lanee4b384d2013-09-13 14:33:40 -0700563 in_port = of_ports[0]
564 egress_port = of_ports[1]
Shudong Zhouc2f18762013-01-11 00:12:44 -0800565
566 logging.info("Inserting a flow with match on Udp Destination Port ")
567 logging.info("Sending matching and non-matching packets")
568 logging.info("Verifying matching packets implements the action specified in the flow")
569
570 (pkt,match) = match_udp_dst(self,of_ports)
571
572 #Sending packet matching the tcp_dport, verify it implements the action
573 self.dataplane.send(of_ports[0], str(pkt))
574
575 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700576 verify_packets(self, pkt, [egress_port])
Shudong Zhouc2f18762013-01-11 00:12:44 -0800577
578 #Sending non matching packet , verify Packetin event gets triggered.
579 pkt2 = simple_udp_packet(udp_dport=541);
580 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700581 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhouc2f18762013-01-11 00:12:44 -0800582
583class ICMPType(base_tests.SimpleDataPlane):
584
585 """Verify match on Single header field -- ICMP type, """
586
587 def runTest(self):
588
589 logging.info("Running ICMP type test")
590
591 of_ports = config["port_map"].keys()
592 of_ports.sort()
593 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
594
595 #Clear Switch State
596 delete_all_flows(self.controller)
597
Rich Lanee4b384d2013-09-13 14:33:40 -0700598 in_port = of_ports[0]
599 egress_port = of_ports[1]
Shudong Zhouc2f18762013-01-11 00:12:44 -0800600
601 logging.info("Inserting a flow with match on ICMP type")
602 logging.info("Sending matching and non-matching ICMP packets")
603 logging.info("Verifying matching packets implements the action specified in the flow")
604
605 (pkt,match) = match_icmp_type(self,of_ports)
606
607 #Sending packet matching the tcp_sport, verify it implements the action
608 self.dataplane.send(of_ports[0], str(pkt))
609
610 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700611 verify_packets(self, pkt, [egress_port])
Shudong Zhouc2f18762013-01-11 00:12:44 -0800612
613 #Sending non matching packet , verify Packetin event gets triggered.
614 pkt2 = simple_icmp_packet(icmp_type=10);
615 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700616 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhouc2f18762013-01-11 00:12:44 -0800617
618class ICMPCode(base_tests.SimpleDataPlane):
619
620 """Verify match on Single header field -- ICMP code, """
621
622 def runTest(self):
623
624 logging.info("Running ICMP code test")
625
626 of_ports = config["port_map"].keys()
627 of_ports.sort()
628 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
629
630 #Clear Switch State
631 delete_all_flows(self.controller)
632
Rich Lanee4b384d2013-09-13 14:33:40 -0700633 in_port = of_ports[0]
634 egress_port = of_ports[1]
Shudong Zhouc2f18762013-01-11 00:12:44 -0800635
636 logging.info("Inserting a flow with match on ICMP type")
637 logging.info("Sending matching and non-matching ICMP packets")
638 logging.info("Verifying matching packets implements the action specified in the flow")
639
640 (pkt,match) = match_icmp_code(self,of_ports)
641
642 #Sending packet matching the tcp_dport, verify it implements the action
643 self.dataplane.send(of_ports[0], str(pkt))
644
645 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700646 verify_packets(self, pkt, [egress_port])
Shudong Zhouc2f18762013-01-11 00:12:44 -0800647
648 #Sending non matching packet , verify Packetin event gets triggered.
649 pkt2 = simple_icmp_packet(icmp_code=10);
650 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700651 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhouc2f18762013-01-11 00:12:44 -0800652
Kiran Poolaff12e482013-07-02 14:19:52 -0700653class ArpOpcode(base_tests.SimpleDataPlane):
654
655 """"Verify match on single Header Field -- Arp Protocol"""
656
657 def runTest(self):
658
659 logging.info("Running Arp Protocol test")
660
661 of_ports = config["port_map"].keys()
662 of_ports.sort()
663 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
664
665 #Clear Switch State
666 delete_all_flows(self.controller)
667
Rich Lanee4b384d2013-09-13 14:33:40 -0700668 in_port = of_ports[0]
669 egress_port = of_ports[1]
Kiran Poolaff12e482013-07-02 14:19:52 -0700670
671 logging.info("Inserting a flow with match on Arp Protocol Opcode")
672 logging.info("Sending matching and non-matching arp packets")
673 logging.info("Verifying only matching packets implements the action specified in the flow")
674
675 #Create a flow matching on ARP Opcode
676 (pkt,match) = match_arp_opcode(self,of_ports)
677
678 #Send Packet matching the flow
679 self.dataplane.send(of_ports[0], str(pkt))
680
681 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700682 verify_packets(self, pkt, [egress_port])
Kiran Poolaff12e482013-07-02 14:19:52 -0700683
684 #Create a non-matching packet , verify packet_in get generated
685 pkt2 = simple_arp_packet(arp_op=2)
686 self.dataplane.send(of_ports[0], str(pkt2))
687 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500688
Shudong Zhoudceec932013-02-06 01:12:54 -0800689class ArpSenderIP(base_tests.SimpleDataPlane):
690
691 """"Verify match on single Header Field -- Arp Protocol"""
692
693 def runTest(self):
694
695 logging.info("Running Arp Protocol test")
696
697 of_ports = config["port_map"].keys()
698 of_ports.sort()
699 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
700
701 #Clear Switch State
702 delete_all_flows(self.controller)
703
Rich Lanee4b384d2013-09-13 14:33:40 -0700704 in_port = of_ports[0]
705 egress_port = of_ports[1]
Shudong Zhoudceec932013-02-06 01:12:54 -0800706
707 logging.info("Inserting a flow with match on Arp Protocol ")
708 logging.info("Sending matching and non-matching arp packets")
709 logging.info("Verifying only matching packets implements the action specified in the flow")
710
711 #Create a flow matching on ARP sender IP
712 (pkt,match) = match_arp_sender(self,of_ports)
713
714 #Send Packet matching the flow
715 self.dataplane.send(of_ports[0], str(pkt))
716
717 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700718 verify_packets(self, pkt, [egress_port])
Shudong Zhoudceec932013-02-06 01:12:54 -0800719
720 #Create a non-matching packet , verify packet_in get generated
721 pkt2 = simple_arp_packet(ip_snd="10.10.0.10");
722 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700723 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhoudceec932013-02-06 01:12:54 -0800724
725class ArpTargetIP(base_tests.SimpleDataPlane):
726
727 """"Verify match on single Header Field -- Arp Protocol"""
728
729 def runTest(self):
730
731 logging.info("Running Arp Protocol test")
732
733 of_ports = config["port_map"].keys()
734 of_ports.sort()
735 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
736
737 #Clear Switch State
738 delete_all_flows(self.controller)
739
Rich Lanee4b384d2013-09-13 14:33:40 -0700740 in_port = of_ports[0]
741 egress_port = of_ports[1]
Shudong Zhoudceec932013-02-06 01:12:54 -0800742
743 logging.info("Inserting a flow with match on Arp Protocol ")
744 logging.info("Sending matching and non-matching arp packets")
745 logging.info("Verifying only matching packets implements the action specified in the flow")
746
747 #Create a flow matching on ARP target IP
748 (pkt,match) = match_arp_target(self,of_ports)
749
750 #Send Packet matching the flow
751 self.dataplane.send(of_ports[0], str(pkt))
752
753 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700754 verify_packets(self, pkt, [egress_port])
Shudong Zhoudceec932013-02-06 01:12:54 -0800755
756 #Create a non-matching packet , verify packet_in get generated
757 pkt2 = simple_arp_packet(ip_tgt="10.10.0.10");
758 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700759 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
Shudong Zhoudceec932013-02-06 01:12:54 -0800760
761
ShreyaPandita6fbff252012-11-13 16:56:48 -0500762class ExactMatch(base_tests.SimpleDataPlane):
763
764 """Verify match on Single header field -- Exact Match """
765
766 def runTest(self):
767
768 logging.info("Running Tcp Exact Match test")
769
770 of_ports = config["port_map"].keys()
771 of_ports.sort()
772 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
773
774 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800775 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500776
Rich Lanee4b384d2013-09-13 14:33:40 -0700777 in_port = of_ports[0]
778 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500779
ShreyaPandita6fbff252012-11-13 16:56:48 -0500780 logging.info("Inserting a flow with match for Exact Match ")
781 logging.info("Sending matching and non-matching packets")
782 logging.info("Verifying matching packets implements the action specified in the flow")
783
784 (pkt,match) = exact_match(self,of_ports)
785
786 #Sending packet matching all the fields of a tcp_packet, verify it implements the action
787 self.dataplane.send(of_ports[0], str(pkt))
788
789 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700790 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500791
792 #Sending non matching packet , verify Packetin event gets triggered.
793 pkt2 = simple_tcp_packet(tcp_sport=540);
794 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700795 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500796
797
798class MultipleHeaderFieldL4(base_tests.SimpleDataPlane):
799
800 """Verify match on multiple header field -- Tcp Source Port, Tcp Destination Port """
801
802 def runTest(self):
803
804 logging.info("Running Multiple Header Field L4 test")
805
806 of_ports = config["port_map"].keys()
807 of_ports.sort()
808 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
809
810 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800811 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500812
Rich Lanee4b384d2013-09-13 14:33:40 -0700813 in_port = of_ports[0]
814 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500815
ShreyaPandita6fbff252012-11-13 16:56:48 -0500816 logging.info("Inserting a flow with match on Multiple Header Field L4 ")
817 logging.info("Sending matching and non-matching packets")
818 logging.info("Verifying matching packets implements the action specified in the flow")
819
820 (pkt,match) = match_mul_l4(self,of_ports)
821
822 #Sending packet matching the tcp_sport and tcp_dport field, verify it implements the action
823 self.dataplane.send(of_ports[0], str(pkt))
824
825 #Verify packet implements the action specified in the flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700826 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500827
ShreyaPanditaefdff312012-11-21 13:35:34 -0500828 #Sending non matching packet (tcp_dport different), verify Packetin event gets triggered.
829 pkt2 = simple_tcp_packet(tcp_sport=111,tcp_dport=541);
830 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700831 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPanditaefdff312012-11-21 13:35:34 -0500832
833 #Sending non matching packet (tcp_sport different), verify Packetin event gets triggered.
834 pkt2 = simple_tcp_packet(tcp_sport=100,tcp_dport=112);
ShreyaPandita6fbff252012-11-13 16:56:48 -0500835 self.dataplane.send(of_ports[0], str(pkt2))
Rich Lane4c504f32013-06-07 17:24:14 -0700836 verify_packet_in(self, str(pkt2), of_ports[0], ofp.OFPR_NO_MATCH)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500837
838
839class ExactMatchPrio(base_tests.SimpleDataPlane):
840
841 """Verify that Exact Match has highest priority """
842
843 def runTest(self):
844
845 logging.info("Running Exact Match High Priority test")
846
847 of_ports = config["port_map"].keys()
848 of_ports.sort()
849 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
850
851 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800852 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500853
Rich Lanee4b384d2013-09-13 14:33:40 -0700854 in_port = of_ports[0]
855 egress_port = of_ports[2]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500856
ShreyaPandita6fbff252012-11-13 16:56:48 -0500857 logging.info("Inserting a flow with Exact Match (low priority)")
858 logging.info("Inserting an overlapping wildcarded flow (higher priority)")
859 logging.info("Sending packets matching both the flows ")
860 logging.info("Verifying matching packets implements the action specified in the exact match flow")
861
862 #Insert two Overlapping Flows : Exact Match and Wildcard All.
863 (pkt,match) = exact_match_with_prio(self,of_ports,priority=10)
864 (pkt2,match2) = wildcard_all(self,of_ports,priority=20);
865
866 #Sending packet matching both the flows ,
867 self.dataplane.send(of_ports[0], str(pkt2))
868
869 #verify it implements the action specified in Exact Match Flow
Rich Lanee4b384d2013-09-13 14:33:40 -0700870 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500871
872
873class WildcardMatchPrio(base_tests.SimpleDataPlane):
874
875 """Verify that Wildcard Match with highest priority overrides the low priority WildcardMatch """
876
877 def runTest(self):
878
879 logging.info("Running Wildcard Match High Priority test")
880
881 of_ports = config["port_map"].keys()
882 of_ports.sort()
883 self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
884
885 #Clear Switch State
Rich Lane32bf9482013-01-03 17:26:30 -0800886 delete_all_flows(self.controller)
ShreyaPandita6fbff252012-11-13 16:56:48 -0500887
Rich Lanee4b384d2013-09-13 14:33:40 -0700888 in_port = of_ports[0]
889 egress_port = of_ports[1]
ShreyaPanditaefdff312012-11-21 13:35:34 -0500890
ShreyaPandita6fbff252012-11-13 16:56:48 -0500891 logging.info("Inserting two wildcarded flows with priorities ")
892 logging.info("Sending packets matching the flows")
893 logging.info("Verifying matching packets implements the action specified in the flow with higher priority")
894
895 (pkt,match) = wildcard_all(self,of_ports,priority=20)
896 (pkt1,match1) = wildcard_all_except_ingress1(self,of_ports,priority=10)
897
898 #Sending packet matching both the flows , verify it implements the action specified by Higher Priority flow
899 self.dataplane.send(of_ports[0], str(pkt1))
Rich Lanee4b384d2013-09-13 14:33:40 -0700900 verify_packets(self, pkt, [egress_port])
ShreyaPandita6fbff252012-11-13 16:56:48 -0500901
902
903
904
905