diff --git a/src/main/java/net/floodlightcontroller/core/OFSwitch.java b/src/main/java/net/floodlightcontroller/core/OFSwitch.java index e8c0b1da6c8998ca49aeaac1aed099e67f752ebe..ece9ac5615fca895278df5df47ebea674b775e0e 100644 --- a/src/main/java/net/floodlightcontroller/core/OFSwitch.java +++ b/src/main/java/net/floodlightcontroller/core/OFSwitch.java @@ -701,7 +701,7 @@ public class OFSwitch implements IOFSwitchBackend { @Override public void write(OFMessage m) { - log.debug("Channel info: {} {}", connections.get(OFAuxId.MAIN).getRemoteInetAddress(), connections.get(OFAuxId.MAIN).isConnected()); + log.trace("Channel: {}, Connected: {}", connections.get(OFAuxId.MAIN).getRemoteInetAddress(), connections.get(OFAuxId.MAIN).isConnected()); connections.get(OFAuxId.MAIN).write(m); } diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java index 730287381acd161714fa4d8b8fc06e75d79d7017..a5a0e1f2fd597100489230587185e724c413590d 100644 --- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java +++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java @@ -443,7 +443,7 @@ public class Controller implements IFloodlightProviderService, IStorageSourceLis public void handleMessage(IOFSwitch sw, OFMessage m, FloodlightContext bContext) { Ethernet eth = null; - log.debug("~~~~~~~~GOT PACKET IN MESSAGE FROM SWITCH~~~~~~~~~"); + log.trace("Dispatching OFMessage to listeners."); if (this.notifiedRole == HARole.STANDBY) { counters.dispatchMessageWhileStandby.increment(); // We are SLAVE. Do not dispatch messages to listeners. diff --git a/src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java b/src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java index 16012307a7c0a9763e2c5892cd4933de828cf671..1c779114f50ac2c2b077b116049389e1331fb902 100644 --- a/src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java +++ b/src/main/java/net/floodlightcontroller/core/web/serializers/StatsReplySerializer.java @@ -40,7 +40,6 @@ import org.projectfloodlight.openflow.protocol.OFPortStatsReply; import org.projectfloodlight.openflow.protocol.OFPortStatsEntry; import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; import org.projectfloodlight.openflow.protocol.OFPortDesc; -import org.projectfloodlight.openflow.protocol.OFPortFeatures; //Use the loxigen's serializer import org.projectfloodlight.openflow.protocol.ver13.OFPortFeaturesSerializerVer13; @@ -183,7 +182,6 @@ public class StatsReplySerializer extends JsonSerializer<StatsReply> { jGen.writeEndArray(); } public void serializeFlowReply(List<OFFlowStatsReply> flowReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{ - int flowCount = 0; for (OFFlowStatsReply flowReply : flowReplies) { // for each flow stats reply //Dose the switch will reply multiple OFFlowStatsReply ? //Or we juse need to use the first item of the list. diff --git a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java index c89791326d16ac83ad2b9e90116a57796ce6927a..fd6c4fcf423be1e0e28beeba02aaaa348230ebfb 100644 --- a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java +++ b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java @@ -35,6 +35,7 @@ import org.projectfloodlight.openflow.protocol.OFType; import org.projectfloodlight.openflow.protocol.OFVersion; import org.projectfloodlight.openflow.protocol.action.OFAction; import org.projectfloodlight.openflow.types.DatapathId; +import org.projectfloodlight.openflow.types.EthType; import org.projectfloodlight.openflow.types.IPv4Address; import org.projectfloodlight.openflow.types.IpProtocol; import org.projectfloodlight.openflow.types.MacAddress; @@ -72,9 +73,7 @@ import net.floodlightcontroller.routing.Route; import net.floodlightcontroller.staticflowentry.IStaticFlowEntryPusherService; import net.floodlightcontroller.topology.ITopologyService; import net.floodlightcontroller.topology.NodePortTuple; -import net.floodlightcontroller.util.ActionUtils; import net.floodlightcontroller.util.FlowModUtils; -import net.floodlightcontroller.util.MatchUtils; /** * A simple load balancer module for ping, tcp, and udp flows. This module is accessed @@ -231,7 +230,7 @@ public class LoadBalancer implements IFloodlightModule, pushBidirectionalVipRoutes(sw, pi, cntx, client, member); // packet out based on table rule - pushPacket(pkt, sw, pi.getBufferId(), pi.getVersion() == OFVersion.OF_10 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT), OFPort.TABLE, + pushPacket(pkt, sw, pi.getBufferId(), (pi.getVersion().compareTo(OFVersion.OF_12) < 0) ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT), OFPort.TABLE, cntx, true); return Command.STOP; @@ -287,7 +286,7 @@ public class LoadBalancer implements IFloodlightModule, arpRequest.getSenderProtocolAddress())); // push ARP reply out - pushPacket(arpReply, sw, OFBufferId.NO_BUFFER, OFPort.ANY, pi.getMatch().get(MatchField.IN_PORT), cntx, true); + pushPacket(arpReply, sw, OFBufferId.NO_BUFFER, OFPort.ANY, (pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT)), cntx, true); log.debug("proxy ARP reply pushed as {}", IPv4.fromIPv4Address(vips.get(vipId).address)); return; @@ -396,7 +395,7 @@ public class LoadBalancer implements IFloodlightModule, DatapathId dstIsland = topologyService.getL2DomainId(dstSwDpid); if ((dstIsland != null) && dstIsland.equals(srcIsland)) { on_same_island = true; - if ((sw.getId().equals(dstSwDpid)) && ((pi.getVersion() == OFVersion.OF_10 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT)).equals(dstDap.getPort()))) { + if ((sw.getId().equals(dstSwDpid)) && ((pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT)).equals(dstDap.getPort()))) { on_same_if = true; } break; @@ -495,10 +494,12 @@ public class LoadBalancer implements IFloodlightModule, for (int i = 0; i < path.size(); i+=2) { DatapathId sw = path.get(i).getNodeId(); - String swString = path.get(i).getNodeId().toString(); + //String swString = path.get(i).getNodeId().toString(); String entryName; - String matchString = null; - String actionString = null; + //String matchString = null; + Match.Builder mb = pinSwitch.getOFFactory().buildMatch(); + ArrayList<OFAction> actions = new ArrayList<OFAction>(); + //String actionString = null; OFFlowMod.Builder fmb = pinSwitch.getOFFactory().buildFlowAdd(); @@ -512,53 +513,100 @@ public class LoadBalancer implements IFloodlightModule, if (inBound) { entryName = "inbound-vip-"+ member.vipId+"-client-"+client.ipAddress+"-port-"+client.targetPort +"-srcswitch-"+path.get(0).getNodeId()+"-sw-"+sw; - matchString = MatchUtils.STR_NW_SRC + "="+client.ipAddress.toString()+"," + /*matchString = MatchUtils.STR_NW_SRC + "="+client.ipAddress.toString()+"," + MatchUtils.STR_NW_PROTO + "="+String.valueOf(client.nw_proto)+"," + MatchUtils.STR_TP_SRC + "="+client.srcPort.toString()+"," + MatchUtils.STR_DL_TYPE + "="+LB_ETHER_TYPE+"," - + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString(); + + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString(); */ + mb.setExact(MatchField.ETH_TYPE, EthType.IPv4) + .setExact(MatchField.IP_PROTO, client.nw_proto) + .setExact(MatchField.IPV4_SRC, client.ipAddress) + .setExact(MatchField.IN_PORT, path.get(i).getPortId()); + if (client.nw_proto.equals(IpProtocol.TCP)) { + mb.setExact(MatchField.TCP_SRC, client.srcPort); + } else if (client.nw_proto.equals(IpProtocol.UDP)) { + mb.setExact(MatchField.UDP_SRC, client.srcPort); + } else if (client.nw_proto.equals(IpProtocol.SCTP)) { + mb.setExact(MatchField.SCTP_SRC, client.srcPort); + } else { + log.error("Unknown IpProtocol {} detected during inbound static VIP route push.", client.nw_proto); + } if (sw.equals(pinSwitch.getId())) { - actionString = "set-dst-ip="+IPv4.fromIPv4Address(member.address)+"," + /*actionString = "set-dst-ip="+IPv4.fromIPv4Address(member.address)+"," + "set-dst-mac="+member.macString+"," - + "output="+path.get(i+1).getPortId(); + + "output="+path.get(i+1).getPortId(); */ + if (pinSwitch.getOFFactory().getVersion().compareTo(OFVersion.OF_12) < 0) { + actions.add(pinSwitch.getOFFactory().actions().setDlDst(MacAddress.of(member.macString))); + actions.add(pinSwitch.getOFFactory().actions().setNwDst(IPv4Address.of(member.address))); + actions.add(pinSwitch.getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); + } else { // OXM introduced in OF1.2 + actions.add(pinSwitch.getOFFactory().actions().setField(pinSwitch.getOFFactory().oxms().ethDst(MacAddress.of(member.macString)))); + actions.add(pinSwitch.getOFFactory().actions().setField(pinSwitch.getOFFactory().oxms().ipv4Dst(IPv4Address.of(member.address)))); + actions.add(pinSwitch.getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); + } } else { - actionString = - "output="+path.get(i+1).getPortId(); + actions.add(switchService.getSwitch(path.get(i+1).getNodeId()).getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); + /*actionString = + "output="+path.get(i+1).getPortId(); */ } } else { entryName = "outbound-vip-"+ member.vipId+"-client-"+client.ipAddress+"-port-"+client.targetPort +"-srcswitch-"+path.get(0).getNodeId()+"-sw-"+sw; - matchString = MatchUtils.STR_NW_DST + "="+client.ipAddress.toString()+"," + /*matchString = MatchUtils.STR_NW_DST + "="+client.ipAddress.toString()+"," + MatchUtils.STR_NW_PROTO + "="+client.nw_proto.toString()+"," + MatchUtils.STR_TP_DST + "="+client.srcPort.toString()+"," + MatchUtils.STR_DL_TYPE + "="+LB_ETHER_TYPE+"," - + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString(); - + + MatchUtils.STR_IN_PORT + "="+path.get(i).getPortId().toString();*/ + mb.setExact(MatchField.ETH_TYPE, EthType.IPv4) + .setExact(MatchField.IP_PROTO, client.nw_proto) + .setExact(MatchField.IPV4_DST, client.ipAddress) + .setExact(MatchField.IN_PORT, path.get(i).getPortId()); + if (client.nw_proto.equals(IpProtocol.TCP)) { + mb.setExact(MatchField.TCP_DST, client.srcPort); + } else if (client.nw_proto.equals(IpProtocol.UDP)) { + mb.setExact(MatchField.UDP_DST, client.srcPort); + } else if (client.nw_proto.equals(IpProtocol.SCTP)) { + mb.setExact(MatchField.SCTP_DST, client.srcPort); + } else { + log.error("Unknown IpProtocol {} detected during outbound static VIP route push.", client.nw_proto); + } + if (sw.equals(pinSwitch.getId())) { - actionString = ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_NW_SRC + MatchUtils.SET_FIELD_DELIM + IPv4.fromIPv4Address(vips.get(member.vipId).address)+"," + /*actionString = ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_NW_SRC + MatchUtils.SET_FIELD_DELIM + IPv4.fromIPv4Address(vips.get(member.vipId).address)+"," + ActionUtils.STR_FIELD_SET + "=" + MatchUtils.STR_DL_SRC + MatchUtils.SET_FIELD_DELIM + vips.get(member.vipId).proxyMac.toString()+"," - + ActionUtils.STR_OUTPUT + "=" + path.get(i+1).getPortId(); + + ActionUtils.STR_OUTPUT + "=" + path.get(i+1).getPortId(); */ + if (pinSwitch.getOFFactory().getVersion().compareTo(OFVersion.OF_12) < 0) { + actions.add(pinSwitch.getOFFactory().actions().setDlSrc(vips.get(member.vipId).proxyMac)); + actions.add(pinSwitch.getOFFactory().actions().setNwSrc(IPv4Address.of(vips.get(member.vipId).address))); + actions.add(pinSwitch.getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); + } else { // OXM introduced in OF1.2 + actions.add(pinSwitch.getOFFactory().actions().setField(pinSwitch.getOFFactory().oxms().ethSrc(vips.get(member.vipId).proxyMac))); + actions.add(pinSwitch.getOFFactory().actions().setField(pinSwitch.getOFFactory().oxms().ipv4Src(IPv4Address.of(vips.get(member.vipId).address)))); + actions.add(pinSwitch.getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); + } } else { - actionString = ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); + /* actionString = ActionUtils.STR_OUTPUT + "="+path.get(i+1).getPortId(); */ + actions.add(switchService.getSwitch(path.get(i+1).getNodeId()).getOFFactory().actions().output(path.get(i+1).getPortId(), Integer.MAX_VALUE)); } } - ActionUtils.fromString(fmb, actionString, log); + /*ActionUtils.fromString(fmb, actionString, log);*/ + fmb.setActions(actions); fmb.setPriority(U16.t(LB_PRIORITY)); - Match match = null; + /* Match match = null; try { match = MatchUtils.fromString(matchString, pinSwitch.getOFFactory().getVersion()); } catch (IllegalArgumentException e) { log.debug("ignoring flow entry {} on switch {} with illegal OFMatch() key: " + matchString, entryName, swString); - } + } - fmb.setMatch(match); + fmb.setMatch(match); */ + fmb.setMatch(mb.build()); sfpService.addFlow(entryName, fmb.build(), sw); - } } return; diff --git a/src/main/java/net/floodlightcontroller/util/FlowModUtils.java b/src/main/java/net/floodlightcontroller/util/FlowModUtils.java index 94ddeeb6eccd79bba2b8d3ddbcee8a952e338aea..9a8d6cdbdeaada086daa8f8627da1c426d3f5f1c 100644 --- a/src/main/java/net/floodlightcontroller/util/FlowModUtils.java +++ b/src/main/java/net/floodlightcontroller/util/FlowModUtils.java @@ -20,7 +20,7 @@ import org.projectfloodlight.openflow.protocol.OFVersion; */ public class FlowModUtils { public static final int INFINITE_TIMEOUT = 0; - + public static final int PRIORITY_MAX = 32768; public static final int PRIORITY_VERY_HIGH = 28672; public static final int PRIORITY_HIGH = 24576; @@ -30,104 +30,195 @@ public class FlowModUtils { public static final int PRIORITY_LOW = 8192; public static final int PRIORITY_VERY_LOW = 4096; public static final int PRIORITY_MIN = 0; - + public static OFFlowAdd toFlowAdd(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowAdd.Builder b = OFFactories.getFactory(version).buildFlowAdd(); - return b.setActions(fm.getActions()) - .setBufferId(fm.getBufferId()) - .setCookie(fm.getCookie()) - .setCookieMask(fm.getCookieMask()) - .setFlags(fm.getFlags()) - .setHardTimeout(fm.getHardTimeout()) - .setIdleTimeout(fm.getIdleTimeout()) - .setInstructions(fm.getInstructions()) - .setMatch(fm.getMatch()) - .setOutGroup(fm.getOutGroup()) - .setOutPort(fm.getOutPort()) - .setPriority(fm.getPriority()) - .setTableId(fm.getTableId()) - .setXid(fm.getXid()) - .build(); + + if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + // cookie-mask not supported + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + // instructions not supported + .setMatch(fm.getMatch()) + // out-group not supported + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + // table-id not supported + .setXid(fm.getXid()) + .build(); + } else { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + .setCookieMask(fm.getCookieMask()) // added in OF1.1 + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + .setInstructions(fm.getInstructions()) // added in OF1.1 + .setMatch(fm.getMatch()) + .setOutGroup(fm.getOutGroup()) // added in OF1.1 + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + .setTableId(fm.getTableId()) + .setXid(fm.getXid()) + .build(); + } } public static OFFlowDelete toFlowDelete(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowDelete.Builder b = OFFactories.getFactory(version).buildFlowDelete(); - return b.setActions(fm.getActions()) - .setBufferId(fm.getBufferId()) - .setCookie(fm.getCookie()) - .setCookieMask(fm.getCookieMask()) - .setFlags(fm.getFlags()) - .setHardTimeout(fm.getHardTimeout()) - .setIdleTimeout(fm.getIdleTimeout()) - .setInstructions(fm.getInstructions()) - .setMatch(fm.getMatch()) - .setOutGroup(fm.getOutGroup()) - .setOutPort(fm.getOutPort()) - .setPriority(fm.getPriority()) - .setTableId(fm.getTableId()) - .setXid(fm.getXid()) - .build(); + if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + // cookie-mask not supported + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + // instructions not supported + .setMatch(fm.getMatch()) + // out-group not supported + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + // table-id not supported + .setXid(fm.getXid()) + .build(); + } else { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + .setCookieMask(fm.getCookieMask()) // added in OF1.1 + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + .setInstructions(fm.getInstructions()) // added in OF1.1 + .setMatch(fm.getMatch()) + .setOutGroup(fm.getOutGroup()) // added in OF1.1 + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + .setTableId(fm.getTableId()) + .setXid(fm.getXid()) + .build(); + } } public static OFFlowDeleteStrict toFlowDeleteStrict(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowDeleteStrict.Builder b = OFFactories.getFactory(version).buildFlowDeleteStrict(); - return b.setActions(fm.getActions()) - .setBufferId(fm.getBufferId()) - .setCookie(fm.getCookie()) - .setCookieMask(fm.getCookieMask()) - .setFlags(fm.getFlags()) - .setHardTimeout(fm.getHardTimeout()) - .setIdleTimeout(fm.getIdleTimeout()) - .setInstructions(fm.getInstructions()) - .setMatch(fm.getMatch()) - .setOutGroup(fm.getOutGroup()) - .setOutPort(fm.getOutPort()) - .setPriority(fm.getPriority()) - .setTableId(fm.getTableId()) - .setXid(fm.getXid()) - .build(); + if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + // cookie-mask not supported + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + // instructions not supported + .setMatch(fm.getMatch()) + // out-group not supported + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + // table-id not supported + .setXid(fm.getXid()) + .build(); + } else { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + .setCookieMask(fm.getCookieMask()) // added in OF1.1 + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + .setInstructions(fm.getInstructions()) // added in OF1.1 + .setMatch(fm.getMatch()) + .setOutGroup(fm.getOutGroup()) // added in OF1.1 + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + .setTableId(fm.getTableId()) + .setXid(fm.getXid()) + .build(); + } } public static OFFlowModify toFlowModify(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowModify.Builder b = OFFactories.getFactory(version).buildFlowModify(); - return b.setActions(fm.getActions()) - .setBufferId(fm.getBufferId()) - .setCookie(fm.getCookie()) - .setCookieMask(fm.getCookieMask()) - .setFlags(fm.getFlags()) - .setHardTimeout(fm.getHardTimeout()) - .setIdleTimeout(fm.getIdleTimeout()) - .setInstructions(fm.getInstructions()) - .setMatch(fm.getMatch()) - .setOutGroup(fm.getOutGroup()) - .setOutPort(fm.getOutPort()) - .setPriority(fm.getPriority()) - .setTableId(fm.getTableId()) - .setXid(fm.getXid()) - .build(); + if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + // cookie-mask not supported + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + // instructions not supported + .setMatch(fm.getMatch()) + // out-group not supported + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + // table-id not supported + .setXid(fm.getXid()) + .build(); + } else { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + .setCookieMask(fm.getCookieMask()) // added in OF1.1 + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + .setInstructions(fm.getInstructions()) // added in OF1.1 + .setMatch(fm.getMatch()) + .setOutGroup(fm.getOutGroup()) // added in OF1.1 + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + .setTableId(fm.getTableId()) + .setXid(fm.getXid()) + .build(); + } } public static OFFlowModifyStrict toFlowModifyStrict(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowModifyStrict.Builder b = OFFactories.getFactory(version).buildFlowModifyStrict(); - return b.setActions(fm.getActions()) - .setBufferId(fm.getBufferId()) - .setCookie(fm.getCookie()) - .setCookieMask(fm.getCookieMask()) - .setFlags(fm.getFlags()) - .setHardTimeout(fm.getHardTimeout()) - .setIdleTimeout(fm.getIdleTimeout()) - .setInstructions(fm.getInstructions()) - .setMatch(fm.getMatch()) - .setOutGroup(fm.getOutGroup()) - .setOutPort(fm.getOutPort()) - .setPriority(fm.getPriority()) - .setTableId(fm.getTableId()) - .setXid(fm.getXid()) - .build(); + if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + // cookie-mask not supported + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + // instructions not supported + .setMatch(fm.getMatch()) + // out-group not supported + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + // table-id not supported + .setXid(fm.getXid()) + .build(); + } else { + return b.setActions(fm.getActions()) + .setBufferId(fm.getBufferId()) + .setCookie(fm.getCookie()) + .setCookieMask(fm.getCookieMask()) // added in OF1.1 + .setFlags(fm.getFlags()) + .setHardTimeout(fm.getHardTimeout()) + .setIdleTimeout(fm.getIdleTimeout()) + .setInstructions(fm.getInstructions()) // added in OF1.1 + .setMatch(fm.getMatch()) + .setOutGroup(fm.getOutGroup()) // added in OF1.1 + .setOutPort(fm.getOutPort()) + .setPriority(fm.getPriority()) + .setTableId(fm.getTableId()) + .setXid(fm.getXid()) + .build(); + } } } diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule index 40d0cd1bc7e878267c1a195708b9c5ef1094809b..b78286cb5786bdfe789940612061b096e130127b 100644 --- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule +++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule @@ -16,7 +16,6 @@ net.floodlightcontroller.threadpool.ThreadPool net.floodlightcontroller.core.internal.ShutdownServiceImpl org.sdnplatform.sync.internal.SyncManager org.sdnplatform.sync.internal.SyncTorture -net.floodlightcontroller.hub.Hub net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher net.floodlightcontroller.testmodule.TestModule net.floodlightcontroller.topology.TopologyManager diff --git a/src/main/resources/floodlightdefault.properties b/src/main/resources/floodlightdefault.properties index 8ba99cf659ec268f1a1f4d001c110da83959b6a7..8bdd1595573645221f3102077c4b0144dcd12dc0 100644 --- a/src/main/resources/floodlightdefault.properties +++ b/src/main/resources/floodlightdefault.properties @@ -12,6 +12,7 @@ net.floodlightcontroller.topology.TopologyManager,\ net.floodlightcontroller.forwarding.Forwarding,\ net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager,\ net.floodlightcontroller.ui.web.StaticWebRoutable,\ +net.floodlightcontroller.loadbalancer.LoadBalancer,\ net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl org.sdnplatform.sync.internal.SyncManager.authScheme=CHALLENGE_RESPONSE org.sdnplatform.sync.internal.SyncManager.keyStorePath=/etc/floodlight/auth_credentials.jceks diff --git a/src/main/resources/logback-test.xml b/src/main/resources/logback-test.xml index c80889cac1cf1411fe6db835c25a1011e7364ad0..1f07e3d620e083d0ed12dba4956b04ba0605833d 100644 --- a/src/main/resources/logback-test.xml +++ b/src/main/resources/logback-test.xml @@ -6,16 +6,17 @@ </appender> <appender name="EV_WARN_ERR" class="net.floodlightcontroller.debugevent.DebugEventAppender"> </appender> - <root level="TRACE"> + <root level="DEBUG"> <appender-ref ref="STDOUT" /> <appender-ref ref="EV_WARN_ERR" /> </root> - <logger name="org" level="TRACE"/> - <logger name="LogService" level="TRACE"></logger> <!-- Restlet access logging --> + <logger name="org" level="DEBUG"/> + <logger name="LogService" level="DEBUG"></logger> <!-- Restlet access logging --> <logger name="net.floodlightcontroller" level="DEBUG"/> <logger name="org.sdnplatform" level="INFO"></logger> - <logger name="net.floodlightcontroller.devicemanager" level="TRACE"></logger> - <logger name="net.floodlightcontroller.packet" level="TRACE"></logger> - <logger name="net.floodlightcontroller.forwarding" level="TRACE"></logger> - <logger name="net.floodlightcontroller.routing" level="TRACE"></logger> + <logger name="net.floodlightcontroller.devicemanager" level="DEBUG"></logger> + <logger name="net.floodlightcontroller.packet" level="DEBUG"></logger> + <logger name="net.floodlightcontroller.forwarding" level="DEBUG"></logger> + <logger name="net.floodlightcontroller.routing" level="DEBUG"></logger> + <logger name="net.floodlightcontroller.core" level="DEBUG"></logger> </configuration>