Java 类net.floodlightcontroller.core.internal.Controller 实例源码

项目:iTAP-controller    文件:OFConnection.java   
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
项目:QoS-floodlight    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc) {
    if (channel == null || !isConnected())
        return;
        //throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:fast-failover-demo    文件:OFConnection.java   
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
项目:floodlightLB    文件:OFConnection.java   
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
项目:DSC    文件:OFConnection.java   
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
项目:floodlight_with_topoguard    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc) {
    if (channel == null || !isConnected())
        return;
        //throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:floodlight    文件:OFConnection.java   
@Override
public void write(OFMessage m) {
    if (!isConnected()) {
        if (logger.isDebugEnabled())
            logger.debug("{}: not connected - dropping message {}", this, m);
        return;
    }
    if (logger.isDebugEnabled())
        logger.debug("{}: send {}", this, m);
    List<OFMessage> msgBuffer = localMsgBuffer.get();
    if (msgBuffer == null) {
        msgBuffer = new ArrayList<OFMessage>();
        localMsgBuffer.set(msgBuffer);
    }

    counters.updateWriteStats(m);
    msgBuffer.add(m);

    if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msgBuffer);
        localMsgBuffer.set(null);
    }
}
项目:FloodligtModule    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc) {
    if (channel == null || !isConnected())
        return;
        //throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:multicastSDN    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc) {
    if (channel == null || !isConnected())
        return;
        //throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:floodlight-nfv    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc)
        throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:floodlight-oss    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc)
        throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:FL_HAND    文件:OFSwitchBase.java   
@Override
public void write(OFMessage m, FloodlightContext bc)
        throws IOException {
    Map<IOFSwitch,List<OFMessage>> msg_buffer_map = local_msg_buffer.get();
    List<OFMessage> msg_buffer = msg_buffer_map.get(this);
    if (msg_buffer == null) {
        msg_buffer = new ArrayList<OFMessage>();
        msg_buffer_map.put(this, msg_buffer);
    }

    this.floodlightProvider.handleOutgoingMessage(this, m, bc);
    msg_buffer.add(m);

    if ((msg_buffer.size() >= Controller.BATCH_MAX_SIZE) ||
        ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
        this.write(msg_buffer);
        msg_buffer.clear();
    }
}
项目:fresco_floodlight    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:fresco_floodlight    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:iTAP-controller    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:iTAP-controller    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:SDN-Multicast    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:SDN-Multicast    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:arscheduler    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:arscheduler    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlight1.2-delay    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:floodlight1.2-delay    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlight-hardware    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:floodlight-hardware    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:ACAMPController    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:ACAMPController    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:fast-failover-demo    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:fast-failover-demo    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlightLB    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:floodlightLB    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:DSC    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:DSC    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>, IFloodlightService> m = new HashMap<Class<? extends IFloodlightService>, IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:Multipath-Hedera-system-in-Floodlight-controller    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m = 
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlight    文件:FlowReconcileManager.java   
/**
 * Compute the maximum number of flows to be reconciled.
 *
 * It computes the packetIn increment from the counter values in
 * the counter store;
 * Then computes the rate based on the elapsed time
 * from the last query;
 * Then compute the max flow reconcile rate by subtracting the packetIn
 * rate from the hard-coded max system rate.
 * If the system rate is reached or less than MIN_FLOW_RECONCILE_PER_SECOND,
 * set the maximum flow reconcile rate to the MIN_FLOW_RECONCILE_PER_SECOND
 * to prevent starvation.
 * Then convert the rate to an absolute number for the
 * FLOW_RECONCILE_PERIOD.
 * @return
 */
protected int getCurrentCapacity() {
    int minFlows = MIN_FLOW_RECONCILE_PER_SECOND * FLOW_RECONCILE_DELAY_MILLISEC / 1000;

    List<DebugCounterResource> contCtrRsrcList = debugCounterService.getModuleCounterValues(Controller.class.getName());
    for (DebugCounterResource dcr : contCtrRsrcList) {
        if (dcr.getCounterHierarchy().equals("packet-in")) {
            ctrPacketInRsrc = dcr;
            break;
        }
    }

    // If no packetInCounter, then there shouldn't be any flow.
    if (ctrPacketInRsrc == null || ctrPacketInRsrc.getCounterValue() == null || ctrPacketInRsrc.getCounterValue() == 0) {
        logger.debug("counter {} doesn't exist", ctrPacketInRsrc);
        return minFlows;
    }

    // We're the first packet_in
    if (lastPacketInCounter.getCounterValue() == 0) {
        logger.debug("First time get the count for {}", lastPacketInCounter);
        return minFlows;
    }

    int pktInRate = getPktInRate(ctrPacketInRsrc, new Date());

    // Update the last packetInCounter
    lastPacketInCounter.reset();
    int capacity = minFlows;
    if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
            MAX_SYSTEM_LOAD_PER_SECOND) {
        capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
                * FLOW_RECONCILE_DELAY_MILLISEC / 1000;
    }

    if (logger.isTraceEnabled()) {
        logger.trace("Capacity is {}", capacity);
    }
    return capacity;
}
项目:floodlight    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:smartenit    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m = 
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:spring-open    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlight-qosmanager    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m = 
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:floodlight-nfv    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m =
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}
项目:HederaInFloodlight    文件:FloodlightProvider.java   
@Override
public Map<Class<? extends IFloodlightService>,
           IFloodlightService> getServiceImpls() {
    controller = new Controller();

    Map<Class<? extends IFloodlightService>,
        IFloodlightService> m = 
            new HashMap<Class<? extends IFloodlightService>,
                        IFloodlightService>();
    m.put(IFloodlightProviderService.class, controller);
    return m;
}