CN112737883B - Two-layer network data packet transmission method, device and network equipment - Google Patents

Two-layer network data packet transmission method, device and network equipment Download PDF

Info

Publication number
CN112737883B
CN112737883B CN202011578600.8A CN202011578600A CN112737883B CN 112737883 B CN112737883 B CN 112737883B CN 202011578600 A CN202011578600 A CN 202011578600A CN 112737883 B CN112737883 B CN 112737883B
Authority
CN
China
Prior art keywords
data packet
network equipment
request
network
request data
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.)
Active
Application number
CN202011578600.8A
Other languages
Chinese (zh)
Other versions
CN112737883A (en
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.)
China Mobile Communications Group Co Ltd
MIGU Music Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Music Co Ltd
MIGU Culture Technology 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 China Mobile Communications Group Co Ltd, MIGU Music Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011578600.8A priority Critical patent/CN112737883B/en
Publication of CN112737883A publication Critical patent/CN112737883A/en
Application granted granted Critical
Publication of CN112737883B publication Critical patent/CN112737883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes

Abstract

The embodiment of the invention relates to the technical field of communication, in particular to a method, a device and network equipment for transmitting a two-layer network data packet.

Description

Two-layer network data packet transmission method, device and network equipment
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a method, a device and network equipment for transmitting a two-layer network data packet.
Background
With the rapid development of the internet, more and more users use the network, and the network troubleshooting work needs much time and energy to troubleshoot; the general network troubleshooting is performed by some commands and tools, such as: an icmp mode ping, a traceroute mode trace route, a telnet mode detection port and a snmp mode detection network; these are all modes of detecting routes, testing ports and detecting equipment by a network three-layer routing mode; because the three-layer network and the two-layer network have different working modes, the three-layer network is based on the IP address, the pure two-layer network in the two-layer network has no IP address, and the data link layer of the two-layer network is based on the MAC address, the two-layer network is invisible in the three-layer network, so that the two-layer network cannot be tracked based on the three layers.
The current path tracking method of the two-layer network is based on the network topology understanding of the two-layer network by maintainers, and the mac address table of equipment is checked hop by hop to track one hop by one hop. And if the stp protocol is started in the two-layer network, when the stp tree is found to change, the path of the two-layer flow also changes, and the fault location of the two-layer network at present depends on the familiarity of maintainers with the two-layer network to a great extent, so that the tracking efficiency is low and the accuracy is low.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device and network equipment for transmitting a two-layer network data packet, and solves the problems that in the prior art, the fault location of the two-layer network depends on the familiarity of maintainers with the two-layer network to a great extent, so that the tracking efficiency is low and the accuracy is low.
In order to solve the above technical problem, in a first aspect, an embodiment of the present invention provides a method for transmitting a two-layer network packet, including:
the first network equipment sends a request data packet;
the second network equipment receives the request data packet and generates a response data packet, wherein the response data packet comprises the marking information of the second network equipment;
And the second network equipment sends the response data packet to the first network equipment.
In a second aspect, an embodiment of the present invention provides a device for transmitting a two-layer network packet, including:
the first network equipment is used for sending a request data packet;
the second network equipment receives the request data packet and generates a response data packet, wherein the response data packet carries the mark information of the second network equipment;
and the second network equipment sends the response data packet to the first network equipment.
In a third aspect, an embodiment of the present invention provides a network device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the method for network two layer data packet transmission according to the embodiment of the first aspect of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for transmitting a data packet in a two-layer network according to the embodiment of the first aspect of the present invention.
Compared with the prior art, the method and the device have the advantages that the first network device sends the request data packet to the second network device by setting the protocol type of the request data packet, the second network device generates the response data packet after receiving the request data packet, and the response data packet carries the mark information of the second network device, so that the first network device can obtain the transmission path of the request data packet, manual work is not relied on, and the detection efficiency and the detection accuracy are improved.
In addition, the sending, by the first network device, the request packet specifically includes:
the first network equipment generates a request data packet according to a target address, wherein the request data packet comprises a first mark; the first mark is used for recording mark information of a second network device which receives and responds to the request data packet on a data path;
and the first network equipment sends the request data packet to any second network equipment on a data path. The second network equipment which receives and responds to the request data packet through the first mark record, namely, the first mark records the mark information of the second network equipment only when the second network equipment receives the request data packet and sends a response to the first network equipment; the transmission path of the request data packet can be accurately recorded.
In addition, the receiving, by the second network device, the request data packet and generating a response data packet specifically includes:
the second network equipment receives the request data packet;
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
and if the address of the second network equipment is judged to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment. When the request data packet is transmitted, the intermediate device simultaneously responds and forwards the request data packet to generate a response data packet and a forwarding data packet, wherein the response data packet is adaptively modified aiming at a first mark of the request data packet, namely, a second network device which sends the response data packet is recorded in the request data packet returned to the first network device, and the forwarding data packet is not adaptively modified; the terminal device (i.e. the device where the target address is located) only generates the response data packet, i.e. the transmission of the request data packet is finished, and finally the transmission path of the request data packet can be obtained only according to the sequence and the corresponding first mark in the response data packet received by the request terminal (the first network device).
In addition, the request data packet further includes a second flag, where the second flag is used to record the sequence in which the second network device on the data path receives the request data packet;
the updating the first flag to generate a response packet specifically includes:
updating the first mark in the request data packet according to the mark information of the second network equipment, and updating the second mark in the request data packet according to a preset rule to generate a response data packet;
the forwarding the request packet to any second network device on the data path that does not receive the request packet specifically includes:
and updating the second mark in the request data packet according to a preset rule, and forwarding the request data packet to any second network equipment which does not receive the request data packet on a data path. On the basis of recording the second network equipment receiving the request data packet by the first mark, all the second network equipment are required to be mutually associated according to the receiving sequence to obtain the transmission path of the request data packet, the second mark is added, the second mark is updated according to a preset rule once every time the second mark is forwarded, the response data packet and the forwarded data packet are updated, and finally the sequence of each response data packet is obtained according to the preset rule and the second mark in each response data packet.
In addition, the first mark is device attribute information, and the device attribute information is one or more of the following combinations: device name, interface name of sending or receiving request packet, manufacturer.
The second label is a time to live TTL;
the preset rule is as follows: subtracting L from the value of the TTL carried in the request data packet, wherein the L is a preset value;
the initial value of TTL in the request data packet is not less than LN, and N is the number of second network equipment on the data path;
through the TTL value of the survival time, the sequence of each response data packet can be simply and directly obtained, and the TTL only occupies one byte and occupies small space.
In addition, after the second network device sends the response packet to the first network device, the method further includes:
and determining the sequence of the response data packets received by the first network equipment, and determining the flow path of the request data packet according to the first mark in the corresponding response data packet. Finally, the transmission path of the request data packet can be obtained only according to the sequence and the corresponding first mark in the response data packet received by the request end (the first network equipment); when the TTL is used for recording the sequence of the response data packets, if the response data packets are not received within the set time, extracting the TTL values and the equipment attribute information of all the response data packets received by the first network equipment, and sequencing the equipment attribute information based on the TTL values to obtain the flow paths of the request data packets on the second network equipment to be detected.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a flow chart of a method for transmitting a two-layer network packet according to a first embodiment of the present invention;
fig. 2 is a flow chart of a method for transmitting a two-layer network packet according to a second embodiment of the present invention;
fig. 3 is a flow chart of a method for transmitting a two-layer network packet according to a third embodiment of the present invention;
fig. 4 is a block diagram of a network device according to a sixth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, the terms "comprise" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a system, product or apparatus that comprises a list of elements or components is not limited to only those elements or components but may alternatively include other elements or components not expressly listed or inherent to such product or apparatus. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise.
At present, no tool or protocol is used for path tracking temporarily based on the flow of the data packets of the two-layer network, and the current method for determining the path tracking can realize the network topology of the two-layer network through maintenance personnel and track the mac address table of equipment one hop by looking up one hop. And if the two-layer network starts the stp protocol, when the stp tree finds changes, the path of the two-layer flow changes, and the current two-layer network fault location depends on the familiarity degree of maintainers with the two-layer network to a great extent, so that the tracking efficiency is low and the accuracy is low.
Therefore, by setting the protocol type of the request data packet, when the request data packet is transmitted, the intermediate device can simultaneously respond and forward to generate a response data packet and a forwarding data packet, wherein the response data packet is marked with the second network device which sends the request data packet, and the forwarding data packet is not marked; the terminal device (namely the device where the target address is located) only generates the response data packet, namely the transmission of the request data packet is finished, and finally the transmission path of the request data packet can be obtained only according to the response data packet received by the request end (the first network device), so that the detection efficiency and the detection accuracy are improved without depending on manual work. The following description and description will proceed with reference being made to various embodiments.
A first embodiment of the present invention relates to a method for transmitting a two-layer network packet, as shown in fig. 1, including:
a first network device generates a request data packet according to a target Address, such as a Media Access Control Address (MACA), where the request data packet includes a first mark, and the first mark is used to record mark information of a second network device that receives and responds to the request data packet on a data path; the marking information may be device attribute information, such as a device name, a name of an interface that transmits or receives the request packet, and a manufacturer;
The first network device sends the request data packet to any second network device on a data path, wherein the request data packet is used for indicating the second network device to receive the request data packet;
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
if the address of the second network equipment is judged to be matched with the target address, generating the response data packet, and sending the response data packet to the first network equipment;
and determining the flow path of the request data packet according to the sequence of the response data packets received by the first network equipment and the first mark.
The method comprises the steps that a first mark is added in a request data packet by setting a protocol type of the request data packet, a first mark user records a second network device which receives the request data packet on a data path, when the request data packet is transmitted, the intermediate device can simultaneously respond and forward to generate a response data packet and a forwarding data packet, wherein the first mark of the request data packet in the response data packet is adaptively modified, namely the second network device which sends the response data packet is recorded in the request data packet returned to the first network device, and the forwarding data packet is not adaptively modified; the terminal device (i.e. the device where the target address is located) only generates the response data packet, i.e. the transmission of the request data packet is finished, and finally the transmission path of the request data packet can be obtained only according to the sequence and the corresponding first mark in the response data packet received by the request terminal (the first network device), so that the detection efficiency and the detection accuracy are improved without depending on manual work.
On the basis of the foregoing embodiment, as a preferred implementation manner, the request packet further includes a Flags field and a session Identification identifier Identification, the Flags field in the request packet and the response packet have different values, and the Identification in the request packet and the response packet are the same.
A second embodiment of the present invention relates to a method for transmitting a two-layer network packet. The second embodiment is a refinement of the first embodiment. In the second embodiment of the present invention, the request packet includes a first flag and a second flag, where the second flag is used to record a sequence in which the request packet is received by the second network device on the data path, and the second flag is used to record a sequence in which the request packet is received by the second network device on the data path; as shown in fig. 2, the method for transmitting a two-layer network packet includes:
a first network device generates a request data packet for path detection according to a target address, wherein the request data packet comprises a first mark and a second mark, and the first mark is used for recording a second network device receiving the request data packet on a data path;
The first network device sends the request data packet to any second network device on a data path, wherein the request data packet is used for indicating the second network device to receive the request data packet;
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark according to the second network equipment receiving the request data packet, and updating the second mark according to a preset rule to generate a response data packet; sending the response data packet to the first network device; updating the second mark in the request data packet according to a preset rule, and forwarding the request data packet to any second network equipment which does not receive the request data packet on a data path;
if the address of the second network equipment is judged to be matched with the target address, generating the response data packet, and sending the response data packet to the first network equipment;
and determining the flow path of the request data packet according to the sequence of the response data packets received by the first network equipment and the first mark.
In this embodiment, a protocol type of a request packet is set, a first tag is added to the request packet, the first tag records a second network device on a data path that receives the request packet, when the request packet is transmitted, the intermediate device will simultaneously respond and forward to generate a response packet and a forwarding packet, where the first tag in the response packet is adaptively modified, that is, the request packet returned to the first network device is recorded with the second network device that sent the response packet, and the forwarding packet is not adaptively modified; the terminal device (namely the device where the target address is located) only generates a response data packet, namely the transmission of the request data packet is finished, through a second mark, the second mark is updated once per forwarding, the response data packet and the forwarding data packet are updated, finally, the sequence of each response data packet is obtained according to the preset rule and the second mark in each response data packet, and the transmission path of the request data packet can be obtained according to the sequence of the response data packet received by the request end (first network device) and the corresponding first mark.
A third embodiment of the present invention relates to a method for transmitting a two-layer network packet. The third embodiment is a refinement of the first embodiment. In the third embodiment of the present invention, the request packet includes a first tag and a second tag; the first mark is used for recording a second network device receiving the request data packet on a data path; the second mark is used for recording the sequence of receiving the request data packet by the second network equipment on the data path; the first mark is equipment attribute information, and the second mark is Time To Live (TTL); the preset rule is as follows: and subtracting L from the value of the TTL carried in the request data packet, wherein the L is a preset value. As shown in fig. 3, the method for transmitting a two-layer network packet includes:
a first network device generates a request data packet for path detection according To a target Address (Media Access Control Address, physical Address), where the request data packet includes Time To Live (TTL) and device attribute information;
specifically, the type of the two-layer data packet header is set to E-tra in this embodiment, and other options are consistent with the existing protocol, and the E-tra protocol in this embodiment includes the following fields:
TTL: default value is set to 32;
name: a device name;
IF: an interface name;
producer: a manufacturer;
identification: random numbers (for session identification);
Flags:0(request)/1(response);
the device attribute information includes the device name, the interface name of the sending or receiving request data packet, and the manufacturer.
The first network device sends the request data packet to any second network device on a path to be detected, wherein the request data packet is used for indicating that the second network device receives the request data packet;
if the address of the second network device is judged not to be matched with the target address, subtracting 1 from the value of TTL carried in the request data packet, updating the device attribute information according to the device attribute of the second network device to generate a response data packet, sending the response data packet to the first network device, subtracting 1 from the value of TTL carried in the request data packet, and forwarding the response data packet to any second network device which does not receive the request data packet on a path to be detected;
if the address of the second network device is matched with the target address, subtracting 1 from the value of TTL carried in the request data packet, updating the device attribute information according to the device attribute of the second network device to generate a response data packet, and sending the response data packet to the first network device;
Specifically, in this embodiment, the processing of the request packet is divided into 3 ways, where a first network device serving as a requester is only responsible for sending the request packet and receiving the response packet, and a second network device serving as an intermediate device is responsible for forwarding the request packet, generating the response packet, sending the response packet to the first network device, and forwarding the request packet to other second network devices that have not received the request packet; the terminal device, that is, the second network device where the destination address (such as the tracked MAC address) is located, only generates a response packet, and does not forward the packet, and if the address corresponding to the second network device matches the destination address, only sends the response packet, and at this time, transmission ends, and when generating the response packet, except subtracting 1 from the TTL value in the received request packet, it needs to update the device attribute information therein, such as the device name and the manufacturer, so that the first network device side knows the second network device and the sequence through which the request packet passes according to the response information.
And determining the flow path of the request data packet according to the response data packet received by the first network equipment.
Specifically, in this embodiment, after each second network device transmits the request packet, the value of the TTL in the corresponding response packet is correspondingly decreased by 1, so that the response packets may be sorted according to the value of the TTL in the response packet, and further, the transmission order of the request packet in each second network device is obtained according to the order of the device attribute information in the response packet corresponding to each second network device, and finally, the traffic path of the request packet is determined.
On the basis of the foregoing embodiment, as a preferred implementation manner, an initial value of TTL in the request packet is not less than the number of second network devices on the path to be detected.
Specifically, since the value of TTL in the request packet is reduced by 1 each time forwarding is performed, in order to ensure that the request packet can be sent to all second network devices as far as possible in the path to be detected, it is preferable to set the initial value of TTL in the request packet to be not less than the number of second network devices on the path to be detected.
On the basis of the foregoing embodiment, as a preferred implementation manner, the request packet further includes a Flags field and a session Identification identifier Identification, the Flags field in the request packet and the response packet have different values, and the Identification in the request packet and the response packet are the same.
A fourth embodiment of the present invention relates to a method for transmitting a two-layer network packet. The fourth example is a specific application of the third embodiment. In the fourth embodiment of the present invention, the first network device is denoted as P1, the second network device is denoted as P2, P3, …, PN, where PN is the device where the tracked address-MAC address is located, SCR is the source address, and Dst is the destination address.
Specifically, the request packet is:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:32;
Name:1;
If:eht0;
PRODUER:P1;
ID:XXXXX;
flags:0;
step 1, the first network device P1 sends the request data packet to any second network device (P2, P3, …, PN) on the path to be detected;
step 2, after receiving the request data packet, if the P2 determines whether the self address matches the target address, if not, the TTL value carried in the request data packet is subtracted by 1, and the device attribute information in the request data packet is updated according to the device attribute of P2, so as to generate a response data packet, where the response data packet is:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:31;
Name:2;
If:eht0;
PRODUER:P2;
ID:XXXXX;
flags:1;
meanwhile, the P2 also needs to forward the request packet, and in the forwarding process, the P2 needs to mark the transmission path of the request packet, and in this embodiment, the value of TTL is used as a mark, and the value of TTL carried in the request packet is subtracted by 1, so as to generate a forwarding packet:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:31;
Name:1;
If:eht0;
PRODUER:P1;
ID:XXXXX;
flags:0;
Step 3, after receiving the forwarding data packet, the P3 generates a response data packet:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:30;
Name:3;
If:eht0;
PRODUER:P3;
ID:XXXXX;
flags:1;
p3 simultaneously generates a forwarding packet:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:30;
Name:1;
If:eht0;
PRODUER:P1;
ID:XXXXX;
flags:0;
repeating the above steps, if in step N, after the PN receives the forwarding data packet, judging that the self address is matched with the target address, only generating a response data packet:
SRC:AO.AA.AA.AA.AA.AA.AA;
Dst:NO.AA.AA.AA.AA.AA.AA;
Type:E-tra;
TTL:32-N+1;
Name:PN;
If:eht0;
PRODUER:PN;
ID:XXXXX;
flags:1;
the PN sends the response packet to P1, and at this time, it may be determined that the request packet passes through the device where the destination address is located according to the parameter corresponding to the E-tra protocol specific field in the response packet received by the P1 end, and then the traffic path of the request in the two-layer network may be determined by tracing back the parameter corresponding to the E-tra protocol specific field in the packet. And sequencing the corresponding device attribute information according to the TTL values in the response data packets to obtain the device names of the request data packets passing through in sequence, and finally determining that the flow path of the request data packets is P1 → P2 → P3 → … → PN.
A fifth embodiment of the present invention relates to a device for transmitting a two-layer network packet, which is applied to a first network device based on the method for transmitting a two-layer network packet in each of the above embodiments, and includes:
the processing module is used for generating a request data packet according to a target address, wherein the request data packet comprises a first mark, and the first mark is used for recording second network equipment receiving the request data packet on a data path;
A path detection module, configured to send the request packet to any second network device on a data path, where the request packet is used to indicate that the second network device receives the request packet, and:
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
if the address of the second network equipment is judged to be matched with the target address, generating the response data packet, and sending the response data packet to the first network equipment;
and determining the flow path of the request data packet according to the sequence of the response data packets received by the first network equipment and the first mark.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A sixth embodiment of the present invention relates to a network device, which includes a server, as shown in fig. 4, where the server includes a processor (processor)810, a communication Interface (Communications Interface)820, a memory (memory)830 and a communication bus 840, where the processor 810, the communication Interface 820 and the memory 830 complete communication with each other through the communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform the steps of a method for layer two network packet transmission as described in the various embodiments above. Examples include:
a first network device generates a request data packet according to a target address, wherein the request data packet comprises a first mark, and the first mark is used for recording a second network device which receives the request data packet on a data path;
the first network device sends the request data packet to any second network device on a data path, the request data packet is used for indicating the second network device to receive the request data packet, and:
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
If the address of the second network device is judged to be matched with the target address, generating the response data packet, and sending the response data packet to the first network device;
and determining the flow path of the request data packet according to the sequence of the response data packets received by the first network equipment and the first mark.
Where the memory and processor are connected by a communications bus, which may include any number of interconnected buses and bridges, connecting together the various circuits of the memory and one or more processors. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between a communication bus and a transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
A seventh embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, performs the steps of a method for two-layer network packet transmission as described in the various embodiments above. Examples include:
a first network device generates a request data packet according to a target address, wherein the request data packet comprises a first mark, and the first mark is used for recording a second network device which receives the request data packet on a data path;
the first network device sends the request data packet to any second network device on a data path, the request data packet is used for indicating the second network device to receive the request data packet, and:
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
If the address of the second network device is judged to be matched with the target address, generating the response data packet, and sending the response data packet to the first network device;
and determining the flow path of the request data packet according to the sequence of the response data packets received by the first network equipment and the first mark.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (8)

