{'fraction_non_alphanumeric': 0.024345451120738368, 'fraction_numerical': 0.008075908834055378, 'mean_word_length': 4.807876384520717, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
SecSens: Secure State Estimation with Application to Localization and Time Synchronization

Research evidence in Cyber-Physical Systems (CPS) shows that the introduced tight coupling of information technology with physical sensing and actuation leads to more vulnerability and security weaknesses. But, the traditional security protection mechanisms of CPS focus on data encryption while neglecting the sensors which are vulnerable to attacks in the physical domain. Accordingly, researchers attach utmost importance to the problem of state estimation in the presence of sensor attacks. In this work, we present SecSens, a novel approach for secure nonlinear state estimation in the presence of modeling and measurement noise. SecSens consists of two independent algorithms, namely, SecEKF and SecOPT, which are based on Extended Kalman Filter and Maximum Likelihood Estimation, respectively. We adopt a holistic approach to introduce security awareness among state estimation algorithms without requiring specialized hardware, or cryptographic techniques. We apply SecSens to securely localize and time synchronize networked mobile devices. SecSens provides good performance at run-time several order of magnitude faster than the state of art solutions under the presence of powerful attacks. Our algorithms are evaluated on a testbed with static nodes and a mobile quadrotor all equipped with commercial ultra-wide band wireless devices.


I. INTRODUCTION
Last decades have witnessed a proliferation in Cyber-Physical Systems (CPS) for observing a variety of physical phenomena and provide appreciate control actions. Consider, for instance, a wireless sensor network which offers many advantages and services in emergency rescue, homeland security, military operations, habitat monitoring, and home automation services. Such a network typically consists of spatially distributed sensor nodes to monitor the state of network [1]. Furthermore, modern vehicles are another example for CPS which present a heterogeneous system for sensing dynamics and providing the required control actions [2]. The new trend in vehicle design is to move from typical isolated control systems to more open automotive architectures that would introduce new services such as remote diagnostics and code updates, and vehicle-to-vehicle communication in order to improved quality and reliability of such systems [3].
To use these systems securely and efficiently, we need a paradigm shift in algorithmic design. For instance, focusing only on the use of data encryption is the wrong approach to assure CPS security. An interdisciplinary approach is needed that brings a diverse set of disciplines to bear on the secure design process of CPS algorithms. Such an approach for CPS should take care of security vulnerabilities that are easily exploitable in life-critical applications and lead to catastrophic consequences. These security vulnerabilities target sensing software, hardware, and physical signals due to the new interaction between information technology and physical world [4]. Such security vulnerabilities result from the dramatic increase in the set of sensors functionalities and system design complexity.
Attacks launched in the cyber domain led to calamitous consensuses during the past decades [5]. For instance, one popular attack is the StuxNet attack on Supervisory Control and Data Acquisition (SCADA) controllers system which is used in industrial processes control [6], [7]. Other security issues on SCADA networks are shown in [8]. Examples of wireless network attacks are shown in [9]. Furthermore, the fragility of the underlying system structure of today's vehicles are exploited to a reasonable extent in [10], [11], which target Electronic Control Units (ECU). They showed that today's vehicles are not resilient against attacks mounted on its internal components. Thus, an attacker can easily disrupt the operation of critical functions of a vehicle. This problem is, even more, emerging with the rise of self-driving cars [12]. Also, attacks on analog sensors which have increasingly become an indispensable part of many modern systems are shown in [13]. Similarly, attacks on CPS could affect the underlying infrastructure as shown in the Maroochy Water breach [14]. Moreover, the vulnerability of drones is a very dangerous threat if attackers can take control of these deadly weapons [15], [16]. Also, consider the case of generating a fake GPS signal that appears identical to those sent out by the real GPS [17] to take over some unmanned aircraft [18].
While considerable research has explored CPS security using cryptographical techniques, it is not sufficient to ensure for securing CPS. Such cyber-security techniques cannot protect against compromised physical environment around a sensor node, which may inject a corrupted signal. Therefore, there is an emerging need for secure systems [19] while considering new techniques. Thus, researchers came up with techniques that address the problem of secure state estimation and intrusion detection under the sensor, actuators, and communication network attacks. Secure state estimation enables to estimate the state of the CPS from corrupted/attacked measurements, while intrusion detection aims to detect the presence of sensor attacks.
CPS offer critical services which would require meeting stringent timing and maintaining some guarantees on the accuracy of the state estimation during operating hours. However, CPS have power consumption constraints [20], limitations in terms of bandwidth [21], computation limitations [22], and generally limited resources. Thus, we envision a new paradigm in the designing and evaluating secure estimation algorithms. Such paradigm requires meeting the real-time requirements and the resource constraints of CPS. Extensive computation and high computational overhead to provide secure estimate estimation are not accepted in our paradigm. To realize this vision, we propose algorithms for secure state estimation in the presence of measurement noise and modeling errors. We show that our algorithms secure the system against physical attacks manifested by additive disruptions on the measurements while keeping in mind the practicality of our proposed algorithms. Up to our knowledge, SecSens is the first solution that meets the real time requirements of CPS in our considered scenarios.
An entirely representative application for secure state estimation is the localization and time synchronization problem. With the growing prevalence of wireless devices, it is important to coordinate timing among IoT and to provide contextual information, such as location. Also, position estimation is necessary for different fields such as military [23], indoor and outdoor localization [24], security surveillance, and wildlife habitat monitoring. Also, maintaining a shared notion of time is critical to the performance of many CPS, Big Science [25], swarm robotics [26], high-frequency trading [27], and global-scale databases [28]. Localization and time synchronization involves a significant amount of collaboration between individual sensors to perform complex signal processing algorithms. This introduces a considerable amount of vulnerability to the network estimation process. Also, the problem is challenging due to its nonlinearity, and due to the high process and measurement noises. When we deal with time; we are expecting a high effect of modeling errors and measurement noises. Therefore, we picked localization and time synchronization as the application driver to illustrate our proposed secure state algorithm. In this work, we revisit the secure estimation problem from a modern viewpoint of sensor networks, to aid in the design of more efficient algorithms with reduced overheads.
Inspired by the above discussion, we made the following key contributions in this paper: • Proposing SecSens which consists of two secure state estimation algorithms suitable for applications in wireless networks with nonlinear time evolution and measurement model. Our solutions are applicable to networks with pairwise measurements. • Showing that our algorithm is resilient against attacks on the sensor measurements while meeting the real-time requirements of CPS. • Applying the proposed strategy in the problem of simultaneous localization and synchronization of spatially distributed nodes in an ad-hoc network. • The proposed algorithms are evaluated on a real testbed using ultra-wideband wireless devices and a quadrotor, representing a network of both static and mobile nodes. The rest of the paper is organized as follows: Section II gives an overview of the relevant work in the domain. Section III defines the secure state estimation problem and the threat model under our study. We define the core concept behind SecSens in IV. We then go through our proposed algorithms in Sections VI-A and VI-B. Section VII illustrates the experimental setup and evaluates the proposed algorithm on static and mobile network of nodes. Finally, Section VIII lists some concluding and discussion remarks.

II. RELATED WORK
In this section, we present the related work on secure state estimation and its application to simultaneous localization and synchronization.

A. Secure State Estimation
Several recent works have studied the problem of secure state estimation against sensor attacks in dynamical systems. We categorize the work to the following subcategories: 1) Secure Estimation for Noiseless Systems: Graphtheoretic conditions for the detectability of attacks for a noiseless system are shown in [29]. Fawzi et al. show the impossibility of accurately reconstructing the state of a system if more than half the sensors are attacked [30]. Pasqualetti et al. [31] propose a fully decentralized solution for attack Identification.
2) Secure Estimation with Bounded non-stochastic Noise: Satisfiability-Modulo-Theory (SMT) approach is proposed for bounded noise in [32]. Another kind of work was based on brute force search which is not applicable for large-scale systems [33]. A practical solution is proposed in [34] that considers real-time issues and synchronization errors.
3) Secure state estimation with Gaussian noise: Observing and recording sensor readings for an amount of time, then repeat them afterward while carrying out an attack is commonly defined as replay attack. Such kind of attack is considered in [35] where all the existing sensors were attacked. The attacker does not know model knowledge, but he can access and corrupt the sensor data. Another work considered stochastic game anachronism for detecting replay attacks [36]. Also, denial of service attacks solution under Gaussian noise is proposed in [37]. Furthermore, false data injection is solved by proposing an ellipsoidal algorithm where attacker's strategy is formulated as a constrained control problem [38].
All the previous work assume linear state space model. Thus, it can not be used with nonlinear state space. Recently, Weber et al. [39] proposed Gordian SMT especially for secure localization which is a non-linear state space. However, they did not propose as a general solution for non-linear secure state estimation of networks with pairwise measurements. Also, during their evaluation, they only considered four links under attack, which is very small number compared to the total number of links. Furthermore, they required about 11 minutes to be able to provide a secure state estimation which is a huge overhead to recover a network state. Finally, they considered a 2D localization problem only. On the other hand, SecSens considers the non-linear state space model of networks with pairwise measurements, while taking into consideration the real-time requirements for CPS and assumes powerful attacks comparing to the related work.

