A time synchronization system security testing method and system

By deploying a central computing gateway in the vehicle network to capture and tamper with gPTP messages, the problem of high cost and complexity of traditional verification methods is solved, the security and robustness of the rapid verification time synchronization system are achieved, equipment costs are reduced and Improved testing efficiency.

CN118611990BActive Publication Date: 2024-10-18AUTOCORE INTELLIGENT TECH (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411077962.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-10-18
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

In vehicle networks, traditional time synchronization system security, reliability and robustness verification requires professional equipment, and is difficult to quickly verify under rapid product iteration and different environmental conditions, and the equipment cost and environmental requirements are high.

Method used

By deploying a central computing gateway in the time synchronization system, setting up a gPTP message acquisition module, a tampering module and a sending module, capturing and tampering with gPTP messages, and simulating network man-in-the-middle attacks, the security and robustness of the time synchronization system can be quickly verified.

Benefits of technology

With minimal cost and minimal network changes, the abnormal structure of gPTP messages is realized, ensuring real-time data transmission and network integrity, saving professional tester equipment, and enabling rapid iteration of test scenarios, reducing R&D costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611990B_ABST
    Figure CN118611990B_ABST
Patent Text Reader

Abstract

The invention discloses a time synchronization system security testing method and system, wherein the central computing gateway of the system comprises a message acquisition module, a message tampering module, and a message sending module; the message acquisition module filters and obtains messages, and outputs them to the message tampering module; the message tampering module parses the messages to obtain all protocol attributes and corresponding attribute values, tampering the tampered attribute values ​​into target values, and outputs the modified tampered messages to the message sending module; the message sending module encapsulates the messages into a network message format, and calls a sending interface to forward the messages; the message receiver receives the tampered messages, performs parsing and processing, and the system throws out the reception abnormal message performance, and obtains the test result of receiving the network communication middleman message tampering attack. The invention realizes the real-time tampering of interactive messages, and solves the time synchronization system response situation and the security, reliability and robustness verification problems under the attack of network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle-mounted networks, and in particular to a time synchronization system security testing method and system. Background Art

[0002] The security, reliability and robustness verification of traditional time synchronization systems requires the use of professional equipment and instruments, such as TSNBox, to simulate the Master and Slave roles of gPTP from the source and construct gPTP message packets to test the corresponding time synchronization security, reliability and robustness verification. However, this method has very high requirements for networking, equipment costs and environmental conditions.

[0003] Nowadays, time synchronization is a necessary protocol stack in the vehicle network usage scenario, and the simulated in-vehicle networking is very complex, with more than one pair of master-slave nodes. With rapid product iteration, we must quickly verify the security, reliability and robustness logic of the time synchronization system under different environmental conditions.

[0004] Therefore, a technology is needed that can quickly modify the gPTP message logic without destroying the verification environment networking and without increasing the hardware cost, so as to provide a technical method for quickly verifying the security, reliability and robustness of time synchronization. Summary of the invention

[0005] In order to solve the deficiencies in the prior art, the object of the present invention is to provide a time synchronization system security testing method and system.

[0006] To achieve the purpose of the present invention, the technical solution adopted by the present invention is:

[0007] A time synchronization system security test system includes a time synchronization system master clock, a time synchronization system slave clock, and a central computing gateway; a central computing gateway is set on the intermediate path between the time synchronization system master clock and the time synchronization system slave clock, and a gPTP message acquisition module, a gPTP message tampering module, and a gPTP message sending module are deployed on the central computing gateway;

[0008] The central computing gateway captures all Ethernet network messages passing through its path, filters the gPTP messages through the gPTP message acquisition module, and outputs them to the gPTP message tampering module for processing;

[0009] The gPTP message tampering module receives the gPTP message, parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values, tampered with the attribute value to the target value, replaces it to obtain a new message, and outputs the new gPTP message to the gPTP message sending module;

[0010] The gPTP message sending module receives the message data input by the gPTP message tampering module, processes the network packet of the message, processes it into a network data flow, and then forwards it according to the original data flow direction of the data flow;

[0011] The gPTP message receiver receives the tampered gPTP message and performs parsing processing. The system will throw out the corresponding performance of receiving the abnormal gPTP message message, and obtain the test result of the network communication middleman message tampering attack.

[0012] Furthermore, the master clock and slave clock of the time synchronization system exchange data in the network through gPTP messages. The master clock periodically sends gPTP sub-messages of the Syn and Follow_up types to the slave clock. After receiving the gPTP sub-messages of the Syn and Follow_up types, the slave clock sends a gPTP sub-message of the Pdelay_req type to the master clock periodically to request a path timestamp. After receiving the gPTP sub-messages of the Pdelay_resp and Pdelay_Resp_Follow_up types, the master clock responds to the gPTP sub-message of the Pdelay_req type. The slave clock calculates the clock synchronization offset and path delay based on the timestamps carried by the gPTP sub-messages of the Follow_up and Pdelay_resp and Pdelay_Resp_Follow_up types.

[0013] A time synchronization system security testing method comprises the following steps:

[0014] (1) The central computing gateway captures all Ethernet network messages passing through its path, filters the gPTP messages through the gPTP message acquisition module, and outputs them to the gPTP message tampering module for processing;

[0015] (2) The gPTP message tampering module receives the gPTP message, parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values, tampered with the attribute value to the target value, replaces it to obtain a new message, and outputs the new gPTP message to the gPTP message sending module;

[0016] (3) The gPTP message sending module receives the message data input by the gPTP message tampering module, processes the network packet of the message, processes it into a network data flow, and then forwards it according to the original data flow direction of the data flow;

[0017] (4) The gPTP message receiver receives the tampered gPTP message and parses it. The system will throw out the corresponding performance of receiving the abnormal gPTP message message and obtain the test result of the network communication middleman message tampering attack.

[0018] Furthermore, in step (1), the central computing gateway creates two independent original Socket objects, binds the eth1 network card and the eth2 network card respectively, and enables the Promisc promisc mode configuration for the eth1 and eth2 network cards. All data packets passing through the original path are captured and forwarded by the central computing gateway.

[0019] Furthermore, in step (1), the gPTP message acquisition module identifies whether the message is an Ethernet message by judging that the type field value of the Ethernet layer is 0x88f7. If so, the data packet is sent to the gPTP message tampering module. Otherwise, the data packet is directly sent to the gPTP message sending module.

[0020] Furthermore, in step (2), the gPTP message tampering module converts the original network byte stream of the received original gPTP message from binary to hexadecimal, and then obtains the messageType attribute value in the PTP protocol by string slicing, and determines that the gPTP message types are Syn, Follow_up, Pdelay_req, Pdelay_resp, and Pdelay_Resp_Follow_up respectively; then, according to the format specified by the specification of the gPTP message, all attributes and attribute values ​​specified in the gPTP message are obtained, and the bytes to be modified are replaced by string replacement to generate a new data string, and then the new data is passed to the gPTP message sending module.

[0021] Furthermore, in step (2), the gPTP message attribute value tampering mainly includes the majorSdoId field, versionptp field, minorversionptp field, and sequenceid field of all types of gPTP messages; and the timestamp tampering carried by the gPTP message types Follow_up, Pdelay_resp, and Pdelay_Resp_Follow_up.

[0022] Furthermore, in step (3), the gPTP message sending module converts the tampered string into a base, packages it into a network byte stream, and then sends it from the eth2 network card through the original Socket sending interface according to the message flow of the original data packet.

[0023] The beneficial effect of the present invention is that, compared with the prior art, the present invention provides a method and system for verifying the security, reliability and robustness of a time synchronization system. A central computing gateway server is deployed on any gPTP transmission path based on the original networking. The server is not limited to the hardware platform. It only needs two independent Ethernet cards, which are respectively connected to the media on the path where the gPTP message is originally to be transmitted. Logically, this server is equivalent to a transmission network cable on the path. With the minimum cost and the minimum subnet change, it can meet the requirements of abnormal construction of gPTP messages to the maximum extent.

[0024] The present invention deploys a central computing gateway server without the need for additional hardware. The gateway logic only needs to create a Socket to capture and send data, and insert data modification logic between data capture and data sending. Complex verification scenarios that require professional hardware equipment to construct can be constructed with simple code logic.

[0025] The system of the present invention provides real-time tampering, which ensures the real-time integrity of system data transmission and the retention of network integrity to the greatest extent. It only needs to add tampering logic in the normal networking test scenario, which simulates the actual security problem scenario to the greatest extent.

[0026] The present invention saves professional tester equipment by deploying a central computing gateway, but can also achieve the message content modification function that professional instruments can achieve, greatly saving research and development costs.

[0027] The present invention deploys a central computing gateway on the transmission path, and applies the gPTP message capture module logic, gPTP message tampering module logic, and gPTP message sending module logic on the gateway, without destroying the original networking, thereby ensuring the networking integrity of the original test environment.

[0028] The present invention adds a gPTP message scenario that needs to be tampered through the gPTP message tampering module logic, and has strong scalability. When the gPTP message capture module logic and the gPTP message sending module logic do not need to be changed, the test scenario content can be quickly iterated. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic diagram of the time synchronization system security test system of the present invention;

[0030] Figure 2 It is a schematic diagram of the time synchronization system security testing method described in the present invention. DETAILED DESCRIPTION

[0031] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of this application.

[0032] like Figure 1 As shown, the time synchronization system security test system of the present invention includes a time synchronization system master clock, a time synchronization system slave clock, and a central computing gateway. A central computing gateway is set on the intermediate path between the time synchronization system master clock and the time synchronization system slave clock, and a gPTP message acquisition module, a gPTP message tampering module, and a gPTP message sending module are deployed on the central computing gateway.

[0033] The central computing gateway captures all Ethernet network messages passing through its path, filters the gPTP messages through the gPTP message acquisition module, and outputs them to the gPTP message tampering module for processing.

[0034] The gPTP message tampering module parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values ​​according to the gPTP message content collected from the gPTP message acquisition module, tampered with the attribute value into the target value, replaces the message content to obtain a new message, and outputs the obtained new gPTP message to the gPTP message sending module.

[0035] The gPTP message sending module receives the message data input by the gPTP message tampering module, and then processes the network packet of the message into a network data stream, and then forwards it according to the original data flow direction of the data stream.

[0036] The gPTP message receiver receives the tampered gPTP message and performs parsing processing. The system will throw out the corresponding performance of receiving the abnormal gPTP message message, and obtain the test result when receiving the network communication middleman message tampering attack.

[0037] The master clock and slave clock of the time synchronization system exchange data in the network through gPTP messages. The master clock periodically sends gPTP submessages of the Syn and Follow_up types to the slave clock. After receiving the gPTP submessages of the Syn and Follow_up types, the slave clock sends a gPTP submessage of the Pdelay_req type to the master clock periodically to request a path timestamp. After receiving the gPTP submessages of the Pdelay_resp and Pdelay_Resp_Follow_up types, the master clock responds to the gPTP submessage of the Pdelay_req type. The slave clock starts to calculate the clock synchronization offset and path delay based on the timestamps carried by the gPTP submessages of the Follow_up, Pdelay_resp, and Pdelay_Resp_Follow_up types.

[0038] In this process, when the central computing gateway receives a gPTP sub-message type Follow_up message sent by the time synchronization system master clock from the network card eth1 port, it first filters the gPTP sub-message type Follow_up message through the gPTP message acquisition module, and then modifies the sequenceid attribute value of the gPTP sub-message type Follow_up message from the original 1558 to 1 through the gPTP message tampering module, and returns a new data packet. In the next step, the new data packet is passed to the gPTP message sending module, and the gPTP message sending module encapsulates the data packet into a network message and sends it through the network card eth After the gPTP sub-message type Follow_up message with tampered sequenceid is received by the time synchronization system from the clock, it is found that it does not match the sequenceid of Syn, and the system will throw an exception. The timestamp carried by this round of Follow_up message will not participate in the calculation of the clock synchronization offset and path delay of the entire cycle. At this time, the processing capability and response of the time synchronization system to abnormal gPTP message messages under the condition of abnormal sequenceid attribute value of the gPTP sub-message type Follow_up message in the time synchronization system security test requirement are completed.

[0039] The system of the present invention is developed using Python dynamic language, without the need for compilation. The intermediate tampering logic uses a script external parameter method, and tags are used to distinguish tampering scenarios. Code modification is extremely convenient and fast. The message parsing part uses the Scapy parsing library. After receiving the original data packet, it can be directly sent to the Ether() method of the Scapy library for instantiation, and the data packet parsing object is returned. Then, the corresponding gPTP message content attributes and attribute values ​​are searched by layer according to the returned object, which provides a flexible and standard scenario construction for time synchronization system security verification.

[0040] like Figure 2 As shown, a time synchronization system security testing method includes the steps of:

[0041] (1) The gPTP message acquisition module in the central computing gateway obtains the gPTP message after message filtering and transmits it to the gPTP message tampering module. The remaining messages that have not passed the filtering are directly forwarded according to the original message sending logic direction;

[0042] Deploy a central computing gateway to replace the network cable transmission on the original path. Create two independent original sockets on the central computing gateway, bind the eth1 network card and the eth2 network card respectively, and all data packets passing through the original path are captured and forwarded by the central computing gateway.

[0043] The central computing gateway enables the Promisc promisc mode configuration for the eth1 and eth2 network cards to receive network messages whose destination MAC is not their own. The gPTP message acquisition module binds eth1 and eth2 respectively by creating two original Socket objects S1 and S2. The Socket object is set to non-blocking mode through the setblocking method to prevent the program logic from being in a waiting state if the Socket does not receive the network message, affecting subsequent logical processing; if the type field value in the filtered Ethernet layer is 0x88f7, it is a gPTP message.

[0044] The eth1 network card of the central computing gateway receives the data packet pkt sent by the master clock of the time synchronization system. Next, the original Socket object of the gPTP message acquisition module continuously queries whether there is a message arriving through a While loop in a process. At this time, it is determined that an original data stream pkt has been received.

[0045] Next, the gPTP message acquisition module determines whether this message is an Ethernet message, and determines that the type field value of the Ethernet layer is 0x88f7 to identify this packet as a gPTP message. If it is, the data packet is sent to the gPTP message tampering module. If not, the data packet is directly sent to the gPTP message sending module. In this embodiment, this data packet is a gPTP data packet.

[0046] (2) The gPTP message tampering module parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values ​​based on the gPTP message content collected from the gPTP message acquisition module, tampering the tampered attribute value to the target value, replacing the message content to obtain a new message, and outputting the obtained new gPTP message to the gPTP message sending module;

[0047] The gPTP message tampering module converts the original gPTP message obtained from the message acquisition module from binary to hexadecimal, and then obtains the messageType attribute value in the PTP protocol through string slicing, and determines that the gPTP message types are Syn, Follow_up, Pdelay_req, Pdelay_resp, and Pdelay_Resp_Follow_up; then, according to the format specified by the specification of the gPTP message, obtains all the attributes and attribute values ​​specified in the gPTP message, replaces the bytes to be modified through string replacement, generates a new data string, and then passes the new data to the gPTP message sending module.

[0048] The tampering of gPTP message attribute values ​​mainly includes the majorSdoId field, versionptp field, minorversionptp field, and sequenceid field of all types of gPTP messages; the tampering of the timestamp carried by the gPTP message types Follow_up, Pdelay_resp, and Pdelay_Resp_Follow_up, and on this basis, the logical code of the field that needs to be tampered is also expanded according to needs.

[0049] (3) The gPTP message sending module receives the message data input by the gPTP message tampering module, and then processes the network packet of the message into a network data flow, and then forwards it according to the original data flow direction of the data flow;

[0050] The gPTP message sending module needs to convert the tampered string into a binary system first, then package it into a network byte stream, and then send it to the target device through the original Socket sending interface according to the message flow direction of the original data packet. At this time, the gPTP message sent out is the tampered message.

[0051] The gPTP message sending module packages and encapsulates the tampered gPTP data packet pkt new into a network message. Next, the gPTP sending module sends the tampered gPTP data packet pkt new from the eth2 network card, and the time synchronization system receives the tampered gPTP data packet pkt new from the clock.

[0052] (4) The gPTP message receiver receives the tampered gPTP message, parses it, and then performs logical processing, throwing out the corresponding performance of receiving the abnormal gPTP message message, and obtains the test result when receiving the network communication middleman message tampering attack.

[0053] The time synchronization system receives the tampered gPTP data packet pkt new from the clock. The clock will identify this message and report an exception, and logically discard this message. It does not participate in the calculation of the time synchronization offset and path delay. This completes the test content of this embodiment.

[0054] The tampered gPTP message content generally has the following manifestations: 1. Message parsing fails, the message is discarded, or the protocol stack exits; 2. Message parsing succeeds, the field content is wrong, and error information is reported; 3. Message parsing succeeds, and the time synchronization logic calculated based on the sequenceid in the message fails, and the protocol stack will have abnormal performance; 4. Message parsing succeeds, and the time synchronization logic calculated based on the key timestamp information in the message fails, and the protocol stack will have abnormal performance.

[0055] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

Claims

1. A time synchronization system security testing system, characterized in that: It includes a time synchronization system master clock, a time synchronization system slave clock, and a central computing gateway; a central computing gateway is set on the intermediate path between the time synchronization system master clock and the time synchronization system slave clock, and a gPTP message acquisition module, a gPTP message tampering module, and a gPTP message sending module are deployed on the central computing gateway; The central computing gateway captures all Ethernet network messages passing through its path, filters the gPTP messages through the gPTP message acquisition module, and outputs them to the gPTP message tampering module for processing; The gPTP message tampering module receives the gPTP message, parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values, tampered with the attribute value to the target value, replaces it to obtain a new message, and outputs the new gPTP message to the gPTP message sending module; The gPTP message sending module receives the message data input by the gPTP message tampering module, processes the network packet of the message, processes it into a network data flow, and then forwards it according to the original data flow direction of the data flow; The gPTP message receiver receives the tampered gPTP message and performs parsing processing. The system will throw out the corresponding performance of receiving the abnormal gPTP message message, and obtain the test result of the network communication middleman message tampering attack.

2. The time synchronization system security testing system according to claim 1, characterized in that: The master clock and slave clock of the time synchronization system exchange data in the network through gPTP messages. The master clock periodically sends gPTP submessages of the Syn and Follow_up types to the slave clock. After receiving the gPTP submessages of the Syn and Follow_up types, the slave clock sends a gPTP submessage of the Pdelay_req type to the master clock periodically to request a path timestamp. After receiving the gPTP submessages of the Pdelay_resp and Pdelay_Resp_Follow_up types, the master clock responds to the gPTP submessage of the Pdelay_req type. The slave clock calculates the clock synchronization offset and path delay based on the timestamps carried by the gPTP submessages of the Follow_up, Pdelay_resp, and Pdelay_Resp_Follow_up types.

3. A time synchronization system security testing method, based on the time synchronization system security testing system according to any one of claims 1-2, characterized in that: Includes steps: (1) The central computing gateway captures all Ethernet network messages passing through its path, filters the gPTP messages through the gPTP message acquisition module, and outputs them to the gPTP message tampering module for processing; (2) The gPTP message tampering module receives the gPTP message, parses the gPTP message to obtain all gPTP protocol attributes and corresponding attribute values, tampered with the attribute value to the target value, replaces it to obtain a new message, and outputs the new gPTP message to the gPTP message sending module; (3) The gPTP message sending module receives the message data input by the gPTP message tampering module, processes the network packet of the message, processes it into a network data flow, and then forwards it according to the original data flow direction of the data flow; (4) The gPTP message receiver receives the tampered gPTP message and parses it. The system will throw out the corresponding performance of receiving the abnormal gPTP message message and obtain the test result of the network communication middleman message tampering attack.

4. The time synchronization system security testing method according to claim 3, characterized in that: In step (1), the central computing gateway creates two independent original Socket objects, binds them to the eth1 network card and the eth2 network card respectively, and enables the Promisc promisc mode configuration for the eth1 and eth2 network cards. All data packets passing through the original path are captured and forwarded by the central computing gateway.

5. The time synchronization system security testing method according to claim 3, characterized in that: In step (1), the gPTP message acquisition module identifies whether the message is an Ethernet message by judging whether the type field value of the Ethernet layer is 0x88f7. If it is, the data packet is sent to the gPTP message tampering module. If not, the data packet is directly sent to the gPTP message sending module.

6. The time synchronization system security testing method according to claim 3, characterized in that: In step (2), the gPTP message tampering module converts the original network byte stream of the received original gPTP message from binary to hexadecimal, and then obtains the messageType attribute value in the PTP protocol by string slicing, and determines that the gPTP message types are Syn, Follow_up, Pdelay_req, Pdelay_resp, and Pdelay_Resp_Follow_up respectively; then, according to the format specified by the specification of the gPTP message, obtains all the attributes and attribute values ​​specified in the gPTP message, replaces the bytes to be modified by string replacement, generates a new data string, and then transmits the new data to the gPTP message sending module.

7. The time synchronization system security testing method according to claim 3, characterized in that: In step (2), the gPTP message attribute value tampering mainly includes the majorSdoId field, versionptp field, minorversionptp field, and sequenceid field of all types of gPTP messages; the timestamp carried by the gPTP message types Follow_up, Pdelay_resp, and Pdelay_Resp_Follow_up is tampered.

8. The time synchronization system security testing method according to claim 3, characterized in that: In step (3), the gPTP message sending module converts the tampered string into a binary format, packages it into a network byte stream, and then sends it from the eth2 network card through the original Socket sending interface according to the message flow of the original data packet.

Citation Information

Patent Citations

  • Clock synchronization test method based on redundant security system

    CN108880728A

  • Precision testing method and device for high-precision clock synchronization

    CN112054939A