opennetworkinglab / flowvisor

FlowVisor - A network hypervisor
Other
164 stars 67 forks source link

Problem in setting flood status from PortMod messages. #271

Open torresGTA opened 10 years ago

torresGTA commented 10 years ago

From src/org/flowvisor/message/FVPortMod.java:

When receiving a PortMod message from a controller, FlowVisor must check if the message changes the Flood status for that port. Currently, the code implemented for that is the following.

 fvSlicer.setFloodPortStatus(this.portNumber,
    (this.mask & OFPhysicalPort.OFPortConfig.OFPPC_NO_FLOOD.getValue()) == 0);

Essentially, FlowVisor sets the Flood status of the port if the message's MASK param has the flood bit set. In other words, FlowVisor ALWAYS sets the Flood status to True when the MASK is True for the flood bit. The problem is that, even though the MASK Flood bit is set, the CONFIG param must be taken into account, since its bit defines if the new port status is True or False for flood. The way its implemented now, it is not possible for a slice to actively set a flood port status to False, since its only considering the MASK and not the actual desired CONFIG. Also, I think the FloodPortStatus should not be updated in every PortMod, but only if the MASK flood bit is set.

So, in order to take into account the Flood bit of the MASK and CONFIG params, I propose the following modification to the above mentioned code:

if ( (this.mask & OFPhysicalPort.OFPortConfig.OFPPC_NO_FLOOD.getValue() ) != 0 )
 {
  fvSlicer.setFloodPortStatus(this.portNumber,
     (this.config & OFPhysicalPort.OFPortConfig.OFPPC_NO_FLOOD.getValue()) == 0);
 }

This way, the flood port status is only set to True when the MASK is active for the flood bit, and the CONFIG bit is active (zero).