B. Secure Localization and Time Synchronization
Researchers attach great importance for secure localization from a long time. For instance, SeRLoc [40] proposed a localization scheme based on a two-tier network architecture. Another type of work was based on partial homomorphic encryption to achieve private and resilient localization [41]. For more details on secure localization, we refer the reader to [42], [43]. On the other hand, secure time synchronization alone got a lot of attention. TinySeRSync [44], for example, proposes secure single-hop pairwise time synchronization using authenticated timestamping. Moreover, authors in [45] analyze attacks on different time synchronization protocols and propose a secure time synchronization toolbox to counter these attacks. In [46] a holistic approach to maintain secure time synchronization in a wireless network is proposed, and in [47] pairwise secure synchronization concept is proposed tailored to real-time applications in smart grids. For more details on secure synchronization, we refer the reader to [48], [49].
Although these two problems, namely secure time synchronization and secure localization, share many aspects in common, they are traditionally treated separately. That results in a lower performance, inefficient use of resources, and nonscalable algorithms. Secnav [50] is the only work that covers simultaneous secure localization and time synchronization up to our knowledge at the time of writing. However, Secnav assumes that sensor nodes cannot be compromised by an adversary, and cares only about the attacked communication channel. In contrast, SecSens considers attacks which compromise sensor nodes and links.

