CN116866457A - Loop detection message processing method and device for two-layer network - Google Patents

Loop detection message processing method and device for two-layer network Download PDF

Info

Publication number
CN116866457A
CN116866457A CN202311127762.3A CN202311127762A CN116866457A CN 116866457 A CN116866457 A CN 116866457A CN 202311127762 A CN202311127762 A CN 202311127762A CN 116866457 A CN116866457 A CN 116866457A
Authority
CN
China
Prior art keywords
message
loop detection
survival time
field
detection message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311127762.3A
Other languages
Chinese (zh)
Inventor
秦佳
王志奇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changzhou Nanfei Microelectronics Co ltd
Original Assignee
Changzhou Nanfei Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changzhou Nanfei Microelectronics Co ltd filed Critical Changzhou Nanfei Microelectronics Co ltd
Priority to CN202311127762.3A priority Critical patent/CN116866457A/en
Publication of CN116866457A publication Critical patent/CN116866457A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/18Loop-free operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a loop detection message processing method and device for a two-layer network, and belongs to the technical field of communication. The loop detection message processing method of the two-layer network is applied to a receiving side of loop detection and comprises the following steps: acquiring a loop detection message, wherein the loop detection message is at least packaged with a message survival time field and a message source MAC field; judging whether the current equipment is source equipment or not based on the message source MAC field; determining that the current equipment is non-source equipment, processing a message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network. The network storm of the loop detection message on the non-source equipment can be terminated rapidly, the network resources on the non-source equipment are reduced to be occupied in a large amount, the bandwidth is saved, and the bandwidth is not wasted.

Description

Loop detection message processing method and device for two-layer network
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for processing a loop detection message of a two-layer network, a device for processing a loop detection message of a two-layer network, a machine-readable storage medium, and a processor.
Background
In ethernet networks, two-layer networks are used to exchange and forward two-layer data and protocol messages within the local area network. Due to the characteristics of simple networking principle, complex and various physical connection paths and the like, loop problems are easy to occur in the networking topology of an actual two-layer network, so that network storm is caused, a large amount of network bandwidth is occupied, and normal two-layer message receiving and transmitting are influenced.
For the loop problem in the two-layer network, the prior art adopts a scheme that a self-defined loop detection message is sent in a broadcast mode, and a plurality of relevant fields are carried in the sent message for judging the loop condition; and when receiving, judging and processing according to the relevant fields carried in the loop detection message.
However, since loop detection is initiated from the source device, the purpose is to detect its own loop associated with the source device, rather than a loop built by other devices in the network. When the prior art is used for loop detection, detection messages are sent to other loops for summarization due to network interconnection, but the loop detection and diagnosis of other devices are not assisted in practice. But other loops can also cause network storms and occupy bandwidth, thereby exacerbating the network storms and wasting bandwidth.
Disclosure of Invention
The purpose of the embodiment of the application is to provide a loop detection message processing method of a two-layer network, a loop detection message processing device of the two-layer network, a machine-readable storage medium and a processor, wherein the loop detection message processing method of the two-layer network can judge whether to terminate the loop detection message according to a message survival time field, thereby rapidly terminating the network storm of the loop detection message on non-source equipment, reducing the occupation of a large amount of network resources on the non-source equipment, saving bandwidth and avoiding the waste of bandwidth.
In order to achieve the above object, a first aspect of the present application provides a method for processing a loop detection message of a two-layer network, which is applied to a receiving side of loop detection, and includes:
acquiring a loop detection message, wherein the loop detection message is at least packaged with a message survival time field and a message source MAC field;
judging whether the current equipment is source equipment or not based on the message source MAC field;
determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time;
The message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network.
In the embodiment of the application, a message Source Port field is also encapsulated in the loop detection message, and the message Source Port field is used for identifying an actual Port of the Source equipment for sending the loop detection message;
the processing method further comprises the following steps:
determining the current equipment as source equipment, recording that a loop exists, and terminating the loop detection message;
the loop exists between a Port corresponding to the message Source Port field and an actually-entered Port of the loop detection message.
In the embodiment of the present application, the processing the packet survival time field according to a preset rule to obtain a new survival time, and determining whether to terminate the loop detection packet based on the new survival time includes:
subtracting 1 from the value of the message survival time field to obtain new survival time;
judging whether the new survival time is 0;
determining that the new survival time is 0, and terminating the loop detection message on the current equipment;
and determining that the new survival time is not 0, and continuing to forward the loop detection message in a broadcasting mode by the current equipment.
In the embodiment of the application, the loop detection message is also encapsulated with a message EtherType field and a message source MAC field;
the step of judging whether the current device is the source device based on the message source MAC field comprises the following steps:
identifying the loop detection message based on the EtherType field of the message, and analyzing a message source MAC field in the loop detection message;
and judging whether the current equipment is source equipment or not based on the analysis result of the message source MAC field.
The second aspect of the present application provides a method for processing a loop detection message of a two-layer network, which is applied to a transmitting side of loop detection, and includes:
obtaining the message survival time, and encapsulating a message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
and sending the loop detection message to a receiving side, so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, processes the message survival time field according to a preset rule under the condition that the current device is determined to be a non-source device, obtains new survival time, and determines whether to terminate the loop detection message based on the new survival time.
In the embodiment of the present application, the obtaining the message survival time and encapsulating the message field based on the message survival time includes:
acquiring message sending interval time;
starting a message sending timer based on the message sending interval time;
after the message sending timer is overtime, obtaining the message survival time, and packaging the message field based on the message survival time;
after sending the loop detection message to the receiving side, the method further comprises:
and starting a next message sending timer based on the message sending interval time.
A third aspect of the present application provides a loop detection message processing apparatus for a two-layer network, applied to a receiving side of loop detection, including:
the receiving module is used for acquiring a loop detection message, and the loop detection message is at least packaged with a message survival time field and a message source MAC field; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network;
the judging module is used for judging whether the current equipment is source equipment or not based on the message source MAC field;
and the processing module is used for determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time.
A fourth aspect of the present application provides a loop detection message processing apparatus for a two-layer network, which is applied to a transmitting side of loop detection, including:
the acquisition module is used for acquiring the message survival time and encapsulating the message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
the sending module is used for sending the loop detection message to the receiving side so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, and processes the message survival time field according to a preset rule to obtain new survival time when the current device is determined to be a non-source device, and determines whether to terminate the loop detection message based on the new survival time.
A fifth aspect of the present application provides a processor configured to perform the loop detection message processing method of the two-layer network.
A sixth aspect of the application provides a machine-readable storage medium having stored thereon instructions which, when executed by a processor, cause the processor to be configured to perform the loop detection message processing method of the two-layer network described above.
According to the technical scheme, the loop detection message is received by the receiving side of the loop detection, and at least the message survival time field is packaged in the loop detection message; judging whether the current equipment is source equipment or not based on the message source MAC field; determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network. Because the message survival time field is encapsulated in the loop detection message, after the receiving side receives the loop detection message, whether the loop detection message is terminated can be judged according to the message survival time field, so that the network storm of the loop detection message on the non-source equipment can be terminated rapidly, the network resources on the non-source equipment are occupied in a large amount, the bandwidth is saved, and the bandwidth is not wasted.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain, without limitation, the embodiments of the application. In the drawings:
fig. 1 schematically illustrates a flow chart of a loop detection message processing method of a two-layer network according to an embodiment of the application;
fig. 2 schematically shows a loop detection transmission side processing flow diagram according to an embodiment of the application;
FIG. 3 schematically illustrates a format of a loop detection message according to an embodiment of the present application;
fig. 4 schematically illustrates a flow chart of another loop detection message processing method of a two-layer network according to an embodiment of the application;
fig. 5 schematically shows a loop detection receiving side processing flow according to an embodiment of the present application;
fig. 6 schematically illustrates a network storm diagram of a terminating loop detection message on a non-source device according to an embodiment of the application;
fig. 7 schematically shows a block diagram of a loop detection message processing apparatus of a two-layer network according to an embodiment of the present application;
FIG. 8 is a block diagram schematically illustrating a loop detection message processing apparatus of another two-layer network according to an embodiment of the present application;
Fig. 9 schematically shows an internal structural view of a computer device according to an embodiment of the present application.
Description of the reference numerals
410 a receiving module; 420-judging module; 430-a processing module; 510-an acquisition module; 520-a transmitting module; a01-a processor; a02-a network interface; a03-an internal memory; a04-a display screen; a05-an input device; a06—a nonvolatile storage medium; b01-operating system; b02-computer program.
Detailed Description
The following describes the detailed implementation of the embodiments of the present application with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the application, are not intended to limit the application.
Referring to fig. 1, fig. 1 schematically illustrates a flow chart of a loop detection message processing method of a two-layer network according to an embodiment of the application. A two-layer network device supporting loop detection includes a transmitting side for loop detection and a receiving side for loop detection, and the following describes the scheme from the transmitting side for loop detection and the receiving side for loop detection, respectively. It should be noted that, the source device mentioned in this embodiment refers to a device that generates a loop detection message; non-source devices refer to devices other than the source device, collectively referred to as non-source devices, as opposed to the source device.
The embodiment provides a loop detection message processing method of a two-layer network, which is applied to a sending side of loop detection and comprises the following steps:
step 210: obtaining the message survival time, and encapsulating a message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
in this embodiment, the message survival time may be preset by a user according to needs, and it should be noted that, in order to facilitate processing, the message survival time may be an integer. The encapsulated message field includes an encapsulated message survival time field, and the message survival time is taken as a value of the message survival time field.
The loop detection message may also be encapsulated with other message fields as required, including but not limited to: the message destination MAC field is used for identifying that the message is a broadcast message; the message source MAC field is used for identifying source equipment for generating a message, and when a loop detection message is received, whether the message is processed and terminated by the current equipment is distinguished through the field; the message EtherType field, when receiving the loop detection message, identify the message type through this field; the message Source Port field is used for identifying an actual Port of the Source equipment for sending the loop detection message, and when the Source equipment receives the loop detection message sent by the Source equipment, the Source equipment judges a start Port and an end Port forming a loop through the field and the Port actually entering the message. For example: as shown in fig. 3, the fields of the loop detection message include: destination MAC Address (full F), source MAC Address, etherType, source Port, time-To-Live.
Step 220: and sending the loop detection message to a receiving side, so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, processes the message survival time field according to a preset rule under the condition that the current device is determined to be a non-source device, obtains new survival time, and determines whether to terminate the loop detection message based on the new survival time.
In this embodiment, after the loop detection message is encapsulated, the loop detection message may be sent out from the designated port, so that the device on the receiving side may receive the message conveniently. In the case that the loop detection message includes a message Source Port field, the loop detection message may be sent out from the designated Port according to the value of the message Source Port field.
After receiving the loop detection message, the receiving side judges whether the device is a source device, and if not, the receiving side processes the message survival time field, which specifically can be: firstly subtracting 1 from the value of the Time-To-Live field of the message, namely the message survival Time field, to obtain new survival Time, then judging whether the value of the Time-To-Live field is equal To 0, if so, directly terminating the message on the current equipment, and ending the processing step. If not, the current device continues to forward the message in a broadcasting mode, and the processing step is ended.
In the implementation process, the loop detection message is obtained by acquiring the message survival time at the sending side of the loop detection and packaging the message field based on the message survival time; then the loop detection message is sent out; the device on the receiving side judges whether the current device is a source device or not, and processes the message survival time field according to a preset rule to obtain new survival time when the current device is determined to be a non-source device, and determines whether to terminate the loop detection message based on the new survival time. By encapsulating the message survival time field in the loop detection message, the receiving side can judge whether to terminate the loop detection message according to the message survival time field after receiving the loop detection message, thereby being capable of rapidly terminating the network storm of the loop detection message on the non-source equipment, reducing the occupation of a large amount of network resources on the non-source equipment, saving the bandwidth and avoiding the waste of the bandwidth.
Referring to fig. 2, fig. 2 schematically shows a loop detection transmitting side processing flow chart according to an embodiment of the present application. In some embodiments, the message is sent multiple times in the actual loop detection, so that the loop detection message can be processed by a timer at regular time, so that the network resource on the non-source device can be reduced to be occupied in a large amount in each loop detection. The method comprises the following steps: the step of obtaining the message survival time and packaging the message field based on the message survival time comprises the following steps:
Firstly, acquiring message transmission interval time and message transmission times;
then, based on the message sending interval time, starting a message sending timer;
then, after the message sending timer is overtime, obtaining the message survival time, and packaging the message field based on the message survival time;
correspondingly, after the loop detection message is sent out, the method further comprises: and starting a next message sending timer based on the message sending interval time.
In this embodiment, the message transmission interval time and the message transmission times may be set according to actual needs, and a transmission cycle time=message transmission interval time×message transmission times, and a message transmission timer is started, where the message transmission timer is a loop detection message transmission timer, and the time-out time of the message transmission timer is the above specified message transmission interval time, and when the message transmission timer times out, the operation of packaging the message field is started. Correspondingly, after the loop detection message is sent out, a next timer can be started, and the loop detection message is circulated for a plurality of times according to the message sending times, so that the network storm of the loop detection message on the non-source equipment can be rapidly ended during each loop detection, the network resources on the non-source equipment are greatly occupied, and the bandwidth is saved.
Referring to fig. 4 and fig. 5, fig. 4 schematically illustrates a flowchart of another loop detection message processing method of a two-layer network according to an embodiment of the present application; fig. 5 schematically shows a loop detection receiving side processing flow according to an embodiment of the present application.
The embodiment provides a loop detection message processing method of a two-layer network, which is applied to a receiving side of loop detection and comprises the following steps:
step 310: acquiring a loop detection message, wherein the loop detection message is at least packaged with a message survival time field and a message source MAC field; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network.
In this embodiment, the receiving side of the loop detection includes a plurality of devices, which may be source devices or non-source devices, and each device needs to perform the following steps after receiving the loop detection packet.
Step 320: judging whether the current equipment is source equipment or not based on the message source MAC field;
in this embodiment, in order to solve the problem that in the prior art, the network storm of the loop detection message on the non-source device cannot be terminated, it is first required to determine the non-source device, that is, determine whether the current device is the source device. So as to facilitate the subsequent processing of the loop detection message on the non-source equipment.
In some embodiments, in order to facilitate determining whether the loop detection message is a source device, a message EtherType field and a message source MAC field are further encapsulated in the loop detection message; the step of judging whether the current device is the source device based on the message source MAC field comprises the following steps:
firstly, identifying the loop detection message based on the EtherType field of the message, and analyzing a message source MAC field in the loop detection message;
and then, judging whether the current device is the source device or not based on the analysis result of the message source MAC field.
In this embodiment, the EtherType field is used to identify the message type through the EtherType field when the loop detection message is received; the message source MAC field is used to identify the source device that generates the message, and when the loop detection message is received, it can be distinguished whether the message is processed and terminated by the current device. Whether the current device is the source device can be rapidly identified through the message EtherType field and the message source MAC field.
Step 330: and determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time.
In this embodiment, the preset rule may be set according to actual situations, for example: the rules are: the value of the message time-to-live field is subtracted by a number, such as by 1.
The processing the message survival time field according to a preset rule to obtain a new survival time, and determining whether to terminate the loop detection message based on the new survival time, including:
firstly, subtracting 1 from the value of the message survival time field to obtain new survival time;
then, judging whether the new survival time is 0; determining that the new survival time is 0, and terminating the loop detection message on the current equipment; and determining that the new survival time is not 0, and continuing to forward the loop detection message in a broadcasting mode by the current equipment.
In this embodiment, since the message survival time field is used to indicate the number of devices that can continue forwarding the loop detection message in the two-layer network, after each non-source device receives the loop detection message, the number of devices that remain forwarding is reduced by one. Specifically, the value of the Time-To-Live field of the message, namely the message survival Time field, is subtracted by 1, then whether the value of the Time-To-Live field is equal To 0 is judged, if so, the message is directly terminated on the current equipment, and the processing step is ended; if not, the current device continues to forward the message in a broadcasting mode, and the processing step is ended.
In the implementation process, a loop detection message is received by a receiving side of the loop detection, and at least a message survival time field is packaged in the loop detection message; judging whether the current equipment is source equipment or not based on the message source MAC field; determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network. Because the message survival time field is encapsulated in the loop detection message, after the receiving side receives the loop detection message, whether the loop detection message is terminated can be judged according to the message survival time field, so that the network storm of the loop detection message on the non-source equipment can be terminated rapidly, the network resources on the non-source equipment are occupied in a large amount, the bandwidth is saved, and the bandwidth is not wasted.
In some embodiments, the loop detection message is further encapsulated with a message Source Port field, where the message Source Port field is used to identify an actual Port of the Source device that sends the loop detection message; further comprises: determining the current equipment as source equipment, recording that a loop exists, and terminating the loop detection message;
The loop exists between a Port corresponding to the message Source Port field and an actually-entered Port of the loop detection message.
In this embodiment, if the current device is the Source device of the message, it is indicated that a loop exists, and it may be recorded that a loop exists between the Source Port field of the message and the actual ingress Port of the loop detection message, and the loop detection message is terminated, and the processing step ends.
In the implementation process, under the condition that the current equipment is determined to be the Source equipment, a loop exists between the Source Port field of the message and the actually-entering Port of the message, and the message is terminated, so that the loop problem directly related to the Source equipment in the two-layer network can be timely found, and the loop problem can be timely found.
Referring to fig. 6, fig. 6 schematically shows a network storm diagram of a terminating loop detection message on a non-source device according to an embodiment of the application. The diagram shows a process of detecting a network storm of a message on a non-source device by a termination loop, which specifically comprises the following steps:
1) The source equipment generates a loop detection message (hereinafter referred to as message P) and sends the loop detection message to the non-source equipment 1 through the Port 1;
2) A loop exists among the non-source devices 1, 2 and 3, and the message P is forwarded on the loop among the devices 1, 2 and 3 to generate a network storm;
3) Assuming that the Time-To-Live field of the message P is initially set To 4, after the message P passes through the non-source device 1- >2- >3- >1 or 1- >3- >2- >1, the message P is directly terminated on the non-source device 1 due To the reduction of the Time-To-Live field To 0;
4) Assuming that the Time-To-Live field of the message P is initially set To 5, after the message P passes through the non-source device 1- >2- >3- >1 or 1- >3- >2- >1, the message P may be continuously forwarded on the non-source device 1 because the value of the Time-To-Live field minus 1 is 1. When the message P is forwarded to the source equipment, the source equipment can detect that a loop exists in the external network of the Port1, and the start and the end of the loop are both Port1; when the message is forwarded To the non-source device 2 or 3, the Time-To-Live field is first subtracted by 1 on the non-source device 2 or 3, so that the value of the Time-To-Live field is reduced To 0, the message P is directly terminated, and the message P cannot be forwarded further.
Fig. 1 and fig. 4 are flow diagrams of a loop detection message processing method of a two-layer network in one embodiment. It should be understood that, although the steps in the flowcharts of fig. 1 and 4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 and 4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of the other steps or sub-steps of other steps.
Referring to fig. 7, fig. 7 schematically illustrates a block diagram of a loop detection message processing apparatus of a two-layer network according to an embodiment of the application. The embodiment provides a loop detection message processing device of a two-layer network, which is applied to a receiving side of loop detection, and includes a receiving module 410, a judging module 420 and a processing module 430, wherein:
a receiving module 410, configured to obtain a loop detection packet, where the loop detection packet is at least encapsulated with a packet survival time field and a packet source MAC field; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network;
a judging module 420, configured to judge whether the current device is a source device based on the message source MAC field;
and a processing module 430, configured to determine that the current device is a non-source device, process the packet survival time field according to a preset rule to obtain a new survival time, and determine whether to terminate the loop detection packet based on the new survival time.
The loop detection message processing device of the two-layer network includes a processor and a memory, where the receiving module 410, the judging module 420, the processing module 430, and the like are all stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and network resources on the non-source device are reduced to be occupied in a large amount by adjusting kernel parameters, so that bandwidth is saved, and the bandwidth is not wasted.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Referring to fig. 8, fig. 8 is a block diagram schematically illustrating a loop detection message processing apparatus of another two-layer network according to an embodiment of the present application. The embodiment also provides a loop detection message processing device of a two-layer network, which is applied to a sending side of loop detection, and comprises an acquisition module 510 and a sending module 520, wherein:
an obtaining module 510, configured to obtain a message survival time, and encapsulate a message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
And a sending module 520, configured to send the loop detection message to a receiving side, so that the receiving side determines whether the current device is a source device based on the message source MAC field, and if it is determined that the current device is a non-source device, processes the message survival time field according to a preset rule to obtain a new survival time, and determines whether to terminate the loop detection message based on the new survival time.
The loop detection message processing device of the two-layer network includes a processor and a memory, where the acquisition module 510 and the transmission module 520 are stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and network resources on the non-source device are reduced to be occupied in a large amount by adjusting kernel parameters, so that bandwidth is saved, and the bandwidth is not wasted.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a machine-readable storage medium, which stores a program, and the program realizes the loop detection message processing method of the two-layer network when being executed by a processor.
The embodiment of the invention provides a processor which is used for running a program, wherein the loop detection message processing method of the two-layer network is executed when the program runs.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 9. The computer apparatus includes a processor a01, a network interface a02, a display screen a04, an input device a05, and a memory (not shown in the figure) which are connected through a system bus. Wherein the processor a01 of the computer device is adapted to provide computing and control capabilities. The memory of the computer device includes an internal memory a03 and a nonvolatile storage medium a06. The nonvolatile storage medium a06 stores an operating system B01 and a computer program B02. The internal memory a03 provides an environment for the operation of the operating system B01 and the computer program B02 in the nonvolatile storage medium a06. The network interface a02 of the computer device is used for communication with an external terminal through a network connection. The computer program is executed by the processor A01 to realize a loop detection message processing method of a two-layer network. The display screen a04 of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device a05 of the computer device may be a touch layer covered on the display screen, or may be a key, a track ball or a touch pad arranged on a casing of the computer device, or may be an external keyboard, a touch pad or a mouse.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, the loop detection message processing apparatus of the two-layer network provided by the present application may be implemented as a computer program, and the computer program may be executed on a computer device as shown in fig. 9. The memory of the computer device may store various program modules of the loop detection message processing apparatus that constitute the two-layer network, for example, the receiving module 410, the judging module 420, and the processing module 430 shown in fig. 7; an acquisition module 510 and a transmission module 520 shown in fig. 8. The computer program formed by the program modules causes the processor to execute the steps in the loop detection message processing method of the two-layer network according to the embodiments of the present application described in the present specification.
The computer device shown in fig. 9 may perform step 210 through the acquisition module 510 in the loop detection message processing apparatus of the two-layer network shown in fig. 8, and the computer device may perform step 220 through the transmission module 520. The computer device shown in fig. 9 may perform step 310 through the receiving module 410 in the loop detection message processing apparatus of the two-layer network shown in fig. 7, the computer device may perform step 320 through the judging module 420, and the computer device may perform step 330 through the processing module 430.
The embodiment of the application provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program:
a receiving side applied to loop detection, comprising:
acquiring a loop detection message, wherein the loop detection message is at least packaged with a message survival time field and a message source MAC field;
judging whether the current equipment is source equipment or not based on the message source MAC field;
determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time;
the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network.
In one embodiment, the loop detection message is further encapsulated with a message Source Port field, where the message Source Port field is used to identify an actual Port of the Source device that sends the loop detection message;
the processing method further comprises the following steps:
determining the current equipment as source equipment, recording that a loop exists, and terminating the loop detection message;
The loop exists between a Port corresponding to the message Source Port field and an actually-entered Port of the loop detection message.
In one embodiment, the processing the packet survival time field according to a preset rule to obtain a new survival time, and determining whether to terminate the loop detection packet based on the new survival time includes:
subtracting 1 from the value of the message survival time field to obtain new survival time;
judging whether the new survival time is 0;
determining that the new survival time is 0, and terminating the loop detection message on the current equipment;
and determining that the new survival time is not 0, and continuing to forward the loop detection message in a broadcasting mode by the current equipment.
In one embodiment, the loop detection message is further encapsulated with a message EtherType field and a message source MAC field;
the step of judging whether the current device is the source device based on the message source MAC field comprises the following steps:
identifying the loop detection message based on the EtherType field of the message, and analyzing a message source MAC field in the loop detection message;
and judging whether the current equipment is source equipment or not based on the analysis result of the message source MAC field.
In one embodiment, a transmitting side applied to loop detection includes:
obtaining the message survival time, and encapsulating a message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
and sending the loop detection message to a receiving side, so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, processes the message survival time field according to a preset rule under the condition that the current device is determined to be a non-source device, obtains new survival time, and determines whether to terminate the loop detection message based on the new survival time.
In one embodiment, the obtaining the message survival time and encapsulating the message field based on the message survival time includes:
acquiring message sending interval time;
starting a message sending timer based on the message sending interval time;
after the message sending timer is overtime, obtaining the message survival time, and packaging the message field based on the message survival time;
After sending the loop detection message to the receiving side, the method further comprises:
and starting a next message sending timer based on the message sending interval time.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. The loop detection message processing method of the two-layer network is characterized by being applied to a receiving side of loop detection and comprising the following steps of:
acquiring a loop detection message, wherein the loop detection message is at least packaged with a message survival time field and a message source MAC field;
judging whether the current equipment is source equipment or not based on the message source MAC field;
determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time;
the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network.
2. The method for processing the loop detection message of the two-layer network according to claim 1, wherein a message Source Port field is further encapsulated in the loop detection message, and the message Source Port field is used for identifying an actual Port of the Source device for sending the loop detection message;
The processing method further comprises the following steps:
determining the current equipment as source equipment, recording that a loop exists, and terminating the loop detection message;
the loop exists between a Port corresponding to the message Source Port field and an actually-entered Port of the loop detection message.
3. The method for processing the loop detection message of the two-layer network according to claim 1, wherein the processing the message survival time field according to a preset rule to obtain a new survival time, and determining whether to terminate the loop detection message based on the new survival time comprises:
subtracting 1 from the value of the message survival time field to obtain new survival time;
judging whether the new survival time is 0;
determining that the new survival time is 0, and terminating the loop detection message on the current equipment;
and determining that the new survival time is not 0, and continuing to forward the loop detection message in a broadcasting mode by the current equipment.
4. The method for processing the loop detection message of the two-layer network according to claim 1, wherein the loop detection message is further encapsulated with a message EtherType field;
the step of judging whether the current device is the source device based on the message source MAC field comprises the following steps:
Identifying the loop detection message based on the EtherType field of the message, and analyzing a message source MAC field in the loop detection message;
and judging whether the current equipment is source equipment or not based on the analysis result of the message source MAC field.
5. The loop detection message processing method of the two-layer network is characterized by being applied to a sending side of loop detection and comprising the following steps of:
obtaining the message survival time, and encapsulating a message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
and sending the loop detection message to a receiving side, so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, processes the message survival time field according to a preset rule under the condition that the current device is determined to be a non-source device, obtains new survival time, and determines whether to terminate the loop detection message based on the new survival time.
6. The method for processing loop detection message in two-layer network according to claim 5, wherein the obtaining the message survival time and encapsulating the message field based on the message survival time comprises:
Acquiring message sending interval time;
starting a message sending timer based on the message sending interval time;
after the message sending timer is overtime, obtaining the message survival time, and packaging the message field based on the message survival time;
after sending the loop detection message to the receiving side, the method further comprises:
and starting a next message sending timer based on the message sending interval time.
7. A loop detection message processing apparatus for a two-layer network, which is applied to a receiving side of loop detection, comprising:
the receiving module is used for acquiring a loop detection message, and the loop detection message is at least packaged with a message survival time field and a message source MAC field; the message survival time field is used for indicating the number of devices for continuously forwarding the loop detection message in the two-layer network;
the judging module is used for judging whether the current equipment is source equipment or not based on the message source MAC field;
and the processing module is used for determining that the current equipment is non-source equipment, processing the message survival time field according to a preset rule to obtain new survival time, and determining whether to terminate the loop detection message based on the new survival time.
8. A loop detection message processing apparatus for a two-layer network, which is applied to a transmitting side of loop detection, comprising:
the acquisition module is used for acquiring the message survival time and encapsulating the message field based on the message survival time to obtain a loop detection message; the loop detection message at least comprises a message survival time field and a message source MAC field, wherein the message survival time field is used for indicating the number of devices which can continue forwarding the loop detection message in a two-layer network;
the sending module is used for sending the loop detection message to the receiving side so that the receiving side judges whether the current device is a source device or not based on the message source MAC field, and processes the message survival time field according to a preset rule to obtain new survival time when the current device is determined to be a non-source device, and determines whether to terminate the loop detection message based on the new survival time.
9. A processor configured to perform the loop detection message processing method of the two-layer network according to any one of claims 1 to 6.
10. A machine-readable storage medium having instructions stored thereon, which when executed by a processor cause the processor to be configured to perform the loop detection message processing method of the two-tier network according to any of claims 1 to 6.
CN202311127762.3A 2023-09-04 2023-09-04 Loop detection message processing method and device for two-layer network Pending CN116866457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311127762.3A CN116866457A (en) 2023-09-04 2023-09-04 Loop detection message processing method and device for two-layer network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311127762.3A CN116866457A (en) 2023-09-04 2023-09-04 Loop detection message processing method and device for two-layer network

