kytos-ng / of_lldp

Kytos LLDP Openflow Network Application (NApp)
https://kytos-ng.github.io/api/of_lldp.html
MIT License
0 stars 3 forks source link

Avoid sending LLDP packets to certain ports #68

Open italovalcy opened 1 year ago

italovalcy commented 1 year ago

Testing Kytos with a Noviflow switch which have a BFD logical port returns the following error:

2022-11-07 16:03:59,491 - INFO [kytos.napps.kytos/of_core] (MainThread) Modified Interface('novi_lport1002', 1002, Switch('00:00:00:00:00:00:00:02')) 00:00:00:00:00:00:00:02:1002
2022-11-07 16:04:00,914 - ERROR [kytos.napps.kytos/of_core] (MainThread) OFPT_ERROR: type ErrorType.OFPET_BAD_ACTION, error code 4, from switch 00:00:00:00:00:00:00:02, xid 2997175759/0xb2a545cf

This happens because Noviflow logicalport of the type BFD does not support PacketOut (quoting the Noviflow docs: It is NOT possible to MATCH on BFD Logical ports, nor is it possible to output to a BFD Logical port - NF200157). On the other hand, there is no easy way to identify this type of port:

One possible solution would be to handle this when it happens and avoid sending future LLDP on ports that returned BAD_ACTION (should we stop sending until the operator clears that port? test from time to time to resume normal operation?). Maybe a lightweight blueprint to cover this point.

italovalcy commented 1 year ago

Observation 1: To clarify, this typically happens when you enable all the ports on the switch (usually when running kytos with -E). If the admin selectively disables ports like this, the message will not happen.

Observation 2: despite de log message being quite annoying and raising attention to something that is unnecessary, no side effects were observed (no degradation to the system other than sending unnecessary packet-out and unnecessary log messages).

Observation 3: it is possible to work around this by explicitly setting the corresponding interface as of_lldp=False.

italovalcy commented 1 year ago

@jab1982 has suggested that of_lldp should listen to those events (of_errors) and log a new message saying that the port does not support LLDP, asking for action from the network operator (e.g., disabling LLDP on Kytos)

viniarck commented 8 months ago

I'll st this under the epic_of_lldp_flows_per_interface for visibility and since it's related.