III. SECURE STATE ESTIMATION PROBLEM
In what follows, we discuss our threat model and the utility measures. Then, provide a mathematical formulation of the state estimation problem.

A. Threat Model
In the context of attack-resilient state estimation, we have the following entities: • Estimation Server: It attempts to securely, efficiently and accurately estimate the state of a network of distributed sensors given that we have measurements and modeling noises. Also, sensors and links are compromised. • Sensor Nodes: Entities that make some required sensing in order to help in estimating the network state. The adversary could compromise nodes. • Adversary: He modifies the framework with the goal of causing the server to misestimate the state of the network. He can compromise sensor/links to corrupt measurements. Denial of service attack is out of the scope of our paper. Therefore, the receiver will still receive the message from the sender, superimposed by the attacker's messages. Also, we can look into the problem as compromised messages where man-in-the-middle attack (MITM) is presented to corrupt the delivered messages to the server.

B. Resilience Metric
The accuracy of state estimation algorithm is the key for its use in mission-critical systems. Besides, the CPS are often resource-constrained and has to meet some time requirements. To accommodate the above practical constraints while still maintaining the desired resilience level we define the following utility metrics: • Estimation Error: The difference between the actual network state (ground truth) and the estimated state. • Execution Time: The time needed by the server to estimate the network state based on the measurements.

C. System and Attack Model
Consider the following nonlinear time-varying system where x k i is the state of node k at time i. y k,j i is the measurement sent to node k from the neighborhood node j ∈ N k . The process and measurement noise are assumed to be uncorrelated and zero mean white Gaussian noise. They are denoted by n k i and v k i , respectively. Q i and R i are the process covariance and the measurement noise matrix at time i, respectively. The attack vector a k,j i is a vector which models how an attacker changes the sensor measurements between node k and node j at time i. A non-zero elements in the vector a corresponds to the attacked values on the corresponding sensor; otherwise the measurement is not attacked. Thereby, the additive attack vector a k,j i can account for both, a malicious node k and a corrupted link (k, j). Moreover, the attack values can be constant or time-varying.
SecSens considers secure state estimation problem over a network of N nodes indexed by k ∈ {0, . . . , N − 1}. The nodes are spatially distributed over some region in space. We say that two nodes are connected if they can communicate directly with each other. The neighborhood of a given node k is denoted by the set N k .