1. A method for transmitting a two-layer network data packet is characterized by comprising the following steps:
the first network equipment sends a request data packet;
the second network equipment receives the request data packet and generates a response data packet, wherein the response data packet carries the mark information of the second network equipment;
the second network equipment sends the response data packet to the first network equipment;
the sending, by the first network device, the request packet specifically includes:
the first network equipment generates a request data packet according to a target address, wherein the request data packet comprises a first mark; the first mark is used for recording mark information of a second network device which receives and responds to the request data packet on a data path;
the first network equipment sends the request data packet to any second network equipment on a data path;
the receiving, by the second network device, the request data packet and generating a response data packet specifically includes:
the second network equipment receives the request data packet;
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
And if the address of the second network equipment is judged to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment.
2. A method for transmitting a two-layer network data packet according to claim 1, wherein the request data packet further includes a second flag, and the second flag is used to record the sequence in which the request data packet is received by a second network device on a data path;
updating the first tag to generate a response packet, specifically including:
updating the first mark in the request data packet according to the mark information of the second network equipment, and updating the second mark in the request data packet according to a preset rule to generate a response data packet;
the forwarding the request packet to any second network device on the data path that does not receive the request packet specifically includes:
and updating the second mark in the request data packet according to a preset rule, and forwarding the request data packet to any second network equipment which does not receive the request data packet on a data path.
3. A method for transmitting data packets in a layer two network according to claim 1, wherein the first flag is device attribute information;
The equipment attribute information is one or more of the following combinations: device name, interface name of sending or receiving request packet, manufacturer.
4. A method for transporting layer two network packets according to claim 2, wherein said second label is a time to live, TTL;
the preset rule is as follows: subtracting L from the value of the TTL carried in the request data packet, wherein the L is a preset value;
and the initial value of TTL in the request data packet is not less than L x N, and N is the number of the second network equipment on the data path.
5. A method for transmitting data packets in a layer two network according to claim 1, wherein after the second network device sends the response data packet to the first network device, the method further comprises:
and determining the sequence of the response data packets received by the first network equipment, and determining the flow path of the request data packet according to the first mark in the corresponding response data packet.
6. A two-tier network packet forwarding apparatus, comprising:
the first network equipment is used for sending a request data packet;
the second network equipment receives the request data packet and generates a response data packet, wherein the response data packet carries the mark information of the second network equipment;
The second network equipment sends the response data packet to the first network equipment;
the sending, by the first network device, the request packet specifically includes:
the first network equipment generates a request data packet according to a target address, wherein the request data packet comprises a first mark; the first mark is used for recording mark information of a second network device which receives and responds to the request data packet on a data path;
the first network equipment sends the request data packet to any second network equipment on a data path;
the receiving, by the second network device, the request data packet and generating a response data packet specifically includes:
the second network equipment receives the request data packet;
if the address of the second network equipment is judged not to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment; the request data packet is forwarded to any second network equipment which does not receive the request data packet on a data path;
and if the address of the second network equipment is judged to be matched with the target address, updating the first mark to generate a response data packet, and sending the response data packet to the first network equipment.
7. A network device, comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of a method for two-tier network packet transmission according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for two-layer network data packet transmission according to any one of claims 1 to 5.
CN202011578600.8A 2020-12-28 2020-12-28 Two-layer network data packet transmission method, device and network equipment Active CN112737883B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011578600.8A CN112737883B (en) 2020-12-28 2020-12-28 Two-layer network data packet transmission method, device and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011578600.8A CN112737883B (en) 2020-12-28 2020-12-28 Two-layer network data packet transmission method, device and network equipment

