BFD support

Registered by Bartek Wolowiec

This is a proposition of using BFD in OpenContrail to improve connection problem detection. BFD is a simple protocol intended to detect connection faults, described in RFC5880

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Bartek Wolowiec
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Here is a list of planned implementation details:
-BFD monitoring functionality can be easily enabled or disabled by configuration
-Important connections like XMPP (control node to vrouter agent) or BGP (control node to control node) are guarded by BFD connection between hosts
-Every host runs an independent process providing BFD monitoring service (high reusability between different services)
-BFD daemon is stateless - after restart every session should be reconfigured
-Config node, vrouter agent and others connect to local BFD service and setup BFD session using RESTful API (based on configuration), and then monitor session state
-BFD implementation supports async mode; Initial version does not support demand mode, echo and authentication
-if BFD session state is DOWN, guarded connection is assumed to be broken and corresponding actions are taken; INIT / ERROR states don’t provide any information about guarded connection

Communication with BFD daemon is done by HTTP requests / responses.

1. Create client session:
/Session
The server creates a new client session and sends new clientId in response. The client session will be destroyed on socket close.

2. Configure BFD sessions (names from RFC5880). BFD session is connected with client session, so if client session is destroyed, all BFD sessions are also destroyed. If multiple clients configure BFD session with the same host there will be only one real BFD session with min/max configuration.
/Session/{clientId}/IpConnection/{ip}
-Address (IPv4, Interface)
-DesiredMinTxInterval (microseconds)
-RequiredMinRxInterval (microseconds)
-DetectionMultiplier
-LocalDiscriminator (associated by the server)

3. Get current session state (names from RFC5880):
/State/{LocalDiscriminator}:
-LocalDiscriminator
-RemoteDiscriminator
-SessionState
-RemoteSessionState
-LocalDiagnostic
-DesiredMinTxInterval (microseconds)
-RequiredMinRxInterval (microseconds)
-RemoteMinRxInterval (microseconds)

4. Configured session can be monitored by HTTP long pull request (RFC6202).
/MonitorSession/{clientId}
Server in response sends changed from last request BFD session state, or wait if there is no change.
-Remote host address
-LocalDiscriminator
-Current state

Possible states:
- INIT
- UP
- DOWN
- ERROR (wrong config, internal error)
- UNKOWN_SESSION_ID
If the state is UNKOWN_SESSION_ID (e.g. after BFD daemon or client restart), the session must be reconfigured by client.

OpenContrail configuration - new node in global-system-config with following entries:
- Enable / disable flag
- DesiredMinTxInterval
- RequiredMinRxInterval
- DetectionMultiplier

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.