- Community Home
- >
- Networking
- >
- Software Defined Networking
- >
- Re: Flow match with MAC mask
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2014 09:39 AM
07-31-2014 09:39 AM
Flow match with MAC mask
Hi everyone!
I am trying to deploy a OF 1.0 flow enty on a flow table for a maskable MAC address. The intention is, to match a specific MAC vendor prefix.
Therefore I set up a FlowMod Add message and created a match with the following sample match field:
MatchField mf = FieldFactory.createBasicField(ProtocolVersion.V_1_0, OxmBasicFieldType.ETH_SRC, MacAddress.valueOf("01:02:03:04:05:06"), MacAddress.valueOf("ff:ff:ff:00:00:00"));
... according to the SDN documentation:
createBasicField(ProtocolVersion pv, OxmBasicFieldType ft, MacAddress mac, MacAddress mask)
For developing purposes I am using the Mininet Open vSwitches. With the above code, a flow entry with an un-masked MAC match field is installed, e.g: eth_src=01:02:03:04:05:06.
Installing the flow manually via dpctl on the flow table, I get the desired result, e.g. eth_src=01:02:03:00:00:00/ff:ff:ff:00:00:00.
Where is the problem? I would be glad if anyone could help me to achieve my intention.
Best regards,
Dast
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2014 12:01 PM
08-14-2014 12:01 PM
Re: Flow match with MAC mask
Hello Dast,
Please try as per the SDN Programming guide(page 27-29, An example : creating a FlowMod message)
private static final MacAddress MAC =MacAddress.valueOf("00001e:000000");
private static final MacAddress MAC_MASK =MacAddress.valueOf("ffffff:000000");
private static final PortNumber SMTP_PORT = PortNumber.valueOf(25);
private static final MacAddress MAC_DEST = MacAddress.BROADCAST;
private static final IpAddress IP_DEST = IpAddress.LOOPBACK_IPv4;
….
….
private Match createMatch() {
// NOTE static imports of:
// com.hp.of.lib.match.FieldFactory.createBasicField;
// com.hp.of.lib.match.OxmBasicFieldType.*;
MutableMatch mm = MatchFactory.createMatch(PV)
.addField(createBasicField(PV, ETH_SRC, MAC, MAC_MASK))
.addField(createBasicField(PV, ETH_TYPE, EthernetType.IPv4))
.addField(createBasicField(PV, IP_PROTO, IpProtocol.TCP))
.addField(createBasicField(PV, TCP_DST, SMTP_PORT));
return (Match) mm.toImmutable();
}
If you still face the issue , please share your code.
Thanks,
HP SDN Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014 12:58 AM
08-15-2014 12:58 AM
Re: Flow match with MAC mask
Hello,
thanks for your reply, but it didn't help. the result is the same: the Flow Table has just a regular MAC address match without a mask (as shown in my initial post).
My code:
// dpId is given as a parameter MacAddress MAC = MacAddress.valueOf("102030:000000"); MacAddress MAC_MASK =MacAddress.valueOf("ffffff:000000"); PortNumber SMTP_PORT = PortNumber.valueOf(25); ProtocolVersion PV = ProtocolVersion.V_1_0; MutableMatch mm = MatchFactory.createMatch(PV) .addField(FieldFactory.createBasicField(PV, OxmBasicFieldType.ETH_SRC, MAC, MAC_MASK)) .addField(FieldFactory.createBasicField(PV, OxmBasicFieldType.ETH_TYPE, EthernetType.IPv4)) .addField(FieldFactory.createBasicField(PV, OxmBasicFieldType.IP_PROTO, IpProtocol.TCP)) .addField(FieldFactory.createBasicField(PV, OxmBasicFieldType.TCP_DST, SMTP_PORT));
Match m = (Match) mm.toImmutable(); OfmMutableFlowMod deployFlowMsg = (OfmMutableFlowMod) MessageFactory.create(ProtocolVersion.V_1_0, MessageType.FLOW_MOD, FlowModCommand.ADD); deployFlowMsg.match(m); Date now = new Date(); long cookie = now.getTime(); deployFlowMsg.idleTimeout(0).hardTimeout(0).priority(155).bufferId(BufferId.NO_BUFFER).cookie(cookie); controllerService.sendFlowMod(deployFlowMsg,toImmutable(), dpId);
Before sending, my app logged the OpenFlow FlowModMessage:
{ofm:[V_1_0,FLOW_MOD,72,126],cmd=ADD,match={Match(V_1_0):[type=STANDARD,len=40],fields=ETH_SRC,ETH_TYPE,IP_PROTO,TCP_DST},...} Cookie : 0x147ba070f37 FMod Cmd : ADD Idle t/o : 0s Hard t/o : 0s Priority : 155 Buffer ID: 0xffffffff(NO_BUFFER) Out Port : 0xffffffff(ANY) FMod Flgs: [] Match : {Match(V_1_0):[type=STANDARD,len=40],fields=ETH_SRC,ETH_TYPE,IP_PROTO,TCP_DST} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=4(ETH_SRC),hm=true,len=12],mac=10:20:30:00:00:00,mask=ff:ff:ff:00:00:00} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=5(ETH_TYPE),hm=false,len=2],type=0x0800(IPv4)} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=10(IP_PROTO),hm=false,len=1],ipp=6(TCP)} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=14(TCP_DST),hm=false,len=2],port=0x19(25)} Actions : (none)
Best regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2014 11:43 PM
10-27-2014 11:43 PM
Re: Flow match with MAC mask
Hello Dast,
Apologies for the delay.
Please let us know if your problem is solved or you still facing some issue.
If you have more questions on the same topic please do reply on the same thread or open a new post if new topic.
Thanks,
HP SDN Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2014 01:27 AM
10-28-2014 01:27 AM
Re: Flow match with MAC mask
Hello sdnindia,
I didn't find a solution for this problem yet...
Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2014 04:14 AM
10-28-2014 04:14 AM
Re: Flow match with MAC mask
Hi Dast
1. Can you please do a packet capture of the the flow_mod message between the controller and switch, and attach the pcap to the thread ?
2. WHich version of the the HP VAN SDN Controller are you using ?
3. What kind of switch are you using ?
4. What software is on the switch ?
5. Would you mind attaching the switch configuration to this as well please ?
Thanks in advance
Gerhard Roets
HP SDN Team
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 05:41 AM
11-10-2014 05:41 AM
Re: Flow match with MAC mask
Hello Gerhard,
I am currently not working on the project anymore, but nevertheless this problem should be discussed / fixed.
Please find subsequently the answers to your questions:
1. This is currently not possible, but as mentioned above the FlowModMessage was sent like this:
{ofm:[V_1_0,FLOW_MOD,72,126],cmd=ADD,match={Match(V_1_0):[type=STANDARD,len=40],fields=ETH_SRC,ETH_TYPE,IP_PROTO,TCP_DST},...} Cookie : 0x147ba070f37 FMod Cmd : ADD Idle t/o : 0s Hard t/o : 0s Priority : 155 Buffer ID: 0xffffffff(NO_BUFFER) Out Port : 0xffffffff(ANY) FMod Flgs: [] Match : {Match(V_1_0):[type=STANDARD,len=40],fields=ETH_SRC,ETH_TYPE,IP_PROTO,TCP_DST} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=4(ETH_SRC),hm=true,len=12],mac=10:20:30:00:00:00,mask=ff:ff:ff:00:00:00} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=5(ETH_TYPE),hm=false,len=2],type=0x0800(IPv4)} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=10(IP_PROTO),hm=false,len=1],ipp=6(TCP)} {Oxm:V_1_0:[cls=0x8000(OPENFLOW_BASIC),ft=14(TCP_DST),hm=false,len=2],port=0x19(25)} Actions : (none)
2. I tried it with version 2.2.5 and 2.3.5.
3. I used the Open vSwitches as well as an HP 5406 and 3500.
4. and 5. see attached files.
Thanks for your support!