Publications (1)

Publication Number Publication Date
CN116866457A true CN116866457A (en) 2023-10-10

Family

ID=88219362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311127762.3A Pending CN116866457A (en) 2023-09-04 2023-09-04 Loop detection message processing method and device for two-layer network

Country Status (1)

Country Link
CN (1) CN116866457A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929439A (en) * 2005-09-07 2007-03-14 杭州华为三康技术有限公司 Data transmission method based on domain-segmentation in elastic sectionalized loop network
CN101764750A (en) * 2009-12-07 2010-06-30 福建星网锐捷网络有限公司 Message packaging method and method, device and network equipment for detecting forwarding loop
JP2011004048A (en) * 2009-06-17 2011-01-06 Mitsubishi Electric Corp L2 redundancy communication device
CN102130793A (en) * 2010-11-29 2011-07-20 华为技术有限公司 Method, device and system for processing loop circuit in access network
CN102420721A (en) * 2011-11-30 2012-04-18 瑞斯康达科技发展股份有限公司 Loop detection message packaging method as well as loop detecting method and device
CN103607317A (en) * 2013-10-21 2014-02-26 华为技术有限公司 Two-layer loop detection method, two-layer loop detection device and communication system
WO2017059715A1 (en) * 2015-10-08 2017-04-13 中兴通讯股份有限公司 Data configuration method and device for protecting ring network
CN114567572A (en) * 2022-04-29 2022-05-31 南京金阵微电子技术有限公司 Network loop monitoring method, system, equipment and storage medium
CN116455845A (en) * 2022-10-27 2023-07-18 深圳市厚石网络科技有限公司 Two-layer networking loop isolation method, device and readable medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929439A (en) * 2005-09-07 2007-03-14 杭州华为三康技术有限公司 Data transmission method based on domain-segmentation in elastic sectionalized loop network
JP2011004048A (en) * 2009-06-17 2011-01-06 Mitsubishi Electric Corp L2 redundancy communication device
CN101764750A (en) * 2009-12-07 2010-06-30 福建星网锐捷网络有限公司 Message packaging method and method, device and network equipment for detecting forwarding loop
CN102130793A (en) * 2010-11-29 2011-07-20 华为技术有限公司 Method, device and system for processing loop circuit in access network
CN102420721A (en) * 2011-11-30 2012-04-18 瑞斯康达科技发展股份有限公司 Loop detection message packaging method as well as loop detecting method and device
CN103607317A (en) * 2013-10-21 2014-02-26 华为技术有限公司 Two-layer loop detection method, two-layer loop detection device and communication system
WO2017059715A1 (en) * 2015-10-08 2017-04-13 中兴通讯股份有限公司 Data configuration method and device for protecting ring network
CN114567572A (en) * 2022-04-29 2022-05-31 南京金阵微电子技术有限公司 Network loop monitoring method, system, equipment and storage medium
CN116455845A (en) * 2022-10-27 2023-07-18 深圳市厚石网络科技有限公司 Two-layer networking loop isolation method, device and readable medium

