On Wed, Feb 14, 2018 at 4:27 AM, Jacob Steadman <[email protected]>
wrote:
> Hi,
>
>
>
> I had code that inserts flow rules in the switches once the feature is
> installed at the controller. It was and still is working fine for OF1.0 but
> I had to upgrade to OF1.3 to make use of multible flow tables.
>
>
>
> If I replace the match so that the flow matches everything, the rule is
> inserted fine so I’m assuming the match is what creates the issue.
>
>
>
> private Flow blockFlow(Short tableId, int priority) {
>
> FlowBuilder Flow = new FlowBuilder() // /**Flow to hold
> DNS rule*/ //
>
> .setTableId(tableId) //
>
> .setFlowName("DropDNSx");
>
>
>
> Flow.setId(new FlowId(Long.toString(1333337))); /**Set flow
> ID*/
>
>
>
> // Match on port and ip
>
> UdpMatch dnsPort = new UdpMatchBuilder().setUdpSourcePort(new
> PortNumber(portNum)).build();
>
>
>
>
>
> Ipv4MatchArbitraryBitMask SrcIp = new Ipv4MatchArbitraryBitMaskBuilder().
> setIpv4SourceAddressNoMask(SrcIP).build();
>
> I believe in case of openflow 1.0 , plugin should be ignoring
Ipv4MatchArbitraryBitMask, as it's only supported for openflow 1.3 only,
as openflow 1.0 don't have mask constraints for ip address. So in case of
openflow 1.0, it should be installing only UDP match based flow. I think if
you comment this Ipv4Match, it might work with openflow 1.3 as well. Which
switch are you using for the test? Do that switch support arbitrary bit
mask for ip addresses?
>
>
> Match Match = new MatchBuilder().setLayer4Match(
> Port).setLayer3Match(SrcIp).build();
>
>
>
> List<Action> actions = new ArrayList<>();
>
>
>
> actions.add(getDropAction());
>
>
>
> // Create an Apply Action
>
> ApplyActions applyActions = new ApplyActionsBuilder() //
>
> .setAction(ImmutableList.copyOf(actions)) //
>
> .build();
>
>
>
> // Wrap our Apply Action in an Instruction
>
> Instruction applyActionsInstruction = new InstructionBuilder()
> //
>
> .setOrder(0)
>
> .setInstruction(new ApplyActionsCaseBuilder()//
>
> .setApplyActions(applyActions) //
>
> .build()) //
>
> .build();
>
>
>
> // Put our Instruction in a list of Instructions
>
> Flow
>
> .setMatch(Match) //
>
> .setInstructions(new InstructionsBuilder() //
>
> .setInstruction(ImmutableList.of(applyActionsInstruction))
> //
>
> .build()) //
>
> .setPriority(priority) //
>
> .setBufferId(OFConstants.OFP_NO_BUFFER) //
>
> .setHardTimeout(flowHardTimeout) //
>
> .setIdleTimeout(flowIdleTimeout) //
>
> .setCookie(new FlowCookie(BigInteger.valueOf(
> flowCookieInc.getAndIncrement())))
>
> .setFlags(new FlowModFlags(false, false, false, false, false));
>
>
>
> LOG.info("Jacob, flow blocked...");
>
>
>
> return dnsxFlow.build();
>
> }
>
> _______________________________________________
> openflowplugin-dev mailing list
> [email protected]
> https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev
>
>
--
Thanks
Anil
_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev