Changes between Version 7 and Version 8 of HowTo/WriteOFv3Rspecs
- Timestamp:
- 09/30/11 09:54:43 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowTo/WriteOFv3Rspecs
v7 v8 80 80 }}} 81 81 82 4. Specify your flowspace. E.g. if you want for the above group to get all traffic that is sourced or destined to the IP subnet 10.1.1.0/24 and uses tcp port 80, then you will need two <openflow:match> tags, one to match the packets that are sourced from that subnet and one to match the packets that are destined to that subnet. Keep in mind that your flowspace is the union of the traffic that is described by each 82 4. Specify your flowspace. E.g. if you want for the above group to get all traffic that is sourced or destined to the IP subnet 10.1.1.0/24 and uses tcp port 80, then you will need two <openflow:match> tags, one to match the packets that are sourced from that subnet and one to match the packets that are destined to that subnet. Keep in mind that your flowspace is the union of the traffic that is described by each. 83 83 {{{ 84 84 #!xml … … 86 86 <openflow:use-group name="mygrp" /> 87 87 <openflow:packet> 88 <openflow:dl_type value="0x800" /> 88 89 <openflow:nw_src value="10.1.1.0/24" /> 90 <openflow:nw_proto value="6, 17" /> 89 91 <openflow:tp_src value="80" /> 90 92 <openflow:packet /> … … 94 96 <openflow:use-group name="mygrp" /> 95 97 <openflow:packet> 98 <openflow:dl_type value="0x800" /> 96 99 <openflow:nw_dst value="10.1.1.0/24" /> 100 <openflow:nw_proto value="6, 17" /> 97 101 <openflow:tp_dst value="80" /> 98 102 <openflow:packet /> … … 100 104 }}} 101 105 106 Notice that although we need to match on IP source/destination and on the transport protocol port, we also applied filters to ensure that the packet is an IP packet and that the IP protocol is TCP or UDP. Openflow can filter on any Layer 2, Layer 3 or Layer 4 header field but you would need to match 107 the type on the lower level in order to filter at the higher one, e.g. in order to match on IP fields you need to first ensure that the packet is indeed an IP packet. 102 108 103 109 Done! The complete rspec looks like : … … 136 142 <openflow:use-group name="mygrp" /> 137 143 <openflow:packet> 144 <openflow:dl_type value="0x800" /> 138 145 <openflow:nw_src value="10.1.1.0/24" /> 146 <openflow:nw_proto value="6, 17" /> 139 147 <openflow:tp_src value="80" /> 140 148 <openflow:packet /> 141 149 <openflow:match> 142 150 143 <openflow:match> 144 <openflow:use-group name="mygrp" /> 145 <openflow:packet> 146 <openflow:nw_dst value="10.1.1.0/24" /> 147 <openflow:tp_dst value="80" /> 151 <openflow:match> 152 <openflow:use-group name="mygrp" /> 153 <openflow:packet> 154 <openflow:dl_type value="0x800" /> 155 <openflow:nw_dst value="10.1.1.0/24" /> 156 <openflow:nw_proto value="6, 17" /> 157 <openflow:tp_dst value="80" /> 148 158 <openflow:packet /> 149 159 <openflow:match>