Network updating method and electronic device
By using BPDU packets to update port mode in an Ethernet networking environment, the problem of not being able to perceive link changes after device switching is solved, and network stability and link convergence rate are improved.
Patent Information
- Application Number
- CN202411273746.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-12
AI Technical Summary
In the prior art, devices cannot perceive link changes after switching to the low-priority spanning tree protocol mode, resulting in low network stability.
In the Ethernet networking environment, the first device sends a Bridge Protocol Data Unit (BPDU) message to the second device, instructing it to update the port mode so that it perceives a higher priority target port mode, thereby improving the link Road convergence rate and network stability.
By sending BPDU messages to downstream devices, downstream devices can determine target port modes with higher priority than the current mode according to the supported port mode, improve the link convergence rate between upstream and downstream devices, and enhance network stability.
Smart Images

Figure CN118802530B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of computers, and more particularly, to a network updating method and an electronic device. Background Art
[0002] In an Ethernet networking environment, you can use the spanning tree protocol to block the ports of redundant links in the networking to retain the main link, eliminate physical loops, and avoid broadcast storms and other problems. When the main link fails, the spanning tree protocol can quickly switch the redundant link to the active state to achieve link backup and improve network reliability.
[0003] With the continuous development of network technology, the spanning tree protocol mode corresponding to the port is also evolving. The spanning tree protocol mode can include the standard spanning tree protocol (Spanning Tree Protocol, STP) mode, the rapid spanning tree protocol (Rapid Spanning Tree Protocol, RSTP) mode, and the multiple spanning tree protocol (Multiple Spanning Tree Protocol, MSTP) mode. Among them, the STP mode has the lowest priority and the MSTP mode has the highest priority. The port of the first device running the high-priority spanning tree protocol mode can allow the second device running the low-priority spanning tree protocol mode to access, and the port of the first device can switch the high-priority spanning tree protocol mode to the low-priority spanning tree protocol mode. For example, the port of the first device running the MSTP mode allows the second device running the STP mode to access, and the port of the first device can switch the MSTP mode to the STP mode.
[0004] In the above process, after the first device port switches to the low priority spanning tree protocol mode, it may not be able to perceive that the second device is removed from the port or changes the spanning tree protocol mode, and it always runs in the low priority spanning tree protocol mode, resulting in low network stability. Summary of the invention
[0005] An embodiment of the present application provides a network update method and an electronic device to solve the defect in the prior art that after the first device switches to a low-priority spanning tree protocol mode, it may not be able to perceive that the second device is removed from the port or changes the spanning tree protocol mode, and always operates in the low-priority spanning tree protocol mode, resulting in low network stability.
[0006] In a first aspect, the present application provides a network update method, which is applied to a first device, wherein the first device is connected to a second device through a port, and the second device is a downstream device of the first device, and the method includes:
[0007] Acquire a current port mode of the port and a first port mode supported by the first device;
[0008] If the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, sending a bridge protocol data unit BPDU message to the second device according to the current port mode, where the BPDU message is used to indicate the first port mode;
[0009] Receive a response message sent by the second device in a target port mode, wherein the response message is used to indicate that the mode of the port is updated to the target port mode, and the target port mode is determined by the second device according to the first port mode and the port modes supported by the second device.
[0010] In a possible implementation, sending a bridge protocol data unit BPDU message to the second device according to the current port mode includes:
[0011] Get the initial message;
[0012] Determine the number of fields to be newly added according to the first port mode and the current port mode;
[0013] Determining the field content of the newly added field according to the first port mode and the current port mode;
[0014] According to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message;
[0015] According to the current port mode, the BPDU message is sent to the second device.
[0016] In a possible implementation manner, determining the number of fields of the newly added field according to the first port mode and the current port mode includes:
[0017] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the number of fields of the newly added field is the first number;
[0018] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is the second number;
[0019] If the current port mode is the first preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is a third number;
[0020] The priority of the third preset mode is greater than that of the second preset mode, and the priority of the second preset mode is greater than that of the first preset mode.
[0021] In a possible implementation manner, determining the field content of the newly added field according to the first port mode and the current port mode includes:
[0022] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the field content of the newly added field is the first content;
[0023] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the field content of the newly added field is the second content;
[0024] If the current port mode is the first preset mode, and the first port mode is the third preset mode, it is determined that the field content of the newly added field is the first content and the second content.
[0025] In a possible implementation manner, according to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message, including:
[0026] If the number of fields is the first number, a first field is added to the initial message, and the first content is filled into the first field to obtain the BPDU message;
[0027] If the number of fields is the second number, a second field and a third field are added to the initial message, and the second content is filled into the second field and the third field to obtain the BPDU message;
[0028] If the number of fields is the third number, the first field, the second field and the third field are newly added to the initial message, the first content is filled into the first field, and the second content is filled into the second field and the third field, to obtain the BPDU message.
[0029] In a second aspect, the present application provides a network update method, which is applied to a second device, where the second device is connected to a first device through a port, and the first device is an upstream device of the second device, and the method includes:
[0030] Receiving a BPDU message sent by the first device in a current port mode, and determining a first port mode supported by the first device according to the BPDU message;
[0031] Acquire a second port mode supported by the second device;
[0032] Determine the port mode with a lower priority between the first port mode and the second port mode as the target port mode;
[0033] If the priority of the target port mode is higher than the priority of the current port mode, a response message is sent to the first device according to the target port mode, where the response message is used to indicate that the mode of the port is updated to the target port mode.
[0034] In a possible implementation manner, determining, according to the BPDU message, a first port mode supported by the first device includes:
[0035] Determine whether the BPDU message contains a new field;
[0036] If yes, determine a newly added field corresponding to the BPDU message, and determine a first port mode supported by the first device according to the current port mode and the newly added field;
[0037] The first port mode includes a first preset mode, a second preset mode and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
[0038] In a possible implementation manner, when the current port mode is the first preset mode, determining the first port mode supported by the first device according to the current port mode and the newly added field includes:
[0039] Determine whether the newly added field contains a first field, and whether the content corresponding to the first field is the first content;
[0040] If so, determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode; if not, determine that the first port mode supported by the first device is the second preset mode.
[0041] In a possible implementation manner, when the current port mode is the second preset mode, determining the first port mode supported by the first device according to the current port mode and the newly added field includes:
[0042] Determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content;
[0043] If so, determine that the first port mode supported by the first device is the third preset mode.
[0044] In a third aspect, the present application provides a network update device, applied to a first device, the first device is connected to a second device through a port, the second device is a downstream device of the first device, and the device includes:
[0045] an acquisition module, configured to acquire a current port mode of the port and a first port mode supported by the first device;
[0046] a sending module, configured to send a bridge protocol data unit BPDU message to the second device according to the current port mode if the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, wherein the BPDU message is used to indicate the first port mode;
[0047] A receiving module is used to receive a response message sent by the second device in a target port mode, wherein the response message is used to indicate that the mode of the port is updated to the target port mode, and the target port mode is determined by the second device based on the first port mode and the port modes supported by the second device.
[0048] In a possible implementation manner, the sending module is specifically configured to:
[0049] Get the initial message;
[0050] Determine the number of fields to be newly added according to the first port mode and the current port mode;
[0051] Determining the field content of the newly added field according to the first port mode and the current port mode;
[0052] According to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message;
[0053] According to the current port mode, the BPDU message is sent to the second device.
[0054] In a possible implementation manner, the sending module is specifically configured to:
[0055] Determine the number of fields to be newly added according to the first port mode and the current port mode;
[0056] Determining the field content of the newly added field according to the first port mode and the current port mode;
[0057] According to the number of fields, the newly added fields are added to the initial message, and the field contents are filled into the corresponding newly added fields to obtain the BPDU message.
[0058] In a possible implementation manner, the sending module is specifically configured to:
[0059] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the number of fields of the newly added field is the first number;
[0060] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is the second number;
[0061] If the current port mode is the first preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is a third number;
[0062] The priority of the third preset mode is greater than that of the second preset mode, and the priority of the second preset mode is greater than that of the first preset mode.
[0063] In a possible implementation manner, the sending module is specifically configured to:
[0064] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the field content of the newly added field is the first content;
[0065] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the field content of the newly added field is the second content;
[0066] If the current port mode is the first preset mode, and the first port mode is the third preset mode, it is determined that the field content of the newly added field is the first content and the second content.
[0067] In a possible implementation manner, the sending module is specifically configured to:
[0068] If the number of fields is the first number, a first field is added to the initial message, and the first content is filled into the first field to obtain the BPDU message;
[0069] If the number of fields is the second number, a second field and a third field are added to the initial message, and the second content is filled into the second field and the third field to obtain the BPDU message;
[0070] If the number of fields is the third number, the first field, the second field and the third field are newly added to the initial message, the first content is filled into the first field, and the second content is filled into the second field and the third field, to obtain the BPDU message.
[0071] In a fourth aspect, the present application provides a network update device, applied to a second device, the second device is connected to a first device through a port, the first device is an upstream device of the second device, and the device includes:
[0072] A receiving module, configured to receive a BPDU message sent by the first device in a current port mode, and determine a first port mode supported by the first device according to the BPDU message;
[0073] An acquisition module, used for acquiring a second port mode supported by the second device;
[0074] A determination module, configured to determine a port mode with a lower priority between the first port mode and the second port mode as a target port mode;
[0075] A sending module is used to send a response message to the first device according to the target port mode if the priority of the target port mode is higher than the priority of the current port mode, wherein the response message is used to indicate that the mode of the port is updated to the target port mode.
[0076] In a possible implementation manner, the receiving module is specifically configured to:
[0077] Determine whether the BPDU message contains a new field;
[0078] If yes, determine a newly added field corresponding to the BPDU message, and determine a first port mode supported by the first device according to the current port mode and the newly added field;
[0079] The first port mode includes a first preset mode, a second preset mode and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
[0080] In a possible implementation manner, when the current port mode is the first preset mode, the receiving module is specifically configured to:
[0081] Determine whether the newly added field contains a first field, and whether the content corresponding to the first field is the first content;
[0082] If so, determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode; if not, determine that the first port mode supported by the first device is the second preset mode.
[0083] In a possible implementation manner, when the current port mode is the second preset mode, the receiving module is specifically configured to:
[0084] Determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content;
[0085] If so, determine that the first port mode supported by the first device is the third preset mode.
[0086] In a fifth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0087] The memory stores computer-executable instructions;
[0088] The processor executes the computer-executable instructions stored in the memory to implement the method described in any one of the first aspects.
[0089] In a sixth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0090] The memory stores computer-executable instructions;
[0091] The processor executes the computer-executable instructions stored in the memory to implement the method described in any one of the second aspects.
[0092] In a seventh aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0093] In an eighth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the second aspects.
[0094] In a ninth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the first aspects.
[0095] In a tenth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the second aspects.
[0096] The embodiment of the present application provides a network update method and electronic device, wherein the first device obtains the current port mode of the port and the first port mode supported by the first device, if the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, the first device sends a bridge protocol data unit BPDU message to the second device according to the current port mode, the BPDU message is used to indicate the first port mode, the second device determines the first port mode supported by the first device according to the BPDU message, the second device obtains the second port mode supported by the second device, the second device determines the port mode with a lower priority between the first port mode and the second port mode as the target port mode, if the priority of the target port mode is higher than the priority of the current port mode, the second device sends a response message to the first device according to the target port mode, and the response message is used to indicate that the mode of the port is updated to the target port mode. In this way, the upstream device sends a BPDU message to the downstream device to indicate the first port mode supported by the upstream device, and the downstream device can determine the target port mode with a higher priority than the current port mode according to the first port mode and the second port mode supported by itself, and improve the convergence rate of the link between the upstream device and the downstream device through the target port mode to improve the stability of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0098] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0099] Figure 2 A flowchart of a network updating method provided in an embodiment of the present application;
[0100] Figure 3 A flowchart of another network updating method provided in an embodiment of the present application;
[0101] Figure 4 A schematic diagram of a BPDU message structure provided in an embodiment of the present application;
[0102] Figure 5 A flowchart of another network updating method provided in an embodiment of the present application;
[0103] Figure 6 A schematic diagram of the structure of a network update device provided in an embodiment of the present application;
[0104] Figure 7 A schematic diagram of the structure of another network updating device provided in an embodiment of the present application;
[0105] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0106] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0107] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0108] It should be noted that, although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. Optionally, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0109] It should be understood that the terms "comprises" and "includes" indicate the presence of the previously mentioned features, steps, operations, but do not exclude the presence, occurrence or addition of one or at least one other feature, step, operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or mean any one or any combination. Optionally, "A and / or B" means "any of the following: A; B; A and B". In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0110] In an Ethernet networking environment, you can use the spanning tree protocol to block the ports of redundant links in the networking to retain the main link, eliminate physical loops, and avoid broadcast storms and other problems. When the main link fails, the spanning tree protocol can quickly switch the redundant link to the active state to achieve link backup and improve network reliability.
[0111] Next, combine Figure 1 , using the Ethernet network topology as an example, explain the working principle of the spanning tree protocol.
[0112] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , Figure 1 The network may include a first device 101, a second device 102, and a third device 103. The first device 101, the second device 102, and the third device 103 may be connected to each other to form a triangular network topology. A physical loop exists in the network topology.
[0113] You can run the spanning tree protocol to eliminate physical loops by following the steps below:
[0114] 1. Determine a root bridge among the first device 101, the second device 102, and the third device 103;
[0115] Each device has a bridge ID, which includes priority and MAC address. The root bridge can be determined based on priority and MAC address.
[0116] For example, assume that the priority of the first device 101 is 4096 and the MAC address is 00:11:22:33:44:55; the priority of the second device 102 is 8192 and the MAC address is 00:22:33:44:55:66; and the priority of the third device 103 is 4096 and the MAC address is 00:33:44:55:66:77.
[0117] The priorities corresponding to the first device 101 , the second device 102 and the third device 103 can be compared. The priorities of the first device 101 and the third device 103 are 4096, which is less than the priority of the second device 102 . The root bridge is determined in the first device 101 and the third device 103 .
[0118] The MAC addresses of the first device 101 and the third device 103 may be compared, and assuming that after the comparison, the MAC address of the first device 101 is smaller, the first device 101 is determined as a root bridge.
[0119] 2. In the second device 102 and the third device 103, a root port is determined;
[0120] The root port is the port closest to the root bridge.
[0121] The root port may be determined by comparing the path costs from the second device 102 to the root bridge and the path costs from the third device 103 to the root bridge.
[0122] Assume that the first device 101 is a root bridge, the link bandwidth connecting the second device 102 and the first device 101 is 1 Gbps, and the path cost is 20000; the link bandwidth connecting the switch C and the first device 101 is 100 Mbps, and the path cost is 200000.
[0123] The path cost of the second device 102 is smaller, and it can be determined that the port on the second device 102 connected to the first device 101 is the root port.
[0124] 3. For each link, determine the designated ports and non-designated ports;
[0125] The devices at both ends of each link can determine a designated port. The designated port is the port with the smallest path cost connecting the link to the root bridge.
[0126] Assume that the first device 101 is a root bridge, and the port on the second device 102 connected to the first device 101 is a root port.
[0127] For the link connecting the second device 102 and the third device 103 , since the second device 102 is a root port and the path cost from the second device 102 to the root bridge (the first device 101 ) is less than the path cost from the third device 103 to the root bridge (the first device 101 ).
[0128] It can be determined that the port on the second device 102 connected to the third device 103 is a designated port, and the port on the third device 103 connected to the second device 102 is a non-designated port.
[0129] Among them, the first device 101 is an upstream device of the second device 102 , the first device 101 is an upstream device of the third device 103 , and the second device 102 is an upstream device of the third device 103 .
[0130] 4. Block non-specified ports.
[0131] In this way, through the operation of the spanning tree protocol, the physical loop in the network is eliminated, forming a loop-free logical topology. When a main link in the network fails, for example, the link connecting the second device 102 and the first device 101 is interrupted, the blocked port will automatically unblock and become an active port, thereby ensuring the connectivity of the network.
[0132] With the continuous development of network technology, the spanning tree protocol mode corresponding to the port is also evolving. The spanning tree protocol mode can include the standard spanning tree protocol (Spanning Tree Protocol, STP) mode, the rapid spanning tree protocol (Rapid Spanning Tree Protocol, RSTP) mode, and the multiple spanning tree protocol (Multiple Spanning Tree Protocol, MSTP) mode. Among them, the STP mode has the lowest priority and the MSTP mode has the highest priority. The port of the first device running the high-priority spanning tree protocol mode can allow the second device running the low-priority spanning tree protocol mode to access, and the port of the first device can switch the high-priority spanning tree protocol mode to the low-priority spanning tree protocol mode. For example, the port of the first device running the MSTP mode allows the second device running the STP mode to access, and the port of the first device can switch the MSTP mode to the STP mode.
[0133] In the above process, after the first device port switches to the low priority spanning tree protocol mode, it may not be able to perceive that the second device is removed from the port or changes the spanning tree protocol mode, and it always runs in the low priority spanning tree protocol mode, resulting in low network stability.
[0134] In order to solve the above technical problems, the embodiment of the present application provides a network update method, wherein an upstream device sends a BPDU message to a downstream device in the current port mode to inform the downstream device of the first port mode with the highest priority supported by the upstream device, so that the downstream device determines the target port mode according to the first port mode and the second port mode with the highest priority supported by the downstream device, and sends a response message in the target port mode when the target port mode is greater than the current port mode, and the response message is used to indicate that the mode of the port is updated to the target port mode. In this way, the upstream device sends a BPDU message to the downstream device to indicate the first port mode supported by the upstream device, and the downstream device can determine the target port mode with a higher priority than the current port mode according to the first port mode and the second port mode supported by itself, and improve the convergence rate of the link between the upstream device and the downstream device through the target port mode to improve the stability of the network.
[0135] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0136] Figure 2 A flowchart of a network update method provided in an embodiment of the present application. Figure 2 , Figure 2The method includes a first device and a second device, wherein the first device is connected to the second device through a port, and the second device is a downstream device of the first device. The method includes:
[0137] S201: A first device obtains a current port mode of a port and a first port mode supported by the first device.
[0138] The port may be a port corresponding to the first device, and the port may be a designated port through which the first device and the second device can be connected.
[0139] The current port mode or the first port mode may include a first preset mode, a second preset mode, and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
[0140] Optionally, the port mode may be represented by a preset value.
[0141] For example, the first preset mode is 1, the second preset mode is 2, and the third preset mode is 3.
[0142] When the port is in a stable state, the first device can obtain port parameters of the port and first device parameters of the first device, determine the current port mode according to the port parameters, determine the highest priority port mode supported by the first device according to the first device parameters, and determine the highest priority port mode as the first port mode.
[0143] S202: If the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, the first device sends a bridge protocol data unit BPDU message to the second device according to the current port mode.
[0144] A Bridge Protocol Data Unit (BPDU) message is used to indicate the first port mode.
[0145] BPDU messages can also be used to detect network status in real time and determine whether the network topology has changed.
[0146] The first device can determine whether the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode. If so, it can generate a BPDU message and send a bridge protocol data unit BPDU message to the second device according to the current port mode; if not, the port maintains the current port mode unchanged.
[0147] Optionally, the BPDU message may be generated in the following manner: generating the BPDU message according to the first port mode.
[0148] Optionally, the BPDU message may be generated in the following manner: generating the BPDU message according to the first port mode and the current port mode.
[0149] It should be noted that the BPDU message can be generated according to any feasible implementation method, and the embodiments of the present application are not limited to this.
[0150] S203: The second device determines, according to the BPDU message, a first port mode supported by the first device.
[0151] Optionally, the BPDU message may be parsed to determine a first port mode supported by the first device.
[0152] Optionally, the BPDU message may be parsed to determine whether the BPDU message has a newly added field, obtain a determination result, and determine the first port mode supported by the first device according to the determination result.
[0153] It should be noted that the first port mode supported by the first device may be determined according to any feasible implementation manner, and this embodiment of the present application does not limit this.
[0154] S204: The second device obtains a second port mode supported by the second device.
[0155] The second port mode may be a port mode with the highest priority supported by the second device.
[0156] The second port mode may include a first preset mode, a second preset mode and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
[0157] The second device may obtain second device parameters, determine the highest priority port mode supported by the second device according to the second device parameters, and determine the highest priority port mode as the second port mode.
[0158] S205: The second device determines the port mode with a lower priority between the first port mode and the second port mode as the target port mode.
[0159] The target port mode may be a port mode with a lower priority among the first port mode and the second port mode.
[0160] The second device can determine a first priority corresponding to the first port mode and a second priority corresponding to the second port mode, and judge whether the first priority is lower than the second priority. If so, the first port mode is determined as the target port mode; if not, the second port mode is determined as the target port mode.
[0161] S206: If the priority of the target port mode is higher than the priority of the current port mode, the second device sends a response message to the first device according to the target port mode.
[0162] The response message is used to indicate that the port mode is updated to the target port mode.
[0163] The response message may be sent through the target port mode, and the preset field in the response message may carry the first identifier.
[0164] It can be determined whether the priority of the target port mode is higher than the priority of the current port mode. If so, the second device can send a response message to the first device through the target port mode. If not, the second device can send a first message to the first device according to the current port mode, and the first message is used to indicate that the current port mode remains unchanged, or the second device may not send a response message to the first device.
[0165] Optionally, after the first device receives the response message, the first device may perform port update according to the target port mode.
[0166] The network update method provided in this embodiment obtains the current port mode of the port and the first port mode supported by the first device through the first device. If the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, the first device sends a bridge protocol data unit BPDU message to the second device according to the current port mode, and the BPDU message is used to indicate the first port mode. The second device determines the first port mode supported by the first device according to the BPDU message. The second device obtains the second port mode supported by the second device. The second device determines the port mode with a lower priority between the first port mode and the second port mode as the target port mode. If the priority of the target port mode is higher than the priority of the current port mode, the second device sends a response message to the first device according to the target port mode, and the response message is used to indicate that the mode of the port is updated to the target port mode. In this way, the upstream device sends the BPDU message to the downstream device to indicate the first port mode supported by the upstream device. The downstream device can determine the target port mode with a higher priority than the current port mode according to the first port mode and the second port mode supported by itself. The convergence rate of the link between the upstream device and the downstream device is improved through the target port mode to improve the stability of the network.
[0167] Next, combine Figure 3 , a process (S202) in which the first device sends a BPDU message to the second device according to the current port mode is explained.
[0168] Figure 3 A flowchart of another network update method provided in an embodiment of the present application. Based on the above embodiment, see Figure 3 , the method is described in detail. The method comprises:
[0169] S301: Obtain an initial message.
[0170] The initial message may include the protocol version, root bridge identifier, root path cost, sending bridge identifier, port identifier, message age, maximum lifetime, Hello time, forwarding delay, etc.
[0171] The initial message can be used to ensure the stability and reliability of the network.
[0172] The first device may obtain first device parameters and network information, and generate an initial message according to the first device parameters and the network information.
[0173] S302: Determine the number of fields to be newly added according to the first port mode and the current port mode.
[0174] The newly added field may be used to indicate the first port mode.
[0175] The number of fields may be determined according to different first port modes and different current port modes.
[0176] Different first port modes and different current port modes may correspond to different numbers of fields.
[0177] A first target rule may be determined from a plurality of first preset rules according to the first port mode and the current port mode, and the number of fields of the newly added field may be determined according to the first target rule.
[0178] Among them, the first preset rule can be determined according to actual conditions and is not limited here.
[0179] Optionally, the number of fields of the newly added fields can be determined according to the first port mode and the current port mode in the following manner: if the current port mode is the first preset mode and the first port mode is the second preset mode, the number of fields of the newly added fields is determined to be the first number; if the current port mode is the second preset mode and the first port mode is the third preset mode, the number of fields of the newly added fields is determined to be the second number; if the current port mode is the first preset mode and the first port mode is the third preset mode, the number of fields of the newly added fields is determined to be the third number.
[0180] The priority of the third preset mode is greater than that of the second preset mode, and the priority of the second preset mode is greater than that of the first preset mode.
[0181] For example, the first number may be 1, the second number may be 2, and the third number may be 3.
[0182] S303: Determine the field content of the newly added field according to the first port mode and the current port mode.
[0183] The field content may be determined according to different first port modes and different current port modes.
[0184] Different first port modes and different current port modes may correspond to different field contents.
[0185] The field content can be used to distinguish different first port modes and different current port modes.
[0186] A second target rule may be determined from a plurality of second preset rules according to the first port mode and the current port mode, and the field content of the newly added field may be determined according to the second target rule.
[0187] Among them, the second preset rule can be determined according to actual conditions and is not limited here.
[0188] Optionally, the field content of the newly added field can be determined according to the first port mode and the current port mode in the following manner: if the current port mode is the first preset mode and the first port mode is the second preset mode, the field content of the newly added field is determined to be the first content; if the current port mode is the second preset mode and the first port mode is the third preset mode, the field content of the newly added field is determined to be the second content; if the current port mode is the first preset mode and the first port mode is the third preset mode, the field content of the newly added field is determined to be the first content and the second content.
[0189] The first content and the second content can be determined according to actual conditions and are not limited here.
[0190] For example, the first content may be 35, and the second content may be 0X0001.
[0191] S304. Add new fields to the initial message according to the number of fields, and fill the field contents into the corresponding new fields to obtain a BPDU message.
[0192] There may be a first mapping relationship between the field quantity and the newly added field, and the first mapping relationship may include multiple field quantities and the newly added field corresponding to each field quantity.
[0193] The newly added field may include the first field, or may include the second field and the third field, or may include the first field, the second field and the third field.
[0194] There may be a second mapping relationship between the newly added field and the field content, and the second mapping relationship may include multiple newly added fields and the field content corresponding to each newly added field.
[0195] For example, the first content corresponds to the first field, and the second content corresponds to the second field and the third field.
[0196] A number of new fields may be added to the initial message, and the field contents may be filled into the corresponding new fields. The filled initial message may be compressed to obtain a BPDU message.
[0197] Optionally, a new field can be added to the initial message according to the number of fields, and the field content is filled into the corresponding new field to obtain a BPDU message in the following manner: if the number of fields is the first number, a first field is added to the initial message, and the first content is filled into the first field to obtain a BPDU message; if the number of fields is the second number, a second field and a third field are added to the initial message, and the second content is filled into the second field and the third field to obtain a BPDU message; if the number of fields is the third number, a first field, a second field and a third field are added to the initial message, and the first content is filled into the first field, and the second content is filled into the second field and the third field to obtain a BPDU message.
[0198] Next, combine Figure 4 , an example is given to illustrate the BPDU message.
[0199] Figure 4 A schematic diagram of the BPDU message structure provided in the embodiment of the present application. Figure 4 , Figure 4 It may include the destination media access control address (DMAC), source media access control address (SMAC), length / type (L / T), logical link control header (LLC Header) and spanning tree protocol (STP).
[0200] The DMAC can be the physical address of the target device to which the data frame or packet is to be sent. The DMAC can be used to identify the recipient of data in a local area network (LAN).
[0201] SMAC can be the physical address of the source device that sends the data frame or data packet. SMAC can be used to identify the source of the data.
[0202] L / T can be used to indicate the length of the subsequent data field or the type of data carried.
[0203] LLC Header can be used to provide reliable data transmission and flow control functions at the data link layer.
[0204] The spanning tree protocol may include an initial message, which may include a protocol version, a root bridge identifier, a root path cost, a sending bridge identifier, a port identifier, a message age, a maximum lifetime, a Hello time, a forwarding delay, etc. The spanning tree protocol may also include a newly added field.
[0205] S305: Send a BPDU message to the second device according to the current port mode.
[0206] The BPDU message may be sent to the second device in the current port mode.
[0207] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0208] The present embodiment provides a network update method, which obtains an initial message, determines the number of fields of the newly added field according to the first port mode and the current port mode, determines the field content of the newly added field according to the first port mode and the current port mode, adds the newly added field to the initial message according to the number of fields, and fills the field content into the corresponding newly added field to obtain a BPDU message, and sends the BPDU message to the second device according to the current port mode. In this way, the upstream device sends the BPDU message to the downstream device to indicate the first port mode supported by the upstream device, and the downstream device can determine the target port mode with a higher priority than the current port mode according to the first port mode and the second port mode supported by itself, and improve the convergence rate of the link between the upstream device and the downstream device through the target port mode to improve the stability of the network.
[0209] Next, combine Figure 5 , a process (S202) in which the second device determines the first port mode supported by the first device according to the current port mode and the BPDU message is explained.
[0210] Figure 5 A flowchart of another network update method provided in an embodiment of the present application. Based on the above embodiment, see Figure 5 , the method is described in detail. The method comprises:
[0211] S501. Determine whether a BPDU message has a newly added field.
[0212] If yes, execute S502;
[0213] If not, execute S504.
[0214] The BPDU message is parsed to determine multiple fields corresponding to the spanning tree protocol. If the current port mode is the first preset mode, it is determined whether the number of first fields corresponding to the multiple fields is greater than a first threshold. When the number of first fields is greater than the first threshold, it is determined that there are new fields in the BPDU message. When the number of first fields is less than or equal to the first threshold, it is determined that there are no new fields in the BPDU message. If the current port mode is the second preset mode, it is determined whether the number of second fields corresponding to the multiple fields is greater than a second threshold. When the number of second fields is greater than the second threshold, it is determined that there are new fields in the BPDU message. When the number of second fields is less than or equal to the second threshold, it is determined that there are no new fields in the BPDU message.
[0215] The first threshold is smaller than the second threshold.
[0216] For example, the first threshold is 35 and the second threshold is 36.
[0217] S502: Determine a newly added field corresponding to the BPDU message.
[0218] If the current port mode is the first preset mode, the field exceeding the first threshold may be determined as a newly added field. If the current port mode is the second preset mode, the field exceeding the second threshold may be determined as a newly added field.
[0219] S503: Determine a first port mode supported by the first device according to the current port mode and the newly added field.
[0220] A third mapping relationship may be obtained, and the first port mode supported by the first device may be determined according to the third mapping relationship, the current port mode, and the newly added field.
[0221] The third mapping relationship may include multiple current port modes, the first port modes corresponding to each current port mode, and the field content of the newly added field corresponding to each first port mode.
[0222] Optionally, when the current port mode is the first preset mode, the first port mode supported by the first device can be determined according to the current port mode and the newly added field in the following manner: determine whether the first field exists in the newly added field, and the content corresponding to the first field is the first content; if so, determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode; if not, determine that the first port mode supported by the first device is the second preset mode.
[0223] For example, assume that the first field is the 36th field, the first content is 35, the second field is the 37th and 38th field, and the second content is 0X0001.
[0224] It can be determined whether there is a 36th field in the newly added field, and the content corresponding to the 36th field is 35. If so, it can be determined whether there are 37th and 38th fields in the newly added field, and the contents corresponding to the 37th and 38th fields are 0X0001. If so, it is determined that the first port mode supported by the first device is MSTP. If not, it is determined that the first port mode supported by the first device is RSTP.
[0225] Optionally, when the current port mode is the second preset mode, the first port mode supported by the first device can be determined according to the current port mode and the newly added field in the following manner: determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode.
[0226] For example, assume that the second field is the 37th or 38th field, and the second content is 0X0001.
[0227] It can be determined whether there are 37th and 38th fields in the newly added field, and the contents corresponding to the 37th and 38th fields are 0X0001. If so, it is determined that the first port mode supported by the first device is MSTP.
[0228] S504: Determine to keep the current port mode unchanged.
[0229] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0230] The network update method provided in this embodiment determines whether there is a newly added field in the BPDU message. If so, the newly added field corresponding to the BPDU message is determined, and the first port mode supported by the first device is determined according to the current port mode and the newly added field. If not, the current port mode is determined to remain unchanged. In this way, the upstream device sends a BPDU message to the downstream device to indicate the first port mode supported by the upstream device. The downstream device can determine a target port mode with a higher priority than the current port mode according to the first port mode and the second port mode supported by itself. Through the target port mode, the convergence rate of the link between the upstream device and the downstream device is improved to improve the stability of the network.
[0231] Figure 6 This is a schematic diagram of the structure of a network update device provided in an embodiment of the present application. Figure 6 , applied to a first device, the first device is connected to a second device through a port, the second device is a downstream device of the first device, the apparatus 600 includes an acquisition module 601, a sending module 602 and a receiving module 603, wherein,
[0232] An acquisition module 601 is used to acquire a current port mode of the port and a first port mode supported by the first device;
[0233] A sending module 602 is configured to send a bridge protocol data unit BPDU message to the second device according to the current port mode if the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, wherein the BPDU message is used to indicate the first port mode;
[0234] The receiving module 603 is used to receive a response message sent by the second device in a target port mode, wherein the response message is used to indicate that the mode of the port is updated to the target port mode, and the target port mode is determined by the second device based on the first port mode and the port mode supported by the second device.
[0235] In a possible implementation manner, the sending module 602 is specifically configured to:
[0236] Get the initial message;
[0237] Determine the number of fields to be newly added according to the first port mode and the current port mode;
[0238] Determining the field content of the newly added field according to the first port mode and the current port mode;
[0239] According to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message;
[0240] According to the current port mode, the BPDU message is sent to the second device.
[0241] In a possible implementation manner, the sending module 602 is specifically configured to:
[0242] Determine the number of fields to be newly added according to the first port mode and the current port mode;
[0243] Determining the field content of the newly added field according to the first port mode and the current port mode;
[0244] According to the number of fields, the newly added fields are added to the initial message, and the field contents are filled into the corresponding newly added fields to obtain the BPDU message.
[0245] In a possible implementation manner, the sending module 602 is specifically configured to:
[0246] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the number of fields of the newly added field is the first number;
[0247] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is the second number;
[0248] If the current port mode is the first preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is a third number;
[0249] The priority of the third preset mode is greater than that of the second preset mode, and the priority of the second preset mode is greater than that of the first preset mode.
[0250] In a possible implementation manner, the sending module 602 is specifically configured to:
[0251] If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the field content of the newly added field is the first content;
[0252] If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the field content of the newly added field is the second content;
[0253] If the current port mode is the first preset mode, and the first port mode is the third preset mode, it is determined that the field content of the newly added field is the first content and the second content.
[0254] In a possible implementation manner, the sending module 602 is specifically configured to:
[0255] If the number of fields is the first number, a first field is added to the initial message, and the first content is filled into the first field to obtain the BPDU message;
[0256] If the number of fields is the second number, a second field and a third field are added to the initial message, and the second content is filled into the second field and the third field to obtain the BPDU message;
[0257] If the number of fields is the third number, the first field, the second field and the third field are newly added to the initial message, the first content is filled into the first field, and the second content is filled into the second field and the third field, to obtain the BPDU message.
[0258] Figure 7This is a schematic diagram of the structure of another network update device provided in an embodiment of the present application. Figure 7 , applied to a second device, the second device is connected to a first device through a port, the first device is an upstream device of the second device, the apparatus 700 includes a receiving module 701, an acquiring module 702, a determining module 703 and a sending module 704, wherein,
[0259] The receiving module 701 is used to receive a BPDU message sent by the first device in the current port mode, and determine a first port mode supported by the first device according to the BPDU message;
[0260] An acquisition module 702 is used to acquire a second port mode supported by the second device;
[0261] A determination module 703, configured to determine a port mode with a lower priority between the first port mode and the second port mode as a target port mode;
[0262] The sending module 704 is used to send a response message to the first device according to the target port mode if the priority of the target port mode is higher than the priority of the current port mode, and the response message is used to indicate that the mode of the port is updated to the target port mode.
[0263] In a possible implementation manner, the receiving module 701 is specifically configured to:
[0264] Determine whether the BPDU message contains a new field;
[0265] If yes, determine a newly added field corresponding to the BPDU message, and determine a first port mode supported by the first device according to the current port mode and the newly added field;
[0266] The first port mode includes a first preset mode, a second preset mode and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
[0267] In a possible implementation manner, when the current port mode is the first preset mode, the receiving module 701 is specifically configured to:
[0268] Determine whether the newly added field contains a first field, and whether the content corresponding to the first field is the first content;
[0269] If so, determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode; if not, determine that the first port mode supported by the first device is the second preset mode.
[0270] In a possible implementation manner, when the current port mode is the second preset mode, the receiving module 701 is specifically configured to:
[0271] Determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content;
[0272] If so, determine that the first port mode supported by the first device is the third preset mode.
[0273] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 , the electronic device 800 may include: a memory 801 , a processor 802 , and a transceiver 803 .
[0274] The memory 801 is used to store program instructions;
[0275] The processor 802 is used to execute the program instructions stored in the memory, so as to enable the electronic device 800 to execute the above method.
[0276] The transceiver 803 may include: a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or the like, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or the like. Exemplarily, the memory 801, the processor 802, and the transceiver 803 are interconnected via a bus 804.
[0277] The embodiment of the present application also provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above method can be implemented.
[0278] The network update device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned network update method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.
[0279] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The above-mentioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the above-mentioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0280] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer executable instructions. These computer executable instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable network update device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable network update device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0281] These computer executable instructions may also be stored in a computer readable memory capable of directing a computer or other programmable network update device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0282] These computer executable instructions may also be loaded onto a computer or other programmable network update device so that a series of operating steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0283] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A network updating method, characterized in that: Applied to a first device, the first device is connected to a second device through a port, and the second device is a downstream device of the first device, the method includes: Acquire a current port mode of the port and a first port mode supported by the first device; If the priority corresponding to the first port mode is higher than the priority corresponding to the current port mode, sending a bridge protocol data unit BPDU message to the second device according to the current port mode, where the BPDU message is used to indicate the first port mode; Receive a response message sent by the second device in a target port mode, wherein the response message is used to indicate that the mode of the port is updated to the target port mode, the priority of the target port mode is higher than the priority of the current port mode, and the target port mode is a port mode with a lower priority between the first port mode and the second port mode supported by the second device.
2. The method according to claim 1, characterized in that According to the current port mode, sending a bridge protocol data unit BPDU message to the second device includes: Get the initial message; Determine the number of fields to be newly added according to the first port mode and the current port mode; Determining the field content of the newly added field according to the first port mode and the current port mode; According to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message; According to the current port mode, the BPDU message is sent to the second device.
3. The method according to claim 2, characterized in that Determining the number of fields of the newly added fields according to the first port mode and the current port mode includes: If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the number of fields of the newly added field is the first number; If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is the second number; If the current port mode is the first preset mode, and the first port mode is the third preset mode, determining that the number of fields of the newly added field is a third number; The priority of the third preset mode is greater than that of the second preset mode, and the priority of the second preset mode is greater than that of the first preset mode.
4. The method according to claim 2 or 3, characterized in that: Determining, according to the first port mode and the current port mode, field content of the newly added field includes: If the current port mode is the first preset mode, and the first port mode is the second preset mode, determining that the field content of the newly added field is the first content; If the current port mode is the second preset mode, and the first port mode is the third preset mode, determining that the field content of the newly added field is the second content; If the current port mode is the first preset mode, and the first port mode is the third preset mode, it is determined that the field content of the newly added field is the first content and the second content.
5. The method according to claim 4, characterized in that According to the number of fields, the newly added field is added to the initial message, and the field content is filled into the corresponding newly added field to obtain the BPDU message, including: If the number of fields is the first number, a first field is added to the initial message, and the first content is filled into the first field to obtain the BPDU message; If the number of fields is the second number, a second field and a third field are added to the initial message, and the second content is filled into the second field and the third field to obtain the BPDU message; If the number of fields is the third number, the first field, the second field and the third field are newly added to the initial message, the first content is filled into the first field, and the second content is filled into the second field and the third field, to obtain the BPDU message.
6. A network updating method, characterized in that: Applied to a second device, the second device is connected to a first device through a port, and the first device is an upstream device of the second device, the method includes: Receiving a BPDU message sent by the first device in a current port mode, and determining a first port mode supported by the first device according to the BPDU message; Acquire a second port mode supported by the second device; Determine the port mode with a lower priority between the first port mode and the second port mode as the target port mode; If the priority of the target port mode is higher than the priority of the current port mode, a response message is sent to the first device according to the target port mode, where the response message is used to indicate that the mode of the port is updated to the target port mode.
7. The method according to claim 6, characterized in that Determining, according to the BPDU message, a first port mode supported by the first device, including: Determine whether the BPDU message contains a new field; If yes, determine a newly added field corresponding to the BPDU message, and determine a first port mode supported by the first device according to the current port mode and the newly added field; The first port mode includes a first preset mode, a second preset mode and a third preset mode, the priority of the third preset mode is greater than the priority of the second preset mode, and the priority of the second preset mode is greater than the priority of the first preset mode.
8. The method according to claim 7, characterized in that When the current port mode is the first preset mode, determining a first port mode supported by the first device according to the current port mode and the newly added field includes: Determine whether the newly added field contains a first field, and whether the content corresponding to the first field is the first content; If so, determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; if so, determine that the first port mode supported by the first device is the third preset mode; if not, determine that the first port mode supported by the first device is the second preset mode.
9. The method according to claim 7, characterized in that: When the current port mode is the second preset mode, determining, according to the current port mode and the newly added field, a first port mode supported by the first device includes: Determine whether the second field and the third field exist in the newly added field, and the corresponding content in the second field and the third field is the second content; If so, determine that the first port mode supported by the first device is the third preset mode.
10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 9.
Citation Information
Patent Citations
Method and switching equipment for triggering downstream equipment to process packet
CN101014040A
Network topology computing method and network topology computing device
CN103139080A
Port resource reservation method, electronic equipment and storage medium
CN113543234A
Method and device for preventing port blockage, electronic equipment and storage medium
CN114338563A
Handling port identifier overflow in spanning tree protocol
US20170104665A1