IV. SECSENS CORE IDEA
Most of the related work on secure state estimation mitigates the influence of attacks as described in Section II by identifying the attacked links and excluding them from the estimation process. This is a highly complex combinatorial problem, and even the convex relaxation techniques are not suitable for realtime applications. So, let's go through SecSens core idea that helps us to solve the problem while considering the practical requirements.
To understand the idea behind SecSens, let's consider the following toy example which is representative of the core idea behind our solution. Consider a network of N nodes, where each node has a link with its neighbor. Now, let's consider Figure 1, node 1 will communicate with node 2 at t 1 . Then node 1 will communicate with node 2 and node 3 at time t 2 and t 3 , respectively. Now, let's go back to the general model of the secure state estimation which is shown in Equation 1. According to that model, we have three attacks which are a 2,1 1 , a 3,1 2 , and a 4,1 3 on the three links. Related work tried to solve at each time instant t the secure state estimation problem while considering the number of possible attacks (unknowns) equals the number of links. It ends up in a very complicated problem with the number of unknowns equals the number of connections.
In contrast, we look into the problem from a different perspective inspired by the real-life application's constraints. At each time instant, t each node can only communicate with one neighbor and this is the practical scenario in any CPS. For instance, measuring the distance using time of the flight of two or three messages between two nodes is a type of communication [51]. Thus, at time t 1 in Figure 1, why should we care about estimating a 3,1 1 ?. What about renaming the three attacks on the figure to a 1 1 , a 1 2 , and a 1 3 as the couple time instant t i and the node index k uniquely defines the neighbor j because node k can only communicate with one node at time t i . Thus, SecSens looks into the attack that is related to node 1 as a 1 t and deals with it as time-varying value. With this paradigm shift, we are able to have the number of attack at each time instant equals to the number of nodes, instead of the number of links. Therefore, SecSens drastically reduces the computational complexity. We will show the performance of SecSens while attacking all the links with time-varying attacks. State estimation while attacking all the links is a hard problem and could not be solved in any of the related work up to our knowledge.
We now utilize this idea to change the general model in (1). We include the attack value of this time step to the state of the node initiating the measurement. Following this procedure, the state of node k would be extended to This yields a modified system model with In this way, we decrease the number of unknowns at each time step. Instead of being proportional to the number of links, they are now only proportional to the number of nodes. We should emphasize that this is just a modeling trick and all the links can be under attack with different values.
A valid question would be how to model the time-evolution in the state-space model for unpredictable static or timevarying attacks. We choose to have a k i = a k i+1 , and the variance of the attack entries of the modeling noise n k i would account for the time-varying aspect of the attack. We would like to define two important concepts associated with measurement values: • Outliers: These measurement values lie outside the main expected range. For example, it would be the measured distance between two nodes that is much larger than diagonal of the localization area. Also, if the measured speed of moving node is higher than the hardware capabilities of the nodes, then this speed value would be considered an outlier. These Outliers can be easily detected and rejected by setting some thresholds on the accepted values. • Attacks: the Smart attacker would corrupt the sensor reading with new values that make sense. Thus, attacks are values that can't be removed by outliers' detectors. Attacked speed value, for example, would be within the capabilities of the node motors.
SecSens makes use of this concept to simplify the complexity of secure state estimation algorithms. We care about designing secure state estimation algorithm which would be combined with outliers rejectors. Thus, attacks can only be in a limited interval which can be represented by the modeling variance. We used this concept in our previous work [51], [52] where we use stationary model for process update function for tracking a flying quadrotor. As long as the quadrotor moves in the range of the modeling noise, D-SLATS would be able perfectly to localize it. At the end of the day; the speed of the quadrotor is limited by the hardware capabilities which are public information. So why we do not make use of this information to simplify the estimation algorithm?
In what follows, this approach will be applied to simultaneous localization and synchronization. It will be seen that the system performance is greatly improved by this approach while the computational complexity is significantly reduced compared to the related work.

