Skip to content
Snippets Groups Projects
Commit 257e1ee7 authored by Shudong Zhou's avatar Shudong Zhou
Browse files

Do not flood packets on a switch in overload

parent 19bc7f8a
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,14 @@ public interface IOFSwitch { ...@@ -114,6 +114,14 @@ public interface IOFSwitch {
*/ */
public boolean inputThrottled(OFMessage ofm); public boolean inputThrottled(OFMessage ofm);
/**
* Return if the switch is currently overloaded. The definition of
* overload refers to excessive traffic in the control path, namely
* a high packet in rate.
* @return
*/
boolean isOverloaded();
/** /**
* Write OFMessage to the output stream, subject to switch rate limiting. * Write OFMessage to the output stream, subject to switch rate limiting.
* The message will be handed to the floodlightProvider for possible filtering * The message will be handed to the floodlightProvider for possible filtering
......
...@@ -787,6 +787,15 @@ public abstract class OFSwitchBase implements IOFSwitch { ...@@ -787,6 +787,15 @@ public abstract class OFSwitchBase implements IOFSwitch {
packetInRatePerPortThreshold = pktInPerPort; packetInRatePerPortThreshold = pktInPerPort;
} }
/**
* Return if switch has exceeded the high threshold of packet in rate.
* @return
*/
@Override
public boolean isOverloaded() {
return packetInThrottleEnabled;
}
/** /**
* Determine if this message should be dropped. * Determine if this message should be dropped.
* *
......
...@@ -439,4 +439,10 @@ public class OFMessageDamperMockSwitch implements IOFSwitch { ...@@ -439,4 +439,10 @@ public class OFMessageDamperMockSwitch implements IOFSwitch {
return false; return false;
} }
@Override
public boolean isOverloaded() {
// TODO Auto-generated method stub
return false;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment