Network booting method, communication apparatus and system
By performing authentication and key distribution in parallel during the link training stage of on-board Ethernet startup, and using training frames to carry secure messages, the problem of on-board Ethernet startup time is solved, and the security communication capability is improved and the automotive-level time is achieved. The requirements are met.
Patent Information
- Application Number
- PCT/CN2024/091406
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-02
- Filing Date
- 2024-05-07
- Publication Date
- 2024-12-05
AI Technical Summary
The existing on-board Ethernet startup process results in the startup time being too long during the process of adding authentication and key distribution, which cannot meet the automotive-grade startup time requirements.
Authentication and key distribution are carried out in parallel during the link training stage of on-board Ethernet startup, and training frames are used to carry secure messages for secure processing to ensure that the network has secure communication capabilities after startup.
It realizes that the security of on-board Ethernet is improved without increasing the total network startup time, and meets the automotive-grade startup time requirements.
Smart Images

Figure CN2024091406_05122024_PF_FP_ABST
Abstract
Description
Network startup method, communication device and system
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on June 2, 2023, with application number 202310655777.0 and application name “Network startup method, communication device and system”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of Ethernet technology, and in particular to a network startup method, a communication device, and a system. Background Art
[0003] With the development and application of technologies such as driver assistance systems, automated parking, and advanced infotainment systems, users are increasingly demanding in-vehicle network bandwidth, exceeding the carrying capacity of traditional in-vehicle networks. Consequently, in-vehicle Ethernet emerged and is rapidly developing and being adopted.
[0004] The existing in-vehicle Ethernet boot process includes system initialization, configuration delivery, link establishment, and link training. With increasing user demands for network security, the in-vehicle Ethernet boot process needs to incorporate authentication and key distribution to enhance security. However, some currently proposed solutions significantly increase the total boot time of in-vehicle Ethernet, preventing the vehicle from meeting automotive-grade boot time requirements and thus lacking feasibility.
[0005] Summary of the Invention
[0006] The present application provides a network startup method, a communication device, and a system for adding authentication and / or key distribution processes to the in-vehicle Ethernet startup process to improve the security of the in-vehicle Ethernet.
[0007] In a first aspect, a network startup method is provided. The method can be performed by a first device, or by a component of the first device, such as a processor, chip, or chip system of the first device. It can also be implemented by a logic module or software that implements all or part of the functions of the first device. The network startup process may include at least a link training process and a security processing process. The method may include: the first device and a second device transmitting a training frame, the training frame carrying a security message. The first device performs link training based on the training frame, and performs security processing based on the security message.
[0008] Based on this solution, the first and second devices can use the training frames used for link training to carry security messages, allowing the first and second devices to perform security processing based on the security messages. This method incorporates security processing during the network startup process, enabling secure communication between the first and second devices after network startup. Furthermore, because the security processing process is performed in parallel with the link training process, the total network startup time is not significantly increased.
[0009] In combination with the above first aspect, in a possible implementation, the security processing may include authentication and / or key distribution.
[0010] In combination with the above first aspect, in a possible implementation manner, the training frame includes an information field, and the first reserved field in the information field can be used to carry a security message.
[0011] Based on this solution, the existing reserved fields in the training frame can be used to carry security messages, so that this method is compatible with the existing network startup process, and the solution can be easily implemented and promoted.
[0012] In combination with the above-mentioned first aspect, in a possible implementation manner, the length of the first reserved field may be an integer multiple of 8 bits.
[0013] Based on this solution, a security message can be completely carried by one or more training frames, which makes it convenient to divide the training frames carrying security messages during the communication process.
[0014] In combination with the above-mentioned first aspect, in a possible implementation, the information field may further include a second reserved field, which may be used to indicate whether the training frame is the starting frame corresponding to the security message carried by the first reserved field.
[0015] Based on this solution, the starting frame carrying the security message is marked so that the receiver can correctly obtain the security message from multiple training frames.
[0016] In conjunction with the first aspect above, in one possible implementation, during a security processing process, the first device and the second device need to exchange security messages multiple times. The information field also includes a third reserved field, which is used to indicate the order of the security message carried by the first reserved field in the multiple exchanged security messages.
[0017] Based on this solution, the receiver can accurately identify the progress of the current security processing process, thereby correctly replying to the security message and avoiding errors in the security message interaction of the security processing process.
[0018] In combination with the above first aspect, in a possible implementation, one training frame carries one security message, or multiple training frames jointly carry one security message.
[0019] In combination with the above first aspect, in a possible implementation manner, when multiple training frames jointly carry a security message, the multiple training frames are training frames that are transmitted continuously.
[0020] In conjunction with the first aspect above, in one possible implementation, a security message exchanged between a first device and a second device during a security processing process for the first time is carried in a training frame transmitted based on a preconfigured time. Alternatively, a security message exchanged between a first device and a second device during a security processing process for the first time is carried in a preset training frame.
[0021] Based on this solution, when the first device and the second device start transmitting the security message can be pre-configured.
[0022] In conjunction with the first aspect above, in one possible implementation, the first device and the second device transmit training frames, which may specifically include: the first device and the second device continuously transmit multiple training frames, where the multiple training frames carry multiple different security messages. The first device performs link training based on the training frames and performs security processing based on the security messages, which may specifically include: the first device performs link training based on the multiple training frames and performs security processing based on the multiple different security messages.
[0023] In conjunction with the first aspect above, in one possible implementation, security processing may include authentication. The transmission of training frames between a first device and a second device may include: first, the first device sending at least one first training frame to the second device, the at least one first training frame carrying a first security message, the first security message used to indicate PSK-based authentication. Then, the first device receives at least one second training frame from the second device, the at least one second training frame carrying a second security message, the second security message including a first random number and a first identifier (ID). The first random number is generated by the second device, and the first ID is the ID of the second device. Then, the first device sends at least one third training frame to the second device, the at least one third training frame carrying a third security message, the third security message including a first random number, a second random number, a second ID, a first count value, and first authentication data. The second random number and the first count value are generated by the first device, and the second ID is the ID of the first device. The first authentication data is calculated by the first device using a preconfigured algorithm and a key on the first random number, the second random number, the first ID, the second ID, and the first count value. The first authentication data is used by the second device to authenticate the first device. Next, the first device receives at least one fourth training frame from the second device. The at least one fourth training frame carries a fourth security message, which includes a second random number, a first count value, and second authentication data. The second authentication data is obtained by the second device by calculating the second random number, the second ID, and the first count value according to a preconfigured algorithm and key. The second authentication data is used by the first device to authenticate the second device. The preconfigured algorithm and key of the first and second devices are the same.
[0024] Based on this solution, the first device and the second device can complete the PSK-based authentication process by transmitting training frames.
[0025] In conjunction with the first aspect above, in one possible implementation, the security processing may include authentication. The first device and the second device transmitting training frames may include: First, the first device sends at least one fifth training frame to the second device, the at least one fifth training frame carrying a fifth security message, which is used to indicate password-based authentication. Then, the first device receives at least one sixth training frame from the second device, the at least one sixth training frame carrying a sixth security message, which includes a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the second device, and the first ID is the ID of the second device. The third authentication data is calculated by the second device using the third random number, the first ID, and the second count value according to a preconfigured algorithm and a password. The third authentication data is used by the first device to authenticate the second device. Then, the first device sends at least one seventh training frame to the second device, the at least one seventh training frame carrying a seventh security message, which includes a third random number, a fourth random number, the second ID, the second count value, and fourth authentication data. The fourth random number is generated by the first device, and the second ID is the ID of the first device. The fourth authentication data is obtained by the first device calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. The fourth authentication data is used by the second device to authenticate the first device. The first device and the second device have the same preconfigured algorithm and password.
[0026] Based on this solution, the first device and the second device can complete the password-based authentication process by transmitting training frames.
[0027] In combination with the first aspect above, in a possible implementation, the security processing may include key distribution. The first device and the second device transmit training frames, and may also include. First, the first device receives at least one eighth training frame from the second device, and the at least one eighth training frame carries an eighth security message. The eighth security message includes a start mark, a first ID, and a first security capability parameter. The start mark is used to indicate the start of key distribution, the first ID is the ID of the second device, and the first security capability parameter is the security capability parameter of the second device. Then, the first device sends at least one ninth training frame to the second device, and the at least one ninth training frame carries a ninth security message. The ninth security message includes a second ID, a second security capability parameter, and a security association key SAK. The second ID is the ID of the first device, the second security capability parameter is the security capability parameter determined by the first device for communication between the first device and the second device, and SAK is the key determined by the first device for communication between the first device and the second device.
[0028] Based on this solution, the first device and the second device can complete the key distribution process and authentication process by transmitting a training frame.
[0029] In a second aspect, a network startup method is provided. This method can be performed by a second device, or by a component of the second device, such as a processor, chip, or chip system of the second device. It can also be implemented by a logic module or software that implements all or part of the second device's functions. The network startup process can include at least a link training process and a security processing process. The method can include: the second device transmits a training frame with the first device, the training frame carrying a security message. The second device performs link training based on the training frame, and performs security processing based on the security message.
[0030] In combination with the above second aspect, in a possible implementation, the security processing may include authentication and / or key distribution.
[0031] In combination with the above second aspect, in a possible implementation, the training frame includes an information field, and the first reserved field in the information field can be used to carry a security message.
[0032] In combination with the above second aspect, in a possible implementation, the length of the first reserved field may be an integer multiple of 8 bits.
[0033] In combination with the above second aspect, in a possible implementation, the information field may further include a second reserved field, which may be used to indicate whether the training frame is the starting frame corresponding to the security message carried by the first reserved field.
[0034] In conjunction with the second aspect above, in one possible implementation, during a security processing process, the second device and the first device need to exchange security messages multiple times. The information field also includes a third reserved field, which is used to indicate the order of the security message carried by the first reserved field in the multiple exchanged security messages.
[0035] In combination with the above second aspect, in a possible implementation, one training frame carries one security message, or multiple training frames jointly carry one security message.
[0036] In combination with the second aspect above, in a possible implementation, when multiple training frames jointly carry a security message, the multiple training frames are training frames that are transmitted continuously.
[0037] In conjunction with the second aspect above, in one possible implementation, a security message exchanged between the second device and the first device for the first time during the security processing process is carried in a training frame transmitted based on a preconfigured time. Alternatively, a security message exchanged between the second device and the first device for the first time during the security processing process is carried in a preset training frame.
[0038] In conjunction with the second aspect above, in one possible implementation, the second device and the first device transmit training frames, which may specifically include: the second device and the first device continuously transmit multiple training frames, where the multiple training frames carry multiple different security messages. The second device performs link training based on the training frames and performs security processing based on the security messages, which may specifically include: the second device performs link training based on the multiple training frames and performs security processing based on the multiple different security messages.
[0039] In conjunction with the second aspect above, in one possible implementation, the security processing may include authentication. The second device transmitting training frames to the first device may include: First, the second device receives at least one first training frame from the first device, the at least one first training frame carrying a first security message, the first security message used to indicate PSK-based authentication. Then, the second device sends at least one second training frame to the first device, the at least one second training frame carrying a second security message, the second security message including a first random number and a first identifier (ID). The first random number is generated by the second device, and the first identifier is the ID of the second device. Then, the second device receives at least one third training frame from the first device, the at least one third training frame carrying a third security message, the third security message including a first random number, a second random number, a second identifier, a first count value, and first authentication data. The second random number and the first count value are generated by the first device, and the second ID is the ID of the first device. The first authentication data is obtained by the first device performing a calculation on the first random number, the second random number, the first identifier, the second identifier, and the first count value according to a preconfigured algorithm and a key. The first authentication data is used by the second device to authenticate the first device. The second device then sends at least one fourth training frame to the first device. The at least one fourth training frame carries a fourth security message, which includes a second random number, a first count value, and second authentication data. The second authentication data is calculated by the second device using a preconfigured algorithm and key on the second random number, the second ID, and the first count value. The second authentication data is used by the first device to authenticate the second device. The preconfigured algorithm and key are the same for the first and second devices.
[0040] In conjunction with the second aspect above, in one possible implementation, the security processing may include authentication. The second device transmitting training frames to the first device may include: First, the second device receives at least one fifth training frame from the first device, the at least one fifth training frame carrying a fifth security message, which is used to indicate password-based authentication. Then, the second device sends at least one sixth training frame to the first device, the at least one sixth training frame carrying a sixth security message, which includes a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the second device, and the first ID is the ID of the second device. The third authentication data is calculated by the second device using the third random number, the first ID, and the second count value according to a preconfigured algorithm and a password. The third authentication data is used by the first device to authenticate the second device. Then, the second device receives at least one seventh training frame from the first device, the at least one seventh training frame carrying a seventh security message, which includes a third random number, a fourth random number, the second ID, the second count value, and fourth authentication data. The fourth random number is generated by the first device, and the second ID is the ID of the first device. The fourth authentication data is obtained by the first device calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. The fourth authentication data is used by the second device to authenticate the first device. The first device and the second device have the same preconfigured algorithm and password.
[0041] In combination with the above-mentioned second aspect, in a possible implementation, the security processing may include key distribution. The second device and the first device transmit training frames, which may also include: first, the second device sends at least one eighth training frame to the first device, the at least one eighth training frame carries an eighth security message, and the eighth security message includes a start mark, a first ID, and a first security capability parameter. The start mark is used to indicate the start of key distribution, the first ID is the ID of the second device, and the first security capability parameter is the security capability parameter of the second device. Then, the second device receives at least one ninth training frame from the second device, the at least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter, and a security association key SAK. The second ID is the ID of the first device, the second security capability parameter is the security capability parameter determined by the first device for communication between the first device and the second device, and SAK is the key determined by the first device for communication between the first device and the second device.
[0042] Among them, the technical effects of the above-mentioned second aspect and its various implementation methods can refer to the above-mentioned first aspect and will not be repeated here.
[0043] In a third aspect, the present application provides a communication device, which may be the first device of the first aspect above, or a chip or chip system in the first device of the first aspect above, or a functional module in the first device of the first aspect above. The communication device can implement the functions performed by the first device in any possible design of the first aspect above, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, the communication device may include: a transceiver module and a processing module. Among them, the transceiver module can be used to transmit a training frame with the second device, and the training frame carries a security message. The processing module can be used to perform link training based on the training frame, and perform security processing based on the security message.
[0044] In conjunction with the third aspect above, in one possible implementation, the transceiver module and the second device transmit training frames, which may specifically include: the transceiver module and the second device continuously transmit multiple training frames, where the multiple training frames carry multiple different security messages. The processing module performs link training based on the training frames and performs security processing based on the security messages, which may specifically include: the processing module performs link training based on the multiple training frames and performs security processing based on the multiple different security messages.
[0045] In conjunction with the third aspect above, in one possible implementation, security processing may include authentication. The transceiver module transmitting training frames to the second device may include: first, the transceiver module sending at least one first training frame to the second device, the at least one first training frame carrying a first security message, the first security message used to indicate PSK-based authentication. Then, the transceiver module receives at least one second training frame from the second device, the at least one second training frame carrying a second security message, the second security message including a first random number and a first identifier (ID). The first random number is generated by the second device, and the first identifier is the ID of the second device. Then, the transceiver module sends at least one third training frame to the second device, the at least one third training frame carrying a third security message, the third security message including a first random number, a second random number, a second identifier, a first count value, and first authentication data. The second random number and the first count value are generated by the transceiver module, and the second identifier is the ID of the transceiver module. The first authentication data is calculated by the transceiver module on the first random number, the second random number, the first identifier, the second identifier, and the first count value according to a preconfigured algorithm and a key. The first authentication data is used by the second device to authenticate the transceiver module. The transceiver module then receives at least one fourth training frame from the second device. The at least one fourth training frame carries a fourth security message, which includes a second random number, a first count value, and second authentication data. The second authentication data is obtained by the second device by calculating the second random number, the second ID, and the first count value according to a preconfigured algorithm and key. The second authentication data is used by the transceiver module to authenticate the second device. The transceiver module and the second device have the same preconfigured algorithm and key.
[0046] In conjunction with the third aspect above, in one possible implementation, security processing may include authentication. The transceiver module transmitting training frames to the second device may include: first, the transceiver module sending at least one fifth training frame to the second device, the at least one fifth training frame carrying a fifth security message, the fifth security message used to indicate password-based authentication. Then, the transceiver module receives at least one sixth training frame from the second device, the at least one sixth training frame carrying a sixth security message, the sixth security message including a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the second device, and the first ID is the ID of the second device. The third authentication data is calculated by the second device using the third random number, the first ID, and the second count value according to a preconfigured algorithm and a password. The third authentication data is used by the transceiver module to authenticate the second device. Then, the transceiver module sends at least one seventh training frame to the second device, the at least one seventh training frame carrying a seventh security message, the seventh security message including a third random number, a fourth random number, the second ID, the second count value, and fourth authentication data. The fourth random number is generated by the transceiver module, and the second ID is the ID of the transceiver module. The fourth authentication data is obtained by the transceiver module by calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. The fourth authentication data is used by the second device to authenticate the transceiver module. The transceiver module and the second device have the same preconfigured algorithm and password.
[0047] In combination with the third aspect above, in a possible implementation, security processing may include key distribution. The transceiver module transmits training frames to the second device, which may also include: first, the transceiver module receives at least one eighth training frame from the second device, the at least one eighth training frame carries an eighth security message, and the eighth security message includes a start marker, a first ID, and a first security capability parameter. The start marker is used to indicate the start of key distribution, the first ID is the ID of the second device, and the first security capability parameter is the security capability parameter of the second device. Then, the transceiver module sends at least one ninth training frame to the second device, the at least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter, and a security association key SAK. The second ID is the ID of the transceiver module, the second security capability parameter is the security capability parameter determined by the transceiver module for communication between the transceiver module and the second device, and the SAK is the key determined by the transceiver module for communication between the transceiver module and the second device.
[0048] In a fourth aspect, the present application provides a communication device, which may be the first device of the second aspect, or a chip or chip system in the first device of the second aspect, or a functional module in the first device of the second aspect. The communication device can implement the functions performed by the first device in any possible design of the second aspect, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, the communication device may include: a transceiver module and a processing module. The transceiver module transmits a training frame with the first device, and the training frame carries a security message. The processing module performs link training based on the training frame, and performs security processing based on the security message.
[0049] In conjunction with the fourth aspect above, in one possible implementation, the transceiver module and the first device transmit training frames, which may specifically include: the transceiver module and the first device continuously transmit multiple training frames, where the multiple training frames carry multiple different security messages. The transceiver module performs link training based on the training frames and performs security processing based on the security messages, which may specifically include: the transceiver module performs link training based on the multiple training frames and performs security processing based on the multiple different security messages.
[0050] In conjunction with the fourth aspect above, in one possible implementation, security processing may include authentication. The transceiver module transmitting training frames to the first device may include: first, the transceiver module receiving at least one first training frame from the first device, the at least one first training frame carrying a first security message, the first security message used to indicate PSK-based authentication. Then, the transceiver module sending at least one second training frame to the first device, the at least one second training frame carrying a second security message, the second security message including a first random number and a first identifier (ID). The first random number is generated by the transceiver module, and the first ID is the transceiver module's ID. Then, the transceiver module receiving at least one third training frame from the first device, the at least one third training frame carrying a third security message, the third security message including a first random number, a second random number, a second ID, a first count value, and first authentication data. The second random number and the first count value are generated by the first device, and the second ID is the first device's ID. The first authentication data is calculated by the first device using a preconfigured algorithm and a key on the first random number, the second random number, the first ID, the second ID, and the first count value. The first authentication data is used by the transceiver module to authenticate the first device. The transceiver module then sends at least one fourth training frame to the first device. The at least one fourth training frame carries a fourth security message, which includes a second random number, a first count value, and second authentication data. The second authentication data is calculated by the transceiver module based on a preconfigured algorithm and key on the second random number, the second ID, and the first count value. The second authentication data is used by the first device to authenticate the transceiver module. The first device and the transceiver module have the same preconfigured algorithm and key.
[0051] In conjunction with the fourth aspect above, in one possible implementation, security processing may include authentication. The transceiver module transmitting training frames to the first device may include: first, the transceiver module receiving at least one fifth training frame from the first device, the at least one fifth training frame carrying a fifth security message, the fifth security message being used to indicate password-based authentication. Then, the transceiver module sending at least one sixth training frame to the first device, the at least one sixth training frame carrying a sixth security message, the sixth security message including a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the transceiver module, and the first ID is the ID of the transceiver module. The third authentication data is calculated by the transceiver module based on a preconfigured algorithm and a password on the third random number, the first ID, and the second count value. The third authentication data is used by the first device to authenticate the transceiver module. Then, the transceiver module receiving at least one seventh training frame from the first device, the at least one seventh training frame carrying a seventh security message, the seventh security message including a third random number, a fourth random number, a second ID, a second count value, and fourth authentication data. The fourth random number is generated by the first device, and the second ID is the ID of the first device. The fourth authentication data is obtained by the first device calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. The fourth authentication data is used by the transceiver module to authenticate the first device. The preconfigured algorithm and password for the first device and the transceiver module are the same.
[0052] In combination with the fourth aspect above, in a possible implementation, security processing may include key distribution. The transceiver module transmits training frames with the first device, and may also include: first, the transceiver module sends at least one eighth training frame to the first device, the at least one eighth training frame carries an eighth security message, and the eighth security message includes a start mark, a first ID, and a first security capability parameter. The start mark is used to indicate the start of key distribution, the first ID is the ID of the transceiver module, and the first security capability parameter is the security capability parameter of the transceiver module. Then, the transceiver module receives at least one ninth training frame from the transceiver module, the at least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter, and a security association key SAK. The second ID is the ID of the first device, the second security capability parameter is the security capability parameter determined by the first device for the first device to communicate with the transceiver module, and the SAK is the key determined by the first device for the first device to communicate with the transceiver module.
[0053] In a fifth aspect, a communication device is provided, comprising: a processor and a communication interface; the communication interface can be configured to perform the receiving and sending operations described in the network startup method described in the first aspect, and the processor is configured to perform the processing or control operations described in the network startup method described in the first aspect. Alternatively, the communication interface is configured to perform the receiving and sending operations described in the network startup method described in the second aspect, and the processor is configured to perform the processing or control operations described in the network startup method described in the second aspect.
[0054] In a sixth aspect, a communication device is provided, comprising: a processor and a memory; the memory is used to store computer instructions, and when the communication device is running, the processor executes the computer instructions stored in the memory to enable the communication device to perform a network startup method as described in any one of the first or second aspects above.
[0055] In conjunction with the sixth aspect, in one possible implementation, the communication device further includes a communication interface; the communication interface is used for the communication device to communicate with other devices. Exemplarily, the communication interface may be a transceiver, an input / output interface, an interface circuit, an output circuit, an input circuit, a pin, or related circuits.
[0056] In a seventh aspect, a communication device is provided, comprising: a processor; the processor is used to couple with a memory, and after reading instructions in the memory, can execute a network startup method as described in any one of the first or second aspects above according to the instructions.
[0057] In conjunction with the seventh aspect above, in one possible implementation, the communication device further includes a communication interface; the communication interface is used for the communication device to communicate with other devices. Exemplarily, the communication interface can be a transceiver, an input / output interface, an interface circuit, an output circuit, an input circuit, a pin, or related circuits.
[0058] In an eighth aspect, a chip is provided, comprising: a processor, the processor being coupled to a memory, the memory being used to store programs or instructions, and when the programs or instructions are executed by the processor, the chip executes the network startup method described in any one of the first or second aspects above.
[0059] In a ninth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer can execute the network startup method described in any one of the first aspect or the second aspect.
[0060] In a tenth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the network startup method described in any one of the first or second aspects above.
[0061] In an eleventh aspect, a communication system is provided, which may include a first device and a second device. The first device may execute any one of the network startup methods described in the first aspect, and the second device may execute any one of the network startup methods described in the first aspect.
[0062] Among them, the technical effects brought about by any design method in the third aspect to the eleventh aspect can refer to the technical effects brought about by different design methods in the first aspect or the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] FIG1 is a schematic diagram of an in-vehicle Ethernet startup process provided by an embodiment of the present application;
[0064] FIG2 is a schematic diagram of another in-vehicle Ethernet startup process provided by an embodiment of the present application;
[0065] FIG3 is a schematic diagram of another in-vehicle Ethernet startup process provided by an embodiment of the present application;
[0066] FIG4 is a schematic diagram of a communication system provided in an embodiment of the present application;
[0067] FIG5 is a schematic diagram of an in-vehicle Ethernet provided in an embodiment of the present application;
[0068] FIG6 is a schematic structural diagram of a communication device provided in an embodiment of the present application;
[0069] FIG7 is a flow chart of a network startup method provided in an embodiment of the present application;
[0070] FIG8 is a schematic diagram of a frame structure of an information field of a training frame provided in an embodiment of the present application;
[0071] FIG9 is a schematic diagram showing the division of 21 reserved bits in the information field of a training frame provided in an embodiment of the present application;
[0072] FIG10 is a schematic diagram of a link training phase during the startup process of an in-vehicle Ethernet according to an embodiment of the present application;
[0073] FIG11 is a schematic diagram of a state change of a device provided in an embodiment of the present application;
[0074] FIG12 is a schematic diagram of a process of transmitting a training frame between a first device and a second device according to an embodiment of the present application;
[0075] FIG13 is a schematic diagram of a first training frame carrying a first security message provided by an embodiment of the present application;
[0076] FIG14 is a schematic diagram of a second training frame carrying a second security message provided by an embodiment of the present application;
[0077] FIG15 is a schematic diagram of a third training frame carrying a third security message provided by an embodiment of the present application;
[0078] FIG16 is a schematic diagram of a fourth training frame carrying a fourth security message provided by an embodiment of the present application;
[0079] FIG17 is a schematic diagram of a tenth training frame carrying a tenth security message provided by an embodiment of the present application;
[0080] FIG18 is a schematic diagram of an eleventh training frame carrying an eleventh safety message provided by an embodiment of the present application;
[0081] FIG19 is a schematic diagram of another process of transmitting a training frame between a first device and a second device according to an embodiment of the present application;
[0082] FIG20 is a schematic diagram of a fifth training frame carrying a fifth security message provided by an embodiment of the present application;
[0083] FIG21 is a schematic diagram of a sixth training frame carrying a sixth security message provided by an embodiment of the present application;
[0084] FIG22 is a schematic diagram of a seventh training frame carrying a seventh security message provided by an embodiment of the present application;
[0085] FIG23 is a schematic diagram of a twelfth training frame carrying a twelfth security message provided by an embodiment of the present application;
[0086] FIG24 is a schematic diagram of a process of transmitting a training frame between a first device and a second device according to another embodiment of the present application;
[0087] FIG25 is a schematic diagram of an eighth training frame carrying an eighth security message provided by an embodiment of the present application;
[0088] FIG26 is a schematic diagram of a ninth training frame carrying a ninth security message provided by an embodiment of the present application;
[0089] FIG27 is a schematic diagram of a thirteenth training frame carrying a thirteenth safety message provided by an embodiment of the present application;
[0090] FIG28 is a schematic diagram of a fourteenth training frame carrying a fourteenth safety message provided by an embodiment of the present application;
[0091] FIG29 is a schematic diagram of a process of transmitting a training frame between a first device and a second device according to another embodiment of the present application;
[0092] Figure 30 is a structural diagram of another communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] To facilitate understanding, first, a brief introduction is given to the technical terms and related technologies involved in this application.
[0094] Ethernet is the most common communication protocol standard used in local area networks (LANs). It defines the cable types and signal processing methods used within LANs. Ethernet transmits information packets between interconnected devices at rates of 10 to 100 megabits per second (Mbps). 10Base-T Ethernet, based on twisted-pair cable, is the most widely used Ethernet technology due to its low cost, high reliability, and 10 Mbps speed.
[0095] As the name suggests, automotive Ethernet is an in-vehicle network based on Ethernet technology. It primarily focuses on in-vehicle networking, specifically communication between various electronic control units (ECUs) within the vehicle. Its emergence addresses the demand for high-bandwidth data within in-vehicle networks. It's important to understand that with the development and application of technologies such as driver assistance systems, automated parking, and advanced infotainment systems, the demand for in-vehicle network bandwidth is increasing, exceeding the carrying capacity of traditional vehicle networks. This has led to the rapid application of Ethernet in the field of in-vehicle networking, and its rapid growth.
[0096] Figure 1 is a schematic diagram of the in-vehicle Ethernet startup process. As shown in Figure 1, the current in-vehicle Ethernet startup process primarily includes the following phases: system initialization, configuration delivery, link establishment, and link training. The configuration delivery phase is also referred to as the host configuration stage (HCS). According to relevant test reports, the system initialization phase of the in-vehicle Ethernet startup process takes 7 milliseconds (ms), the configuration delivery phase takes 5 ms, and the link establishment and link training processes take a total of 40 ms. Continuing with Figure 1, the in-vehicle Ethernet startup process takes a total of 52 ms.
[0097] However, the current in-vehicle Ethernet startup process does not include secure startup functions (such as authentication and key distribution). As a result, there are security risks when using the in-vehicle Ethernet after startup, which may not meet the security needs of some customers.
[0098] To meet security requirements, one possible implementation involves adding existing standardized security mechanisms to the automotive Ethernet field, such as MACsec, defined in Institute of Electrical and Electronics Engineers (IEEE) 802.1AE and IEEE 802.1X. This security mechanism includes authentication, key distribution, and encryption. For example, Figure 2 shows another schematic diagram of the automotive Ethernet startup process. As shown in Figure 2, after the link training phase of the automotive Ethernet startup process is completed, authentication and key distribution continue, enabling the booted automotive Ethernet to have security and encryption capabilities.
[0099] However, the added security mechanisms increase the startup time of automotive Ethernet, exceeding the automotive-grade startup time requirements. Test data shows that the authentication process in automotive Ethernet takes 27ms, and the key distribution process takes 29ms. Continuing with Figure 2, when authentication and key distribution are added to the automotive Ethernet startup process, the total startup time is 108ms. Current automotive-grade startup times require less than 100ms from power-up to network availability. This means that if authentication and key distribution are added to the automotive Ethernet startup process, the automotive-grade startup time requirement cannot be met.
[0100] To meet the time requirements for in-vehicle network startup specified by industry standards, embodiments of the present application provide a network startup method that implements authentication and / or key distribution during the link training phase of the in-vehicle Ethernet startup process, thereby ensuring that the in-vehicle Ethernet after startup has security and encryption capabilities. Furthermore, because authentication and / or key distribution are implemented during the link training phase, no additional time is required for authentication and / or key distribution, ensuring that the in-vehicle Ethernet startup meets the automotive-grade startup time requirements.
[0101] It should be understood that authentication and / or key distribution are implemented during the link training phase, and it can be considered that the authentication and / or key distribution process is carried out in parallel with the link training process. For example, Figure 3 is a schematic diagram of another in-vehicle Ethernet startup process. As shown in Figure 3, at least part of the authentication and / or key distribution process can be carried out in parallel with the link training process, so that the link training time can cover part of the authentication and / or key distribution time. For example, in the example of Figure 3, the total duration of link establishment, link training, and authentication and / or key distribution can be 50ms, and the total duration of the entire in-vehicle Ethernet startup process is 62ms. Compared with the in-vehicle Ethernet startup process shown in Figure 2, the total time consumption of the in-vehicle Ethernet startup process shown in Figure 3 is shortened.
[0102] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0103] Before introducing the network startup method provided in the embodiment of the present application, the communication system / service scenario to which the network startup method of the present application is applied is first introduced.
[0104] FIG4 is a schematic diagram of a communication system provided in an embodiment of the present application. As shown in FIG4 , the communication system may include a first device 401 and a second device 402 , and the first device 401 is connected to the second device 402 .
[0105] Optionally, the communication system shown in Figure 4 can be an in-vehicle Ethernet, and the first device 401 and the second device 402 can be in-vehicle devices in the in-vehicle Ethernet (such as an in-vehicle gateway, an in-vehicle terminal, various ECUs, etc.). The first device 401 or the second device 402 in the communication system shown in Figure 4 can execute the startup process of the in-vehicle Ethernet shown in Figures 1 to 3.
[0106] The network startup method provided in the embodiment of the present application can be applied to the first device 401 or the second device 402 in the communication system shown in Figure 4. For specific implementation, please refer to the following method embodiment, which will not be described in detail here.
[0107] Figure 5 is a schematic diagram of an in-vehicle Ethernet provided in an embodiment of the present application. As shown in Figure 5, the in-vehicle Ethernet may include a main control unit 501. The main control unit 501 can be connected to an advanced driving assistance system (ADAS) unit 502, a body control unit 503, a powertrain unit 504, a chassis control unit 505, and an entertainment control unit 506. The ADAS 502 can be connected to devices such as a camera 507, an on-board radar 508, and a satellite navigation system 509. The entertainment control unit 506 can be connected to devices such as a display 510, a speaker 511, and a television (TV) 512.
[0108] Alternatively, the communication system shown in FIG4 may be an in-vehicle Ethernet, and the first device 401 and the second device 402 may be the two connected units shown in FIG5 . For example, the first device 401 may be an ADAS 502, and the second device 402 may be a camera 507, an in-vehicle radar 508, or a satellite navigation system 509. Alternatively, the first device 401 may be an entertainment control unit 506, and the second device 402 may be a display 510, a speaker 511, or a TV 512. Alternatively, the first device 401 may be a main control unit 501, and the second device 402 may be an ADAS unit 502, a body control unit 503, a powertrain unit 504, a chassis control unit 505, or an entertainment control unit 506.
[0109] The network startup method provided in the embodiment of the present application can be applied between the various units in the vehicle Ethernet shown in Figure 5 above, so that the various units establish a communication link. The specific implementation can be referred to the following method embodiment, which will not be repeated here.
[0110] It should be noted that the in-vehicle Ethernet architecture shown in FIG5 is merely exemplary, and the in-vehicle Ethernet architectures of vehicles produced by different automobile manufacturers and brands may be different.
[0111] It should be understood that the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0112] Optionally, the first device and the second device in the embodiment of the present application may be a communication device, and the first device and the second device may adopt the composition structure shown in Figure 6 or include the components shown in Figure 6. Figure 6 is a structural diagram of a communication device provided in an embodiment of the present application. As shown in Figure 6, the communication device 60 includes one or more processors 601, a communication line 602, and at least one communication interface (Figure 6 is only exemplary and takes the inclusion of a communication interface 603 and a processor 601 as an example for explanation). Optionally, a memory 604 may also be included.
[0113] The processor 601 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.
[0114] Communication line 602 may include a pathway for communication between different components.
[0115] The communication interface 603 may be a transceiver module for communicating with other devices or communication networks, such as Ethernet, RAN, or wireless local area networks (WLAN). For example, the transceiver module may be a device such as a transceiver or a transceiver. Alternatively, the communication interface 603 may be a transceiver circuit within the processor 601, which is used to implement signal input and output to the processor.
[0116] The memory 604 may be a device having a storage function. For example, it may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via the communication line 602. The memory may also be integrated with the processor.
[0117] The memory 604 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the computer-executable instructions stored in the memory 604, thereby implementing the multi-hop transmission method provided in the embodiment of the present application.
[0118] Alternatively, optionally, in an embodiment of the present application, the processor 601 may also perform processing-related functions in the multi-hop transmission method provided in the following embodiments of the present application, and the communication interface 603 is responsible for communicating with other devices or communication networks, which is not specifically limited in the embodiments of the present application.
[0119] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0120] In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as CPU0 and CPU1 in FIG6 .
[0121] In a specific implementation, as an embodiment, the communication device 60 may include multiple processors, such as the processor 601 and the processor 607 in FIG6 . Each of these processors may be a single-core processor or a multi-core processor. The processors here may include, but are not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, and other types of computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing.
[0122] In a specific implementation, as an embodiment, the communication device 60 may further include an output device 605 and an input device 606. The output device 605 communicates with the processor 601 and can display information in a variety of ways. For example, the output device 605 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 606 communicates with the processor 601 and can receive user input in a variety of ways. For example, the input device 606 can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0123] The communication device 60 described above may also sometimes be referred to as a communication device, which may be a general-purpose device or a dedicated device. For example, the communication device 60 may be a network device such as a router, a switch, or a gateway, or a terminal device, or a controller in a network, or a device having a similar structure to that shown in FIG6 . The embodiments of the present application do not limit the type of the communication device 60.
[0124] The network startup method provided in the embodiments of the present application will be described below with reference to Figures 1 to 6. The actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message names or parameter names in the embodiments of the present application are only examples, and other names can also be used in specific implementations without limitation.
[0125] Figure 7 is a flowchart of a network startup method provided by an embodiment of the present application. The network startup method is applied to the network startup process, and the network startup process may include at least a link training process and a security processing process. As shown in Figure 7, the network startup method may include the following steps:
[0126] Step 701: A first device and a second device transmit a training frame, where the training frame carries a security message.
[0127] Among them, the training frame can be used for link training, and its frame format and the information carried for link training can refer to those described in the existing standards. Optionally, the first device and the second device transmit the training frame, which may include: the first device sends a training frame to the second device, and the second device sends a training frame to the first device. It should be understood that the training frame is defined based on the function of the frame to have link training, and the frames for link training transmitted between the first device and the second device can be called training frames. This application does not limit the content of the training frames to be the same. For example, the training frame sent by the first device to the second device may be different from the training frame sent by the second device to the first device, the multiple training frames sent by the first device to the second device may be different, and the multiple training frames sent by the second device to the first device may be different.
[0128] Optionally, multiple training frames may be continuously transmitted between the first device and the second device. For example, the first device may continuously send training frames to the second device, and the second device may also continuously send training frames to the first device.
[0129] Optionally, the process of the first device sending a training frame to the second device is independent of the process of the second device sending a training frame to the first device. For example, the process of the first device sending a training frame to the second device is independent of the process of the first device receiving a training frame from the second device. The process of the second device sending a training frame to the first device is independent of the process of the second device receiving a training frame from the first device.
[0130] In an embodiment of the present application, in addition to carrying information used for link training, the training frame also carries a security message. The security message carried by the training frame can be used for security processing between the first device and the second device.
[0131] Optionally, the security processing may include authentication and / or key distribution, and the training frame may carry security messages for authentication and / or key distribution.
[0132] Optionally, the multiple training frames continuously transmitted between the first device and the second device may carry multiple different security messages.
[0133] Optionally, one training frame can carry one security message, or multiple training frames can jointly carry one security message. It should be understood that if the length of a security message does not exceed the carrying capacity of one training frame, then one training frame can be used to carry one security message. If the length of a security message exceeds the carrying capacity of one training frame, then multiple training frames can be used to jointly carry one security message. For example, if the carrying capacity of one training frame is 2 bytes and the length of one security message is less than or equal to 2 bytes, then one training frame can carry one complete security message. If the carrying capacity of one training frame is 2 bytes and the length of one security message is greater than 2 bytes, then at least two training frames are required to carry one complete security message.
[0134] Optionally, when multiple training frames jointly carry a security message, the multiple training frames jointly carrying the security message may be multiple training frames continuously sent by the first device or the second device. It should be understood that by transmitting the same security message via multiple consecutively sent data frames, the receiving end can conveniently and correctly read the security message carried in the training frames.
[0135] Optionally, the first security message exchanged between the first device and the second device during the security processing process can be carried in a training frame transmitted based on a preconfigured time. Alternatively, the first security message exchanged between the first device and the second device during the security processing process can be carried in a preset training frame. In other words, the time or training frame from which the security message for the first interaction begins to be transmitted can be preconfigured.
[0136] Optionally, the frame structure of the training frame may include an information field (infofield), which includes at least one reserved field. The at least one reserved field can be used to carry security messages. For example, the first reserved field in the information field can be used to carry security messages. It should be understood that the first reserved field can be any reserved field or a preset reserved field in the information field, without limitation.
[0137] Optionally, the length of the first reserved field in the information field of a training frame may be an integer multiple of 8 bits. The length of a security message used for security processing may be an integer multiple of 8 bits. The length of a security message may be greater than or equal to the length of the first reserved field, and a security message may be carried by one or more training frames. For example, if the length of a security message is 8 bits and the length of the first reserved field in the information field of a training frame is 8 bits, then one training frame can completely carry the security message. For another example, if the length of a security message is 16 bits and the length of the first reserved field in the information field of a training frame is 8 bits, then two training frames can carry the security message.
[0138] Optionally, the information field of the training frame may further include a second reserved field, which may be used to indicate whether the training frame is the starting frame corresponding to the security message carried by the first reserved field. The starting frame corresponding to the security message may refer to: a training frame carrying the starting part of the security message. In other words, if the content carried by the first reserved field of the training frame includes the starting part of the security message, then the training frame may be considered to be the starting frame corresponding to the security message carried by the first reserved field. In this way, the second reserved field can be used to determine whether the training frame carries the starting information of the security message, so that the first device or the second device can continuously receive the security message from the starting part of the security message, thereby ensuring the integrity of the received security message and improving the accuracy of receiving the security message.
[0139] As a possible implementation, when a training frame carries a security message, the second reserved field of the training frame carrying the security message can be set to the first value. In the embodiment of the present application, the value of the second reserved field being the first value indicates that the current training frame is the starting frame carrying the security message.
[0140] As a possible implementation, when multiple training frames jointly carry a security message, the second reserved field of the starting frame corresponding to the security message in the multiple training frames can be set to the first value, and the second reserved fields of other training frames except the starting frame can be set to the second value. In this embodiment of the present application, the value of the second reserved field being the second value indicates that the current training frame is not the starting frame carrying the security message.
[0141] For example, training frame a and training frame b jointly carry a security message 1. Training frame a carries the first half of security message 1, and training frame b carries the second half of security message 1. Therefore, the second reserved field of training frame a can be set to a first value (e.g., a value of 0), and the second reserved field of training frame b can be set to a second value (e.g., a value of 1). It should be understood that training frame a is the starting frame carrying security message 1, so the second reserved field of training frame a is the first value. Training frame b is not the starting frame carrying security message 1, so the second reserved field of training frame b is the second value.
[0142] Optionally, the information field of the training frame may further include a third reserved field, which is used to indicate the sequence number of the security message carried by the first reserved field. The sequence number of the security message indicates the order of the security message among the multiple security messages exchanged during the security processing process. It should be understood that during the security processing process, the first device and the second device may need to exchange security messages with different contents multiple times, and the sequence number can indicate the order of each of the multiple security messages exchanged.
[0143] Figure 8 is a schematic diagram of the frame structure of the information field of a training frame provided in an embodiment of the present application. As shown in Figure 8, the information field may include 12 octets: octet1 to octet12. The first three octets (octet1 to octet3) can be used for frame locking. For example, the value of octet1 can be 0xBB, the value of octet2 can be 0xA7, and the value of octet3 can be 0x00. The 4th to 6th octets (octet4 to octet6) are physical layer frame count (PFC) fields, which are used to carry the count value of the training frame. The 7th octet (octet7) can be a message field, which is used to carry status information related to the link training process. The 8th to 10th octets (octet8 to octet10) are PFC capability fields, which are used to carry device capability information that interacts during the link training process. The 11th and 12th octets (octet11-octet12) are cyclic redundancy check (CRC) fields, which are used to carry CRC information.
[0144] Continuing with Figure 8 , if the training frame is sent by the master, the message field may include a PMA_state indicator bit (2 bits in length), a Loc_revr_status indicator bit (1 bit in length), an En_slave_tx indicator bit (1 bit in length), and a reserved bit (4 bits in length). The PMA_state indicator bit is used to indicate whether the link training process has entered the countdown phase, the Loc_revr_status indicator bit is used to indicate the number of the training frame in the current phase, and the En_slave_tx indicator bit is used to indicate whether the slave device has started sending training frames. PMA refers to physical medium attachment, as explained herein.
[0145] Continuing with FIG8 , when the training frame is sent from a slave device (slave), the message field may include a PMA_state indicator bit (2 bits in length), a Loc_revr_status indicator bit (1 bit in length), a Timing_lock_ok indicator bit (1 bit in length), and a reserved bit (4 bits in length). The functions of the PMA_state indicator bit and the Loc_revr_status bit are as described above, and the Timing_lock_ok indicator bit is used to indicate whether the slave device has completed clock synchronization.
[0146] Continuing with Figure 8, octet 8 and octet 9 in the PFC capability field are used to carry vendor-specific data and are reserved by the vendor. In octet 10 in the PFC capability field, the first bit is reserved, the second and third bits are used to indicate an increase in interleaver depth, the fourth and fifth bits are used to indicate precoding selection (precodesel), and the sixth bit is used to indicate a slow wake request. The seventh bit is used to indicate whether the Energy Efficient Ethernet (EEE) function is enabled (EEE enable, abbreviated as EEEen). The eighth bit is used to indicate whether the Operations Administration and Maintenance (OAM) function is enabled (OAM enable, abbreviated as OAMen).
[0147] In the information field shown in FIG8 , bits 5-8 of octet7, all bits of octet8 and octet9, and bit 1 of octet10 (a total of 21 bits) are reserved. Optionally, the 21 reserved bits can be used as the first reserved field, the second reserved field, and the third reserved field described above.
[0148] As a possible implementation, FIG9 shows a schematic diagram of the division of the 21-bit reserved bits in the information field of the training frame, wherein the first 4 bits of the 21-bit reserved bits (corresponding to bits 5-8 of octet7 in FIG8 ) can be used as the third reserved field, the 5th bit of the 21-bit reserved bits (corresponding to bit 1 of octet8 in FIG8 ) can be used as the second reserved field, and bits 6 to 21 of the 21-bit reserved bits (corresponding to bits 2-8 of octet8, all bits of octet9, and bit 1 of octet10) can be used as the first reserved field. The description of the first reserved field, the second reserved field, and the third reserved field can be found above and will not be repeated here.
[0149] Step 702: The first device performs link training based on the training frame and performs security processing based on the security message.
[0150] Optionally, the first device performing link training based on the training frame may include: the first device training parameters for link communication on the first device side based on the received training frame. As a possible implementation, the parameters for link communication may include a clock, equalizer parameters, descrambling code status, etc.
[0151] Optionally, the first device may continuously train the physical layer parameters of the first device side by continuously receiving training frames, so that the parameters used for link communication on the first device side are increasingly converged and the performance of the received signal is increasingly improved.
[0152] Optionally, the first device may obtain multiple different security messages by continuously receiving training frames. The first device performing security processing based on the security message may include: the first device performing security processing based on the multiple different security messages.
[0153] Optionally, the security processing may include authentication and / or key distribution. Thus, the first device performing security processing based on the security message may include: the first device performing authentication and / or key distribution based on the security message.
[0154] Optionally, the network startup method may further include: step 703, the second device performs link training based on the training frame and performs security processing based on the security message. It should be understood that the actions of the second device can refer to the relevant description of the actions of the first device in step 702, which will not be repeated here.
[0155] Optionally, the multiple training frames continuously transmitted between the first device and the second device may sequentially carry security messages corresponding to each authentication and / or key distribution step according to the authentication and / or key distribution steps. Thus, the first device and the second device may sequentially perform each authentication and / or key distribution step, thereby completing the authentication and / or key distribution process.
[0156] It should be understood that if the first device and the second device are successfully authenticated, the first device and the second device may consider each other to be legitimate users, so that subsequent communication between the first device and the second device will meet the security requirements of both parties.
[0157] It should be understood that if key distribution is successfully achieved between the first device and the second device, the first device and the second device can subsequently perform encrypted communication based on the negotiated key, so that subsequent communication between the first device and the second device will meet the security requirements of both parties.
[0158] Based on the network startup method provided above, the first and second devices can use the training frames used for link training to carry security messages, allowing the first and second devices to perform security processing based on the security messages. This method incorporates security processing during the network startup process, enabling the first and second devices to have secure communication capabilities after network startup. Furthermore, because the security processing process is performed in parallel with the link training process, the total duration of the network startup process is not significantly increased.
[0159] Alternatively, the first device and the second device may be devices in an in-vehicle Ethernet network. Applying the above method to the startup process of the in-vehicle Ethernet network can enable secure communication capabilities for the in-vehicle Ethernet network after startup. Furthermore, because the security processing and link training processes can be performed in parallel, incorporating security processing into the network startup process can still meet the startup time requirements of the in-vehicle Ethernet network.
[0160] In the embodiments of the present application, the period from the time a link is established until the link can normally transmit service data is divided into a link training phase, such as the link training phase shown in Figures 1 to 3. It should be understood that during the period from the time a link is established until the link can normally transmit service data, the state and interaction behavior of the devices are constantly changing.
[0161] Optionally, the link training phase may specifically include multiple different sub-phases, with different sub-phases corresponding to different device states and interaction behaviors. As a possible implementation, the training frames carrying security messages transmitted between the first device and the second device in the above embodiment may be transmitted during the sub-phase of the link training phase in which the first device and the second device exchange capability information.
[0162] FIG10 is a schematic diagram of a link training phase in a vehicle Ethernet startup process provided by the present application. As shown in FIG10 , the link training process may include the following phases in sequence:
[0163] Phase 1: The master device's transmitter is enabled and continuously sends training frames to the slave device. The slave device's transmitter remains silent. The slave device receives training frames to train its parameters, which may include clock, equalizer parameters, and descrambling status.
[0164] Phase 2: The slave device's transmitter is enabled, and the slave device continues to send training frames to the master device. The master device can train its own parameters by receiving training frames. The parameters for these are described above for slave device training and are not detailed here. Furthermore, the master device continues to send training frames to the slave device, and the slave device continues to receive training frames to train its own parameters.
[0165] Phase 3: The master device continuously sends training frames to the slave device, and the slave device also continuously sends training frames to the master device. Furthermore, the master and slave devices exchange capability information through these training frames. Both the master and slave devices can include their capability information in the training frames they send, thereby notifying the other device of this capability information.
[0166] In the embodiment of the present application, the security message described above may be carried in a training frame used for capability information exchange, and the method steps described above may occur in the third stage.
[0167] As a possible implementation, after the master and slave devices have trained their parameters by receiving training frames until certain conditions are met (for example, a bit error rate below a certain threshold), they can enter the third phase. It should be understood that if the bit error rate of the training frames received by the master and slave devices is below a certain threshold, this indicates that the success rate and accuracy of communication between the master and slave devices are high, and the link is relatively stable. In this case, the exchange of capability information between the master and slave devices is relatively reliable.
[0168] It should be noted that, in the third phase, in addition to exchanging capability information by sending training frames to each other, the master device and the slave device can also continue to train local parameters by receiving training frames.
[0169] Phase 4: The fourth phase is the countdown phase. After the master and slave devices complete the capability exchange, they enter this phase. During this phase, the master and slave devices can agree to continue sending the same number of training frames to each other before stopping. For example, the master and slave devices can agree to stop sending training frames after sending 256 training frames.
[0170] In an embodiment of the present application, the first device may be the master device in Figure 10, the second device may be the slave device in Figure 10, the first device and the second device may execute the network startup method described in the embodiment corresponding to Figure 7 in the third stage in Figure 10, and the training frame transmitted in the third stage in Figure 10 may carry the security message of the present application.
[0171] FIG11 is a schematic diagram of a physical layer (PHY) control state change of a device provided by the present application. As shown in FIG11 , the change of the physical layer control state of the device may be as follows:
[0172] 1. If the conditions ((link_control=disable)*auto_neg_imp*mr_autoneg_enable)+((sync_link_control=disable)*!auto_neg_imp*!mr_autoneg_enable)+(pma_reset=on) are met, the transmitter is in the disable transmitter state.
[0173] "link_control=disable" in the above conditions means that the link control (link_control) parameter is set to disable (disable), "sync_link_control=disable" in the above conditions means that the synchronization link control (sync_link_control) parameter is set to disable, "auto_neg_imp" in the above conditions means that the auto_neg_imp parameter is set to true, "!auto_neg_imp" in the above conditions means that the auto_neg_imp parameter is set to false, "mr_autoneg_enable" in the above conditions means that the mr_autoneg_enable parameter is set to true, "!mr_autoneg_enable" in the above conditions means that the mr_autoneg_enable parameter is set to false, and "pma_reset=on" in the above conditions means that the pma_reset parameter is set to on (on).
[0174] In FIG11 , “*” is used to indicate an “and” relationship, and “+” indicates an “or” relationship, which are explained uniformly here.
[0175] Therefore, satisfying the condition ((link_control = disable) * auto_neg_imp * mr_autoneg_enable) + ((sync_link_control = disable) * !auto_neg_imp * !mr_autoneg_enable) + (pma_reset = on) can be understood as satisfying the situation where "the link_control parameter is set to disable, the auto_neg_imp parameter is set to true, and the mr_autoneg_enable parameter is set to true." Alternatively, satisfying the situation where "the sync_link_control parameter is set to disable, the auto_neg_imp parameter is set to false, and the mr_autoneg_enable parameter is set to false." Alternatively, satisfying the situation where "the pma_reset parameter is set to on."
[0176] In this field, the link_control parameter can be configured with two values (enable or disable). Disable is used by the auto-negotiation function to disable the PHY function, and enable indicates that the auto-negotiation function is used to enable the PHY function. The mr_autoneg_enable parameter is used to control the enabling and disabling of the auto-negotiation function. The mr_autoneg_enable parameter can be configured with two values (true and false). False indicates that auto-negotiation is disabled, and true indicates that auto-negotiation is enabled.
[0177] As shown in FIG11 , after entering the disable transmitter state, the physical coding sublayer (PCS) data mode (PCS_data_mode) parameter is set to false.
[0178] In this field, the PCS_data_mode parameter is used to indicate whether the PHY transitions from the initialization state to the PCS data mode and can be configured to two values (true or false). Setting the PCS_data_mode parameter to false indicates that the PHY remains in the initialization state, and setting the PCS_data_mode parameter to true indicates that the PHY transitions from the initialization state to the PCS data mode.
[0179] 2. If the condition ((link_control=enable)*auto_neg_imp*mr_autoneg_enable)+((sync_link_control=enable)*!auto_neg_imp*!mr_autoneg_enable) is met, the system enters the silent state.
[0180] In the above conditions, "link_control=enable" indicates that the link_control parameter is set to enable, and "sync_link_control=enable" indicates that the sync_link_control parameter is set to enable. In addition, the meanings of "auto_neg_imp", "mr_autoneg_enable", "!auto_neg_imp", and "!mr_autoneg_enable" in the above conditions have been explained above and will not be repeated here.
[0181] The condition ((link_control=enable)*auto_neg_imp*mr_autoneg_enable)+((sync_link_control=enable)*!auto_neg_imp*!mr_autoneg_enable) is satisfied, which can be understood as: satisfying the condition that "the link_control parameter is set to enable, the auto_neg_imp parameter is set to true, and the mr_autoneg_enable parameter is set to true." Alternatively, satisfying the condition that "the sync_link_control parameter is set to enable, the auto_neg_imp parameter is set to false, and the mr_autoneg_enable parameter is set to false."
[0182] As shown in FIG11 , after entering the silent state, the minimum wait timer (start minwait_timer) is started, and the TX_mode parameter is set to SEND_Z (ie, TX_mode=SEND_Z).
[0183] In this field, the TX_mode parameter indicates the data transmission mode on the link and can be configured to three values: SEND_N, SEND_T, and SEND_Z. N stands for normal, and SEND_N means sending normal data frames; T stands for training, and SEND_T means sending training frames; and Z stands for zero, and SEND_Z means sending 0, meaning the transmitted signal energy is 0, that is, no data is sent.
[0184] 3. If the condition ((config=master)+(config=slave)*(loc_SNR_margin=OK)*(en_slave_tx=1))*minwaittimer_done is met, the training state is entered.
[0185] "config=master" in the above condition means that the config parameter is set to the master device (master), "config=slave" in the above condition means that the config parameter is set to the slave device (slave), "loc_SNR_margin=OK" in the above condition means that the loc_SNR_margin parameter is set to good (OK), "en_slave_tx=1" in the above condition means that the en_slave_tx parameter is set to 1, and "minwait_timer_done" in the above condition means that the minwait_timer_done parameter is set to true.
[0186] The condition ((config=master)+(config=slave)*(loc_SNR_margin=OK)*(en_slave_tx=1))*minwaittimer_done is satisfied, which can be understood as: "The config parameter is set to master, and the minimum wait timer started in the silent state times out." Alternatively, "The config parameter is set to slave, the loc_SNR_margin parameter is set to OK, the en_slave_tx parameter is set to 1, and the minimum wait timer started in the silent state times out."
[0187] In this context, setting the config parameter to master indicates training the master device, while setting it to slave indicates training the slave device. loc_SNR_margin indicates whether the device hardware has sufficient signal-to-noise ratio margin (SNRmargin) to proceed to the next state and can be configured to one of two values: OK or NOT_OK. Setting loc_SNR_margin to OK indicates that the device hardware has sufficient SNR margin to proceed to the next state; setting loc_SNR_margin to NOT_OK indicates that the device hardware does not have sufficient SNR margin to proceed to the next state. en_slave_tx can be configured to one of two values: 0 or 1. Setting en_slave_tx to 0 indicates that the master device is not ready to send data to the slave device; setting en_slave_tx to 1 indicates that the master device is ready to send data to the slave device. Setting minwait_timer_done to true indicates that the minimum wait timer (minwait_timer) has expired. The minimum wait timer here refers to the minimum wait timer started in the silent state.
[0188] As shown in FIG11 , after entering the training state, the minimum wait timer (start minwait_timer) may be started, the TX_mode parameter may be set to SEND_T (ie, TX_mode=SEND_T), and the PMA_state parameter may be set to 00 (ie, PMA_state=00).
[0189] In this field, the PMA_state parameter can be configured to two values (00 or 01). When the PMA_state parameter is set to 00, it indicates the training state, and when the PMA_state parameter is set to 01, it indicates the counting state.
[0190] 4. When the conditions (loc_rcvr_status=OK)*(rem_rcvr_status=OK)*minwait_timer_done*infofield_complete are met, the countdown state is entered.
[0191] In the above condition, "loc_rcvr_status=OK" indicates that the loc_rcvr_status parameter is set to OK, "rem_rcvr_status=OK" indicates that the rem_rcvr_status parameter is set to OK, and "infofield_complete" indicates that the infofield_complete parameter is set to true. "minwait_timer_done" in the above condition has been introduced above and will not be repeated here.
[0192] The condition (loc_rcvr_status=OK)*(rem_rcvr_status=OK)*minwait_timer_done*infofield_complete can be understood as: satisfying the situation where "the loc_rcvr_status parameter is set to OK, the rem_rcvr_status parameter is set to OK, the minwait_timer_done parameter is set to true, and the infofield_complete parameter is set to true".
[0193] In this context, loc_rcvr_status is a variable set by the PMA receive function to indicate whether the local PHY's receive function is functioning properly. loc_rcvr_status can be configured to one of two values (OK or NOT_OK). Setting loc_rcvr_status to OK indicates that the local PHY's receive function is functioning reliably, while setting loc_rcvr_status to NOT_OK indicates that the local PHY's receive function is not functioning reliably. Setting infofield_complete to true indicates that the information field in the training frame was successfully transmitted.
[0194] As shown in Figure 11, after entering the count down state, set the PMA_state parameter to 01 and wait for the countdown to complete.
[0195] 5. When the condition loc_countdown_done*infofield_complete is met, enter the TX_switch state.
[0196] The "loc_countdown_done" in the above condition indicates that the loc_countdown_done parameter is set to true. The "infofield_complete" in the above condition has been explained above and will not be repeated here.
[0197] The condition loc_countdown_done*infofield_complete can be understood as: satisfying the situation where "the loc_countdown_done parameter is set to true and the infofield_complete parameter is set to true".
[0198] In this field, when the PHY control state is in the disable_transmitter state, the loc_countdown_done parameter is set to false. When the device transmits the agreed last training frame in the countdown state, the loc_countdown_done parameter is immediately set to true.
[0199] As shown in FIG11 , after entering the TX_switch state, the TX_mode parameter can be set to SEND_N (ie, TX_mode=SEND_N), and the device will subsequently send normal data frames.
[0200] It should be noted that in the TX_switch state, the master device switches the PAM modulation order of the transmitter (TX), so that subsequent devices use the switched PAM modulation order to send normal data frames. For example, if the modulation order of the training frame previously sent was PMA2, the master device can switch the modulation order to PMA4. The master device also notifies the slave device of the switched PAM modulation order, so that the slave device also switches the PMA modulation order of the transmitter.
[0201] Optionally, as shown in FIG11 , when loc_rcvr_status is set to NOT_OK, it means that the local PHY receiving function is not reliable and will re-enter the silent state.
[0202] 6. When the rem_countdown_done condition is met, enter the PCS_test state.
[0203] The above condition "rem_countdown_done" means that the rem_countdown_done parameter is set to true. Satisfying the condition rem_countdown_done can be understood as: satisfying the situation where "rem_countdown_done parameter is set to true".
[0204] In this field, when the PHY control state is in the disable_transmitter state or the silent state, the rem_countdown_done parameter is set to false. Once the device completes the switching of the PMA modulation order in the TX_switch state, the rem_countdown_done parameter is immediately set to true.
[0205] After the device enters the PCS_test state, the minimum wait timer (ie, start minwait_timer) may be started.
[0206] Optionally, as shown in FIG11 , when loc_rcvr_status is set to NOT_OK, it means that the local PHY receiving function is not reliable and will re-enter the silent state.
[0207] 7. When the condition (loc_rcvr_status=OK)*minwait_timer_done*!hi_rfer*block_lock is met, enter the PCS_data state.
[0208] The meanings of "loc_rcvr_status=OK" and "minwait_timer_done" in the above conditions have been introduced above and will not be repeated here. "!hi_rfer" in the above conditions means that the hi_rfer parameter is set to 0, and "block_lock" in the above conditions means that the block_lock parameter is set to 1.
[0209] The condition "(loc_rcvr_status=OK)*minwait_timer_done*!hi_rfer*block_lock" can be understood as: satisfying "loc_rcvr_status is set to OK, and the minwait_timer_done parameter is set to true, and the hi_rfer parameter is set to 0, and the block_lock parameter is set to 1".
[0210] In this field, hi_rfer can be used to indicate the link error status. hi_rfer can be configured to two values (0 or 1). Setting the hi_rfer parameter to 1 indicates that the link error rate is too high and exceeds the error correction capability of the link itself. Setting the hi_rfer parameter to 0 indicates that the link error rate does not exceed the error correction capability of the link itself. block_lock is used to indicate whether the code block is locked. block_lock can be configured to two values (0 or 1). Setting the block_lock parameter to 1 indicates that the code block lock is completed. Setting the block_lock parameter to 0 indicates that the code block lock is not completed.
[0211] It should be understood that block lock is related to the link bit error rate. If the link bit error rate is high and exceeds the link's error correction capability, block lock will not be achieved. Typically, if the hi_rfer parameter is set to 1, the block_lock parameter will be set to 0. If the hi_rfer parameter is set to 0, the block_lock parameter will be set to 1.
[0212] After entering the PCS_data state, the PCS_data_mode parameter is set to true (ie, PCS_data_mode=true).
[0213] Optionally, when the condition (loc_rcvr_status=NOT_OK)+(minwait_timer_done*(hi_rfer+!block_lock)) is met, the silent state will be re-entered.
[0214] "loc_rcvr_status=NOT_OK" and "minwait_timer_done" in the above conditions have been explained above and will not be repeated here. "hi_rfer" in the above conditions indicates that the hi_rfer parameter is set to 1, and "!block_lock" in the above conditions indicates that the block_lock parameter is set to 0.
[0215] The condition (loc_rcvr_status=NOT_OK)+(minwait_timer_done*(hi_rfer+!block_lock)) can be understood as: the condition "loc_rcvr_status parameter is set to NOT_OK" is satisfied. Alternatively, the condition "minwait_timer_done parameter is set to true and hi_rfer parameter is set to 1" is satisfied. Alternatively, the condition "minwait_timer_done parameter is set to true and block_lock parameter is set to 0" is satisfied.
[0216] It should be understood that the states of the master device and the slave device can both follow the state change process shown in FIG11 .
[0217] Optionally, the state changes of the first device and the second device in this application after link establishment may also be as shown in Figure 11. As an implementation method, the network startup method described in the embodiment corresponding to Figure 7 above may be executed when the first device and the second device are in the training state shown in Figure 11. Therefore, the network startup method provided in this application is compatible with existing network startup processes and is easy to implement.
[0218] It should be understood that security processing may include authentication and / or key distribution, and both authentication and / or key distribution need to be implemented through multiple interactive processes, so the above steps 701 and 702 are implemented based on multiple interactive training frames. The method provided in this application will be described below with reference to Figures 12, 19, 24, and 29.
[0219] In one example, the security processing may include authentication. The process of transmitting the training frame between the first device and the second device may be as shown in FIG12 , which may include the following steps:
[0220] Step 1201: A first device sends at least one first training frame to a second device. Correspondingly, the second device receives at least one first training frame from the first device.
[0221] At least one first training frame carries a first security message, and the first security message is used to instruct authentication based on a pre-shared key (PSK).
[0222] If the first device and the second device support PSK-based authentication, the first device and the second device can be pre-configured with the same key and authentication algorithm. The PSK-based authentication method can refer to the relevant definitions of security mechanisms in IEEE 802.1AE and IEEE 802.1X, which are described here.
[0223] Optionally, the first security message further indicates a request to input a user name.
[0224] Optionally, the implementation method of the first training frame carrying the first security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the first training frame may include a first reserved field, a second reserved field, and a third reserved field. The first security message may be carried in the first reserved field of the information field of the first training frame. The second reserved field may be used to indicate whether the first training frame is the starting frame carrying the first security message. The third reserved field may indicate the message sequence number of the first security message during the authentication process.
[0225] It should be understood that the authentication process may correspond to multiple interactive security messages, and the security messages of different interactions correspond to different message sequence numbers, which are uniformly described in this application.
[0226] For example, the reserved field of the information field of the first training frame can be as shown in Figure 9. The first reserved field of the first training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the first security message is 2 bytes, the first security message can be fully carried by one first training frame.
[0227] For example, Figure 13 is a schematic diagram of a first training frame carrying a first security message. The first reserved field can carry the first security message in its entirety. The second reserved field can have a value of 1, which indicates that the first training frame is the starting frame for carrying the first security message. It should be understood that since the first security message is completely carried in the first training frame, the training frame is naturally the starting frame for carrying the first security message. The third reserved field can have a value of 0x0001, which indicates that the first security message has a message sequence number of 1 during the authentication process.
[0228] Step 1202: The second device sends at least one second training frame to the first device. Correspondingly, the first device receives at least one second training frame from the second device.
[0229] The at least one second training frame carries a second security message, and the second security message includes a first random number and a first identifier ID, wherein the first random number is generated by the second device, and the first ID is the ID of the second device.
[0230] Optionally, the implementation method of the second training frame carrying the second security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the second training frame may include a first reserved field, a second reserved field, and a third reserved field. The second security message may be carried in the first reserved field of the information field of the second training frame. The second reserved field may be used to indicate whether the second training frame is the starting frame carrying the second security message. The third reserved field may indicate the message sequence number of the second security message during the authentication process.
[0231] For example, the reserved fields of the information field of the second training frame can be as shown in Figure 9, where the first reserved field is 16 bits (2 bytes), the second reserved field is 1 bit, and the third reserved field is 4 bits. Assuming that the first random number is 16 bytes long and the first ID is 16 bytes long, the total length of the second security message is 32 bytes, and the second security message needs to be fully carried by 16 second training frames.
[0232] For example, Figure 14 is a schematic diagram of 16 second training frames carrying one second security message. Among them, the first reserved field in each second training frame can carry part of the content of the second security message respectively, the first random number (represented by R1 in Figure 14) requires 8 training frames to carry, and the first ID (represented by ID1 in Figure 14) requires 8 training frames to carry. The value of the second reserved field of the first second training frame in the 16 second training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the second security message. The value of the second reserved field of the other training frames except the first second training frame in the 16 second training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the second security message. The value of the third reserved field of the 16 second training frames can all be 0x0010, which is used to indicate that the message sequence number of the second security messages carried by these training frames in the authentication process is 2.
[0233] It should be understood that the first security message can be used to request a username, and thus the first ID in the second security message can be considered the username that the second device responds to the first device. In addition, the first random number and first ID in the second security message can be used to generate authentication data for the second device to authenticate the first device.
[0234] Step 1203: The first device sends at least one third training frame to the second device. Correspondingly, the second device receives the at least one third training frame from the first device.
[0235] At least one third training frame carries a third security message, and the third security message includes a first random number, a second random number, a second ID, a first count value, and first authentication data. The second random number and the first count value are generated by the first device, and the second ID is the ID of the first device. The first authentication data is obtained by the first device by calculating the first random number, the second random number, the first ID, the second ID, and the first count value based on a preconfigured algorithm and a key. The first authentication data is used by the second device to authenticate the first device.
[0236] The first random number, the second random number, the second ID, and the first count value in the third security message can be used by the second device to verify the first authentication data, and can be used to generate authentication data for the first device to authenticate the second device.
[0237] Optionally, after receiving the third security message, the second device may also perform an operation on the first random number, the second random number, the first ID, the second ID, and the first count value according to a preconfigured algorithm and key. If the operation result obtained by the second device is the same as the first authentication data, then the second device successfully authenticates the first device. It should be understood that if the first and second devices are preconfigured with the same algorithm and key, and if the third security message is not transmitted incorrectly or illegally tampered with, the operation result obtained by the second device using the same method should be the same as the first authentication data.
[0238] Optionally, the algorithm used to generate the first authentication data may be an Advanced Encryption Standard (AES) algorithm, such as an AES-CMAC algorithm. As an example, the value of the first authentication data may be expressed using the algorithm formula AES-CMAC(key, ID1||ID2||R1||R2||counter1), where key refers to a preconfigured key of the first device and the second device, ID1 refers to a first ID, ID2 refers to a second ID, R1 refers to a first random number, R2 refers to a second random number, counter1 refers to a first count value, and "||" is a connector. "ID1||ID2||R1||R2||counter1" indicates that the characters ID1, ID2, R1, R2, and counter1 are connected in sequence. For example, when the first authentication data is AES-CMAC(key, ID1||ID2||R1||R2||counter1) generated by the first device, the second device can also calculate AES-CMAC(key, ID1||ID2||R1||R2||counter1). If the value calculated by the second device is the same as the first authentication data, the second device successfully authenticates the first device.
[0239] Optionally, the implementation method of the third training frame carrying the third security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the third training frame may include a first reserved field, a second reserved field, and a third reserved field. The third security message may be carried in the first reserved field of the information field of the third training frame. The second reserved field may be used to indicate whether the third training frame is the starting frame for carrying the third security message. The third reserved field may indicate the message sequence number of the third security message during the authentication process.
[0240] For example, the reserved fields of the information field of the third training frame can be as shown in FIG9 , where the first reserved field length is 16 bits (2 bytes), the second reserved field length is 1 bit, and the third reserved field length is 4 bits. Assuming that the total length of the third safety message is 66 bytes, the third safety message needs to be fully carried by 33 third training frames.
[0241] For example, Figure 15 is a schematic diagram of 33 third training frames carrying one third security message. The first reserved field in each third training frame can carry part of the content of the third security message. The value of the second reserved field of the first third training frame among the 33 third training frames can be 1, indicating that the training frame is the starting frame carrying the third security message. The value of the second reserved field of the other training frames except the first third training frame among the 33 third training frames is 0, indicating that these training frames are not the starting frames carrying the third security message. The value of the third reserved field of the 33 third training frames can all be 0x0011, indicating that the message sequence number of the third security message carried by these training frames in the authentication process is 3. The first random number is represented by R1 in Figure 15, the second random number is represented by R2 in Figure 15, the second ID is represented by ID2 in Figure 15, and the first count value is represented by counter1 in Figure 15, which are explained here.
[0242] After the second device receives the third security message and successfully authenticates the first device, step 1204 may be continued. If the second device receives the third security message but fails to authenticate the first device, the authentication process may be repeated starting from step 1201.
[0243] Step 1204: The second device sends at least one fourth training frame to the first device. Correspondingly, the first device receives at least one fourth training frame from the second device.
[0244] At least one fourth training frame may carry a fourth security message, which includes a second random number, a first count value, and second authentication data. The second authentication data is obtained by the second device performing a calculation on the second random number, the second ID, and the first count value based on a preconfigured algorithm and key. The second authentication data is used by the first device to authenticate the second device. The second random number and first count value in the fourth security message may be used by the first device to verify the second authentication data.
[0245] Optionally, after receiving the fourth security message, the first device may also perform an operation on the second random number, the second ID, and the first count value according to a preconfigured algorithm and key. If the operation result obtained by the first device is the same as the second authentication data, then the first device successfully authenticates the second device. It should be understood that if the first and second devices are preconfigured with the same algorithm and key, and if the fourth security message is not transmitted incorrectly or illegally tampered with, the operation result obtained by the first device using the same method should be the same as the second authentication data.
[0246] Optionally, the algorithm used to generate the second authentication data may be an AES algorithm, such as an AES-CMAC algorithm. As an example, the value of the second authentication data may be expressed as AES-CMAC(key, ID2||R1||counter1) using the algorithm formula, wherein key refers to the pre-configured key of the first device and the second device, ID2 refers to the second ID, R1 refers to the first random number, counter1 refers to the first count value, "||" is a connector, and "ID2||R1||counter1" means that the characters ID2, R1, and counter1 are connected in sequence. For example, in the case where the second authentication data is AES-CMAC(key, ID2||R1||counter1) generated by the second device, the first device may also calculate AES-CMAC(key, ID2||R1||counter1). If the value calculated by the first device is the same as the second authentication data, then the first device successfully authenticates the second device.
[0247] Optionally, the implementation method of the fourth training frame carrying the fourth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the fourth training frame may include a first reserved field, a second reserved field, and a third reserved field. The fourth security message may be carried in the first reserved field of the information field of the fourth training frame. The second reserved field may be used to indicate whether the fourth training frame is the starting frame carrying the fourth security message. The third reserved field may indicate the message sequence number of the fourth security message during the authentication process.
[0248] For example, the reserved fields of the information field of the fourth training frame can be as shown in FIG9 , where the first reserved field length is 16 bits (2 bytes), the second reserved field length is 1 bit, and the third reserved field length is 4 bits. Assuming that the total length of the fourth security message is 34 bytes, the fourth security message needs to be fully carried by 17 fourth training frames.
[0249] For example, Figure 16 is a schematic diagram of 17 fourth training frames carrying 1 fourth security message. Among them, the first reserved field in each fourth training frame can carry part of the content of the fourth security message. The value of the second reserved field of the first fourth training frame in the 17 fourth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the fourth security message. The value of the second reserved field of the other training frames except the first fourth training frame in the 17 fourth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the fourth security message. The value of the third reserved field of the 17 fourth training frames can all be 0x0100, which is used to indicate that the message sequence number of the fourth security messages carried by these training frames in the authentication process is 4. The second random number is represented by R2 in Figure 16, and the first count value is represented by counter1 in Figure 16, which is explained here.
[0250] It should be understood that when the first device successfully authenticates the second device, and the second device successfully authenticates the first device, the first device and the second device have completed mutual authentication.
[0251] Optionally, the process of transmitting training frames between the first device and the second device shown in FIG12 may further include: step 1205: the first device sends at least one tenth training frame to the second device, and the second device receives the at least one tenth training frame from the first device. The at least one tenth training frame carries a tenth security message, and the tenth security message is used to indicate successful authentication.
[0252] Optionally, the implementation method of the tenth training frame carrying the tenth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the tenth training frame may include a first reserved field, a second reserved field, and a third reserved field. The tenth security message may be carried in the first reserved field of the information field of the tenth training frame. The second reserved field may be used to indicate whether the tenth training frame is the starting frame carrying the tenth security message. The third reserved field may indicate the message sequence number of the tenth security message during the authentication process.
[0253] For example, the reserved fields of the information field of the tenth training frame may be as shown in FIG9 , where the first reserved field of the tenth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming the length of the tenth security message is 2 bytes, the tenth security message can be completely carried by one tenth training frame.
[0254] For example, Figure 17 is a schematic diagram of a tenth training frame carrying a tenth security message. The first reserved field can carry the tenth security message in its entirety. The second reserved field can have a value of 1, indicating that the tenth training frame is the starting frame for carrying the tenth security message. It should be understood that since the tenth security message is completely carried in the tenth training frame, the training frame is naturally the starting frame for carrying the tenth security message. The third reserved field can have a value of 0x0101, indicating that the tenth security message is numbered 5 during the authentication process.
[0255] Optionally, the process of transmitting training frames between the first device and the second device shown in FIG12 may further include: step 1206: the second device sends at least one eleventh training frame to the first device, and the first device receives the at least one eleventh training frame from the second device. The at least one eleventh training frame carries an eleventh security message, which is used to request startup authentication. Step 1206 is performed before step 1201.
[0256] Optionally, the implementation method of the eleventh training frame carrying the eleventh security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the eleventh training frame may include a first reserved field, a second reserved field, and a third reserved field. The eleventh security message may be carried in the first reserved field of the information field of the eleventh training frame. The second reserved field may be used to indicate whether the eleventh training frame is the starting frame carrying the eleventh security message. The third reserved field may indicate the message sequence number of the eleventh security message during the authentication process.
[0257] For example, the reserved fields of the information field of the eleventh training frame may be as shown in FIG9 , where the first reserved field of the eleventh training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the eleventh safety message is 2 bytes, the eleventh safety message can be completely carried by one eleventh training frame.
[0258] For example, Figure 18 is a schematic diagram of an eleventh training frame carrying an eleventh security message. The first reserved field can completely carry the eleventh security message. The second reserved field can have a value of 1, which can be used to indicate that the eleventh training frame is the starting frame for carrying the eleventh security message. It should be understood that since the eleventh security message is completely carried in the eleventh training frame, the training frame is naturally the starting frame for carrying the eleventh security message. The third reserved field can have a value of 0x0000, which can be used to indicate that the message sequence number of the eleventh security message during the authentication process is 0.
[0259] In another example, the security processing may include authentication, and the process of transmitting the training frame between the first device and the second device may also be as shown in FIG. 19 , which may include the following steps:
[0260] Step 1901: The first device sends at least one fifth training frame to the second device. Correspondingly, the second device receives at least one fifth training frame from the first device.
[0261] At least one fifth training frame carries a fifth security message, which is used to indicate password-based authentication. A password can also be called a password. Compared with key-based authentication, password-based authentication is less complex and the authentication process is faster. If the first device and the second device support password-based authentication, the first device and the second device can be pre-configured with the same password and authentication algorithm.
[0262] Optionally, the implementation method of the fifth training frame carrying the fifth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the fifth training frame may include a first reserved field, a second reserved field, and a third reserved field. The fifth security message may be carried in the first reserved field of the information field of the fifth training frame. The second reserved field may be used to indicate whether the fifth training frame is the starting frame carrying the fifth security message. The third reserved field may indicate the message sequence number of the fifth security message during the authentication process.
[0263] For example, the reserved fields of the information field of the fifth training frame may be as shown in FIG9 , where the first reserved field of the fifth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming the length of the fifth security message is 2 bytes, the fifth security message can be completely carried by one fifth training frame.
[0264] For example, Figure 20 is a schematic diagram of a fifth training frame carrying a fifth security message. The first reserved field can carry the fifth security message in its entirety. The second reserved field can have a value of 1, which can be used to indicate that the fifth training frame is the starting frame for carrying the fifth security message. It should be understood that since the fifth security message is completely carried in a fifth training frame, the training frame is naturally the starting frame for carrying the fifth security message. The third reserved field can have a value of 0x0001, which can be used to indicate that the fifth security message has a message sequence number of 1 during the authentication process.
[0265] Step 1902: The second device sends at least one sixth training frame to the first device. Correspondingly, the first device receives at least one sixth training frame from the second device.
[0266] At least one sixth training frame carries a sixth security message, and the sixth security message includes a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the second device, and the first ID is the ID of the second device. The third authentication data is obtained by the second device by calculating the third random number, the first ID, and the second count value according to a preconfigured algorithm and a password, and is used by the first device to authenticate the second device.
[0267] The third random number, the first ID, and the second count value in the sixth security message can be used by the first device to verify the third authentication data.
[0268] Optionally, after receiving the sixth security message, the first device may perform an operation on the third random number, the first ID, and the second count value according to a preconfigured algorithm and password. If the result of the operation performed by the first device is identical to the third authentication data, the first device successfully authenticates the second device. It should be understood that if the first and second devices are preconfigured with the same algorithm and password, and if the sixth security message is not transmitted incorrectly or illegally tampered with, the result of the operation performed by the first device using the same method should be identical to the third authentication data.
[0269] Optionally, the algorithm used to generate the third authentication data may be a hash algorithm, such as the SHA256 algorithm. As an example, the value of the third authentication data may be expressed using the algorithm formula SHA256(password, ID1||R3||Counter2), where password refers to the password pre-configured by the first device and the second device, ID1 refers to the first ID, R3 refers to the third random number, counter2 refers to the second counter value, "||" is a connector, and "ID1||R3||Counter2" means that the characters ID1, R3, and counter2 are connected in sequence. For example, in the case where the third authentication data is SHA256(password, ID1||R3||Counter2) generated by the second device, the first device may also calculate SHA256(password, ID1||R3||Counter2). If the value calculated by the first device is the same as the third authentication data, then the first device successfully authenticates the second device.
[0270] Optionally, the implementation method of the sixth training frame carrying the sixth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the sixth training frame may include a first reserved field, a second reserved field, and a third reserved field. The sixth security message may be carried in the first reserved field of the information field of the sixth training frame. The second reserved field may be used to indicate whether the sixth training frame is the starting frame for carrying the sixth security message. The third reserved field may indicate the message sequence number of the sixth security message during the authentication process.
[0271] For example, the reserved fields of the information field of the sixth training frame can be as shown in FIG9 , where the first reserved field length is 16 bits (2 bytes), the second reserved field length is 1 bit, and the third reserved field length is 4 bits. Assuming that the total length of the sixth safety message is 66 bytes, the sixth safety message needs to be fully carried by 33 sixth training frames.
[0272] For example, Figure 21 is a schematic diagram of 33 sixth training frames carrying one sixth security message. Among them, the first reserved field in each sixth training frame can carry part of the content of the sixth security message. The value of the second reserved field of the first sixth training frame among the 33 sixth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the sixth security message. The value of the second reserved field of the other training frames except the first sixth training frame among the 33 sixth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the sixth security message. The value of the third reserved field of the 33 sixth training frames can all be 0x0010, which is used to indicate that the message sequence number of the sixth security message carried by these training frames in the authentication process is 2. The third random number is represented by R3 in Figure 21, the first ID is represented by ID1 in Figure 21, and the second count value is represented by counter2 in Figure 21, which are explained here.
[0273] After the first device receives the sixth security message and successfully authenticates the second device, step 1903 may be continued. If the first device receives the sixth security message but fails to authenticate the second device, the authentication process may be repeated starting from step 1901.
[0274] Step 1903: The first device sends at least one seventh training frame to the second device. Correspondingly, the second device receives at least one seventh training frame from the first device.
[0275] At least one seventh training frame carries a seventh security message, which includes a third random number, a fourth random number, a second ID, a second count value, and fourth authentication data. The fourth random number is generated by the first device, and the second ID is the ID of the first device. The fourth authentication data is obtained by the first device by calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value based on a preconfigured algorithm and a password. The fourth authentication data is used by the second device to authenticate the first device. The third random number, the fourth random number, the second ID, and the second count value in the seventh security message can be used by the second device to verify the fourth authentication data.
[0276] Optionally, after receiving the seventh security message, the second device may perform an operation on the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. If the result of the operation performed by the second device is the same as the fourth authentication data, the second device successfully authenticates the first device. It should be understood that if the first and second devices are preconfigured with the same algorithm and password, and if the seventh security message is not transmitted incorrectly or illegally tampered with, the result of the operation performed by the second device using the same method should be the same as the fourth authentication data.
[0277] Optionally, the algorithm used to generate the fourth authentication data may be a hash algorithm, such as the SHA256 algorithm. As an example, the value of the fourth authentication data may be expressed using the algorithm formula SHA256(password, ID1||ID2||R3||R4||Counter2), where password refers to the preconfigured password of the first device and the second device, ID1 refers to the first ID, ID2 refers to the second ID, R3 refers to the third random number, R4 refers to the fourth random number, counter2 refers to the second count value, and "||" is a connector. "ID1||ID2||R3||R4||Counter2" means that the characters ID1, ID2, R3, R4, and counter2 are connected in sequence. For example, when the fourth authentication data is SHA256(password, ID1||ID2||R3||R4||Counter2) generated by the first device, the second device can also calculate SHA256(password, ID1||ID2||R3||R4||Counter2). If the value calculated by the first device is the same as the fourth authentication data, the second device successfully authenticates the first device.
[0278] Optionally, the implementation method of the seventh training frame carrying the seventh security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the seventh training frame may include a first reserved field, a second reserved field, and a third reserved field. The seventh security message may be carried in the first reserved field of the information field of the seventh training frame. The second reserved field may be used to indicate whether the seventh training frame is the starting frame carrying the seventh security message. The third reserved field may indicate the message sequence number of the seventh security message during the authentication process.
[0279] For example, the reserved fields of the information field of the seventh training frame can be as shown in FIG9 , where the first reserved field length is 16 bits (2 bytes), the second reserved field length is 1 bit, and the third reserved field length is 4 bits. Assuming that the total length of the seventh security message is 82 bytes, the seventh security message needs to be fully carried by 41 seventh training frames.
[0280] For example, Figure 22 is a schematic diagram of 41 seventh training frames carrying one seventh security message. The first reserved field in each seventh training frame can carry part of the content of the seventh security message. The value of the second reserved field of the first seventh training frame among the 41 seventh training frames can be 1, indicating that the training frame is the starting frame carrying the seventh security message. The value of the second reserved field of the other training frames except the first seventh training frame among the 41 seventh training frames can be 0, indicating that these training frames are not the starting frames carrying the seventh security message. The value of the third reserved field of the 41 seventh training frames can all be 0x0011, indicating that the message sequence number of the seventh security message carried by these training frames in the authentication process is 3. The third random number is represented by R3 in Figure 22, the fourth random number is represented by R4 in Figure 22, the second ID is represented by ID2 in Figure 22, and the second count value is represented by counter2 in Figure 22, which are explained here.
[0281] It should be understood that when the first device successfully authenticates the second device, and the second device successfully authenticates the first device, the first device and the second device have completed mutual authentication.
[0282] Optionally, the process of transmitting training frames between the first device and the second device shown in FIG19 may further include: step 1904: the second device sends at least one twelfth training frame to the first device, and the first device receives the at least one twelfth training frame from the second device. The at least one twelfth training frame carries a twelfth security message, and the twelfth security message is used to indicate successful authentication.
[0283] Optionally, the implementation method of the twelfth training frame carrying the twelfth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the twelfth training frame may include a first reserved field, a second reserved field, and a third reserved field. The twelfth security message may be carried in the first reserved field of the information field of the twelfth training frame, the second reserved field may be used to indicate whether the twelfth training frame is the starting frame carrying the twelfth security message, and the third reserved field may indicate the message sequence number of the twelfth security message during the authentication process.
[0284] For example, the reserved fields of the information field of the twelfth training frame may be as shown in FIG9 , where the first reserved field of the twelfth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the twelfth security message is 2 bytes, the twelfth security message can be completely carried by one twelfth training frame.
[0285] For example, Figure 23 is a schematic diagram of a twelfth training frame carrying a twelfth security message. The first reserved field can carry the entire twelfth security message. The value of the second reserved field can be 1, which can be used to indicate that the twelfth training frame is the starting frame carrying the twelfth security message. It should be understood that since the entire twelfth security message is carried in the twelfth training frame, the training frame is naturally the starting frame carrying the twelfth security message. The value of the third reserved field can be 0x0100, which can be used to indicate that the message sequence number of the twelfth security message during the authentication process is 4.
[0286] Figures 12 and 19 above illustrate two different ways of implementing authentication. The first device and the second device can select the authentication method to use based on their needs, which is described here. In addition, the authentication methods shown in Figures 12 and 19 above are merely exemplary, and the processes of other authentication methods can also be implemented through the transmission of training frames, which is not limited by this application.
[0287] Optionally, in the embodiments corresponding to FIG. 12 and FIG. 19 , the first device may serve as a master device for authentication, and the second device may serve as a slave device for authentication.
[0288] The above description uses security processing including authentication as an example. The following describes the method provided by this application using security processing including key distribution as an example in conjunction with Figure 24. As shown in Figure 24, the process of transmitting a training frame between the first device and the second device may include the following steps:
[0289] Step 2401: The second device sends at least one eighth training frame to the first device. Correspondingly, the first device receives at least one eighth training frame from the second device.
[0290] At least one eighth training frame carries an eighth security message, and the eighth security message includes a start marker, a first ID, and a first security capability parameter. The start marker is used to indicate the start of key distribution, the first ID is the ID of the second device, and the first security capability parameter is the security capability parameter of the second device.
[0291] The first ID in the eighth security message can be used to indicate that the eighth security message comes from the second device, and the first security capability parameter in the eighth security message can be used by the first device to determine the security capability parameter used for encrypted communication.
[0292] Optionally, the eighth security message may further include a first message number (message number) and a first integrity check value (ICV), the first message number being used to prevent replay attacks on the eighth security message, and the first ICV being used to perform integrity protection on the eighth security message. As a possible implementation, the first ICV may be a value obtained by the second device by calculating the start tag, the first ID, the first message number, and the first security capability parameter according to a preconfigured integrity protection algorithm and key.
[0293] Optionally, after the first device receives the eighth security message, it may verify the integrity of the eighth security message based on the first ICV. For example, the first device may also perform an operation on the start tag, the first ID, the first message number, and the first security capability parameter based on a preconfigured integrity protection algorithm and key. If the operation result of the first device is the same as the first ICV, the eighth security message passes the integrity check.
[0294] Optionally, the implementation method of the eighth training frame carrying the eighth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the eighth training frame may include a first reserved field, a second reserved field, and a third reserved field. The eighth security message may be carried in the first reserved field of the information field of the eighth training frame. The second reserved field may be used to indicate whether the eighth training frame is the starting frame carrying the eighth security message. The third reserved field may indicate the message sequence number of the eighth security message during the authentication process.
[0295] For example, the reserved field of the information field of the eighth training frame can be as shown in FIG9 , where the first reserved field of the eighth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the eighth security message is 40 bytes, the eighth security message needs to be fully carried by 20 eighth training frames.
[0296] For example, Figure 25 is a schematic diagram of 20 eighth training frames carrying one eighth security message. Among them, the first reserved field in each eighth training frame can carry part of the content of the eighth security message. The value of the second reserved field of the first eighth training frame in the 20 eighth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the eighth security message. The value of the second reserved field of the other training frames except the first eighth training frame in the 20 eighth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the eighth security message. The value of the third reserved field in the 20 eighth training frames can all be 0x0001, which can be used to indicate that the message sequence number of the eighth security message in the authentication process is 1. In Figure 25, init represents the start mark, ID1 represents the first ID, MN1 represents the first message number, capability1 represents the first security capability parameter, and ICV1 represents the first ICV, which are uniformly explained here.
[0297] Step 2402: The first device sends at least one ninth training frame to the second device. Correspondingly, the second device receives at least one ninth training frame from the first device.
[0298] At least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter, and a security association key (SAK). The second ID is an ID of the first device, the second security capability parameter is a security capability parameter determined by the first device for encrypted communication between the first device and the second device, and the SAK is a key determined by the first device for encrypted communication between the first device and the second device.
[0299] Optionally, the second security parameter may be determined by the first device based on the first security capability parameter and a third security capability parameter, where the third security capability parameter is the security capability parameter of the first device. In other words, the first device may determine the security capability parameter for encrypted communication between the first device and the second device based on the security capability parameter of the first device and the security capability parameter of the second device.
[0300] After the first device allocates the second security capability parameter and the SAK for encrypted communication to the second device, the first device and the second device may subsequently implement encrypted communication based on the second security capability parameter and the SAK.
[0301] Optionally, the ninth security message may further include a first message number, a second message number, and a second ICV. The second message number is used to protect the ninth security message from replay attacks, the first message number may be used to indicate that the ninth security message is a response message to the eighth security message, and the second ICV may be used to protect the data integrity of the ninth security message. As a possible implementation, the second ICV may be a value obtained by the first device performing an operation on the second ID, the first message number, the second message number, and the second security capability parameter based on a preconfigured integrity protection algorithm and key.
[0302] Optionally, after the second device receives the ninth security message, it may verify the integrity of the ninth security message based on the second ICV. For example, the second device may also perform an operation on the second ID, the first message number, the second message number, and the second security capability parameter based on a preconfigured integrity protection algorithm and key. If the operation result of the second device is the same as the second ICV, the ninth security message passes the integrity check.
[0303] Optionally, the ninth security message may carry an encrypted SAK. After receiving the ninth security message, the second device may obtain the SAK by decryption. The algorithm and key used to encrypt and decrypt the SAK may also be a preconfigured integrity protection algorithm and key.
[0304] Optionally, the implementation method of the ninth training frame carrying the ninth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the ninth training frame may include a first reserved field, a second reserved field, and a third reserved field. The ninth security message may be carried in the first reserved field of the information field of the ninth training frame. The second reserved field may be used to indicate whether the ninth training frame is the starting frame carrying the ninth security message. The third reserved field may indicate the message sequence number of the ninth security message during the authentication process.
[0305] For example, the reserved fields of the information field of the ninth training frame may be as shown in FIG9 , where the first reserved field of the ninth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the ninth security message is 74 bytes, the ninth security message needs to be fully carried by 37 ninth training frames.
[0306] For example, Figure 26 is a schematic diagram of 37 ninth training frames carrying one ninth security message. Among them, the first reserved field in each ninth training frame can carry part of the content of the ninth security message. The value of the second reserved field of the first ninth training frame in the 37 ninth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the ninth security message. The value of the second reserved field of the other training frames except the first ninth training frame in the 37 ninth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the ninth security message. The value of the third reserved field in the 37 ninth training frames can all be 0x0010, which can be used to indicate that the message sequence number of the ninth security message in the authentication process is 2. In Figure 26, ID2 represents the second ID, MN1 represents the first message number, MN2 represents the second message number, capability2 represents the second security capability parameter, and ICV2 represents the second ICV, which are uniformly explained here.
[0307] Alternatively, the SAK can be a key derived by the first device using a key derivation function (KDF) based on the Connectivity Association Key (CAK). The CAK is the root key in the Connectivity Association (CA), and all keys used by the CA can be derived from the CAK.
[0308] It should be understood that the key distribution process implemented in the embodiment corresponding to Figure 24 can be implemented according to the key distribution rules defined in the MACsec standard. The above-mentioned SAK, CAK, CA, etc. can be explained in the MACsec standard, and this application will not go into details here.
[0309] Through the above steps 2401 and 2402, key distribution for encrypted communication between the first device and the second device can be achieved.
[0310] Optionally, the process of transmitting training frames between the first device and the second device shown in FIG24 may further include: Step 2403: the second device sends at least one thirteenth training frame to the first device, and the first device receives the at least one thirteenth training frame from the second device. The at least one thirteenth training frame carries a thirteenth security message, and the thirteenth security message is used to indicate that the second device has successfully acquired the SAK.
[0311] Optionally, the thirteenth security message may include a first ID, a second message number, a third message number, and a third ICV. The first ID may be used to indicate that the thirteenth security message comes from the second device, the second message number may be used to indicate that the thirteenth security message is a response message to the ninth security message, the third message number may be used to prevent the thirteenth security message from being attacked by replay, and the third ICV is used to perform integrity protection on the thirteenth security message. As a possible implementation, the third ICV may be a value obtained by the second device performing an operation on the first ID, the second message number, and the third message number based on a preconfigured integrity protection algorithm and key. As a possible implementation, the third message number is equal to the first message number plus 1.
[0312] Optionally, the implementation method of the thirteenth training frame carrying the thirteenth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the thirteenth training frame may include a first reserved field, a second reserved field, and a third reserved field. The thirteenth security message may be carried in the first reserved field of the information field of the thirteenth training frame. The second reserved field may be used to indicate whether the thirteenth training frame is the starting frame carrying the thirteenth security message. The third reserved field may indicate the message sequence number of the thirteenth security message during the authentication process.
[0313] For example, the reserved fields of the information field of the thirteenth training frame may be as shown in FIG9 , where the first reserved field of the thirteenth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming the length of the thirteenth safety message is 40 bytes, the thirteenth safety message needs to be fully carried by 20 thirteenth training frames.
[0314] For example, Figure 27 is a schematic diagram of 20 thirteenth training frames carrying one thirteenth security message. Among them, the first reserved field in each thirteenth training frame can carry part of the content of the thirteenth security message. The value of the second reserved field of the first thirteenth training frame in the 20 thirteenth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the thirteenth security message. The value of the second reserved field of the other training frames except the first thirteenth training frame in the 20 thirteenth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the thirteenth security message. The value of the third reserved field in the 20 thirteenth training frames can all be 0x0011, which can be used to indicate that the message sequence number of the thirteenth security message in the authentication process is 3. In Figure 27, ID1 represents the first ID, MN2 represents the second message number, MN3 represents the third message number (MN3=MN1+1), and ICV3 represents the third ICV, which are uniformly explained here.
[0315] Optionally, the process of transmitting training frames between the first device and the second device shown in FIG24 may further include: Step 2404: the first device sends at least one fourteenth training frame to the second device, and the second device receives the at least one fourteenth training frame from the first device. The at least one fourteenth training frame carries a fourteenth security message, and the fourteenth security message is used to indicate that the second device has successfully acquired the SAK.
[0316] Optionally, the fourteenth security message may include a second ID, a third message number, a fourth message number, and a fourth ICV. The second ID may be used to indicate that the fourteenth security message comes from the first device, the third message number may be used to indicate that the fourteenth security message is a response message to the thirteenth security message, the fourth message number may be used to prevent the fourteenth security message from being attacked by replay, and the fourth ICV is used to perform integrity protection on the fourteenth security message. As a possible implementation, the fourth ICV may be a value obtained by the first device performing an operation on the second ID, the third message number, and the fourth message number based on a preconfigured integrity protection algorithm and key. As a possible implementation, the fourth message number is equal to the second message number plus 1.
[0317] Optionally, the implementation method of the fourteenth training frame carrying the fourteenth security message can refer to the description of the implementation method of the training frame carrying the security message in step 701 above, and will not be repeated here. For example, the fourteenth training frame may include a first reserved field, a second reserved field, and a third reserved field. The fourteenth security message may be carried in the first reserved field of the information field of the fourteenth training frame. The second reserved field may be used to indicate whether the fourteenth training frame is the starting frame carrying the fourteenth security message. The third reserved field may indicate the message sequence number of the fourteenth security message during the authentication process.
[0318] For example, the reserved fields of the information field of the fourteenth training frame may be as shown in FIG9 , where the first reserved field of the fourteenth training frame is 16 bits (2 bytes) long, the second reserved field is 1 bit long, and the third reserved field is 4 bits long. Assuming that the length of the fourteenth security message is 40 bytes, the fourteenth security message needs to be fully carried by 20 fourteenth training frames.
[0319] For example, Figure 28 is a schematic diagram of 20 fourteenth training frames carrying one fourteenth security message. Among them, the first reserved field in each fourteenth training frame can carry part of the content of the fourteenth security message. The value of the second reserved field of the first fourteenth training frame in the 20 fourteenth training frames can be 1, which is used to indicate that the training frame is the starting frame carrying the fourteenth security message. The value of the second reserved field of the other training frames except the first fourteenth training frame in the 20 fourteenth training frames is 0, which is used to indicate that these training frames are not the starting frames carrying the fourteenth security message. The value of the third reserved field in the 20 fourteenth training frames can all be 0x0100, which can be used to indicate that the message sequence number of the fourteenth security message in the authentication process is 4. In Figure 28, ID2 represents the second ID, MN3 represents the third message number (MN3=MN1+1), MN4 represents the fourth message number (MN4=MN2+1), and ICV4 represents the fourth ICV, which are uniformly explained here.
[0320] The embodiment of Figure 24 above shows a solution for achieving key distribution by transmitting training frames, but this solution is only exemplary. The key distribution process can also be implemented in an existing manner, such as distributing keys through Ethernet frames after link training. This application does not impose any restrictions on this.
[0321] Optionally, in the embodiment corresponding to FIG24 , the first device may serve as a master device for key distribution, and the second device may serve as a slave device for key distribution.
[0322] In an embodiment of the present application, the first device and the second device may only perform authentication without performing key distribution. Alternatively, the first device and the second device may only perform key distribution without prior authentication. Alternatively, the first device and the second device may perform both authentication and key distribution.
[0323] It should be understood that if the authentication of the first device and the second device adopts the implementation shown in Figure 12, then the authentication process is performed in parallel with the link training process, saving the authentication process time. If the key distribution between the first device and the second device can adopt the implementation shown in Figure 24, then the key distribution process is performed in parallel with the link training process, saving the key distribution process time.
[0324] As a possible implementation, when the first device and the second device perform authentication and key distribution, both authentication and key distribution can be implemented during the link training process. For example, the authentication method can adopt the implementation method shown in Figure 12, and the key distribution can adopt the implementation method shown in Figure 24. In this case, the process of transmitting training frames between the first device and the second device can also be shown in Figure 29, which may include the following steps:
[0325] Step 2901: The second device sends an eleventh training frame to the first device. Correspondingly, the first device receives the eleventh training frame from the second device. At least one eleventh training frame carries the eleventh security message. This step can be referred to as described in step 1206 and will not be repeated here.
[0326] Step 2902: The first device sends at least one first training frame to the second device. In response, the second device receives at least one first training frame from the first device. The at least one first training frame carries a first security message. This step is similar to the description of step 1201 and is not repeated here.
[0327] Step 2903: The second device sends at least one second training frame to the first device. Correspondingly, the first device receives at least one second training frame from the second device. The at least one second training frame carries the second security message. This step is similar to the description of step 1202 and is not repeated here.
[0328] Step 2904: The first device sends at least one third training frame to the second device. In response, the second device receives at least one third training frame from the first device. The at least one third training frame carries a third security message. This step is similar to the description of step 1203 and is not repeated here.
[0329] Step 2905: The second device sends at least one fourth training frame to the first device. In response, the first device receives at least one fourth training frame from the second device. The at least one fourth training frame carries a fourth security message. This step is similar to the description of step 1204 and is not repeated here.
[0330] Step 2906: The first device sends at least one tenth training frame to the second device. Correspondingly, the second device receives at least one tenth training frame from the first device. The at least one tenth training frame carries the tenth security message. This step can be referred to as described in step 1205 and will not be repeated here.
[0331] Step 2907: The second device sends at least one eighth training frame to the first device. Correspondingly, the first device receives at least one eighth training frame from the second device. The at least one eighth training frame carries the eighth security message. This step is similar to the description of step 2401 and is not repeated here.
[0332] Step 2908: The first device sends at least one ninth training frame to the second device. In response, the second device receives at least one ninth training frame from the first device. The at least one ninth training frame carries the ninth security message. This step is described in the same manner as step 2402 and is not repeated here.
[0333] Step 2909: The second device sends at least one thirteenth training frame to the first device. Correspondingly, the first device receives at least one thirteenth training frame from the second device. The at least one thirteenth training frame carries the thirteenth security message. This step can be referred to as described in step 2403 and will not be repeated here.
[0334] Step 2910: The first device sends at least one fourteenth training frame to the second device. In response, the second device receives at least one fourteenth training frame from the first device. The at least one fourteenth training frame carries the fourteenth security message. This step can be referred to in the description of step 2404 and will not be repeated here.
[0335] It should be noted that, when the first device and the second device perform PSK-based authentication and key distribution, the first device and the second device may pre-configure a key Key for authentication and a root key CAK for key distribution.
[0336] As another possible implementation method, when the first device and the second device perform authentication and key distribution, authentication can be implemented during the link training process (for example, the authentication method can adopt the implementation method shown in Figure 12), and key distribution can be implemented using existing communication methods. This application does not impose any restrictions on this.
[0337] In the above method embodiment, the action of the first device can be performed by the processor 601 in the communication device 60 shown in Figure 6 calling the application code stored in the memory 604 to instruct the first device to execute, and the action of the second device can be performed by the processor 601 in the communication device 60 shown in Figure 6 calling the application code stored in the memory 604 to instruct the second device to execute.
[0338] It can be understood that in the above embodiments, the methods and / or steps implemented by the first device can also be implemented by components that can be used for the first device (such as chips or circuits), and the methods and / or steps implemented by the second device can also be implemented by components that can be used for the second device (such as chips or circuits).
[0339] Optionally, embodiments of the present application further provide a communication device for implementing the various methods described above. The communication device may be the first device in the above method embodiments, or a device including the above first device, or a component that can be used for the first device. The communication device may also be the second device in the above method embodiments, or a device including the above second device, or a component that can be used for the second device. It is understood that, in order to implement the above functions, the communication device includes hardware structures and / or software modules corresponding to performing each function. Those skilled in the art should readily appreciate that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0340] In the embodiment of the present application, the functional modules of the communication device can be divided according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0341] FIG30 shows a schematic diagram of the structure of a communication device. As shown in FIG30 , the communication device 300 includes a transceiver module 3001 and a processing module 3002. The transceiver module 3001, which may also be referred to as a transceiver unit, is used to implement transceiver functions, and may be, for example, a transceiver circuit, a transceiver, a transceiver, or a communication interface.
[0342] Here, the communication device 300 is taken as the first device in the above method embodiment as an example:
[0343] The transceiver module 3001 can be used to transmit a training frame with a second device, the training frame carrying a security message. The processing module 3002 can be used to perform link training based on the training frame and perform security processing based on the security message.
[0344] Optionally, the transceiver module 3001 is configured to transmit training frames to the second device, specifically including: the transceiver module 3001 is configured to continuously transmit multiple training frames to the second device, the multiple training frames carrying multiple different security messages. The processing module 3002 is configured to perform link training based on the training frames and perform security processing based on the security messages, specifically including: the processing module 3002 is configured to perform link training based on the multiple training frames and perform security processing based on the multiple different security messages.
[0345] Optionally, security processing may include authentication. The transceiver module 3001 is used to transmit training frames with the second device, and specifically may include: first, the transceiver module 3001 is used to send at least one first training frame to the second device, the at least one first training frame carrying a first security message, and the first security message is used to indicate authentication based on the PSK. Then, the transceiver module 3001 is used to receive at least one second training frame from the second device, the at least one second training frame carrying a second security message, and the second security message including a first random number and a first identifier (ID). The first random number is generated by the second device, and the first ID is the ID of the second device. Then, the transceiver module 3001 is used to send at least one third training frame to the second device, the at least one third training frame carrying a third security message, and the third security message including a first random number, a second random number, a second ID, a first count value, and first authentication data. The second random number and the first count value are generated by the transceiver module 3001, and the second ID is the ID used by the transceiver module 3001. The first authentication data is obtained by the transceiver module 3001 by calculating the first random number, the second random number, the first ID, the second ID, and the first count value according to the preconfigured algorithm and key. The first authentication data is used by the second device to authenticate the transceiver module 3001. Then, the transceiver module 3001 is used to receive at least one fourth training frame from the second device. The at least one fourth training frame carries a fourth security message. The fourth security message includes the second random number, the first count value, and the second authentication data. The second authentication data is obtained by the second device by calculating the second random number, the second ID, and the first count value according to the preconfigured algorithm and key. The second authentication data is used by the transceiver module 3001 to authenticate the second device. The algorithm and key preconfigured for the transceiver module 3001 and the second device are the same.
[0346] Optionally, the security processing may include authentication. The transceiver module 3001 is configured to transmit training frames with the second device, and specifically may include: First, the transceiver module 3001 is configured to send at least one fifth training frame to the second device, the at least one fifth training frame carrying a fifth security message, which is used to indicate password-based authentication. Then, the transceiver module 3001 is configured to receive at least one sixth training frame from the second device, the at least one sixth training frame carrying a sixth security message, which includes a third random number, a first ID, a second count value, and third authentication data. The third random number and the second count value are generated by the second device, and the first ID is the ID of the second device. The third authentication data is obtained by the second device calculating the third random number, the first ID, and the second count value based on a preconfigured algorithm and a password. The third authentication data is used by the transceiver module 3001 to authenticate the second device. Then, the transceiver module 3001 is configured to send at least one seventh training frame to the second device, the at least one seventh training frame carrying a seventh security message, which includes a third random number, a fourth random number, a second ID, a second count value, and fourth authentication data. The fourth random number is generated by the transceiver module 3001, and the second ID is the ID used by the transceiver module 3001. The fourth authentication data is obtained by the transceiver module 3001 by calculating the third random number, the fourth random number, the first ID, the second ID, and the second count value according to a preconfigured algorithm and password. The fourth authentication data is used by the second device to authenticate the transceiver module 3001. The algorithm and password preconfigured for the transceiver module 3001 and the second device are the same.
[0347] Optionally, security processing may include key distribution. The transceiver module 3001 is configured to transmit training frames with the second device, and may further include: first, the transceiver module 3001 is configured to receive at least one eighth training frame from the second device, the at least one eighth training frame carrying an eighth security message, the eighth security message including a start marker, a first ID, and a first security capability parameter. The start marker indicates the initiation of key distribution, the first ID is the ID of the second device, and the first security capability parameter is the security capability parameter of the second device. Then, the transceiver module 3001 is configured to send at least one ninth training frame to the second device, the at least one ninth training frame carrying a ninth security message, the ninth security message including a second ID, a second security capability parameter, and a security association key (SAK). The second ID is the ID of the transceiver module 3001, the second security capability parameter is the security capability parameter determined by the transceiver module 3001 for communication with the second device, and the SAK is the key determined by the transceiver module 3001 for communication with the second device.
[0348] Take the communication device 300 as the second device in the above method embodiment as an example:
[0349] The transceiver module 3001 can be used to transmit a training frame with the first device, the training frame carrying a security message. The processing module 3002 can be used to perform link training based on the training frame and perform security processing based on the security message.
[0350] Optionally, the transceiver module 3001 is configured to transmit training frames to the first device, which may specifically include: the transceiver module 3001 is configured to continuously transmit multiple training frames to the first device, wherein the multiple training frames carry multiple different security messages. The transceiver module 3001 is configured to perform link training based on the training frames and perform security processing based on the security messages, which may specifically include: the transceiver module 3001 is configured to perform link training based on the multiple training frames and perform security processing based on the multiple different security messages.
[0351] Optionally, security processing may include authentication. The transceiver module 3001 is used to transmit training frames with the first device, and may include: first, the transceiver module 3001 is used to receive at least one first training frame from the first device, the at least one first training frame carries a first security message, and the first security message is used to indicate authentication based on PSK. Then, the transceiver module 3001 is used to send at least one second training frame to the first device, the at least one second training frame carries a second security message, and the second security message includes a first random number and a first identifier ID. The first random number is generated by the transceiver module 3001, and the first ID is the ID of the transceiver module 3001. Then, the transceiver module 3001 is used to receive at least one third training frame from the first device, the at least one third training frame carries a third security message, and the third security message includes a first random number, a second random number, a second ID, a first count value, and first authentication data. The second random number and the first count value are generated by the first device, and the second ID is the ID of the first device. The first authentication data is obtained by the first device by calculating the first random number, the second random number, the first ID, the second ID, and the first count value according to a preconfigured algorithm and key. The first authentication data is used by the transceiver module 3001 to authenticate the first device. Then, the transceiver module 3001 is used to send at least one fourth training frame to the first device. The at least one fourth training frame carries a fourth security message. The fourth security message includes the second random number, the first count value, and the second authentication data. The second authentication data is obtained by the transceiver module 3001 by calculating the second random number, the second ID, and the first count value according to a preconfigured algorithm and key. The second authentication data is used by the first device to authenticate the transceiver module 3001. The first device and the transceiver module 3001 use the same preconfigured algorithm and key.
[0352] Optionally, the security processing may include authentication. The transceiver module 3001 is used to transmit training frames with the first device, and may include: first, the transceiver module 3001 is used to receive at least one fifth training frame from the first device, at least one fifth training frame carries a fifth security message, and the fifth security message is used to indicate authentication based on a password. Then, the transceiver module 3001 is used to send at least one sixth training frame to the first device, at least one sixth training frame carries a sixth security message, and the sixth security message includes a third random number, a first ID, a second count value and third authentication data. Among them, the third random number and the second count value are generated by the transceiver module 3001, and the first ID is the ID used by the transceiver module 3001. The third authentication data is obtained by the transceiver module 3001 by calculating the third random number, the first ID and the second count value according to a preconfigured algorithm and password, and the third authentication data is used by the first device to authenticate the transceiver module 3001. Next, the transceiver module 3001 is used to receive at least one seventh training frame from the first device. The at least one seventh training frame carries a seventh security message. The seventh security message includes a third random number, a fourth random number, a second ID, a second count value, and fourth authentication data. The fourth random number is generated by the first device, and the second ID is the ID of the first device. The fourth authentication data is calculated by the first device based on a preconfigured algorithm and password using the third random number, the fourth random number, the first ID, the second ID, and the second count value. The fourth authentication data is used by the transceiver module 3001 to authenticate the first device. The first device and the transceiver module 3001 use the same preconfigured algorithm and password.
[0353] Optionally, security processing may include key distribution. The transceiver module 3001 is configured to transmit training frames with the first device, and may further include: first, the transceiver module 3001 is configured to send at least one eighth training frame to the first device, the at least one eighth training frame carrying an eighth security message, the eighth security message including a start marker, a first ID, and a first security capability parameter. The start marker indicates the initiation of key distribution, the first ID is the ID of the transceiver module 3001, and the first security capability parameter is the security capability parameter of the transceiver module 3001. Then, the transceiver module 3001 is configured to receive at least one ninth training frame from the transceiver module 3001, the at least one ninth training frame carrying a ninth security message, the ninth security message including a second ID, a second security capability parameter, and a security association key (SAK). The second ID is the ID of the first device, the second security capability parameter is the security capability parameter determined by the first device for communication between the first device and the transceiver module 3001, and the SAK is the key determined by the first device for communication between the first device and the transceiver module 3001.
[0354] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here. Since the communication device 300 provided in this embodiment can execute the above network startup method, the technical effects that can be obtained can be referred to the above method embodiment and will not be repeated here.
[0355] In this embodiment, the communication device 300 is presented in the form of various functional modules divided in an integrated manner. "Module" here can refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and / or other devices that can provide the aforementioned functions. In a simple embodiment, those skilled in the art will appreciate that the communication device 300 can take the form of the communication device 60 shown in Figure 6.
[0356] For example, the processor 601 in the communication device 60 shown in FIG6 may call the computer-executable instructions stored in the memory 604 to enable the communication device 60 to execute the network startup method in the above method embodiment.
[0357] Specifically, the functions / implementation processes of the transceiver module 3001 and the processing module 3002 in FIG10 can be implemented by the processor 601 in the communication device 60 shown in FIG6 calling computer-executable instructions stored in the memory 604. Alternatively, the functions / implementation processes of the transceiver module 3001 in FIG10 can be implemented by the communication interface 603 in the communication device 60 shown in FIG6, and the functions / implementation processes of the processing module 3002 in FIG10 can be implemented by the processor 601 in the communication device 60 shown in FIG6 calling computer-executable instructions stored in the memory 604.
[0358] Since the communication device 300 provided in this embodiment can execute the above-mentioned network startup method, the technical effects that can be obtained can refer to the above-mentioned method embodiments and will not be repeated here.
[0359] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0360] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0361] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0362] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0363] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0364] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0365] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more media that can be integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0366] As used in this application, the terms "component", "module", "system" and the like are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program and / or a computer. As an example, both an application running on a computing device and the computing device can be a component. One or more components can exist in an executing process and / or thread, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in the form of local and / or remote processes, such as based on signals having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in the form of signals over a network such as the Internet).
[0367] The present application presents various aspects, embodiments, or features in the context of systems that may include multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.
[0368] Additionally, in the embodiments of this application, the word "exemplary" is used to indicate an example, illustration, or description. Any embodiment or design described in this application as "exemplary" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete way.
[0369] In the embodiments of the present application, information, signal, message, and channel may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to convey are the same. "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to convey are the same. "System" and "network" may sometimes be used interchangeably. When the distinction between them is not emphasized, the meanings they intend to convey are the same. For example, "communication network" also refers to "communication system."
[0370] The network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field will know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0371] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A network startup method, characterized in that: The network startup process at least includes a link training process and a security processing process; the method includes: The first device transmits a training frame with the second device, where the training frame carries a security message; The first device performs link training based on the training frame, and performs security processing based on the security message.
2. The method according to claim 1, characterized in that The security processing includes authentication and / or key distribution.
3. The method according to claim 1 or 2, characterized in that: The training frame includes an information field infofield, and the first reserved field in the information field is used to carry the safety message.
4. The method according to claim 3, characterized in that The length of the first reserved field is an integer multiple of 8 bits.
5. The method according to claim 3 or 4, characterized in that: The information domain also includes a second reserved field; the second reserved field is used to indicate whether the training frame is a starting frame corresponding to a security message carried by the first reserved field.
6. The method according to any one of claims 3 to 5, characterized in that: During the security processing, the first device and the second device need to exchange security messages multiple times; the information domain also includes a third reserved field, and the third reserved field is used to indicate the order of the security message carried by the first reserved field in the multiple exchanged security messages.
7. The method according to any one of claims 1 to 6, characterized in that: One training frame carries one security message, or multiple training frames carry one security message together.
8. The method according to claim 7, characterized in that The multiple training frames are training frames that are transmitted continuously.
9. The method according to any one of claims 1 to 8, characterized in that: The security message of the first interaction between the first device and the second device during the security processing is carried in a training frame transmitted based on a preconfigured time; Alternatively, the security message of the first interaction between the first device and the second device during the security processing process is carried in a preset training frame.
10. The method according to any one of claims 1 to 9, characterized in that: The first device and the second device transmit a training frame, including: the first device and the second device continuously transmit a plurality of training frames, the plurality of training frames carrying a plurality of different security messages; The first device performs link training based on the training frame and performs security processing based on the security message, including: The first device performs link training based on the multiple training frames, and performs security processing based on the multiple different security messages.
11. The method according to any one of claims 1 to 10, characterized in that: The security processing includes authentication; the first device and the second device transmit a training frame, including: The first device sends at least one first training frame to the second device, where the at least one first training frame carries a first security message, where the first security message is used to indicate authentication based on a pre-shared key PSK; The first device receives at least one second training frame from the second device, the at least one second training frame carries a second security message, and the second security message includes a first random number and a first identifier ID; wherein the first random number is generated by the second device, and the first ID is the ID of the second device; The first device sends at least one third training frame to the second device, the at least one third training frame carries a third security message, the third security message includes the first random number, the second random number, the second ID, the first count value, and the first authentication data; wherein the second random number and the first count value are generated by the first device, and the second ID is the ID of the first device; the first authentication data is obtained by the first device calculating the first random number, the second random number, the first ID, the second ID and the first count value according to a preconfigured algorithm and a key, and the first authentication data is used for the second device to authenticate the first device; The first device receives at least one fourth training frame from the second device, where the at least one fourth training frame carries a fourth security message, where the fourth security message includes the second random number, the first count value, and second authentication data; wherein the second authentication data is obtained by the second device calculating the second random number, the second ID, and the first count value according to a preconfigured algorithm and a key, and the second authentication data is used by the first device to authenticate the second device; The algorithm and key pre-configured for the first device and the second device are the same.
12. The method according to any one of claims 1 to 11, characterized in that: The security processing includes authentication; the first device and the second device transmit a training frame, including: The first device sends at least one fifth training frame to the second device, where the at least one fifth training frame carries a fifth safety message, The fifth security message is used to instruct authentication based on a password; The first device receives at least one sixth training frame from the second device, the at least one sixth training frame carries a sixth security message, the sixth security message includes a third random number, a first ID, a second count value and third authentication data; wherein the third random number and the second count value are generated by the second device, the first ID is the ID of the second device; the third authentication data is obtained by the second device calculating the third random number, the first ID and the second count value according to a preconfigured algorithm and a password, and the third authentication data is used by the first device to authenticate the second device; The first device sends at least one seventh training frame to the second device, the at least one seventh training frame carries a seventh security message, the seventh security message includes the third random number, the fourth random number, the second ID, the second count value and fourth authentication data; wherein the fourth random number is generated by the first device, and the second ID is the ID of the first device; the fourth authentication data is obtained by the first device calculating the third random number, the fourth random number, the first ID, the second ID and the second count value according to a preconfigured algorithm and a password, and the fourth authentication data is used by the second device to authenticate the first device; The pre-configured algorithms and passwords of the first device and the second device are the same.
13. The method according to any one of claims 1 to 12, characterized in that: The security processing includes key distribution; the first device and the second device transmit a training frame, and further includes: The first device receives at least one eighth training frame from the second device, where the at least one eighth training frame carries an eighth security message, where the eighth security message includes a start marker, a first ID, and a first security capability parameter; wherein the start marker is used to indicate starting key distribution, the first ID is an ID of the second device, and the first security capability parameter is a security capability parameter of the second device; The first device sends at least one ninth training frame to the second device, and the at least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter and a security association key SAK; wherein the second ID is the ID of the first device, the second security capability parameter is a security capability parameter determined by the first device for communication between the first device and the second device, and the SAK is a key determined by the first device for communication between the first device and the second device.
14. A network startup method, characterized in that: The network startup process at least includes a link training process and a security processing process; the method includes: The second device transmits a training frame with the first device, where the training frame carries a security message; The second device performs link training based on the training frame, and performs security processing based on the security message.
15. The method according to claim 14, characterized in that The security processing includes authentication; the second device and the first device transmit a training frame, including: The second device receives at least one first training frame from the second device, where the at least one first training frame carries a first security message, where the first security message is used to indicate authentication based on a pre-shared key PSK; The second device sends at least one second training frame to the first device, where the at least one second training frame carries a second security message, and the second security message includes a first random number and a first identifier ID; wherein the first random number is generated by the second device, and the first ID is an ID of the second device; The second device receives at least one third training frame from the second device, the at least one third training frame carries a third security message, the third security message includes the first random number, the second random number, the second ID, the first count value, and the first authentication data; wherein the second random number and the first count value are generated by the first device, and the second ID is the ID of the first device; the first authentication data is obtained by the first device calculating the first random number, the second random number, the first ID, the second ID and the first count value according to a preconfigured algorithm and a key, and the first authentication data is used for the second device to authenticate the first device; The second device sends at least one fourth training frame to the second device, where the at least one fourth training frame carries a fourth security message, where the fourth security message includes the second random number, the first count value, and second authentication data; wherein the second authentication data is obtained by the second device calculating the second random number, the second ID, and the first count value according to a preconfigured algorithm and a key, and the second authentication data is used by the first device to authenticate the second device; The algorithm and key pre-configured for the first device and the second device are the same.
16. The method according to claim 14, characterized in that The security processing includes authentication; the second device and the first device transmit a training frame, including: The second device receives at least one fifth training frame of the first device, where the at least one fifth training frame carries a fifth safety message, The fifth security message is used to instruct authentication based on a password; The second device sends at least one sixth training frame to the first device, the at least one sixth training frame carries a sixth security message, the sixth security message includes a third random number, a first ID, a second count value and third authentication data; wherein the third random number and the second count value are generated by the second device, the first ID is the ID of the second device; the third authentication data is obtained by the second device calculating the third random number, the first ID and the second count value according to a preconfigured algorithm and a password, and the third authentication data is used by the first device to authenticate the second device; The second device receives at least one seventh training frame from the first device, the at least one seventh training frame carries a seventh security message, the seventh security message includes the third random number, the fourth random number, the second ID, the second count value and fourth authentication data; wherein the fourth random number is generated by the first device, and the second ID is the ID of the first device; the fourth authentication data is obtained by the first device calculating the third random number, the fourth random number, the first ID, the second ID and the second count value according to a preconfigured algorithm and a password, and the fourth authentication data is used by the second device to authenticate the first device; The pre-configured algorithms and passwords of the first device and the second device are the same.
17. The method according to any one of claims 14 to 16, characterized in that: The security processing includes key distribution; the second device and the first device transmit a training frame, and further includes: The second device sends at least one eighth training frame to the first device, where the at least one eighth training frame carries an eighth security message, where the eighth security message includes a start marker, a first ID, and a first security capability parameter; wherein the start marker is used to indicate starting key distribution, the first ID is an ID of the second device, and the first security capability parameter is a security capability parameter of the second device; The second device receives at least one ninth training frame from the first device, and the at least one ninth training frame carries a ninth security message, and the ninth security message includes a second ID, a second security capability parameter and a security association key SAK; wherein the second ID is the ID of the first device, the second security capability parameter is a security capability parameter determined by the first device for the first device to communicate with the second device, and the SAK is a key determined by the first device for the first device to communicate with the second device.
18. A communication device, characterized in that: The communication device comprises: a processor and a memory; The memory is used to store computer-executable instructions. When the processor executes the computer-executable instructions, the communication device executes the network startup method as described in any one of claims 1-13 or 14-17.
19. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, cause the computer to execute the network startup method according to any one of claims 1 to 13 or 14 to 17.
20. A communication system, characterized in that: comprising a first device and a second device, The first device is used to execute the network startup method according to any one of claims 1 to 13, and the second device is used to execute the network startup method according to any one of claims 14 to 17.
Citation Information
Patent Citations
Link training and training frame for 100Gbps Ethernet
CN104322014A
Methods and nodes in a wireless communication network
CN106922217A
System, Apparatus And Method For Recovering Link State During Link Training
US20190095215A1
Beam training method, initiator device, and responder device
WO2018233568A1