V. SECSENS IN REAL LIFE APPLICATION
Without loss of generality, we choose to apply SecSens on simultaneous localization and time synchronization estimation problem while some nodes/links are under attack. It a quite representative example of secure state estimation problem where we have modeling noise of the clocks and the dynamics of moving nodes in conjunction with measurements noise. Our sensors are able to get the time difference and the distance between two each other. More specifically, we consider three types of measurements which are distinguished by the number of messages exchanged between a pair of nodes. The measurement vector at node k, from node j ∈ N k has the following form where d k,j i represents the counter difference at time i denoted by d k,j i which is the measurement of the difference between the clocks of each node. r k,j i , on the other hand, represents a noisy measurement due to frequency bias discrepancies between k and j which is formally represented by singlesided two-way range. Finally, R k,j i is another distance measurement between nodes k and j based on a trio of messages between the nodes at time i. This is a more accurate estimate than r k,j i due to mitigation of frequency bias errors from the additional message. It is formally called doublesided two-way range. For more details about the three types of measurements, we encourage the reader to check [51]. However, these measurements are corrupted by some attacks on counter difference and distance, namely, ao k i and ad k i , respectively. We would like to note that subset of these measurements may be used rather than the full set, i.e., we can have experiments involving just r k,j i , R k,j i , d k,j i or any combinations. Also, we do not put any limitation on the way of calculating these measurements. So, no special requirements on the used hardware.
Thus, we are concerned with a state vector which consists of three dimensional position vector p k i , clock time offset o k i , and clock frequency bias b k i for every node. We adopt a convention where both o k i and b k i are described with respect to the global time clock which is usually the clock of master node, which can be any node. Also, there are attacks on the distance measurements, which is denoted by ad k i , and the attack on offset measurement values ao k i which are added by an attacked node. In summary our state vector is as following: We define the full network state x i at master time as the concatenation of all states from the N participating devices at time step i:

A. SecEKF Algorithm
The core idea behind SecEKF is to make use of Extended Kalman filter (EKF) in order to estimate the network state beside the introduced attacks. We periodically apply corrections when new measurements are received. We assume the clock parameters evolve according to the first-order affine approximation of the following dynamics o given that t M is the root node time which is the global time. The process update is responsible for evolving the state estimates for all N devices-clock offsets, frequency biases, and device position. Therefore, we can write the process update function as following: Note that this simple process model can still be used to capture node state dynamics and changing attack values simply by setting the covariance of the corresponding state value adequately high to account for high change rate. We will show that our module can work with high rate changing attack and moving nodes as well. On the other hand, The measurement update step relates the state variables x k i to a measurement vector y k,j i between two devices. Each of our measurements depends on the of local clock values, distances between two devices and the amount of the introduced attack on time and distance. For any given node k in the network, the nodespecific measurement model with respect to a second node j is given as: The time synchronization and localization problem aims to estimate the clock parameters and the 3D position using the available measurements and the model of the system. We denote byx i the estimate of x i where we seek to minimize the mean-square error E x i −x i 2 . Given this, we design an EKF to get a secure state estimate over time, periodically applying corrections when new timing and range measurements are received. Our EKF only updates upon arrival of a new measurement (message) exchanged between two or more nodes. The EKF steps are: • Receive a new measurement: The server obtains a new measurement at filter step i which is generated by a message exchange between devices k and j. By convention, communication is always defined to terminate at device j. One of the nodes maybe under attack and corrupt the sent measurement.
• Calculate δ t : The server maintains an estimate of master time t M (i) as well as time offset and frequency bias estimates for every node. This gives the capability to calculate the time elapsed between measurements in the master time reference. • Time update: Update the current secure estimates for the location and time of each node while taking the attack effect out of the measurement.

