facebook / fboss

Facebook Open Switching System Software for controlling network switches.
Other
860 stars 295 forks source link

Does`parserType` set to `0` works as expected ? #73

Closed ggiamarchi closed 6 years ago

ggiamarchi commented 6 years ago

On a Wedge 16x I'm running FBOSS version a376ab2 compiled from sources and running on ONL-DEB8 with kernel 3.16.53. I'm using the configuration fboss/agent/configs/sample1.json.

In this configuration, parserType is set to 0 for all ports. By the way I see in logs information about IP addresses.

https://github.com/facebook/fboss/blob/a376ab24f4cde708f1c2192700837a99210db57f/fboss/agent/switch_config.thrift#L20-L29

Example

E0824 16:10:56.229668  2927 SwSwitch.cpp:1032] error processing trapped packet: N8facebook5fboss10FbossErrorE: No interface with ip : 255.255.255.255

And FBOSS is crashing when handling IPv6 packets

*** Aborted at 1535125247 (unix time) try "date -d @1535125247" if you are using GNU date ***
PC: @     0x7f3cf2237b4a boost::container::flat_map<>::end()
*** SIGSEGV (@0x50) received by PID 2662 (TID 0x7f3cf0ce7700) from PID 80; stack trace: ***
    @     0x7f3ceed1e0c0 (unknown)
    @     0x7f3cf2237b4a boost::container::flat_map<>::end()
    @     0x7f3cf2236836 facebook::fboss::Interface::hasAddress()
    @     0x7f3cf2433c41 facebook::fboss::IPv6Handler::handlePacket()
    @     0x7f3cf22c5d9a facebook::fboss::SwSwitch::handlePacket()
    @     0x7f3cf22c5298 facebook::fboss::SwSwitch::packetReceived()
    @     0x7f3cf217c469 facebook::fboss::BcmSwitch::packetReceived()
    @     0x7f3cf217c37b facebook::fboss::BcmSwitch::packetRxCallback()
    @     0x7f3cebeae031 (unknown)
    @     0x7f3cebeaea31 (unknown)
    @     0x7f3cebeb3984 (unknown)
    @     0x7f3cec5aadae (unknown)
    @     0x7f3ceed14494 start_thread
    @     0x7f3ce8c9dacf clone
    @                0x0 (unknown)

It looks like with only IPv4 traffic I don't get any crash.

For now, my priority is to use my switchs as basic L2 switchs.

Any ideas ?

capveg commented 6 years ago

Short story - afaict, ParseType is unused in the current code at all. I've actually never seen this referenced before and will have to do some digging to better understand what it (historically?) was supposed to do. The only reference to it that I see is in a test for our packet capture feature. So bottom line - no, this does not do what the comment implies.

ggiamarchi commented 6 years ago

I see... I should have searched in the code first. It was straightforward. Is there any other way to prevent FBOSS reading L3 information?

So far, I don't know exactly why FBOSS crash. Maybe the IPv6 stack on some servers connected to the Wedge is broken (some experimental things) but for this use case I need only L2 features on the Wedge.