CN109981819B - mDNS message processing method, device and networking system - Google Patents

mDNS message processing method, device and networking system Download PDF

Info

Publication number
CN109981819B
CN109981819B CN201910226411.5A CN201910226411A CN109981819B CN 109981819 B CN109981819 B CN 109981819B CN 201910226411 A CN201910226411 A CN 201910226411A CN 109981819 B CN109981819 B CN 109981819B
Authority
CN
China
Prior art keywords
message
mdns
request message
setting
equipment
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
CN201910226411.5A
Other languages
Chinese (zh)
Other versions
CN109981819A (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.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
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 New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN201910226411.5A priority Critical patent/CN109981819B/en
Publication of CN109981819A publication Critical patent/CN109981819A/en
Application granted granted Critical
Publication of CN109981819B publication Critical patent/CN109981819B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/16Multipoint routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides an mDNS message processing method, device and networking system; wherein, the method comprises the following steps: receiving a request message sent by terminal equipment; if the request message is an mDNS message, setting a first setting identifier at the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message; and sending the request message with the first set identifier to gateway equipment corresponding to the mDNS message through the mDNS relay equipment. According to the method and the device, under the condition that the mDNS relay device and the gateway device are in different VLANs, the mDNS relay device can identify whether the message is the mDNS message or not through the first set standard in the message without decapsulating the message, and then the mDNS message is subjected to relevant processing and then sent to the gateway device, so that the mDNS service spanning the VLANs is provided for the terminal device.

Description

mDNS message processing method, device and networking system
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, and a networking system for processing an mDNS packet.
Background
The mDNS (multicast Domain Name System) protocol can implement a function of discovering and communicating devices in a VLAN (Virtual Local Area Network) with each other without a conventional DNS server. The mDNS relay equipment and the mDNS gateway equipment can enable mDNS service to cross VLAN, so that the forwarding speed of mDNS messages and the infinite capacity of wireless networking are improved.
Disclosure of Invention
In view of this, an object of the present disclosure is to provide an mDNS packet processing method, an mDNS packet processing device, and a networking system, so that an mDNS relay device identifies whether the packet is an mDNS packet, and further performs related processing on the mDNS packet and sends the mDNS packet to a gateway device, thereby providing an mDNS service spanning a VLAN for a terminal device.
In order to achieve the above purpose, the technical scheme adopted by the disclosure is as follows:
in a first aspect, the present disclosure provides a method for processing an mDNS packet, where the method is applied to an AP (Access Point); the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; the method comprises the following steps: receiving a request message sent by terminal equipment; if the request message is an mDNS message, setting a first setting identifier at the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message; and sending the request message with the first set identifier to gateway equipment corresponding to the mDNS message through the mDNS relay equipment.
In a second aspect, the present disclosure provides a method for processing an mDNS packet, where the method is applied to an mDNS relay device; the mDNS relay equipment is in communication connection with the AP and the gateway equipment respectively; the method comprises the following steps: receiving a request message sent by an AP; judging whether a first set identifier is set in a message header of the request message; the first setting identification is used for identifying the request message as an mDNS message; if so, converting the request message into a unicast message, and sending the converted request message to the gateway equipment corresponding to the mDNS message.
In a third aspect, the present disclosure provides an mDNS packet processing apparatus, where the apparatus is disposed in an AP; the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; the device includes: the first receiving module is used for receiving a request message sent by the terminal equipment; the identifier setting module is used for setting a first set identifier in a message header of the request message if the request message is an mDNS message; the first setting identification is used for identifying the request message as an mDNS message; and the first sending module is used for sending the request message provided with the first setting identifier to the gateway equipment corresponding to the mDNS message through the mDNS relay equipment.
In a fourth aspect, the present disclosure provides an mDNS packet processing apparatus, where the apparatus is disposed in an mDNS relay device; the mDNS relay equipment is respectively in communication connection with the AP and the gateway equipment; the device comprises: the second receiving module is used for receiving a request message sent by the AP; the judging module is used for judging whether a first set identifier is arranged in a message header of the request message or not; the first setting identification is used for identifying the request message as an mDNS message; and the second sending module is used for converting the request message into a unicast message and sending the converted request message to the gateway equipment corresponding to the mDNS message if the message header of the request message is provided with the first set identifier.
In a fifth aspect, the present disclosure provides an access point, including a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the mDNS message processing method according to the first aspect.
In a sixth aspect, the present disclosure provides an mDNS relay device, including a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the mDNS message processing method according to the second aspect.
In a seventh aspect, the present disclosure provides a machine-readable storage medium storing machine-executable instructions, which when invoked and executed by a processor, cause the processor to implement the mDNS message processing method described above.
In an eighth aspect, the present disclosure provides a networking system, including an AP, an mDNS relay device, a first gateway device, and a second gateway device; the AP is connected with the mDNS relay equipment; the mDNS relay device is respectively connected with the first gateway device and the second gateway device.
According to the mDNS message processing method, the device, the access point, the mDNS relay equipment, the machine readable storage medium and the networking system, after the AP receives the request message sent by the terminal equipment, if the request message is the mDNS message, a first set identifier is set at the message header of the request message to identify the request message as the mDNS message; and then the request message with the first set identifier is sent to the gateway device corresponding to the mDNS message through the mDNS relay device. By the mode, under the condition that the mDNS relay equipment and the gateway equipment are in different VLANs, the mDNS relay equipment can identify whether the message is the mDNS message or not through the first set scale in the message without decapsulating the message, and further performs related processing on the mDNS message and sends the mDNS message to the gateway equipment, so that the mDNS service spanning the VLANs is provided for the terminal equipment.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned and other objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic structural diagram of a network according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an mDNS message processing method according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another mDNS message processing method according to the embodiment of the present disclosure;
fig. 4 is a flowchart of another mDNS message processing method according to the embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of another networking provided by the embodiments of the present disclosure;
fig. 6 is a flowchart of another mDNS message processing method according to the embodiment of the present disclosure;
fig. 7 is a flowchart of another mDNS message processing method according to the embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an mDNS message processing apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of another mDNS message processing apparatus according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an AP or mDNS relay device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the embodiments of the present disclosure will be described clearly and completely with reference to the accompanying drawings, and it is to be understood that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
For convenience of understanding, the following first describes a networking suitable for the mDNS message processing method of the present disclosure; as shown in fig. 1, the network includes a gateway device, an mDNS relay device, an AP, and a terminal device; for convenience of description, in fig. 1, two groups of sequentially connected mDNS relay devices, APs, and terminal devices are taken as an example, and the mDNS relay devices in each group are connected to a gateway device; certainly, in actual implementation, the gateway device may be connected to multiple mDNS relay devices, and the AP may also be connected to multiple terminal devices; the AP may be provided with a wireless access interface or a wired access interface, and the disclosure does not limit a specific networking structure. The mDNS relay equipment is used for enabling mDNS service to cross the VLAN, namely, communication of terminal equipment under the non-identical VLAN is realized; the terminal device can be various devices with communication connection functions, such as a mobile phone, a tablet computer, a printer, a multimedia player and the like.
In the related art, in networking, when a message sent by a terminal device is sent to a gateway device (or an access controller) through an AP, the message needs to be encapsulated; to enable cross-VLAN mDNS services in a network; an mDNS relay device is generally provided between the AP and the gateway device. However, the mDNS relay device cannot identify whether the packet encapsulated by the AP is an mDNS packet, and therefore cannot perform processing related to the mDNS packet, which makes it difficult to implement cross-VLAN mDNS service in networking.
Specifically, when the terminal device sends a message to the gateway device through the AP, the AP generally encapsulates the message through a preset tunneling protocol, such as openflow protocol or capwap protocol; however, the mDNS relay device between the AP and the gateway device does not have the capability of decapsulating the packet, and therefore, the mDNS relay device cannot identify whether the encapsulated packet is an mDNS packet, and cannot provide relevant processing for the mDNS packet, and at this time, the mDNS relay function of the mDNS relay device is not effective, and only serves as an ordinary switch to forward the packet. Because the multicast address used by the mDNS message only takes effect in the two-layer broadcast domain, the mDNS message can only be forwarded in the same VLAN; if the mDNS relay equipment and the gateway equipment are in the same VLAN, the mDNS relay equipment can send the request message to the gateway equipment, so that the mDNS service is realized; however, if the mDNS relay device and the gateway device are in different VLANs, the mDNS relay device cannot forward the request packet to the gateway device, which makes it difficult to implement cross-VLAN mDNS service in networking.
Based on this, the present embodiment intends to provide an mDNS packet processing method, an mDNS packet processing device, and a networking system, and the technology can be applied to a networking system to implement an mDNS service across VLANs. Firstly, an mDNS message processing method is described below, which is applied to an access point AP; the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; as shown in fig. 2, the method comprises the steps of:
step S202, receiving a request message sent by a terminal device;
when the terminal device needs to establish connection with other terminal devices, the request message needs to be sent first to acquire addresses of the other terminal devices, so as to communicate with the other terminal devices. For example, when the mobile phone needs the printer to provide the printing service, the mobile phone needs to send the message request to obtain the address of the printer, and after establishing communication connection with the printer through the address, the mobile phone sends the data to be printed to the printer. For another example, when the tablet computer needs the audio playing service provided by the audio device, the tablet computer needs to send the message request to obtain the address of the audio device, and after establishing communication connection with the audio device through the address, the tablet computer sends the audio to be played to the audio device.
Step S204, if the request message is an mDNS message, setting a first setting identifier at the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message;
for example, whether the request message is an mDNS message may be determined according to a message header of the request message or other message information; the message header of the request message usually contains information such as a source IP address, a source MAC address, a source port number, a destination IP address, a destination MAC address, a destination port number and the like of the message; since the mDNS packet belongs to a multicast packet, the destination IP address and the destination MAC address in the packet header are generally multicast addresses, and the destination port number of the mDNS packet is 5353. Therefore, the AP can determine whether the message is an mDNS message by analyzing the header of the request message.
The first setting identifier may be set at each layer of encapsulation header of the packet header, such as an IP layer, an ethernet layer, and the like; in order not to affect other contents, the first setting flag may be set in some blank fields or optional fields, such as an OPTION field of an IP layer. The first setting indicator may be represented in the form of a character or a number, such as by 0x01 or T.
It should be noted that, in order to facilitate identification of the mDNS relay device, the first setting identifier may be set in an encapsulation header that can be queried by the mDNS relay device, such as the IP layer, the ethernet layer, and the like, so that the mDNS relay device can query the first setting identifier without decapsulating the request packet.
Step S206, the request message with the first setting identifier is sent to the gateway device corresponding to the mDNS message through the mDNS relay device.
Specifically, the AP may first send a request packet with a first setting identifier to an mDNS relay device, where the mDNS relay device may preset a function of querying a field corresponding to the first setting identifier; after receiving the request message, the mDNS relay equipment inquires whether a first set identifier is set in a field corresponding to the first set identifier, if not, the mDNS relay equipment takes the request message as a common message and sends the common message to gateway equipment corresponding to the common message; if yes, determining the request message as an mDNS message; in order to send the request message to the mesh device when the mDNS relay device and the gateway device are in different VLANs, the mDNS relay device may convert the request message from the mDNS message to a unicast message, and send the unicast message to the gateway device corresponding to the mDNS message, so as to implement cross-VLAN mDNS message forwarding.
In the mDNS message processing method provided by the present disclosure, after receiving a request message sent by a terminal device, if the request message is an mDNS message, an AP sets a first setting identifier at a message header of the request message to identify the request message as an mDNS message; and then the request message with the first set identifier is sent to the gateway device corresponding to the mDNS message through the mDNS relay device. By the mode, under the condition that the mDNS relay equipment and the gateway equipment are in different VLANs, the mDNS relay equipment can identify whether the message is the mDNS message or not through the first set scale in the message without decapsulating the message, and further performs related processing on the mDNS message and sends the mDNS message to the gateway equipment, so that the mDNS service spanning the VLANs is provided for the terminal equipment.
The embodiment of the present disclosure further provides another mDNS message processing method, which is implemented on the basis of the mDNS message processing method; the method mainly describes a specific process that an AP judges whether a request message is an mDNS message and a setting process of a set identifier; as shown in fig. 3, the method comprises the steps of:
step S302, receiving a request message sent by a terminal device;
step S304, analyzing the message header of the request message to obtain the address information of the request message; the address information comprises a destination address and/or a port number;
step S306, determining whether the request message is an mDNS message according to the address information of the request message; if yes, go to step S308; if not, go to step S312;
the destination address of the mDNS message is a multicast address, for example, the multicast address in the IPv4 network is 224.0.0.251; and the port number of the mDNS message is 5353; therefore, whether the destination address of the request message is the multicast address or not is judged, or whether the port number of the request message is 5353 or not is judged, and whether the request message is the mDNS message or not can be determined. Of course, in order to improve reliability, it may also be determined whether the destination address of the request packet is a multicast address and whether the port number of the request packet is 5353, and when the determination results are yes, it is determined that the request packet is an mDNS packet.
Step S308, a first setting identification is set in the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message;
step S310, sending the request message with the first set identifier to gateway equipment corresponding to the mDNS message through the mDNS relay equipment; and (6) ending.
Step S312, a second setting identification is set in the message header of the request message; the second setting identification is used for identifying the request message as a common service message;
step S314, sending the request message to the gateway device corresponding to the normal service message through the mDNS relay device.
The first setting flag and the second setting flag may be set in the same field or in different fields. In one implementation manner, a designated field can be selected in the header of the request message in advance, the designated field is usually an idle field or an optional field, and if the request message is an mDNS message, a first setting identifier is set on the designated field in the header of the request message; if the request message is a common service message, setting a second setting identification on the appointed field.
Specifically, the specified field may be located in a header of the request packet, an option part of the IP layer; an identification field (also referred to as a flag field) may be added to the option portion of the IP layer, and the format of the identification field may be a TLV (tag length value) format, but may also be other formats. In the identification field, 0x01 can indicate that the request message is an mDNS message, and 0x00 can indicate that the request message is a normal service message (which can also be referred to as a non-mDNS message); the identification field may be 1 byte (byte) in length.
In the above manner, the AP can determine whether the request message is an mDNS message by the address information of the request message; if the request message is an mDNS message, setting a first setting identifier in the request message, and if the request message is a common service message, setting a second setting identifier in the request message so as to enable subsequent mDNS relay equipment to identify the mDNS message; and then, the mDNS message is subjected to relevant processing and then is sent to the gateway equipment, so that the mDNS service spanning the VLAN is provided for the terminal equipment.
The embodiment of the present disclosure further provides another mDNS message processing method, which is implemented on the basis of the mDNS message processing method; the method is described from the perspective of an mDNS relay device; the mDNS relay equipment is respectively in communication connection with the AP and the gateway equipment; as shown in fig. 4, the method includes the steps of:
step S402, receiving a request message sent by an AP;
step S404, judging whether a first setting identification is arranged in the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message;
step S406, if the message header of the request message is provided with the first setting identifier, the request message is converted into a unicast message, and the converted request message is sent to the gateway device corresponding to the mDNS message.
In the method, after receiving a request message sent by an AP, an mDNS relay device determines whether a first set identifier is set in a message header of the request message, and if so, determines the request message as an mDNS message, converts the request message into a unicast message, and sends the converted request message to a gateway device corresponding to the mDNS message. By the mode, under the condition that the mDNS relay equipment and the gateway equipment are in different VLANs, the mDNS relay equipment can identify whether the message is the mDNS message or not through the first set identifier in the message without decapsulating the message, and further performs related processing on the mDNS message and sends the mDNS message to the gateway equipment, so that the mDNS service spanning the VLANs is provided for the terminal equipment.
The embodiment of the disclosure also provides another method for processing the mDNS message, which is implemented on the basis of the method for processing the mDNS message. In the above networking, the gateway device needs to process the mDNS packet and the common service packet at the same time, and when the packet volume is large, the processing pressure of the gateway device is large, which easily causes the situations of packet loss, packet transmission failure, and the like, resulting in low user experience.
Based on this, the method firstly improves the networking structure, and takes wireless networking as an example for description, that is, the AP is wirelessly connected with the terminal device, and of course, the method may also be applied to wired networking. Specifically, the gateway device is divided into a first gateway device and a second gateway device according to the execution function, and the first gateway device and the second gateway device are respectively in communication connection with the mDNS relay device. As shown in fig. 5, the mDNS relay device 1 and the mDNS relay device 2 both connect the first gateway device and the second gateway device at the same time; the first gateway equipment is used for processing the mDNS message, and the second gateway equipment is used for processing the common service message; that is, when the mDNS relay device determines that the request message is an mDNS message, the request message is sent to the first gateway device; and when the mDNS relay equipment judges that the request message is a common service message, sending the request message to second gateway equipment. Further, the mDNS relay device 1 is connected with the AP1, and the AP1 is connected with the terminal device 1; the mDNS relay device 2 is connected to the AP2, and the AP2 is connected to the terminal device 2.
Based on the above networking structure, refer to a flowchart of another mDNS message processing method shown in fig. 6; the method comprises the following steps:
step S602, receiving a request message sent by an AP;
step S604, judging whether a first setting identification or a second setting identification is set in a message header of the request message; if the setting flag is the first setting flag, go to step S606; if the setting flag is the second setting flag, go to step S612; the first setting identification is used for identifying the request message as an mDNS message; the second setting identification is used for identifying the request message as a common service message;
step S606, converting the request message into a unicast message, sending the converted request message to the first gateway equipment, and performing response processing on the mDNS message through the first gateway equipment;
as described in the foregoing embodiment, since the multicast address of the mDNS packet is only valid in the two-layer broadcast domain, that is, it can only be forwarded in the same VLAN; when the mDNS relay device and the gateway device belong to different VLANs, in order to send the mDNS message to the gateway device, the mDNS relay device needs to convert the request message from the mDNS message to a unicast message, and then sends the request message in the form of the unicast message to the gateway device, that is, the first gateway device.
Step S608, receiving a response message of the first gateway device to the request message;
after receiving the request message, the first gateway device analyzes the request message, inquires the address of the device to which the terminal device needs to be connected from the table entry according to the request content in the request message, and then generates a response message according to the inquiry result. The reply message typically contains the address of the queried device. Typically, the first gateway device sends the reply message in unicast to the mDNS relay device.
Step S610, in the VLAN to which the AP sending the request message belongs, sending a response message in a multicast manner, so that the terminal device receives the response message. And (6) ending.
After receiving the response message, the terminal device can acquire the address of the device to be connected from the response message, and after acquiring the address, the terminal device can send a communication message to the address, and the communication message is sent to the device through the AP and the second gateway controller; when the AP sends a communication packet, the AP generally encapsulates the communication packet through a tunneling protocol, sends the encapsulated communication packet to the second gateway device, and then the second gateway device implements communication with the device. For example, when the device is a printer, the communication message may be a message containing print data.
Step S612, sending the request message to a second gateway device; and providing request service or forwarding processing for the request message through the second gateway equipment.
In the above manner, the gateway devices in the network are divided into a first gateway device and a second gateway device, and when the mDNS relay device identifies that the request message is an mDNS message, the request message is converted into a unicast message and sent to the first gateway device for processing; when the request message is a common service message, sending the request message to second gateway equipment for processing; in the method, the processing function of the mDNS message is isolated, the first gateway device and the second gateway device are clearly separated, and compared with a method that one gateway device simultaneously processes the mDNS message and a common service message, the method can ensure the service processing efficiency when the message volume is large, so that the user experience can be optimized.
For further understanding, the embodiment of the present disclosure also provides another mDNS message processing method, which is implemented on the basis of the mDNS message processing method. In this method, a case where a terminal device establishes a communication connection with a printer will be described as an example. The method is realized by interaction of terminal equipment, an AP, mDNS relay equipment and first gateway equipment. As shown in fig. 7, the method includes the steps of:
step S702, the terminal equipment sends a request message to the AP; the request message may be used for the terminal device to obtain the address of the printer from the first gateway device.
Step S704, the AP analyzes the message header of the request message to obtain the address information of the request message; judging that the request message is an mDNS message according to the address information, and setting a first setting identifier at the message header of the request message;
step S706, sending the request packet with the first setting identifier to the mDNS relay device.
In this step, if the AP does not have the function of determining that the request packet is the mDNS packet, the AP sends the request packet and other packets to the second gateway device for processing as common service packets through the mDNS relay device.
Step S708, the mDNS relay equipment judges that a first setting identifier is arranged in a message header of the request message, and converts the request message from the mDNS message into a unicast message;
step S710, sending the converted request message to the first gateway device.
In this step, if the mDNS relay device does not have the function of querying the first setting identifier, the mDNS relay device sends the request packet to the second gateway device for processing as a normal service packet.
Step S712, the first gateway device parses the request message, queries the address of the printer from the table entry, and generates a response message according to the address of the printer;
step S714, returns the response message to the mDNS relay device.
In actual implementation, if the first gateway device turns off the function of processing the mDNS packet, the first gateway device usually discards the request packet and does not respond to the processing.
Step S716, the mDNS relay device sends the response message in multicast form in the VLAN to which the AP sending the request message belongs, so that the terminal device receives the response message.
Step S718, after receiving the response message, the terminal device obtains the address of the printer from the response message, and implements communication with the printer according to the address.
In the above manner, under the condition that the mDNS relay device and the gateway device are in different VLANs, the mDNS relay device can identify the mDNS message through the first set standard in the message without decapsulating the message, and further convert the mDNS message into a unicast message and send the unicast message to the first gateway device for processing, thereby providing the mDNS service crossing the VLANs for the terminal device.
Corresponding to the above method implementation, refer to a schematic structural diagram of an mDNS message processing apparatus shown in fig. 8; the device is arranged in an Access Point (AP); the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; the device includes:
a first receiving module 80, configured to receive a request message sent by a terminal device;
the identifier setting module 81 is configured to set a first set identifier in a header of the request message if the request message is an mDNS message; the first setting identification is used for identifying the request message as an mDNS message;
the first sending module 82 is configured to send the request packet with the first set identifier to the gateway device corresponding to the mDNS packet through the mDNS relay device.
Further, the above apparatus further comprises: the analysis module is used for analyzing the message header of the request message to obtain the address information of the request message; the address information comprises a destination address and/or a port number; and the determining module is used for determining whether the request message is an mDNS message according to the address information of the request message.
Further, the above apparatus further comprises: the second setting identifier setting module is used for setting a second setting identifier at the message header of the request message if the request message is not the mDNS message; the second setting identification is used for identifying the request message as a common service message; and the first request message sending module is used for sending the request message to the gateway equipment corresponding to the common service message through the mDNS relay equipment.
Further, the identifier setting module is configured to set a first setting identifier in a specified field in a header of the request packet; the second setting flag is used to set the second setting flag on the designated field.
In the mDNS message processing apparatus, after the AP receives the request message sent by the terminal device, if the request message is an mDNS message, a first setting identifier is set at a message header of the request message to identify the request message as an mDNS message; and then the request message with the first set identifier is sent to the gateway device corresponding to the mDNS message through the mDNS relay device. By the mode, under the condition that the mDNS relay equipment and the gateway equipment are in different VLANs, the mDNS relay equipment can identify whether the message is the mDNS message or not through the first set scale in the message without decapsulating the message, and further performs related processing on the mDNS message and sends the mDNS message to the gateway equipment, so that the mDNS service spanning the VLANs is provided for the terminal equipment.
See fig. 9 for a schematic structural diagram of another mDNS message processing apparatus; the device is arranged on mDNS relay equipment; the mDNS relay equipment is in communication connection with the AP and the gateway equipment respectively; the device includes:
a second receiving module 90, configured to receive a request packet sent by an AP;
the determining module 91 is configured to determine whether a first setting identifier is set in a header of the request packet; the first setting identification is used for identifying the request message as an mDNS message;
a second sending module 92, configured to convert the request packet into a unicast packet if a first setting identifier is set in a packet header of the request packet, and send the converted request packet to a gateway device corresponding to the mDNS packet.
Further, the apparatus further includes a second request packet sending module, configured to send the request packet to a gateway device corresponding to the common service packet if a second set identifier is set in a packet header of the request packet; and the second setting identification is used for identifying the request message as a common service message.
Further, the gateway device includes a first gateway device and a second gateway device; the first gateway equipment and the second gateway equipment are respectively in communication connection with the mDNS relay equipment; the second sending module is configured to send the converted request packet to the first gateway device; performing response processing on the mDNS message through the first gateway equipment; the second request message sending module is configured to send a request message to a second gateway device; and providing request service or forwarding processing for the request message through the second gateway equipment.
Further, the above apparatus further comprises: a response message receiving module, configured to receive a response message of the first gateway device to the request message; and the response message sending module is used for sending the response message in a multicast mode in the VLAN to which the AP sending the request message belongs, so that the terminal equipment receives the response message.
In the above manner, after receiving a request message sent by an AP, an mDNS relay device determines whether a first set identifier is set in a message header of the request message, and if so, determines the request message as an mDNS message, converts the request message into a unicast message, and sends the converted request message to a gateway device corresponding to the mDNS message. By the method, under the condition that the mDNS relay equipment and the gateway equipment are in different VLANs, the mDNS relay equipment can identify whether the message is the mDNS message or not through the first set target in the message without decapsulating the message, and further performs related processing on the mDNS message and sends the mDNS message to the gateway equipment, so that the mDNS service spanning the VLANs is provided for the terminal equipment.
The embodiment of the present disclosure further provides a networking system, where the system includes an AP, an mDNS relay device, a first gateway device, and a second gateway device; the AP is connected with the mDNS relay equipment; the mDNS relay device is respectively connected with the first gateway device and the second gateway device.
The embodiment provides an access point and an mDNS relay device corresponding to the method embodiment; fig. 10 is a schematic structural diagram of an AP or mDNS relay device, which includes a processor 101 and a memory 100, as shown in fig. 10; the memory 100 is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the mDNS message processing method.
The AP or mDNS relay device shown in fig. 10 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102. The AP or mDNS relay device may be a network edge device.
The Memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 10, but this does not indicate only one bus or one type of bus.
The communication interface 103 is configured to connect to at least one user terminal and other network elements through a network interface, and send the packaged IPv4 message or IPv10 message to the user terminal through the network interface.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present disclosure further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the mDNS message processing method.
The AP or mDNS relay device provided in the embodiments of the present disclosure has the same implementation principle and technical effect as the foregoing method embodiments, and for brevity, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (14)

1. A multicast domain name system mDNS message processing method is characterized in that the method is applied to an access point AP; the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; the method comprises the following steps:
receiving a request message sent by the terminal equipment;
if the request message is an mDNS message, setting a first setting identifier at the message header of the request message; the first setting identification is used for identifying the request message as an mDNS message;
and sending the request message with the first set identifier to gateway equipment corresponding to the mDNS message through the mDNS relay equipment.
2. The method according to claim 1, wherein after the step of receiving the request message sent by the terminal device, the method further comprises:
analyzing the message header of the request message to obtain the address information of the request message; the address information comprises a destination address and/or a port number;
and determining whether the request message is an mDNS message according to the address information of the request message.
3. The method of claim 1, further comprising:
if the request message is not an mDNS message, setting a second setting identifier at the message header of the request message; the second setting identification is used for identifying the request message as a common service message;
and sending the request message to gateway equipment corresponding to a common service message through the mDNS relay equipment.
4. The method according to claim 3, wherein the step of setting the first setting flag in the header of the request message comprises: setting a first setting identification on a designated field in a message header of the request message;
the step of setting a second setting identifier in the header of the request message includes: and setting a second setting identifier on the specified field.
5. An mDNS message processing method is characterized in that the method is applied to mDNS relay equipment; the mDNS relay equipment is in communication connection with the AP and the gateway equipment respectively; the method comprises the following steps:
receiving a request message sent by the AP;
judging whether a first set identifier is set in a message header of the request message; the first setting identification is used for identifying the request message as an mDNS message;
if so, converting the request message into a unicast message, and sending the converted request message to gateway equipment corresponding to the mDNS message.
6. The method of claim 5, further comprising: if the message header of the request message is provided with a second set identifier, sending the request message to gateway equipment corresponding to a common service message; and the second setting identifier is used for identifying that the request message is a common service message.
7. The method of claim 6, wherein the gateway device comprises a first gateway device and a second gateway device; the first gateway device and the second gateway device are respectively in communication connection with the mDNS relay device;
the step of sending the converted request message to the gateway device corresponding to the mDNS message includes: sending the converted request message to the first gateway device; performing response processing on the mDNS message through the first gateway equipment;
the step of sending the request message to the gateway device corresponding to the common service message includes: sending the request message to the second gateway device; and providing request service or forwarding processing for the request message through the second gateway equipment.
8. The method of claim 7, further comprising:
receiving a response message of the first gateway device to the request message;
and sending the response message in a multicast mode in the VLAN to which the AP sending the request message belongs, so that the terminal equipment receives the response message.
9. An mDNS message processing device is characterized in that the device is arranged in an access point AP; the AP is respectively in communication connection with the terminal equipment and the mDNS relay equipment; the device comprises:
the first receiving module is used for receiving a request message sent by the terminal equipment;
the identifier setting module is used for setting a first set identifier in a message header of the request message if the request message is an mDNS message; the first setting identification is used for identifying the request message as an mDNS message;
and the first sending module is used for sending the request message provided with the first setting identifier to the gateway equipment corresponding to the mDNS message through the mDNS relay equipment.
10. An mDNS message processing device is characterized in that the device is arranged in mDNS relay equipment; the mDNS relay equipment is in communication connection with the AP and the gateway equipment respectively; the device comprises:
a second receiving module, configured to receive a request packet sent by the AP;
the judging module is used for judging whether a first set identifier is arranged in a message header of the request message or not; the first setting identification is used for identifying the request message as an mDNS message;
and the second sending module is used for converting the request message into a unicast message and sending the converted request message to gateway equipment corresponding to the mDNS message if a first set identifier is arranged in a message header of the request message.
11. An access point comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of any one of claims 1 to 4.
12. An mDNS relay device, comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of any one of claims 5 to 8.
13. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1 to 8.
14. A networking system is characterized in that the system comprises an AP, an mDNS relay device, a first gateway device and a second gateway device; the AP is connected with the mDNS relay equipment; the mDNS relay device is connected to the first gateway device and the second gateway device, respectively.
CN201910226411.5A 2019-03-22 2019-03-22 mDNS message processing method, device and networking system Active CN109981819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910226411.5A CN109981819B (en) 2019-03-22 2019-03-22 mDNS message processing method, device and networking system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910226411.5A CN109981819B (en) 2019-03-22 2019-03-22 mDNS message processing method, device and networking system

Publications (2)

Publication Number Publication Date
CN109981819A CN109981819A (en) 2019-07-05
CN109981819B true CN109981819B (en) 2022-05-06

Family

ID=67080261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910226411.5A Active CN109981819B (en) 2019-03-22 2019-03-22 mDNS message processing method, device and networking system

Country Status (1)

Country Link
CN (1) CN109981819B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049948B (en) * 2019-12-30 2022-07-29 杭州迪普科技股份有限公司 Domain name detection method and device
US11824640B2 (en) * 2020-06-17 2023-11-21 Hewlett Packard Enterprise Development Lp System and method for reconfiguring a network using network traffic comparisions
CN114244784B (en) * 2021-11-11 2023-09-19 新华三大数据技术有限公司 Message forwarding method and device
CN115767155A (en) * 2022-09-07 2023-03-07 成都西加云杉科技有限公司 Network communication method, device, equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8832433B2 (en) * 2012-08-17 2014-09-09 Cellco Partnership Methods and systems for registering a packet-based address for a mobile device using a fully-qualified domain name (FQDN) for the device in a mobile communication network
US9479422B2 (en) * 2013-03-15 2016-10-25 Cable Television Laboratories, Inc. mDNS-DNS architecture
US9130859B1 (en) * 2013-03-29 2015-09-08 Juniper Networks, Inc. Methods and apparatus for inter-virtual local area network multicast services
CN104283979B (en) * 2013-07-11 2017-11-17 华为技术有限公司 The method, apparatus and system of message transmissions in multicast domain name system
CN104717313B (en) * 2013-12-17 2018-08-14 华为技术有限公司 mDNS gateway address configuration method and device
CN106452924B (en) * 2016-11-30 2019-11-15 北京小米移动软件有限公司 The method and apparatus of synchronous radio network configuration
CN109151086B (en) * 2017-06-19 2021-03-23 华为技术有限公司 Message forwarding method and network equipment
CN108965045A (en) * 2018-06-22 2018-12-07 四川斐讯信息技术有限公司 A kind of method and system of test router forwarding multicasting DNS message

Also Published As

Publication number Publication date
CN109981819A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN109981819B (en) mDNS message processing method, device and networking system
US11979322B2 (en) Method and apparatus for providing service for traffic flow
US10880817B2 (en) Wi-fi configuration method, Wi-Fi mobile terminal, and Wi-Fi device
CN108632098B (en) Flow classifier, service routing trigger, message processing method and system
US10742777B2 (en) UDP protocol acceleration method and system
EP3190754B1 (en) Method and apparatus for processing a modified packet
WO2017054576A1 (en) Unicast tunnel building method, apparatus and system
CN107580079B (en) Message transmission method and device
WO2018214809A1 (en) Message transmission method and device, and storage medium
CN106921578B (en) Method and device for generating forwarding table item
US20170332439A1 (en) Extending the range of mesh networks
CN107547535B (en) Anti-attack MAC address learning method and device and network equipment
JP2024504466A (en) Packet forwarding methods, packet processing methods, and devices
JP2023511150A (en) Multicast packet detection method, network device and system
CN108989173B (en) Message transmission method and device
WO2015027474A1 (en) Data packet header encapsulation method, data packet header decapsulation method, apparatus and device
CN110798409A (en) Traffic processing method, device and storage medium
CN107547691B (en) Address resolution protocol message proxy method and device
WO2021254454A1 (en) Bier oam detection method, and device and system
CN110719178A (en) Network topology acquisition method and device
CN116095197A (en) Data transmission method and related device
CN114826826A (en) Network congestion information transmission method and device, public cloud network and electronic equipment
WO2018045521A1 (en) Method and device for transmitting signaling in wireless network
EP3913865B1 (en) Message decapsulation method and device, message encapsulation method and device, electronic device, and storage medium
CN111866046A (en) Method for realizing cluster and related equipment

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