Similar Documents

Publication Publication Date Title
US20060252440A1 (en) Wireless communication device, wireless communication method, and computer program
CN102790776A (en) Heartbeat connection normalizing processing method, terminal, server and communication system
CN114422412B (en) Equipment detection method and device and communication equipment
CN110856052A (en) Flexe implementation method and device supporting multiple granularities and electronic equipment
CN112422361A (en) Switch testing method, device and medium
CN111147313B (en) Message abnormity monitoring method and device, storage medium and electronic equipment
CN105763463B (en) Method and device for transmitting link detection message
CN112737945B (en) Server connection control method and device
CN113794282A (en) Data processing method and device based on intelligent gateway and computer equipment
CN116866457A (en) Loop detection message processing method and device for two-layer network
CN112559565A (en) Abnormity detection method, system and device
CN114301981B (en) Chip service proxy method and related equipment
JP3104221B2 (en) Polling delay avoidance method
CN117575544B (en) Distribution area equipment management method and device, storage medium and electronic equipment
CN113271235B (en) Fuzzy test method and device for network traffic, storage medium and processor
US11770312B2 (en) Service detection method and apparatus, device, and storage medium
CN113630422B (en) Network security data processing method and system based on edge node
CN113904980B (en) Channel switching method, device, switch and storage medium
CN114422064B (en) Message forwarding method and device
CN112737915B (en) Intranet tunnel cross-domain gateway forwarding method, system, equipment and medium based on intelligent network card
CN116260743A (en) Link detection method and device, intelligent network card and storage medium
WO2022206370A1 (en) Pdcch monitoring method and apparatus, terminal, and network side device
US20230403719A1 (en) Method for physical layer monitoring and related apparatuses
CN115314473A (en) Communication method based on LoRa gateway, related equipment and monitoring system
JP3409731B2 (en) Communication message monitoring system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20231010