Message processing method, device, equipment, system and storage medium
By stopping the reply to the second message on the non-master port, the functional unavailability problem caused by IEEE 1588 messages in a one-to-many port communication system was resolved, and normal interaction and time synchronization of 1588 messages were realized.
Patent Information
- Application Number
- CN202010924424.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2040-09-04
AI Technical Summary
In one-to-many port communication systems, the exchange of IEEE 1588 messages renders the 1588 function unusable, and existing technologies cannot effectively solve this problem.
By stopping the reply to the second message on the non-master port, multiple second messages are avoided, ensuring that the 1588 function works properly.
This effectively prevents the 1588 function from becoming unusable due to receiving multiple messages, ensuring normal interaction and time synchronization of 1588 messages in the communication system.
Smart Images

Figure CN114221730B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of clock, in particular to a message processing method, device, equipment, system and storage medium. BACKGROUND
[0002] In order to meet the increasing demand for high-precision time synchronization, the institute of electrical and electronics engineers (IEEE) 1588 protocol standard emerges as the times require. Among them, the IEEE 1588 protocol standard is called IEEE 1588 precision clock synchronization protocol, which is called precision time protocol (PTP) for short.
[0003] With the application range of IEEE 1588 protocol standard becoming wider and wider, there are more and more time synchronization scenarios through 1588 messages. One of the application scenarios is to apply 1588 messages for time synchronization in a one-to-many port communication system. Among them, the one-to-many port includes one master port and multiple slave ports, and each port corresponds to a network device.
[0004] How to support the interaction of 1588 messages in a one-to-many port communication system is a problem to be solved at present. SUMMARY
[0005] The present application provides a message processing method, device, equipment, system and storage medium to solve the problems provided by related technologies. The technical solutions are as follows:
[0006] In the first aspect, a message processing method is provided. The communication system includes at least three network devices. The port state of one network device in the at least three network devices is master state, and the port state of the remaining network devices is non-master state. Taking the first network device in the communication system as an example, the first network device receives a first message sent by a second port through a first port. The first port is a port of the first network device, and the second port is a port of a second network device in the communication system. The first message is used to measure the time delay. Based on the port state of the first port being non-master state, the first network device stops replying to a second message. The second message includes a response message and a following message.
[0007] Exemplarily, the first message is a point delay request (pdelay_req) message, and the second message is a point delay response (pdelay_resp) message and a point delay response follow-up (pdelay_resp_follow_up) message. According to the current 802.1AS protocol, when a node receives multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, the node sets the 1588 function of the local port as unavailable. The message processing method stops the first network device from replying to the second message in the case that the first port receiving the first message is in a non-master state, so that the second port can avoid the 1588 function being unavailable due to receiving multiple second messages.
[0008] In a possible implementation, after the first network device receives the first message sent by the second port through the first port, the first network device replies to the second port with the second message through the first port based on the port state of the first port being a non-master state, and the second message carries the port state of the first port.
[0009] Since the second message carries the port state of the first port, the second network device can determine that the first port is in a non-master state, so as to not process the second message, thereby avoiding the 1588 function of the second port of the second network device being unavailable.
[0010] In a possible implementation, the port state of the first port being a non-master state includes the port state of the first port being a listening state, a former master state, an uncalibrated state, a backup state, or a slave state. By taking the listening state, the former master state, the uncalibrated state, the backup state, or the slave state as the non-master state, the message processing method can be applied to more comprehensive scenarios.
[0011] In a possible implementation, the first network device stops replying to the second message based on the port state of the first port being a non-master state and a first condition, including: the first network device stops replying to the second message based on the port state of the first port being a non-master state and the first condition.
[0012] By stopping the first network device from replying to the second message in the case that the port state of the first port is a non-master state and the first condition, the scenario of stopping the first network device from replying to the second message is more accurate.
[0013] In a possible implementation, the first condition includes that a clock identifier in the first message is inconsistent with a clock identifier of a master node. The clock identifier of the master node is obtained from an announce message, a sync message, or a follow-up message sent by the port of the master node, i.e., the port in a master state. If the first network device is the master node, the clock identifier of the first network device is the clock identifier of the master node.
[0014] Whether the clock identifier in the first message is consistent with the clock identifier of the master node can reflect whether the port state of the second port is a non-master state, and inconsistency between the clock identifier in the first message and the clock identifier of the master node is taken as the first condition, so that the second message is stopped from being replied in the case that the port states of the first port and the second port are both non-master states. The first condition can be effectively and conveniently obtained without the first message carrying additional information.
[0015] In a possible implementation, the first condition comprises inconsistency between a source media access control (MAC) address in the first message and a MAC address of the master node.
[0016] Whether the source MAC address in the first message is consistent with the MAC address of the master node can reflect whether the port state of the second port is a non-master state, and inconsistency between the source MAC address in the first message and the MAC address of the master node is taken as the first condition, so that the second message is stopped from being replied in the case that the port states of the first port and the second port are both non-master states. The first condition can be effectively and conveniently obtained without the first message carrying additional information.
[0017] In a possible implementation, the first condition comprises inconsistency between a source internet protocol (IP) address in the first message and an IP address of the master node.
[0018] Whether the source IP address in the first message is consistent with the IP address of the master node can reflect whether the port state of the second port is a non-master state, and inconsistency between the source IP address in the first message and the IP address of the master node is taken as the first condition, so that the second message is stopped from being replied in the case that the port states of the first port and the second port are both non-master states. The first condition can be effectively and conveniently obtained without the first message carrying additional information.
[0019] In a possible implementation, the first message carries the port state of the second port, and the first condition comprises that the port state of the second port carried by the first message is a listening state, a former master state, an uncalibrated state, a backup state or a slave state.
[0020] The first network device can directly obtain the first condition based on the first message by carrying the port state of the second port in the first message.
[0021] In a second aspect, a message processing method is provided for a communication system including at least three network devices, a port state of one of the network devices being a master state, and port states of the remaining network devices being non-master states. Taking an example of the method being applied to a second network device in the communication system, the second network device sends a first message to a first port via a second port, the second port being a port of the second network device, and the first port being a port of a first network device, the first message being used for measuring a time delay; and the second network device receives a second message replied by the first port via the second port, and based on the port state of the first port being a non-master state, the second network device stops processing the second message, the second message including a response message and a follow-up message.
[0022] It should be understood that the stopping processing the second message can also be understood as skipping processing the second message.
[0023] Exemplarily, the first message is a pdelay_req message, and the second message is a pdelay_resp message and a pdelay_resp_follow_up message. According to the current 802.1AS protocol, when a node receives multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, the node sets the 1588 function of the port to be unavailable. However, in the case that the first port sending the second message is in a non-master state, the second network device stops processing the second message according to the message processing method, thereby avoiding the 1588 function of the second port of the second network device being unavailable.
[0024] In a possible implementation, the clock identity in the second message is inconsistent with a clock identity of the master node, and the port state of the first port is a non-master state.
[0025] The port state of the first port is determined by the clock identity, so that the second message does not need to carry additional information, and the determination of the port state is relatively effective and convenient.
[0026] In a possible implementation, a source media access control (MAC) address in the second message is inconsistent with a MAC address of the master node, and the port state of the first port is a non-master state.
[0027] The port state of the first port is determined by the source MAC address, so that the second message does not need to carry additional information, and the determination of the port state is relatively effective and convenient.
[0028] In a possible implementation, a source Internet protocol (IP) address in the second message is inconsistent with an IP address of the master node, and the port state of the first port is a non-master state.
[0029] The port state of the first port is determined by the source IP address, so that the second message does not need to carry additional information, and the port state is determined in a more effective and convenient manner.
[0030] In a possible implementation, the second message carries the port state of the first port, and the port state of the first port carried by the second message is a listening state, a former master state, an uncalibrated state, a backup state, or a slave state, and the port state of the first port is a non-master state.
[0031] The second message carries the port state of the first port, so that the second network device can directly determine the port state of the first port based on the second message, and the port state is determined in a more direct manner.
[0032] In a possible implementation, based on the port state of the first port being a non-master state, the second network device stops processing the second message, including: based on the first port being a non-master state and a second condition, the second network device stops processing the second message.
[0033] The second message is stopped processing based on the port state of the first port being a non-master state and a second condition, so that the scenario of stopping processing the second message is more accurate.
[0034] In a possible implementation, the second condition includes that the port state of the second port is a listening state, a former master state, an uncalibrated state, a backup state, or a slave state.
[0035] The port state of the second port is a listening state, a former master state, an uncalibrated state, a backup state, or a slave state as the second condition, so that the scenario in which the message processing method is applied is more comprehensive.
[0036] In a possible implementation, the first message carries the port state of the second port. The first message carries the port state of the second port, so that the first network device receiving the first message can directly determine the port state of the second port based on the first message.
[0037] In a third aspect, a message processing apparatus is provided, and the apparatus includes:
[0038] The receiving module is configured to receive a first message sent by a second port through a first port, the first port being a port of a first network device, the second port being a port of a second network device, and the first message being used for measuring a time delay;
[0039] The processing module is configured to stop replying to the second message based on the port state of the first port being a non-master state, or reply to the second message through the first port, the second message carrying the port state of the first port, and the second message including a response message and a following message.
[0040] In a possible implementation, the port state of the first port is a non-primary state, including that the port state of the first port is a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
[0041] In a possible implementation, the processing module is configured to stop replying to the second message based on the port state of the first port being a non-primary state and a first condition.
[0042] In a possible implementation, the first condition includes that a clock identifier in the first message is inconsistent with a clock identifier of the primary node.
[0043] In a possible implementation, the first condition includes that a source media access control (MAC) address in the first message is inconsistent with a MAC address of the primary node.
[0044] In a possible implementation, the first condition includes that a source Internet protocol (IP) address in the first message is inconsistent with an IP address of the primary node.
[0045] In a possible implementation, the first message carries a port state of the second port, and the first condition includes that the port state of the second port carried in the first message is a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
[0046] In a fourth aspect, a message processing apparatus is provided, which includes:
[0047] a sending module configured to send a first message to a first port through a second port, the second port being a port of a second network device, the first port being a port of a first network device, and the first message being used for measuring a time delay;
[0048] a receiving module configured to receive a second message replied by the first port through the second port, the second message including a response message and a following message;
[0049] a processing module configured to stop processing the second message based on a port state of the first port being a non-primary state.
[0050] In a possible implementation, the port state of the first port is a non-primary state when a clock identifier in the second message is inconsistent with a clock identifier of the primary node.
[0051] In a possible implementation, the port state of the first port is a non-primary state when a source media access control (MAC) address in the second message is inconsistent with a MAC address of the primary node.
[0052] In a possible implementation, the source Internet Protocol (IP) address in the second packet is inconsistent with an IP address of the master node, and the port state of the first port is a non-master state.
[0053] In a possible implementation, the second packet carries the port state of the first port, and the port state of the first port carried by the second packet is a listening state, a former master state, an uncalibrated state, a backup state, or a slave state, and the port state of the first port is a non-master state.
[0054] In a possible implementation, the processing module is configured to stop processing the second packet based on the first port being in a non-master state and a second condition.
[0055] In a possible implementation, the second condition includes that the port state of the second port is a listening state, a former master state, an uncalibrated state, a backup state, or a slave state.
[0056] In a possible implementation, the first packet carries the port state of the second port.
[0057] Also provided is a network device including a memory and a processor, the memory storing at least one instruction, and the at least one instruction being loaded and executed by the processor to enable the network device to implement the packet processing method according to any of the first aspect or the second aspect.
[0058] Also provided is a computer-readable storage medium storing at least one instruction, and the at least one instruction being loaded and executed by a processor to implement the packet processing method according to any of the above.
[0059] Another communication apparatus is provided, which includes a transceiver, a memory, and a processor. The transceiver, the memory, and the processor are in communication with each other through internal connection paths. The memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive a signal and control the transceiver to send a signal. When the processor executes the instructions stored in the memory, the processor is caused to execute the method according to the first aspect or any possible implementation of the first aspect, or execute the method according to the first aspect or any possible implementation of the first aspect.
[0060] As an exemplary embodiment, the processor is one or more, and the memory is one or more.
[0061] As an exemplary embodiment, the memory can be integrated with the processor, or the memory and the processor are separately arranged.
[0062] In a specific implementation process, the memory can be a non-transitory memory, for example, a read only memory (ROM), which can be integrated on the same chip with the processor, or can be separately arranged on different chips. The embodiments of the present application do not limit the type of memory and the arrangement mode of the memory and the processor.
[0063] A computer program (product) is provided, which comprises computer program code, which, when executed by a computer, causes the computer to perform the method in the above aspects.
[0064] A chip is provided, which comprises a processor, configured to invoke and execute instructions stored in a memory, so that a communication device installed with the chip performs the method in the above aspects.
[0065] Another chip is provided, which comprises an input interface, an output interface, a processor and a memory, and the input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is configured to execute code in the memory, and when the code is executed, the processor is configured to perform the method in the above aspects. BRIEF DESCRIPTION OF DRAWINGS
[0066] Figure 1 A structure diagram of a PTP packet header is provided for the embodiments of the present application;
[0067] Figure 2 A structure diagram of a pdelay_req packet is provided for the embodiments of the present application;
[0068] Figure 3 A structure diagram of a pdelay_resp packet is provided for the embodiments of the present application;
[0069] Figure 4 A structure diagram of a pdelay_resp_follow_up packet is provided for the embodiments of the present application;
[0070] Figure 5 A structure diagram of a communication system is provided for the embodiments of the present application;
[0071] Figure 6 A message interaction flow diagram is provided for the embodiments of the present application;
[0072] Figure 7 A message processing method flow diagram is provided for the embodiments of the present application;
[0073] Figure 8A format diagram of a 1588 message provided for an embodiment of the present application is shown in FIG. 1.
[0074] Figure 9 A format diagram of another 1588 message provided for an embodiment of the present application is shown in FIG. 2.
[0075] Figure 10 A flowchart of a message processing method provided for an embodiment of the present application is shown in FIG. 3.
[0076] Figure 11 A structure diagram of a message processing device provided for an embodiment of the present application is shown in FIG. 4.
[0077] Figure 12 A structure diagram of a message processing device provided for an embodiment of the present application is shown in FIG. 5.
[0078] Figure 13 A structure diagram of a network device provided for an embodiment of the present application is shown in FIG. 6.
[0079] Figure 14 A structure diagram of a network device provided for an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION
[0080] The terms used in the embodiment part of the present application are only used for explaining the embodiments of the present application, and are not intended to limit the present application.
[0081] As more and more communication systems have high-precision time synchronization requirements, the application range of IEEE 1588 protocol standard is becoming wider and wider. The IEEE 1588 protocol standard is also called precision time protocol (PTP). Two propagation delay measurement mechanisms are defined in the PTP protocol: request response mechanism and peer delay mechanism. In IEEE 1588v2, three PTP messages in the peer-delay mechanism are included, which are pdelay_req message, pdelay_resp message and pdelay_resp_follow_up message. In addition, signaling message and announce message are also added.
[0082] Among them, IEEE 802.1AS-2020 is a profile of IEEE 1588v2, mainly used in industrial, vehicle-mounted and other fields. The various PTP messages defined in IEEE 802.1AS-2020 include a PTP message header. For example, the structure of the PTP message header is as follows. Figure 1The PTP message header includes a major SdoId field, a message type field, a minor version PTP field, a version PTP field, a message length field, a domain number field, a minor SdoId field, a flags field, a correction field, a message type specific field, a source port identity field, a sequence ID field, a control field, and a log message interval field. The fields of the PTP message header are described as follows.
[0083] Message type: different values represent different PTP messages. Version PTP: if PTP version 1, the value of version PTP is 1; if PTP version 2, the value of version PTP is 2. Domain number: the value of this field is the variable default DS domain Number. Flags: carries various flags. Correction field: carries the resident time of a transparent clock, the link delay of a point-to-point transparent clock, and the asymmetric compensation, etc. Source port identity: the related attributes of a sending port. Sequence ID: used to distinguish multiple messages of the same type sent by the same port. Control field: the value is determined by the value of the message type field, i.e., different values are taken according to different message types. Log message interval: carries the logarithmic time interval of sending messages, and the values are logarithms with base 2.
[0084] The structure of the pdelay_req message is shown in FIG. 11B, and includes a header field (see 11.4.2 for details) and a reserved field. Figure 2 The structure of the pdelay_resp message is shown in FIG. 11C, and includes a header field (see 11.4.2 for details) and a reserved field. Figure 3As shown, the pdelay_resp_follow_up message includes a header field (see 11.4.2 for details), a response origin timestamp field, and a requesting port identity field. Figure 4 As shown, the pdelay_resp_follow_up message includes a header field (see 11.4.2 for details), a response origin timestamp field, and a requesting port identity field.
[0085] With the application range of IEEE 1588 protocol standard becoming wider and wider, the scenarios of clock synchronization through 1588 messages are more and more. The 1588 message can be applied not only in one-to-one port communication system, but also in one-to-many port communication system. The one-to-one port includes one master port and one slave port, and the one-to-many port includes one master port and multiple slave ports. No matter one-to-one port or one-to-many port, each port corresponds to a network device. In the embodiments of the present application, the network device corresponding to the master port is referred to as master node, and the network device corresponding to the slave port is referred to as slave node.
[0086] Taking the application scenario of applying 1588 message in the 10BASE-T1S scenario in the vehicle field as an example, 10BASE-T1S is a technology for connecting multiple Ethernet devices using a single unshielded twisted pair bus line, 10Base represents 10 Mbps speed level, T1 represents physical layer as single twisted pair (unshielded), and S represents short range. The 10BASE-T1S can be applied to one-to-many port communication system.
[0087] For example, taking the one-to-many port communication system as shown in Figure 5 As shown, the pdelay_resp_follow_up message includes a header field (see 11.4.2 for details), a response origin timestamp field, and a requesting port identity field.
[0088] The message interaction flow between a master node and a slave node defined by the current 802.1AS protocol is shown in Figure 6 as follows.
[0089] 1) The master node sends an announce message and a sync message to the slave node.
[0090] If the master node is configured in two-step mode, the master node also sends a follow_up message to the slave node; if the master node is configured in one-step mode, the master node does not need to send the follow_up message to the slave node.
[0091] 2) The master node and the slave node transmit a point delay (pdelay) message, which is independent of the port state.
[0092] For example, the master node sends a point delay request (pdelay_req) message to the slave node, and the slave node returns a point delay response (pdelay_resp) message and a point delay response follow_up (pdelay_resp_follow_up) message to the master node. At this time, the master node can calculate the link delay between the master node and the slave node, and the frequency deviation of the master node relative to the slave node.
[0093] For another example, the slave node can also send a pdelay_req message to the master node, and the master node returns a pdelay_resp message and a pdelay_resp_follow_up message to the slave node. At this time, the slave node can calculate the link delay between the master node and the slave node, and the frequency deviation of the slave node relative to the master node.
[0094] For a general one-to-one Ethernet interface, because the port state of the port will be switched, for example, the port of the master node will change from the master state to the slave state, and the port of the slave node will change from the slave state to the master state, therefore, in the general Ethernet interface scenario, the master node needs to send a pdelay_req message to the slave node to calculate the time delay of the master node and the slave node and the frequency deviation of the master node relative to the slave node, so that after the switching is completed, time fast locking can be achieved.
[0095] Since the 1588 message defined in the current 802.1AS protocol is multicast encapsulation, when the master node sends the announce message, the sync message and the follow_up message, the announce message, the sync message and the follow_up message can be normally received by multiple slave nodes. But when the master node sends the pdelay_req message, multiple slave nodes will receive the pdelay_req message, and then each slave node will also reply the pdelay_resp message and the pdelay_resp_follow_up message to the master node. Thus, the master node will receive multiple pdelay_req messages and multiple pdelay_resp_follow_up messages.
[0096] However, according to the current 802.1AS protocol, when a node receives multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, the node will set the 1588 function of the local port as unavailable. Therefore, the master node will finally set the 1588 function of the local port as unavailable, resulting in that other slave nodes cannot obtain the 1588 time from the master node.
[0097] For the slave node, after sending the Pdelay_Req message, multiple Pdelay_Resp messages and multiple Pdelay_Resp_Follow_Up messages will also be received, resulting in that the 1588 function of the local port of the slave node is unavailable.
[0098] In this regard, considering that the port state of the master node and the slave node is fixed and will not change under 10BASE-T1S, the master node does not need to calculate the time delay from the master node to the slave node and the frequency offset of the master node relative to the slave node through the pdelay message. Therefore, by setting the pdelay message sending interval of the master node to 127 (see the explanation of 127 in the chapter 10.6.4.3.6 of IEEE 802.1AS-2020 protocol), the master node will not send the pdelay_req message to the slave node, so that the master node will not receive multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages that need to be processed, and the 1588 function of the port of the master node will not be set as unavailable. But when the slave node sends the pdelay_req message, there will still be a problem because multiple Pdelay_Resp messages and multiple Pdelay_Resp_Follow_Up messages will be received.
[0099] For example, when a target slave node in the plurality of slave nodes sends a pdelay_req packet, the master node and other slave nodes in the plurality of slave nodes all receive the pdelay_req packet, and then the master node and each slave node receiving the pdelay_req packet reply a pdelay_resp packet and a pdelay_resp_follow_up packet to the target slave node, so that the target slave node receives multiple pdelay_req packets and multiple pdelay_resp_follow_up packets. According to the current 802.1AS protocol, when a node receives multiple pdelay_resp packets and multiple pdelay_resp_follow_up packets, the node sets the 1588 function of the local port as unavailable; therefore, the 1588 function of 10BASE-T1S cannot be normally used according to the 1588 function defined in the current 802.1AS protocol.
[0100] To this end, an embodiment of the present application provides a packet processing method to enable a slave node in a 10BASE-T1S scenario to normally deliver a 1588 packet. The method can be applied to a communication system including at least three network devices, a port of a network device in the at least three network devices being in a master state, and ports of the remaining network devices being in a non-master state. Exemplarily, an embodiment of the present application takes an interaction process between a first network device and a second network device in the at least three network devices as an example to describe the packet processing method provided by the embodiment of the present application. Referring to Figure 7 The method includes the following processes.
[0101] 701. The second network device sends a first packet to the first port through a second port, the second port being a port of the second network device, and the first port being a port of the first network device, the first packet being used to measure a time delay.
[0102] The second network device and the first network device are located in the same communication system, and the embodiment of the present application does not limit the port states of the first port and the second port. In the IEEE 1588 protocol, the port state includes the following.
[0103] (1) Initializing state: the port is in the initializing state, and after completion, the port changes to a listening state. The port in the initializing state cannot send any 1588 packet.
[0104] (2) Faulty state: if a port fault is found, the port is set to the faulty state. The port in the faulty state cannot send any 1588 packet, but can respond to a received 1588 management packet.
[0105] (3) Disabled state: the port in disabled state cannot send any 1588 message, and the disabled port discards the received 1588 message except 1588 management message.
[0106] (4) Listening state: the port in listening state can receive message, and can send pdelay_req message, pdelay_resp message, pdelay_resp_follow_up message, signaling message and management message, but cannot send other messages.
[0107] (5) Pre_master state: the pre_master state is similar to master state, but can only send pdelay_req message, pdelay_resp message, pdelay_resp_follow_up message, signaling message and management message.
[0108] (6) Master state: the port in master state can send the message which needs to be sent, such as announce message, sync message, follow_up message, pdelay_req message, pdelay_resp message, pdelay_resp_follow_up message, signaling message and management message.
[0109] (7) Passive state: the port in passive state can only send pdelay_req message, pdelay_resp message, pdelay_resp_follow_up message, signaling message and management message.
[0110] (8) Uncalibrated state: the uncalibrated state is a transition state, which indicates that the master clock source has been selected and is in the process of synchronization. The port in uncalibrated state can send pdelay_req message, pdelay_resp message, pdelay_resp_follow_up message, signaling message and management message.
[0111] (9) Slave state: The slave state is a state after the device is synchronized stably, and the port in the slave state can send a pdelay_req message, a pdelay_resp message, a pdelay_resp_follow_up message, a signaling message and a management message.
[0112] The first message sent by the second network device to the first port through the second port is used for time delay measurement, for example, the first message is a pdelay_req message.
[0113] 702, the first network device receives the first message sent by the second network device through the first port.
[0114] In an example embodiment, the first message is a pdelay_req message. After receiving the pdelay_req message, the first network device should return a pdelay_resp message and a pdelay_resp_follow_up message to the second network device. However, since the first network device and the second network device are in a one-to-many port communication system, according to the current 802.1AS protocol, when a network device receives multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, the network device will set the 1588 function of the port receiving the message as unavailable. In this regard, after the first network device receives the first message sent by the second network device through the first port, the first network device further determines whether to reply the pdelay_resp message and the pdelay_resp_follow_up message based on the state of the first port.
[0115] In an embodiment of the present application, the port state of the first port is a listening state, a former master state, an uncalibrated state, a backup state or a slave state, and the port state of the first port is a non-master state.
[0116] In an example embodiment, in addition to determining whether to reply the second message based on the port state of the first port, the first network device also needs to consider the port state of the second port to determine whether to reply the second message based on the port state of the first port and the first condition, that is, the pdelay_resp message and the pdelay_resp_follow_up message.
[0117] The embodiment of the present application does not limit the first condition, which includes but is not limited to any one of the following four conditions.
[0118] The first condition includes that the clock identifier in the first message is inconsistent with the clock identifier of the master node.
[0119] 10BASE-T1S scenario, the pdelay_req message includes a clock identity. If the clock identity in the first message is inconsistent with the clock identity of the master node, it indicates that the second port sending the first message is not in the master state. For example, the first 8 bytes in the source port identity field of the message header of the pdelay_req message are the clock identity (clockIdentity). If the clockIdentity of the message header of the pdelay_req message is inconsistent with the clockIdentity of the master clock, the first network device determines that the second port is in a non-master state, that is, the first condition is obtained. If the clockIdentity of the message header of the pdelay_req message is consistent with the clockIdentity of the master clock, the first network device determines that the second port is in the master state.
[0120] Wherein the clockIdentity of the master node is obtained through an announce message, a sync message or a follow_up message sent by the master node, that is, the port in the master state, or if the node is the master node, the clockIdentity of the node is the clockIdentity of the master node.
[0121] The second kind: the first condition includes that the source media access control (MAC) address in the first message is inconsistent with the MAC address of the master node.
[0122] In addition to identifying the port state of the second port through the clockIdentity of the master node, the method provided by the embodiments of the application also supports identifying the port state of the second port through the source MAC address of the master node. For example, if the 1588 message format is transmitted through Ethernet encapsulation, for example, the 1588 standard 802.1AS adopted by the current vehicle standard is Ethernet encapsulation, and the complete 1588 message format is as shown in Figure 8 The 1588 message includes a destination MAC (DMAC) field, a source MAC (SMAC) field, an Ethernet type field, a PTP message header field and a PTP message payload field.
[0123] The first network device determines whether the port state of the second port is a non-master state by comparing whether the source MAC address of the first message is consistent with the MAC address of the master node. For example, the first network device determines that the port state of the second port is a non-master state by comparing that the source MAC address of the first message is inconsistent with the MAC address of the master node, i.e., obtains the first condition. The first network device determines that the port state of the second port is a master state by comparing that the source MAC address of the first message is consistent with the MAC address of the master node.
[0124] The MAC address of the master node can be obtained from an announce message, a sync message or a follow_up message sent by the master node, i.e., the port in the master state, or if the node is the master node, the MAC address of the node is the MAC address of the master node.
[0125] The third: the first condition includes that the source Internet Protocol (IP) address in the first message is inconsistent with the IP address of the master node.
[0126] The method provided by the embodiments of the present application also supports identifying the port state of the second port through the source IP address of the master node. For example, if the 1588 message format is transmitted through IP encapsulation, the complete 1588 message format is as shown in Figure 9 The 1588 message includes a DMAC field, an SMAC field, an Ethernet type field, an IP header field, a source IP (SIP) field, a destination IP (DIP) field, a source port number (SPN) field, a destination port number (DPN) field, a UDP length field, a UDP checksum field, a PTP message header field and a PTP message payload field.
[0127] The first network device determines whether the port state of the second port is a non-master state by comparing whether the source IP address of the first message is consistent with the IP address of the master node. For example, the first network device determines that the port state of the second port is a non-master state by comparing that the source IP address of the first message is inconsistent with the IP address of the master node, i.e., obtains the first condition. The first network device determines that the port state of the second port is a master state by comparing that the source IP address of the first message is consistent with the IP address of the master node.
[0128] The IP address of the master node can be obtained from an announce message, a sync message or a follow_up message sent by the port of the master node, i.e., the master state, or if the node is the master node, the IP address of the node is the IP address of the master node.
[0129] The fourth: the first message carries the port state of the second port, and the first condition includes that the port state of the second port carried by the first message is a listening state, a former master state, an uncalibrated state, a backup state or a slave state. For the manner in which the first message carries the port state of the second port, reference can be made to the manner in which the second message carries the port state of the first port in 1003 below, which will not be described here.
[0130] For example, if the port state of the second port carried by the first message is a listening state, a former master state, an uncalibrated state, a backup state or a slave state, the first network device determines that the second port is in a non-master state, and obtains the first condition. If the port state of the second port carried by the first message is a master state, the first network device determines that the second port is in a master state.
[0131] 703, based on the port state of the first port being a non-master state, the first network device stops replying to the second message.
[0132] By determining the port state of the first port receiving the first message, in the case that the port state of the first port is a non-master state, the first network device stops replying to the second message, so that the second network device avoids receiving multiple second messages. Exemplarily, the second message includes a pdelay_resp message and a pdelay_resp_follow_up message. That is, the network device with a non-master state port will not reply to the pdelay_resp message and the pdelay_resp_follow_up message, and only the network device with a master state port will reply to the pdelay_resp message and the pdelay_resp_follow_up message, so that the network device sending the pdelay_req message will not receive multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, and thus the network device sending the pdelay_req message will not malfunction. It should be noted that for the 10BASE-T1S interface involved in the embodiments of the present application, only one port with a master state port exists.
[0133] In the example embodiment, the embodiments of the present application also support that the first network device stops replying the second message based on the first port being in a non-master state and the first condition, so that the second network device avoids receiving multiple copies of the second message. That is, if the port state of the network device sending the pdelay_req message is in a non-master state and the port state of the network device receiving the pdelay_req message is in a non-master state, the network device of the receiving port will not reply the pdelay_resp message and the pdelay_resp_follow_up message, so that the network device sending the pdelay_req message will not receive multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message, and thus the network device sending the pdelay_req message will not fail.
[0134] Therefore, the message processing method provided by the embodiments of the present application can normally deliver the 1588 message in the 10BASE-T1S scenario, so as to ensure that the vehicle and other fields can normally obtain the 1588 time synchronization when using 10BASE-T1S.
[0135] It should be noted that if the port state of the second port is in a non-master state and the port state of the first port is in a master state, the first network device replies the pdelay_resp message and the pdelay_resp_follow_up message to the second port through the first port, so that the second network device in which the second port is located can normally perform time synchronization. In the example embodiment, the port state of the first port is in a master state, so that the first port of the first network device normally replies the pdelay_resp message and the pdelay_resp_follow_up message to the second port of the second network device, but the port of the network device in a non-master state will not reply the pdelay_resp message and the pdelay_resp_follow_up message, so as to avoid the port of the network device sending the pdelay_req message receiving multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message.
[0136] In summary, in combination with the port state defined by the IEEE 1588v2 protocol, when the port state is Master / Slave / Uncalibrated / Pre master / Listening / Passive state, pdelay_req message needs to be sent, and pdelay_resp message and pdelay_resp_follow_up message need to be replied. However, in the method provided in the embodiment of the present application, only the port with Master state needs to reply pdelay_resp message and pdelay_resp_follow_up message, and therefore, it can be defined that pdelay_resp message and pdelay_resp_follow_up message do not need to be replied when the port state is Slave / Uncalibrated / Pre master / Listening / Passive state.
[0137] In the exemplary embodiment, in the case that the port state of the first port receiving the first message is a non-master state, in addition to the manner in which the first network device stops replying to the second message, the method provided in the embodiment of the present application also supports other manners to realize normal transmission of 1588 messages in the 10BASE-T1S scenario. Referring to Figure 10 The message processing method provided in the embodiment of the present application includes the following processes.
[0138] 1001, the second network device sends a first message to the first port through a second port, the second port is a port of the second network device, the first port is a port of the first network device, and the first message is used to measure a time delay.
[0139] The second network device and the first network device are located in the same communication system, and the communication system includes at least three network devices. The port state of a port of one of the at least three network devices is a master state, and the port state of a port of the remaining network devices is a non-master state. Exemplarily, the interaction process between the first network device and the second network device of the at least three network devices is taken as an example to describe the message processing method provided in the embodiment of the present application, and the port state of the first port and the second port is not limited in the embodiment of the present application, and can be referred to the related description of 701 above, which will not be described here. Exemplarily, the first message is used to measure a time delay, for example, a pdelay_req message.
[0140] 1002, the first network device receives the first message sent by the second port through the first port.
[0141] Exemplarily, the first message is a pdelay_req message, and after receiving the pdelay_req message, the first network device should return a second message, such as a pdelay_resp message and a pdelay_resp_follow_up message, to the second network device. However, since the first network device and the second network device are in a one-to-many port communication system, according to the current 802.1AS protocol, when a network device receives multiple pdelay_resp messages and multiple pdelay_resp_follow_up messages, the network device will set the 1588 function of the port receiving the multiple pdelay_resp messages and the multiple pdelay_resp_follow_up messages as unavailable. In this regard, after the first network device receives the first message sent by the second port through the first port, the first network device needs to determine the port state of the first port, and further determine whether to return the pdelay_resp message and the pdelay_resp_follow_up message based on the port state of the first port. In an exemplary embodiment, in addition to determining whether to return the second message based on the port state of the first port, the first network device can also consider the first condition, and further determine whether to return the pdelay_resp message and the pdelay_resp_follow_up message based on the port state of the first port and the first condition.
[0142] The manner in which the first network device determines the port state of the first port and the first condition can refer to the related description of 702 above, and will not be described here again.
[0143] 1003, based on the port state of the first port being a non-master state, the first network device returns a second message to the second port through the first port, and the second message includes a response message and a follow-up message.
[0144] In the example embodiment, after the first network device determines that the port state of the first port is a non-master state, it can not reply to the second message, for example, not reply to the pdelay_resp message and the pdelay_resp_follow_up message, so as to prevent the network device sending the pdelay_req message from receiving multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message, otherwise, the network device sending the pdelay_req message will set the 1588 function of the port receiving multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message as unavailable. In addition, the method provided by the embodiment of the present application also supports implementing the function of the 1588 message in the case of normally returning the second message. However, in order to avoid the network device sending the pdelay_req message from receiving multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message and causing the port to be unavailable, the method provided by the embodiment of the present application carries the port state of the first port in the second message. In this way, the second network device can determine the port state of the first port, and thus determine whether to process the received pdelay_resp message and the pdelay_resp_follow_up message.
[0145] pdelay_resp_follow_up message.
[0146] In the example embodiment, the first network device, in addition to determining the port state of the first port, can also determine whether the first condition is met. Based on the port state of the first port being a non-master state and the first condition being met, the second message, such as the pdelay_resp message and the pdelay_resp_follow_up message, can not be replied, and the network device sending the pdelay_req message can not receive multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message, and the network device sending the pdelay_req message can set the 1588 function of the port receiving the multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message as unavailable. In addition, the method provided in the embodiment of the present application also supports implementing the function of the 1588 message in the case of normally replying the second message. However, in order to avoid the network device sending the pdelay_req message and the port being in a non-master state receiving multiple copies of the pdelay_resp message and the pdelay_resp_follow_up message and causing the port to be unavailable, the method provided in the embodiment of the present application carries the port state of the first port in the second message. In this way, the second network device can determine the port state of the first port, and determine whether to process the received pdelay_resp message and the pdelay_resp_follow_up message.
[0147] For example, the first message can also carry the port state of the second port. The embodiment of the present application does not limit the manner of the first message carrying the port state of the second port and the second message carrying the port state of the first port. For example, for the above-mentioned 9 states, 4 bits can be used to carry the port state. For example, based on the message header of the PTP message shown in the table 1, the flags field of the PTP message header is defined in the IEEE 802.1AS protocol as shown in the table 1. Among them, the 3rd / 4th / 7th bits of the 0th byte and the 6th / 7th bits of the 1st byte are reserved fields, and the embodiment of the present application can select 4 bits to carry the port state. Figure 1
[0148] Table 1
[0149]
[0150]
[0151] In addition to the above manner of selecting 4 bits in the flags field to carry the port state, the method provided by the embodiment of the present application also supports a manner of adding 1 byte in the pdelay_req packet, the pdelay_resp packet, and the pdelay_resp_follow_up packet, so as to use 4 bits in the added byte to carry the port state.
[0152] 1004, the second network device receives the second message replied by the first port through the second port, and based on the port state of the first port being a non-master state, the second network device stops processing the second message.
[0153] After the second network device receives the second message replied by the first port through the second port, the port state of the first port also needs to be determined, so as to further determine whether to process the second message replied by the first port. The port state of the first port being a non-master state includes but is not limited to the following four cases.
[0154] Case one: the second message carries the port state of the first port, and the port state of the first port carried by the second message is a listening state, a former master state, an uncalibrated state, an alternative state, or a slave state, so the port state of the first port is a non-master state.
[0155] In the above case, since the second message carries the port state of the first port, after the second network device determines that the port state of the first port is a non-master state according to the port state of the first port carried in the second message, the second network device stops processing the second message. In this way, the second network device does not process the second message sent by other slave nodes, and only processes the second message replied by the master node, so as to avoid the second port of the second network device becoming an unusable state due to processing multiple second messages.
[0156] For the case that the second message does not carry the port state of the first port, after the second network device receives the second message replied by the first port through the second port, the second network device also includes but is not limited to any one of the following modes two to four for determining the port state of the first port.
[0157] Case two: the clock identifier in the second message is inconsistent with the clock identifier of the master node, and the port state of the first port is a non-master state.
[0158] When each network device in the 10BASE-T1S scenario receives the pdelay_resp message and the pdelay_resp_follow_up message, the pdelay_resp message and the pdelay_resp_follow_up message include clock identification. If the clock identification in the second message is inconsistent with the clock identification of the master node, it indicates that the port state of the first port sending the second message is not the master state. For example, the first 8 bytes in the source port identity field of the message header of the pdelay_resp message and the pdelay_resp_follow_up message are clock identification (clockIdentity). If the clockIdentity of the message header of the pdelay_resp message and the pdelay_resp_follow_up message is inconsistent with the clockIdentity of the master clock, the second network device determines that the first port is in a non-master state. If the clockIdentity of the message header of the pdelay_resp message and the pdelay_resp_follow_up message is consistent with the clockIdentity of the master clock, the second network device determines that the first port is in a master state.
[0159] The clockIdentity of the master clock can be obtained from an announce message, a sync message or a follow_up message sent by the master node, i.e., the port in the master state, or if the node is the master node, the clockIdentity of the node is the clockIdentity of the master node.
[0160] Case three: the source MAC address in the second message is inconsistent with the MAC address of the master node, and the port state of the first port is a non-master state.
[0161] In addition to identifying the port state of the first port by the clockIdentity of the master node, the method provided in the embodiments of the application also supports identifying the port state of the first port by the source MAC address of the master node. For example, if the 1588 message format is transmitted by Ethernet encapsulation, for example, the 1588 standard 802.1AS adopted by the current vehicle standard is Ethernet encapsulation, and the complete 1588 message format is as shown in Figure 8 The 1588 message includes a destination MAC (DMAC) field, a source MAC (SMAC) field, an Ethernet type field, a PTP message header field and a PTP message payload field.
[0162] The second network device determines whether the port state of the first port is the non-master state by comparing whether the source MAC address of the second message is consistent with the MAC address of the master node. For example, the second network device determines that the port state of the first port is the non-master state by comparing that the source MAC address of the second message is inconsistent with the MAC address of the master node. The second network device determines that the port state of the first port is the master state by comparing that the source MAC address of the second message is consistent with the MAC address of the master node.
[0163] The MAC address of the master node can be obtained from an announce message, a sync message or a follow_up message sent by the master node, i.e., the port in the master state, or if the node is the master node, the MAC address of the node is the MAC address of the master node.
[0164] Case four: the source IP address in the second message is inconsistent with the IP address of the master node, and the port state of the first port is the non-master state.
[0165] The method provided by the embodiment of the application also supports identifying the port state of the first port through the source IP address of the master node. For example, if the 1588 message format is transmitted through IP encapsulation, the complete 1588 message format is as shown in Figure 9 The 1588 message includes a DMAC field, an SMAC field, an ethernet type field, an IP header field, a source IP (SIP) field, a destination IP (DIP) field, a source port number (SPN) field, a destination port number (DPN) field, a UDP length field, a UDP checksum field, a PTP message header field and a PTP message payload field.
[0166] The second network device determines whether the port state of the first port is the non-master state by comparing whether the source IP address of the second message is consistent with the IP address of the master node. For example, the second network device determines that the port state of the first port is the non-master state by comparing that the source IP address of the second message is inconsistent with the IP address of the master node. The second network device determines that the port state of the first port is the master state by comparing that the source IP address of the second message is consistent with the IP address of the master node.
[0167] The IP address of the master node can be obtained from an announce message, a sync message or a follow_up message sent by the port of the master node, i.e., the master state, or if the node is the master node, the IP address of the node is the IP address of the master node.
[0168] Optionally, in the exemplary embodiment, the second network device stops processing the second message based on the first port being in a non-master state and a second condition.
[0169] Exemplarily, the second condition includes the second port being in a listening state, a pre-master state, an uncalibrated state, a backup state or a slave state. Based on the first port being in a non-master state and the second condition, even if the second network device receives the second message replied by the first port, the second network device stops processing the second message, thereby avoiding that in the case of receiving multiple second messages, the network device sets the 1588 function of the second port receiving the message as unavailable.
[0170] For example, when the second network device where the second port is located determines that the first port is in a non-master state through the pdelay_resp message and the pdelay_resp_follow_up message, or determines that the first port is in a non-master state through the pdelay_resp message and the pdelay_resp_follow_up message, and the port state of the second port is also in a non-master state, the pdelay_resp message and the pdelay_resp_follow_up message can not be processed.
[0171] pdelay_resp_follow_up message, and the source clockIdentity, the source MAC address or the source IP address carried in the pdelay_resp message and the pdelay_resp_follow_up message determines that the first port is in a non-master state, and the port state of the second port is also in a non-master state, the pdelay_resp message and the pdelay_resp_follow_up message can not be processed.
[0172] It should be noted that if a network device (a network device with a port in a master state or a non-master state) does not send a pdelay_req message, but can receive a pdelay_resp message and a pdelay_resp_follow_up message replied by other network devices, if the requestingport identity field in the pdelay_resp message and the pdelay_resp_follow_up message is inconsistent with the port identity of the port receiving the message of the network device, the network device can not process the messages according to the existing 802.1AS protocol.
[0173] Furthermore, the method provided in this application embodiment is only illustrated using the transmission of 1588 messages in a 10BASE-T1S scenario as an example. Besides being applicable to the transmission of 1588 messages in a 10BASE-T1S scenario, the method provided in this application embodiment can also be applied to other possible one-to-many port communication systems. This application embodiment does not limit the application scenario of the method.
[0174] The above describes the message processing method of the embodiments of this application. Corresponding to the above method, the embodiments of this application also provide a message processing device. Figure 11 This is a schematic diagram of a message processing device provided in an embodiment of this application. The device is applied to a first network device, which is the one described above. Figure 7 and Figure 10 The first network device shown in any of the attached figures. Based on Figure 11 The following modules are shown. Figure 11 The shown message processing apparatus is capable of performing all or part of the operations performed by the first network device. It should be understood that the apparatus may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. Figure 11 As shown, the device includes:
[0175] The receiving module 1101 is used to receive a first message sent by a second port through a first port. The first port is a port of a first network device, and the second port is a port of a second network device. The first message is used to measure latency.
[0176] The processing module 1102 is used to stop replying to the second message based on the port status of the first port being non-master state, or to reply to the second port through the first port with the second message, the second message carrying the port status of the first port, the second message including a response message and a follow-up message.
[0177] In one possible implementation, the port state of the first port is a non-master state, including the port state of the first port being a listening state, a former master state, an uncalibrated state, a backup state, or a slave state.
[0178] In one possible implementation, the processing module 1102 is used to stop replying to the second message based on the port state of the first port being a non-master state and a first condition.
[0179] In one possible implementation, the first condition includes that the clock identifier in the first message is inconsistent with the clock identifier of the master node.
[0180] In one possible implementation, the first condition includes that the source media access control MAC address in the first message is inconsistent with the MAC address of the master node.
[0181] In one possible implementation, the first condition includes that the source Internet Protocol IP address in the first message is inconsistent with the IP address of the master node.
[0182] In one possible implementation, the first message carries the port status of the second port, and the first condition includes that the port status of the second port carried in the first message is listening state, former master state, uncalibrated state, standby state, or slave state.
[0183] Figure 12 This is a schematic diagram of a message processing device provided in an embodiment of this application. The device is applied to a second network device, which is the one described above. Figure 7 and Figure 10 The second network device shown in any of the attached figures. Based on Figure 12 The following modules are shown. Figure 12 The shown message processing apparatus is capable of performing all or part of the operations performed by the second network device. It should be understood that the apparatus may include more additional modules than those shown, or may omit some of the modules shown; this application embodiment does not impose limitations in this regard. See also Figure 12 The device includes:
[0184] The sending module 1201 is used to send a first message to a first port through a second port. The second port is a port of a second network device, and the first port is a port of a first network device. The first message is used to measure latency.
[0185] The receiving module 1202 is used to receive a second message replied by the first port through the second port. The second message includes a response message and a follow-up message.
[0186] The processing module 1203 is used to stop processing the second message based on the fact that the port status of the first port is non-master state.
[0187] In one possible implementation, if the clock identifier in the second message is inconsistent with the clock identifier of the master node, then the port state of the first port is a non-master state.
[0188] In one possible implementation, if the source media access control MAC address in the second message is inconsistent with the MAC address of the master node, then the port state of the first port is a non-master state.
[0189] In one possible implementation, if the source Internet Protocol IP address in the second message is inconsistent with the IP address of the master node, then the port state of the first port is non-master state.
[0190] In a possible implementation, the second message carries the port state of the first port, and the port state of the first port carried by the second message is the listening state, the former master state, the uncalibrated state, the backup state or the slave state, and the port state of the first port is the non-master state.
[0191] In a possible implementation, the processing module is configured to stop processing the second message based on the first port being in the non-master state and the second condition.
[0192] In a possible implementation, the second condition comprises that the port state of the second port is the listening state, the former master state, the uncalibrated state, the backup state or the slave state.
[0193] In a possible implementation, the first message carries the port state of the second port.
[0194] It should be understood that the above Figure 11 or Figure 12 The apparatus provided in the present application is only exemplified by the above division of functional modules when realizing its functions, and in actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0195] Referring to Figure 13 , Figure 13 A structural schematic diagram of a network device 2000 provided in an example embodiment of the present application is shown. Figure 13 The network device 2000 shown is used to perform the operations involved in the message processing method shown in the above Figure 7 or Figure 10 The network device 2000 is, for example, a switch, a router, etc., and the network device 2000 can be implemented by a general bus architecture.
[0196] As shown in Figure 13 , the network device 2000 includes at least one processor 2001, a memory 2003 and at least one communication interface 2004.
[0197] The processor 2001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processer (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits used to implement a design described in the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, transistor logic, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logical blocks, modules, and circuits described in combination with the disclosure of the embodiments of the present application. The processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0198] Optionally, the network device 2000 also includes a bus. The bus is used to transmit information between the components of the network device 2000. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 13 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0199] Memory 2003 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 2003 may exist independently and be connected to processor 2001 via a bus. Memory 2003 may also be integrated with processor 2001.
[0200] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN). The communication interface 2004 can include wired and wireless communication interfaces. Specifically, the communication interface 2004 can be an Ethernet interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network communication interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In this embodiment, the communication interface 2004 can be used by the network device 2000 to communicate with other devices.
[0201] In a specific implementation, as one example, the processor 2001 may include one or more CPUs, such as... Figure 13 The CPU0 and CPU1 shown are examples of processors. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0202] In particular implementations, as one example, network device 2000 can include multiple processors, such as processor 2001 and processor 2005, as shown in FIG. 20. Each of these processors can be a single-CPU or a multi-CPU. A processor here can refer to one or more devices, circuits, and / or processing cores for processing data, such as computer program instructions. Figure 13
[0203] In particular implementations, as one example, network device 2000 can also include an output device and an input device. The output device is in communication with the processor 2001 and can present information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like. The input device is in communication with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
[0204] In some embodiments, the memory 2003 is used to store program code 2010 for implementing the solutions of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the packet processing method provided by the method embodiments through the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 can include one or more software modules. Alternatively, the processor 2001 itself can also store program codes or instructions for implementing the solutions of the present application.
[0205] In particular embodiments, the network device 2000 of the embodiments of the present application can correspond to the first network device in the above-mentioned various method embodiments, and the processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 can perform all or part of the operations performed by the first network device. Figure 13 The network device 2000 shown in FIG. 20 can perform all or part of the operations performed by the first network device.
[0206] In particular embodiments, the network device 2000 of the embodiments of the present application can correspond to the second network device in the above-mentioned various method embodiments, and the processor 2001 in the network device 2000 reads the instructions in the memory 2003, so that the network device 2000 can perform all or part of the operations performed by the second network device. Figure 13 The network device 2000 shown in FIG. 20 can perform all or part of the operations performed by the second network device.
[0207] The network device 2000 can also correspond to the apparatus shown in Figure 11-12 each functional module in the apparatus shown in Figure 11-12 is implemented by software of the network device 2000. In other words, Figure 11-12 The functional modules included in the apparatus shown in
[0208] wherein, Figure 7 and Figure 10 The steps of the packet processing method shown in
[0209] Referring to Figure 14 , Figure 14 shows a structural schematic diagram of a network device 2100 provided by another exemplary embodiment of the present application Figure 14 The network device 2100 shown in Figure 7 and Figure 10 is used to perform all or part of the operations involved in the packet processing method shown in
[0210] As shown in Figure 14 The network device 2100 includes a main control board 2110 and an interface board 2130.
[0211] The main control board is also called a main processing unit (MPU) or a route processor card. The main control board 2110 is used to control and manage various components in the network device 2100, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes a central processing unit 2111 and a memory 2112.
[0212] The interface board 2130 is also called a line processing unit (LPU), a line card, or a service board. The interface board 2130 is configured to provide various service interfaces and implement forwarding of data packets. The service interfaces include, but are not limited to, an Ethernet interface, a POS (Packet over SONET / SDH) interface, and the like, and the Ethernet interface is, for example, a Flexible Ethernet Client (FlexE Client). The interface board 2130 includes a central processor 2131, a network processor 2132, a forwarding table entry storage 2134, and a physical interface card (PIC) 2133.
[0213] The central processor 2131 on the interface board 2130 is configured to control and manage the interface board 2130 and communicate with the central processor 2111 on the master board 2110.
[0214] The network processor 2132 is configured to implement forwarding processing of a packet. The network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is configured to forward a received packet based on a forwarding table stored in the forwarding table entry storage 2134, and if a destination address of the packet is an address of the network device 2100, the packet is sent to a CPU (such as the central processor 2131) for processing; if the destination address of the packet is not the address of the network device 2100, the next hop and an out interface corresponding to the destination address are found from the forwarding table according to the destination address, and the packet is forwarded to the out interface corresponding to the destination address. The processing of an uplink packet can include processing of an in interface of the packet and forwarding table lookup, and the processing of a downlink packet can include forwarding table lookup, and the like. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the interface board does not need a forwarding chip.
[0215] The physical interface card 2133 is used to implement the interfacing function of the physical layer, and the original traffic enters the interface board 2130 through the physical interface card 2133, and the processed packet is sent out from the physical interface card 2133. The physical interface card 2133 is also called a daughter card, which can be installed on the interface board 2130 and is responsible for converting the optical and electrical signals into packets and forwarding the packets to the network processor 2132 for processing after the packets are checked for legitimacy. In some embodiments, the central processor 2131 can also perform the functions of the network processor 2132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 2132 is not needed in the physical interface card 2133.
[0216] Optionally, the network device 2100 includes multiple interface boards, for example, the network device 2100 further includes an interface board 2140, which includes a central processor 2141, a network processor 2142, a forwarding table item storage 2144, and a physical interface card 2143. The functions and implementation manners of the components in the interface board 2140 are the same as or similar to those of the interface board 2130, and are not described here again.
[0217] Optionally, the network device 2100 further includes a switching network board 2120. The switching network board 2120 can also be called a switch fabric unit (SFU). In the case where the network device has multiple interface boards, the switching network board 2120 is used to complete the data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 can communicate through the switching network board 2120.
[0218] The main control board 2110 is coupled with the interface boards. For example, the main control board 2110, the interface board 2130, and the interface board 2140, and the switching network board 2120 are connected through a system bus and a system backboard to realize intercommunication. In a possible implementation manner, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface board 2130 and the interface board 2140, and the main control board 2110 and the interface board 2130 and the interface board 2140 communicate through the IPC channel.
[0219] Logically, network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111, while the forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as router operation, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining the status of network devices. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables distributed by the control plane. The forwarding tables distributed by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.
[0220] It's worth noting that a network device may have one or more main control boards, including a primary and a backup main control board. It may also have one or more interface boards; the more powerful the network device's data processing capabilities, the more interface boards it provides. Each interface board may also have one or more physical interface cards. A switching board may or may not exist; multiple boards can share the load and provide redundancy. In a centralized forwarding architecture, the network device may not need a switching board, as the interface boards handle the entire system's business data processing. In a distributed forwarding architecture, the network device can have at least one switching board, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a distributed architecture network device are greater than those of a centralized architecture network device. Alternatively, the network device can also be a single board, without a switching board. The functions of the interface board and the main control board are integrated on this one board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU to perform the combined functions. This type of network device has lower data exchange and processing capabilities (e.g., low-end switches or routers). The specific architecture adopted depends on the specific network deployment scenario, and no restrictions are imposed here.
[0221] In a specific embodiment, network device 2100 corresponds to the above. Figure 11 The illustrated message processing apparatus is applied to a first network device. In some embodiments, Figure 11 The receiving module 1101 in the message processing device shown is equivalent to the physical interface card 2133 in the network device 2100. Figure 11 The processing module 1102 in the message processing device shown is equivalent to the central processing unit 2111 or network processor 2132 in the network device 2100.
[0222] In some embodiments, the network device 2100 also corresponds to the above.Figure 12 The message processing apparatus shown in FIG. 12 is applied to the second network device. In some embodiments, Figure 12 The sending module 1201 and the receiving module 1202 in the message processing apparatus shown in FIG. 12 are equivalent to the physical interface card 2133 in the network device 2100. Figure 12 The processing module 1203 in the message processing apparatus shown in FIG. 12 is equivalent to the central processor 2111 or the network processor 2132 in the network device 2100.
[0223] Based on the above Figure 13 And Figure 14 The network device shown in FIG. 2 or Figure 13 The network device 2100 shown in FIG. 21, the second network device is Figure 14 The network device 2000 shown in FIG. 2 or Figure 13 The network device 2100 shown in FIG. 21. Figure 14 The network device 2000 shown in FIG. 2 or
[0224] The method performed by the first network device and the second network device can refer to the related description of the above Figure 7 And Figure 10 The embodiments shown in FIG. 2, which will not be repeated here.
[0225] It should be understood that the above processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It should be noted that the processor can be a processor supporting advanced RISC machines (ARM) architecture.
[0226] Further, in an optional embodiment, the above-mentioned memory can include read-only memory and random access memory, and provide instructions and data for the processor. The memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0227] The memory can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used. For example, a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate synchronous DRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synchlink DRAM (SLDRAM), and a direct Rambus RAM (DR RAM) can be used.
[0228] A computer readable storage medium is also provided, and the storage medium stores at least one instruction, which is loaded and executed by a processor to implement the packet processing method according to any one of the above.
[0229] The present application provides a computer program, when the computer program is executed by a computer, can make the processor or computer execute the corresponding steps and / or processes in the above method embodiments.
[0230] A chip is provided, including a processor, configured to call and run instructions stored in a memory, so that a communication device installed with the chip executes the method in the above aspects.
[0231] Another chip is provided, including an input interface, an output interface, a processor and a memory, the input interface, the output interface, the processor and the memory are connected through internal connection paths, the processor is configured to execute code in the memory, when the code is executed, the processor is configured to execute the method in the above aspects.
[0232] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the present application are generated. 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 one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk) and the like.
[0233] The above detailed description of the specific embodiments is further detailed to the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application shall be included in the protection scope of the present application.
[0234] Those of ordinary skill in the art can realize that, in combination with the method steps and modules described in the embodiments disclosed herein, the embodiments can be implemented by software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of the embodiments have been described in the above description. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solutions. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0235] Those of ordinary skill in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or by programs instructing related hardware, which can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0236] When implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media include both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media can be any available media that can be accessed by a general purpose or special purpose computing device. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code means in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computing device, or a general-purpose or special-purpose computing device. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, or twisted pair, then the coaxial cable, fiber optic cable, or twisted pair are included in the definition of medium. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), and Blu-Ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0237] In one embodiment, the techniques can be embodied in computer-usable form in one or more computer program products, containing computer readable program instructions embodied in media. The media can be, for example, a hard disk, a CD, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), electronically erasable programmable read-only memory (EEPROM), flash memory, a portable storage media, or a memory chip. The program instructions can be in a machine-readable format, such as one or more of hexadecimal, C, assembly language, markup language, or the like. The program instructions can be any set of instructions, memory states or data that controls operation of a processor, or a special-purpose computer, or a special-purpose computer system, and / or any set of instructions, memory states or data that influences a processor, or a special-purpose computer, or a special-purpose computer system to perform a desired operation.
[0238] In the context of the present embodiments, the computer program code or associated data can be embodied in any suitable carrier, including a signal, a computer readable medium, or the like.
[0239] Examples of a signal can include, but are not limited to, electronic, electromagnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof.
[0240] A machine-readable medium can be any tangible medium that includes or stores a program of instructions for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium include, but are not limited to, the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0241] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and module can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0242] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the module is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, devices or modules, and can also be electrical, mechanical or other form of connection.
[0243] The module described as a separate component can or can not be physically separated, and the component displayed as a module can or can not be a physical module, that is, it can be located in one place, or can be distributed to a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0244] In addition, the functional modules in each embodiment of the present application can be integrated in one processing module, or each module can exist physically, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.
[0245] When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or say the part of the prior art that contributes to the technical solutions, or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0246] The terms "first", "second", etc. are used to distinguish between similar items or items having substantially the same function, and it should be understood that there is no logical or chronological dependency between "first", "second", "n-th", and that the number and execution order are not limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various described examples, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. The first image and the second image can both be images, and in some cases, can be separate and distinct images.
[0247] It should also be understood that the size of the serial number of various processes in various embodiments of the present application does not mean the order of execution, and the execution order of various processes should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0248] The term "at least one" in the present application means one or more, and the term "multiple" in the present application means two or more, for example, multiple second packets means two or more second packets. The terms "system" and "network" are often used interchangeably in this document.
[0249] It should be understood that the terms used in the description of various described examples herein are only for the purpose of describing specific examples, and are not intended to be limiting. As used in the description of various described examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0250] It should also be understood that the term "comprise" (also "comprises", "comprising", "includes" and / or "including") when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0251] It should also be understood that the terms "if" and "when" can be interpreted to mean "when" or "upon" or "in response to a determination" or "in response to detecting". Similarly, the phrase "if determined" or "if detected [a stated condition or event]" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]", depending on the context.
[0252] It should be understood that determining B from A does not mean that B is determined only from A, but also B can be determined from A and / or other information.
[0253] It should also be understood that, throughout this specification, "an embodiment", "one embodiment", "a possible implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the application. Therefore, appearances of the phrases "in one embodiment" or "in an embodiment" or "a possible implementation" in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0254] The above description is merely optional embodiments of the present application, and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.
Claims
1. A method of processing a packet, the method comprising: The method is applied to a first network device in a one-to-many port communication system; the method comprises: The first network device receives a first message sent by a second port through a first port, the first port is a port of the first network device, the second port is a port of a second network device in the one-to-many port communication system, the first message is used for measuring time delay, and the first message is a point delay request message; Based on a first condition and a port state of the first port being a non-primary state, the first network device stops replying to a second message, the second message comprises a point delay response message and a point delay response follow-up message, and the first condition indicates that the second port is a non-primary state.
2. The method of claim 1, wherein, The port state of the first port being a non-primary state comprises the port state of the first port being a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
3. The method according to claim 1 or 2, characterized in that, The first condition comprises that a clock identifier in the first message is inconsistent with a clock identifier of a primary node.
4. The method according to claim 1 or 2, characterized in that, The first condition comprises that a source media access control (MAC) address in the first message is inconsistent with a MAC address of a primary node.
5. The method according to claim 1 or 2, characterized in that, The first condition comprises that a source Internet protocol (IP) address in the first message is inconsistent with an IP address of a primary node.
6. The method of claim 1 or 2, wherein, The first message carries a port state of the second port, and the first condition comprises that the port state of the second port carried by the first message is a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
7. A packet processing device, characterized by, The device is applied to a first network device in a one-to-many port communication system; the device comprises: The receiving module is configured to receive a first message sent by a second port through a first port, the first port is a port of the first network device, the second port is a port of a second network device in the one-to-many port communication system, the first message is used for measuring time delay, and the first message is a point delay request message; The processing module is configured to stop replying to a second message based on a first condition and a port state of the first port being a non-primary state, the second message comprises a point delay response message and a point delay response follow-up message, and the first condition indicates that the second port is a non-primary state.
8. The apparatus of claim 7, wherein, The port state of the first port being a non-primary state comprises the port state of the first port being a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
9. The apparatus of claim 7 or 8, wherein, The first condition comprises that a clock identifier in the first message is inconsistent with a clock identifier of a primary node.
10. The apparatus of claim 7 or 8, wherein, The first condition comprises that a source media access control (MAC) address in the first message is inconsistent with a MAC address of a primary node.
11. The apparatus of claim 7 or 8, wherein, The first condition comprises that a source Internet protocol (IP) address in the first message is inconsistent with an IP address of a primary node.
12. The apparatus of claim 7 or 8, wherein, The first message carries a port state of the second port, and the first condition comprises that the port state of the second port carried by the first message is a listening state, a former primary state, an uncalibrated state, a backup state or a slave state.
13. A network device, comprising: The network device comprises: A memory and a processor, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to enable the network device to implement the packet processing method of any of claims 1-6.
14. A packet processing system, characterized by The system comprises a first network device and a second network device, the first network device being configured to implement the packet processing method of any of claims 1-6.
15. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, the instruction being loaded and executed by the processor to implement the packet processing method of any of claims 1-6.
Citation Information
Patent Citations
Unicast-based time synchronization realization method and apparatus, and network equipment
CN106301645A