---
# System prepended metadata

title: ECM Disocvery and Automatic Co

---

# ECM Discovery and Automatic Configuration
## ECM configuration cases
### 1. Service discovered prior to timeout
The ECM service has been discovered and resolved prior to the first multicast timeout. Multicast never returns. We have what we need to configure the balancer successfully, and we receive unicast. Multicast reappears later.

Result: Receive unicast forever. Ignore multicast after configuration is successful.

```plantuml
@startuml
participant CS
participant Network
participant ECM
group #lightgreen Service discovery
    CS <- Network: ECM service discovered
    CS -> Network: Resolve service
    CS <- Network: Service resolved
end
...
note over CS #red: Multicast timeout
loop #lightgreen Configuration procedure
    CS -> Network: Resolve host
    CS <- Network: Host resolved
    CS -> ECM: Configuration request
    CS <- ECM: Configuration response
end
...
note over CS #lightgreen: Receiving unicast messages
note over CS #orange: Multicast message ignored
@enduml
```

## 2. Service never discovered
No ECM service is discovered. Multicast timeout.

Result: Keep accepting multicast messages.
```plantuml
@startuml
participant CS
participant Network
participant ECM
note over CS #red: Multicast timeout
...
note over CS #lightgreen: Multicast message received
...
note over CS #red: Multicast timeout
@enduml
```

## 3. Service discovered, ECM configuration fails
When multicast times out, we start configuration of the ECM that has previously been discovered. Multicast messages start appearing again while configuration keeps failing.

Result: ?

```plantuml
@startuml
participant CS
participant Network
participant ECM
group #lightgreen Service discovery
    CS <- Network: ECM service discovered
    CS -> Network: Resolve service
    CS <- Network: Service resolved
end
...
note over CS #red: Multicast timeout
group #lightgreen Host resolution
    CS -> Network: Resolve host
    CS <- Network: Host resolved
end
note over CS #lightgreen: Multicast message received
note right ECM #pink: Configuration procedure is failing forever
loop #pink Configuration procedure    
    CS -> ECM: Configuration request
    CS <- ECM: Configuration response
end
note over CS #orange: Multicast message ignored
note over CS #orange: Multicast message ignored
@enduml
```

### 4. Balancer reboots after unicast has been configured
Both multicast and unicast messages are received. The balancer reboots so both sources time out. Then multicast messages start appearing and the ECM service gets discovered


Result: Stick with unicast forever. Multicast is ignored if present after ECM reboot.

```plantuml
@startuml
participant CS
participant Network
participant ECM

note over CS #lightgreen: Unicast message used
note over CS #orange: Multicast message ignored

note over ECM: ECM shuts down

note over CS #red: Unicast message timeout
note over CS #red: Multicast message timeout

note over ECM: ECM Reappears

note over CS #orange: Multicast message ignored

group #lightgreen Service discovery
    CS <- Network: ECM service discovered
    CS -> Network: Resolve service
    CS <- Network: Service resolved
end
...
loop #lightgreen Configuration procedure
    CS -> Network: Resolve host
    CS <- Network: Host resolved
    CS -> ECM: Configuration request
    CS <- ECM: Configuration response
end
...
note over CS #lightgreen: Receiving unicast messages
note over CS #orange: Multicast message ignored
@enduml
```
