Federated detection of open charge point protocol 1.6 cyberattacks
Abstract
The ongoing electrification of the transportation sector requires the deployment of multiple Electric Vehicle (EV) charging stations across multiple locations. However, the EV charging stations introduce significant cyber-physical and privacy risks, given the presence of vulnerable communication protocols, such as the Open Charge Point Protocol (OCPP). Meanwhile, the Federated Learning (FL) paradigm showcases a novel approach for improved intrusion detection results that utilize multiple sources of Internet of Things data, while respecting the confidentiality of private information. This paper proposes an FL-based intrusion detection system, which leverages OCPP 1.6 network flows to detect OCPP 1.6 cyberattacks. The evaluation results showcase high detection performance of the proposed FL-based solution.
Keywords
1. INTRODUCTION
Electric Vehicles (EVs) are a driving force towards the electrification of the transportation sector, contributing to the reduction of the environmental footprint and towards achieving the sustainability goals. In this context, the European Union (EU) plans to ban new non-electric cars starting from the year 2035. At the same time, the deployment of EV Charging Stations (EVCSs) increases in order to ensure seamless experience for EV users and reduce the range anxiety [1]. The EV charging is associated with numerous services, including management of the EVCSs, handling and billing of charging transactions, metering, roaming of EV charging services as well as communication with the power grid and the Distribution/Transmission System Operators (DSOs/TSOs).
To realize properly integrated and interoperable EV charging services, a number of protocols and standards are in force. For example, International Standards Organization (ISO) / International Electro-technical Commission (IEC) 15118 is proposed for defining the Vehicle-to-Grid interface for bi-directional charging/discharging of EVs, smart charging and plug & charge. Roaming between Charging Station Operators (CSO) and e-mobility service providers is accomplished by the Open Charge Point Interface (OCPI) standard, whereas grid operators can interact with the CSOs through demand response protocols, e.g., the Open Automated Demand Response (openADR).
While many of the above-mentioned standards and protocols are optional or their development is on-going, a fundamental interaction within the EV charging ecosystem is the one between EVCSs and the EV Charging Station Management System (EVCSMS) (operated by the CSO), through the Open Charge Point Protocol (OCPP). OCPP is an open standard, maintained by the Open Charge Alliance (OCA), for the vendor-neutral remote management and monitoring of EVCSs. Common operations of OCPP include the authorization and management of transactions and the maintenance of the EVCSs (e.g., firmware upgrades and system logs monitoring). Currently, version 1.6 of OCPP is the most widely deployed version of the protocol; it is supported by the majority of EVCS and EVCSMS manufacturers as well as the one that is fully certified by the OCA.
Despite its significance, OCPP is associated with notable cybersecurity concerns. For example, Alcaraz et al. [2] assess the security features of OCPP, potential vulnerabilities and threat scenarios resulting from the protocol design and characteristics. The authors investigate the implementation and feasibility of various threats, including False Data Injections (FDI), Man-in-The-Middle (MiTM), impersonation, data tampering, fraud / energy theft, and Denial of Service (DoS), by developing a virtual infrastructure based on multiple Virtual Machines (VMs) to replicate the EVCSs and the OCPP server. For the identified threats, the authors explain how they could be materialized as well as corresponding mitigation measures. The authors extend this analysis for the newest version of the standard, OCPP 2.0.1, in [3]. A detailed security assessment of the EV charging ecosystem is performed by Kaur et al.[4]. The authors discuss the attack vector and threat models for multiple protocols used in the EV charging domain, including ISO-15118, OCPP, OCPI and openADR. For OCPP, six relevant threat models are identified. In particular, a MiTM is an imminent threat, in which a potential attacker can be placed between the EVCSMS and the EVCS in order to intercept unencrypted OCPP traffic. A DoS attack is also feasible by introducing a fuzzer, as highlighted in OCPPStorm [5], by injecting malformed or unexpected inputs in the OCPP communication, causing unexpected behavior, system dysfunction, crashes and operational instability. A botnet attack is also feasible, by utilizing multiple compromised EVCS that target the EVCSMS or other assets of the EV charging network through malware spreading. Finally, through impersonation, an attacker could intercept and replay sensitive data that is used for authenticating EVCS and authorizing charging transactions. In this way, a malicious actor could impersonate a legitimate EVCS by using its unique ID or initiate charging transaction by using the user ID of another legitimate user.
Considering the critical security issues with respect to OCPP, an open challenge remains the dynamic detection of potential threats and cyberattacks. In this paper, we focus our attention on detecting potential cyberattacks against OCPP 1.6, by adopting the Federated Learning (FL) approach for analyzing OCPP-based network flows. FL is a distributed Artificial Intelligence (AI) system, in which multiple entities train their local AI model and contribute to the training of a global AI model [6]. Compared to the conventional approach of a single and central AI model, the FL paradigm is characterized by enhanced performance as well as for respecting data privacy and data access rights. Considering the private and sensitive data that could be transferred or elicited by analyzing OCPP traffic (e.g., EV user identity, charging locations, behavioral patterns), the FL architecture is a suitable solution for privacy-aware security analysis and threat detection, benefiting from the contribution of multiple clients realized as multiple EV charging hubs.
Based on the aforementioned remarks, the contribution of this paper is summarized as follows:
● We describe four OCPP cyberattacks and provide insights with respect to their implementation and observations that can be leveraged for their detection.
● We develop the
● We propose an FL-based IDS architecture that can be applied to monitor the OCPP 1.6 traffic of multiple EVCSs, grouped as EV charging hubs at multiple locations. The evaluation results showcase high detection accuracy, ranging from 98.49% to 99.21%, obtained by comparing the results of six FL aggregation methods.
● As a result of this work, we have developed and published the Federated OCPP 1.6 Intrusion Detection Dataset[7], which can also be found on Zenodo1. This dataset includes network traffic samples and the respective flow statistics of the four OCPP 1.6 cyberattacks developed in this paper.
1https://zenodo.org/records/14887131
The rest of this paper is organized as follows. Section 1.1 discusses the existing works on FL-based intrusion detection and detection of OCPP threats, Section 2 presents the proposed adoption of FL on the EV charging infrastructure, the OCPP cyberattacks that we consider in this work, and the proposed FL-based IDS. Section 3 presents the evaluation results; Section 4 discusses the results and potential next steps for future research directions and improvements, and section 5 concludes this work by providing the key takeaways.
1.1. Related work
This section discusses the related work with respect to (a) FL adoption in the context of cybersecurity; and (b) existing methods for detecting OCPP cyberattacks.
1.1.1. FL for cybersecurity
Mothukuri et al.[8] propose a privacy-focused FL approach for Internet of Things (IoT). Each IoT device trains a Gate Recurrent Unit (GRU) model using its local data, and sends the parameters to a central FL server that aggregates them and sends the updated weights to each IoT device. As a result, the accuracy of each model increases, while the data of each IoT device remains private. The authors evaluate the performance of their solution by using a public dataset based on Modbus TCP, which is processed by CICFlowMeter to extract the features that the AI models can use to classify the attacks. According to the evaluation results, the proposed FL approach achieves 90.2% accuracy, showcasing 4.1% improvement on accuracy compared to the non FL approach.
In [9], Rashid et al. introduce a dynamic weighted aggregation federated learning (DAFL), a new aggregation technique that implements dynamic filtering and weighting strategies for local models. The proposed method improves the performance of conventional FL-based IDS in terms of communication overhead, while maintaining high detection accuracy and preserving data privacy.
In [10], Idrissi et al. propose the Federated Anomaly-Based Network Intrusion Detection System (Fed-ANIDS), which employs auto-encoders and FL in a distributed manner. The proposed architecture further employs two aggregation methods, FedProx and FedAvg. The proposed system is evaluated using numerous public datasets, namely the
Karunamurthy et al.[11] introduce a deep learning FL-based IDS for IoT environments. In the proposed architecture, the local models in the remote IoT environments leverage Convolutional Neural Networks (CNNs) with different parameter settings. Furthermore, an optimal feature selection model resides on the federated aggregation server, based on the Chimp optimization method. Inspired by the behavior of chimps in their natural environment, the feature selection model applies a fitness function to select the most optimal features, which are given as input to the deep learning classifier. The proposed model is evaluated on an MQTT protocol dataset, which includes five different attacks. The proposed method achieves 93.3% recall, 94% F1 score and 95.5% accuracy.
Finally, Radoglou-Grammatikis et al.[12] present a multimodal FL-based IDS, called AI4FIDS, which is able to analyze four different data types, namely system logs, operational data, network flow statistics, and visual representations, in order to detect potential anomalies or indication of cyberattacks in the critical infrastructure. Combining the multiple detection methods, AI4FIDS includes a majority voting and a weighted majority method aggregate the predictions of the multiple underlying models in order to generate a single, combined prediction.
1.1.2. Detection of OCPP cyberattacks
Moreover, several works have been identified, which describe OCPP threats and try to address their detection. In more detail, Morosan et al.[13] propose a Back-Propagation Neural Network (BPNN) that is able to classify EVCSs between the normal and faulted states, based on the OCPP 1.5-J traffic they generate. The three-layered neural network was able to determine a faulty EVCS based a) on the similarity of consecutive pairs of request-response, and b) the OCPP message type from the server. In a similar approach in [14], Kabir et al. propose a BPNN utilized by the EVCSMS to analyze the OCPP requests and detect potential malicious attempts of coordinated switching attacks, i.e., charging/discharging and back again within a very short time period.
Girdhar et al.[15] aim to predict and mitigate cyberattacks against EVCSs; therefore, they propose a cybersecurity framework that predicts and mitigates potential cyberattacks. In particular, the authors employ the STRIDE thread modeling to predict potential vulnerabilities and attack vectors on EVCSs, then a weighted attack defense tree is developed to analyze the adversary's objectives and create attack scenarios. A Hidden Markov Model is proposed in order to predict the possible attack paths, while a Partially Observable Monte-Carlo Planning (POMCP) algorithm ensures that the attacker is directed toward the predicted paths, ensuring that mitigation actions are timely placed to reduce the impact of the attack. While the proposed method can predict the attacker's behavior in multi-step attack scenarios, the problem on how to classify the individual behavior as malicious is not addressed.
Elkashlan et al.[16] utilize the
The
Benfarhat et al.[19] leverage deep learning and propose a temporal convolutional network (TCN) in order to classify up to 17 different cyberattacks against the ISO-15118 and OCPP protocols, as they are introduced in the CICEVSE2024 dataset [20]. According to the authors, the proposed model provides benefits in terms of representing temporal dependencies and spatial characteristics, thus being able to detect complex patterns. The authors evaluate their solution by measuring accuracy, precision, recall and F1-score metrics, while comparing the results with CNN, DNN, RNN and LSTM models as well as a hybrid CNN-DNN-LSTM model. Three experiments are conducted, while considering two classes, five classes and 17 classes, respectively. In the binary and 5-class classification experiments, all metrics reach 100%. On the contrary, when considering 17 classes, the TCN achieves 93% in all metrics. Despite the large number of classes considered by the authors, it is noteworthy that the attacks considered exhibit common attack vectors of the network and transport layer, such as network scanning with the nmap tool and TCP/UDP flooding variants, which are already addressed by other solutions considering IoT-based DDoS attack detection [21].
Rahman et al.[22] evaluate a hybrid architecture of CNN and LSTM networks to detect the attacks of the CICEVSE2024 dataset. To enhance the detection performance as well as to increase the understanding of the dataset and attack patterns, the authors apply the SHAP explainability method to obtain results on the features that contributed mostly on the detection outcomes. It is worth mentioning that the selected features are related solely to transport-layer characteristics, such as the average packet inter-arrival time in network flows. The evaluation results indicate high performance, achieving accuracy, precision, recall and F1 score at 97.5% and Area Under Curve (AUC) at 98.5%.
Finally, Purohit et al.[23] propose an FL-based IDS for detecting cyberattacks against the EVCS infrastructure. Similar to [19] and [22], the authors utilize the CICEVSE2024 dataset in order to evaluate the performance of their solution, achieving an accuracy of around 97% and superior F1-score compared to centralized AI-based IDS that use the CICEVSE2024 dataset.
Summarizing, multiple works have been identified that aim to develop AI-based solutions for detecting attacks in IoT and EVCS setups. However, it is noteworthy that most of the existing work[16, 19, 20, 22, 23] employs a similar methodology of detecting OCPP attacks by analyzing network flow features stemming from the network and transport layers of the TCP/IP stack, for example those generated by CICFlowMeter[24] and NFStream2. However, this approach is not sufficient for detecting threats that rely on application-layer characteristics, while the network and transport layers remain agnostic. Moreover, the threat model considered by the aforementioned works and the CICEVSE2024 dataset focus mostly on common IoT threats rather than on OCPP-specific attack scenarios.
2. METHODS
2.1. Case study
In this work, we introduce a novel approach for detecting OCPP cyberattacks, by applying the FL architecture on the EV charging infrastructure and detecting potential threats by generating and analyzing network flows with OCPP-related features. Figure 1 depicts the proposed solution applied on the EV charging infrastructure. The system under study consists of multiple locations, where multiple EV charging stations are deployed and serve EV users. EVCSs in the same location form an EV charging hub, which could correspond to a shopping mall or an airport parking area. Each EV charging hub is connected to the interconnected power grid through a distribution substation. In each EV charging hub, Internet connectivity is provided by a gateway router, necessary for interconnecting the EVCSs with the EVCSMS. Owned by the CSO, the EVCSMS controls the EVCSs through the OCPP 1.6 protocol. Finally, on each EV charging hub, an FL client is deployed, which is connected to the FL server. The FL client receives the raw network traffic from the EV charging hub, containing OCPP traffic traces of the EVCSs, and analyses the traffic for potential cyberattacks. The local models residing on the FL clients are updated by the centralized FL server, by considering the updates coming from all the EV charging hubs.
Figure 1. The FL-based IDS architecture applied on the EV charging infrastructure. Used icons from: https://www.flaticon.com/.
2.2. OCPP 1.6 cyberattacks
According to the works relevant to OCPP threats mentioned in Section 1, we have considered the implementation of four cyberattacks grouped into two categories, namely Flooding attacks and FDI attacks. Under the FDI category, we consider: (a) Charging Profile Manipulation; (b) Denial of Charge, while for the Flooding attacks, we consider: (c) Unauthorized Access; and (d) Heartbeat Flood. These attacks are summarized and illustrated in Figure 2.
The main difference between the two categories is that the flooding attacks rely on overwhelming the target with application-layer network packets, which the target is unable to properly handle. Depending on possible implementation flaws or weaknesses from the side of the target, these attacks may cause exhaustion of computing resources and unavailability of services. On the contrary, the FDIs depend on the fact that the OCPP 1.6 packets are transmitted unencrypted and unsigned. Based on this fact, a malicious insider places themself between the EVCSMS and the EVCSs through Address Resolution Protocol (ARP) cache poisoning in order to alter the OCPP 1.6 messages being transmitted. The consequences vary, depending on the modification carried out by the adversary. The FDIs considered in this work cause either denial of service or lead to cyber-physical consequences.
The cyberattacks are described in more detail in the next subsections. For each cyberattack, we describe: (1) the normal operation, i.e., the respective flow of operations based on the OCPP 1.6 standard; (2) the threat(s) that we identify based on potential flaws or weaknesses of the normal operation; (3) the cyberattack, which describes how we materialize the threat; and (4) observations of the cyberattack in terms of traces or abnormal behavior that could be considered for detecting the cyberattack.
2.2.1. Charging profile manipulation
Normal operation: The
As a powerful and flexible operation,
Threat: Given its criticality for the above-mentioned reasons, an erroneous or maliciously altered charging profile could have significant cyber-physical impact to the power grid. For example, a CSO may have introduced charging profiles as a safety measure to avoid overloading and stressing of legacy electrical infrastructure, including old electric cables or unmaintained transformers. In that case, false charging profiles may lead to stressing of the electrical infrastructure and potential malfunctions. More sophisticated attacks are also possible, e.g., a coordinated oscillatory load attack that could manipulate the load following an on/off pattern, causing system frequency fluctuations that can threaten the grid stability [27].
Cyberattack: The Charging Profile Manipulation attack we consider in this work assumes that a cyberattacker performs MiTM, through ARP poisoning, followed by FDI that modifies the
Observation: The Charging Profile Manipulation FDI could be detected by inspecting the
2.2.2. Denial of charge
Normal operation: Figure 4 describes the procedure to remotely start a transaction and the authorization process before starting a charging session. To start a charging transaction, the EV user through the mobile app will trigger EVCSMS to send a
Threat: By observing the authorization procedure, a denial of service (in particular, a denial of charge) situation could happen if the authentication information, which is private information, is tampered with. In particular, if the
Cyberattack: We consider a denial of charge attack, in which a cyberattacker performs MiTM, through ARP poisoning, followed by FDI that replaces the
Observation: Considering that the CSO prefers to minimize the messages transmitted from/to the EVCS, it is reasonable to assume that, normally, an EVCSMS will never send a
2.2.3. Heartbeat flood
Normal operation: Figure 5 depicts an overview of the procedure for establishing an OCPP 1.6 session over WebSocket (OCPP 1.6-J) between an EVCS and the EVCSMS [28]. The procedure is initiated by the CSO engineer, which configures the EVCS through an out-of-band management method, usually via Bluetooth and a dedicated mobile app provided by the EVCS manufacturer. The engineer specifies the Unique Resource Identifier (URL) that the EVCS must use to register to the EVCSMS. Upon applying this configuration, the EVCS sends a HyperText Transport Protocol (HTTP) GET request, incorporating the unique ID of the EVCS at the end of the URL as well as the appropriate HTTP headers that request session upgrade to WebSocket. If the EVCSMS accepts the EVCSMS, it will send an HTTP 101 Switching Protocols response, which signals the EVCS to immediately start sending OCPP 1.6-J messages, starting with the
Threat: While the Heartbeat interval can be indicated by the EVCSMS via the
Cyberattack: In this attack scenario, we assume that the attacker deploys a botnet of multiple virtual EVCSs, which concurrently attempt to establish OCPP 1.6-J sessions with the targeted EVCSMS. Assuming that the EVCSMS is not configured to authorize each EVCS or that the bots use valid IDs, all connections are accepted. After this step, the bots flood the EVCSMS with
Observation: In contrast to the FDI attacks, someone could notice the traces of this attack also at the Transmission Control Protocol (TCP) / Internet Protocol (IP) layer. In particular, an unusually high number of packets will be noticed per TCP session. Moreover, at the application layer, the CSO would notice an unusually high number of Heartbeat messages per EVCS.
2.2.4. Unauthorized access
Normal operation: As an alternative flow depicted in Figure 5, and according to the OCPP 1.6-J specification [28], if an EVCS session establishment attempt is not accepted, then the EVCSMS should reply with an "HTTP 404 - Not Found" response.
Threat: If the EVCSMS does not apply any throttling policy, an overwhelming amount of connection attempts may cause exhaustion of computing resources and degradation of system performance. Moreover, an attacker could perform an enumeration attack by trying to "guess" valid EVCS IDs.
Cyberattack: Similarly to the Heartbeat Flood attack, in this attack scenario we assume that the attacker deploys a botnet of multiple virtual EVCSs, which concurrently attempt to establish OCPP 1.6-J sessions with the targeted EVCSMS. However, in this variation of the attack, the targeted EVCSMS is appropriately configured in order to reject connection attempts from unknown EVCSs. Hence, the EVCS responds to each bot with an HTTP 404 message, leading to wastage of computing resources and possible performance degradation due to over-utilization of computing and network resources.
Observation: At the TCP/IP layer, this attack would generate an unusually high number of short-lived TCP sessions finished by TCP packets having the FIN flag activated. Moreover, at the application layer, this attack would generate an unusually high number of HTTP 404 messages, clearly indicating failed connection attempts from WebSocket clients.
2.3. Federated learning intrusion detection system
Figure 6 depicts the architecture and implementation details of the proposed FL-based IDS, which is composed of the following components: (a) the Network Traffic Capturing Module; (b) the Network Flow Extraction Module; (c) the Local Prediction Engine; and (d) the Response Module. In summary, the FL client receives network traffic from the EV charging infrastructure and generates a security event for each abnormal network flow. Finally, the security events are delivered to the preferred Security Information and Event Management (SIEM) system.
2.3.1. Network traffic capturing module
First, the Network Traffic Capturing Module is responsible for capturing the network traffic data, using a Switched Port Analyzer (SPAN) (i.e., port mirroring) of the local network switch. SPAN allows the FL-based IDS to monitor and capture the traffic data passing through specific ports of the network switch, where the EVCSs are connected. In the context of SPAN, the monitoring source and destination ports should be defined. Next, all incoming and outgoing traffic data from the monitoring sources are copied/mirrored to the destination port. Next, the Network Traffic Capturing Module uses
2.3.2. Network flow extraction module
The Network Flow Extraction Module is composed of a set of flow statistics/features generators that receive the network traffic data (i.e., PCAP file) from the previous module and produces bi-directional flow statistics/features. For this purpose, we use two flow generators, namely (a) the
Features of the
Network Layer | # | Feature | Description |
TCP/IP | 1 | Unique ID of the flow | |
2 | Source IP of the flow | ||
3 | Destination IP of the flow | ||
4 | Source TCP port | ||
5 | Destination TCP port | ||
6 | Total number of packets contained within the flow | ||
7 | Total flow packets in the forward direction | ||
8 | Total flow packets in the backward direction | ||
9 | Flow duration in seconds | ||
10 | The fraction between the packets in the backward direction and the packets in the forward direction | ||
11 | The total number of the TCP SYN packets | ||
12 | The total number of the TCP RST packets | ||
13 | The total number of the TCP PSH packets | ||
14 | The total number of the TCP ACK packets | ||
15 | The total number of the TCP URG packets | ||
16 | The total number of the TCP CWE packets | ||
17 | The total number of the TCP ECE packets | ||
18 | The total number of the TCP FIN packets | ||
19 | The timestamp of the flow. It is defined with the first relevant packet. | ||
20 | The timestamp of the last packet of the flow | ||
HTTP | 21 | The total number of HTTP GET packets | |
22 | The total number of HTTP 2XX success messages | ||
23 | The total number of HTTP 4XX client error messages | ||
24 | The total number of HTTP 5XX server error messages | ||
WebSocket | 25 | The number of WebSocket packets per second | |
26 | The number of WebSocket packets per second in the forward direction | ||
27 | The number of WebSocket packets per second in the backward direction | ||
28 | The sum of WebSocket payload lengths per second | ||
29 | The sum of WebSocket payload lengths per second in the forward direction | ||
30 | The sum of WebSocket payload lengths per second in the backward direction | ||
31 | The total number of the WebSocket ping packets (opcode 0x9) | ||
32 | The total number of the WebSocket pong packets (opcode 0xA) | ||
33 | The total number of the WebSocket close packets (opcode 0x8) | ||
34 | The total number of the WebSocket data frames (opcode 0x1 or 0x2) | ||
OCPP 1.6 | 35 | The total number of the OCPP 1.6 Heartbeat messages | |
36 | The total number of the OCPP 1.6 HardReset messages | ||
37 | The total number of the OCPP 1.6 SoftReset messages | ||
38 | The total number of the OCPP 1.6 UnlockConnector messages | ||
39 | The total number of the OCPP 1.6 StartTransaction messages | ||
40 | The total number of the OCPP 1.6 RemoteStartTransaction messages | ||
41 | The total number of Authorize.conf messages containing an "Invalid", "Blocked" or "Expired" AuthorizationStatus | ||
42 | The total number of the OCPP 1.6 SetChargingProfile messages | ||
43 | Average number of the "limit" value of SetChargingProfile messages | ||
44 | Maximum value of the "limit" value of SetChargingProfile messages | ||
45 | Minimum value of the "limit" value of SetChargingProfile messages | ||
46 | Average number of the "minChargingRate" attribute of SetChargingProfile messages | ||
47 | Minimum value of the "minChargingRate" attribute of SetChargingProfile messages | ||
48 | Maximum value of the "minChargingRate" attribute of SetChargingProfile messages | ||
49 | The total number of meterValues messages | ||
50 | The minimum value of State of Charge attribute of the meterValues messages | ||
51 | The maximum value of State of Charge attribute of the meterValues messages | ||
52 | The average of the difference between the "Energy.Active.Import.Register" attributes of consequentive meterValues messages | ||
53 | The maximum difference between the "Energy.Active.Import.Register" attributes of consequentive meterValues messages | ||
54 | The minimum difference between the "Energy.Active.Import.Register" attributes of consequentive meterValues messages | ||
Other | 55 | String that describes the classification result of the flow. It can be normal, unlabelled, or denote a specific cyberattack. |
2.3.3. Local prediction engine
Upon completing the FL process, each participating client obtains a local copy of the final global model from the server, during the final FL round. This model is then independently deployed on the client's infrastructure (e.g., devices, on-premise servers, virtual machines, or cloud-based systems) to perform real-time inference. As such, the Local Prediction Engine consists of a set of federated detection models that are generated by the Training Module. As input, it receives the flow statistics/features from the previous module and applies the corresponding federated detection models. The Local Prediction Engine model is trained with TCP/IP flow statistics/features from
2.3.4. Response module
Based on the detection results, the Response Module is responsible for generating the corresponding security events. The security event is delivered to the configured SIEM using the
2.3.5. Training module
The Training Module consists of two components: (a) Federated Server (Fed Server) and (b) Federated Client(s) (Fed Clients). On the one hand, the Federated Server is responsible for coordinating the FL process and managing the communication between the Federated Clients. It aggregates the locally trained models from the Federated Clients and updates the global model. It also handles the management of resources and data privacy. On the other hand, a Federated Client is responsible for training the AI models on the local data and communicating the trained models to the Federated Server. It also handles the pre-processing and post-processing of the data and the management of the local resources. It is placed on the EV charging hubs to enable the use of the local data for training the models and to ensure the privacy and security of the EV charging data. For the implementation of the Training Module,
3. RESULTS
3.1. Experiment setup
Figure 7 depicts the experimental infrastructure utilized to test and evaluate the proposed solution. In this setup, we implemented the FL-based system model of Section 2.1 by replicating two EV charging hubs. The first hub consists of real EV charging stations, namely a Terra Alternating Current (AC) 22kW wallbox type 2 (TAC-W22-T-0) and a Terra 54 Direct Current (DC) 50 kW Fast Charger, both manufactured by ABB. The first hub is provided by the e-mobility laboratory of the Public Power Corporation (PPC) Innovation Hub3. The second EV charging hub is composed of multiple virtual EV charging stations, which are simulated using the e-mobility charging stations simulator by SAP4. Both hubs are managed by an EVCSMS, which is provided by the SteVe5 open-source software. On both locations, the attacker utilizes custom scripts written in Python in order to implement the cyberattacks described in Section 2.2.
3https://innovationhub.dei.gr/en/services/testing/other/e-mobility-laboratory/
4https://github.com/sap/e-mobility-charging-stations-simulator
5https://github.com/steve-community/steve
For implementing the FDI attacks, the
6https://www.ettercap-project.org/
7https://github.com/oremanj/python-netfilterqueue
For the flooding attacks, the attacker utilizes the
The evaluation results were calculated by using the data of both the
Detection capabilities and relevant features of CICFlowMeter and OCPPFlowMeter
OCPP cyberattack | CICFlowMeter | OCPPFlowMeter | Relevant OCPPFlowMeter features |
Charging profile manipulation | ✘]]> | ✔]]> | |
Denial of charge | ✘]]> | ✔]]> | |
Heartbeat flood | ✔]]> | ✔]]> | |
EVCS session establishment flood | ✔]]> | ✔]]> |
Finally, the overall dataset consists of 4, 415 samples, with each sample corresponding to a network flow. The dataset consists of four attack classes, as described above, and one normal, indicating benign traffic. Moreover, the dataset is balanced, meaning that all classes are represented by an equal number of samples. We consider that three clients participate in the FL, with the dataset evenly divided among them to ensure each client receives an equal number of labels. Each client then splits its local dataset into training, validation, and test sets, using a ratio of 0.6, 0.1, and 0.3, respectively. Regarding the FL training setting, the local model of each FL client is a neural network consisting of 3 fully connected hidden layers with 128 neurons and ReLU activation. The training consisted of 40 rounds with a batch size of 32 and learning rate equal to 0.001.
3.2. Detection results
Before analyzing the detection performance of the proposed FL-based IDS, the relevant evaluation metrics are introduced first. On the one hand, True Positives (TP) denotes the number of correct classifications with respect to the presence of the attacks. Similarly, True Negatives (TN) indicates the number of correct classifications regarding the normal network flows. On the other hand, False Negatives (FN) and False Positives (FP) imply mistaken classifications related to the attacks. Therefore, based on the aforementioned terms, the following evaluation metrics are used:
Table 3 and Table 4 summarize the evaluation results of the proposed FL-based IDS, for the two network flow extraction modules, by trying six different aggregation methods: (a) FedAvg, (b) FedProx, (c) FedAdam, (d) FedAdagrad, (e) FedYogi, and (f) FedTree.
Evaluation results of the proposed FL architecture with various aggregation methods - CICFlowMeter
Strategy | Accuracy | TPR | FPR | F1 |
FedAvg | 99.36% | 99.36% | 0.23% | 99.08% |
FedProx | 99.18% | 99.18% | 0.16% | 99.36% |
FedAdam | 99.18% | 99.18% | 0.21% | 99.18% |
FedAdagrad | 98.26% | 98.26% | 0.21% | 99.18% |
FedYogi | 99.45% | 99.45% | 0.44% | 98.25% |
FedTree | 98.26% | 98.26% | 0.21% | 99.18% |
Centralized | 99.52% | 99.52% | 0.15% | 99.52% |
Evaluation results of the proposed FL architecture with various aggregation methods - OCPPFlowMeter
Strategy | Accuracy | TPR | FPR | F1 |
FedAvg | 99.21% | 99.21% | 0.20% | 99.21% |
FedProx | 99.21% | 99.21% | 0.20% | 99.21% |
FedAdam | 99.14% | 99.14% | 2.15% | 99.14% |
FedAdagrad | 98.49% | 98.49% | 4.05% | 98.37% |
FedYogi | 99.07% | 99.07% | 0.23% | 98.07% |
FedTree | 99.21% | 99.21% | 0.20% | 99.21% |
Centralized | 99.66% | 99.66% | 0.08% | 99.66% |
Based on the evaluation results for the
For the
Finally, for both
4. DISCUSSION
In this paper, an FL-based IDS is presented, which aims to detect cyberattacks against the EV charging infrastructure based on the OCPP 1.6. The proposed system realizes multiple FL clients on multiple EV charging hubs, which analyze the local OCPP 1.6 network traffic in terms of network flows and contribute to the training of a global AI model. Moreover, the FL client integrates the
An experimental setup was described, based on both simulated and real EV charging stations, showcasing high detection performance. By comparing the results from six FL aggregation methods, it is concluded that the FredProx, FedAvg and FedTree provided better results, especially in terms of FPR and F1 score.
However, it should be noted that a cyberattack is detected only by assuming that the detector is able to capture the relevant malicious activity. If the attacker is able to avoid the packet capture, or if the attacker leverages adversarial AI techniques to evade the detection from the AI models, then the attack may remain undetectable. In these cases, an attack could be detected by observing the state of the system, i.e., the symptoms of a potential attack. Moreover, while OCPP 1.6 is considered dominant in the market at the time of writing, future versions of OCPP (e.g., OCPP 2.0.1) may require the revision of the
Considering the aforementioned remarks, as future work, we plan to extend our detection method by working on the following points: (a) detecting an attack not only by its traces, but also by assessing the system status and performance Key Performance Indicators (KPIs) that would indicate the potential impact of a cyberattack, (b) strengthening the resilience of our AI models against adversarial attacks, (c) extending our threat analysis and the
5. CONCLUSION
In the present work, we study the detection of cyberattacks against OCPP 1.6 by introducing an FL-based IDS. The literature review identified several IDS solutions. Some of the existing IDS adopt the FL paradigm while others focus on applying deep learning models that are trained in a centralized manner. Moreover, the solutions that detect threats against the EVCS infrastructure, mainly utilize centrally trained models, while their detection methodology rely on analyzing the network and transport layer attributes of network flows. Furthermore, the threat model considered by these solutions focuses on generic network threats that are applicable to multiple IoT domains rather than application-specific threat scenarios.
Considering the aforementioned remarks, we developed a privacy-preserving FL-based anomaly detection method which relies on network flow features, generated by
DECLARATIONS
Authors' contributions
Made substantial contributions to conception and design of the study and performed data analysis and interpretation: Dalamagkas, C.; Radoglou-Grammatikis, P.; Bouzinis, P.; Papadopoulos, I.; Lagkas, T.; Argyriou, V.; Sarigiannidis, P.
Performed data acquisition and provided administrative, technical, and material support: Dalamagkas, C.; Radoglou-Grammatikis, P.; Papadopoulos, I.; Goudos, S.; Margounakis, D.; Fountoukidis, E.
Availability of data and materials
The data producing the results of this work are published on Zenodo8 and IEEE Dataport9, titled as Federated OCPP 1.6 Intrusion Detection Dataset.
8https://zenodo.org/records/14887131
9https://ieee-dataport.org/documents/federated-ocpp-16-intrusion-detection-dataset
Financial support and sponsorship
This project has received funding from the European Union's Horizon 2020 and Horizon Europe research and innovation programmes under grant agreements No 101021936 (ELECTRON) and No 101070455 (DYNABIC). Disclaimer: Funded by the European Union. Views and opinions expressed are, however, those of the author(s) only and do not necessarily reflect those of the European Union or European Commission. Neither the European Union nor the European Commission can be held responsible for them.
Conflicts of interest
Bouzinis, P. is from Metamind Innovations IKE. Papadopoulos, I.; is from Public Power Corporation S.A. Dimitrios Margounakis and Eleftherios Fountoukidis are from SIDROCO Holdings Ltd., while the other authors have declared that they have no conflicts of interest.
Ethical approval and consent to participate
Not applicable.
Consent for publication
Not applicable.
Copyright
© The Author(s) 2025.
REFERENCES
1. Rauh, N.; Franke, T.; Krems, J. F. Understanding the impact of electric vehicle driving experience on range anxiety. Hum. Factors. 2014, 57, 177-87.
2. Alcaraz, C.; Lopez, J.; Wolthusen, S. OCPP protocol: security threats and challenges. IEEE. Trans. Smart. Grid. 2017, 8, 2452-59.
3. Alcaraz, C.; Cumplido, J.; Trivino, A. OCPP in the spotlight: threats and countermeasures for electric vehicle charging infrastructures 4.0. Int. J. Inf. Sec. 2023, 22, 1395-421.
4. Kaur, A.; Valizadeh, N.; Nandan, D.; et al. Cybersecurity challenges in the EV charging ecosystem. ACM. Comput. Surv. 2025. DOI: 10.1145/3735662.
5. Coppoletta, G. OCPPStorm: a comprehensive fuzzing tool for OCPP implementations. University of Illinois at Chicago; 2024.
6. Zhang, T.; Mao, S. An introduction to the federated learning standard. Mob. Comput. Commun. 2022, 25, 18-22.
7. Dalamagkas, C.; Radoglou-Grammatikis, P.; Bouzinis, P.; et al. Federated OCPP 1.6 intrusion detection dataset. IEEE DataPort; 2025.
8. Mothukuri, V.; Khare, P.; Parizi, R. M.; et al. Federated-learning-based anomaly detection for IoT security attacks. IEEE. Internet. Things. J. 2022, 9, 2545-54.
9. Rashid, M. M.; Khan, S. U.; Eusufzai, F.; et al. A federated learning-based approach for improving intrusion detection in industrial internet of things networks. Network 2023, 3, 158-79.
10. Idrissi, M. J.; Alami, H.; El Mahdaouy, A.; et al. Fed-ANIDS: federated learning for anomaly-based network intrusion detection systems. Expert. Syst. Appl. 2023, 234, 121000.
11. Karunamurthy, A.; Vijayan, K.; Kshirsagar, P. R.; Tan, K. T. An optimal federated learning-based intrusion detection for IoT environment. Sci. Rep. 2025, 15, 8696.
12. Radoglou-Grammatikis, P.; Bouzinis, P. S.; Makris, I.; et al. AI4FIDS: multimodal federated intrusion detection. IEEE. Trans. Emerging. Top. Comput. 2025, 1-15.
13. Morosan, A. G.; Pop, F. OCPP security - neural network for detecting malicious traffic. In: Proceedings of the International Conference on Research in Adaptive and Convergent Systems; 2017.
14. Kabir, M. E.; Ghafouri, M.; Moussa, B.; Assi, C. A two-stage protection method for detection and mitigation of coordinated EVSE switching attacks. IEEE. Trans. Smart. Grid. 2021, 12, 4377-88.
15. Girdhar, M.; Hong, J.; Yoo, Y.; Song, T. J. Machine learning-enabled cyber attack prediction and mitigation for EV charging stations. arXiv2022.
16. ElKashlan, M.; Elsayed, M. S.; Jurcut, A. D.; Azer, M. A machine learning-based intrusion detection system for IoT electric vehicle charging stations (EVCSs). Electronics 2023, 12, 1044.
17. Rubio, J. E.; Alcaraz, C.; Lopez, J. Addressing security in OCPP: protection against man-in-the-middle attacks. In: 2018 9th IFIP International Conference on New Technologies, Mobility and Security (NTMS); 2018. pp. 1-5.
18. Kim, D. U.; Kim, K. O.; Kang, S. M.; Hong, C. S. DataTransfer PDU-based rollback mechanism for securing OCPP 1.6 against spoofing attacks. In: 2025 27th International Conference on Advanced Communications Technology (ICACT); 2025. pp. 94-8.
19. Benfarhat, I.; Goh, V. T.; Lim Siow, C.; Sheraz, M.; Chee Chuah, T. Temporal convolutional network approach to secure open charge point protocol (OCPP) in electric vehicle charging. IEEE. Access. 2025, 13, 15272-89.
20. Buedi, E. D.; Ghorbani, A. A.; Dadkhah, S.; Ferreira, R. L. Enhancing EV charging station security using a multi-dimensional dataset: CICEVSE2024; 2024.
21. Bala, B.; Behal, S. AI techniques for IoT-based DDoS attack detection: taxonomies, comprehensive review and research challenges. Comput. Sci. Rev. 2024, 52, 100631.
22. Rahman, M. M.; Chayan, M. M. H.; Mehrin, K.; Sultana, A.; Hamed, M. M. Explainable deep learning for cyber attack detection in electric vehicle charging stations. In: Proceedings of the 11th International Conference on Networking, Systems, and Security; 2024. pp. 1-7.
23. Purohit, S.; Govindarasu, M. FL-EVCS: federated learning based anomaly detection for EV charging ecosystem. In: 2024 33rd International Conference on Computer Communications and Networks (ICCCN). IEEE; 2024. pp. 1-9.
24. Engelen, G.; Rimmer, V.; Joosen, W. Troubleshooting an intrusion detection dataset: the CICIDS2017 case study. In: 2021 IEEE Security and Privacy Workshops (SPW); 2021. pp. 7-12.
25. Open Charge Point Protocol 1.6. 2017. Available from: https://openchargealliance.org/protocols/open-charge-point-protocol/#OCPP1.6[Last accessed on 13 Jun 2025].
26. Hoekstra, A.; Bienert, R.; Wargers, A.; Singh, H.; Voskuilen, P. Using OpenADR with OCPP; 2023. Available from: https://openchargealliance.org/wp-content/uploads/2023/11/OCA-Using-OpenADR-with-ocpp.pdf[Last accessed on 13 Jun 2025].
27. Sarieddine, K.; Sayed, M. A.; Jafarigiv, D.; et al. A real-time cosimulation testbed for electric vehicle charging and smart grid security. IEEE. Secur. Priv. 2023, 21, 74-83.
28. Open Charge Point Protocol JSON 1.6. 2015. Available from: https://openchargealliance.org/protocols/open-charge-point-protocol/#OCPP1.6[Last accessed on 13 Jun 2025].
29. Zhou, Y.; Ye, Q.; Lv, J. Communication-efficient federated learning with compensated overlap-FedAvg. IEEE. Trans. Parallel. Distrib. Syst. 2022, 33, 192-205.
30. Li, T.; Sahu, A. K.; Zaheer, M.; et al. Federated optimization in heterogeneous networks. arXiv2018.
32. Li, Q.; Zhaomin, W.; Cai, Y.; et al. FedTree: a federated learning system for trees. In: Song D, Carbin M, Chen T, editors. Proceedings of Machine Learning and Systems; 2023. pp. 89-103. Available from: https://proceedings.mlsys.org/paper_files/paper/2023/file/3430e7055936cb8e26451ed49fce84a6-Paper-mlsys2023.pdf[Last accessed on 13 Jun 2025].
Cite This Article

How to Cite
Download Citation
Export Citation File:
Type of Import
Tips on Downloading Citation
Citation Manager File Format
Type of Import
Direct Import: When the Direct Import option is selected (the default state), a dialogue box will give you the option to Save or Open the downloaded citation data. Choosing Open will either launch your citation manager or give you a choice of applications with which to use the metadata. The Save option saves the file locally for later use.
Indirect Import: When the Indirect Import option is selected, the metadata is displayed and may be copied and pasted as needed.
About This Article
Copyright
Data & Comments
Data

Comments
Comments must be written in English. Spam, offensive content, impersonation, and private information will not be permitted. If any comment is reported and identified as inappropriate content by OAE staff, the comment will be removed without notice. If you have any queries or need any help, please contact us at support@oaepublish.com.