telstra / open-kilda

OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.
Apache License 2.0
78 stars 53 forks source link

Flow: LAG port: Flow creation has been failed due to the java.lang.IllegalArgumentException: Invalid inputPort #5539

Closed yuliiamir closed 6 months ago

yuliiamir commented 9 months ago

The issue has been caught during testing server42-related changes. The flow creation has been failed due to the error: java.lang.IllegalArgumentException: Invalid inputPort 2396. Valid range [0, 2047] STR:

  1. Create LAG port.
  2. Create flow with this port. Actual result: Command <ingress-flow-segment-INSTALL{id=4f6690e0-b471-11ee-9025-9d159190cbd8, metadata=FlowSegmentMetadata(flowId=16Jan131523_973_strawberries0141, cookie=0x4000000000003DD9, multiTable=true), endpoint=switchId="00:00:00:22:3d:6b:00:7a" port=2396 vlanId=471, isl_port=7, encapsulation=FlowTransitEncapsulation(id=3927, type=TRANSIT_VLAN), meterConfig=MeterConfig(id=MeterId(value=1768), bandwidth=500)}> on 00:00:00:22:3d:6b:00:7a have failed with error: java.lang.IllegalArgumentException: Invalid inputPort 2396. Valid range [0, 2047] (exec time: PT0.021S)

To reproduce this issue run TC: Rtt statistic is available for a flow on a LAG port *sometimes test passes when LAG port is in the range

niksv commented 9 months ago

It is a bug in the server42 code.

Default max logical port numbe is 2999 https://github.com/telstra/open-kilda/blob/03bb40316725d10e343c8df1baae82b5b177331d/src-java/swmanager-topology/swmanager-storm-topology/src/main/java/org/openkilda/wfm/topology/switchmanager/SwitchManagerTopologyConfig.java#L81

Pablo decreased count of port numbers in metadata from 4096 to 2048 here https://github.com/telstra/open-kilda/pull/5353/files#diff-ccc74053a5cf5eb6fbd479a191365bf1f72d0e2cd74d880cfaa0a4184786018aR40

KIlda pick a port number 2396 which is out of range [0, 2047] but fits in max port value 2999

That is why Kilda raised the error. @pablomuri Please take a look