Auto-negotiation method, communication device and communication equipment
Through a self-negotiation method, Ethernet devices are allowed to be connected in the order of any line pair and network cable crimping, solving the strict requirements for the wiring method in the prior art during the self-negotiation process, and achieving higher flexibility and lower complexity.
Patent Information
- Application Number
- CN202311638481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
During the self-negotiation process, existing Ethernet devices need to strictly follow the standard wiring method. Otherwise, the automatic crossover function cannot correctly switch the port that sends fast link pulse signals, resulting in the failure of the self-negotiation information interaction.
Through a self-negotiation method, the Ethernet device is allowed to connect in any line pair sequence and network cable crimp sequence, and the target port is determined by judging the number of ports of the received link pulse signals, thereby realizing automatic cross-negotiation.
It improves the flexibility and freedom of wired connections of Ethernet devices, reduces the complexity of wired connections, and ensures the successful completion of the self-negotiation process.
Smart Images

Figure CN120075333A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to an auto-negotiation method, a communication device, and a communication equipment. Background Art
[0002] During the process from power-on to normal data transmission of an Ethernet twisted pair cable (hereinafter referred to as network cable), it is necessary to execute the auto-negotiation process specified by the standard, so that the two network devices on both sides negotiate information such as master / slave relationship, rate, and working mode.
[0003] The automatic crossover function in the standard auto-negotiation enables the ports of the two Ethernet devices on both sides to successfully perform auto-negotiation according to the wiring method shown as Figure 1 (A port is cross-connected to B' port, and / or, C port is cross-connected to D' port). If other wiring methods are adopted, such as A port is cross-connected to D' port, or B port is cross-connected to C' port, etc., the automatic crossover function of the network device cannot correctly and orderly switch the port for sending Fast Link Pulse (FLP) signals, resulting in the failure of auto-negotiation information interaction.
[0004] In view of this, a solution for supporting the crimping of Ethernet in any pair order is urgently needed. Summary of the Invention
[0005] This application provides an auto-negotiation method, a communication device, and a communication equipment, which are used to improve the flexibility of the wired connection between Ethernet devices.
[0006] In a first aspect, the present application provides a self-negotiation method. In the self-negotiation method provided by the present application, both Ethernet devices at both ends need to have entered the self-negotiation state, and both Ethernet devices at both ends have the automatic crossover function. One of the Ethernet devices (referred to as the local device) first confirms that the peer device has successfully entered the self-negotiation state, and then all ports of the local device need to enter the signal reception state. During the signal reception state of each port of the Ethernet device, link pulse signals are received, and the transmission of link pulse signals is prohibited. Among them, the link pulse signals in the present application include Fast Link Pulse (FLP) signals or Normal Link Pulse (NLP) signals. Therefore, the self-negotiation method in the present application is applicable to the self-negotiation process implemented based on FLP signal interaction and also applicable to the self-negotiation process implemented based on NLP signal interaction. The other Ethernet device (referred to as the peer device) needs to enter the standard ability detect stage. When the peer device is in the ability detection state, two of its ports are selected. At the same moment, link pulse signals are sent from one port, and the other port only receives link pulse signals without sending link pulse signals. Therefore, the link pulse signals sent by the peer device will be received by one of the ports of the local device. Since all ports of the local device are prohibited from sending signals, the peer device will not receive link pulse signals from the local device, which causes the peer device to trigger the automatic crossover function, so that the port that previously sent link pulse signals is used to receive link pulse signals, and the port that previously received link pulse signals is used to send link pulse signals. The switching of the transceiver ports of the peer device enables another port of the local device to receive link pulse signals. Thus, it can be seen that two different ports of the local device receive link pulse signals from the peer device at different times, indicating that these two ports are connected to the ports of the peer device currently used for automatic crossover negotiation. Therefore, the local device determines the two ports that receive link pulse signals at two different times as the target ports, and the local device performs the automatic crossover function during self-negotiation with the peer device based on these two target ports.
[0007] The target ports defined in this application refer to two ports in an Ethernet device that are used to perform the auto - crossover function in the auto - negotiation process. At the same time, one target port is used to send link pulse signals, and the other target port only receives link pulse signals without sending. In this application, the two interconnected Ethernet devices determine the target ports in different ways. For the local device, the two ports that receive link pulse signals at two different times are selected as the target ports in the local device; for the peer device, the two ports used to perform auto - crossover are actively selected as the target ports in the peer device. In practical applications, the peer device can select the port with a higher priority as the target port according to the port priority.
[0008] In this application, in the case where two Ethernet devices are connected in any wiring order, any network cable crimping order, or any interface mode, the ports used for auto - crossover negotiation can be accurately and clearly determined between the two Ethernet devices, enabling the two Ethernet devices to complete auto - negotiation, thereby improving the flexibility and freedom of the wired connection of Ethernet devices and reducing the complexity of the wired connection.
[0009] It should be understood that in this application, the Ethernet device is used as the execution entity of this auto - negotiation method to illustrate the method, but this application does not limit the execution entity of the auto - negotiation method. For example, the Ethernet device mentioned in this application can also be a chip, a chip system, or a processor that supports the Ethernet device to implement this method, or can also be a logical node, a logical module, or software that can implement all or part of the test of the Ethernet device.
[0010] Based on the first aspect, in an optional implementation, a target signal is defined. The Ethernet device chooses to enter the signal reception state or the capability detection state by determining whether it receives the target signal. If the local device does not receive the target signal from the peer device, the local device sends the target signal to the peer device and then enters the signal reception state.
[0011] Based on the first aspect, in an optional implementation, a target signal is defined. The Ethernet device chooses to enter the signal reception state or the capability detection state by determining whether it receives the target signal. If the local device receives the target signal from the peer device, the local device jumps out of the port detection process, enters the standard capability detection state, and actively selects the two ports used to perform the auto - crossover function, that is, the target ports in this application. The target ports defined in this application refer to two ports in an Ethernet device that are used to perform the auto - crossover function in the auto - negotiation process, where, at the same time, one target port is used to send link pulse signals and the other target port is used to receive link pulse signals.
[0012] The target signal is a special signal type defined in this application, which is different from the existing signal types in standard auto-negotiation. Exemplarily, in practical applications, the target signal can be a signal defined by a special coding format, or the target signal can be a signal carrying a special identifier or special field, or the target signal can be multiple signals sent by multiple ports in an Ethernet device at the same time. In the auto-negotiation method of this application, if an Ethernet device receives multiple signals at the same time on multiple ports, the Ethernet device can determine that it has received the target signal. Or, the target signal can also be other signal types, and this application does not limit this.
[0013] Based on the first aspect, in an optional implementation, the target signal can be multiple link pulse signals sent by different ports at the same time. Exemplarily, the target signal can include multiple link pulse signals sent by 2, 3, or 4 ports at the same time. Specifically, because in the existing standard auto-negotiation process, an Ethernet device only sends link pulse signals through one port at a time. Therefore, multiple link pulse signals sent by an Ethernet device through multiple ports at the same time are the target signal. If an Ethernet device receives link pulse signals (such as FLP signals) on multiple ports at the same time, the Ethernet device can determine that it has received the target signal; if an Ethernet device only receives link pulse signals (such as FLP signals) on one port at a time, the Ethernet device can determine that it has received a standard link pulse signal and has not received the target signal. By controlling the number of ports sending link pulse signals at the same time, there is no need to redefine the coding format of the target signal, which improves the efficiency of the Ethernet device sending the target signal. In addition, since the Ethernet device identifies the target signal based on the number of ports of the received link pulse signals rather than specific bit information, the Ethernet device does not need to sense the link code word (LCW) in the target signal, and thus does not need to parse and recover the link code word of the target signal, thereby improving the efficiency of the Ethernet device receiving and identifying the target signal.
[0014] Based on the first aspect, in an optional implementation, if an energy signal is received from the peer device, it is confirmed that the peer device has entered the auto-negotiation state. The energy signal is a signal used to indicate that an Ethernet device has entered the auto-negotiation state, and the present application does not limit the signal type of the energy signal. Exemplarily, in practical applications, the energy signal can be a signal defined by a special coding format, or the energy signal can be a signal carrying a certain special identifier or special field, or the energy signal can be a link pulse signal (FLP signal or NLP signal) in the standard, or the energy signal can also be other signal types, and the present application does not limit this. For example, when the peer device is in the energy detection state, it will send a link pulse signal (FLP signal or NLP signal) to the local device. After the local device receives the link pulse signal, it can confirm that the peer device has entered the auto-negotiation state.
[0015] Based on the first aspect, in an optional implementation, the local device can send an energy signal to the peer device. Among them, the local device can select any port to send the energy signal, and the present application does not limit this. Among them, if the peer device also executes the auto-negotiation logic provided by the present application, that is, the peer device enters the auto-negotiation state and jumps out of the Transmit Disable state, it will also wait to receive the energy signal from the local device. At this time, the energy signal sent by the local device can enable the peer device to sense that the local device has entered the auto-negotiation state; if the peer device does not execute the auto-negotiation logic provided by the present application, that is, the peer device executes the auto-negotiation process of the existing standard, then the peer device starts auto-negotiation and enters the ability detection state after jumping out of the Transmit Disable state. At this time, the energy signal sent by the peer device to the local device in the ability detection state can be used for the local device to determine that the peer device has entered the auto-negotiation state.
[0016] Based on the first aspect, in an optional implementation, if a pair of twisted pairs in the network cable fails, and the signal sent by the local device to the peer device happens to pass through this pair of faulty lines, the peer device cannot receive the link pulse signal and cannot sense whether the local device has entered the auto-negotiation state. Therefore, the local device can send energy signals to the peer device in multiple ports in turn, and the peer device can receive the energy signals through multiple ports, reducing the impact of network cable pair faults on the auto-negotiation process.
[0017] Based on the first aspect, in an optional implementation, after the local device sends an energy signal to the peer device, during the duration of the energy signal (i.e., the sum of the pulse width of the energy signal and the round-trip link transmission time of the energy signal), it is impossible to accurately determine whether the energy signal received by the local device comes from the peer device, thus affecting the accuracy of the local device to identify that the peer device enters the auto-negotiation state. Therefore, the local device can use only the energy signals received during the energy detection period as the energy signals from the peer device to determine that the peer device has entered the auto-negotiation state, thereby improving the accuracy of confirming that the peer device enters the auto-negotiation state. Herein, the energy detection period is the time period outside the duration of the energy signal sent by the local device.
[0018] Based on the first aspect, in an optional implementation, since the local device only identifies whether the peer device enters the auto-negotiation state during the energy detection period, if both Ethernet devices enter the auto-negotiation state but the time difference between sending energy signals is less than the energy detection period, the local device will not be able to sense whether the peer device has entered the auto-negotiation state. In this regard, if the local device does not receive an energy signal from the peer device during the energy detection period (before the energy detection timer ends), it randomly updates the start time point of the energy detection period, thereby changing the time difference between the local device and the peer device in sending energy signals and improving the accuracy of the local device to identify that the peer device enters the auto-negotiation state. Specifically, the local device can configure another random timer (back_off_timer), and the random timer is used to determine a random duration. When the energy detection timer ends, if the local device does not receive an energy signal from the peer device, it triggers the random timer. When the random duration defined by the random timer ends, it restarts the energy detection timer, waits to receive an energy signal from the peer device, and sends an energy signal to the peer device, and this is executed in a loop until it receives an energy signal from the peer device and confirms that the peer device has entered the auto-negotiation state.
[0019] Based on the first aspect, in an alternative embodiment, the target signal includes a plurality of link pulse signals sent by different ports at the same moment. In this scenario, if the number of ports of the Ethernet device that receive link pulse signals at the same moment is multiple, then the Ethernet device confirms that the target signal is received. If a pair of twisted pairs of the network cable fails, resulting in at most one port of each of the Ethernet devices at both ends receiving link pulse signals, then the Ethernet devices at both ends will enter the signal receiving state. In other words, all ports of the Ethernet devices at both ends are only used to wait for receiving link pulse signals and will not send link pulse signals. Thus, all ports of the Ethernet devices at both ends are only used to wait for receiving link pulse signals and will not send link pulse signals. Therefore, after entering the signal receiving state, when the Ethernet device does not receive a link pulse signal from the peer device within a preset duration, it can be determined that there is a failure in the wired pair between the Ethernet device and the peer device.
[0020] Based on the first aspect, in an alternative embodiment, since it has been determined that a link failure has occurred and auto-negotiation cannot be performed, the Ethernet devices at both ends can choose to exit the auto-negotiation state. Furthermore, they can choose to perform PMA training and communication on the only remaining intact link.
[0021] In a second aspect, the present application provides a communication device, which is characterized by including:
[0022] A determination unit, configured to determine that the peer device enters the auto-negotiation state in the auto-negotiation state;
[0023] A processing unit, configured to enter the signal receiving state on all ports, and each port prohibits sending link pulse signals during the signal receiving state, where the link pulse signals include fast link pulse signals FLP or normal link pulse signals NLP;
[0024] The determination unit is further configured to determine two ports as target ports when link pulse signals from the peer device are received through two ports at two different moments, and the target ports are used for automatic crossover with the peer device.
[0025] Based on the second aspect, in an alternative embodiment, the processing unit is specifically configured to:
[0026] When the target signal from the peer device is not received, send the target signal to the peer device and enter the signal receiving state on all ports.
[0027] Based on the second aspect, in an alternative embodiment, the determination unit is further configured to determine two ports as target ports for automatic crossover when the target signal from the peer device is received.
[0028] Based on the second aspect, in an alternative embodiment, the target signal is a plurality of link pulse signals sent by different ports at the same time.
[0029] Based on the second aspect, in an alternative embodiment, the determining unit is further configured to:
[0030] When link pulse signals from the peer device are received on multiple ports at the same time, determine that the target signal from the peer device is received.
[0031] Based on the second aspect, in an alternative embodiment, the determining unit is specifically configured to:
[0032] Receive an energy signal from the peer device;
[0033] Determine that the peer device enters the auto-negotiation state according to the energy signal from the peer device.
[0034] Based on the second aspect, in an alternative embodiment, the processing unit is further configured to:
[0035] Send an energy signal to the peer device.
[0036] Based on the second aspect, in an alternative embodiment, the processing unit is specifically configured to:
[0037] Send energy signals to the peer device through multiple ports in turn.
[0038] Based on the second aspect, in an alternative embodiment, the determining unit is specifically configured to:
[0039] Determine that the link pulse signals received during the energy detection period are link pulse signals from the peer device, and the energy detection period is a time period outside the duration of the link pulse signals sent by the local device.
[0040] Based on the second aspect, in an alternative embodiment, the processing unit is further configured to update the start time point of the energy detection period when no link pulse signal from the peer device is received during the energy detection period.
[0041] Based on the second aspect, in an alternative embodiment, the processing unit is further configured to perform automatic crossover negotiation with the peer device through two target ports.
[0042] Based on the second aspect, in an alternative embodiment, the processing unit is further configured to determine that there is a fault in the network cable pair between the local device and the peer device when no link pulse signal from the peer device is received within a preset duration.
[0043] Based on the second aspect, in an alternative embodiment, the processing unit is further configured to:
[0044] Exit the auto-negotiation state.
[0045] The content such as the information interaction and execution process of the embodiments shown in this aspect is based on the same concept as the embodiments shown in the first aspect. Therefore, for the description of the beneficial effects shown in this aspect, please refer to the above-mentioned first aspect for details, and will not be elaborated here specifically.
[0046] In a third aspect, an embodiment of the present application provides a communication device, including: a processor, which is coupled to a memory, and the memory is used to store instructions. When the instructions are executed by the processor, the communication device implements the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0049] In a sixth aspect, an embodiment of the present application provides a chip, including: a processor, which is coupled to a memory, and the memory is used to store instructions. When the instructions are executed by the processor, the chip implements the method in the above-mentioned first aspect and any possible implementation manner of the first aspect. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0051] Figure 1 Schematic diagram of the crossover mode of standard Ethernet wire pairs;
[0052] Figure 2 Schematic diagram of the structure of the FLP signal;
[0053] Figure 3 Schematic diagram of the structure of the NLP signal;
[0054] Figure 4 Standard schematic diagram of crimping network cables for RJ45 interfaces;
[0055] Figure 5Schematic diagram of a non-standard network cable crimping method;
[0056] Figure 6 Schematic diagram of the scenario to which the auto-negotiation method in the embodiments of the present application is applied;
[0057] Figure 7 Schematic flowchart of an auto-negotiation method in the embodiments of the present application;
[0058] Figure 8 Schematic diagram of the auto-negotiation logic provided in the embodiments of the present application;
[0059] Figure 9 Schematic diagram of a process for an Ethernet device to perform port detection in the embodiments of the present application;
[0060] Figure 10 Another schematic diagram of a process for an Ethernet device to perform port detection in the embodiments of the present application;
[0061] Figure 11 Schematic diagram of a structure of a communication device provided in the embodiments of the present application;
[0062] Figure 12 Schematic diagram of a logical structure of a communication device provided in the embodiments of the present application. Detailed implementation manners
[0063] The embodiments of the present application provide an auto-negotiation method, a communication device, and a communication equipment, which are used to improve the flexibility of the wired connection between Ethernet devices.
[0064] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, rather than to limit the embodiments of the present application. Those of ordinary skill in the art know that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0065] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or multiple.
[0066] The terms "first", "second", "third", "fourth", etc. (if any) in the description, claims and the above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application described here, for example, can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0067] Some nouns or terms used in the embodiments of this application are explained below, and these nouns or terms are also part of the invention content.
[0068] Auto-negotiation: The main function of auto-negotiation is that the devices at both ends of the shared link automatically select and configure working parameters through information interaction, so that the transmission capacity reaches the maximum value that both devices can support. The basic mechanism for realizing auto-negotiation is to encapsulate information (such as master / slave relationship, duplex mode, operating rate, and flow control information) in FastLink Pulse (FLP) signals or Normal Link Pulse (NLP) signals for transmission. Please refer to Figure 2 , Figure 2 for the structural schematic diagram of the FLP signal. As Figure 2 shown, the FLP signal includes 33 pulses. Among the 33 pulses, there are 17 clock pulses and 16 data pulses, and the clock pulses and data pulses are alternately arranged. When a data pulse appears, it represents logic 1; when a data pulse is missing, it represents logic 0. In order to maintain interoperability with existing Ethernet devices, the auto-negotiation function also supports using the NLP signal compliant with the 10BASE-T standard as shown in Figure 3 to replace the FLP signal for interaction.
[0069] FLP Signal: A device with auto-negotiation function can send and receive FLP signals. The data pulses in the FLP signal are encoded into a 16-bit (bit) Link Code Word (LCW), which is divided into a basic page and an additional page. The code word length of the basic page is 16 bits, and each bit has a corresponding standard definition, that is, constant coding. The additional page can be a pre-defined code (message page) or a custom code. After the device starts the auto-negotiation function, it enters the disabled transmission stage. After the link interruption timer in the device ends, the device enters the capability detection state and sends a 16-bit basic page message (where the "Ack" bit is 0). If the subsequent received 16-bit basic page information, except for the "Ack" bit, the other 15 bits are the same for 3 consecutive times, the device exits the capability detection state, enters the confirmation detection state, and sets the Ack bit to 1. If the 16-bit basic page received 3 consecutive times is exactly the same and is the same as the other 15 bits in the capability detection state except for the Ack bit, it exits the confirmation detection state and starts to send the additional page.
[0070] Network Cable: A network cable is a combined cable. According to different network standards, it is divided into Category 5 network cable, Category 5e network cable, Category 6 network cable, Category 6a network cable, Category 7 network cable, and Category 8 network cable. To achieve a communication rate of 1G or above, a network cable with 4 pairs of twisted pairs is usually required. Every two wires are twisted together to form 1 pair of twisted pairs, and each pair of twisted pairs serves as a data transmission channel.
[0071] Next, the scenarios involved in the embodiments of the present application will be introduced.
[0072] In the 10BASE-T technology and 100BASE-TX technology of Ethernet, only two pairs of twisted pair cables are required to operate. That is, only two pairs of pins in the 45th standard interface (RJ45 interface) of the standard socket interface (Registered Jack) are used: pins1 and pins2 are used to send signals, and pins3 and pins6 are used to receive signals. In the half-duplex communication mode, sending and receiving are carried out separately on the two pairs of wires, so it is necessary to stagger the sending and receiving pins. Specifically, please refer to Figure 4 , Figure 4 which is the standard schematic diagram of the crimped network cable for the RJ45 interface. As Figure 4As shown, in the standards for crimping network cables of RJ45 interfaces, there are usually two methods: Type A (EIA / TIA 568A) and Type B (EIA / TIA 568B). According to whether the wiring methods of the RJ45 connectors at both ends of the network cable are the same, the network cables crimped by Ethernet devices can be divided into straight-through cables and cross-over cables. Among them, those with the same wiring method at both ends of the network cable (for example, both ends adopt the EIA / TIA 568A standard or both ends adopt the EIA / TIA 568B standard) belong to straight-through cables, while those with different wiring methods at both ends of the network cable (for example, one end adopts the EIA / TIA 568A standard and the other end adopts the EIA / TIA 568B standard) belong to cross-over cables.
[0073] Currently, for high-speed Ethernet twisted pairs (such as 1 Gigabit per second), the full-duplex communication mode is mainly adopted. In the full-duplex communication mode, each pair of pins has both receiving and transmitting functions. Therefore, the full-duplex communication mode is not affected by the wiring sequence of the network cable. However, during the process from power-on to normal data transmission of Ethernet twisted pairs (hereinafter referred to as network cables), there are mainly three processes: 1. Configuring information such as master / slave relationship, rate, and working mode, which can be specifically achieved through manual configuration or enabling the auto-negotiation function for information interaction. Auto-negotiation does not require manual participation and is more flexible and efficient; 2. Physical Medium Attachment (PMA) training to achieve pre-convergence of parameters such as Digital Signal Processing (DSP), thereby further improving the success rate of link communication; 3. Normal communication, which requires further updating of DSP parameters based on pre-convergence. During the above three processes, high-speed Ethernet twisted pairs (such as 1 Gigabit per second) can achieve the full-duplex communication mode during PMA training and normal communication, and are not affected by the wiring sequence of the network cable. However, when executing the auto-negotiation process, only the half-duplex communication mode can be adopted.
[0074] In the half-duplex communication mode of an Ethernet network, when connecting a medium dependent interface (MDI) device such as a network card or router to a medium dependent interface crossover (MDIX) device such as a hub or switch via an Ethernet twisted pair cable to establish communication, a straight-through cable is required. When connecting an MDI device to another MDI device, or connecting an MDIX device to another MDIX device, a cross-over cable is needed. Network administrators must use different types of cables (straight-through or cross-over) for different devices, which causes inconvenience during the wiring process.
[0075] To eliminate the usage restrictions of straight-through and cross-over cables, an auto-crossover function, i.e., Auto-MDI / MDIX technology, is introduced in the auto-negotiation process of Ethernet. Based on the received link pulse signals within a certain period of time and the output bit condition of the Pseudo-Random Binary Sequence (PRBS) 11, it is determined whether to perform a switch between MDI and MDIX on the device (i.e., a switch between the transmit and receive ports / wire pairs). In this case, either a straight-through cable or a cross-over cable can be used by Ethernet devices to complete the communication connection. Specifically, if an Ethernet device receives a link pulse signal before the sampling timer expires, no transmit / receive port / wire pair switch will be performed during the next sampling timer period; if the Ethernet device does not receive a link pulse signal before the sampling timer expires and the S
[10] bit of PRBS11 is 0, no transmit / receive port / wire pair switch will be performed; if no link pulse signal is received and the S
[10] bit of PRBS11 is 1, a transmit / receive port / wire pair switch will be performed. For example, as Figure 1 shown, originally transmitted from port A and received at port B, it is switched to receive at port A and transmit from port B, or originally transmitted from port C and received at port D, it is switched to receive at port C and transmit from port D.
[0076] The auto-crossover function in standard auto-negotiation enables the ports of two Ethernet devices on both sides to successfully perform auto-negotiation according to the wiring method shown in Figure 1 (port A is cross-connected to port B', and / or, port C is cross-connected to port D'). If the wire pair crossover situation is outside the above range, it will result in auto-negotiation failure. Therefore, when crimping network cables for Ethernet devices, users need to strictly compare with the color spectrum shown in Figure 4 , which requires a high level of professionalism from users and has a low tolerance for operation errors.
[0077] Please refer to Figure 5 , Figure 5 , which is a schematic diagram of a non-standard network cable crimping method. As Figure 5 shown: Port A is connected to Port D’, Port B is connected to Port C’, Port C is connected to Port A’, and Port D is connected to Port B’. It can be seen that in this scenario, the wiring methods of the two end devices are different from Figure 1 . During the automatic crossover process, the two end devices (Device 1 and Device 2) need to first select two of their respective ports for sending and receiving auto-negotiation signals. Suppose Device 1 and Device 2 respectively select to perform auto-negotiation on ports (A, B) and (A’, B’). During a certain period of time, Device 1 sends a signal on Port A and receives a signal on Port B, while Device 2 just sends a signal on Port B’ and receives a signal on Port A’. In Figure 5 the shown wiring method, since Device 1 cannot receive the signal from Device 2 on Port B, Device 1 will perform an automatic crossover, so that Device 1 switches to sending a signal on Port B and receiving a signal on Port A. Similarly, since Device 2 cannot receive the signal from Device 1 on Port A’, Device 2 will perform an automatic crossover, so that Device 2 switches to sending a signal on Port A’ and receiving a signal on Port B’. However, from Figure 5 the shown wiring method, it can be seen that no matter how many times Device 1 and Device 2 cross over, the negotiation between Device 1 and Device 2 cannot succeed, that is, the automatic crossover function of the device cannot be successfully implemented.
[0078] In view of this, the embodiments of the present application provide an auto-negotiation method, a communication device, and a communication device, which are used to improve the flexibility of the wired connection between Ethernet devices. In practical applications, the auto-negotiation method in the embodiments of the present application is used to support the connection and communication between two Ethernet devices in any circuit board routing order, any network cable crimping order, or any interface mode. Please refer to Figure 6 , Figure 6 , which is a schematic diagram of the scenario to which the auto-negotiation method in the embodiments of the present application is applied. In Figure 6 the shown example, the auto-negotiation method in the embodiments of the present application is applicable to the wired connection between a switch and a terminal device, or, applicable to the wired connection between a switch and a switch, or, also applicable to the wired connection between a terminal device and a terminal device.
[0079] The Ethernet device in the embodiments of the present application is a communication device that supports the Ethernet protocol for sending signals, or, receiving signals, or, sending and receiving signals. Exemplarily, the Ethernet device includes a switch, a router, a computer, a printer, a camera, a vehicle to everything (V2X) device, a gateway device, or a bridge device, etc., and the embodiments of the present application do not make any limitations in this regard.
[0080] Next, the auto - negotiation method provided by the embodiments of the present application will be introduced. In the auto - negotiation method provided by the present application, it is required that both ends of the Ethernet devices have entered the auto - negotiation state, and both ends of the Ethernet devices have the automatic crossover function. One of the Ethernet devices (referred to as the local device) first confirms that the peer device has successfully entered the auto - negotiation state, and then all ports of the local device need to enter the signal receiving state. During the signal receiving state of each port of this Ethernet device, link pulse signals are received, and the transmission of link pulse signals is prohibited. Among them, the link pulse signals in the present application include Fast Link Pulse (FLP) signals or Normal Link Pulse (NLP) signals. Therefore, the auto - negotiation method in the present application is applicable to the auto - negotiation process implemented based on FLP signal interaction and also applicable to the auto - negotiation process implemented based on NLP signal interaction. The other Ethernet device (referred to as the peer device) needs to enter the standard ability detect stage. When the peer device is in the ability detect state, two of its ports are selected, and at the same moment, link pulse signals are sent from one port and received at the other port. Therefore, the link pulse signals sent by the peer device will be received by one of the ports of the local device. Since all ports of the local device are prohibited from sending signals, the peer device will not receive link pulse signals from the local device, which causes the peer device to trigger the automatic crossover function, so that the port that previously sent link pulse signals is used to receive link pulse signals, and the port that previously received link pulse signals is used to send link pulse signals. The switching of the sending and receiving ports of the peer device enables another port of the local device to receive link pulse signals. Thus, it can be seen that two different ports of the local device receive link pulse signals from the peer device at different times, indicating that these two ports are connected to the ports of the peer device currently used for performing automatic crossover negotiation. Therefore, the local device determines the two ports that receive link pulse signals at two different times as the target ports, and the local device performs the automatic crossover function during auto - negotiation with the peer device based on these two target ports.
[0081] The target ports defined in this application refer to two ports in an Ethernet device that are used to perform the automatic crossover function in the auto-negotiation process. At the same time, one target port is used to send link pulse signals, and the other target port only receives link pulse signals without sending link pulse signals. In this application, the two interconnected Ethernet devices determine the target ports in different ways. For the local device, select two ports that receive link pulse signals at two different times as the target ports in the local device; for the peer device, actively select two ports used to perform automatic crossover as the target ports in the peer device. In practical applications, the peer device can select the port with a higher priority as the target port according to the port priority.
[0082] In this application, when two Ethernet devices are connected in any wiring order, any network cable crimping order, or any interface mode, the ports used for automatic crossover negotiation can be accurately and clearly determined between the two Ethernet devices, enabling the two Ethernet devices to complete auto-negotiation, thereby improving the flexibility and freedom of the wired connection of Ethernet devices and reducing the complexity of the wired connection.
[0083] It should be understood that in the embodiments of this application, the Ethernet device is used as the execution entity of this auto-negotiation method to illustrate this method, but this application does not limit the execution entity of the auto-negotiation method. For example, the Ethernet device mentioned in the embodiments of this application can also be a chip, a chip system, or a processor that supports the Ethernet device to implement this method, or can also be a logical node, a logical module, or software that can implement all or part of the test of the Ethernet device.
[0084] For the sake of easy understanding, the above auto-negotiation method will be exemplarily described below in conjunction with the accompanying drawings. Please refer to Figure 7 , Figure 7 which is a schematic flowchart of an auto-negotiation method in the embodiments of this application. In the example of Figure 7 , the auto-negotiation method in the embodiments of this application includes but is not limited to steps 101 to 104.
[0085] 101. The local device enters the signal receiving state, and the peer device enters the ability detection state.
[0086] After the two Ethernet devices at both ends enter the auto-negotiation state, one of the Ethernet devices (referred to as the local device) enters the signal receiving state on all its ports. During the signal receiving state of each port of the local device, it is used to receive link pulse signals, and sending link pulse signals is prohibited. And the other Ethernet device (referred to as the peer device) enters the ability detection state in the standard protocol and can normally send link pulse signals. As Figure 7As shown in the figure, the wiring method between the local device and the peer device is as follows: Port A is connected to Port D’, Port B is connected to Port C’, Port C is connected to Port A’, and Port D is connected to Port B’.
[0087] 102. The peer device sends an FLP signal to the local device through one of its ports.
[0088] As can be seen from the above, the link pulse signal in the embodiment of the present application includes an FLP signal or an NLP signal. Therefore, the auto-negotiation method in the embodiment of the present application is applicable to the auto-negotiation process implemented based on the interaction of FLP signals and also applicable to the auto-negotiation process implemented based on the interaction of NLP signals. Here, only the FLP signal is used as the link pulse signal in the embodiment of the present application for exemplary description.
[0089] In the ability detection state, the peer device can only select one of its ports to send an FLP signal at the same time. As Figure 7 shown, the peer device selects to send an FLP signal to the local device through Port A’, and selects Port B’ (which can also be Port C’ or Port D’) to receive the FLP signal from the local device. From Figure 7 this, it can be known that Port A’ of the peer device is connected to Port C of the local device. Therefore, the local device can receive the FLP signal from Port A’ of the peer device on Port C.
[0090] 103. The peer device sends a signal to the local device through another port.
[0091] Since all ports (Port A, Port B, Port C, and Port D) of the local device are prohibited from sending FLP signals, the ports of the peer device will not receive the FLP signal from the local device, resulting in the peer device triggering auto-crossing, that is, sending an FLP signal to the local device through another port. As Figure 7 shown, after the peer device performs auto-crossing, it becomes receiving the FLP signal on Port A’ and sending the FLP signal on Port B’. At this time, since Port B’ of the peer device is connected to Port D of the local device, the local device can receive the FLP signal from Port B’ of the peer device on Port D.
[0092] In practical applications, since the peer device enters the standard ability detection state, the standard auto-crossing logic can be followed to determine whether to switch the sending and receiving ports. For example, when the peer device cannot receive the FLP signal, if the S
[10] bit of PRBS11 is 0, the sending and receiving ports are not switched; if the S
[10] bit of PRBS11 is 1, the sending and receiving ports are switched.
[0093] 104. The local device determines the two ports that receive the FLP signals at two different times as the target ports.
[0094] After the above steps 102 and 103, two different ports (port C and port D) of the local device receive the FLP signals from the peer device at different times respectively, which indicates that these two ports (port C and port D) are connected to the ports (port A' and port B') of the peer device currently used for automatic crossover. Therefore, the local device determines the two ports (port C and port D) that receive the FLP signals at two different times as the target ports, and the local device performs the subsequent automatic crossover process with the peer device based on the target ports.
[0095] In the auto - negotiation process defined by the existing Ethernet standard, after an Ethernet device starts the auto - negotiation state, it will enter the ability detection state. In the ability detection state, the Ethernet device can only select one port to send link pulse signals at the same time. As can be seen from the above, in the auto - negotiation method of this application embodiment, one of the Ethernet devices needs to enter the signal reception state after starting the auto - negotiation state, and the other Ethernet device needs to enter the ability detection state to send link pulse signals normally. Therefore, in the embodiment of this application, it is necessary to update the auto - negotiation logic of at least one Ethernet device so that the Ethernet device can choose whether to enter the signal reception state based on the auto - negotiation logic provided by this application embodiment after starting the auto - negotiation state. In practical applications, the auto - negotiation logic provided by this application embodiment can be applied to two interconnected Ethernet devices at the same time (that is, the auto - negotiation logics between the two Ethernet devices are peer - to - peer), or it can also be applied to only one of the Ethernet devices, and the other Ethernet device does not need to update the auto - negotiation logic (that is, continues the auto - negotiation logic defined by the existing Ethernet standard), thus achieving compatibility with existing Ethernet devices and improving the flexibility of the solution.
[0096] Please refer to Figure 8 , Figure 8 which is a schematic diagram of the auto - negotiation logic provided in the embodiment of this application. As Figure 8 shown, in the traditional auto - negotiation logic, after an Ethernet device starts the auto - negotiation function, it enters the transmit - disable stage. After the break - link timer ends (break_link_timer_done), the local device enters the ability detection state and executes the process defined in the standard. The auto - negotiation logic defined in the embodiment of this application inserts Figure 8The newly added port detection process shown. For an Ethernet device that has updated the auto-negotiation logic provided in the embodiments of the present application, after the link interruption timer in the prohibited transmission stage ends (break_link_timer_done), the Figure 9 port detection process shown will be executed first to select whether to enter the signal reception state.
[0097] Please refer to Figure 9 , Figure 9 which is a schematic diagram of an Ethernet device in an embodiment of the present application executing the port detection process. In the Figure 9 example, taking the local device executing the port detection process as an example, an exemplary introduction is made. As Figure 9 shown, the port detection process executed by the local device includes, but is not limited to, steps 201 to 206.
[0098] 201. Wait to receive an energy signal from the peer device.
[0099] After the local device starts the auto-negotiation function, it waits to receive an energy signal from the peer device. The local device confirms whether the peer device has entered the auto-negotiation state based on whether it receives an energy signal from the peer device. When the local device receives an energy signal from the peer device, the local device confirms that the peer device has entered the auto-negotiation state and then executes step 203.
[0100] Among them, the energy signal is a signal used to indicate that the Ethernet device has entered the auto-negotiation state, and the embodiments of the present application do not limit the signal type of the energy signal. Exemplarily, in practical applications, the energy signal can be a signal defined by a special coding format, or the energy signal can be a signal carrying a certain special identifier or special field, or the energy signal can be a link pulse signal (FLP signal or NLP signal) in the standard, or the energy signal can also be other signal types, which are not limited in the embodiments of the present application. For example, when the peer device is in the energy detection state, it will send a link pulse signal (FLP signal or NLP signal) to the local device, and then the local device can confirm that the peer device has entered the auto-negotiation state after receiving the link pulse signal.
[0101] In the embodiments of the present application, the port for receiving the energy signal is not limited. As long as any port in the local device receives an energy signal from the peer device, it can be confirmed that the peer device has entered the auto-negotiation state.
[0102] In practical applications, the local device can define an energy detection timer, which is used for the local device to determine whether it has received an energy signal from the peer device before the end of the energy detection timer. If an energy signal from the peer device is received before the end of the energy detection timer, it is determined that the peer device has entered the auto-negotiation state.
[0103] 202. Send an energy signal to the peer device.
[0104] When the local device executes step 201, it will also execute step 202, that is, send an energy signal to the peer device. Among them, the local device can select any port to send the energy signal (such as an FLP signal or an NLP signal), and this application embodiment does not limit this. Preferably, the local device can send an energy signal to the peer device simultaneously when the energy detection timer is started (that is, execute steps 201 and 202 simultaneously). Among them, if the peer device also executes the auto-negotiation logic (port detection process) provided by this application embodiment, that is, after the peer device starts the auto-negotiation function, it will also wait to receive an energy signal from the local device (that is, execute step 201). At this time, the energy signal sent by the local device can enable the peer device to perceive that the local device has entered the auto-negotiation state. If the peer device does not execute the auto-negotiation logic (port detection process) provided by this application embodiment, that is, executes the existing standard auto-negotiation process, then the peer device enters the ability detection state after starting the auto-negotiation and sends a link pulse signal (which belongs to an energy signal) to the local device. The local device can determine that the peer device has entered the auto-negotiation state by receiving this link pulse signal.
[0105] In practical applications, if it is known in advance that the peer device executes the existing standard auto-negotiation process, then the local device can choose not to send a link pulse signal to the peer device, and the local device directly executes step 206.
[0106] In practical applications, after the local device sends an energy signal to the peer device, during the duration of this energy signal (that is, the sum of the pulse width of the energy signal and the round-trip link transmission time of the energy signal), it is impossible to accurately determine whether the energy signal received by the local device comes from the peer device, thus affecting the accuracy of identifying that the peer device has entered the auto-negotiation state. Therefore, the local device can consider only the energy signals received within the energy detection period as coming from the peer device, thereby improving the accuracy of confirming that the peer device has entered the auto-negotiation state. In other words, the local device will determine that the peer device has entered the auto-negotiation state only when an energy signal is received within the energy detection period. Among them, the energy detection period is the time period outside the duration of the signal sent by the local device.
[0107] Furthermore, since the local device only identifies whether the opposite device enters the self-negotiation state during the energy detection period. If the opposite device sends an energy signal to the opposite device during the non-energy detection period (i.e., the duration of the energy signal sent by the local device) after entering the self-negotiation state, the local device will not be able to perceive that the opposite device has entered the self-negotiation state. In this regard, if the local device does not receive the energy signal from the opposite device during the energy detection period (before the energy detection timer ends), the starting time point of the energy detection period is randomly updated to stagger the time when the local device sends the energy signal so that the time difference between the local device and the opposite device is greater than the duration of the energy signal, thereby improving the accuracy of the local device in identifying that the opposite device enters the self-negotiation state. Specifically, the local device can configure another random timer (back_off_timer), and the random timer is used to determine a random duration. When the energy detection timer ends, if the local device does not receive the energy signal from the opposite device, the random timer is triggered. When the random duration defined by the random timer ends, the energy detection timer is restarted, and the energy signal from the opposite device is continued to be received, and the energy signal is sent to the opposite device. This cycle is executed until the energy signal from the opposite device is received, confirming that the opposite device has entered the auto-negotiation state.
[0108] 203. Determine whether a target signal is received from the opposite device. If the target signal is received, execute step 204; if the target signal is not received, execute step 205.
[0109] In an embodiment of the present application, a target signal is defined, and the Ethernet device chooses to enter a signal receiving state or a capability detection state according to whether the target signal is received. If the local device receives the target signal from the opposite device, the local device executes step 204, that is, the local device exits the port detection process and enters a standard capability detection state. In the capability detection state, a port for performing automatic crossover is actively selected, that is, the target port in the embodiment of the present application. The target port defined in the embodiment of the present application refers to two ports in an Ethernet device for performing automatic crossover, wherein, at the same time, one target port is used to send a link pulse signal, and the other target port is used to receive a link pulse signal. In actual applications, the opposite device can select a target port according to the port priority (for example, Figure 1 The priority order in the DHCP relay is A' port > B' port > C' port > D' port), so the two ports with higher priority are selected as the target ports.
[0110] The target signal is a special signal type defined in this application, which is different from the existing signal types in standard auto-negotiation. Exemplarily, in practical applications, the target signal can be a signal defined by a special coding format, or the target signal can be a signal carrying a special identifier or a special field, or the target signal can be multiple signals sent by multiple ports in an Ethernet device at the same time. In the auto-negotiation method of this application, if an Ethernet device receives multiple signals at the same time on multiple ports, the Ethernet device can determine that it has received the target signal. Or, the target signal can also be other signal types, which are not limited in this application.
[0111] In a possible implementation, the target signal in the embodiments of this application can be multiple link pulse signals sent by different ports at the same time. Exemplarily, the target signal can include multiple link pulse signals sent by 2, 3, or 4 ports at the same time. Specifically, because in the existing standard auto-negotiation process, an Ethernet device will only send link pulse signals on one port at the same time. Therefore, an Ethernet device sending multiple link pulse signals through multiple ports at the same time is the target signal. If an Ethernet device receives link pulse signals (such as FLP signals) on multiple ports at the same time, the Ethernet device can determine that it has received the target signal; if an Ethernet device only receives link pulse signals (such as FLP signals) on one port at the same time, the Ethernet device can determine that it has received the standard link pulse signal and has not received the target signal. By controlling the number of ports sending link pulse signals at the same time, there is no need to redefine the coding format of the target signal, which improves the efficiency of the Ethernet device sending the target signal. In addition, since the Ethernet device identifies the target signal based on the number of ports of the received link pulse signals, rather than specific bit information, the Ethernet device does not need to sense the link code word (LCW) in the target signal, and thus does not need to parse and recover the link code word of the target signal, thereby improving the efficiency of the Ethernet device receiving and identifying the target signal.
[0112] If the local device does not receive the target signal from the peer device, the local device executes step 205, that is, the local device sends the target signal to the peer device, and then executes step 206, that is, enters the signal receiving state.
[0113] Specifically, as can be seen from the above, the port detection process of the embodiments of the present application can be applied to two interconnected Ethernet devices at the same time. In other words, the auto-negotiation logic between the two Ethernet devices is peer-to-peer, and both execute the newly added port detection process (steps 201 to 206) in the embodiments of the present application. Or, it can also be applied to only one of the Ethernet devices, and the other Ethernet device does not need to execute the newly added port detection process in the embodiments of the present application (that is, continue the auto-negotiation process of the existing Ethernet standard). In both of the above cases, one of the two interconnected Ethernet devices can enter the signal receiving state, and the other Ethernet device can enter the capability detection state. Next, the above two cases will be described separately.
[0114] Case 1: The auto-negotiation logic between two interconnected Ethernet devices is peer-to-peer, and both execute the newly added port detection process in the embodiments of the present application. After the two Ethernet devices confirm that the other party has entered the auto-negotiation state, they will both determine whether their own device has received the target signal. Among them, since an Ethernet device only considers that the other device has entered the auto-negotiation state when it receives an energy signal during the energy detection period, this ensures that the time for the two Ethernet devices to execute the step of "determining whether the target signal is received" is staggered and greater than the duration of sending the energy signal. Assume that the local device executes the step of "determining whether the target signal is received" earlier than the peer device. Therefore, when the local device does not receive the target signal, it first sends the target signal to the peer device, and then the local device enters the signal receiving state (that is, first execute step 205, and then execute step 206). For the peer device, since the local device has sent the target signal to the peer device, the peer device can receive the target signal, and thus the peer device enters the standard capability detection state.
[0115] Case 2: The port detection process of the embodiments of the present application is only applied to one of the Ethernet devices, and the other Ethernet device does not need to execute the newly added port detection process in the embodiments of the present application (that is, continue the auto-negotiation process of the existing Ethernet standard). Hereinafter, taking the local device executing the port detection process of the embodiments of the present application as an example for description. Since the peer device does not execute the newly added port detection process in the embodiments of the present application, that is, the peer device continues to execute the auto-negotiation process of the existing standard. When the peer device starts the auto-negotiation function and enters the capability detection state, it will not send the target signal to the local device. After the local device confirms that the peer device has entered the auto-negotiation state, since it cannot receive the target signal, the local device sends the target signal to the peer device and then enters the signal receiving state (that is, first execute step 205, and then execute step 206).
[0116] 204. Enter the capability detection state.
[0117] If the local device receives a target signal from the peer device, the local device actively selects the ports for performing auto - crossover, i.e., the target ports in the embodiments of the present application. Among them, one target port is used to send link pulse signals, and the other target port is used to receive link pulse signals. In practical applications, the peer device can, according to the port priority (for example Figure 1 the priority sorting in it is port A'> port B'> port C'> port D'), preferentially select the two ports with higher priority as the target ports. Then, the local device jumps out of the port detection process and enters the standard ability detection state.
[0118] 205. Send a target signal to the peer device.
[0119] After the local device sends a target signal to the peer device, it then enters the signal reception state, that is, step 206 is executed.
[0120] 206. Enter the signal reception state.
[0121] When the local device enters the signal reception state, during the signal reception state, all ports of the local device are used to receive link pulse signals, and sending link pulse signals is prohibited. The peer device is in the ability detection state and autonomously selects two target ports. At the same moment, one target port is used to send link pulse signals, and the other target port is used to receive link pulse signals. Since the local device does not send link pulse signals, the peer device cannot receive link pulse signals, so the auto - crossover function of the peer device is triggered, causing the peer device to switch the two ports for sending and receiving. In practical applications, the peer device can follow the standard auto - crossover logic to determine whether to switch the sending and receiving ports. For example, when the peer device cannot receive the FLP signal, if the S
[10] bit of PRBS11 is 0, the sending and receiving ports are not switched; if the S
[10] bit of PRBS11 is 1, the sending and receiving ports are switched.
[0122] Therefore, the local device will receive link pulse signals at two different ports at different times, indicating that these two ports are connected to the current target ports of the peer device. Then the local device determines the two ports that continuously receive link pulse signals as the target ports. Next, based on these two target ports, the local device completes the subsequent auto - negotiation process with the peer device.
[0123] In practical applications, for the network cable connected between two Ethernet devices, there may also be a situation of network cable pair failure. The embodiments of the present application provide another port detection process for the case of Ethernet cable failure. Please refer to Figure 10 , Figure 10 which is another schematic diagram of the Ethernet device executing the port detection process in the embodiments of the present application. InFigure 10 In the example, the port detection process performed by the local device is used as an example for an exemplary introduction. Figure 10 As shown, the port detection process executed by the local device includes but is not limited to steps 301 to 308.
[0124] 301. Waiting to receive an energy signal from the opposite device.
[0125] 302. Send an energy signal to the peer device.
[0126] If a pair of twisted pairs of the network cable fails, and the energy signal sent by the local device to the opposite device happens to pass through this faulty pair, the opposite device cannot receive the energy signal, and the opposite device cannot sense that the local device has entered the auto-negotiation state. Therefore, the local device can send energy signals to the opposite device in turn through multiple ports, reducing the impact of network cable failures on energy signal reception and improving the accuracy and stability of identifying whether the opposite device has entered the auto-negotiation state.
[0127] In addition, step 301 to step 302 are similar to the aforementioned step 201 to step 202. Please refer to the description of the aforementioned step 201 to step 202 for details, and will not be repeated here.
[0128] 303. Determine whether the number of ports that simultaneously receive link pulse signals is greater than or equal to 2, if not, execute step 304, if yes, execute step 306.
[0129] Exemplarily, in this scenario, the Ethernet device (the local device and the opposite device) can simultaneously send link pulse signals on four ports as the target signal in the embodiment of the present application. If the number of ports on the local device that simultaneously receive the link pulse signals is greater than or equal to 2, step 304 is executed; if it is less than 2, step 306 is executed.
[0130] 304. Send a target signal to the opposite device.
[0131] If the number of ports of the local device receiving the link pulse signal is less than 2, it means that the target signal is not received, then the local device sends the target signal to the opposite device, and then enters the signal receiving state, that is, executes step 305.
[0132] 305. Enter signal receiving state.
[0133] In a possible implementation, when performing step 303, if only one port of the Ethernet devices at both ends receives the link pulse signal, the Ethernet devices at both ends will enter the signal receiving state. As a result, all ports of the Ethernet devices at both ends are only used to wait for receiving the link pulse signal and will not send the link pulse signal. Therefore, after entering the signal receiving state, when an Ethernet device does not receive the link pulse signal from the peer device within a preset time period, it can be determined that 3 wire pairs between the Ethernet device and the peer device have failed, and the failed wire pairs are the wire pairs that do not receive the energy signal.
[0134] Furthermore, since it has been determined that a link failure has occurred and autonegotiation cannot be performed, the Ethernet devices at both ends can choose to exit the autonegotiation state. Then, they can choose to perform PMA training and communication on the only remaining intact wire pair.
[0135] 306. Determine whether the number of ports that receive the link pulse signal simultaneously is equal to 4. If so, perform step 307; if not, perform step 308.
[0136] 307. Select two of the ports as the target ports.
[0137] Since 4 ports receive the link pulse signal simultaneously, that is, the local device receives the target signal, it indicates that all 4 ports are intact and no failure has occurred. The local device will select two of the ports as the target ports for auto - crossover according to the port priority and enter the ability detection state. The peer device will use the two ports that receive the link pulse signal as the target ports of the peer device for auto - crossover.
[0138] 308. Select 2 of the ports that receive the link pulse signal as the target ports for auto - crossover.
[0139] Since the number of ports that receive the link pulse signal simultaneously is greater than or equal to 2 and less than 4, it indicates that the local device receives the target signal and that there is a wire pair failure. At this time, the local device selects 2 of the ports that receive the link pulse signal as the target ports for auto - crossover according to the port priority and enters the ability detection state. Optionally, for example, select the two ports with higher priority as the target ports for auto - crossover according to the port priority. The peer device will use the two ports that receive the link pulse signal as the target ports of the peer device for auto - crossover.
[0140] Thus, the autonegotiation method of the embodiments of the present application can implement any crossover function on the basis of at least 2 pairs of intact network cables, improving the success rate of autonegotiation.
[0141] Accordingly, the embodiments of the present application further provide related devices for implementing the above solutions. Specifically, please refer to Figure 11 , Figure 11 which is a schematic structural diagram of a communication device provided by an embodiment of the present application. The device may be an Ethernet device, a component of an Ethernet device (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the functions of an Ethernet device. As Figure 11 shown, the Ethernet device includes:
[0142] A determination unit 401, configured to determine that the peer device enters the auto-negotiation state in the auto-negotiation state;
[0143] A processing unit 402, configured to enter the signal reception state on all ports, and each port prohibits sending link pulse signals during the signal reception state, and the link pulse signals include fast link pulse signals FLP or normal link pulse signals NLP;
[0144] The determination unit 401 is further configured to determine that two ports are target ports when link pulse signals from the peer device are received through two ports at two moments respectively, and the target ports are used for automatic crossover with the peer device.
[0145] In a possible design, the processing unit 402 is specifically configured to:
[0146] When the target signal from the peer device is not received, send the target signal to the peer device, and enter the signal reception state on all ports.
[0147] In a possible design, the determination unit 401 is further configured to determine that two of the ports are target ports for automatic crossover when the target signal from the peer device is received.
[0148] In a possible design, the target signal is a plurality of link pulse signals sent by different ports at the same moment.
[0149] In a possible design, the determination unit 401 is further configured to:
[0150] When link pulse signals from the peer device are received on multiple ports at the same moment, determine that the target signal from the peer device is received.
[0151] In a possible design, the determination unit 401 is specifically configured to:
[0152] Receive an energy signal from the peer device;
[0153] Determine that the peer device enters the auto-negotiation state according to the energy signal from the peer device.
[0154] In a possible design, the processing unit 402 is further configured to:
[0155] Send an energy signal to the peer device.
[0156] In a possible design, the processing unit 402 is specifically configured to:
[0157] Send an energy signal to the peer device in turn through multiple ports.
[0158] In a possible design, the determining unit 401 is specifically configured to:
[0159] Determine that the link pulse signal received during the energy detection period is a link pulse signal from the peer device, where the energy detection period is a time period outside the duration of the link pulse signal sent by the local device.
[0160] In a possible design, the processing unit 402 is further configured to update the start time point of the energy detection period when no link pulse signal from the peer device is received during the energy detection period.
[0161] In a possible design, the processing unit 402 is further configured to perform automatic cross-negotiation with the peer device through two target ports.
[0162] In a possible design, the processing unit 402 is further configured to determine that there is a fault in the network cable pair between the local device and the peer device when no link pulse signal from the peer device is received within a preset duration.
[0163] In a possible design, the processing unit 402 is further configured to:
[0164] Exit the auto-negotiation state.
[0165] It should be noted that the information interaction, execution process, etc. between the modules / units in the communication device are based on the same concept as the method embodiments corresponding to any one of the present application Figures 7 to 10 The specific content can be referred to the description in the method embodiments shown above in the present application, and will not be elaborated here.
[0166] Please refer to Figure 12 , Figure 12 FIG. is a schematic logical structure diagram of a communication device 50 provided in an embodiment of the present application. The communication device 50 may be an Ethernet device, a component of an Ethernet device (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the functions of an Ethernet device. The communication device 50 may be deployed with Figure 11 The Ethernet device described in the corresponding embodiment is used to implement Figures 7 to 10The functions implemented by the Ethernet device in any of the corresponding embodiments. The communication device 50 includes: a memory 501, a processor 502, a communication interface 503, and a bus 504. Among them, the memory 501, the processor 502, and the communication interface 503 are communicatively connected to each other through the bus 504.
[0167] The memory 501 can be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 501 can store a program. When the program stored in the memory 501 is executed by the processor 502, the processor 502 and the communication interface 503 are used to execute the above-mentioned auto-negotiation method.
[0168] The processor 502 can be a central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), a digital signal processing (DSP), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any combination thereof, and is used to execute relevant programs to implement one or more steps corresponding to the auto-negotiation method in this application. The steps of the data processing method disclosed in combination with the embodiments of this application can be executed by a compiler and an executor, where the compiler and the executor can be executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read only memory, a programmable read only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 501, and the processor 502 reads the information in the memory 501 and combines its hardware to execute the embodiments corresponding to the auto-negotiation method in this application.
[0169] The communication interface 503 uses a transceiver device such as, but not limited to, a transceiver to implement the communication between the computer device 50 and other devices or communication networks.
[0170] The bus 504 can implement a path for transmitting information between various components of the computer device 50 (for example, the memory 501, the processor 502, and the communication interface 503). The bus 504 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 12 it is only represented by a thick line in Figure 12 , but it does not mean that there is only one bus or one type of bus.
[0171] It should be noted that the information interaction, execution process, etc. between the modules / units in the communication device are based on the same concept as the method embodiments corresponding to any one of those in this application. For specific content, reference can be made to the descriptions in the method embodiments shown above in this application, which will not be elaborated here. Figures 7 to 10 The method embodiments corresponding to any one of those in this application are based on the same concept as the method embodiments corresponding to any one of those in this application. For specific content, reference can be made to the descriptions in the method embodiments shown above in this application, which will not be elaborated here.
[0172] The embodiments of this application also provide a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computer device, it causes at least one computer device to execute the method described in the embodiments shown in any one of those as described above Figures 7 to 10 in this application.
[0173] The embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc. The computer-readable storage medium includes instructions that direct the computing device to execute the method described in the embodiments shown in any one of those as described above Figures 7 to 10 in this application.
[0174] The communication device provided in the embodiments of this application can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin, or a circuit, etc. The processing unit can execute the computer-executable instructions stored in the storage unit to cause the chip to execute the above Figures 7 to 10The method described in any of the embodiments shown. Optionally, the storage unit is a storage unit within the chip, such as a register, cache, etc., and the storage unit can also be a storage unit outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0175] It should be further noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided in the embodiments of the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0176] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments of the present application can be implemented by means of software plus necessary general hardware, and of course, can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be various, such as analog circuits, digital circuits or dedicated circuits. However, for the embodiments of the present application, in more cases, software program implementation is a better implementation method. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disc of a computer, and includes several instructions for causing a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0177] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0178] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
Claims
1. A self-negotiation method, characterized in that, it includes: In the self-negotiation state, determine that the peer device enters the self-negotiation state; Enter the signal reception state on all ports, and each of the ports prohibits sending link pulse signals during the signal reception state, and the link pulse signals include fast link pulse signals FLP or normal link pulse signals NLP; In response to receiving link pulse signals from the peer device through two ports at two moments respectively, determine that the two ports are target ports, and the target ports are used for automatic crossover with the peer device.
2. The method according to claim 1, characterized in that, The entering the signal reception state on all ports includes: If the target signal from the peer device is not received, send the target signal to the peer device, and enter the signal reception state on all ports.
3. The method according to claim 2, characterized in that, The method further includes: If the target signal from the peer device is received, determine that two of the ports are target ports.
4. The method according to claim 2 or 3, characterized in that, The target signal includes a plurality of the link pulse signals sent by different ports at the same moment.
5. The method according to claim 4, characterized in that, The method further includes: In response to receiving link pulse signals from the peer device on multiple ports at the same moment, determine that the target signal from the peer device is received.
6. The method according to any one of claims 1 to 5, characterized in that, Determining that the peer device enters the self-negotiation state includes: Receiving an energy signal from the peer device; According to the energy signal from the peer device, determine that the peer device enters the self-negotiation state.
7. The method according to claim 6, characterized in that, Before determining that the peer device enters the self-negotiation state, the method further includes: Sending an energy signal to the peer device.
8. The method according to claim 7, characterized in that, Sending an energy signal to the peer device includes: Sending an energy signal to the peer device through multiple ports in turn.
9. The method according to claim 7 or 8, characterized in that, The receiving the energy signal from the peer device includes: Determine that the signal received within the energy detection period is the energy signal from the peer device, and the energy detection period is the time period outside the duration of the energy signal sent by the local device.
10. The method according to claim 9, characterized in that, The method further includes: If the energy signal from the peer device is not received within the energy detection period, update the start time point of the energy detection period.
11. The method according to any one of claims 1 to 10, characterized in that, The method further includes: Performing automatic crossover with the peer device through the two target ports.
12. The method according to claim 4, characterized in that, After entering the signal reception state on all ports, the method further includes: If a link pulse signal from the peer device is not received within a preset time period, it is determined that a fault has occurred in the network cable pair between the local device and the peer device.
13. The method according to claim 12, wherein, the method further includes: exiting the auto-negotiation state.
14. A communication device, wherein, it includes: a determination unit, configured to determine, in the auto-negotiation state, that the peer device enters the auto-negotiation state; a processing unit, configured to enter a signal reception state on all ports, and each of the ports prohibits sending a link pulse signal during the signal reception state, and the link pulse signal includes a fast link pulse signal FLP or a normal link pulse signal NLP; the determination unit is further configured to determine, when link pulse signals from the peer device are received through two ports at two different times, that the two ports are target ports, and the target ports are used for automatic crossover with the peer device.
15. The communication device according to claim 14, wherein, the processing unit is specifically configured to: when a target signal from the peer device is not received, send the target signal to the peer device, and enter a signal reception state on all ports.
16. The communication device according to claim 15, wherein, the determination unit is further configured to determine, when a target signal from the peer device is received, that two of the ports are target ports for automatic crossover.
17. The communication device according to claim 15 or 16, wherein, the target signal includes a plurality of the link pulse signals sent by different ports at the same time.
18. The communication device according to claim 17, wherein, the determination unit is further configured to: when link pulse signals from the peer device are received on multiple ports at the same time, determine that a target signal from the peer device is received.
19. The communication device according to any one of claims 14 to 18, wherein, the determination unit is specifically configured to: receive an energy signal from the peer device; determine, according to the energy signal from the peer device, that the peer device enters the auto-negotiation state.
20. The communication device according to claim 19, wherein, the processing unit is further configured to: send an energy signal to the peer device.
21. The communication device according to claim 20, wherein, the processing unit is specifically configured to: send energy signals to the peer device through multiple ports in turn.
22. The communication device according to claim 20 or 21, wherein, the determination unit is specifically configured to: determine that the link pulse signal received within an energy detection period is a link pulse signal from the peer device, and the energy detection period is a time period outside the duration of the link pulse signal sent by the local device.
23. The communication device according to claim 22, wherein, The processing unit is further configured to update the start time point of the energy detection period when no link pulse signal is received from the peer device within the energy detection period.
24. The communication device according to any one of claims 14 to 23, wherein, the processing unit is further configured to perform an automatic crossover negotiation with the peer device through the two target ports.
25. The communication device according to claim 17, wherein, the processing unit is further configured to determine that a fault has occurred in the network cable pair between the communication device and the peer device when no link pulse signal is received from the peer device within a preset duration.
26. The communication device according to claim 25, wherein, the processing unit is further configured to: exit the auto-negotiation state.
27. A communication device, wherein, it includes a processor, and the processor is coupled to a memory, the memory is configured to store instructions; the processor is configured to execute the instructions in the memory, so that the communication device executes the method according to any one of claims 1 to 13.
28. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
29. A computer program product, wherein, the computer program product stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Cited By
Ethernet architecture, communication equipment and automatic negotiation and link training method
CN121309250A