Publications (2)

Publication Number Publication Date
CN112737883A CN112737883A (en) 2021-04-30
CN112737883B true CN112737883B (en) 2022-07-29

Family

ID=75606457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011578600.8A Active CN112737883B (en) 2020-12-28 2020-12-28 Two-layer network data packet transmission method, device and network equipment

Country Status (1)

Country Link
CN (1) CN112737883B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102148700A (en) * 2010-12-31 2011-08-10 华为技术有限公司 Layer 2 multicast forwarding link failure positioning method and equipment
CN102934398A (en) * 2010-06-01 2013-02-13 雅马哈株式会社 Topology detection system and relay device
EP2843888A1 (en) * 2013-08-30 2015-03-04 Juniper Networks, Inc. Dynamic end-to-end network path setup across multiple network layers
CN104579978A (en) * 2014-12-30 2015-04-29 国网安徽省电力公司芜湖供电公司 Link-layer topology discovery method for dynamic network
CN105072039A (en) * 2015-07-31 2015-11-18 山东蚁巡网络科技有限公司 Link layer network topology discovery method
CN110401568A (en) * 2019-07-31 2019-11-01 普联技术有限公司 A kind of method for discovering network topology and equipment

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5926463A (en) * 1997-10-06 1999-07-20 3Com Corporation Method and apparatus for viewing and managing a configuration of a computer network
US7881214B2 (en) * 2002-10-25 2011-02-01 General Instrument Corporation Method for performing remote testing of network using IP measurement protocol packets
CN100442779C (en) * 2006-02-10 2008-12-10 华为技术有限公司 Control system and data message transmission method in Ethernet
US20090116404A1 (en) * 2007-11-01 2009-05-07 Telefonaktiebolaget Lm Ericsson (Publ) Topology discovery in heterogeneous networks
CN101345655A (en) * 2008-08-15 2009-01-14 中兴通讯股份有限公司 Method for discovering protocol and acquiring network connection information by utilization of link layer
CN101383772B (en) * 2008-09-26 2011-08-10 中兴通讯股份有限公司 Method and device for automatically discovering and establishing MAC route information table
CN102271065B (en) * 2011-08-10 2013-11-06 华为技术有限公司 Multicast forwarding path detection method for two-layer network and switching equipment
US9300483B2 (en) * 2013-03-15 2016-03-29 International Business Machines Corporation Self-routing multicast in a software defined network fabric
US9894122B2 (en) * 2014-10-16 2018-02-13 Cisco Technology, Inc. Traceroute in virtual extenisble local area networks
CN104320347B (en) * 2014-10-31 2017-10-17 新华三技术有限公司 A kind of method and apparatus for actively updating LLDP
CN106936824B (en) * 2017-03-09 2019-12-24 迈普通信技术股份有限公司 LLDP neighbor information processing method and LLDP neighbor information processing device
CN107682202B (en) * 2017-10-26 2021-03-02 新华三技术有限公司 Network equipment management method and device
CN109981323B (en) * 2017-12-28 2022-04-05 华为技术有限公司 Method and network equipment for detecting multicast path state of data link layer
CN109412851B (en) * 2018-10-26 2022-05-17 迈普通信技术股份有限公司 Link layer path detection method, device and system
CN111698125B (en) * 2020-04-17 2022-11-18 新华三信息安全技术有限公司 Communication test method and device
CN111934946A (en) * 2020-07-16 2020-11-13 深信服科技股份有限公司 Network equipment identification method, device, equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934398A (en) * 2010-06-01 2013-02-13 雅马哈株式会社 Topology detection system and relay device
CN102148700A (en) * 2010-12-31 2011-08-10 华为技术有限公司 Layer 2 multicast forwarding link failure positioning method and equipment
EP2843888A1 (en) * 2013-08-30 2015-03-04 Juniper Networks, Inc. Dynamic end-to-end network path setup across multiple network layers
CN104579978A (en) * 2014-12-30 2015-04-29 国网安徽省电力公司芜湖供电公司 Link-layer topology discovery method for dynamic network
CN105072039A (en) * 2015-07-31 2015-11-18 山东蚁巡网络科技有限公司 Link layer network topology discovery method
CN110401568A (en) * 2019-07-31 2019-11-01 普联技术有限公司 A kind of method for discovering network topology and equipment

