Open Charging Technology · Whitepapers

White Paper

CSMS Migration with EVQI Transport Extensions

Draft 0.1, 2026-12-02. A concept for discussion.

A charging station that moves from one Charging Station Management System (CSMS) to another is today switched over in one step: OCPP 2.x use case B10 Migrate to new CSMS writes a new network connection profile, changes the priority of the profile slots and resets the station. If the new CSMS does not answer, the station falls back to the old one. Nothing is tested before the reset, both back ends never see the station at the same time, and the new operator learns what it has bought only after it is in charge.

This paper describes a migration in which the station keeps two equal connections for a while: one to the old CSMS, which stays in charge, and one to the new CSMS, which is configured, tested and activated by the old one and then takes over by itself. It builds on the multi-homed station of EVQI Transport, chapter 11 (peers, endpoints, roles), and adds what that chapter left for later:

All statements about the reference implementation refer to the open source C# implementation in WWCP_Node, WWCP_OCPP and the EV Charging Test Environment, where the whole migration runs as one end-to-end test.

Contents

  1. Starting point
  2. The migration in six steps
  3. Model: what a peer gets
  4. Configuration via OCPP
  5. New messages
  6. Behaviour of the station during the migration
  7. Security considerations
  8. Example: the whole migration on the wire
  9. Reference implementation and test
  10. Amendments to EVQI Transport
  11. Open questions

1. Starting point

1.1 What OCPP offers

OCPP 1.6 (+ Security Whitepaper Ed. 3) OCPP 2.0.1 / 2.1
Where the CSMS is vendor configuration NetworkConnectionProfile in numbered slots (B09 SetNetworkProfile)
Migration none B10: new slot, new NetworkConfigurationPriority, reset; fallback to the old slot when the new one fails
Testing a new CSMS before the cut-over no no
Two CSMS at the same time no no: the slots are a failover list
Which connections the station has no no
Closing one connection no no

B10 is a sequential migration. Its weak points:

  1. The first contact is the cut-over. Whether the URL, the TLS server certificate, the credentials and the sub-protocol are right is found out at the reset that puts the new CSMS in charge.
  2. The fallback hides errors. A station that falls back to the old CSMS reports nothing about why the new one failed.
  3. The new CSMS starts blind. It sees the station for the first time with the BootNotification after the reset and must read the whole Device Model while it is already in charge, charging sessions included.
  4. There is no way to retire the old connection on purpose. It stays a slot, or it is removed by the new CSMS with SetNetworkProfile, which overwrites the slot and leaves nothing to fall back to.

1.2 What EVQI Transport chapter 11 adds

A multi-homed station keeps several peers connected at the same time: back ends with an identity, one or more endpoints and a role. Exactly one is the primary; the others are secondaries with explicit rights. Use case U1 of section 11.2.1 is exactly the CSMS migration: the new CSMS is a successor, receives everything the station reports, may read but not control, and is promoted by an explicit switchover (section 11.4.5).

Chapter 11 leaves open how a CSMS creates a successor via OCPP without slots, how it tests one before it is used, how it sees which connections a station has, and how one of them is ended. This paper fills these gaps, and changes one decision of section 11.4.5: here, a successor may take over by itself (section 3.3).

1.3 Requirements

ID Requirement
M1 The old CSMS configures the new connection without it being used yet.
M2 The old CSMS can test the new connection, and learns where it fails if it fails.
M3 The old CSMS activates the new connection; the station then keeps both and stays with the old CSMS.
M4 The new CSMS reads the station (Device Model, connections) before it takes over.
M5 The new CSMS takes over without a reset, without a gap in the connection, without losing a transaction.
M6 The old connection is ended on purpose, and kept as an on-demand connection: a way back.
M7 Every step works with OCPP 2.1 and with OCPP 1.6, and every step is logged and reported as a security event.
M8 A CSMS that knows nothing of this paper sees an ordinary station (EVQI R7).

2. The migration in six steps

sequenceDiagram
    autonumber
    participant Old as CSMS old (primary)
    participant CS as Charging station
    participant New as CSMS new

    CS->>Old: connects, BootNotification (1)
    Old->>CS: SetVariables OCPPPeerController[csms-new].Url, .Identity, .BasicAuthPassword, ... (2)
    Note over CS: peer csms-new: Successor, Persistent, Enabled = false
    Old->>CS: TestConnection csms-new (3)
    CS-->>New: connect once, Heartbeat, close
    CS->>Old: NotifyConnectionTestResult (ok, steps)
    Old->>CS: SetVariables OCPPPeerController[csms-new].Enabled = true (4)
    CS->>New: connects, BootNotification
    Note over CS: two valid CSMS connections, csms-old stays primary
    New->>CS: GetBaseReport FullInventory (5)
    CS->>New: NotifyReport ...
    New->>CS: SetVariables OCPPPeerController[csms-old].ConnectionMode = OnDemand
    Note over CS: switchover: csms-new is primary, csms-old is a Service peer, on demand
    CS->>Old: SecurityEventNotification PrimaryChanged
    CS->>New: SecurityEventNotification PrimaryChanged
    New->>CS: GetConnections (6)
    CS->>New: [ csms-old (id a1), csms-new (id b2, this connection) ]
    New->>CS: CloseConnection a1
    CS--xOld: closes
  1. The station boots and connects to the old CSMS. Nothing new: the old CSMS is the primary peer, csms-old.
  2. The old CSMS configures the new connection. It writes a new instance of OCPPPeerController, csms-new: URL, identity, credentials, OCPP version. A peer created via OCPP is a successor, its connection mode is Persistent, and it is not enabled: the station stores it and does not connect to it (section 3.1).
  3. The old CSMS tests the new connection. TestConnection makes the station connect to csms-new once, with exactly the configuration it would use, ask a Heartbeat, close, and report every step: name resolution, TCP, TLS and the server certificate, the WebSocket or SSH handshake with the sub-protocol, the answer to the Heartbeat. A test changes nothing and is allowed on a disabled peer; that is what it is for (section 5.1).
  4. The old CSMS activates the new connection. Enabled = true. The station connects to csms-new and keeps that connection up, registers there with a BootNotification of its own, and from then on has two valid CSMS connections. csms-old stays the primary: it owns new transactions, answers Authorize, and every request the station sends by itself goes there. csms-new receives what a successor receives (EVQI section 11.3.3) and may read the station.
  5. The new CSMS reads the station and takes over. It asks for the Device Model with GetBaseReport, which a successor may do; the NotifyReports go to the peer that asked. Then it sets the connection mode of csms-old from Persistent to OnDemand. A successor that puts the primary on demand takes over: the station makes csms-new the primary and csms-old a Service peer, which is connected to on demand only (section 3.3). Both are told with a security event PrimaryChanged. Transactions that csms-old started stay with it until they end (EVQI section 11.4.2).
  6. The new CSMS ends the old connection. GetConnections lists the station's connections, each with an id, the peer it belongs to and a flag for the connection the request came over. CloseConnection with the id of the connection to csms-old closes it. As csms-old is on demand now, the station does not connect to it again by itself. The peer stays configured: the new operator, or a local operator, can connect to it again, or remove it.

Steps 5 and 6 are separate on purpose. Closing a persistent connection only makes the station connect again (section 5.3); the connection mode says whether a connection is to stay, and CloseConnection acts on the connection that is there now.

3. Model: what a peer gets

The terms are those of EVQI Transport section 11.3.1: a peer is a back end, an endpoint one way to reach it, a connection the live transport to one endpoint.

3.1 Enabled: configured or activated

Enabled The station ...
false stores the peer and its endpoints, and does not connect to it, neither by itself nor on demand. It may be tested (section 5.1). It is never the primary.
true connects to it as its connection mode says.

3.2 ConnectionMode: persistent or on demand

ConnectionMode The station ...
Persistent keeps a connection to the peer, at its first endpoint that works, and connects again when it drops, as EVQI chapter 8 says (back-off, failover between endpoints).
OnDemand connects to the peer only when it is asked to: by a local operator, or by the primary. A connection made on demand stays until it is closed (CloseConnection, local operator) and is not made again by itself after a reboot.

EVQI section 11.3.3 already has a role that is connected to on demand, Service. In this paper the connection mode is a variable of its own, and it is coupled to the role in one direction:

The reference implementation keeps this coupling as it is: a peer whose endpoints do not connect by themselves is a service, and the connection mode writes whether its endpoints connect by themselves (autoConnect).

3.3 A successor may take over

Decided by Achim, 2026-12-02. EVQI section 11.4.5 says "A successor cannot promote itself", and section 11.3.3 reserves the configuration of other peers for the primary. For a migration that is one step too careful: the old operator gave its consent when it configured the successor (step 2) and activated it (step 4), and the cut-over is the new operator's to choose, when it has read the station and is ready. A second round trip to the old CSMS, which may be the back end of a company that has just lost the contract, buys nothing.

A successor therefore may, without further consent:

Request Effect
SetVariables OCPPPeerController[<primary>].ConnectionMode = OnDemand (1.6: MultiHoming.<primary>.ConnectionMode) switchover: the successor that wrote it becomes the primary; the previous primary becomes a Service peer, on demand.
SetVariables OCPPPeerController[<other>].ConnectionMode of any other secondary as for the primary, without a switchover
CloseConnection of any connection the connection is closed (section 5.3)
GetConnections, TestConnection as for the primary

Rules:

The price of this decision is discussed in section 7.1.

3.4 A connection ends on an explicit command only

A connection that is up is never closed as a side effect. During a migration both back ends depend on their line: a request on its way, a transaction message, a registration or a report that is cut off by a reconnect is a fault nobody asked for. The station therefore closes a connection only when it is told to:

Everything else leaves the connection as it is:

3.5 How a connection that is up is reached is read-only

Decided by Achim, 2026-12-02. The details of how a peer is reached - its URL, identity, password or TOTP secret, client certificate, host key pins, OCPP version and security profile, and the encoding (JSON or CBOR) or HTTP binding where a station has them - are read-only while its connection is up. A station answers such a write with Rejected and reasonCode ReadOnly over OCPP, and refuses it on its web page, in its HTTP API and on its command line with the same reason. A connection that is not up - not enabled yet, on demand and not connected, or not reachable at the moment - may be changed freely, over OCPP as well.

A change under a connection that is up would close it and open another, which section 3.4 rules out, and it would change the way to a back end without a test and without a way back. So a change of a connection that is up is a migration, even where the back end stays the same: a new peer with the new details is written, tested, enabled, takes over, and the old one is closed. That holds for the only connection a station has as well. An operator who would rather not migrate hangs the connection up first - explicitly - and changes it then.

What is learned or confirmed rather than edited - a host key or key pin learned on first use, a signed pin set taken - changes how the next handshake is judged and closes nothing.

3.6 Connection ids

GetConnections and CloseConnection name a connection by a connection id:

A connection id says which connection; the peer it belongs to says who is at the other end. Both are reported, so that a CSMS never has to guess a peer from a URL.

4. Configuration via OCPP

4.1 OCPP 2.x: OCPPPeerController

EVQI section 11.7.2 decided two components, OCPPPeersController and OCPPPeerController, with the endpoints of a peer in network profile slots. For a migration the slots are a detour: a successor has one endpoint, and a station that is migrated is often one whose slots were never used. This paper therefore lets a peer carry its endpoint itself, as SSHPeerController of OCPP over SSH (section 7.3) carries the address of an SSH peer. Slots stay what EVQI section 11.7.2 says they are; a peer with Endpoints uses them, a peer with Url does not, and a peer has one or the other.

OCPPPeersController (no instance):

Variable Mutability Type Description
Peers ro string comma separated peer ids, in the order they were created
Primary ro string the id of the primary. Read-only here: a switchover is a write of ConnectionMode (section 3.3) or of Role (EVQI section 11.4.5).
MaxPeers ro integer how many peers the station takes

OCPPPeerController (instance = peer id, string[36], [A-Za-z0-9._-]):

Variable Mutability Type Description
Url rw string[512] the URL of its endpoint: ws://, wss:// or ssh://. Writing it for an instance that does not exist creates the peer: role Successor, kind CSMS, Persistent, not enabled, the OCPP version of the connection the request came over.
Identity rw string[48] the identity towards this peer (the station's own where not set): last path segment of the WebSocket URL, HTTP Basic login, SSH user name
BasicAuthPassword wo passwordString the password of HTTP Basic Authentication (security profiles 1 and 2), as SecurityCtrlr.BasicAuthPassword; never read back
HostKeyPins rw string for an ssh:// endpoint: comma separated SHA-256 fingerprints of the host keys its SSH server may show (SHA256:<base64>, as ssh-keygen -l prints them), as HostKeyPins of SSHPeerController. It is the SSH counterpart of the server certificate and its trust anchors: part of the endpoint's configuration, and an ssh:// peer without it is not connected to.
SecurityProfile rw integer 1, 2 or 3; 3 uses the station's client certificate (ChargingStationCertificate)
OCPPVersion rw OptionList OCPP16, OCPP201, OCPP21
Role rw OptionList Primary, Successor, Observer, EnergyManager, Service, Custom (EVQI section 11.3.3)
Kind rw OptionList CSMS, LocalController, Gateway, EnergyManager, Service (a label)
Enabled rw boolean section 3.1
ConnectionMode rw OptionList Persistent, OnDemand (section 3.2)
Remove wo boolean true removes the peer and its endpoint; refused for the primary
Connected ro boolean monitorable
ConnectionId ro string the id of its live connection (section 3.6); empty while there is none
RegistrationStatus ro OptionList NotAsked, Pending, Accepted, Rejected

Who may write what:

A write outside these rules is answered Rejected with attributeStatusInfo.reasonCode SecurityError, as for a violation of the connection role.

4.2 OCPP 1.6: MultiHoming.* keys

As EVQI section 11.7.3 and the SSH peers of OCPP over SSH have it, one key per variable, under the peer id:

Key Accessibility Variable of 4.1
MultiHoming.Peers R OCPPPeersController.Peers
MultiHoming.Primary R OCPPPeersController.Primary
MultiHoming.<peer>.Url RW Url; writing it for an unknown peer creates it
MultiHoming.<peer>.Identity RW Identity
MultiHoming.<peer>.AuthorizationKey W BasicAuthPassword, written as AuthorizationKey of the 1.6 Security Whitepaper is
MultiHoming.<peer>.HostKeyPins RW HostKeyPins
MultiHoming.<peer>.SecurityProfile RW SecurityProfile
MultiHoming.<peer>.OCPPVersion RW OCPPVersion
MultiHoming.<peer>.Role RW Role
MultiHoming.<peer>.Enabled RW Enabled
MultiHoming.<peer>.ConnectionMode RW ConnectionMode
MultiHoming.<peer>.Remove W Remove
MultiHoming.<peer>.Connected R Connected
MultiHoming.<peer>.ConnectionId R ConnectionId

ChangeConfiguration answers Rejected where 4.1 answers Rejected; 1.6 has no reason code, the security log has it. A peer of a 1.6 station may speak OCPP 2.1, and the other way round: the version of the peer is that of its OCPPVersion, not that of the connection it was configured over.

4.3 The order of the writes

Without atomic updates a CSMS writes in this order, each step valid on its own:

  1. Url (creates the peer, disabled);
  2. HostKeyPins for an ssh:// peer, Identity, BasicAuthPassword, SecurityProfile, OCPPVersion, Role where not Successor, ConnectionMode where not Persistent;
  3. TestConnection (section 5.1), as often as needed;
  4. Enabled = true.

SetVariables of OCPP 2.x carries several variables in one request, but OCPP does not say in which order they are applied, nor what happens to the others when one is rejected. The station applies them in the order of the request, and each one that is accepted stays accepted.

Reference implementation: A request for OCPPPeerController with the data consistency model ACID or BASE is answered Rejected with reasonCode UnsupportedRequest for every entry: the peers are written one entry at a time, as this section describes, and nothing would be rolled back.

4.4 Why atomic Device Model updates would matter here

OCPP has no atomic SetVariables. The white paper Safe & Secure OCPP v2.x Device Model Updates proposes transactions (ACID, BASE) and conditional updates (the expected old value of a variable, like HTTP If-Match). For this use case they would be very important, and the migration is one of the clearest arguments for them:

This paper does not depend on that extension: every step of chapter 2 is safe one write at a time. Where a station supports it, a CSMS SHOULD use it for steps 2 and 4 together, and SHOULD use a conditional update for the takeover of step 5.

5. New messages

All new messages are new actions, for OCPP 2.1 and for OCPP 1.6 (as vendor extension actions, in the way the actions of Secure Time Synchronization section 3.3.5 are). Like every message they may carry customData and signatures, which the tables leave out. Under Signed OCPP Messages they need the permissions connections:run (TestConnection, CloseConnection) and connections:read (GetConnections).

5.1 TestConnection and NotifyConnectionTestResult

Answered at once, reported later, as TestTimeServer: a test takes up to the message timeout of the peer, and a response held back that long would hold up every other request of the CSMS.

TestConnectionRequest (CSMS → CS)

Property M/O Type JSON Type Description
requestId M integer Number (Integer) Chosen by the CSMS. The NotifyConnectionTestResultRequest carries it.
peer M string[36] String The peer to test: an instance of OCPPPeerController.
connectionId O string[36] String The endpoint of the peer to test (section 3.6). Default: its first.

TestConnectionResponse (CS → CSMS)

Property M/O Type JSON Type Description
status M GenericStatusEnumType String Accepted: the test has begun, and a notification will follow. Rejected: nothing is tried, and no notification follows.
statusInfo O StatusInfoType Object Why it was rejected.

NotifyConnectionTestResultRequest (CS → CSMS)

Sent once, to the peer that asked, when the test is over. It is not queued: a test is cheap to repeat.

Property M/O Type JSON Type Description
requestId M integer Number (Integer) The requestId of the request.
generatedAt M dateTime String When the test ended.
test M ConnectionTestType Object What came of it.

NotifyConnectionTestResultResponse has no properties.

ConnectionTestType

Property M/O Type JSON Type Description
peer M string[36] String The peer tested.
connectionId M string[36] String The endpoint tested.
url M string[512] String Its URL, without credentials.
ok M boolean Boolean Whether the connection was made and the Heartbeat was answered.
failedAt O ConnectionTestStageEnumType String The stage the test ended at. Absent when ok is true.
duration M decimal Number How long the test took, in seconds.
subprotocol O string[50] String The sub-protocol the server agreed on (ocpp2.1, ocpp1.6, ...).
serverKeyPin O string[100] String The pin of the key the server showed (spki:<hex>), whether it was believed or not: what an operator pins a new peer to.
steps M Array<ConnectionTestStepType> Array What happened, step by step.

ConnectionTestStepType

Property M/O Type JSON Type Description
elapsed M decimal Number Seconds since the test began.
stage O ConnectionTestStageEnumType String The stage the step belongs to.
level M Info, Notice, Warning, Error String As in TimeServerTestStepType: Notice for a stage passed, Error for the step that ended the test.
text M string[512] String What happened, in English, for people and diagnostic agents. Not meant to be parsed.

ConnectionTestStageEnumType

Value The step concerns
Configuration the peer's settings: URL, credentials, certificate, what will be offered
NameResolution the host name and the addresses it resolves to
Connection the TCP connection
ServerAuthentication the TLS handshake, the chain, trust anchors and pins, or the SSH host key
ClientAuthentication HTTP Basic, TOTP, the client certificate, the SSH sign-in
Handshake the WebSocket upgrade or the SSH subsystem, and the sub-protocol
Probe the Heartbeat and its answer
Close the close

5.2 GetConnections

Answered at once: the list is the station's own state, it costs nothing to make.

GetConnectionsRequest (CSMS → CS)

Property M/O Type JSON Type Description
includeInactive O boolean Boolean Also the endpoints that are not connected now. Default false: only the live connections.

GetConnectionsResponse (CS → CSMS)

Property M/O Type JSON Type Description
connections M Array<ConnectionType> Array The connections, the primary's first.

ConnectionType

Property M/O Type JSON Type Description
connectionId M string[36] String Section 3.6.
peer O string[36] String The peer it belongs to; absent for an inbound connection of no peer.
role O PeerRoleEnumType String The peer's role: Primary, Successor, Observer, EnergyManager, Service, Custom.
kind O string[20] String The peer's kind (a label).
direction M Outbound, Inbound String Who made it: the station, or the other end.
url O string[512] String For an outbound connection: its URL, without credentials.
ocppVersion M OCPPVersionEnumType String OCPP16, OCPP201, OCPP21.
enabled M boolean Boolean Section 3.1.
connectionMode M Persistent, OnDemand String Section 3.2.
state M ConnectionStateEnumType String Connected, Connecting, Lost, NotConnected, Disabled, Standby (an endpoint in reserve).
since O dateTime String Since when it is in that state.
registrationStatus O RegistrationStatusEnumType String What the peer answered to the BootNotification.
subprotocol O string[50] String The sub-protocol agreed on.
transport O WebSocket, SSH String What it runs over.
self O boolean Boolean true for the connection this request came over. A CSMS learns its own connection id from this, and does not close itself by mistake.

5.3 CloseConnection

CloseConnectionRequest (CSMS → CS)

Property M/O Type JSON Type Description
connectionId M string[36] String The connection to close (section 3.6).
reason O string[512] String Why: written to the security log and into the close frame (WebSocket close reason, SSH disconnect message), shortened to what fits.

CloseConnectionResponse (CS → CSMS)

Property M/O Type JSON Type Description
status M GenericStatusEnumType String Accepted: it is closed after this response is sent. Rejected: nothing is closed.
statusInfo O StatusInfoType Object Why it was rejected.

6. Behaviour of the station during the migration

Everything of EVQI section 11.4 applies; this section only says what the migration adds.

Type When techInfo
PeerConfigured a peer was created, changed or removed via OCPP or locally the peer, the variables, who wrote them
PeerEnabled / PeerDisabled Enabled changed the peer, who
PrimaryChanged a switchover, by a takeover or otherwise from, to, who
ConnectionClosedByPeer CloseConnection the connection, its peer, who closed it, the reason
ConnectionTestRequested a TestConnection the peer, the endpoint, who asked; the outcome follows in the log

Reference implementation: every one of these is written to the node's log with who asked; the security events themselves are not sent yet.

7. Security considerations

7.1 A successor can lock out the primary

With section 3.3 every successor can take the station over at any time. That is the decision, and it moves the trust to the moment a successor is configured: configuring a successor is handing over the station, with a delay the new operator chooses. Consequences:

7.2 Tests

A test connects with the peer's real credentials. It may only test configured peers (section 5.1), validates the server exactly as the real connection would, and never sends credentials to a server that failed server authentication: HTTP Basic is sent after the TLS handshake only, an SSH password only after the host key was believed. A station MAY limit tests (the reference implementation: one at a time, Busy).

7.3 Closing connections

CloseConnection of a persistent connection is a reconnect, of an on-demand one a hang-up. Both can be used to disturb: a successor can close the primary's connection again and again. The station SHOULD therefore count closes per sender and refuse more than a few per minute (the reference implementation: none yet; see open question 4).

7.4 Rights are checked at the station

Every rule of this paper is checked by the station, per message, as EVQI section 11.3.3 and the gates of the reference implementation do: what a peer may ask, what it is sent, what it may write. A CSMS is never trusted to restrict itself.

8. Example: the whole migration on the wire

The station cs001 is connected to csms-old over wss:// with OCPP 2.1. Every message below is sent over the connection named on its left.

Step 2, configuring:

old → CS:  [2, "m1", "SetVariables", { "setVariableData": [
               { "component": { "name": "OCPPPeerController", "instance": "csms-new" },
                 "variable":  { "name": "Url" },               "attributeValue": "wss://ocpp.newcpo.example.net/" },
               { "component": { "name": "OCPPPeerController", "instance": "csms-new" },
                 "variable":  { "name": "Identity" },          "attributeValue": "DE*NEW*E000123" },
               { "component": { "name": "OCPPPeerController", "instance": "csms-new" },
                 "variable":  { "name": "BasicAuthPassword" }, "attributeValue": "…" },
               { "component": { "name": "OCPPPeerController", "instance": "csms-new" },
                 "variable":  { "name": "SecurityProfile" },   "attributeValue": "2" } ] }]
CS → old:  [3, "m1", { "setVariableResult": [ … four times "Accepted" … ] }]

Step 3, testing:

old → CS:  [2, "m2", "TestConnection", { "requestId": 17, "peer": "csms-new" }]
CS → old:  [3, "m2", { "status": "Accepted" }]
CS → old:  [2, "c9", "NotifyConnectionTestResult", {
               "requestId":   17,
               "generatedAt": "2026-12-02T10:15:04Z",
               "test": {
                   "peer":         "csms-new",
                   "connectionId": "8f3c2a1e",
                   "url":          "wss://ocpp.newcpo.example.net/DE*NEW*E000123",
                   "ok":           true,
                   "duration":     2.412,
                   "subprotocol":  "ocpp2.1",
                   "steps": [
                       { "elapsed": 0.000, "stage": "Configuration",        "level": "Info",   "text": "OCPP 2.1 to wss://ocpp.newcpo.example.net/DE*NEW*E000123, as 'DE*NEW*E000123' with a password." },
                       { "elapsed": 0.012, "stage": "NameResolution",       "level": "Info",   "text": "'ocpp.newcpo.example.net' resolves to 192.0.2.40." },
                       { "elapsed": 0.031, "stage": "Connection",           "level": "Info",   "text": "A TCP connection to ocpp.newcpo.example.net:443 was accepted." },
                       { "elapsed": 0.088, "stage": "ServerAuthentication", "level": "Notice", "text": "TLSv1.3; the chain ends at a root of the station's connections." },
                       { "elapsed": 0.102, "stage": "Handshake",            "level": "Notice", "text": "The server agreed on ocpp2.1." },
                       { "elapsed": 0.131, "stage": "Probe",                "level": "Notice", "text": "Heartbeat answered: the clocks are 0.4 s apart." },
                       { "elapsed": 2.412, "stage": "Close",                "level": "Notice", "text": "Closed. The connection can be made." } ] } }]
old → CS:  [3, "c9", {}]

Step 4, activating:

old → CS:  [2, "m3", "SetVariables", { "setVariableData": [
               { "component": { "name": "OCPPPeerController", "instance": "csms-new" },
                 "variable":  { "name": "Enabled" }, "attributeValue": "true" } ] }]
CS → old:  [3, "m3", { "setVariableResult": [ { "attributeStatus": "Accepted", … } ] }]
CS → new:  [2, "b1", "BootNotification", { "reason": "PowerUp", "chargingStation": { … } }]
new → CS:  [3, "b1", { "status": "Accepted", "interval": 300, "currentTime": "…" }]

Step 5, reading and taking over:

new → CS:  [2, "n1", "GetBaseReport", { "requestId": 1, "reportBase": "FullInventory" }]
CS → new:  [3, "n1", { "status": "Accepted" }]
CS → new:  [2, "r1", "NotifyReport", { "requestId": 1, "seqNo": 0, "tbc": false, "reportData": [ … ] }]
new → CS:  [3, "r1", {}]
new → CS:  [2, "n2", "SetVariables", { "setVariableData": [
               { "component": { "name": "OCPPPeerController", "instance": "csms-old" },
                 "variable":  { "name": "ConnectionMode" }, "attributeValue": "OnDemand" } ] }]
CS → new:  [3, "n2", { "setVariableResult": [ { "attributeStatus": "Accepted", … } ] }]
CS → old:  [2, "s1", "SecurityEventNotification", { "type": "PrimaryChanged", "techInfo": "csms-old -> csms-new, by csms-new", … }]
CS → new:  [2, "s2", "SecurityEventNotification", { "type": "PrimaryChanged", "techInfo": "csms-old -> csms-new, by csms-new", … }]

Step 6, ending the old connection:

new → CS:  [2, "n3", "GetConnections", {}]
CS → new:  [3, "n3", { "connections": [
               { "connectionId": "8f3c2a1e", "peer": "csms-new", "role": "Primary", "direction": "Outbound",
                 "url": "wss://ocpp.newcpo.example.net/DE*NEW*E000123", "ocppVersion": "OCPP21",
                 "enabled": true, "connectionMode": "Persistent", "state": "Connected",
                 "registrationStatus": "Accepted", "transport": "WebSocket", "subprotocol": "ocpp2.1", "self": true },
               { "connectionId": "a1d07b44", "peer": "csms-old", "role": "Service", "direction": "Outbound",
                 "url": "wss://csms.oldcpo.example.org/cs001", "ocppVersion": "OCPP21",
                 "enabled": true, "connectionMode": "OnDemand", "state": "Connected",
                 "registrationStatus": "Accepted", "transport": "WebSocket", "subprotocol": "ocpp2.1" } ] }]
new → CS:  [2, "n4", "CloseConnection", { "connectionId": "a1d07b44", "reason": "Migrated to NEWCPO." }]
CS → new:  [3, "n4", { "status": "Accepted" }]
CS --x old: WebSocket close 1000 "Migrated to NEWCPO."

With OCPP 1.6 the same runs with ChangeConfiguration of the MultiHoming.* keys and the same new actions.

9. Reference implementation and test

Part Where
Enabled, ConnectionMode, peers with a chosen id, the takeover WWCP_Node: PeerEntry, ConnectionStore, WWCPNode.Peers
OCPPPeerController / OCPPPeersController, MultiHoming.* keys WWCP_OCPP_Node: OCPPPeerDeviceModel, beside SSHPeerDeviceModel
The new messages, OCPP 2.1 and OCPP 1.6 WWCP_OCPP: Messages/VendorExtensions/ConnectionExtensions of both versions
Answering them for a node WWCP_OCPP_Node: DeviceModelBridge.Connections
The end-to-end test of chapter 2 EV Charging Test Environment: EVChargingTestEnvironmentTests/CSMSMigration

The test runs a real charging station and two real CSMS nodes of Open Charging Cloud on 127.0.0.1, and walks through the six steps of chapter 2 in OCPP 2.1: the CSMS of Open Charging Cloud speaks OCPP 2.1 alone. It does so four times: the station connects to the old and to the new CSMS over WebSockets both, over SSH both (OCPP over SSH), and mixed either way. What it checks at each step: the new peer stored and not connected; the test report ok with its steps; two connections, both registered, the old one primary; the NotifyReport at the new CSMS only; the switchover; the old connection closed and not made again.

Not yet in the reference implementation: the stages of test steps (section 5.1) - its steps carry level and text.

10. Amendments to EVQI Transport

If this paper is accepted, EVQI Transport changes as follows:

Section Change
11.3.3 Successor: inbound additionally GetConnections, TestConnection, CloseConnection and the ConnectionMode of other peers; "Authoritative for: nothing until it is promoted or takes over (CSMS Migration section 3.3)". The table gets the columns Enabled and ConnectionMode.
11.3.3 (last paragraph) "the configuration of other peers belong to the primary", except the connection mode, which a successor may write.
11.4.5 "A successor cannot promote itself" becomes "A successor promotes itself by putting the primary on demand (CSMS Migration section 3.3)".
11.5.1, 11.4.5 A switchover moves the alias of the primary in the routing table and closes no connection; a connection ends on an explicit command only (section 3.4).
11.7.1, 11.8, 14 (P7) How a connection that is up is reached is read-only, on the page and over OCPP; a change is a migration to a new peer (section 3.5). P7 "a changed endpoint reconnected" applies to endpoints that are not up.
11.7.2 OCPPPeerController gets Url, Identity (exists), BasicAuthPassword, SecurityProfile, Enabled, ConnectionMode, Remove, ConnectionId; a peer has Url or Endpoints. OCPPPeersController.Peers and .Primary are read-only.
11.7.3 The 1.6 keys of section 4.2.
14, Phase P A new work package P18: this paper.

11. Open questions

  1. The takeover without consent (section 3.3, decided 2026-12-02). Should an operator be able to switch it off per successor (MayTakeOver, default true), so that a station can be configured with a successor that may only be promoted, as EVQI section 11.4.5 had it?
  2. A previous primary that still owns transactions is on demand after a takeover. Should the station connect to it by itself until those transactions end (recommended), or should TransferOpenTransactions be implied by a takeover?
  3. OnDemand and the Service role. Should the connection mode be independent of the role, so that an on-demand peer can also be an Observer that gets the queue when it is connected? Today the two are coupled (section 3.2).
  4. Rate limits for CloseConnection and TestConnection per sender (section 7.3).
  5. Network profile slots. Should SetNetworkProfile with a slot that no peer uses create a disabled successor, so that a CSMS that only knows B09 can prepare a migration?
  6. One message for the whole peer. If atomic Device Model updates (section 4.4) do not come, should there be a SetPeer request that writes a peer in one go?

License

This white paper is published under the Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA 4.0).