use of org.projectfloodlight.openflow.protocol.OFGroupAdd in project open-kilda by telstra.
the class VerificationFlowGenerator method generateFlow.
@Override
public SwitchFlowTuple generateFlow(IOFSwitch sw) {
ArrayList<OFAction> actionList = new ArrayList<>();
OFMeterMod meter = generateAddMeterForDefaultRule(sw, meterId, meterRate, config.getSystemMeterBurstSizeInPackets(), config.getDiscoPacketSize());
OFInstructionMeter ofInstructionMeter = buildMeterInstruction(meterId, sw, actionList);
OFGroupAdd group = null;
if (broadcast && featureDetectorService.detectSwitch(sw).contains(SwitchFeature.GROUP_PACKET_OUT_CONTROLLER)) {
group = getInstallRoundTripLatencyGroupInstruction(sw);
actionList.add(sw.getOFFactory().actions().group(group.getGroup()));
} else {
addStandardDiscoveryActions(sw, actionList);
}
OFFlowMod flowMod = buildVerificationRule(sw, broadcast, cookie, ofInstructionMeter, actionList);
return SwitchFlowTuple.builder().sw(sw).flow(flowMod).meter(meter).group(group).build();
}
use of org.projectfloodlight.openflow.protocol.OFGroupAdd in project open-kilda by telstra.
the class SwitchManagerTest method validateRoundTripLatencyGroup.
@Test
public void validateRoundTripLatencyGroup() {
OFGroupAdd groupAdd = getOfGroupAddInstruction();
assertTrue(runValidateRoundTripLatencyGroup(groupAdd.getBuckets()));
}
use of org.projectfloodlight.openflow.protocol.OFGroupAdd in project open-kilda by telstra.
the class OfGroupConverterTest method testConvertInstallGroupCommand.
@Test
public void testConvertInstallGroupCommand() {
List<Bucket> buckets = new ArrayList<>();
buckets.add(Bucket.builder().watchPort(WatchPort.ANY).watchGroup(WatchGroup.ALL).writeActions(Sets.newHashSet(new PortOutAction(new PortNumber(2, null)))).build());
buckets.add(Bucket.builder().watchPort(WatchPort.ANY).watchGroup(WatchGroup.ALL).writeActions(Sets.newHashSet(new PortOutAction(new PortNumber(1, null)))).build());
GroupSpeakerData groupSpeakerData = GroupSpeakerData.builder().groupId(new GroupId(GROUP_ID)).type(GroupType.ALL).buckets(buckets).build();
OFFactoryVer13 factory = new OFFactoryVer13();
OFGroupAdd ofGroupAdd = OfGroupConverter.INSTANCE.convertInstallGroupCommand(groupSpeakerData, factory);
assertEquals(OFGroup.of(GROUP_ID), ofGroupAdd.getGroup());
assertEquals(OFGroupType.ALL, ofGroupAdd.getGroupType());
assertEquals(2, ofGroupAdd.getBuckets().size());
List<OFBucket> expectedBuckets = new ArrayList<>();
expectedBuckets.add(factory.buildBucket().setWatchPort(OFPort.ANY).setWatchGroup(OFGroup.ALL).setActions(getActions(factory, 2)).build());
expectedBuckets.add(factory.buildBucket().setWatchPort(OFPort.ANY).setWatchGroup(OFGroup.ALL).setActions(getActions(factory, 1)).build());
assertEquals(expectedBuckets, ofGroupAdd.getBuckets());
}
Aggregations