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:
- A peer can be written via OCPP without network profile slots:
OCPPPeerControllerin the OCPP 2.x Device Model,MultiHoming.*keys in OCPP 1.6. - Configured is not activated. A peer has
Enabled, and a new peer starts disabled. - Persistent or on demand. A peer has a
ConnectionMode: kept up by the station, or connected only when somebody asks for it. - Three new requests, for OCPP 2.1 and OCPP 1.6 alike:
TestConnection: the station connects to a peer once, step by step, and reports every step in aNotifyConnectionTestResult, asTestTimeServerof Secure Time Synchronization does for time servers;GetConnections: the connections of the station, each with an id;CloseConnection: one of them closed, by its id.
- A successor may take over. It may put the primary on demand, which hands the station over to it, and close the primary's connection.
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
- Starting point
- The migration in six steps
- Model: what a peer gets
- Configuration via OCPP
- New messages
- Behaviour of the station during the migration
- Security considerations
- Example: the whole migration on the wire
- Reference implementation and test
- Amendments to EVQI Transport
- 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:
- 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.
- The fallback hides errors. A station that falls back to the old CSMS reports nothing about why the new one failed.
- 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.
- 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
- The station boots and connects to the old CSMS. Nothing new: the old CSMS is the primary
peer,
csms-old. - 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). - The old CSMS tests the new connection.
TestConnectionmakes the station connect tocsms-newonce, 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). - The old CSMS activates the new connection.
Enabled = true. The station connects tocsms-newand keeps that connection up, registers there with a BootNotification of its own, and from then on has two valid CSMS connections.csms-oldstays the primary: it owns new transactions, answersAuthorize, and every request the station sends by itself goes there.csms-newreceives what a successor receives (EVQI section 11.3.3) and may read the station. - The new CSMS reads the station and takes over. It asks for the Device Model with
GetBaseReport, which a successor may do; theNotifyReports go to the peer that asked. Then it sets the connection mode ofcsms-oldfrom Persistent to OnDemand. A successor that puts the primary on demand takes over: the station makescsms-newthe primary andcsms-oldaServicepeer, which is connected to on demand only (section 3.3). Both are told with a security eventPrimaryChanged. Transactions thatcsms-oldstarted stay with it until they end (EVQI section 11.4.2). - The new CSMS ends the old connection.
GetConnectionslists the station's connections, each with an id, the peer it belongs to and a flag for the connection the request came over.CloseConnectionwith the id of the connection tocsms-oldcloses it. Ascsms-oldis 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. |
- A peer created via OCPP starts disabled. Whoever creates it activates it with a second, explicit write. Without atomic Device Model updates (section 4.4), a peer is written one variable at a time; starting disabled means that no half-written peer is ever connected to.
- Disabling a peer closes its connection. Its queue is kept, but nothing is added to it while it is disabled.
- The primary cannot be disabled. To retire it, another peer is made the primary first.
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:
- a peer that is
OnDemandhas the roleService, with the rights of its preset; - putting a secondary on demand makes it a
Servicepeer; - putting a
Servicepeer back toPersistentgives it the role written with it, orObserverwhere none is written; - putting the primary on demand is a switchover (section 3.3).
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 switchover is explicit and attributable: it is the write of one variable by one successor over its own connection, logged with that peer and, for signed messages, the signer (Signed OCPP Messages).
- It only happens when the writer is a successor that is enabled, connected and accepted
(its BootNotification was answered
Accepted). A successor that is not yet registered getsRejectedwithreasonCodeNotRegistered. - With two successors, the one that writes first takes over; the other one stays a successor of the new primary.
- Running transactions stay with their owner (EVQI section 11.4.2). The previous primary, now on demand, receives the rest of its transactions when it is connected; a station SHOULD connect to a previous primary on demand by itself while it owns running transactions, and close the connection when they have ended (question 2 of chapter 11).
- The way back is the same operation in the other direction: the new primary, or a local
operator, sets the old peer to
Persistent(it becomes anObserver) and makes it the primary again, or a successor that puts it on demand. KeepPreviousForof EVQI section 11.4.5 does not apply to a takeover: the previous primary is on demand, not an observer. It stays configured until somebody removes it.
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:
CloseConnection(section 5.3);Enabled = falseorRemove = trueof its peer;- a local operator's hang-up.
Everything else leaves the connection as it is:
- A switchover - by a takeover (section 3.3) or by
Role- moves the alias of the back end in charge (CSMS,CentralSystem, EVQI section 11.5.1) from one line to the other in the station's routing, and moves with it what belongs to the primary: what waits in its queue, and whose heartbeats the station sends by itself. Neither line is closed. - A change of the connection mode changes what happens when the connection ends next: a connection put on demand stays up until it is closed.
- A change of the role or the kind changes what the peer may do and what it is sent, from the next message on.
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:
- it is the station's id of the endpoint the connection is made to (
string[36]), stable across reconnects and reboots, and unique on the station; - every connection, persistent or on demand, has one; a connection the other end makes (a Local Controller below the station, a commissioning tool) has the id of its inbound entry, where there is one;
- OCPP 2.x network profile slots and the endpoints of chapter 11 map onto it 1:1: an endpoint
that came from slot n MAY have the id
slot-n.
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:
- the primary: every variable of every peer but its own
EnabledandRole, and how a peer is reached only while its connection is not up (section 3.5); - a successor:
ConnectionModeof every other peer (section 3.3); its own instance's read-only variables may be read; - every other secondary: nothing, and only its own instance may be read.
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:
Url(creates the peer, disabled);HostKeyPinsfor anssh://peer,Identity,BasicAuthPassword,SecurityProfile,OCPPVersion,Rolewhere notSuccessor,ConnectionModewhere notPersistent;TestConnection(section 5.1), as often as needed;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:
- Two writers. During a migration two CSMS of two companies write the same Device Model, and
both may write peer configuration. A successor that puts the primary on demand while the primary
changes its own credentials, or two successors that take over at the same time, are exactly the
lost updates that conditional updates prevent: "set
csms-oldtoOnDemandonly ifPrimaryis stillcsms-old". - A peer is several variables. URL, identity, password and security profile only make sense together. Atomically, a peer could be created enabled, in one request, and never exist in a half-written state. Without it, this paper needs the rule that a new peer starts disabled (section 3.1), and an extra round trip to enable it.
- Credentials and URL change together. Moving a peer to a new URL with a new password is two
writes; between them the station connects with the old password to the new URL, or the other
way round, and is refused. With
ACIDit is one change. - The switchover and the rest. A new primary that wants to take over and set its own heartbeat interval, rights of other peers and the old peer's removal would want all of it or nothing.
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. |
- The station connects to the endpoint with exactly the configuration it would use: URL, identity, credentials, client certificate, trust anchors, pins, HTTP binding and encoding. It then asks a Heartbeat, waits for its answer, stays connected for a short while (the reference implementation: 2 s) to see whether anything is said, and closes the connection with a normal close code.
- Disabled peers are tested. That is the point: a peer is added disabled, tested, and enabled when the test went through, as a time server of Secure Time Synchronization section 3.2.7 is.
- A test changes nothing. It is not the peer's connection: it uses a client of its own, does
not register, sends nothing from any queue, learns no pin and no host key on first use, and
leaves no route. A peer that is connected is tested with a second, separate connection; under
EVQI chapter 12, a server that judges by the pair of login and networking node may refuse it as
a duplicate (
409), and that refusal is reported as the outcome of the step it happened in. - Only peers of the station can be tested, never a URL given in the request: a mistyped URL would otherwise hand the credentials of a peer to whoever answers it.
Rejectedwith thereasonCodeUnknownPeer: no such instance; theadditionalInfonames the peers there are;UnknownConnection: the peer has no such endpoint;Busy: a test requested before is still running.
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. |
- The primary sees every connection. A successor sees every connection as well; it needs them to take over (section 3.3). Every other secondary sees its own connections only.
- Credentials, passwords and secrets are never reported.
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. |
- The connection is closed after the response has been sent, with a normal close (WebSocket
1000, SSHSSH_DISCONNECT_BY_APPLICATION), so that a CSMS that closes its own connection gets its answer. - What comes after depends on the connection mode. A
Persistentconnection is made again, after the reconnect delay of EVQI chapter 8:CloseConnectionof a persistent connection is a reconnect. AnOnDemandconnection stays closed. To end a connection for good, a CSMS puts its peer on demand first, or disables it. - Who may close what: the primary and a successor any connection; every other secondary its own connections only. An inbound connection of a Local Controller or tool below the station may be closed by the primary only.
Rejectedwith thereasonCodeUnknownConnection: no connection of that id is live;SecurityError: the sender may not close it.
- The closed peer is sent a
SecurityEventNotificationConnectionClosedByPeernaming the peer that closed it, queued for when it is connected next; the sender gets nothing beyond its answer.
6. Behaviour of the station during the migration
Everything of EVQI section 11.4 applies; this section only says what the migration adds.
Registration per peer. After step 4 the station sends a BootNotification to
csms-newon its own connection. Untilcsms-newhas accepted it, nothing but the BootNotification goes there (OCPP's rule, EVQI section 11.4.1).What
csms-newreceives before the takeover: what the successor preset of EVQI section 11.3.3 says: copies of status, meter values, transaction events and security events, noAuthorize. Its answers to copies are logged and otherwise ignored.What
csms-newmay ask before the takeover: the successor preset (Get*,TriggerMessageanswered to itself,GetLog, its own certificates) plusGetConnections,TestConnection,CloseConnectionand theConnectionModeof other peers (section 3.3).Reports go to the one that asked.
NotifyReport,NotifyMonitoringReport,NotifyConnectionTestResult,LogStatusNotificationandFirmwareStatusNotificationgo to the peer whose request they answer, not to the primary.The takeover changes, at the moment the variable is written:
- which peer the alias
CSMS(CentralSystem) resolves to (EVQI section 11.5.1); - which peer owns new transactions and answers
Authorize; - the rights of both peers, from the next message on;
- nothing about the connections themselves: both stay up until step 6 (section 3.4).
Reference implementation: the alias is moved in the routing table of the station's OCPP node (
MovePrimaryLive), and the registration of the new line becomes the primary's: what waited is sent over it, and the old line beats by itself. The end-to-end test checks that neither CSMS sees its line drop beforeCloseConnection.- which peer the alias
Security events, to every peer that may receive them:
| 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:
- Only the primary or a local operator can create a successor (section 4.1). A secondary cannot create a peer, so no secondary can make itself a successor.
- A successor's endpoint is as sensitive as the primary's: its URL, trust anchors and pins decide
who may take the station. A station SHOULD refuse to enable a successor whose endpoint has no
server authentication (security profile 1 over
ws://), and MUST log every takeover with the writing peer and, for signed requests, the signer. - The old operator keeps the way back only as long as the new one lets it: after the takeover the
old peer is on demand and the new primary decides whether it is ever connected again. Operators
that need more SHOULD agree on a delayed takeover instead (EVQI
PromoteAt), or keep section 11.4.5 as it was (open question 1). - An attacker with the credentials of a successor has the station. Successors therefore SHOULD use security profile 3 or SSH public key authentication, and their credentials SHOULD be rotated after the migration or the peer removed.
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
- The takeover without consent (section 3.3, decided 2026-12-02). Should an operator be able
to switch it off per successor (
MayTakeOver, defaulttrue), so that a station can be configured with a successor that may only be promoted, as EVQI section 11.4.5 had it? - 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
TransferOpenTransactionsbe implied by a takeover? OnDemandand theServicerole. Should the connection mode be independent of the role, so that an on-demand peer can also be anObserverthat gets the queue when it is connected? Today the two are coupled (section 3.2).- Rate limits for
CloseConnectionandTestConnectionper sender (section 7.3). - Network profile slots. Should
SetNetworkProfilewith a slot that no peer uses create a disabled successor, so that a CSMS that only knows B09 can prepare a migration? - One message for the whole peer. If atomic Device Model updates (section 4.4) do not come,
should there be a
SetPeerrequest 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).