B. SecOPT Algorithm
The second algorithm for secure state estimation is based on the Maximum Likelihood Estimator (MLE). By using the model of the system and the knowledge of how the unknown attack signal affects the measurements, we formulate an optimization problem as arg min where a time window comprising L measurements is used for minimization. The L1-norm on the attack values is added to quadratic minimization criteria for more robust attack estimation. The resulting method is summarized in Algorithm 1. The algorithm is centralized in the sense that all the exchanged messages are transmitted to a centralized server where the computation and optimization are solved. While the minimization is initialized for i = 0 with the state x init = 0 for numerical optimization, run repeat the it multiple times by setting x init to the previously estimated state.

Algorithm 1 SecOPT
Set i = 0, andx 0 = x init . At the centralized server: Step 1: Collect enough measurements between nodes according to the window size.
Step 2: Solve the centralized optimization problem with solver initial condition set tox i : Step 3: Increment i by 1 and go back to Step 1

A. Experimental Setup
We evaluated the performance of the proposed secure state estimation algorithms in a custom ultra-wideband RF testbed based. The overall setup is described in details in the Appendix and shown in Figure 6.

B. Experiments
We demonstrate SecSens state estimation algorithms in simultaneous localization and time synchronization of wireless sensor nodes under attack while keeping on minds the resilience metrics as defined in Subsection III-B. This attack can be on the communication link or/and the whole sensor node. We are going to evaluate our proposed algorithms under different attack cases for static and mobile nodes.

C. Case Study: Static Nodes
Nodes are placed in 8 distinct locations around the 10 × 9 m 2 area, roughly in the positions indicated by Figure 6. The goal of our algorithm is to accurately and securely estimate the positions of all network devices relative to each other, as well as, the relative clock offsets. This relative localization (graph realization), is a well-researched field. Local minima, high computational complexity, and restrictions on graph rigidity are the main challenges in graph realization problems [53], [54]. SecSens does not put restrictions on the connectivity of the graph as we will show. An original extended Kalman filter (OrigEKF) is implemented as a baseline for comparison to show the criticality of estimating the attacks values in CPS.

1) Secure Position Estimation:
We would like to start with defining the attacker strategy to corrupt the network state estimation. The common way in secure estimation field is to consider a uniform random number or constant values as attacks value without putting constraints on the rate of change of the attacks values. Neglecting the convergence time of the algorithm has catastrophic consensuses. Unlike the previous work, we consider three types of attacks generator statistics. Also, we consider the attacker switch between different parameters during an attack session. Function 1 in the Appendix shows a Pseudocode for our attacker function. We consider Uniform, Normal and Pareto Distributions as type 1, 2, and 3 attacks, respectively. Note that generating the attack values according to Function 1 simulates time-varying attack values that are different for all links. Also, we should highlight the following points: • Every new measurement gets different attack value, i.e, the Function getDistanceAttackValue is called every time instance for every new measurements. • All the measurements under attack. • The attacker changes the parameters of each type from period to period as shown in the Pseudocode. Such an attack is stronger than using fixed statistics random generator. • The attacks values must results in a location within the localization area, as a smart attacker strategy. Otherwise, the attack can be easily detected with a simple threshold mechanism. The proposed secure algorithms find relative positions. Therefore, we first superimpose the estimated positions onto the true positions of each node by use of a Procrustes transformation [55]. Specifically, the estimated network topology as a whole is rotated and translated without scaling, until it most closely matches the true node positions. Once transformed, the error of a given node's position is defined as the 2 norm of the transformed position minus the true position. Figure 2 shows a twenty seconds snapshot of the performance after running the three types of attacks. We can notice the jump in the OrigEKF behaviors due changing the attack statistics. However, SecSens is resilient against such type of attacks. Table I summarizes the localization error for every node using the three algorithm. SecEKF outperforms SecOPT in the three types of attacks.
2) Secure Time Synchronization: We considered two attacker strategies in order to corrupt the network state estimation in term of time, for the space constraint. We define Type 4 attack where each node adds a constant value in order ∼ 100µ seconds to measurement d i j. While, Type 5 attack considers adding uniform random values in order ∼ 100µ seconds to measurement d i j. The reason behind choosing these types of attacks is discussed in the Appendix. We should highlight that different attacked nodes add different attack values for both Type 4 and Type 5. As mentioned before, we choose node 0 to be the reference node, i.e, b 0 i := 0 and o 0 i := 0 ∀i. Table II shows the synchronization errors for all nodes with respect to node 0. We also assume that the reference node is free of attack which is not the same assumption in the secure localization scenario. In order to test the secure time synchronization with minimum uncertainty in our testing mechanism, we follow the testing strategy in [56], and [57].
SecEKF comes with the best performance, then SecOPT for both attack types. We should note that the synchronization errors in Table II are reported for a fully connected network. SecEKF algorithm achieved 0.03 and 0.25 µ seconds for Type 4 and Type 5 attack, respectively. On the other hand, SecOPT algorithm achieved 0.34 and 9.10 µ seconds for Type 4 and Type 5 attacks, respectively. Neglecting the secure estimation techniques leads to catastrophic consequences as shown for OrigEKF performance against Type 4 and Type 5 attacks. The synchronization error is in order of attacks values, namely, 121 and 132 µ seconds for Type 4 and Type 5 attack, respectively.

D. Case Study: Mobile Nodes
We have shown that our proposed algorithms can be used to localize and synchronize a network of static nodes under three types of attacks. We now present the case of a heterogeneous network containing both static and mobile nodes. We add one mobile node in the form of a CrazyFlie quadrotor to the eight anchor nodes topology used in Section VII-C, as shown in Figure 6. We analyzed the results of running SecEKF, SecOPT and OrigEKF to localize the mobile node flying in our lab. Again, all the links are under attacks. For space limit, we will show the results under attack 1 scenario only.
Some experiments were performed with quadrotors traveling with variable velocities. Figure 3 show the results of localizing the traveling quadrotors using SecEKF, SecOPT and OrigEKF algorithms. SecEKF achieved the best secure localization estimation with a mean of 1.38 m and standard deviation of 0.72 m. On the other hand, SecOPT reported 1.82m mean error and standard deviation of 0.78 m. If the normal estimation does not consider attacks estimation, it will suffer from 7.03m mean error and 3.54m standard deviation.
We repeated the experiments for the network topology where every node is only connected to four neighbors instead of eight nodes in the fully connected scenario, which means we are dropping about 27 links out of 72 links. The performance degraded as expected. As shown in Fig 4, SecEKF, SecOPT and OrigEKF algorithms reported 3.48m, 3.36m, and 10.07m mean localization error, respectively.

E. Case Study: Execution Time
Previous work [39] could achieve secure state estimation in case of localization in about 11 minutes. They only consider 2D localization and only four links under attack. Eleven minutes overhead is a very high one especially for the moving nodes. We are going during this case study to analyze the required execution time for the proposed secure estimation algorithms to localize the CrazyFlie quadrotor, where all the links are under Type 1 attack. The execution of SecOPT depends on the number of considered measurements during one run of the algorithms which we called the window size. Figure 5 summarizes the 3D localization error for each window size. For a window size of 300 measurements, we could achieve a mean error of 1.59m at the cost of 4.6 seconds of execution time. When we decreased the window size to 50 measurements, we get 4.7m localization error at the cost of 1.1 seconds of execution time. On the other hand, we can see the SecEKF could achieve a mean error of 1.28m with a cost of 0.004 seconds. SecEKF considers only a window size of one measurement as it depends on EKF.

VIII. CONCLUSION
This work has investigated the security aware-aspect of the estimation algorithms for the multi-sensor system. More specifically, we proposed SecEKF and SecOPT secure estimation algorithms for the wireless network where state evolution and measurement models can follow nonlinear functions. Then, we picked simultaneous localization and synchronization as a representative application for our secure estimation problem. Several experiments in a network with static nodes and a mobile quadrotor, all equipped with commercial ultrawideband wireless radios, were conducted. Our empirical results indicate that SecSens offers reliable performance and efficient computational procedures for the secure state estimation. Our proposed algorithm made it possible by stateof-the-art advances in commercial ultra-wideband radios to securely estimate the state in asynchronous networks. Future directions will deal with testing over a large-scale system and more sophisticated attack scenarios. Algorithm node 0 node 1 node 2 node 3 node 4 node 5 node 6 node 7 mean std      Function getDistanceAttackValue shows the attacker behavior for corrupting the measurements R i j and r i j.

A. Experimental Setup
The main components of our testbed can be summarized in the following points: • Motion capture system capable of 3D rigid body position measurement with less than 0.5 mm accuracy. The system consists of an eight-camera which are deployed in order to provide accurate ground truth position measurements. The results presented in this work treat the motion capture estimate as a true position, though we qualify here that all results are accurate to within the motion capture accuracy. The ground truth position estimates from the motion capture cameras are sent to a centralized server which uses the Robot Operating System (ROS) [58] with a custom package. We adopt a right-handed coordinate system where y is the vertical axis, and x and z make up the horizontal plane. • The Fixed nodes used in the following experiments consist of custom-built circuit boards equipped with ARM Cortex M4 processors t 196 MHz powered over Ethernet and communicating to Decawave DW1000 ultrawideband radios as shown in Figure 7 and Figure 8. Each node performs a single and double-sided two-way range with its neighbors. The used Decawave radio is equipped with a temperature-compensated crystal oscillator with frequency equals 38.4 MHz and a stated frequency stability of ±2 ppm. We installed eight UWB nodes in different positions in a 10×9 m 2 lab. More specifically, six nodes are placed on the ceiling at about 2.5m high, and two were placed at waist height at about 1 m in order to better disambiguate positions on the vertical axis. Each node is fully controllable over a TCP/IP command structure from the central server. These nodes are placed so as to remain mostly free from obstructions, maximizing line-of-sight barring pedestrian interference. • The Mobile Node used in the experiments are batterypowered mobile nodes also with ARM Cortex M4 processors based on the CrazyFlie 2.0 helicopter [59] and equipped with the very same DW1000 radio as shown in Figure 9. This allows for compatibility in the single and double sided ranging technique used. • The server is a MacBook Pro laptop with Intel(R) Core i7-4870HQ CPUs @2:5GHz, which is a normal PC.

B. Attacks on Distances
Function getDistanceAttackValue shows the attacker behavior for corrupting the measurements. We considered, as a proof of concept, three types of attacks using Uniform, Normal and Pareto Distributions. We gave them names as type 1, 2, and 3 attacks, respectively. rand(), randn() and randp() are considered APIs to get the required distribution. currentT is the current system time and totalT is the total execution time. We considered Pareto Distribution as an example of heavytailed distributions. The Pareto distribution is characterized by a scale parameter paretoScale and a shape parameter   paretoShape. We picked the parameters of the distributions to be logical attack values resulting in an acceptable position in the localization area. Otherwise, the attack would be easily detected.
Note that generating the attack values according to Function 1 simulates time-varying attack values that are different for all links. The trend in the evaluation of the related work is to use a uniform random number generator to define attack which can look like some bias in the sensor reading from a practical point of view. Thus, we used such time-varying parameters that can evaluate the algorithm in a better way.

C. Attacks on Time
We would like to open a discussion in the types of the time attacks, as they are tricky ones. Simple monitoring for evolving time of every node can help in detecting many attacks. For example, the time should not go backward; thus any reported time value in the past can be flagged as an attack. Also, the time can't go faster than the specification of the crystal, which is public information. However, we did not consider this type of smart checkers in SecSens, we just let the secure algorithms deal with that, but it can be a possible future work. One popular attack in the time domain to provide a constant delay to pretend, as if the time is shifted, that is why we considered adding constant time attacks to the measurements while evaluating SecSens.

D. Measurements Correlations
Many sensors in CPS reported correlated measurements. For instance, some distance measurements could be based on the time of flight calculations which is tightly coupled with time measurements. Such tight coupling could be investigated to detect attacks. We should note that SecSens does not at this stage consider the measurements correlation and dealt with the measurements as uncorrelated measurements. Many other practical considerations could be investigated to enhance the secure estimation algorithms.

E. CPS Physics
Understanding the underlying physics governing the CPS itself would offer significant support to the secure estimation algorithms using preprocessing phase which would help in filtering the measurements. If a sensor observes a signal that appears to violate the physics governing the CPS dynamics, an attack flag can be easily raised to enhance the CPS security.