LoRa device identification system and method based on clock fingerprint features
By using a LoRa device identification system based on clock fingerprint features, and utilizing the timestamps recorded by the frequency hopping spread spectrum communication of LoRa devices to construct a fingerprint database, the security and equipment cost issues of IoT device identification and authentication systems are solved, achieving high-security and low-cost device identification.
Patent Information
- Application Number
- CN202310450333.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-25
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-04-25
AI Technical Summary
Existing IoT device identification and authentication systems based on device ID and MAC address are not very secure, and identification methods based on radio frequency fingerprints require expensive equipment, making them difficult to implement in practice.
A LoRa device identification system based on clock fingerprint features is adopted. Through a time synchronization module, a feature extraction module, and a fingerprint recognition module, the system uses the frequency hopping spread spectrum communication of LoRa devices to record timestamps, uses the least squares method to fit the clock relationship, constructs a fingerprint database, and uses the nearest neighbor algorithm to identify the device.
It achieves highly secure and low-cost LoRa device identification, avoids device spoofing attacks, and requires no additional hardware support, making it suitable for low-power IoT environments.
Smart Images

Figure CN116528231B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of device identification, and relates to a LoRa device identification system and method based on clock fingerprint characteristics. BACKGROUND
[0002] The advent of the Internet of Things era brings a large number of terminal devices into people's daily production and life, and these devices support key application scenarios such as military Internet of Things, smart home, smart factory, etc. "Internet of Everything" brings convenience, but also sounds the alarm for us on the security problem of the Internet of Things. In recent years, data theft, spoofing attacks, device hijacking and other events caused by device identity camouflage have occurred frequently at home and abroad. Therefore, the device identification and authentication system, as the first line of defense for Internet of Things devices to enter the network, is crucial. The traditional identification and authentication system based on device ID and MAC address usually relies on values defined by users or manufacturers as features, and such features can be modified by software and are easily camouflaged, so the security is not high. The latest identification and authentication system based on device hardware features directly extracts features from device hardware and its wireless environment, and these features cannot be modified and are difficult to camouflage, so the security is very high.
[0003] In addition, with the vigorous development of the Internet of Things, short-range communication technologies such as ZigBee, WiFi, Bluetooth are widely used, and the LoRa technology supporting long-distance Internet of Things communication is a rapidly emerging new technology, which is a remote low-power technology and has been widely used in scenarios where cellular signals are weak or unavailable and power consumption is strictly required. And currently, there are few researches on the identification and authentication of large-scale commercial LoRa devices, most of which use the radio frequency fingerprint of LoRa for device identification, but these methods need to use expensive special equipment such as signal analyzers or USRP (Universal Software Radio Peripheral), which is very difficult to implement in practice. The LoRa device identification system and method based on clock fingerprint do not need to introduce other devices, and can realize device identification only by arranging on the edge node / gateway.
[0004] The clock fingerprint-based device identification method mainly utilizes the fact that different crystal oscillators have errors in production due to the process level, thereby causing differences between different clock crystal hardware, and the clock crystal frequencies of any two sensor nodes are almost not the same. Therefore, each Internet of Things device has a different and unique clock crystal characteristic. Thus, there is a drift between the clock signals generated by each device. Among them, clock skew and clock offset represent the basic relationship between the two hardware clocks in time synchronization. Their accurate estimation and update are not only important for high synchronization accuracy, but also important for reliable node identification based on the uniqueness of the hardware clock. Generally, the time synchronization relationship between two devices can be defined as T2=α*T1+β. Wherein α is called clock skew, and β is called clock offset. The clock skew can be used as a clock fingerprint for device identification, which is extracted by a high-precision time synchronization method. Generally, the clock drift between two devices is in the order of microseconds, so only a time synchronization method with a precision of microseconds can extract the clock fingerprint. However, the research on high-precision time synchronization methods for LoRa devices is still blank.
[0005] As for the device identification algorithm, it can be generally divided into supervised classification machine learning algorithm, unsupervised clustering machine learning algorithm or neural network-based classification. SUMMARY
[0006] In view of the problems that the existing identification and authentication system based on device ID and MAC address is easy to be attacked, has low security, and the radio frequency fingerprint is difficult to land, the application discloses a LoRa device identification system and method based on clock fingerprint characteristics, realizes LoRa device identification and authentication based on clock fingerprint characteristics, and has the advantages of not being easy to be attacked, high security and low cost.
[0007] The purpose of the application is achieved by the following technical solutions.
[0008] The LoRa device identification system based on clock fingerprint characteristics disclosed by the application comprises a time synchronization module, a feature extraction module and a fingerprint identification module.
[0009] The time synchronization module: utilizes the frequency hopping spread spectrum in the LoRa device to change the time stamp when recording the transmission completion data packet preamble and header in the channel, and writes it into the radio frequency FIFO together with the message, the receiver records the time stamp when receiving the completion message, calculates the compensation time through the transmission parameters and the packet size, and decodes the time stamp sent by the sender to obtain the time stamp pair representing the relationship between the device clock crystal, as the input of the feature extraction module.
[0010] The feature extraction module: the time stamp pair representing the clock crystal relationship between devices input by the time synchronization module is linearly fitted using the least square method, the clock relationship between devices is extracted, and the clock fingerprint is extracted from the clock relationship as the input of the fingerprint identification module.
[0011] The fingerprint identification module: a fingerprint database is constructed by pre-extracting the clock fingerprint of the legal device, and the legal device is registered. The clock fingerprint input by the feature extraction module is read from the fingerprint database, a certain number of clock fingerprints of each device are calculated, the distance between the input clock fingerprint and the clock fingerprint of each device in the database is calculated, and the distance is compared with a set threshold value. If the distance calculated for each device is greater than the threshold value, the device is judged to be an illegal device. Otherwise, the device is identified as the device with the smallest distance.
[0012] The identification method for LoRa device identification based on clock fingerprint characteristics disclosed in the application is realized based on the LoRa device identification system based on clock fingerprint characteristics, and includes the following steps:
[0013] Step 1: The time stamp when the preamble and header of the data packet are sent before the channel interruption record is changed by the frequency hopping spread spectrum in the LoRa device, and is written into the radio frequency FIFO and sent with the message. The receiver records the time stamp when the message is received, calculates the compensation time through the transmission parameters and the data packet size, and decodes the time stamp sent by the sender to obtain the time stamp pair representing the clock crystal relationship between devices.
[0014] Step 1.1, in LoRa, frequency hopping spread spectrum communication is supported and a Frequency Hopping Spread Spectrum Change Channel Interrupt (hereinafter referred to as frequency hopping interrupt) is provided. Frequency hopping spread spectrum communication means that the LoRa device will first send the content on a certain frequency channel for a period of time, and then continue to send on other frequency channels. The frequency change is specified by setting the frequency hopping table, and the duration of LoRa sending on a certain frequency channel is set by setting the hopping period. Among them, LoRa changes the frequency of the current channel by triggering the frequency hopping interrupt, the value of the current channel FhssPresentChannel is set in the RegHopChannel register, and the value of the current channel FhssPresentChannel indexes the frequency in the specified frequency hopping table. In addition, LoRa also stipulates that the sender will first send the preamble and header of the LoRa data packet on channel 0, and then trigger the first frequency hopping interrupt. The preamble and header part of the sending is not subject to the hopping period constraint. By using the frequency hopping interrupt, the time stamp T1 of the time when the preamble and header are sent is recorded when the first frequency hopping interrupt is triggered, that is, when the sender sends the preamble and header, and it is sent together with the communication in the sending queue buffer. For the receiver, LoRa stipulates that when the LoRa receives the data packet, it will trigger a reception completion interrupt (RxDone Interrupt), so the receiver records the reception completion time T d as the reception completion time stamp.
[0015] Step 1.2, the interrupt delay (Interrupt Delay) between the reception completion time T d and the time T1 when the preamble and header are sent actually consists of the time over air required to send the LoRa data packet payload and a small amount of hardware response delay.
[0016] Among them, the hardware response delay T int is a fixed offset value, and the offset value ranges from several microseconds to tens of microseconds according to the difference between different hardware platforms. The time over air is calculated by the length of the payload and the transmission rate of LoRa:
[0017]
[0018]
[0019] SF is the spreading factor, BW is the bandwidth, both of which are transmission parameters initialized before transmission. PL is the number of bytes of payload; CRC indicates whether CRC check is enabled, which is 1 when enabled and 0 when disabled; DE indicates whether low-rate optimization is enabled, which is enabled when SF>10, with DE being 1 when enabled and 0 when disabled; CR is the coding rate, another parameter initialized before transmission.
[0020] Based on the calculated LoRa transmission rate and the number of symbols in the payload, T... a (k) and T d The air transmission time required to send a payload between (k) is:
[0021] T ToA =Ts×n Payload
[0022] The receiver compensates for over-the-air transmission time and interruption delays to obtain the time when it has received the preamble and header. Then, the gateway decodes the timestamp T sent by the sender from the received payload. a (k). Thus, through a single time synchronization, the gateway can collect a pair of timestamps T. k = <T rx (k), T tx (k)>, where:
[0023] T rx (k)=T d (k)-T ToA -T int
[0024] T tx (k)=T a (k)
[0025] Step 2: The least squares method is used to perform linear fitting on the timestamp pairs collected in Step 1 to obtain the clock relationships between devices. The clock offset, which characterizes the device's clock crystal oscillator, is used as the device fingerprint. By collecting the clock fingerprints of legitimate devices, a fingerprint database is constructed to achieve the registration of legitimate devices.
[0026] Step 2.1: In time synchronization, the relationship between the two clocks is T2 = α*T1 + β, meaning there is a linear relationship between T2 and T1, where α is the clock offset and β is the clock deviation. According to Step 1, after the receiver collects a certain number of timestamp pairs, it uses the least squares method to linearly fit the timestamp pairs. The least squares method minimizes the sum of squared errors between the actual and predicted values by determining unknown parameters. Where y i For the true value, This is a predicted value. And... Therefore, by substituting The problem is transformed into an optimization problem involving α and β. By taking the partial derivatives with respect to α and β respectively, the values of clock offset α and clock deviation β can be obtained.
[0027]
[0028]
[0029] The clock offset α is the unique clock fingerprint that identifies a device. It depends on the device's clock crystal oscillator. Due to manufacturing errors caused by variations in the process of producing different crystal oscillators, the clock offset α varies from device to device. Furthermore, the clock fingerprint depends on the internal clock crystal oscillator of the device, and this characteristic cannot be modified or imitated, thus providing a high level of security.
[0030] Step 2.2: By repeating the above steps, collect a certain number of clock fingerprints from legitimate devices to build a fingerprint database. The data table is shown below:
[0031] Device ID Clock fingerprint
[0032] The device ID is the serial number of the legitimate device, and the clock fingerprint is the extracted clock offset α.
[0033] Step 3: When identifying an unknown device, calculate the clock fingerprint of the unknown device according to Step 1 and Step 2. Then, read a certain number of clock fingerprints of each device from the fingerprint database as a training set. Calculate the distance between the clock fingerprint of the unknown device and the clock fingerprints of each device using the nearest neighbor algorithm. Determine whether the unknown device is a legitimate device by judging whether the distance is greater than a threshold. If it is a legitimate device, identify it as the device with the smallest distance. That is, LoRa device identification and authentication is achieved based on clock fingerprint features.
[0034] When a device needs to be identified, the receiver first calculates a clock fingerprint α for that device through steps 1 and 2.1. Then, it reads k clock fingerprints for each device from the fingerprint database. in Let θ represent the k-th clock fingerprint of the i-th device. Using the nearest neighbor algorithm, calculate the clock fingerprint θ of this device and... The distance d between i , where d i Calculated using the following formula:
[0035]
[0036] By determining the distance d iThe size of the set threshold σ is set, and if the distance d of each device is greater than the threshold σ, the device is determined as an illegal device. Otherwise, the device is identified as a distance d i The smallest device.
[0037] Advantages:
[0038] 1. The application discloses a LoRa device identification system and method based on clock fingerprint characteristics, and the extracted clock fingerprint depends on the clock crystal oscillator of the device, which is a determined feature during production and cannot be modified or imitated, thereby solving the low security problem of a traditional identification and authentication system based on a device ID and a MAC address and having higher security.
[0039] 2. The application discloses a LoRa device identification system and method based on clock fingerprint characteristics, and the LoRa device identification and authentication are realized based on the clock fingerprint characteristics, without additional device overhead, thereby solving the problem of high hardware devices required in a scheme based on radio frequency fingerprint identification. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 It is a LoRa device identification system structure diagram based on a clock crystal oscillator feature.
[0041] Figure 2 It is a LoRa frequency hopping spread spectrum communication process diagram.
[0042] Figure 3 It is a LoRa data sending flowchart.
[0043] Figure 4 It is a LoRa time synchronization timestamp recording diagram.
[0044] Figure 5 It is a LoRa time synchronization process diagram.
[0045] Figure 6 It is a device classification effect diagram.
[0046] Figure 7 It is a LoRa device identification flowchart based on a clock crystal oscillator feature. DETAILED DESCRIPTION
[0047] The application will be further illustrated below in combination with the drawings and specific embodiments, and the technical problems solved by the technical solutions of the application and the advantages thereof will be discussed. It should be pointed out that the described embodiments are intended to facilitate the understanding of the application and do not have any limiting effect on the application.
[0048] Example 1
[0049] The LoRa device identification system based on clock fingerprint features comprises a time synchronization module, a feature extraction module and a fingerprint identification module. The clock fingerprint identification is divided into three steps: time synchronization, time stamp collection, feature extraction and fingerprint comparison. The time synchronization module is realized by communication between the node and the gateway. The node sends its time stamp to the gateway. The gateway records the time when it receives the time stamp from the sender, and after compensation, decodes the time stamp sent by the node to form a time synchronization time stamp pair. The time stamp collected by the time synchronization is taken as the input of the feature extraction module. The feature extraction module extracts the clock offset of the node relative to the gateway as the clock fingerprint by the least square method. The extracted clock fingerprint is taken as the input of the fingerprint identification module. The fingerprint identification module reads the clock fingerprint of the device registered in advance from the database, and compares the input clock fingerprint with the clock fingerprint of the device in the database by the nearest neighbor algorithm to classify and obtain the final device identification result.
[0050] As shown in Figure 1 The LoRa device identification system based on clock fingerprint features comprises a LoRa terminal node and a LoRa gateway. The LoRa terminal node comprises an ESP-WROOM-32 as a main control MCU chip and an SX1276 as a LoRa radio frequency module. The LoRa gateway comprises a Raspberry Pi 3B (Raspberry Pi 3 Model B) as a main control MCU chip and an RHF0M301 LoRa concentrator as a radio frequency module. They are connected through an adapter board. The Raspberry Pi drives the LoRa concentrator through SPI. The Raspberry Pi is a microcomputer with strong computing power, which can run some programs with high computing complexity. Alternatively, the Raspberry Pi can be connected to a personal computer through a serial port or communicate with a server through a socket communication mode, and data is forwarded to a device with stronger computing power such as a neural network to run an identification algorithm. However, the method proposed in the present application can successfully identify devices without complex algorithms, which is very suitable for low-power LoRa wireless Internet of Things network and can be easily arranged on edge devices. The working process of the LoRa device identification system based on clock fingerprint features is as follows: the node first performs high-precision LoRa time synchronization with the gateway to obtain a time stamp. The gateway collects the time stamp and extracts the clock fingerprint of the device through the time stamp. Then, according to the extracted clock fingerprint of the device, a fingerprint database is constructed on the gateway to register legal devices. Finally, the nearest neighbor algorithm is used to identify the device according to the extracted clock fingerprint.
[0051] The key technology of the LoRa device identification system based on clock fingerprint features is a high-precision LoRa time synchronization method, and only through the high-precision LoRa time synchronization method can the clock crystal features of the device be extracted as the unique fingerprint for identifying the device. The high-precision LoRa time synchronization method proposed in the present application will be described.
[0052] The essence of time synchronization is to transfer timestamp information between nodes. In the past research, numerous time synchronization methods can be divided into one-way time synchronization and two-way time synchronization. In the one-way time synchronization model, the root node broadcasts a synchronization message, all neighbor nodes receive the synchronization message, and the synchronization message generally contains the timestamp of the root node. The root node sends its own timestamp to all neighbor nodes at time t1, and all neighbor nodes adjust their internal time according to the timestamp. Generally, as long as the distance between the root node and the neighbor nodes is close, the synchronization accuracy of this method can reach the microsecond level. The working principle of the two-way time synchronization model is to exchange the timestamps of two adjacent nodes (called sender and receiver nodes). In this model, the sender node requests the latest time report of one of its neighbors. The receiver node responds with its latest time report and the received time of the request. For LoRa, to achieve low power consumption of LoRa, LoRa devices are required to work in sleep mode except at specified times. This feature makes LoRa itself insensitive to the downlink messages sent by the root node, and is not suitable for the traditional one-way time synchronization model. As for two-way time synchronization, LoRa network is a typical one-to-many topology, many terminal nodes communicate with a gateway, which requires the gateway to process the responses of multiple terminal nodes, i.e. to send multiple downlink response messages. On the one hand, there is a situation of sending queue congestion, and on the other hand, due to the reason that LoRa itself is insensitive to downlink messages, the two-way time synchronization model is also not suitable for the time synchronization scheme of LoRa.
[0053] Based on the above discussion, the present application proposes a reverse LoRa time synchronization method based on LoRa frequency hopping spread spectrum change channel interrupt (hereinafter referred to as frequency hopping interrupt).
[0054] Frequency hopping spread spectrum communication is a communication method supported by LoRa. It refers to LoRa devices first transmitting a portion of a data packet on one frequency, then hopping to another frequency to transmit the next portion of the data packet. The selection of the hopping frequency is controlled by a frequency lookup table. The current channel value (FhssPresentChannel) is set in the RegHopChannel register. When frequency hopping occurs, the current channel value indexes the specified frequency in the frequency hopping table. After a predetermined hopping period, the transmitter and receiver will change to the next channel in the predetermined list of hopping frequencies to continue transmitting and receiving the next portion of the data packet. The transmission time spent on a particular frequency is determined by the frequency hopping interval (FreqHoppingPeriod). Figure 2 The diagram illustrates LoRa frequency hopping communication. LoRa data packets are divided into a preamble, a header, and a payload. The sender first transmits the preamble and header on channel 0. The duration of this transmission is not controlled by the frequency hopping interval. After the preamble and header are transmitted, a frequency hopping interrupt is triggered, changing the frequency to channel 1. Subsequent frequency hopping interrupts are triggered according to the frequency hopping interval until the payload is transmitted. Utilizing the characteristics of frequency hopping spread spectrum communication and frequency hopping interrupts, a frequency hopping interrupt can be triggered when the node finishes transmitting the preamble and header, recording the timestamp of the completed transmission, and adding this timestamp to the payload before sending it to the gateway. Figure 3 The diagram shows the LoRa data transmission flowchart. First, the radio frequency (RF) is initialized, setting various transmission parameters. Then, data is written into the RF FIFO, and the system switches to transmit mode and sends data. Afterward, it waits for transmission to complete. LoRa transmission primarily involves reading data from the RF FIFO. The length of the FIFO is specified by the data packet size in the transmission parameters. Therefore, by pre-modifying the data packet size in the transmission parameters to reserve space for the timestamp, and then obtaining the timestamp of the preamble and header after transmission when a frequency hopping interrupt is triggered, it is written into the FIFO. Later, when LoRa reads the FIFO to send the payload, the timestamp can be sent along with the message.
[0055] As for the gateway, the hardware of the gateway is SX1301, which does not support frequency hopping communication and frequency hopping interrupt. Therefore, the gateway can only record the timestamp when all data packets are received.
[0056] like Figure 4 The diagram shows a LoRa time synchronization timestamp recording. During the k-th time synchronization, the node records a timestamp T by triggering a frequency hopping interrupt after sending the data packet preamble and header. d (k). The gateway triggers a reception completion interrupt and records a timestamp T after receiving the entire data packet.a (k). In T a (k) and T d (k), there is a transmission time delay required for transmitting the payload. While the transmission rate of LoRa is:
[0057]
[0058] where SF is the spreading factor, and BW is the bandwidth, both are transmission parameters initialized before transmission. And the number of symbols of the payload can be calculated by:
[0059]
[0060] where PL is the number of bytes of the payload; CRC is whether to enable CRC check, 1 for enabling and 0 for disabling; DE is whether to enable low-rate optimization, enabling when SF > 10, DE is 1 for enabling and 0 for disabling; CR is the coding rate, which is another transmission parameter initialized before transmission.
[0061] According to the calculation of the LoRa transmission rate and the number of symbols of the payload, then the transmission time delay required for transmitting the payload between T a (k) and T d (k) is:
[0062] T ToA = Ts x n Payload
[0063] In addition, there is also a small amount of hardware response delay in the interrupt delay. The hardware response delay T int is a fixed offset value, which ranges from several microseconds to tens of microseconds according to the differences between different hardware platforms.
[0064] Finally, the gateway compensates for this transmission time delay to obtain the time when the preamble and the header are received by the receiving end, and then the gateway decodes the timestamp T a (k) sent by the sending end from the received payload. Thus, through one-time time synchronization, the gateway can collect a pair of timestamps T k = <T rx (k), T tx (k) >, where:
[0065] T rx (k) = T d (k) - T ToA - T int
[0066] T tx (k) = T a (k)
[0067] like Figure 5 The diagram illustrates the LoRa time synchronization process. When a terminal node is woken up, it performs the (k-1)th time synchronization and sends its timestamp T to the gateway. a (k-1), and then it can enter a sleep state to reduce power consumption. The gateway record receives the timestamp T when it is completed. d (k-1) timestamps are collected, and the compensation time is calculated using the transmission parameters and data packet length. The node then performs the k-th time synchronization upon being woken up again. This process is repeated until enough timestamps are collected for feature extraction.
[0068] In the Internet of Things (IoT), each network device has its own clock. Due to the imperfect manufacturing of low-cost quartz crystals in typical IoT devices, the clock oscillator frequencies of any two sensor nodes are almost identical. Therefore, each IoT device has a distinct and unique clock oscillator characteristic. Clock skew and clock offset represent the fundamental relationship between two hardware clocks in time synchronization. Their accurate estimation and updating are crucial not only for high synchronization accuracy but also for reliable node identification based on the uniqueness of the hardware clock.
[0069] Clock skew can be determined by analyzing the clock drift of node i with the aid of a stable reference clock. However, in practical settings, a stable reference clock is often unavailable, and only another drifting clock can be used to monitor a drifting clock. Therefore, the measured clock skew value of a node reflects the drift of the measured clock and the reference clock used. In this invention, the clock relationship between the clock of node i and the reference clock of the gateway can be defined as:
[0070] T tx =αT rx +β
[0071] Here, α represents clock skew, and β represents clock offset. Clock offset represents the hardware clock at t=0. Unlike clock skew, it cannot be used as a device-specific fingerprint because its value is independent of hardware characteristics and changes when either of the two nodes is powered on. However, its value is fixed, likely unique, and fairly stable over short periods during normal operation, thus it can be used as an auxiliary variable for identification.
[0072] Based on the aforementioned time synchronization method, the gateway eventually collected n pairs of timestamps T = {T1, T2, ..., T}. n Each pair of timestamps represents the clock relationship between the node and the gateway. Accurately estimating the device's clock skew is equivalent to accurately fitting n pairs of timestamps.
[0073] The least square method is a commonly used curve fitting method, which is often used for linear regression and can well estimate the clock relationship of nodes and gateways. In the present application, the clock offset a and the clock deviation b can be estimated by the following formula.
[0074]
[0075]
[0076] wherein a is the clock fingerprint feature of the identifiable device. Generally, a large number of time stamps are not required to estimate the clock offset and the clock deviation of the device, but as n increases, the estimation accuracy of the clock offset and the clock deviation also increases. In the present scheme, 10 pairs of time stamps are used for estimation, and a time synchronization accuracy of 10 microseconds can be achieved. High-precision time synchronization also means that the clock crystal characteristics of the device can be more accurately estimated, making the identification more accurate.
[0077] Finally, the clock fingerprint features of the legal devices are extracted in advance as a training set to construct a fingerprint database. As shown in Figure 6 The clock fingerprint classification diagram of four devices extracted in advance is shown in the figure, the horizontal axis is the device serial number, and the vertical axis is the clock offset value of the device. Each device extracts 200 clock fingerprint features. From the results, it can be seen that the box plots do not overlap, indicating that the devices can be clearly classified at a confidence level of 95%. In particular, for device 3 and device 4, the clock fingerprint difference between the two devices and device 1 and device 2 is huge, and they can be clearly identified by judging the maximum value and the minimum value. As for device 1 and device 2, except for a small number of outliers, they can also be clearly classified. This proves the effectiveness of the present application. In addition, the number of fitted time stamps can be appropriately increased to improve the accuracy of the clock offset estimation and improve the recognition rate of the device.
[0078] For the fingerprint recognition module, the present application selects the nearest neighbor algorithm with low computational overhead, which is more suitable for deployment on edge devices such as gateways. The idea of the nearest neighbor algorithm is to compare the distance between the test point and the data in the training set, and classify the test point into the class with the nearest distance. Its defect is that no matter how large the distance between the test point and the data in the training set is, it will choose one as the result, which cannot well identify the illegal devices that have not been pre-registered. Therefore, a distance threshold needs to be introduced, and if the calculated distance is greater than the threshold, the device is judged to be an illegal device. The selection of the threshold determines the resistance of the algorithm to illegal devices.
[0079] As shown in Figure 7 The device identification flowchart of the present application is shown in the figure, and the specific steps are as follows:
[0080] Step 1: When there is a device to be identified to communicate with the gateway, the gateway collects a certain number of time synchronization timestamp pairs T = {T1, T2,..., Tk} from the device. n}.
[0081] Step 2: Through the timestamp pairs, the gateway extracts the clock fingerprint of the device α.
[0082] Step 3: The gateway extracts k clock characteristics of each device from the database
[0083] Wherein,
[0084] Step 4: The gateway calculates the distance d between α and i
[0085]
[0086] Step 5: Determine the size of the distance d i and the set threshold σ, if the distance d of each device is greater than the threshold σ, then the device is judged as an illegal device. Otherwise, the device is identified as the one with the smallest distance d i .
[0087] In summary, the present application proposes a high-precision LoRa time synchronization method, extracts the clock crystal characteristics of the LoRa device as the fingerprint of the device for device identification. The clock crystal characteristics of the device are determined by the quartz crystal oscillator when the device is produced, which is a hardware feature that cannot be changed or imitated, and has higher security compared with the traditional method of using device ID or MAC address for device identification. In addition, compared with the method of using device radio frequency fingerprint for identification, the present application does not need expensive devices such as signal analyzers or USRPs, and can be deployed on large-scale commercial LoRa devices. Moreover, the proposed method has low computational complexity and is very suitable for low-power Internet of Things such as LoRa. In addition, the LoRa time synchronization method proposed by us also fills the gap in the research of LoRa device time synchronization, and can achieve an accuracy of 10 microseconds. Finally, through experiments, 200 clock offset values of 4 devices are measured, and the results show that the present application can accurately identify each device.
[0088] The above specific description is a further detailed description of the purpose, technical solution and beneficial effects of the present application, and it should be understood that the above description is only a specific embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the claims of the present application.
Claims
1. A LoRa device identification system based on clock fingerprint features, characterized in that: It includes a time synchronization module, a feature extraction module, and a fingerprint recognition module; The time synchronization module utilizes the frequency hopping spread spectrum in the LoRa device to change the channel interruption record when the preamble and header of the data packet are sent, and writes them into the radio frequency FIFO and sends them along with the message. The receiver records the timestamp when the message is received and calculates the compensation time through the transmission parameters and data packet size. At the same time, it decodes the timestamp sent by the sender to obtain a timestamp pair that represents the relationship between the device clock crystal oscillator and the timetamp, which is used as the input of the feature extraction module. The feature extraction module: uses the least squares method to perform linear fitting on the timestamp pairs representing the clock crystal oscillator relationship of the devices input by the time synchronization module, extracts the clock relationship between the devices, and extracts the clock fingerprint from the clock relationship as the input of the fingerprint recognition module; The fingerprint recognition module: constructs a fingerprint database by pre-extracting the clock fingerprints of legitimate devices and registers legitimate devices; For the clock fingerprint input by the feature extraction module, the fingerprint recognition module reads a certain number of clock fingerprints for each device from the fingerprint database, calculates the distance between the input clock fingerprint and the clock fingerprints of each device in the database, and judges the distance by comparing it with a set threshold. If the distance calculated for each device is greater than the threshold, the device is judged as an illegal device; otherwise, it is a legal device and is identified as the device with the smallest distance.
2. A method for identifying LoRa devices based on clock fingerprint features, implemented based on the LoRa device identification system based on clock fingerprint features as described in claim 1, characterized in that: Includes the following steps, Step 1: Use the frequency hopping spread spectrum in the LoRa device to change the channel interruption record when the preamble and header of the data packet are sent and write them into the RF FIFO and send them with the message. The receiver records the timestamp when the message is received and calculates the compensation time through the transmission parameters and data packet size. At the same time, it decodes the timestamp sent by the sender to obtain the timestamp pair that represents the relationship between the device clock crystal oscillator. Step 2: Use the least squares method to perform linear fitting on the timestamp pairs collected in Step 1 to obtain the clock relationship between devices. Use the clock offset that characterizes the device clock crystal oscillator as the device fingerprint. By collecting the clock fingerprints of legitimate devices, construct a fingerprint database to realize the registration of legitimate devices. Step 3: When identifying an unknown device, calculate the clock fingerprint of the unknown device according to Step 1 and Step 2. Then, read a certain number of clock fingerprints of each device from the fingerprint database as a training set. Calculate the distance between the clock fingerprint of the unknown device and the clock fingerprints of each device using the nearest neighbor algorithm. Determine whether the unknown device is a legitimate device by judging whether the distance is greater than a threshold. If it is a legitimate device, identify it as the device with the smallest distance. That is, LoRa device identification and authentication is achieved based on clock fingerprint features.
3. The identification method for LoRa device identification based on clock fingerprint features as described in claim 2, characterized in that: Step 1 is implemented as follows: Step 1.1: LoRa supports frequency hopping spread spectrum communication and provides a Frequency Hopping Spread Spectrum Change Channel Interrupt (hereinafter referred to as frequency hopping interrupt). Frequency hopping spread spectrum communication refers to LoRa devices transmitting data on a specific frequency channel for a period of time before switching to another frequency channel to continue transmitting. Frequency changes are specified by setting a frequency hopping table, and the duration of transmission on a specific frequency channel is set by setting the hopping interval (HoppingPeriod). LoRa changes the frequency of the current channel by triggering a frequency hopping interrupt. The current channel value, FhssPresentChannel, is set in the RegHopChannel register, and the current channel value, FhssPresentChannel, is... The PresentChannel indexes frequencies in the specified frequency hopping table. Furthermore, LoRa specifies that the sender will first transmit the preamble and header of the LoRa data packet on channel 0, after which the first frequency hopping interrupt will be triggered. The transmitted preamble and header are not constrained by the frequency hopping interval. Utilizing the frequency hopping interrupt, when the first frequency hopping interrupt is triggered (i.e., when the sender has transmitted the preamble and header), the timestamp T1 of the completed transmission is recorded and added to the transmission queue buffer, to be transmitted with this communication. For the receiver, LoRa specifies that when LoRa completes receiving the data packet, a receive completion interrupt (RxDone Interrupt) is triggered. Therefore, the receiver records the receive completion time T1. d As a timestamp indicating completion of reception; Step 1.2, at the receiving completion time T d The time T1 between sending the preamble and header includes an interrupt delay, which is actually composed of the time over air required to send the LoRa data packet payload and a small amount of hardware response delay. Among them, hardware response latency T int It is a fixed offset value, ranging from a few microseconds to tens of microseconds depending on the different hardware platforms; the over-the-air transmission time is calculated using the payload length and the LoRa transmission rate. Where SF is the spreading factor, BW is the bandwidth, both of which are transmission parameters initialized before transmission; PL is the number of bytes of payload; CRC is whether CRC check is enabled, which is 1 when enabled and 0 when disabled; DE is whether low-rate optimization is enabled, which is enabled when SF>10, and DE is 1 when enabled and 0 when disabled; CR is the coding rate, which is another parameter initialized before transmission. Based on the calculated LoRa transmission rate and the number of symbols in the payload, T... a (k) and T d The air transmission time required to send a payload between (k) is: T ToA =Ts×n Payload The receiver compensates for over-the-air transmission time and interruption delays to obtain the time when it has received the preamble and header. Then, the gateway decodes the timestamp T sent by the sender from the received payload. a (k); Thus, through one time synchronization, the gateway can collect a pair of timestamps T. k = <T rx (k), T tx (k)>, where: T rx (k)=T d (k)-T ToA -T int T tx (k)=T a (k) 4. The identification method for LoRa device identification based on clock fingerprint features as described in claim 3, characterized in that: Step 2 is implemented as follows: Step 2.1: In time synchronization, the relationship between the two clocks is T2 = α * T1 + β, meaning there is a linear relationship between T2 and T1, where α is the clock offset and β is the clock deviation. According to Step 1, after the receiver collects a certain number of timestamp pairs, it uses the least squares method to linearly fit the timestamp pairs. The least squares method minimizes the sum of squared errors between the true and predicted values by determining unknown parameters. Where y i For the true value, For predicted values; and Therefore, by substituting The problem is transformed into an optimization problem involving α and β. By taking the partial derivatives with respect to α and β respectively, the values of clock offset α and clock deviation β can be obtained. Among them, clock offset α is the unique clock fingerprint that identifies the device, and it depends on the device's clock crystal oscillator; Step 2.2: By repeating the above steps, a certain number of clock fingerprints of legitimate devices are collected to build a fingerprint database; the device ID is the serial number of the legitimate device, and the clock fingerprint is the extracted clock offset α.
5. The identification method for LoRa device identification based on clock fingerprint features as described in claim 4, characterized in that: Step 3 is implemented as follows: When a device needs to be identified, the receiver first calculates a clock fingerprint α for that device through steps 1 and 2.1; then, it reads k clock fingerprints for each device from the fingerprint database. in Represent the k-th clock fingerprint of the i-th device; use the nearest neighbor algorithm to calculate the clock fingerprint θ of this device and... The distance d between i , where d i Calculated using the following formula: By determining the distance d i If the distance d to any device is greater than the set threshold σ, the device is considered an illegal device; otherwise, the device is identified as an illegal device if the distance d is less than the set threshold σ. i The smallest device.
Citation Information
Patent Citations
Anti-neighbor collusion digital fingerprint generation method based on dynamic network representation learning
CN113326485A
Terminal identity authentication method based on device fingerprint under ubiquitous power Internet of Things
CN114125847A