Also Published As

Publication number Publication date
CN112737883A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
CN109981457B (en) Message processing method, network node and system
CN109246017B (en) Method and device for inquiring multicast forwarding path
CN110034971B (en) Method and device for detecting service chain
CN101536411B (en) Ethernet OAM at intrmediate nodes in a PBT network
KR102569305B1 (en) Data message detection method, device and system
US9559954B2 (en) Indexed segment ID
KR20220062335A (en) Method, apparatus and system for establishing BIER forwarding table entry
US11627070B2 (en) Data packet processing method and apparatus, storage medium, and electronic device
CN105812197A (en) Bit-forwarding ingress router, bit-forwarding router and operation administration maintenance detection method
CN110535768B (en) Multicast data transmission method and related equipment
CN111988266B (en) Method for processing message
CN103354509B (en) The acquisition methods of a kind of link connection information and equipment
CN114365464A (en) Method, equipment and system for forwarding message in SR network
CN105991435A (en) Method and apparatus of acquiring port path
CN109379241A (en) A kind of routing information determines method and device
CN107547242A (en) The acquisition methods and device of VM configuration informations
CN112787922A (en) Message processing method, network node and system
CN113489646B (en) VXLAN-based segmented route transmission method, server, source node and storage medium
CN104780090A (en) VPN multicast transmission method and device PE equipment
JP2023527932A (en) BIER Multicast Traffic Statistics Collection Method, Apparatus, and System
CN112787930B (en) Method, device and storage medium for monitoring running state of peer
US20230327983A1 (en) Performance measurement in a segment routing network
CN112737883B (en) Two-layer network data packet transmission method, device and network equipment
US20230155933A1 (en) BIER OAM Detection Method, Device, and System
CN115766252A (en) Flow abnormity detection method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant