Uploaded image for project: 'OpenFlowPlugin'
  1. OpenFlowPlugin
  2. OPNFLWPLUG-238

TCP Flag Reads Fail to install if a MAC Address is included in MatchBuilder

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • General
    • None
    • Operating System: Mac OS
      Platform: Other

    • 1547

    Description

      TCP_Flags match won't work when included with a MAC address in the match fields. I mentioned it to Michal P a couple of months ago and he seemed to have a hunch so Im hoping it is an easy fix. I think I remember him mentioning it is a length issue but time is tight w/ code freeze so Im hoping it is a quick fix as openstack/ODL Sec services are blocked on this one. Marking it major from a perspective of the OVSDB plugin project, feel free to adjust Just upping the pestering as I am blocked until resolved.

      Adding the Java API to hopefully help with checking it out. TCP_FLAG requires version 2.1+ of OVS for support. The flowmod does work and install if using the OVS client.

      Failed Match Java API:
      ---------------------

      // Ethertype match
      EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
      EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
      ethTypeBuilder.setType(new EtherType(0x0800L));
      ethernetType.setEthernetType(ethTypeBuilder.build());
      matchBuilder.setEthernetMatch(ethernetType.build());

      EthernetMatchBuilder ethernetMatch1 = new EthernetMatchBuilder();
      EthernetDestinationBuilder ethDestinationBuilder1 = new EthernetDestinationBuilder();
      ethDestinationBuilder1.setAddress(new MacAddress("01:00:00:01:01:01"));
      ethernetMatch1.setEthernetDestination(ethDestinationBuilder1.build());
      matchBuilder.setEthernetMatch(ethernetMatch1.build());

      // TCP Protocol Match
      IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
      ipMatch.setIpProtocol((short) 6);
      matchBuilder.setIpMatch(ipMatch.build());

      // TCP Port Match
      PortNumber dstPort = new PortNumber(80);
      TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
      tcpMatch.setTcpDestinationPort(dstPort);
      matchBuilder.setLayer4Match(tcpMatch.build());

      TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
      tcpFlagMatch.setTcpFlag(0x002);
      matchBuilder.setTcpFlagMatch(tcpFlagMatch.build());

      TunnelBuilder tunnelBuilder = new TunnelBuilder();
      tunnelBuilder.setTunnelId(new BigInteger("1600"));
      matchBuilder.setTunnel(tunnelBuilder.build());

      return matchBuilder;

      MatchBuilder:
      ------------
      [
      _tunnel=Tunnel[
      _tunnelId=1600,
      augmentation=[
      ]
      ],
      _ethernetMatch=EthernetMatch[
      _ethernetDestination=EthernetDestination[
      _address=MacAddress[
      _value=01: 00: 00: 01: 01: 01
      ],
      augmentation=[
      ]
      ],
      augmentation=[
      ]
      ],
      _ipMatch=IpMatch[
      _ipProtocol=6,
      augmentation=[
      ]
      ],
      _layer4Match=TcpMatch[
      _tcpDestinationPort=PortNumber[
      _value=80
      ],
      augmentation=[
      ]
      ],
      _tcpFlagMatch=TcpFlagMatch[
      _tcpFlag=2,
      augmentation=[
      ]
      ],
      augmentation=[
      ]
      ]

      If I drop the Mac Addr match it works:
      -------------------------------------

      // Ethertype match
      EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
      EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
      ethTypeBuilder.setType(new EtherType(0x0800L));
      ethernetType.setEthernetType(ethTypeBuilder.build());
      matchBuilder.setEthernetMatch(ethernetType.build());

      // TCP Protocol Match
      IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
      ipMatch.setIpProtocol((short) 6);
      matchBuilder.setIpMatch(ipMatch.build());

      // TCP Port Match
      PortNumber dstPort = new PortNumber(80);
      TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
      tcpMatch.setTcpDestinationPort(dstPort);
      matchBuilder.setLayer4Match(tcpMatch.build());

      TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
      tcpFlagMatch.setTcpFlag(0x002);
      matchBuilder.setTcpFlagMatch(tcpFlagMatch.build());

      TunnelBuilder tunnelBuilder = new TunnelBuilder();
      tunnelBuilder.setTunnelId(new BigInteger("1600"));
      matchBuilder.setTunnel(tunnelBuilder.build());

      Matchbuilder:
      ------------

      [
      _tunnel=Tunnel[
      _tunnelId=1600,
      augmentation=[
      ]
      ],
      _ethernetMatch=EthernetMatch[
      _ethernetType=EthernetType[
      _type=EtherType[
      _value=2048
      ],
      augmentation=[
      ]
      ],
      augmentation=[
      ]
      ],
      _ipMatch=IpMatch[
      _ipProtocol=6,
      augmentation=[
      ]
      ],
      _layer4Match=TcpMatch[
      _tcpDestinationPort=PortNumber[
      _value=80
      ],
      augmentation=[
      ]
      ],
      _tcpFlagMatch=TcpFlagMatch[
      _tcpFlag=2,
      augmentation=[
      ]
      ],
      augmentation=[
      ]
      ]

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            brent.salisbury@gmail.com Brent Salisbury
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: