CN107547668B - Message processing method and device and DHCP server - Google Patents

Message processing method and device and DHCP server Download PDF

Info

Publication number
CN107547668B
CN107547668B CN201610474421.7A CN201610474421A CN107547668B CN 107547668 B CN107547668 B CN 107547668B CN 201610474421 A CN201610474421 A CN 201610474421A CN 107547668 B CN107547668 B CN 107547668B
Authority
CN
China
Prior art keywords
dhcp
message
wireless
address
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
CN201610474421.7A
Other languages
Chinese (zh)
Other versions
CN107547668A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610474421.7A priority Critical patent/CN107547668B/en
Publication of CN107547668A publication Critical patent/CN107547668A/en
Application granted granted Critical
Publication of CN107547668B publication Critical patent/CN107547668B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a message processing method and device and a DHCP server, wherein the message processing method comprises the following steps: receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message; under the condition that a source Media Access Control (MAC) address of a two-layer DHCP discovery message or a DHCP request message is different from a client MAC address carried by the DHCP discovery message or the DHCP request message, sending a DHCP providing message or a DHCP response message to a station STA device and/or a Personal Computer (PC) device hung under a wireless relay or a wireless network bridge device, wherein the DHCP providing message or the DHCP response message is a broadcast message; the invention solves the problem that the address acquisition through DHCP fails in the wireless relay or the down-hanging equipment of the wireless bridge in the related technology.

Description

Message processing method and device and DHCP server
Technical Field
The present invention relates to the field of Wireless Local Area Networks (WLAN), and in particular, to a method and an apparatus for processing a packet, and a DHCP server.
Background
Generally, a Station (STA) device can directly Access an Internet network or a subnet network through a Wireless Access Point (AP). When the wireless coverage of the AP is insufficient, it is necessary to extend the coverage of the wireless network by adding wireless relays. When a device with only a wired network card but no wireless network card needs to access the network through the AP, the wireless network bridge device needs to be added to convert between a wireless network and a wired network.
Fig. 1 is a schematic view of a usage scenario of an AP under-hook wireless relay or wireless bridge in the related art, and the usage scenario of the wireless relay or wireless bridge device is not limited to the above scenario, and is described here by taking the scenario of fig. 1 as an example.
For example, when the STA device with the MAC4 address in fig. 1 needs to access the Internet, the STA device with the MAC4 address may access the Internet network by accessing the wireless relay through the WLAN first and then accessing the AP through the WLAN.
For example, the PC device with MAC3 address in fig. 1 only has an Ethernet card, and needs to access the wireless bridge through Ethernet (ETH for short), and then the wireless bridge accesses the AP through WLAN, and the STA device with MAC3 address can finally access the Internet network.
The connection between the wireless relay or wireless bridge device and the AP in fig. 1 uses a WLAN network, i.e. using the 802.11 protocol. Fig. 2 is a schematic diagram of the usage of an address field in an 802.11 protocol in a data frame in the related art, referring to fig. 2, the usage of the address field in the data frame in the 802.11 protocol is that all messages exchanged between a STA and an AP in a common use are in an infrastructure type 3 address format, and most of wireless relay or wireless bridge devices and the AP are connected in an infrastructure type data format in which 3 addresses are also used, that is, the wireless relay or wireless bridge devices are used as a common STA device to access the AP. However, the problem of address allocation of Dynamic Host Configuration Protocol (DHCP) is often found in the 3-address access mode.
All the Wireless relay or Wireless bridge devices discussed later herein refer to devices accessing the AP only in a 3-address manner, and not in a 4-address Wireless Distribution System (WDS) manner. In the scenario of 4-address WDS access, the DHCP address assignment problem described herein does not exist.
In a 3-address infrastructure network, the packet sent from the STA To the AP has three addresses in the 802.11 frame header, as shown by To AP in fig. 2: address1 (the receiving end) is the MAC Address of the AP; address2 (sender) is the MAC Address of the STA; address3 is the destination Address of the message. When the AP receives the 802.11 frame header and converts the 802.3 frame header format, the source Address is Address2, i.e. the MAC Address of the STA, and the destination Address is Address3, i.e. the destination Address of the message.
In a 3-address infrastructure network, the packet sent From the AP to the STA has three addresses in the 802.11 frame header, as shown in the From AP in fig. 2: address1 (the receiving end) is the MAC Address of the STA; address2 (sender) is the MAC Address of the AP; address3 is the source Address of the message. When the STA receives the 802.11 frame header and converts the 802.3 frame header format, the source Address is Address3, namely the source Address of the message, and the destination Address is Address1, namely the MAC Address of the STA.
After the introduction of the wireless relay or the wireless bridge device, when the STA or the PC is hung down by the wireless relay or the wireless bridge device, all messages sent to the AP and the 802.11 frame header do not have the actual MAC address of the hung-down device, but only have the address of the STA interface of the wireless relay or the wireless bridge. When the AP receives the frame header format and converts the frame header format into an 802.3 frame header format, the source address is changed into the MAC address of the STA, and the MAC address information of the actual equipment hung under the wireless relay or wireless network bridge equipment is lost. The message sent by the AP to the wireless relay or the wireless bridge device, the 802.3 frame header or the 802.11 frame header are also addresses of only the STA interface of the wireless relay or the wireless bridge, and there is no MAC address information of the down-hanging actual device. The mapping relationship between the IP address and the MAC address of the actual drop-down device is generally recorded inside the wireless relay or wireless bridge device, and after the message sent by the AP is received, the actual MAC address of the drop-down device is found and forwarded according to the index of the IP address in the message. However, before the drop device acquires the IP address, the DHCP address acquisition process itself often fails.
Fig. 3 is a schematic diagram of a basic work flow of a DHCP protocol in the related art, wherein fig. 4 is a schematic diagram of a format of a DHCP protocol message in the related art.
Take the example where a PC with MAC3 address in fig. 1 accesses the AP through a wireless bridge device and the IP address is assigned by the AP through DHCP. The MAC3 address of the PC is d8:55: a3: de: be: ff, the STA interface address of the wireless bridge connected with the AP is 06: e6: e4: e1: db:24, the PC sends a DHCP Discover message, when the wireless bridge is transferred to the AP, the source MAC of the message is changed into the STA interface address of the wireless bridge, and finally the 802.3 message (which is converted from 802.11 to 802.3) received by the AP is shown in FIG. 5. In the ethernet header of the second layer in this message, the source MAC address is STA interface address 06: e6: e4: e1: db:24 of the wireless bridge, and the client MAC address (chaddr) inside the DHCP message is MAC address d8:55: a3: de: be: ff of the PC. The first bit of the Bootp mark field is 0, which indicates that the DHCP server is required to respond to the message and send the message in a unicast manner.
After receiving the DHCP Discover message as shown in fig. 5, the AP allocates an IP address and returns a DHCP Offer message, and since the Bootp flag is unicast, the AP replies a unicast message according to the DHCP protocol, and at this time, an abnormality of DHCP interaction occurs. The abnormalities are divided into two cases:
when the AP returns the DHCP Offer, the destination MAC address adopts chaddr in the DHCP message, namely the MAC address of the PC. Since the MAC address is not associated with the AP, the message is discarded in the wireless driver of the AP, and the AP cannot send out the DHCP Offer message. Eventually, the DHCP of the PC device hanging down the wireless network bridge fails to acquire an address, as shown in fig. 6 (a).
When the AP sends back the DHCP Offer, the destination MAC address adopts the source MAC address in the DHCP Discover message, i.e., the STA interface address of the wireless bridge. The message can be normally sent to an air interface and received by the wireless bridge, but because the IP address is allocated to the PC device for the first time, the mapping relationship between the MAC address and the IP address of the PC is not learned in the wireless bridge, and at this time, the wireless bridge cannot normally process the DHCP Offer message and discards the message. Eventually, the DHCP of the PC device hanging down the wireless network bridge fails to acquire an address, as shown in fig. 6 (b).
When the STA equipment is hung down through the wireless relay, the problem of failure in obtaining the address by DHCP also exists as when the PC is hung down through the wireless network bridge equipment.
In view of the above technical problems in the related art, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a message processing method and device and a DHCP server, which are used for at least solving the problem that address acquisition fails through DHCP (dynamic host configuration protocol) in the process of hanging down equipment of a wireless relay or a wireless bridge in the related technology.
According to an embodiment of the present invention, a message processing method is provided, including: receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message; and under the condition that the source media access control MAC address of the two layers of the DHCP discovery message or the DHCP request message is different from the client MAC address carried by the DHCP discovery message or the DHCP request message, sending a DHCP providing message or a DHCP response message to the STA equipment and/or the PC equipment of the station hung under the wireless relay or the wireless network bridge equipment, wherein the DHCP providing message or the DHCP response message is a broadcast message.
Optionally, before sending the DHCP offer message or the DHCP acknowledge message to the down-hung STA device and/or PC device, the method further includes: and fixedly filling the destination address of the two layers in the DHCP providing message or the DHCP response message as a broadcast address.
Optionally, the DHCP discover message or the DHCP request message is received in at least one of the following scenarios: the method comprises the following steps that an Access Point (AP) hangs down a wireless relay or wireless bridge device, and meanwhile, the AP serves as a Dynamic Host Configuration Protocol (DHCP) server to distribute Internet Protocol (IP) addresses for Station (STA) devices and/or Personal Computer (PC) devices which are hung down by the wireless relay or wireless bridge device; the gateway equipment is in communication connection with the bridging AP, the bridging AP hangs the wireless relay or the wireless bridge equipment, and meanwhile, the gateway equipment serves as a DHCP server to distribute IP addresses for the STA equipment and/or the PC equipment hung below the wireless relay or the wireless bridge equipment; the wireless relay or wireless bridge device accesses the scene of the AP device through the 3-address mode of the infrastructure type.
Optionally, the method is performed by a DHCP server.
According to another embodiment of the present invention, there is provided a message processing apparatus including: the receiving module is used for receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message; and the sending module is used for sending a DHCP providing message or a DHCP response message to the station STA equipment and/or the personal computer PC equipment hung below the wireless relay or the wireless bridge equipment under the condition that the source Media Access Control (MAC) address of the two layers of the DHCP discovery message or the DHCP request message is different from the client MAC address carried by the DHCP discovery message or the DHCP request message, wherein the DHCP providing message or the DHCP response message is a broadcast message.
Optionally, the apparatus further comprises: and the modification module is used for fixedly filling the destination address of the two layers in the DHCP providing message or the DHCP response message into a broadcast address.
Optionally, the sending module is further configured to send the DHCP offer packet or the DHCP reply packet to the down-hanging STA device and/or PC device through a wireless relay or a wireless bridge device.
Optionally, the apparatus is applied to at least one of the following scenarios: the method comprises the following steps that an Access Point (AP) hangs down a wireless relay or wireless bridge device, and meanwhile, the AP serves as a Dynamic Host Configuration Protocol (DHCP) server to distribute Internet Protocol (IP) addresses for Station (STA) devices and/or Personal Computer (PC) devices which are hung down by the wireless relay or wireless bridge device; the gateway equipment is in communication connection with the bridging AP, the bridging AP hangs the wireless relay or the wireless bridge equipment, and meanwhile, the gateway equipment serves as a DHCP server to distribute IP addresses for the STA equipment and/or the PC equipment hung below the wireless relay or the wireless bridge equipment; the wireless relay or wireless bridge device accesses the scene of the AP device through the 3-address mode of the infrastructure type.
Optionally, the apparatus is located in a DHCP server.
According to another embodiment of the present invention, a DHCP server is provided, which includes the above message processing apparatus.
According to still another embodiment of the present invention, there is also provided a storage medium. The storage medium is configured to store program code for performing the steps of: receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message; and under the condition that the source media access control MAC address of the two layers of the DHCP discovery message or the DHCP request message is different from the client MAC address carried by the DHCP discovery message or the DHCP request message, sending a DHCP providing message or a DHCP response message to the station STA equipment and/or the personal computer PC equipment which is hung downwards, wherein the DHCP providing message or the DHCP response message is a broadcast message.
According to the invention, under the condition that the MAC address of the two layers of the received DHCP discovery message or DHCP request message is different from the MAC address of the client carried by the DHCP discovery message or the DHCP request message, the DHCP providing message or DHCP response message is sent to the station STA equipment and/or the personal computer PC equipment which is hung downwards, wherein the DHCP providing message or DHCP response message is a broadcast message; under the condition that the addresses of the STA equipment and the PC equipment are different, the broadcasted DHCP offer message or DHCP response message is sent to the down-hanging STA equipment and/or PC equipment, and then the down-hanging STA equipment and/or PC equipment can normally acquire the IP address, so that the problem that the address acquisition by the DHCP fails in the down-hanging equipment of a wireless relay or a wireless bridge in the related technology can be solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic view of a usage scenario of an AP under-hook wireless relay or wireless bridge in the related art;
fig. 2 is a diagram illustrating the usage of an address field in a data frame in the 802.11 protocol in the related art;
fig. 3 is a diagram illustrating a basic work flow of a DHCP protocol in the related art;
fig. 4 is a schematic diagram of a format of a DHCP protocol packet in the related art;
FIG. 5 is a diagram illustrating a DHCP Discover message packet capture forwarded by a wireless bridge to an AP;
FIG. 6(a) is a schematic diagram showing a first interaction flow of failure of DHCP to acquire address when a PC is hung up under a wireless network bridge;
FIG. 6(b) is a schematic diagram of an interaction flow of failure of DHCP to acquire address when a PC is hung under a wireless network bridge;
fig. 7 is a block diagram of a hardware structure of a computer terminal of a message processing method according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a usage scenario of an AP under-hook wireless relay or wireless bridge in the related art;
FIG. 9 is a flow diagram of a message processing method according to an embodiment of the invention;
fig. 10 is a schematic diagram illustrating an interaction flow of a DHCP get address message according to a preferred embodiment of the present invention;
FIG. 11 is a schematic structural diagram of an AP/HGW/DHCP server provided in accordance with a preferred embodiment of the present invention;
fig. 12 is a flowchart illustrating a message processing method according to a preferred embodiment of the present invention;
fig. 13 is a block diagram of a configuration of a message processing apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the example of running on a computer terminal, fig. 7 is a hardware structure block diagram of a computer terminal of a message processing method according to an embodiment of the present invention. As shown in fig. 7, computer terminal 70 may include one or more (only one shown) processors 702 (processor 702 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 704 for storing data, and a transmission device 706 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration and is not intended to limit the structure of the electronic device. For example, computer terminal 70 may also include more or fewer components than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 704 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the message processing method in the embodiment of the present invention, and the processor 702 executes various functional applications and data processing by running the software programs and modules stored in the memory 704, so as to implement the above-mentioned method. The memory 704 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 704 may further include memory located remotely from the processor 702, which may be connected to the computer terminal 70 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 706 is used for receiving or sending data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 70. In one example, the transmission device 706 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 706 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The embodiment of the present application may be operated on a network architecture shown in fig. 1, as shown in fig. 1, in the network architecture, an access point AP hangs down a wireless relay or wireless bridge device, and the AP serves as a DHCP Server (DHCP Server) to allocate an internet protocol IP address to a station STA device and/or a personal computer PC device hung down by the wireless relay or wireless bridge device; it may also operate in the network architecture shown in fig. 8, as shown in fig. 8, in the network architecture, a gateway device is in communication connection with a bridging AP, the bridging AP hangs down a wireless relay or a wireless bridge device, and the gateway device serves as a DHCP server to allocate an IP address to an STA device and/or a PC device hung down by the wireless relay or the wireless bridge device, it should be noted that in the scenario shown in fig. 8, the communication connection between the gateway device and the bridging AP may include the gateway device hanging down the bridging AP through a wired port or hanging down the bridging AP through a wireless port, but is not limited thereto.
In this embodiment, a message processing method operating on the computer terminal or the network architecture is provided, and fig. 9 is a flowchart of the message processing method according to the embodiment of the present invention, as shown in fig. 9, the flowchart includes the following steps:
step S902, receiving a DHCP discovery message or a DHCP request message of a dynamic host configuration protocol;
step S904, sending the DHCP offer message or the DHCP response message to the STA and/or the PC under the wireless relay or the wireless bridge device when the source MAC address of the two layers of the DHCP discover message or the DHCP request message is different from the client MAC address carried by the DHCP discover message or the DHCP request message, wherein the DHCP offer message or the DHCP response message is a broadcast message.
Through the steps, under the condition that the MAC address of the two layers of the received DHCP discovery message or DHCP request message is different from the MAC address of the client carried by the DHCP discovery message or the DHCP request message, the DHCP providing message or DHCP response message is sent to the STA equipment and/or PC equipment of the website hung under the wireless relay or wireless network bridge equipment, wherein the DHCP providing message or DHCP response message is a broadcast message; under the condition that the addresses of the STA equipment and the PC equipment are different, the broadcasted DHCP offer message or DHCP response message is sent to the down-hanging STA equipment and/or PC equipment, and then the down-hanging STA equipment and/or PC equipment can normally acquire the IP address, so that the problem that the address acquisition by the DHCP fails in the down-hanging equipment of a wireless relay or a wireless bridge in the related technology can be solved.
In an embodiment of the present invention, before the step S906, the method may further include: and fixedly filling the destination address of the two layers in the DHCP providing message or the DHCP response message as a broadcast address. That is, before the step S906, the DHCP offer message or the DHCP reply message is modified to be a broadcast message, so that the DHCP offer message or the DHCP reply message can be sent to all the STA devices and/or PC devices hanging down in the system.
In an embodiment of the present invention, the step S906 may be expressed as: and sending the DHCP providing message or the DHCP response message to the down-hung STA device and/or PC device through the wireless relay or the wireless bridge device which is down-hung by the access point AP. That is, after receiving the broadcasted DHCP offer packet or DHCP response packet, the AP-hung wireless relay or wireless bridge device directly sends the broadcasted DHCP offer packet or DHCP response packet to the wireless relay or wireless bridge device-hung STA device and/or PC device without performing special processing, so that the wireless relay or wireless bridge device-hung STA device and/or PC device can normally obtain an IP address.
In an embodiment of the present invention, after the step S904, the method may further include: under the condition that the MAC address of the two layers of the received DHCP discovery message or DHCP request message is the same as the MAC address of the client carried by the DHCP discovery message or DHCP request message, determining whether a DHCP providing message or a DHCP response message sent to the down-hung STA device and/or PC device is a broadcast message or a unicast message according to a Bootp flag bit of a bootstrap protocol in the DHCP discovery message or DHCP request message; when the Bootp flag bit is unicast, sending a DHCP providing message or a DHCP response message to the hung STA equipment and/or PC equipment, wherein the DHCP providing message or the DHCP response message is a unicast message; and when the Bootp flag bit is broadcast, the DHCP offer message or DHCP response message sent to the down-hanging STA device and/or PC device is a broadcast message. That is, when the two addresses are the same, the processing can be performed according to a normal protocol.
In the case where the determination results are the same, the processing may be performed in accordance with the processing results in the different cases, but the present invention is not limited to this.
The above method may be performed for a wireless interface or a wired interface, but is not limited thereto.
In the case of performing for the wireless interface, the method may be applied to the scenario shown in fig. 1, that is, the scenario may be applied to a situation where an AP hangs down a wireless relay or a wireless bridge device, and the AP serves as a DHCP server to allocate an internet protocol IP address to a station STA device and/or a personal computer PC device that hangs down the wireless relay or the wireless bridge device, and in this scenario, the step S902 is executed, but is not limited thereto; in the case of performing a wired interface, the method may be applied to the scenario shown in fig. 8, that is, may be applied to a scenario in which the gateway device hangs the bridging AP through the wired interface, hangs the wireless relay or the wireless bridge device under the bridging AP, and simultaneously, the gateway device serves as a DHCP server to allocate an IP address to the STA device and/or the PC device hung under the wireless relay or the wireless bridge device, and in this scenario, step S902 is executed.
It should be noted that the above method can be applied to a scenario where a wireless relay or a wireless bridge device accesses an AP device through an infrastructure type 3-address mode.
The main body of the above steps may be a DHCP server, etc., but is not limited thereto.
For a better understanding of the present invention, it is further explained below in connection with preferred embodiments.
The preferred embodiment of the invention provides a DHCP message processing method, which is compatible with various types of wireless relays or wireless bridge equipment in the market.
The DHCP Server processing flow of the AP or gateway device of the preferred embodiment of the invention comprises:
step 1, after receiving a DHCP Discover/Request message (equivalent to a DHCP discovery message or a DHCP Request message), a DHCP Server module determines whether a source MAC address of a second layer at a header of the message is the same as a client MAC address carried by chaddr inside the DHCP message, and if not, when replying a DHCP Offer/ACK message (a DHCP Offer message or a DHCP reply message), a destination address of the second layer is fixedly filled as a broadcast address, and determination is not performed according to a Bootp flag bit in the DHCP Discover/Request message.
And 2, because the DHCP Offer/ACK message sent by the DHCP module is a broadcast message, the wireless drive on the AP can send the message to all the off-hook STA equipment, including off-hook wireless relay or wireless bridge equipment. After receiving the broadcasted DHCP Offer/ACK message, the AP-down wireless relay or wireless bridge device may send the broadcasted message to all the down-hanging STAs or PC devices without performing special processing. Through the processing flow, the STA or PC equipment which is hung under the wireless relay or the wireless network bridge can normally acquire the IP address finally. The whole message interaction flow is shown in fig. 10.
The processing flow of step 1 may be performed only for a wireless interface, or may be performed for all interfaces including a wireless or wired interface.
The processing flow of step 1 above for the wireless interface may be compatible with a scenario in which the AP hangs down the wireless relay or the wireless bridge device as shown in fig. 1, and the AP serves as a DHCP Server to allocate an IP address.
The processing flow of step 1 above performed for the wired interface may be compatible with a scenario in which the gateway device hangs down the bridging AP through the wired interface, the bridging AP hangs down the wireless relay or the wireless bridge device, and the gateway device serves as the DHCP Server to allocate the IP address, as shown in fig. 8.
Fig. 11 is a schematic structural diagram of an AP/HGW/DHCP server according to a preferred embodiment of the present invention, and as shown in fig. 11, the AP/HGW/DHCP server includes:
DHCP Server module
The module provides the concrete realization of the DHCP function, and the functions related in the invention comprise the following: receiving a DHCP request message from a message transceiver module; processing according to the content of the DHCP request message, allocating an IP address to the down-hanging equipment, and packaging a DHCP response message; and sending the DHCP response message to the message receiving and sending module for sending.
Message receiving and transmitting module
The module provides the message receiving and transmitting functions of a wireless or wired interface, and the functions related to the invention comprise the following steps: receiving messages through a wireless or wired interface; sending messages through a wireless or wired interface; after receiving the message, transferring the message related to the DHCP protocol to a DHCP Server module for processing; and when receiving the message to be issued from the DHCP Server module, the message is sent out through a wired or wireless interface.
Fig. 12 is a schematic flowchart of a message processing method according to a preferred embodiment of the present invention, and as shown in fig. 12, a processing flow of a DHCP Server includes:
after receiving the message, the message transceiver module transfers the DHCP Request message therein, such as a DHCP Discover/Request message, to the DHCP Server module for processing.
And after receiving the DHCP request message, the DHCP Server module processes the message and assembles a DHCP response message of DHCP Offer/ACK. And extracting a source MAC of the second layer and a client MAC address in a chaddr field of the DHCP request message from the DHCP request message, and judging whether the source MAC and the client MAC address are the same. If the two are different, the DHCP request is considered to pass through the wireless relay or the DHCP request rotated in the wireless bridge equipment, and the second-layer destination address is fixedly filled as a broadcast address when the DHCP response message is replied, so that the client side hung under the wireless relay or the wireless bridge can receive the message. And if the addresses of the two-layer source MAC of the DHCP request message and the client MAC in the chaddr field are the same, processing according to a normal protocol, and returning a unicast response when the Bootp mark is unicast and returning a broadcast response when the Bootp mark is broadcast.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, FLASH, magnetic disk, optical disk), and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a message processing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of which have been already described are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 13 is a block diagram of a structure of a message processing apparatus according to an embodiment of the present invention, and as shown in fig. 13, the apparatus includes:
a receiving module 1302, configured to receive a DHCP discover message or a DHCP request message;
a sending module 1304, connected to the receiving module 1302, configured to send a DHCP offer message or a DHCP response message to a station STA device and/or a personal computer PC device under a wireless relay or a wireless network bridge device when a source media access control MAC address of a layer two of the DHCP discover message or the DHCP request message is different from a client MAC address carried by the DHCP discover message or the DHCP request message, where the DHCP offer message or the DHCP response message is a broadcast message.
Through the device, under the condition that the two-layer MAC address of the received DHCP discovery message or DHCP request message is different from the client-side MAC address carried by the DHCP discovery message or the DHCP request message, the sending module 1304 sends a DHCP providing message or a DHCP response message to the station STA equipment and/or the personal computer PC equipment which is hung down, wherein the DHCP providing message or the DHCP response message is a broadcast message, namely under the condition that the two addresses are different, the sending module 1304 sends the broadcast DHCP providing message or the DHCP response message to the STA equipment and/or the PC equipment which is hung down, and further the STA equipment and/or the PC equipment which is hung down can normally obtain the IP address, so that the problem that the address obtaining failure through the DHCP exists in the wireless relay or the lower hanging equipment of the wireless bridge in the related technology can be solved.
In an embodiment of the present invention, the apparatus further includes: and a modification module, connected to the sending module 1304, configured to fixedly fill a destination address of a second layer in the DHCP offer message or the DHCP response message as a broadcast address. Namely, the DHCP offer message or the DHCP response message is modified into the broadcast message through the modification module, so that the DHCP offer message or the DHCP response message can be sent to all the hung STA devices and/or PC devices in the system.
It should be noted that the sending module 1304 may also be configured to send a DHCP offer packet or a DHCP response packet to a down-hung STA device and/or a down-hung PC device through a wireless relay or a wireless bridge device that is down-hung by the access point AP. That is, after receiving the broadcasted DHCP offer packet or DHCP response packet, the AP-hung wireless relay or wireless bridge device directly sends the broadcasted DHCP offer packet or DHCP response packet to the wireless relay or wireless bridge device-hung STA device and/or PC device without performing special processing, so that the wireless relay or wireless bridge device-hung STA device and/or PC device can normally obtain an IP address.
In an embodiment of the present invention, the apparatus may further include: a determining module, connected to the receiving module 1302, configured to determine, according to a bootstrap protocol Bootp flag bit in a DHCP discovery message or a DHCP request message, whether a DHCP offer message or a DHCP reply message sent to a down-hanging STA device and/or PC device is a broadcast message or a unicast message, when a two-layer MAC address of the received DHCP discovery message or DHCP request message is the same as a client MAC address carried by the DHCP discovery message or the DHCP request message; when the Bootp flag bit is unicast, sending a DHCP providing message or a DHCP response message to the hung STA equipment and/or PC equipment, wherein the DHCP providing message or the DHCP response message is a unicast message; and when the Bootp flag bit is broadcast, the DHCP offer message or DHCP response message sent to the down-hanging STA device and/or PC device is a broadcast message.
It should be noted that, in the case that the MAC address of the two layers of the received DHCP discovery message or DHCP request message is the same as the client MAC address carried in the DHCP discovery message or DHCP request message, the determining module may also operate according to the operation of the sending module 1304, but is not limited thereto.
It should be noted that the above apparatus may be applied to at least one of the following scenarios: the method comprises the following steps that an Access Point (AP) hangs down a wireless relay or wireless bridge device, and meanwhile, the AP serves as a Dynamic Host Configuration Protocol (DHCP) server to distribute Internet Protocol (IP) addresses for Station (STA) devices and/or Personal Computer (PC) devices which are hung down by the wireless relay or wireless bridge device; the gateway device is in communication connection with the bridging AP, the bridging AP hangs down the wireless relay or the wireless bridge device, and meanwhile, the gateway device serves as a DHCP server to allocate an IP address to the STA device and/or the PC device that the wireless relay or the wireless network bridge device hangs down, it should be noted that in this scenario, the gateway device and the bridging AP are in communication connection, and the bridging AP may be hung down by the gateway device through a wired port, or hung down by the wireless port, but the present invention is not limited thereto; the wireless relay or wireless bridge device accesses the scene of the AP device through the 3-address mode of the infrastructure type.
The above-mentioned device is located in the DHCP server, but is not limited thereto.
The embodiment of the invention also provides a DHCP server, which comprises the message processing device.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
The embodiment of the invention also provides a storage medium. Alternatively, in the present embodiment, the above-mentioned storage medium may be configured to store program codes for executing the method in embodiment 1.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH, a removable hard disk, a magnetic disk, or an optical disk, and other various media capable of storing program codes.
Alternatively, in the present embodiment, the processor executes the steps of the method in embodiment 1 according to the program code stored in the storage medium.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented in a general purpose computing device, centralized on a single computing device such as a home gateway device, or distributed across a network of computing devices, or alternatively, may be implemented in program code executable by a computing device, such that the steps shown and described may be executed by a computing device stored in a storage device and, in some cases, executed in a sequence other than that shown or described herein, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from a plurality of modules or steps therein. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A message processing method is characterized by comprising the following steps:
receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message;
under the condition that a source Media Access Control (MAC) address of a second layer of the DHCP discovery message or the DHCP request message is different from a client MAC address carried by the DHCP discovery message or the DHCP request message, sending a DHCP providing message or a DHCP response message to a station STA device and/or a Personal Computer (PC) device hung under a wireless relay or a wireless network bridge device; wherein, the DHCP providing message or DHCP response message is a broadcast message; the source MAC address is the STA interface address of the wireless relay or the wireless bridge equipment, and the client MAC address is the MAC address of the STA equipment and/or the MAC address of the PC equipment.
2. The method according to claim 1, wherein before sending the DHCP offer message or the DHCP acknowledge message to the STA device and/or the PC device under-hung by a wireless relay or a wireless network bridge device, the method further comprises:
and fixedly filling the destination address of the two layers in the DHCP providing message or the DHCP response message as a broadcast address.
3. The method according to claim 1 or 2, wherein the DHCP discover message or the DHCP request message is received in at least one of the following scenarios:
the method comprises the following steps that an Access Point (AP) hangs down a wireless relay or wireless bridge device, and meanwhile, the AP serves as a DHCP server to distribute an Internet Protocol (IP) address for a Station (STA) device and/or a Personal Computer (PC) device which are hung down by the wireless relay or wireless bridge device;
the gateway equipment is in communication connection with a bridging AP, the bridging AP hangs down a wireless relay or a wireless bridge equipment, and meanwhile, the gateway equipment is used as a DHCP server to distribute an IP address for STA equipment and/or PC equipment hung down by the wireless relay or the wireless bridge equipment;
the wireless relay or wireless bridge device accesses the scene of the AP device through the 3-address mode of the infrastructure type.
4. Method according to claim 1 or 2, characterized in that it is performed by a DHCP server.
5. A message processing apparatus, comprising:
the receiving module is used for receiving a Dynamic Host Configuration Protocol (DHCP) discovery message or a DHCP request message;
the sending module is used for sending a DHCP providing message or a DHCP response message to a station STA device and/or a personal computer PC device which are hung under a wireless relay or wireless network bridge device under the condition that a source Media Access Control (MAC) address of a second layer of the DHCP discovery message or the DHCP request message is different from a client MAC address carried by the DHCP discovery message or the DHCP request message; wherein, the DHCP providing message or DHCP response message is a broadcast message; the source MAC address is the STA interface address of the wireless relay or the wireless bridge equipment, and the client MAC address is the MAC address of the STA equipment and/or the MAC address of the PC equipment.
6. The apparatus of claim 5, further comprising:
and the modification module is used for fixedly filling the destination address of the two layers in the DHCP providing message or the DHCP response message into a broadcast address.
7. The apparatus according to claim 5, wherein the sending module is further configured to send the DHCP offer packet or the DHCP reply packet to the STA device and/or the PC device on the downlink through the wireless relay or the wireless bridge device.
8. The apparatus according to any one of claims 5 to 7, wherein the apparatus is applied to at least one of the following scenarios:
the method comprises the following steps that an Access Point (AP) hangs down a wireless relay or wireless bridge device, and meanwhile, the AP serves as a DHCP server to distribute an Internet Protocol (IP) address for a Station (STA) device and/or a Personal Computer (PC) device which are hung down by the wireless relay or wireless bridge device;
the gateway equipment is in communication connection with a bridging AP, the bridging AP hangs down a wireless relay or a wireless bridge equipment, and meanwhile, the gateway equipment is used as a DHCP server to distribute an IP address for STA equipment and/or PC equipment hung down by the wireless relay or the wireless bridge equipment;
the wireless relay or wireless bridge device accesses the scene of the AP device through the 3-address mode of the infrastructure type.
9. The apparatus according to any of claims 5 to 7, wherein the apparatus is located in a DHCP server.
10. A dynamic host configuration protocol, DHCP, server, comprising: the device of any one of claims 5 to 9.
CN201610474421.7A 2016-06-24 2016-06-24 Message processing method and device and DHCP server Active CN107547668B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610474421.7A CN107547668B (en) 2016-06-24 2016-06-24 Message processing method and device and DHCP server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610474421.7A CN107547668B (en) 2016-06-24 2016-06-24 Message processing method and device and DHCP server

Publications (2)

Publication Number Publication Date
CN107547668A CN107547668A (en) 2018-01-05
CN107547668B true CN107547668B (en) 2022-03-15

Family

ID=60959866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610474421.7A Active CN107547668B (en) 2016-06-24 2016-06-24 Message processing method and device and DHCP server

Country Status (1)

Country Link
CN (1) CN107547668B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108650336A (en) * 2018-04-13 2018-10-12 普联技术有限公司 IP address dynamic allocation method, device and storage medium, wireless relay apparatus
CN111356126B (en) * 2018-12-20 2022-08-30 中兴通讯股份有限公司 Method, device and gateway for realizing wireless roaming

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471966A (en) * 2006-07-06 2009-07-01 华为技术有限公司 Method for preventing IP address from leakage
CN101515950B (en) * 2009-04-09 2011-11-16 杭州华三通信技术有限公司 Realization method and device for WLAN subnet terminal and wireless access client

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7505432B2 (en) * 2003-04-28 2009-03-17 Cisco Technology, Inc. Methods and apparatus for securing proxy Mobile IP
US8910282B2 (en) * 2012-09-04 2014-12-09 Jonathan Somers System and method for protecting devices on dynamically configured network
CN103685592B (en) * 2012-09-20 2018-11-30 新华三技术有限公司 A kind of wireless bridge and the method for realizing dhcp address application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471966A (en) * 2006-07-06 2009-07-01 华为技术有限公司 Method for preventing IP address from leakage
CN101515950B (en) * 2009-04-09 2011-11-16 杭州华三通信技术有限公司 Realization method and device for WLAN subnet terminal and wireless access client

Also Published As

Publication number Publication date
CN107547668A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
KR20190121842A (en) IoT communication method, apparatus and system
US8942212B2 (en) Autoconfiguration system for wireless sensor network and its method, and gateway apparatus for wireless sensor network
CN103685592B (en) A kind of wireless bridge and the method for realizing dhcp address application
CN102143247B (en) Method for allocating and configuring address, address allocation server and host machine
CN111031078B (en) Communication method and device
US20180219981A1 (en) Communication of non-ip data over packet data networks
US20180359214A1 (en) Device and method for wireless communication in an ip network
CN102118453B (en) Method, service device, client and communication system for automatic configuration of IP address
CN112398959B (en) RLC channel determination method and device
KR100909014B1 (en) Dynamic IP Address Allocation Method for Mobile Terminal in Mobile Communication System
CN110062060B (en) System and method for IP address allocation
EP4145906A1 (en) Non-ip type data transmission processing method, device and apparatus, and medium
CN112532756A (en) Interface extension method, device and system
CN106888450A (en) Information processing method and device
EP3086618B1 (en) Repeating method and corresponding communication network device, system, computer readable program product and computer readable storage medium
CN107547668B (en) Message processing method and device and DHCP server
US9503418B2 (en) Method and apparatus for obtaining remote IP address
CN104081740A (en) Method and system to reduce wireless network packets for centralized layer two network
CN101257517B (en) Method and device for processing address analysis protocol request message
EP2477372A1 (en) Method, device and terminal for obtaining terminal identifier
CN111163463B (en) Method, device, equipment and storage medium for wireless equipment to access router
CN114189497A (en) Address acquisition method and device and computer-readable storage medium
CN106850871B (en) Method for realizing DHCP server with single physical network card and multiple VLANs
WO2017000674A1 (en) 4in6 tunnel mode selection method and apparatus
CN102647768A (en) Message transmitting method and device based on LTE-LAN(long term evolution-local area network)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180420

Address after: 518057 Nanshan District science and technology, Guangdong Province, South Road, No. 55, No.

Applicant after: ZTE Corporation

Address before: 210012 Nanjing, Yuhuatai District, South Street, Bauhinia Road, No. 68

Applicant before: Nanjing Zhongxing Software Co., Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant