ljerezchaves / ofswitch13

OFSwitch13: OpenFlow 1.3 module for ns-3.
http://www.lrc.ic.unicamp.br/ofswitch13/
GNU General Public License v2.0
24 stars 16 forks source link

SIGSEGV at OFSwitch13Device #45

Closed RuiCunhaM closed 1 year ago

RuiCunhaM commented 2 years ago

Hello, I'm experiencing some issues when running large scale and long simulations using ofswitch13. After a while the program receives a segmentation fault at OFSwitch13Device::BufferPacketRetrieve. In shorter simulations the module appears to work without problems, so I was not yet able to identify what is the cause of the problem. Or if this occurs in time consuming simulations (multiple hours), due to large amounts of traffic or when dealing with multiple data streams at the same time.

I've attached a gdb output showing the issue. gdboutput.txt

ljerezchaves commented 1 year ago

Hi,

When the switch receives a packet with no matching rules to apply, it can buffer the packet and send a packet-in message to controller. The controller can decide what to do with the packet and sends back a packet-out message to the switch. Upon receiving this message, the switch retrieves the original packet from the buffer and execute the actions on it. The problem arrises when the packet is held too long in the buffer and expires, so the packet-out message won’t find the packet anymore.

The maximum time a packet is kept in the buffer is defined by the constant OVERWRITE_MSECS in the dp_buffers.c file of the BUFUSS library. Increasing this value can help with this problem, but on the other hand the buffer may fill up sooner. Another solution is to increase the buffer size, but this decreases the tag size to identify packets mapped to the same position on the buffer.

The commit 8280159652ffc4051f84145e81e16a09a1a48189 improves the buffer timeout resolution to msecs and increases the default value from 1 to 2 seconds. This commit also includes an NS_ABORT_MSG_IF clause to stop the simulation if this issue occurs. These changes will be included in the next release.