WO2017092588A1 - Mac地址的分配方法、装置及系统 - Google Patents

Mac地址的分配方法、装置及系统 Download PDF

Info

Publication number
WO2017092588A1
WO2017092588A1 PCT/CN2016/106849 CN2016106849W WO2017092588A1 WO 2017092588 A1 WO2017092588 A1 WO 2017092588A1 CN 2016106849 W CN2016106849 W CN 2016106849W WO 2017092588 A1 WO2017092588 A1 WO 2017092588A1
Authority
WO
WIPO (PCT)
Prior art keywords
mac address
allocated
pool
random
mac
Prior art date
Application number
PCT/CN2016/106849
Other languages
English (en)
French (fr)
Inventor
邓高亮
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017092588A1 publication Critical patent/WO2017092588A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5092Address allocation by self-assignment, e.g. picking addresses at random and testing if they are already in use
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5061Pools of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a MAC address allocation method, apparatus, and system.
  • a terminal hides a real MAC address by using a random MAC address in a process of scanning a wireless signal, thereby avoiding illegal collection of a real MAC address.
  • the related art has a problem in that a random MAC address is used only when scanning a wireless signal transmitted by a wireless access point (AP), and in actual communication, the terminal needs to use a real MAC address to avoid randomization. The conflict caused by the repetition of the MAC address can not affect the normal communication.
  • a method for allocating a MAC address including: acquiring a random MAC address of a terminal according to a scan request sent by a terminal received in advance; and searching for a presence in a preset MAC address pool.
  • the unassigned MAC address pool of the preset MAC address pool is assigned a corresponding MAC address to be assigned to the random MAC address.
  • a device for allocating a MAC address including: an obtaining module, configured to acquire a random MAC address of a terminal according to a scan request sent by a terminal received in advance; and a retrieval module, Retrieving whether there is a MAC address to be allocated corresponding to the random MAC address in the preset MAC address pool; the first allocation module is configured to extract and randomly in the preset MAC address pool if the search result is yes a MAC address to be assigned to the MAC address; a second allocation module, configured to allocate a corresponding MAC address to be assigned to the random MAC address in the unassigned MAC address pool of the preset MAC address pool if the search result is negative .
  • a system for allocating a MAC address including: an access point AP and a terminal, wherein the AP is in communication connection with the terminal, wherein the AP is a device for allocating the MAC address.
  • the random MAC address of the terminal is obtained according to the scan request sent by the terminal received in advance; and the MAC address to be allocated corresponding to the random MAC address exists in the preset MAC address pool; If the result is yes, the MAC address to be allocated corresponding to the random MAC address is extracted in the preset MAC address pool; if the search result is no, in the unallocated MAC address pool of the preset MAC address pool. Assigning a corresponding MAC address to the random MAC address, the purpose of hiding the real MAC address of the terminal in the communication process is achieved, thereby realizing the technical effect of hiding the real MAC address of the terminal in the communication process, thereby solving the related technology. The lack of the real MAC address hiding technology of the terminal causes the real MAC address of the terminal to still be illegally acquired during the communication process.
  • FIG. 1 is a block diagram showing a hardware structure of an AP of a method for allocating a MAC address according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for allocating a MAC address according to Embodiment 1 of the present application
  • FIG. 3 is a schematic diagram of a relationship between each MAC address pool in a preset MAC address pool according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a MAC address allocation process in a method for allocating a MAC address according to an embodiment of the present application
  • FIG. 5 is a flowchart of a method for allocating a MAC address according to Embodiment 1 of the present application.
  • FIG. 6 is a schematic structural diagram of a specific element in a method for allocating a MAC address according to Embodiment 1 of the present application;
  • FIG. 7 is a flowchart of another method for allocating a MAC address according to Embodiment 1 of the present application.
  • FIG. 8 is a flowchart of verifying an authentication packet in another MAC address allocation method according to Embodiment 1 of the present application.
  • FIG. 9 is a schematic structural diagram of a device for allocating a MAC address according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a device for allocating a MAC address according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a device for allocating a MAC address according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a MAC address allocation system according to an embodiment of the present application.
  • a method embodiment of a method for allocating a MAC address there is also provided a method embodiment of a method for allocating a MAC address, and it is to be noted that the steps shown in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer executable instructions. And, although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 1 is a block diagram showing the hardware structure of an AP for allocating a MAC address according to an embodiment of the present invention.
  • the AP 10 may include one or more (only one shown) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), A memory 104 for storing data, and a transmission module 106 for communication functions.
  • the structure shown in Figure 1 is only It is shown that it does not limit the structure of the above electronic device.
  • the AP 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the MAC address assignment method in the embodiment of the present invention, and the processor 102 executes by executing the software programs and modules stored in the memory 104.
  • Memory 104 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.
  • memory 104 may further include memory remotely located relative to processor 102, which may be connected to AP 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the above specific network example may include a wireless network provided by a communication provider of the AP 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for allocating a MAC address according to Embodiment 1 of the present invention.
  • Step S202 Acquire a random MAC address of the terminal according to the scan request sent by the terminal received in advance.
  • the method for allocating a MAC address in the embodiment of the present application can be applied to a wireless local area network (WLAN) environment, and is particularly applicable to a wireless access point (AP) device.
  • WLAN wireless local area network
  • AP wireless access point
  • the bridging terminal communicates with the remote server, the real media access control (MAC) address of the terminal is hidden, and the real MAC address of the terminal is prevented from being maliciously obtained. Further, the terminal does not affect the terminal based on the hidden real MAC address. Communication between servers.
  • the terminal may include: a mobile phone, a notebook computer, a tablet computer, a wearable device, a palm commerce, and the like, and the mobile terminal capable of accessing the AP device.
  • the terminal uses a smart phone as an example for description, and the details are as follows:
  • the random MAC address of the smart phone is obtained by receiving a scan request of the smart phone.
  • a wireless fidelity (WIFI) signal is taken as an example, when there is a smart phone scan.
  • the AP extracts the MAC address of the smart phone in the scan request by receiving a scan request of the smart phone, where the MAC address may be a random MAC address.
  • the following random MAC addresses of smartphones are represented by MAC-C addresses.
  • Step S204 retrieve in the preset MAC address pool whether there is a MAC address to be allocated corresponding to the random MAC address.
  • the preset MAC address pool of the AP is divided into: an unallocated MAC address pool, a pre-allocated MAC address pool, and an allocated MAC address pool, and an AP.
  • the MAC address of the smart phone in the above MAC address pool the MAC address of the corresponding MAC-C address is matched.
  • the MAC address pool is not allocated, and the MAC address that is not allocated or the MAC address after the recovery is put into the pool, and the AP is initialized.
  • the reserved MAC address is in this pool. After the terminal goes offline, the MAC corresponding to the terminal will also be recycled to the pool.
  • the pre-allocated MAC address pool is used by the AP to process a scan request probe request message to select a MAC address from the unallocated address pool. This address is transferred from the unallocated pool to the pre-allocated address pool. The correspondence between the pre-allocated MAC address and the probe request source MAC of the terminal is recorded at the time of allocation. Each MAC address in the pre-allocated address pool is transferred to the unallocated address pool after the fixed timer expires;
  • the MAC address pool is allocated for the AP to receive the 802.11 Authenticate message from the pre-allocated MAC address and the processing succeeds.
  • the MAC address is transferred from the pre-allocated address pool to the allocated address pool.
  • FIG. 3 is a schematic diagram of the relationship between each MAC address pool in a preset MAC address pool provided by the embodiment of the present application. It should be noted that all the unassigned MAC address pools in the initialization in FIG.
  • the MAC-S address status is an unassigned NA state.
  • the AP records the correspondence between the assigned MAC address and the MAC address of the smartphone in the assigned MAC address, in order to distinguish the MAC address of the AP from the smartphone, and assume the AP's default MAC address pool.
  • the MAC address in the MAC address is recorded as a MAC-S address. Therefore, it is retrieved in the preset MAC address pool whether there is a MAC address to be allocated corresponding to the random MAC address, that is, whether the presence and the intelligence are retrieved in the preset MAC address pool.
  • the MAC-S address corresponding to the MAC-C address of the mobile phone.
  • step S206 if the search result is yes, the MAC address to be allocated corresponding to the random MAC address is extracted in the preset MAC address pool.
  • the terminal is still a smart phone as an example.
  • the search result is yes, it indicates that the smart phone has accessed the AP, that is, the AP side has assigned the MAC-S address to the smart phone. And storing the correspondence between the MAC-C address of the smartphone and the assigned MAC-S address, and therefore, according to the correspondence Relationship, according to the MAC-C address query to get the corresponding MAC-S address.
  • the foregoing correspondence may be stored in the pre-allocated MAC address pool and the allocated MAC address pool, and the AP obtains the MAC by retrieving the correspondence in the allocated MAC address pool.
  • the MAC-S address corresponding to the C address; if the correspondence is not recorded in the allocated MAC address pool, the search may be performed according to the correspondence in the pre-allocated MAC address pool, thereby obtaining the MAC-S corresponding to the MAC-C address. address.
  • step S208 if the search result is no, the corresponding MAC address to be allocated is allocated to the random MAC address in the unallocated MAC address pool of the preset MAC address pool.
  • step S208 of the present application the difference from step S206 is that when the search result is no, it indicates that the smart phone has never accessed the AP, that is, the AP has never assigned the MAC-S address to the smart phone, therefore, There is no corresponding MAC-S address correspondence for the MAC-C address of the smart phone, but in order to realize communication between the smart phone and the remote server, the AP will not allocate the MAC address of the smart phone in the pool of MAC addresses.
  • the C address is assigned the corresponding MAC-S address.
  • the method for allocating the MAC address provided by the embodiment of the present application in order to circumvent the problem that the random MAC address in the related art cannot resolve the MAC address conflict when communicating with the remote server, the MAC address of the terminal in this embodiment of the present application
  • the address will be allocated by the AP.
  • the AP reserves the N MAC addresses for the terminal according to the maximum number of access terminals. Therefore, the AP allocates a MAC to the terminal when scanning, and the normal communication process after the terminal is used.
  • the MAC address assigned by the AP solves the problem that the communication fails due to the conflict between the random MAC address of the terminal and the MAC address of the remote server in the related art.
  • the solution provided in the first embodiment of the present application obtains the random MAC address of the terminal according to the scan request sent by the terminal received in advance, and searches whether the existing MAC address pool corresponds to the random MAC address.
  • the effect further solves the technical problem that the real MAC address of the terminal still exists illegally in the communication process due to the lack of the technology of hiding the real MAC address of the terminal in the related art.
  • FIG. 4 is a schematic flowchart of a MAC address allocation process in a method for allocating a MAC address according to an embodiment of the present application.
  • a method for allocating a MAC address is as follows:
  • step S204 whether a random MAC address exists in the preset MAC address pool is retrieved.
  • the steps of the MAC address to be allocated corresponding to the address include:
  • Step 1 respectively, in the unallocated MAC address pool, the pre-allocated MAC address pool, and the allocated MAC address pool, respectively, whether the random MAC address exists to have a corresponding MAC address to be allocated.
  • the AP receives the scan request message probe request sent by the smart phone, and obtains the MAC address of the smart phone by parsing the scan request message, and then passes the preset
  • the MAC address pool traverses to query whether the MAC-C address has a corresponding MAC-S address in the unallocated MAC address pool, the pre-allocated MAC address pool, and the allocated MAC address pool.
  • the step of extracting the MAC address to be allocated corresponding to the random MAC address in the preset MAC address pool includes:
  • Step S401 retrieve whether the MAC address to be allocated corresponding to the random MAC address is recorded in the allocated MAC address pool.
  • step S401 of the present application the AP searches for the corresponding MAC-S address in the allocated MAC address pool according to the MAC address of the smart phone, that is, determines the preset MAC address based on step S206.
  • the MAC-S address corresponding to the MAC-C address exists in the pool.
  • the smart phone has scanned the wireless signal sent by the AP, and the AP also assigns the corresponding MAC to the smart phone according to the MAC-C address of the smart phone. S address.
  • the smart phone has scanned the wireless signal sent by the AP, and the AP also assigns the corresponding MAC-S address to the smart phone according to the MAC-C address of the smart phone, the preset MAC address pool
  • the search in the allocated MAC address pool can quickly obtain whether the MAC-C address has a corresponding MAC-S address.
  • step S402 if the search result is yes, the corresponding MAC address to be allocated is extracted according to the random MAC address in the allocated MAC address pool.
  • step S402 of the present application based on step S401, if the AP retrieves the corresponding MAC-S address of the MAC-C address in the allocated MAC address pool, the MAC-S address is directly extracted.
  • the smart phone has scanned the wireless signal sent by the AP, and the AP also assigns the corresponding MAC-S address to the smart phone according to the MAC-C address of the smart phone, the most ideal state is in the allocated MAC address pool.
  • the MAC-S address corresponding to the MAC-C address has not been reclaimed into the unallocated MAC address pool. Therefore, after the smart phone sends a scan request message to the AP, the AP can retrieve the smart phone in the allocated MAC address pool.
  • the MAC-S address corresponding to the MAC-C address that is, the communication connection between the AP and the smart phone is always maintained, so the MAC-S address corresponding to the MAC-C address in the allocated MAC address pool has not been recovered to the unallocated MAC address.
  • the AP retrieves the MAC-C address corresponding to the MAC-C address in the allocated MAC address pool by extracting the MAC-C address in the probe request. .
  • step S403 if the search result is no, the MAC address to be allocated corresponding to the random MAC address is retrieved in the pre-allocated MAC address pool.
  • step S403 of the present application based on the step S401, when the AP does not retrieve the MAC-S address corresponding to the MAC-C address in the allocated MAC address pool, it is necessary to consider whether the MAC-C address exists as follows:
  • the MAC-S address corresponding to the MAC-C address may still be The possible reason for the pre-allocation of the MAC address pool is that the timing mechanism is provided in the method for allocating the MAC address provided by the embodiment of the present application. If the MAC-C address of the smart phone is in the MAC address of the pre-allocated MAC address pool, If the timer of the S address has not been timed out, the pre-allocated MAC address pool will retain the MAC-S address corresponding to the MAC-C address. Therefore, when the AP receives the scan request packet sent by the smartphone, it may be pre-allocated. The MAC-S address corresponding to the MAC-C address is retrieved in the allocated MAC address pool.
  • Case 2 different from Case 1, is also based on the timing mechanism, assuming that the timer of the smartphone's MAC-C address in the pre-allocated MAC address pool is timed out, but the AP never allocates the MAC-S.
  • the AP After receiving the authentication packet returned by the smart phone, after the timer is finished, the AP considers that the smart phone only performs the scanning function and does not intend to access the AP, so the MAC-S corresponding to the MAC address of the smart phone is the MAC-S.
  • the address is assigned to another terminal or the MAC-S address is returned to the unallocated MAC address pool, but the record of the MAC-C address is stored in the pre-allocated MAC address pool, so the AP can retrieve the record of the MAC-C address.
  • the step of retrieving whether the MAC address to be allocated corresponding to the random MAC address is recorded in the pre-allocated MAC address pool in step S403 includes:
  • step S404 if the search result is yes, the corresponding MAC address to be allocated is extracted according to the random MAC address in the pre-allocated MAC address pool, and the pre-allocated MAC address pool timer is refreshed.
  • step S404 of the present application as in the scenario 1 in the above step S403, when the AP retrieves that the MAC-S address corresponding to the MAC-C address exists in the pre-allocated MAC address pool, it indicates that the smart phone has received the AP allocation before. After the MAC-S address is not fed back the authentication packet, and the corresponding timer of the MAC-S address in the pre-allocated MAC address pool has not expired, the AP detects the scan request message sent by the smartphone again.
  • the MAC-C address is taken, but since the MAC-S address corresponding to the MAC-C address is not retrieved in the allocated MAC address pool, the MAC-S address corresponding to the MAC-C address is retrieved in the pre-allocated MAC address pool. Thereby, the MAC-S address corresponding to the MAC-C address is extracted, and the timer is refreshed, so that the timing mechanism is followed, that is, whether the smart phone confirms access to the current AP to perform a timing mechanism.
  • Step S405 if the search result is no, the idle MAC address to be allocated is extracted from the unallocated MAC address pool, the idle MAC address to be allocated is allocated to the random MAC address, and the idle MAC address to be allocated and the random MAC are stored.
  • the correspondence between the addresses generates a pre-allocated MAC address pool timer.
  • step S405 of the present application as in the scenario 2 in the above step S403, when the AP retrieves that the MAC-S address corresponding to the MAC-C address exists in the pre-allocated MAC address pool, it indicates that the smart phone has received the AP allocation before.
  • the MAC-S address does not feed back the authentication packet, and the corresponding timer of the MAC-S address in the pre-allocated MAC address pool has expired. Therefore, after the AP detects the scan request message sent by the smartphone again.
  • the MAC-S address corresponding to the MAC-C address is retrieved in the pre-allocated MAC address pool.
  • the MAC-S address corresponding to the MAC-C address is not found in the pre-allocated MAC address pool, so the AP will extract the idle MAC-S address in the unallocated MAC address pool and store the MAC-C address and MAC address.
  • the timers in the pre-allocated MAC address pool can be set to 4s.
  • the timer corresponding to the MAC-S address will be re-entered for 4s timing.
  • the timing of setting the timer in the embodiment of the present application is only described by using 4s as an example, and the method for allocating the MAC address provided by the embodiment of the present application is applicable, which is not limited.
  • step S208 if the search result is no, the step of allocating a corresponding MAC address to be allocated to the random MAC address in the unassigned MAC address pool of the preset MAC address pool includes: :
  • Step S406 determining whether there is any remaining MAC address to be allocated in the unallocated MAC address pool.
  • step S406 of the present application different from the step S401 to the step S405, when the AP does not retrieve the MAC-S address corresponding to the MAC-C address in the preset MAC address pool, the AP will be in the preset MAC address.
  • the unallocated MAC address pool in the address pool queries whether there are any remaining MAC-S addresses to be allocated.
  • the AP since the number of MAC-S addresses stored by the AP is limited, after the AP receives the scan request sent by the smart phone, the AP does not retrieve the MAC corresponding to the MAC-C address in the preset MAC address pool. For the S address, you need to query the number of MAC-S addresses remaining in the unassigned MAC address pool.
  • Step S407 in the case that the determination result is yes, assign a corresponding MAC to be allocated to the random MAC address.
  • Address which stores the correspondence between the random MAC address and the MAC address to be assigned.
  • step S407 of the present application based on step S406, if the AP queries in the unallocated MAC address pool to find that there is still a remaining MAC-S address to be allocated, the MAC-S address is allocated to the MAC-C address of the smart phone. And generating a correspondence between the MAC-C address and the MAC-S address.
  • Step S408 the correspondence is transferred to the pre-allocated MAC address pool, and a pre-allocated MAC address pool timer is generated.
  • step S408 after the correspondence between the MAC-C address and the MAC-S address is generated, the correspondence is transferred to the pre-allocated MAC address pool, and the corresponding MAC-S address is generated.
  • the timer where the timer corresponding to the MAC-S address can still be set to 4s timing.
  • step S409 if the result of the determination is no, it is retrieved in the pre-allocated MAC address pool whether there is a MAC address to be allocated whose timing is less than a preset threshold.
  • step S409 of the present application when the AP finds that there is no MAC-S address remaining in the unallocated MAC address pool, but the AP allocates the corresponding MAC-S address to the MAC address of the smart phone, Retrieving, from the pre-allocated MAC address pool, whether there is a MAC-S address whose timer is less than a preset threshold.
  • the timing mechanism when the timer corresponding to the MAC-S address is about to end or has ended, the MAC address pool is pre-allocated. The MAC-S address in it will be assigned to other terminals.
  • the preset threshold is 2s.
  • the AP finds that there is no MAC-S address remaining in the unallocated MAC address pool, it searches whether the MAC-S address in the pre-allocated MAC address pool has a MAC-S whose timing is less than or equal to 2s. address.
  • the default threshold of the timer provided by the embodiment of the present application is only 2s, and the method for allocating the MAC address provided by the embodiment of the present application is applicable, which is not limited. That is, the principle is that the remaining time of the timer in the pre-allocated MAC address pool is the shortest, and is less than 2 s.
  • the MAC-S address corresponds to the terminal, but the terminal does not use the MAC-S address to send the authentication Authenticate message. If the timer has a long time remaining, it is likely that the terminal has not yet sent the Authenticate. If it is greater than 2s, it has not been sent yet.
  • the Authenticate packet indicates that the terminal only scans and does not want to associate with the AP. At this time, the AP can assign the MAC-S address to the smartphone.
  • the step of retrieving, in the step S409, the pre-assigned MAC address pool, whether there is a MAC address to be allocated whose timing is less than a preset threshold includes:
  • step S410 if the search result is yes, the MAC address to be allocated is allocated to the random MAC address, and the correspondence between the MAC address to be allocated and the random MAC address in the pre-allocated MAC address pool is updated, and the pre-allocation is refreshed.
  • MAC address pool timer if the search result is yes, the MAC address to be allocated is allocated to the random MAC address, and the correspondence between the MAC address to be allocated and the random MAC address in the pre-allocated MAC address pool is updated, and the pre-allocation is refreshed.
  • step S410 of the present application based on the step S409, when the AP retrieves the MAC-S address in the pre-allocated MAC address pool that is less than the preset threshold, the AP will take the timing from the pre-allocated MAC address pool to be less than the preset threshold.
  • the MAC-S address is assigned to the MAC-C address of the smartphone, and the correspondence between the MAC-S address and the MAC-C address is updated, and the timer corresponding to the MAC-S address is refreshed, that is, the timer is re-timed from 4s.
  • step S411 if the search result is no, the terminal is instructed to use the real MAC address.
  • step S411 of the present application when there is no remaining MAC-S address to be allocated in the unallocated MAC address pool, and there is no MAC-S address in the pre-allocated MAC address pool that is less than the preset threshold, the AP will instruct the smartphone to communicate using the real MAC address.
  • FIG. 5 is a flowchart of a method for allocating a MAC address according to the first embodiment of the present invention. As shown in FIG. 5, the method for allocating a MAC address according to the embodiment of the present application further includes:
  • Step S209 the MAC address to be allocated is encapsulated in a scan response message
  • step S209 of the present application based on the MAC-S address allocation process shown in FIG. 4, after the AP retrieves the MAC-S address corresponding to the MAC-C address, the MAC-S address is encapsulated, that is, the MAC is encapsulated.
  • the S-address is encapsulated in a scan response message, and the scan response message is used to indicate that the terminal has assigned a corresponding MAC-S address to the MAC-C address of the terminal.
  • the AP packages and encapsulates the retrieved MAC-S address with the MAC address of the smart phone to obtain a scan response message.
  • Step S210 Return the scan response message to the terminal.
  • step S210 of the present application based on step S209, the AP sends the scan response message to the terminal after the MAC-S address is encapsulated into the scan response message.
  • the scan response Probe Response message is generated according to the MAC-S address, and the smart message is sent to the smart The mobile phone sends the Probe Response message to enable the smartphone to use the MAC-S address.
  • step S209 includes:
  • Step S501 encapsulating the MAC address to be allocated and the random MAC address in a specific element
  • FIG. 6 is a schematic structural diagram of a specific element in a method for allocating a MAC address according to the first embodiment of the present invention.
  • the AP sends to the smart device.
  • the specific element of the mobile phone's scan response message Vendor Specific element includes: element ID (element ID), The element length (Length), the Organizationally Unique Identifier (OUI), the Sub ID, the MAC-C address, and the MAC-S address, wherein the SUB ID is 1, indicating that the MAC address subtype is assigned.
  • the AP encapsulates the retrieved MAC-S address and the MAC address of the smart phone into a specific element Vendor Specific element, where the role of the Vendor Specific element is that after receiving the Probe Response, the terminal will check whether there is a Vendor Specific element. If yes, the subsequent association process uses the MAC-S address as the MAC address used for communication, and also needs to carry the Vendor Specific element when the subsequent authentication Authenticate message is sent. The content is a copy of the Vendor Specific element in the Probe Response. If there is no Vendor Specific element in the Probe Response, the terminal returns the authentication message using the real MAC address according to the normal processing.
  • the AP retrieves the MAC-S address corresponding to the MAC address of the smart phone, the AP will encapsulate the MAC-C address and the MAC-S address according to the structure type of the Vendor Specific element, so as to make subsequent When the smartphone returns the authentication Authenticate message, it still returns the authentication according to the specific element.
  • Step S502 generating a scan response message according to the specific element.
  • step S502 of the present application based on step S501, after the MAC-S address retrieved by the AP and the MAC-C address of the smart phone are encapsulated according to the specific element, a scan response message is obtained.
  • FIG. 7 is a flowchart of another method for allocating a MAC address according to the first embodiment of the present invention. As shown in FIG. 7 , after the scan response message is returned to the terminal in step S210, the embodiment of the present application provides The method for allocating the MAC address also includes:
  • Step S211 the receiving terminal returns an authentication message according to the scan response message.
  • step S211 of the present application based on the process of generating and transmitting the scan response message shown in FIG. 5, the AP receives the authentication Authenticate message returned by the smart phone according to the scan response Probe Response message.
  • Step S212 verifying the authentication message.
  • step S212 of the present application after the AP receives the Authenticate returned by the smart phone, the Authenticate is verified by the AP, so that the smart phone is determined according to the process of confirming the subsequent bridging of the smart phone and the remote server.
  • the MAC-S in the Vendor Specific element in the Probe Response communicates.
  • Step S213 When the verification is successful, the authentication response message is returned according to the authentication message.
  • step S213 of the present application after the AP verifies that the authentication packet sent by the smart phone is successful, the AP generates a verification result of the verification success or failure, and returns the verification result to the smart phone in the form of an authentication response message. Causing the subsequent AP to bridge the smartphone with the remote server, thereby enabling the smartphone to use the MAC-S The address communicates with the remote server via the AP.
  • FIG. 8 is a flowchart of verifying an authentication packet in another method for allocating a MAC address according to the first embodiment of the present invention.
  • the step of verifying the authentication packet in step S212 includes:
  • Step S801 determining whether a specific element is carried in the authentication message.
  • step S801 of the present application based on step S212, as shown in FIG. 8, after receiving the Authenticate message sent by the smart phone, the AP determines whether the Authenticate message includes a Vendor Specific element, and if the Authenticate carries Vendor Specific The element performs step S802; if not, the feedback authentication succeeds, wherein if the Authenticate does not carry the Vendor Specific element, the MAC address of the AP is not allocated to the MAC address of the smart phone in the AP's predetermined MAC address pool.
  • the smart phone uses the real MAC-C address, so the verification succeeds, that is, in the method for allocating the MAC address provided by the embodiment of the present application, if the terminal does not carry the Vendor Specific element, the original 802.11 carries the prescribed procedure. Therefore, this processing does not have a side effect on a terminal that does not support the Vendor Specific element.
  • Step S802 when the determination result is yes, it is determined whether the MAC address to be allocated in the authentication message is a MAC address recorded in the pre-allocated MAC address pool.
  • step S802 of the present application based on the timer mechanism, when the AP receives the authentication packet sent by the smart phone in the timer period corresponding to the MAC-S address, the AP will be in the pre-allocated MAC address pool. And determining whether the MAC-S address corresponding to the MAC-C address in the authentication packet sent by the smart phone is a correspondence between the MAC-C address recorded in the pre-allocated MAC address pool and the MAC-S address.
  • the step of determining, in step S802, whether the MAC address to be allocated in the authentication packet is the MAC address recorded in the pre-allocated MAC address pool includes:
  • step S803 if the result of the determination is YES, it is determined whether the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is the same as the random MAC address in the authentication packet.
  • step S803 of the present application based on the determination in step S802, if the AP determines that the MAC-S address in the authentication packet is the MAC-S address recorded in the pre-allocated MAC address pool, the AP needs to determine the pre-allocated MAC address pool. Whether the MAC-C address corresponding to the MAC-S address recorded in the record is the same as the MAC-C address in the authentication packet.
  • the AP searches whether the MAC-S is in the pre-allocated MAC address pool and checks whether the MAC-C in the Authenticate packet is saved in the pre-allocated address pool. Whether the MAC-C address in the correspondence between the MAC-C address and the MAC-S address is the same.
  • Step S804 if the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is the same as the random MAC address in the authentication packet, the MAC address to be allocated is transferred to the allocated MAC address. The address pool and feedback authentication succeeded.
  • step S804 of the present application when the AP determines that the MAC-C address corresponding to the MAC-S address recorded in the pre-allocated MAC address pool is the same as the MAC-C address in the authentication packet, the AP will transfer the MAC- The correspondence between the S address and the MAC-C address is in the allocated MAC address pool, and the feedback authentication is successful, that is, the feedback Status Code is success.
  • step S805 if the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is different from the random MAC address in the authentication packet, the feedback authentication fails.
  • step S805 of the present application when the AP determines that the MAC-C address corresponding to the MAC-S address recorded in the pre-allocated MAC address pool is different from the MAC-C address in the authentication packet, the AP fails the feedback authentication. If the information is inconsistent, it indicates that the MAC-S address has been allocated to another terminal in the pre-allocated MAC address pool, and therefore responds to the Authenticate message whose Status code is REFUSED to reject the terminal connection.
  • the MAC-S address is also recorded in the pre-allocated MAC address pool, but if the terminal is in the MAC If the timer corresponding to the -S address expires to feed back the authentication packet, the MAC-S address in the pre-allocated MAC address pool will be allocated to other scanning AP terminals with a high probability, and the MAC-S address is refreshed.
  • the mapping between the MAC-C addresses, so the AP side will not respond to the authentication failure, that is, the Status code is REFUSED.
  • step S802 the step of determining whether the MAC address to be allocated in the authentication packet is the MAC address recorded in the pre-allocated MAC address pool further includes:
  • step S806 if the determination result is negative, it is determined whether the MAC address to be allocated in the authentication message is the MAC address recorded in the allocated MAC address pool.
  • step S806 of the present application in the case that the AP determines that the MAC-S address in the authentication packet is not the MAC-S address recorded in the pre-allocated MAC address pool, the AP determines the MAC in the authentication packet.
  • the -S address is the MAC-S address recorded in the allocated MAC address pool.
  • step S807 is performed; if no, step S810 is performed, as follows.
  • Step S807 if the MAC address to be allocated in the authentication packet is the MAC address recorded in the allocated MAC address pool, determine the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool. Whether the address is the same as the random MAC address in the authentication message.
  • step S807 of the present application based on step S806, when the MAC-S address of the AP in the authentication packet is the MAC-S address recorded in the allocated MAC address pool, the AP needs to further allocate the MAC address pool. It is determined whether the MAC-C address corresponding to the MAC-S address recorded in the allocated MAC address pool is the same as the MAC-C address in the authentication packet.
  • step S808 if the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is the same as the random MAC address in the authentication packet, the feedback authentication succeeds.
  • step S808 of the present application based on the step S807, if the AP determines that the MAC-C address corresponding to the MAC-S address recorded in the allocated MAC address pool is the same as the MAC-C address in the authentication packet, the feedback authentication succeeds. That is, if the AP determines that the MAC-C address corresponding to the recorded MAC-S address is the same as the MAC-C address in the authentication packet, the AP directly responds to the Authenticate packet whose Status Code is SUCCESS.
  • step S809 if the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is different from the random MAC address in the authentication packet, the feedback authentication fails.
  • the method is different from the step S808. If the AP determines that the MAC-C address corresponding to the MAC-S address recorded in the allocated MAC address pool is different from the MAC-C address in the authentication packet, the feedback authentication fails. That is, if the AP determines that the MAC-C address corresponding to the recorded MAC-S address is inconsistent with the MAC-C address in the authentication packet, it directly responds to the Authenticate message whose Status Code is REFUSED.
  • the step of determining, in step S806, whether the MAC address to be allocated in the authentication packet is the MAC address recorded in the allocated MAC address pool further includes:
  • step S810 if the MAC address to be allocated in the authentication packet is not the MAC address recorded in the allocated MAC address pool, the feedback authentication fails.
  • step S810 of the present application in the case that the MAC-S address in the authentication packet is not the MAC-S address recorded in the allocated MAC address pool, the feedback authentication fails, that is, if the AP determines If the MAC-S address in the authentication packet is not the MAC-S address recorded in the allocated MAC address pool, it directly responds to the Authenticate packet whose Status Code is REFUSED.
  • mechanism 1 after the AP drops the address, the AP starts a 4s timer, and if the Authenticate packet of the terminal is still not received after the timer expires, If the terminal does not connect to the AP, the MAC address will be transferred to the unallocated address pool.
  • Mechanism 2 Due to the mechanism of timer aging, the AP may assign the same MAC-S address to different terminals at different time points. The role of the MAC-C is to prevent different terminals from using the same MAC address to connect to the AP. Only the terminal that was last assigned can be connected, and the others will be rejected.
  • Mechanism 3 When the terminal goes offline, it searches for the MAC-S address in the allocated address pool, and if so, transfers to the unallocated address pool.
  • the terminal side hides the real MAC address by using the random MAC address in the process of scanning the wireless signal sent by the AP, the possibility of illegally acquiring the MAC address is avoided, but if the terminal is still with the remote server If a random MAC address is used, the MAC address conflict is likely to occur, and the problem that the terminal and the remote server cannot communicate with each other occurs.
  • the preset maximum corresponding in the AP is The upper limit is used to access the MAC address of the number of users, so that the terminal accessing the AP establishes a communication connection with the remote server by using the MAC address allocated by the AP, so as to achieve the situation of avoiding the illegal acquisition of the real MAC address of the terminal, and ensuring the terminal and the The communication quality of the remote server.
  • the purpose of hiding the real MAC address of the terminal in the communication process is achieved, thereby realizing the technical effect of hiding the real MAC address of the terminal in the communication process, thereby solving the technology of hiding the real MAC address of the terminal due to lack of related technologies.
  • the real MAC address of the terminal still has technical problems that are illegally acquired during communication.
  • the MAC address allocation method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be through hardware, but many In the case of the former is a better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • an apparatus embodiment for implementing the foregoing method embodiments is also provided.
  • the apparatus provided by the foregoing embodiment of the present application may be run on a wireless access hotspot AP.
  • FIG. 9 is a schematic structural diagram of a device for allocating a MAC address according to an embodiment of the present application.
  • the MAC address allocation apparatus includes an acquisition module 92, a retrieval module 94, a first distribution module 96, and a second distribution module 98.
  • the obtaining module 92 is configured to acquire a random MAC address of the terminal according to the scan request sent by the terminal received in advance, and the searching module 94 is configured to retrieve, in the preset MAC address pool, whether there is a corresponding to the random MAC address.
  • the first allocation module 96 is configured to: in the case that the search result is yes, extract the MAC address to be allocated corresponding to the random MAC address in the preset MAC address pool; the second allocation module 98 is configured to If the search result is no, the corresponding MAC address to be allocated is allocated to the random MAC address in the unallocated MAC address pool of the preset MAC address pool.
  • the solution provided in the foregoing Embodiment 2 of the present application obtains a random MAC address of the terminal according to the scan request sent by the terminal received in advance; and searches whether the existing MAC address pool corresponds to the random MAC address.
  • the MAC address to be allocated in the case that the retrieval result is yes, the MAC address to be allocated corresponding to the random MAC address is extracted in the preset MAC address pool; if the retrieval result is no, the preset MAC address is The unassigned MAC address pool of the pool allocates a corresponding MAC address to the random MAC address, which achieves the purpose of hiding the real MAC address of the terminal during the communication process, thereby realizing the technology of hiding the real MAC address of the terminal during the communication process.
  • the effect further solves the technical problem that the real MAC address of the terminal still exists illegally in the communication process due to the lack of the technology of hiding the real MAC address of the terminal in the related art.
  • the foregoing obtaining module 92, the retrieving module 94, the first allocating module 96, and the second allocating module 98 correspond to steps S202 to S208 in the first embodiment, and the four modules are implemented by corresponding steps.
  • the examples and application scenarios are the same, but are not limited to the contents disclosed in the above embodiment 1.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the retrieval module 94 includes: a first retrieval unit,
  • the first retrieving unit is configured to: in the case that the preset MAC address pool includes an unallocated MAC address pool, a pre-allocated MAC address pool, and an allocated MAC address pool, the unassigned MAC address pool and the pre-allocated MAC address pool And whether the random MAC address is respectively retrieved from the allocated MAC address pool to determine whether there is a corresponding MAC address to be allocated.
  • the first search unit corresponds to Step 1 of step S204 in the first embodiment
  • the module is the same as the example and the application scenario implemented by the corresponding step, but is not limited to the content disclosed in the first embodiment.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the first allocating module 96 includes: a second retrieving unit, a first allocating unit, and a second allocating unit.
  • the second search unit is configured to retrieve whether the MAC address to be allocated corresponding to the random MAC address is recorded in the allocated MAC address pool; and the first allocation unit is configured to allocate the MAC address pool if the search result is yes.
  • the corresponding allocation MAC address is extracted according to the random MAC address; and the second allocation unit is configured to retrieve, in the case of the retrieval result, whether the MAC address to be allocated corresponding to the random MAC address is recorded in the pre-allocated MAC address pool.
  • the foregoing second retrieval unit, the first allocation unit, and the second allocation unit correspond to steps S401 to S403 in the first embodiment, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps. However, it is not limited to the content disclosed in the first embodiment above. It should be noted that the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the first allocation unit includes: a first extraction subunit and a second extraction subunit.
  • the first extraction sub-unit is configured to: in the case that the search result is yes, extract a corresponding MAC address to be allocated according to the random MAC address in the pre-allocated MAC address pool, and refresh the pre-allocated MAC address pool timer; Extracting a subunit for extracting an idle MAC address to be allocated from an unassigned MAC address pool, allocating an idle MAC address to be allocated to a random MAC address, and storing an idle MAC address to be allocated.
  • a pre-allocated MAC address pool timer is generated corresponding to the random MAC address.
  • first extraction sub-unit and the second extraction sub-unit correspond to step S404 and step S405 in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but not It is limited to the content disclosed in the above embodiment 1.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the second allocation module 98 includes: a determining unit, a third allocating unit, a configuring unit, and a third retrieving unit.
  • the determining unit is configured to determine whether there is a remaining MAC address to be allocated in the unallocated MAC address pool, and the third allocation unit is configured to allocate a corresponding MAC address to be allocated to the random MAC address if the determination result is yes. And storing a correspondence between the random MAC address and the MAC address to be allocated; the configuration unit is configured to transfer the correspondence to the pre-allocated MAC address pool to generate a pre-allocated MAC address pool timer; and the third retrieval unit is configured to: If no, it is retrieved in the pre-allocated MAC address pool whether there is a MAC address to be allocated whose timing is less than a preset threshold.
  • the foregoing determining unit, the third assigning unit, the configuring unit, and the third searching unit correspond to the steps S406 to S409 in the first embodiment, and the examples and application scenarios implemented by the four modules and the corresponding steps. The same, but not limited to, the content disclosed in the above embodiment 1. It should be noted that the above module is used as one of the devices. The part can be implemented in the AP 10 provided in the first embodiment, and can be implemented by software or by hardware.
  • the third retrieval unit includes: a first allocation subunit and a configuration subunit.
  • the first allocation sub-unit is configured to allocate the MAC address to be allocated to the random MAC address, and update the correspondence between the MAC address to be allocated and the random MAC address in the pre-allocated MAC address pool, and refresh A pre-allocated MAC address pool timer; a configuration sub-unit for instructing the terminal to use the real MAC address if the retrieval result is no.
  • the foregoing first allocation subunit and configuration subunit correspond to step S410 and step S411 in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above.
  • the content disclosed in the first embodiment may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • FIG. 10 is a schematic structural diagram of a MAC address allocation apparatus according to an embodiment of the present application.
  • the apparatus for allocating a MAC address provided by the embodiment of the present application further includes: a packaging module 1002 and a sending module 1004.
  • the encapsulating module 1002 encapsulates the MAC address to be allocated in the scan response message, and the sending module 1004 is configured to return the scan response message to the terminal.
  • the foregoing encapsulation module 1002 and the transmission module 1004 correspond to step S209 and step S210 in the first embodiment.
  • the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above embodiments.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the encapsulating module 1002 includes: a packaging unit and a message generating unit.
  • the encapsulating unit is configured to encapsulate the MAC address to be allocated and the random MAC address in a specific element, and the packet generating unit is configured to generate a scan response message according to the specific element.
  • the foregoing encapsulation unit and the packet generation unit correspond to step S501 and step S502 in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above embodiments.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • FIG. 11 is a schematic structural diagram of a MAC address allocation apparatus according to an embodiment of the present application.
  • the apparatus for allocating a MAC address provided by the embodiment of the present application further includes: a receiving module 1102, a verification module 1104, and a feedback module 1106.
  • the receiving module 1102 is configured to: after receiving the scan response message, return the receiving terminal according to the scan The authentication packet returned by the packet; the verification module 1104 is configured to verify the authentication packet; and the feedback module 1106 is configured to: when the verification succeeds, return the authentication response packet according to the authentication packet.
  • the foregoing receiving module 1102, the verification module 1104, and the feedback module 1106 correspond to steps S211 to S213 in the first embodiment, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps, but not It is limited to the content disclosed in the above embodiment 1. It should be noted that the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the verification module 1104 includes: a first determining unit and a second determining unit.
  • the first determining unit is configured to determine whether the specific element is carried in the authentication packet
  • the second determining unit is configured to determine, when the determining result of the first determining unit is yes, whether the MAC address to be allocated in the authentication packet is Pre-allocate the MAC address recorded in the MAC address pool.
  • the foregoing first determining unit and the second determining unit correspond to step S801 and step S802 in the first embodiment, and the two modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the above.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the second determining unit includes: a first determining subunit, a first authenticating subunit, and a second authenticating subunit.
  • the first determining sub-unit is configured to determine, when the determination result of the second determining unit is yes, whether the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is random with the authentication packet.
  • the MAC address is the same; the first authentication sub-unit is configured to transfer the MAC address to be allocated if the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is the same as the random MAC address in the authentication packet.
  • the second authentication sub-unit is configured to: the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is different from the random MAC address in the authentication packet Next, the feedback authentication failed.
  • the foregoing first determining subunit, the first authenticating subunit, and the second authenticating subunit correspond to steps S803 to S805 in the first embodiment, and the three modules and the corresponding steps are implemented by the example and The application scenario is the same, but is not limited to the content disclosed in the first embodiment.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the second determining unit further includes: a second determining subunit, a third determining unit, a third authenticating subunit, and a fourth authenticating subunit.
  • the second determining sub-unit is configured to determine, in the case that the determination result of the second determining unit is negative, whether the MAC address to be allocated in the authentication packet is the MAC address recorded in the allocated MAC address pool; Single And determining, in the case that the MAC address to be allocated in the authentication packet is the MAC address recorded in the allocated MAC address pool, determining whether the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is authenticated The random MAC address in the packet is the same.
  • the third authentication sub-unit is configured to provide feedback when the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is the same as the random MAC address in the authentication packet. The authentication succeeds; the fourth authentication sub-unit is configured to fail the feedback authentication when the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is different from the random MAC address in the authentication packet.
  • the foregoing second determining subunit, the third determining unit, the third authenticating subunit, and the fourth authenticating subunit correspond to steps S806 to S809 in the first embodiment, the four modules and the corresponding steps.
  • the implemented example and the application scenario are the same, but are not limited to the content disclosed in the above embodiment 1.
  • the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the apparatus for allocating a MAC address provided by the embodiment of the present application further includes: a fifth authentication subunit.
  • the fifth authentication sub-unit is configured to: when the MAC address to be allocated in the authentication packet is not the MAC address recorded in the allocated MAC address pool, the feedback authentication fails.
  • the foregoing fifth authentication sub-unit corresponds to the step S810 in the first embodiment, and the module is the same as the example and the application scenario implemented by the corresponding steps, but is not limited to the content disclosed in the first embodiment. It should be noted that the foregoing module may be implemented in the AP 10 provided in the first embodiment as a part of the device, and may be implemented by software or by hardware.
  • the terminal side hides the real MAC address by using the random MAC address in the process of scanning the wireless signal sent by the AP, the possibility of illegally acquiring the MAC address is avoided, but if the terminal is still with the remote server If a random MAC address is used, the MAC address conflict is likely to occur, and the problem that the terminal and the remote server cannot communicate with each other occurs.
  • the preset maximum corresponding in the AP is The upper limit is used to access the MAC address of the number of users, so that the terminal accessing the AP establishes a communication connection with the remote server by using the MAC address allocated by the AP, so as to achieve the situation of avoiding the illegal acquisition of the real MAC address of the terminal, and ensuring the terminal and the The communication quality of the remote server.
  • the purpose of hiding the real MAC address of the terminal in the communication process is achieved, thereby realizing the technical effect of hiding the real MAC address of the terminal in the communication process, thereby solving the technology of hiding the real MAC address of the terminal due to lack of related technologies.
  • the real MAC address of the terminal still has technical problems that are illegally acquired during communication.
  • the AP in the MAC address allocation system provided by the foregoing embodiment of the present application may be a wireless access hotspot AP.
  • FIG. 12 is a schematic structural diagram of a MAC address allocation system according to an embodiment of the present application.
  • the MAC address allocation system includes: an access point AP 1202 and a terminal 1204, and the AP 1202 is in communication connection with the terminal 1204, wherein the AP 1202 is a MAC address allocation device shown in any one of FIG. 9 to FIG. .
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the method for allocating the MAC address provided in the first embodiment.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: acquiring a random MAC address of the terminal according to the scan request sent by the terminal received in advance; in the preset MAC address pool If there is a MAC address to be allocated corresponding to the random MAC address, if the search result is yes, the MAC address to be allocated corresponding to the random MAC address is extracted in the preset MAC address pool; if the search result is no In this case, the corresponding MAC address to be allocated is allocated to the random MAC address in the unallocated MAC address pool of the preset MAC address pool.
  • the storage medium is further configured to store program code for performing the following steps: in the case that the preset MAC address pool includes an unallocated MAC address pool, a pre-allocated MAC address pool, and an allocated MAC address pool, The unassigned MAC address pool, the pre-allocated MAC address pool, and the allocated MAC address pool respectively retrieve whether the random MAC address has a corresponding MAC address to be allocated.
  • the storage medium is further configured to store program code for performing the following steps: in case the search result is yes, retrieving whether the MAC address to be allocated corresponding to the random MAC address is recorded in the allocated MAC address pool; If the result is yes, the corresponding MAC address to be allocated is extracted according to the random MAC address in the allocated MAC address pool; if the search result is no, the MAC address to be allocated corresponding to the random MAC address is retrieved and recorded in the pre-allocation. MAC address pool.
  • the storage medium is further configured to store program code for performing the following steps: in the case that the search result is yes, extract the corresponding MAC address to be allocated according to the random MAC address in the pre-allocated MAC address pool, and refresh Pre-allocating the MAC address pool timer; if the search result is no, the idle MAC address pool is extracted from the unassigned MAC address pool, and the idle MAC address to be allocated is allocated to the random MAC address and stored.
  • a pre-allocated MAC address pool timer is generated by the correspondence between the idle MAC address to be allocated and the random MAC address.
  • the storage medium is further configured to store program code for performing the following steps: determining whether there is a remaining MAC address to be allocated in the unallocated MAC address pool; and if the determination result is yes, assigning a random MAC address The corresponding MAC address to be allocated, the correspondence between the random MAC address and the MAC address to be allocated is stored; the correspondence is transferred to the pre-allocated MAC address pool to generate a pre-allocated MAC address pool timer; if the judgment result is no, The pre-allocated MAC address pool retrieves whether there is a MAC address to be allocated whose timing is less than a preset threshold.
  • the storage medium is further configured to store program code for performing the following steps: in the case that the search result is yes, assign the MAC address to be allocated to the random MAC address, and update the MAC to be allocated in the pre-allocated MAC address pool. The correspondence between the address and the random MAC address is refreshed, and the pre-allocated MAC address pool timer is refreshed; if the search result is no, the terminal is instructed to use the real MAC address.
  • the storage medium is further configured to store program code for performing the steps of: encapsulating the MAC address to be allocated in the scan response message; and returning the scan response message to the terminal.
  • the storage medium is further configured to store program code for performing the steps of: encapsulating the MAC address to be assigned and the random MAC address in a particular element; generating a scan response message in accordance with the particular element.
  • the storage medium is further configured to store program code for performing the following steps: receiving the authentication message returned by the terminal according to the scan response message; verifying the authentication message; and when the verification is successful, returning the authentication response according to the authentication message Message.
  • the storage medium is further configured to store program code for performing the following steps: determining whether to carry a specific element; when the determination result is yes, determining whether the MAC address to be allocated in the authentication message is a pre-allocated MAC address pool The MAC address recorded in .
  • the storage medium is further configured to store program code for performing the following steps: determining, if the determination result is yes, whether the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is authenticated
  • the random MAC address in the packet is the same. If the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is the same as the random MAC address in the authentication packet, the MAC address to be allocated is transferred to the allocated MAC address.
  • the MAC address pool is forwarded and the authentication succeeds. If the random MAC address corresponding to the MAC address to be allocated recorded in the pre-allocated MAC address pool is different from the random MAC address in the authentication packet, the feedback authentication fails.
  • the storage medium is further configured to store program code for performing the following steps: determining, in the case of the determination result, whether the MAC address to be allocated in the authentication message is the MAC recorded in the allocated MAC address pool Address: If the MAC address to be assigned in the authentication packet is the MAC address recorded in the allocated MAC address pool, determine whether the random MAC address corresponding to the MAC address to be allocated recorded in the MAC address pool is associated with the authentication packet.
  • the random MAC address is the same; if the random MAC address corresponding to the MAC address to be allocated recorded in the allocated MAC address pool is the same as the random MAC address in the authentication packet, the feedback authentication succeeds; in the allocated MAC address pool If the recorded random MAC address corresponding to the MAC address to be assigned is different from the random MAC address in the authentication packet, the feedback authentication fails.
  • the storage medium is further configured to store program code for performing the following steps: in the case where the MAC address to be allocated in the authentication message is not the MAC address recorded in the allocated MAC address pool, the feedback authentication fails.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, It can be stored on a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种MAC地址的分配方法、装置及系统。其中,该方法包括:依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。

Description

MAC地址的分配方法、装置及系统
本申请要求2015年12月03日递交的申请号为201510884047.3、发明名称为“MAC地址的分配方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,具体而言,涉及一种MAC地址的分配方法、装置及系统。
背景技术
随着网络时代的发展,除了网络技术的革新进步,如何确保网络安全成为了网络时代所关注的主要问题。众所周知,无线通信虽然由IEEE在特有的802.11i和802.11w两个子协议来针对无线数据报文和无线管理报文进行加密,但是用户所使用的终端的介质访问控制(Media Access Control,简称MAC)地址无法被加密,因此若数据统计公司违规通过MAC地址进行数据收集,则通过对该数据进行分析即可获取用户的行踪以及外出习惯,由此可知如何避免由于终端的MAC地址的暴露,导致用户隐私被侵犯成为了亟待解决的技术问题。
在相关技术中,提出一种终端在对无线信号进行扫描的过程中,通过使用随机MAC地址的方法隐藏真实MAC地址,以此规避对真实MAC地址的非法采集。但该相关技术的问题在于,仅在扫描无线访问热点(Wireless Access Point,简称AP)发送的无线信号时采用随机MAC地址,而实际进行通信的过程中,终端还需使用真实的MAC地址避免随机MAC地址重复带来的冲突,才能不影响正常通信。
发明内容
根据本发明实施例的一个方面,提供了一种MAC地址的分配方法,包括:依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。
根据本发明实施例的另一方面,还提供了一种MAC地址的分配装置,包括:获取模块,用于依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;检索模块,用于在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;第一分配模块,用于在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;第二分配模块,用于在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。
根据本发明实施例的又一方面,还提供了一种MAC地址的分配系统,包括:接入点AP和终端,AP与终端通信连接,其中,AP为上述MAC地址的分配装置。
在本发明实施例中,通过依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址,达到了在通信过程中仍旧隐藏终端的真实MAC地址的目的,从而实现了在通信过程中隐藏终端真实MAC地址的技术效果,进而解决了由于相关技术中缺少将终端的真实MAC地址进行隐藏技术,导致终端的真实MAC地址仍然存在通信过程中被非法获取的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是本申请实施例的一种MAC地址的分配方法的AP的硬件结构框图;
图2是根据本申请实施例一的MAC地址的分配方法的流程图;
图3是本申请实施例提供的预设的MAC地址池中各MAC地址池间关系的示意图;
图4是本申请实施例提供的MAC地址的分配方法中MAC地址分配流程的流程示意图;
图5是根据本申请实施例一的一种MAC地址的分配方法的流程图;
图6是根据本申请实施例一的MAC地址的分配方法中特定元素的结构示意图;
图7是根据本申请实施例一的另一种MAC地址的分配方法的流程图;
图8是根据本申请实施例一的另一种MAC地址的分配方法中验证认证报文的流程 图;
图9是根据本申请实施例的MAC地址的分配装置的结构示意图;
图10是根据本申请实施例的一种MAC地址的分配装置的结构示意图;
图11是根据本申请实施例的一种MAC地址的分配装置的结构示意图;
图12是根据本申请实施例的MAC地址的分配系统的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
实施例1
根据本发明实施例,还提供了一种MAC地址的分配方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在无线访问热点(Wireless Access Point,简称AP)上为例,图1是本发明实施例的一种MAC地址的分配方法的AP的硬件结构框图。如图1所示,AP 10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。本领域普通技术人员可以理解,图1所示的结构仅为 示意,其并不对上述电子装置的结构造成限定。例如,AP 10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的MAC地址的分配方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的应用程序的漏洞检测方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至AP 10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括AP10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在上述运行环境下,本申请提供了如图2所示的MAC地址的分配方法。图2是根据本发明实施例一的MAC地址的分配方法的流程图。
步骤S202,依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址。
本申请实施例提供的MAC地址的分配方法可以适用于无线局域网(Wireless Local Area Network,简称WLAN)的环境下,特别是应用于无线访问热点(Wireless Access Point,简称AP)设备,以此在AP桥接终端与远端服务器进行通信时,隐藏终端真实介质访问控制(Media Access Control,简称MAC)地址,避免终端的真实MAC地址被恶意获取,进一步地在隐藏真实MAC地址的基础上不影响终端与服务器之间的通信。其中,在本申请实施例提供的终端中,该终端可以包括:智能手机、笔记本电脑、平板电脑、穿戴设备、掌上商务等能够接入AP设备的移动终端。在本申请实施例中终端以智能手机为例进行说明,具体如下:
本申请上述步骤S202中,在AP侧,通过接收到智能手机的扫描请求,获取该智能手机的随机MAC地址,这里以无线保真(WIreless FIdelity,简称WIFI)信号为例,当存在智能手机扫描当前WLAN区域内搜索WIFI时,AP通过接收智能手机的扫描请求,提取该扫描请求中该智能手机的MAC地址,其中,该MAC地址可以为随机MAC地址, 为方便阐述以下智能手机的随机MAC地址均以MAC-C地址表示。
步骤S204,在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址。
基于步骤S202,仍以终端为智能手机为例,本申请上述步骤S204中,AP的预设的MAC地址池分为:未分配MAC地址池、预分配MAC地址池和已分配MAC地址池,AP通过在上述MAC地址池中遍历查询智能手机的MAC-C地址,以使得匹配得到对应MAC-C地址的待分配MAC地址。
其中,在本申请实施例中,AP的预设的MAC地址池中:未分配MAC地址池,用于将没有被分配出去的MAC地址或者回收之后的MAC地址放入该池中,AP初始化的时候预留的MAC地址都在这个池中,终端下线之后对应该终端的MAC也会回收到该池中;
预分配MAC地址池,用于AP在处理终端的扫描请求probe request报文会从未分配地址池中选一个MAC地址,这个地址就会从未分配池中转移至预分配地址池。在分配的时候会记录预分配的MAC地址和终端的probe request源MAC的对应关系。预分配地址池中的每个MAC地址在固定定时器超时后转移至未分配地址池;
已分配MAC地址池,用于AP收到终端使用预分配MAC地址发送认证802.11Authenticate报文并处理成功,会将MAC地址从预分配地址池中转移至已分配地址池。具体如图3所示,图3是本申请实施例提供的预设的MAC地址池中各MAC地址池间关系的示意图,需说明的是,图3中初始化时所有未分配MAC地址池中的MAC-S地址状态均为未分配NA状态。
这里AP在分配过的MAC地址中,会记录分配过的MAC地址与智能手机的MAC-C地址之间的对应关系,为区别AP与智能手机的MAC地址,假设AP的预设的MAC地址池中的MAC地址记为MAC-S地址,因此,在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址,即,在预设的MAC地址池中检索是否存在与智能手机的MAC-C地址对应的MAC-S地址。
步骤S206,在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址。
本申请上述步骤S206中,仍旧以终端为智能手机为例进行说明,当检索结果为是时,说明该智能手机曾接入过AP,即,AP侧曾对该智能手机分配过MAC-S地址,并存储过该智能手机的MAC-C地址与分配的MAC-S地址之间的对应关系,因此,依据该对应 关系,依据MAC-C地址查询得到对应的MAC-S地址。
具体的,基于步骤S204可知,当检索结果为是时,说明上述对应关系可以存储于预分配MAC地址池和已分配MAC地址池,AP通过在已分配MAC地址池检索该对应关系得到该MAC-C地址对应的MAC-S地址;若该对应关系没有记录在已分配MAC地址池,则可以在预分配MAC地址池中依据该对应关系进行检索,进而得到该MAC-C地址对应的MAC-S地址。
步骤S208,在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。
本申请上述步骤S208中,与步骤S206不同在于,当检索结果为否时,说明该智能手机从未接入过该AP,即,AP从未对该智能手机分配过MAC-S地址,因此,对于该智能手机的MAC-C地址不存在对应的MAC-S地址的对应关系,但为了实现智能手机与远端服务器之间的通信,AP将从未分配MAC地址池中为智能手机的MAC-C地址分配对应的MAC-S地址。
结合步骤S202至步骤S208,本申请实施例提供的MAC地址的分配方法,为了规避相关技术中随机MAC地址不能解决在与远端服务器通信时MAC地址冲突的问题,本申请实施例中终端的MAC地址将转由AP来分配,AP根据自身最大接入终端的数量,通过预留N个MAC地址供终端使用,使得终端在扫描的时候AP分配一个MAC给终端,终端之后的正常通信过程就使用AP分配的MAC地址,从而解决了相关技术中由于终端使用随机MAC地址与远端服务器通信MAC地址冲突,导致通信失败的问题。
由上可知,本申请上述实施例一所提供的方案,通过依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址,达到了在通信过程中仍旧隐藏终端的真实MAC地址的目的,从而实现了在通信过程中隐藏终端真实MAC地址的技术效果,进而解决了由于相关技术中缺少将终端的真实MAC地址进行隐藏技术,导致终端的真实MAC地址仍然存在通信过程中被非法获取的技术问题。
具体的,图4是本申请实施例提供的MAC地址的分配方法中MAC地址分配流程的流程示意图,如图4所示,MAC地址的分配方法具体如下:
可选地,在预设的MAC地址池包括未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,步骤S204中在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址的步骤包括:
Step1,在未分配MAC地址池、预分配MAC地址池和已分配MAC地址池中分别检索随机MAC地址是否存在对应的待分配MAC地址。
在本申请实施例提供的MAC地址的分配方法中,AP通过接收智能手机发送的扫描请求报文probe request,通过解析该扫描请求报文得到智能手机的MAC-C地址,进而通过在预设的MAC地址池中遍历查询该MAC-C地址是否在未分配MAC地址池、预分配MAC地址池和已分配MAC地址池中是否存在对应的MAC-S地址。
可选的,如图4所示,步骤S206中在检索结果为是的情况下,在预设的MAC地址池中提取随机MAC地址对应的待分配MAC地址的步骤包括:
步骤S401,检索随机MAC地址对应的待分配MAC地址是否记录在已分配MAC地址池。
本申请上述步骤S401中,如图4所示,AP依据智能手机的MAC-C地址在已分配MAC地址池内检索是否存在对应的MAC-S地址,即,基于步骤S206,判定预设的MAC地址池中存在MAC-C地址对应的MAC-S地址,换言之,该智能手机曾扫描到AP发送的无线信号,且AP也为该智能手机依据该智能手机的MAC-C地址分配过对应的MAC-S地址。
由上可知,若该智能手机曾扫描到AP发送的无线信号,且AP也为该智能手机依据该智能手机的MAC-C地址分配过对应的MAC-S地址,则在预设的MAC地址池中的已分配MAC地址池中进行检索,可以快速的得到该MAC-C地址是否存在对应的MAC-S地址。
步骤S402,在检索结果为是的情况下,在已分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址。
本申请上述步骤S402中,基于步骤S401,若AP在已分配MAC地址池中检索到该MAC-C地址存在对应的MAC-S地址,则直接提取该MAC-S地址。
这里若智能手机曾扫描到AP发送的无线信号,且AP也为该智能手机依据该智能手机的MAC-C地址分配过对应的MAC-S地址,最理想的状态就是在已分配MAC地址池中该MAC-C地址对应的MAC-S地址还未被回收到未分配MAC地址池,因此,在智能手机向AP发送扫描请求报文后,AP能够在已分配MAC地址池中检索到该智能手机的 MAC-C地址对应的MAC-S地址,即,AP与智能手机之间一直保持通信连接,所以已分配MAC地址池中该MAC-C地址对应的MAC-S地址还未被回收到未分配MAC地址池,当智能手机向AP发送扫描请求probe request报文时,AP通过提取该probe request中的MAC-C地址,在已分配MAC地址池中检索到该MAC-C地址对应的MAC-S地址。
步骤S403,在检索结果为否的情况下,检索随机MAC地址对应的待分配MAC地址是否记录在预分配MAC地址池。
本申请上述步骤S403中,基于步骤S401,当AP在已分配MAC地址池中没有检索到该MAC-C地址存在对应的MAC-S地址,则需要考虑该MAC-C地址是否存在如下情况:
情况一,由于确定该MAC-C地址存在于预设的MAC地址池,若已分配MAC地址池中没有该MAC-C的地址,则有可能该MAC-C地址对应的MAC-S地址还在预分配MAC地址池中,这种可能的原因在于,由于本申请实施例提供的MAC地址的分配方法中存在定时机制,若智能手机的MAC-C地址在预分配MAC地址池中对应的MAC-S地址的定时器还未计时完毕,则预分配MAC地址池将保留该MAC-C地址对应的MAC-S地址,所以当AP接收到智能手机发送的扫描请求报文时,将存在可能在预分配MAC地址池中检索到该MAC-C地址对应的MAC-S地址。
情况二,区别于情况一,同样基于定时机制,假设智能手机的MAC-C地址在预分配MAC地址池中对应的MAC-S地址的定时器计时完毕,但AP在分配MAC-S之后从未接收到智能手机返回的认证报文,因此在定时器计时完毕后,AP认为该智能手机仅是执行扫描功能,并不打算接入AP,故将该智能手机MAC-C地址对应的MAC-S地址分配给了其他终端或将该MAC-S地址返回未分配MAC地址池,但是该MAC-C地址的记录却存储于预分配MAC地址池中,所以AP能够检索到MAC-C地址的记录。
可选的,如图4所示,步骤S403中检索随机MAC地址对应的待分配MAC地址是否记录在预分配MAC地址池的步骤包括:
步骤S404,在检索结果为是的情况下,在预分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址,并刷新预分配MAC地址池定时器。
本申请上述步骤S404中,如上述步骤S403中的情景一,当AP检索到该MAC-C地址对应的MAC-S地址存在于预分配MAC地址池时,说明该智能手机在之前收到AP分配的MAC-S地址后未反馈认证报文,且,该MAC-S地址在预分配MAC地址池中对应的定时器计时还未结束,所以当AP检测到智能手机再次发送的扫描请求报文后,提 取MAC-C地址,但是由于在已分配MAC地址池中未检索到该MAC-C地址对应的MAC-S地址,则在预分配MAC地址池检索该MAC-C地址对应的MAC-S地址,从而提取该MAC-C地址对应的MAC-S地址,并重新刷新定时器,以使得遵循定时机制,即,对智能手机是否确认接入当前AP执行定时机制。
步骤S405,在检索结果为否的情况下,从未分配MAC地址池提取空闲的待分配MAC地址,将空闲的待分配MAC地址分配给随机MAC地址,并存储空闲的待分配MAC地址与随机MAC地址的对应关系,生成预分配MAC地址池定时器。
本申请上述步骤S405中,如上述步骤S403中的情景二,当AP检索到该MAC-C地址对应的MAC-S地址存在于预分配MAC地址池时,说明该智能手机在之前收到AP分配的MAC-S地址后未反馈认证报文,且,该MAC-S地址在预分配MAC地址池中对应的定时器计时已经结束,所以,当AP检测到智能手机再次发送的扫描请求报文后,提取MAC-C地址,但是由于在已分配MAC地址池中未检索到该MAC-C地址对应的MAC-S地址,则在预分配MAC地址池检索该MAC-C地址对应的MAC-S地址,但在预分配MAC地址池中也没有找到该MAC-C地址对应的MAC-S地址,因此AP将提取未分配MAC地址池中空闲的MAC-S地址,并存储该MAC-C地址与MAC-S地址之间的对应关系,同时,生成该MAC-S地址对应的定时器。
这里在预分配MAC地址池中的定时器均可以设置成4s的定时,当同一MAC-S在预分配MAC地址池中被分配时,该MAC-S地址对应的定时器将重进进行4s计时,本申请实施例中定时器设定的计时仅以4s为例进行说明,以实现本申请实施例提供的MAC地址的分配方法为准,具体不做限定。
可选的,如图4所示,步骤S208中在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址的步骤包括:
步骤S406,判断未分配MAC地址池中是否存在剩余的待分配MAC地址。
本申请上述步骤S406中,区别于步骤S401至步骤S405,当AP在预设的MAC地址池中未检索到存在与该MAC-C地址对应的MAC-S地址时,AP将在预设的MAC地址池中的未分配MAC地址池查询是否存在剩余的待分配的MAC-S地址。
这里由于AP存储的MAC-S地址数量有限,因此在AP接收到智能手机发送的的扫描请求后,当AP在预设的MAC地址池中未检索到存在与该MAC-C地址对应的MAC-S地址时,需要对未分配MAC地址池中剩余的MAC-S地址数量进行查询。
步骤S407,在判断结果为是的情况下,为随机MAC地址分配对应的待分配MAC 地址,存储随机MAC地址与待分配MAC地址的对应关系。
本申请上述步骤S407中,基于步骤S406,若AP在未分配MAC地址池中查询发现还有剩余的待分配MAC-S地址,则将该MAC-S地址分配给智能手机的MAC-C地址,并生成该MAC-C地址与该MAC-S地址的对应关系。
步骤S408,将对应关系转移至预分配MAC地址池,生成预分配MAC地址池定时器。
本申请上述步骤S408中,基于步骤S407,在生成该MAC-C地址与该MAC-S地址的对应关系后,将该对应关系转移至预分配MAC地址池,并生成该MAC-S地址对应的定时器,这里该MAC-S地址对应的定时器的计时仍可以设置为4s计时。
步骤S409,在判断结果为否的情况下,在预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址。
本申请上述步骤S409中,区别于步骤S407,当AP发现在未分配MAC地址池中没有剩余的MAC-S地址时,但是为了给智能手机的MAC-C地址分配对应的MAC-S地址,则从预分配MAC地址池中检索是否存在定时器的定时小于预设阈值的MAC-S地址,依据定时机制,当MAC-S地址对应的定时器计时即将结束或已结束时,预分配MAC地址池中的MAC-S地址将分配给其他终端。
这里假设预设阈值为2s,当AP发现在未分配MAC地址池中没有剩余的MAC-S地址时,检索预分配MAC地址池中是否有MAC-S地址的计时小于或等于2s的MAC-S地址。本申请实施例提供的定时器的预设阈值仅以2s为例,以实现本申请实施例提供的MAC地址的分配方法为准,具体不做限定。即,原则是选预分配MAC地址池中定时器剩余时间最短的,并且要小于2s,这样做的原因是预分配MAC地址池中的MAC-S实际上是已经通过扫描响应Probe Response报文通知该MAC-S地址对应终端了,只是该终端还没有使用该MAC-S地址发送认证Authenticate报文,如果定时器剩余时间很长很有可能是终端还没有来得及发送Authenticate,如果大于2s还没有发送Authenticate报文,说明该终端只是扫描,并不想关联AP,这个时候AP可以把该MAC-S地址分配给智能手机。
可选的,如图4所示,步骤S409中在预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址的步骤包括:
步骤S410,在检索结果为是的情况下,将待分配MAC地址分配给随机MAC地址,更新预分配MAC地址池中待分配MAC地址与随机MAC地址的对应关系,刷新预分配 MAC地址池定时器。
本申请上述步骤S410中,基于步骤S409,当AP检索到预分配MAC地址池中存在定时小于预设阈值的MAC-S地址时,AP将从预分配MAC地址池中将该定时小于预设阈值的MAC-S地址分配给智能手机的MAC-C地址,同时更新MAC-S地址与MAC-C地址的对应关系,并刷新该MAC-S地址对应的定时器,即,重新从4s计时。
步骤S411,在检索结果为否的情况下,指示终端使用真实的MAC地址。
本申请上述步骤S411中,区别于步骤S410,当未分配MAC地址池中没有剩余的待分配的MAC-S地址,预分配MAC地址池中也没有定时小于预设阈值的MAC-S地址时,为保障智能手机能够正常与远端服务器正常通信,AP将指示智能手机使用真实的MAC地址进行通信。
可选的,图5是根据本发明实施例一的一种MAC地址的分配方法的流程图,如图5所示,本申请实施例提供的MAC地址的分配方法还包括:
步骤S209,将待分配MAC地址封装于扫描响应报文;
本申请上述步骤S209中,基于图4所示的MAC-S地址分配流程,当AP检索到MAC-C地址对应的MAC-S地址后,将对该MAC-S地址进行封装,即,将MAC-S地址封装于扫描响应报文,该扫描响应报文用于指示终端已针对该终端的MAC-C地址分配了对应的MAC-S地址。
具体的,AP将检索得到的MAC-S地址与智能手机的MAC-C地址一起打包封装,得到扫描响应报文。
步骤S210,将扫描响应报文返回终端。
本申请上述步骤S210中,基于步骤S209,AP在将MAC-S地址封装至扫描响应报文后,向终端发送该扫描响应报文。
具体的,对应智能手机的扫描请求Probe Request报文,若AP检索得到智能手机的MAC-C地址对应的MAC-S地址,则依据该MAC-S地址生成扫描响应Probe Response报文,并向智能手机发送该Probe Response报文,以使得智能手机使用该MAC-S地址。
进一步地,步骤S209将待分配MAC地址封装于扫描响应报文的步骤包括:
步骤S501,将待分配MAC地址与随机MAC地址封装于特定元素;
本申请上述步骤S501中,基于步骤S209,图6是根据本发明实施例一的MAC地址的分配方法中特定元素的结构示意图,如图6所示,在本申请实施例中,AP发送至智能手机的扫描响应报文中特定元素Vendor Specific element包括:元素ID(element ID)、 元素长度(Length)、组织唯一标示符(Organizationally Unique Identifier,简称OUI)、Sub ID、MAC-C地址和MAC-S地址,其中,SUB ID为1,表示分配MAC地址子类型。
具体地,AP将检索到的MAC-S地址和智能手机的MAC-C地址封装至特定元素Vendor Specific element,这里Vendor Specific element的作用在于,终端收到Probe Response之后,将查看是否有Vendor Specific element,如果有则后续关联过程使用该MAC-S地址作为自己用于通信的MAC地址,并在后续发送认证Authenticate报文时也需要携带Vendor Specific element,其内容就是Probe Response中Vendor Specific element的拷贝。如果Probe Response中没有Vendor Specific element,终端则按正常处理使用真实MAC地址进行返回认证报文。
这里若仍以智能手机为例,AP若检索到智能手机MAC-C地址对应的MAC-S地址,则将依据Vendor Specific element的结构类型封装该MAC-C地址和MAC-S地址,以使得后续智能手机返回认证Authenticate报文时,仍依据该特定元素返回认证。
步骤S502,依据特定元素生成扫描响应报文。
本申请上述步骤S502中,基于步骤S501,当依据特定元素封装AP检索到的MAC-S地址和智能手机的MAC-C地址后,得到扫描响应报文。
可选的,图7是根据本发明实施例一的另一种MAC地址的分配方法的流程图,如图7所示,在步骤S210将扫描响应报文返回终端之后,本申请实施例提供的MAC地址的分配方法还包括:
步骤S211,接收终端依据扫描响应报文返回的认证报文;
本申请上述步骤S211中,基于图5所示的扫描响应报文的生成和发送过程,AP接收智能手机依据扫描响应Probe Response报文返回的认证Authenticate报文。
步骤S212,验证认证报文。
本申请上述步骤S212中,基于步骤S211,在AP接收到智能手机返回的Authenticate后,将对该Authenticate进行验证,以使得确认后续桥接智能手机与远端服务器进行通信的过程中,智能手机将依据Probe Response中Vendor Specific element内的MAC-S进行通信。
步骤S213,当验证成功时,依据认证报文返回认证响应报文。
本申请上述步骤S213中,基于步骤S212,AP验证智能手机发送的认证报文成功后,将生成验证成功或失败的验证结果,并将该验证结果以认证响应报文的形式返回智能手机,以使得后续AP桥接智能手机与远端服务器,进而使得智能手机通过使用MAC-S地 址经由AP与远端服务器进行通信。
可选的,图8是根据本发明实施例一的另一种MAC地址的分配方法中验证认证报文的流程图,如图8所示,步骤S212中验证认证报文的步骤包括:
步骤S801,判断认证报文中是否携带有特定元素。
本申请上述步骤S801中,基于步骤S212,如图8所示,AP在接收到智能手机发送的Authenticate报文后,将判断该Authenticate报文中是否包含Vendor Specific element,若该Authenticate携带有Vendor Specific element则执行步骤S802;若否,则反馈认证成功,其中,若Authenticate没有携带有Vendor Specific element,说明AP的预定的MAC地址池中没有对智能手机的MAC-C地址分配对应的MAC-S地址,智能手机使用的是真实的MAC-C地址,因此验证成功,即,本申请实施例提供的MAC地址的分配方法中,如果终端没有携带Vendor Specific element,则按原有802.11携带规定的流程,因此该处理对不支持Vendor Specific element的终端不会有副作用。
步骤S802,当判断结果为是时,判断认证报文中的待分配MAC地址是否为预分配MAC地址池中记录的MAC地址。
本申请上述步骤S802中,如图8所示,基于定时器机制,当AP接收到智能手机在MAC-S地址对应的定时器计时周期内发送的认证报文,将在预分配MAC地址池中判断该智能手机发送的认证报文中的MAC-C地址对应的MAC-S地址是否为预分配MAC地址池中记录的MAC-C地址与该MAC-S地址的对应关系。
可选的,如图8所示,步骤S802中判断认证报文中的待分配MAC地址是否为预分配MAC地址池中记录的MAC地址的步骤包括:
步骤S803,在判断结果为是的情况下,判断预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址是否与认证报文中的随机MAC地址相同。
本申请上述步骤S803中,基于步骤S802中的判断,若AP判断认证报文中的MAC-S地址为预分配MAC地址池中记录的MAC-S地址,则AP需要判断在预分配MAC地址池中记录的MAC-S地址对应的MAC-C地址是否与认证报文中的MAC-C地址相同。
具体地,如果终端返回的认证Authenticate报文携带Vendor Specific element,AP则查找预分配MAC地址池中是否有该MAC-S并检查Authenticate报文中的MAC-C是否,和预分配地址池保存的MAC-C地址与MAC-S地址对应关系中的MAC-C地址是否一致。
步骤S804,在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,将待分配MAC地址转移至已分配MAC 地址池,并反馈认证成功。
本申请上述步骤S804中,当AP判断在预分配MAC地址池中记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址相同的情况下,AP将转移该MAC-S地址与该MAC-C地址的对应关系至已分配MAC地址池,同时反馈认证成功,即,反馈Status Code为success。
步骤S805,在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
本申请上述步骤S805中,当AP判断在预分配MAC地址池中记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址不同的情况下,AP将反馈认证失败,其中,如果不一致,说明该MAC-S地址已经在预分配MAC地址池分配给另一个终端了,因此回应Status code为REFUSED的Authenticate报文以拒绝终端连接。
具体的,基于定时机制,虽然认证报文中携带有特定元素,且该特定元素也携带有MAC-S地址,同样预分配MAC地址池中也记录有MAC-S地址,但是若终端在该MAC-S地址对应的定时器计时结束才反馈认证报文,则在预分配MAC地址池中该MAC-S地址很大概率上将已经分配给其他扫描AP的终端,并刷新了MAC-S地址与MAC-C地址之间的对应关系,所以AP侧才会反馈认证失败,即,Status code为REFUSED。
可选的,如图8所示,步骤S802,判断认证报文中的待分配MAC地址是否为预分配MAC地址池中记录的MAC地址的步骤还包括:
步骤S806,在判断结果为否的情况下,判断认证报文中的待分配MAC地址是否为已分配MAC地址池中记录的MAC地址。
本申请上述步骤S806中,区别于步骤S803,在AP判断认证报文中的MAC-S地址不是预分配MAC地址池中记录的MAC-S地址的情况下,AP将判断认证报文中的MAC-S地址是否为已分配MAC地址池中记录的MAC-S地址。
具体地,当AP在预分配MAC地址池中检索不到认证报文中的MAC-S地址时,说明该MAC-S地址有可能已经转移至已分配MAC地址池,即,出现了终端重认证的的情况,因此在已分配MAC地址池中将存在该MAC-S地址。若该MAC-S地址是已分配MAC地址池中记录的MAC地址,则执行步骤S807;若否,则执行步骤S810,具体如下。
步骤S807,在认证报文中的待分配MAC地址是已分配MAC地址池中记录的MAC地址的情况下,判断已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地 址是否与认证报文中的随机MAC地址相同。
本申请上述步骤S807中,基于步骤S806,当AP在认证报文中的MAC-S地址是已分配MAC地址池中记录的MAC-S地址的情况下,AP需要进一步的在已分配MAC地址池中进行判断该已分配MAC地址池中记录的MAC-S地址对应的MAC-C地址是否与认证报文中的MAC-C地址相同。
步骤S808,在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,反馈认证成功。
本申请上述步骤S808中,基于步骤S807,若AP判断在已分配MAC地址池中记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址相同,则反馈认证成功,即,若AP判断该记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址一致,则直接回应Status Code为SUCCESS的Authenticate报文。
步骤S809,在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
本申请上述步骤S809中,区别于步骤S808,若AP判断在已分配MAC地址池中记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址不同,则反馈认证失败,即,若AP判断该记录的MAC-S地址对应的MAC-C地址与认证报文中的MAC-C地址不一致,则直接回应Status Code为REFUSED的Authenticate报文。
可选的,如图8所示,步骤S806中判断认证报文中的待分配MAC地址是否为已分配MAC地址池中记录的MAC地址的步骤还包括:
步骤S810,在认证报文中的待分配MAC地址不是已分配MAC地址池中记录的MAC地址的情况下,反馈认证失败。
本申请上述步骤S810中,区别于步骤S807,当AP在认证报文中的MAC-S地址不是已分配MAC地址池中记录的MAC-S地址的情况下,反馈认证失败,即,若AP判断在认证报文中的MAC-S地址不是已分配MAC地址池中记录的MAC-S地址,则直接回应Status Code为REFUSED的Authenticate报文。
本申请实施例提供的MAC地址的分配方法中,提供了如下机制:机制一,AP在分出地址后,会启动一个4s定时器,在定时器超时之后如果仍然没有收到终端的Authenticate报文,则认为终端不会连接AP了,会把该MAC地址转移至未分配地址池。机制二,由于定时器老化的机制,AP可能会在不同时间点为不同的终端分配相同的MAC-S地址,记录MAC-C的作用是在于防止不同终端使用相同的MAC地址连接AP, 只有最近一次分配的终端才能连上,其他的会被拒接。机制三,当终端下线时,查找已分配地址池中是否有该MAC-S地址,如果有则转移至未分配地址池中。
由此可知,现有技术存在虽然终端侧在扫描AP发送的无线信号过程中,通过使用随机MAC地址隐藏真实的MAC地址,避免了非法获取MAC地址的可能,但是终端在与远端服务器如果还使用随机MAC地址,则有很大的可能发生MAC地址冲突,导致终端与远端服务器无法进行通信的问题发生,本申请实施例提供的MAC地址的分配方法中,通过在AP中预设对应最大上限接入用户数量的MAC地址,以使得接入AP的终端通过使用AP分配的MAC地址与远端服务器建立通信连接,以达到在规避非法获取终端真实MAC地址的情况发生的同时,保障终端与远端服务器的通信质量。达到了在通信过程中仍旧隐藏终端的真实MAC地址的目的,从而实现了在通信过程中隐藏终端真实MAC地址的技术效果,进而解决了由于相关技术中缺少将终端的真实MAC地址进行隐藏技术,导致终端的真实MAC地址仍然存在通信过程中被非法获取的技术问题。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的MAC地址的分配方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例2
根据本发明实施例,还提供了一种用于实施上述方法实施例的装置实施例,本申请上述实施例所提供的装置可以在无线访问热点AP上运行。
图9是根据本申请实施例的MAC地址的分配装置的结构示意图。
如图9所示,该MAC地址的分配装置包括:获取模块92、检索模块94、第一分配模块96以及第二分配模块98。
其中,获取模块92,用于依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;检索模块94,用于在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;第一分配模块96,用于在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;第二分配模块98,用于在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。
由上可知,本申请上述实施例二所提供的方案,通过依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址,达到了在通信过程中仍旧隐藏终端的真实MAC地址的目的,从而实现了在通信过程中隐藏终端真实MAC地址的技术效果,进而解决了由于相关技术中缺少将终端的真实MAC地址进行隐藏技术,导致终端的真实MAC地址仍然存在通信过程中被非法获取的技术问题。
此处需要说明的是,上述获取模块92、检索模块94、第一分配模块96以及第二分配模块98对应于实施例一中的步骤S202至步骤S208,四个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,在预设的MAC地址池包括未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,检索模块94包括:第一检索单元,
其中,第一检索单元,用于在预设的MAC地址池包括未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,在未分配MAC地址池、预分配MAC地址池和已分配MAC地址池中分别检索随机MAC地址是否存在对应的待分配MAC地址。
此处需要说明的是,上述第一检索单元对应于实施例一中的步骤S204的Step1,该模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第一分配模块96包括:第二检索单元、第一分配单元和第二分配单元。
其中,第二检索单元,用于检索随机MAC地址对应的待分配MAC地址是否记录在已分配MAC地址池;第一分配单元,用于在检索结果为是的情况下,在已分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址;第二分配单元,用于在检索结果为否的情况下,检索随机MAC地址对应的待分配MAC地址是否记录在预分配MAC地址池。
此处需要说明的是,上述第二检索单元、第一分配单元和第二分配单元对应于实施例一中的步骤S401至步骤S403,三个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第一分配单元包括:第一提取子单元和第二提取子单元。
其中,第一提取子单元,用于在检索结果为是的情况下,在预分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址,并刷新预分配MAC地址池定时器;第二提取子单元,用于在检索结果为否的情况下,从未分配MAC地址池提取空闲的待分配MAC地址,将空闲的待分配MAC地址分配给随机MAC地址,并存储空闲的待分配MAC地址与随机MAC地址的对应关系,生成预分配MAC地址池定时器。
此处需要说明的是,上述第一提取子单元和第二提取子单元对应于实施例一中的步骤S404和步骤S405,两个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第二分配模块98包括:判断单元、第三分配单元、配置单元和第三检索单元。
其中,判断单元,用于判断未分配MAC地址池中是否存在剩余的待分配MAC地址;第三分配单元,用于在判断结果为是的情况下,为随机MAC地址分配对应的待分配MAC地址,存储随机MAC地址与待分配MAC地址的对应关系;配置单元,用于将对应关系转移至预分配MAC地址池,生成预分配MAC地址池定时器;第三检索单元,用于在判断结果为否的情况下,在预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址。
此处需要说明的是,上述判断单元、第三分配单元、配置单元和第三检索单元对应于实施例一中的步骤S406至步骤S409,四个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一 部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第三检索单元包括:第一分配子单元和配置子单元。
其中,第一分配子单元,用于在检索结果为是的情况下,将待分配MAC地址分配给随机MAC地址,更新预分配MAC地址池中待分配MAC地址与随机MAC地址的对应关系,刷新预分配MAC地址池定时器;配置子单元,用于在检索结果为否的情况下,指示终端使用真实的MAC地址。
此处需要说明的是,上述第一分配子单元和配置子单元对应于实施例一中的步骤S410和步骤S411,两个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,图10是根据本申请实施例的一种MAC地址的分配装置的结构示意图。如图10所示,本申请实施例提供的MAC地址的分配装置还包括:封装模块1002和发送模块1004。
其中,封装模块1002,将待分配MAC地址封装于扫描响应报文;发送模块1004,用于将扫描响应报文返回终端。
此处需要说明的是,上述封装模块1002和发送模块1004对应于实施例一中的步骤S209和步骤S210,两个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,封装模块1002包括:封装单元和报文生成单元。
其中,封装单元,用于将待分配MAC地址与随机MAC地址封装于特定元素;报文生成单元,用于依据特定元素生成扫描响应报文。
此处需要说明的是,上述封装单元和报文生成单元对应于实施例一中的步骤S501和步骤S502,两个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,图11是根据本申请实施例的一种MAC地址的分配装置的结构示意图。如图11所示,本申请实施例提供的MAC地址的分配装置还包括:接收模块1102、验证模块1104和反馈模块1106。
其中,接收模块1102,用于在将扫描响应报文返回终端之后,接收终端依据扫描响 应报文返回的认证报文;验证模块1104,用于验证认证报文;反馈模块1106,用于当验证成功时,依据认证报文返回认证响应报文。
此处需要说明的是,上述接收模块1102、验证模块1104和反馈模块1106对应于实施例一中的步骤S211至步骤S213,三个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,验证模块1104包括:第一判定单元和第二判定单元。
其中,第一判定单元,用于判断认证报文中是否携带有特定元素;第二判定单元,用于在第一判定单元的判断结果为是时,判断认证报文中的待分配MAC地址是否为预分配MAC地址池中记录的MAC地址。
此处需要说明的是,上述第一判定单元和第二判定单元对应于实施例一中的步骤S801和步骤S802,两个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第二判定单元包括:第一判定子单元、第一认证子单元和第二认证子单元。
其中,第一判定子单元,用于在第二判定单元的判断结果为是的情况下,判断预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址是否与认证报文中的随机MAC地址相同;第一认证子单元,用于在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,将待分配MAC地址转移至已分配MAC地址池,并反馈认证成功;第二认证子单元,用于在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
此处需要说明的是,上述第一判定子单元、第一认证子单元和第二认证子单元对应于实施例一中的步骤S803至步骤S805,三个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,第二判定单元还包括:第二判定子单元、第三判定单元、第三认证子单元和第四认证子单元。
其中,第二判定子单元,用于在第二判定单元的判断结果为否的情况下,判断认证报文中的待分配MAC地址是否为已分配MAC地址池中记录的MAC地址;第三判定单 元,用于在认证报文中的待分配MAC地址是已分配MAC地址池中记录的MAC地址的情况下,判断已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址是否与认证报文中的随机MAC地址相同;第三认证子单元,用于在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,反馈认证成功;第四认证子单元,用于在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
此处需要说明的是,上述第二判定子单元、第三判定单元、第三认证子单元和第四认证子单元对应于实施例一中的步骤S806至步骤S809,四个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
可选的,本申请实施例提供的MAC地址的分配装置还包括:第五认证子单元。
其中,第五认证子单元,用于在认证报文中的待分配MAC地址不是已分配MAC地址池中记录的MAC地址的情况下,反馈认证失败。
此处需要说明的是,上述第五认证子单元对应于实施例一中的步骤S810,该模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的AP 10中,可以通过软件实现,也可以通过硬件实现。
由此可知,现有技术存在虽然终端侧在扫描AP发送的无线信号过程中,通过使用随机MAC地址隐藏真实的MAC地址,避免了非法获取MAC地址的可能,但是终端在与远端服务器如果还使用随机MAC地址,则有很大的可能发生MAC地址冲突,导致终端与远端服务器无法进行通信的问题发生,本申请实施例提供的MAC地址的分配方法中,通过在AP中预设对应最大上限接入用户数量的MAC地址,以使得接入AP的终端通过使用AP分配的MAC地址与远端服务器建立通信连接,以达到在规避非法获取终端真实MAC地址的情况发生的同时,保障终端与远端服务器的通信质量。达到了在通信过程中仍旧隐藏终端的真实MAC地址的目的,从而实现了在通信过程中隐藏终端真实MAC地址的技术效果,进而解决了由于相关技术中缺少将终端的真实MAC地址进行隐藏技术,导致终端的真实MAC地址仍然存在通信过程中被非法获取的技术问题。
实施例3
根据本发明实施例,还提供了一种用于实施上述MAC地址的分配方法实施例的系 统实施例,本申请上述实施例所提供的MAC地址的分配系统中的AP可以为无线访问热点AP。
图12是根据本申请实施例的MAC地址的分配系统的结构示意图。
如图12所示,该MAC地址的分配系统包括:接入点AP 1202和终端1204,AP1202与终端1204通信连接,其中,AP1202为图9至图11中任一所示的MAC地址的分配装置。
实施例4
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的MAC地址的分配方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:依据预先接收到的终端发送的扫描请求,获取终端的随机MAC地址;在预设的MAC地址池中检索是否存在与随机MAC地址对应的待分配MAC地址;在检索结果为是的情况下,在预设的MAC地址池中提取与随机MAC地址对应的待分配MAC地址;在检索结果为否的情况下,在预设的MAC地址池的未分配MAC地址池中为随机MAC地址分配对应的待分配MAC地址。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在预设的MAC地址池包括未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,在未分配MAC地址池、预分配MAC地址池和已分配MAC地址池中分别检索随机MAC地址是否存在对应的待分配MAC地址。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在检索结果为是的情况下,检索随机MAC地址对应的待分配MAC地址是否记录在已分配MAC地址池;在检索结果为是的情况下,在已分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址;在检索结果为否的情况下,检索随机MAC地址对应的待分配MAC地址是否记录在预分配MAC地址池。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在检索结果为是的情况下,在预分配MAC地址池中根据随机MAC地址提取对应的待分配MAC地址,并刷新预分配MAC地址池定时器;在检索结果为否的情况下,从未分配MAC地址池提取空闲的待分配MAC地址,将空闲的待分配MAC地址分配给随机MAC地址,并存储 空闲的待分配MAC地址与随机MAC地址的对应关系,生成预分配MAC地址池定时器。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:判断未分配MAC地址池中是否存在剩余的待分配MAC地址;在判断结果为是的情况下,为随机MAC地址分配对应的待分配MAC地址,存储随机MAC地址与待分配MAC地址的对应关系;将对应关系转移至预分配MAC地址池,生成预分配MAC地址池定时器;在判断结果为否的情况下,在预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在检索结果为是的情况下,将待分配MAC地址分配给随机MAC地址,更新预分配MAC地址池中待分配MAC地址与随机MAC地址的对应关系,刷新预分配MAC地址池定时器;在检索结果为否的情况下,指示终端使用真实的MAC地址。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:将待分配MAC地址封装于扫描响应报文;将扫描响应报文返回终端。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:将待分配MAC地址与随机MAC地址封装于特定元素;依据特定元素生成扫描响应报文。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:接收终端依据扫描响应报文返回的认证报文;验证认证报文;当验证成功时,依据认证报文返回认证响应报文。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:判断是否携带特定元素;当判断结果为是时,判断认证报文中的待分配MAC地址是否为预分配MAC地址池中记录的MAC地址。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在判断结果为是的情况下,判断预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址是否与认证报文中的随机MAC地址相同;在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,将待分配MAC地址转移至已分配MAC地址池,并反馈认证成功;在预分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在判断结果为否的情况下,判断认证报文中的待分配MAC地址是否为已分配MAC地址池中记录的MAC 地址;在认证报文中的待分配MAC地址是已分配MAC地址池中记录的MAC地址的情况下,判断已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址是否与认证报文中的随机MAC地址相同;在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址相同的情况下,反馈认证成功;在已分配MAC地址池中记录的待分配MAC地址对应的随机MAC地址与认证报文中的随机MAC地址不同的情况下,反馈认证失败。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:在认证报文中的待分配MAC地址不是已分配MAC地址池中记录的MAC地址的情况下,反馈认证失败。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,本实施例中的具体示例可以参考上述实施例1中所描述的示例,本实施例在此不再赘述。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时, 可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (27)

  1. 一种MAC地址的分配方法,其特征在于,包括:
    依据预先接收到的终端发送的扫描请求,获取所述终端的随机MAC地址;
    在预设的MAC地址池中检索是否存在与所述随机MAC地址对应的待分配MAC地址;
    在检索结果为是的情况下,在所述预设的MAC地址池中提取与所述随机MAC地址对应的待分配MAC地址;
    在检索结果为否的情况下,在所述预设的MAC地址池的未分配MAC地址池中为所述随机MAC地址分配对应的待分配MAC地址。
  2. 根据权利要求1所述的方法,其特征在于,在所述预设的MAC地址池包括所述未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,在预设的MAC地址池中检索是否存在与所述随机MAC地址对应的待分配MAC地址包括:
    在所述未分配MAC地址池、所述预分配MAC地址池和已分配MAC地址池中分别检索所述随机MAC地址是否存在对应的待分配MAC地址。
  3. 根据权利要求2所述的方法,其特征在于,在检索结果为是的情况下,在所述预设的MAC地址池中提取所述随机MAC地址对应的待分配MAC地址包括:
    检索所述随机MAC地址对应的待分配MAC地址是否记录在所述已分配MAC地址池;
    在检索结果为是的情况下,在所述已分配MAC地址池中根据所述随机MAC地址提取对应的待分配MAC地址;
    在检索结果为否的情况下,检索所述随机MAC地址对应的待分配MAC地址是否记录在所述预分配MAC地址池。
  4. 根据权利要求3所述的方法,其特征在于,检索所述随机MAC地址对应的待分配MAC地址是否记录在所述预分配MAC地址池包括:
    在检索结果为是的情况下,在所述预分配MAC地址池中根据所述随机MAC地址提取对应的待分配MAC地址,并刷新预分配MAC地址池定时器;
    在检索结果为否的情况下,从所述未分配MAC地址池提取空闲的待分配MAC地址,将所述空闲的待分配MAC地址分配给所述随机MAC地址,并存储所述空闲的待分配MAC地址与所述随机MAC地址的对应关系,生成预分配MAC地址池定时器。
  5. 根据权利要求2所述的方法,其特征在于,在检索结果为否的情况下,在所述 预设的MAC地址池的未分配MAC地址池中为所述随机MAC地址分配对应的待分配MAC地址包括:
    判断所述未分配MAC地址池中是否存在剩余的待分配MAC地址;
    在判断结果为是的情况下,为所述随机MAC地址分配对应的待分配MAC地址,存储所述随机MAC地址与所述待分配MAC地址的对应关系;
    将所述对应关系转移至所述预分配MAC地址池,生成预分配MAC地址池定时器;
    在判断结果为否的情况下,在所述预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址。
  6. 根据权利要求5所述的方法,其特征在于,在所述预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址包括:
    在检索结果为是的情况下,将所述待分配MAC地址分配给所述随机MAC地址,更新所述预分配MAC地址池中所述待分配MAC地址与随机MAC地址的对应关系,刷新预分配MAC地址池定时器;
    在检索结果为否的情况下,指示所述终端使用真实的MAC地址。
  7. 根据权利要求3或5所述的方法,其特征在于,所述方法还包括:
    将所述待分配MAC地址封装于扫描响应报文;
    将所述扫描响应报文返回所述终端。
  8. 根据权利要求7所述的方法,其特征在于,所述将所述待分配MAC地址封装于扫描响应报文包括:
    将所述待分配MAC地址与所述随机MAC地址封装于特定元素;
    依据所述特定元素生成所述扫描响应报文。
  9. 根据权利要求8所述的方法,其特征在于,在所述将所述扫描响应报文返回所述终端之后,所述方法还包括:
    接收所述终端依据所述扫描响应报文返回的认证报文;
    验证所述认证报文;
    当验证成功时,依据所述认证报文返回认证响应报文。
  10. 根据权利要求9所述的方法,其特征在于,验证所述认证报文包括:
    判断所述认证报文中是否携带有所述特定元素;
    当判断结果为是时,判断所述认证报文中的待分配MAC地址是否为所述预分配MAC地址池中记录的MAC地址。
  11. 根据权利要求10所述的方法,其特征在于,判断所述认证报文中的待分配MAC地址是否为所述预分配MAC地址池中记录的MAC地址包括:
    在判断结果为是的情况下,判断所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址是否与所述认证报文中的随机MAC地址相同;
    在所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址相同的情况下,将所述待分配MAC地址转移至所述已分配MAC地址池,并反馈认证成功;
    在所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址不同的情况下,反馈认证失败。
  12. 根据权利要求10所述的方法,其特征在于,判断所述认证报文中的待分配MAC地址是否为所述预分配MAC地址池中记录的MAC地址还包括:
    在判断结果为否的情况下,判断所述认证报文中的待分配MAC地址是否为所述已分配MAC地址池中记录的MAC地址;
    在所述认证报文中的待分配MAC地址是所述已分配MAC地址池中记录的MAC地址的情况下,判断所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址是否与所述认证报文中的随机MAC地址相同;
    在所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址相同的情况下,反馈认证成功;
    在所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址不同的情况下,反馈认证失败。
  13. 根据权利要求12所述的方法,其特征在于,判断所述认证报文中的待分配MAC地址是否为所述已分配MAC地址池中记录的MAC地址还包括:
    在所述认证报文中的待分配MAC地址不是所述已分配MAC地址池中记录的MAC地址的情况下,反馈认证失败。
  14. 一种MAC地址的分配装置,其特征在于,包括:
    获取模块,用于依据预先接收到的终端发送的扫描请求,获取所述终端的随机MAC地址;
    检索模块,用于在预设的MAC地址池中检索是否存在与所述随机MAC地址对应的待分配MAC地址;
    第一分配模块,用于在检索结果为是的情况下,在所述预设的MAC地址池中提取 与所述随机MAC地址对应的待分配MAC地址;
    第二分配模块,用于在检索结果为否的情况下,在所述预设的MAC地址池的未分配MAC地址池中为所述随机MAC地址分配对应的待分配MAC地址。
  15. 根据权利要求14所述的装置,其特征在于,所述检索模块包括:
    第一检索单元,用于在所述预设的MAC地址池包括所述未分配MAC地址池、预分配MAC地址池和已分配MAC地址池的情况下,在所述未分配MAC地址池、所述预分配MAC地址池和已分配MAC地址池中分别检索所述随机MAC地址是否存在对应的待分配MAC地址。
  16. 根据权利要求15所述的装置,其特征在于,所述第一分配模块包括:
    第二检索单元,用于检索所述随机MAC地址对应的待分配MAC地址是否记录在所述已分配MAC地址池;
    第一分配单元,用于在检索结果为是的情况下,在所述已分配MAC地址池中根据所述随机MAC地址提取对应的待分配MAC地址;
    第二分配单元,用于在检索结果为否的情况下,检索所述随机MAC地址对应的待分配MAC地址是否记录在所述预分配MAC地址池。
  17. 根据权利要求16所述的装置,其特征在于,所述第一分配单元包括:
    第一提取子单元,用于在检索结果为是的情况下,在所述预分配MAC地址池中根据所述随机MAC地址提取对应的待分配MAC地址,并刷新预分配MAC地址池定时器;
    第二提取子单元,用于在检索结果为否的情况下,从所述未分配MAC地址池提取空闲的待分配MAC地址,将所述空闲的待分配MAC地址分配给所述随机MAC地址,并存储所述空闲的待分配MAC地址与所述随机MAC地址的对应关系,生成预分配MAC地址池定时器。
  18. 根据权利要求15所述的装置,其特征在于,所述第二分配模块包括:
    判断单元,用于判断所述未分配MAC地址池中是否存在剩余的待分配MAC地址;
    第三分配单元,用于在判断结果为是的情况下,为所述随机MAC地址分配对应的待分配MAC地址,存储所述随机MAC地址与所述待分配MAC地址的对应关系;
    配置单元,用于将所述对应关系转移至所述预分配MAC地址池,生成预分配MAC地址池定时器;
    第三检索单元,用于在判断结果为否的情况下,在所述预分配MAC地址池中检索是否存在定时小于预设阈值的待分配MAC地址。
  19. 根据权利要求18所述的装置,其特征在于,所述第三检索单元包括:
    第一分配子单元,用于在检索结果为是的情况下,将所述待分配MAC地址分配给所述随机MAC地址,更新所述预分配MAC地址池中所述待分配MAC地址与随机MAC地址的对应关系,刷新预分配MAC地址池定时器;
    配置子单元,用于在检索结果为否的情况下,指示所述终端使用真实的MAC地址。
  20. 根据权利要求16或18所述的装置,其特征在于,所述装置还包括:
    封装模块,将所述待分配MAC地址封装于扫描响应报文;
    发送模块,用于将所述扫描响应报文返回所述终端。
  21. 根据权利要求20所述的装置,其特征在于,所述封装模块包括:
    封装单元,用于将所述待分配MAC地址与所述随机MAC地址封装于特定元素;
    报文生成单元,用于依据所述特定元素生成所述扫描响应报文。
  22. 根据权利要求21所述的装置,其特征在于,所述装置还包括:
    接收模块,用于在所述将所述扫描响应报文返回所述终端之后,接收所述终端依据所述扫描响应报文返回的认证报文;
    验证模块,用于验证所述认证报文;
    反馈模块,用于当验证成功时,依据所述认证报文返回认证响应报文。
  23. 根据权利要求22所述的装置,其特征在于,所述验证模块包括:
    第一判定单元,用于判断所述认证报文中是否携带有所述特定元素;
    第二判定单元,用于在所述第一判定单元的判断结果为是时,判断所述认证报文中的待分配MAC地址是否为所述预分配MAC地址池中记录的MAC地址。
  24. 根据权利要求23所述的装置,其特征在于,所述第二判定单元包括:
    第一判定子单元,用于在所述第二判定单元的判断结果为是的情况下,判断所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址是否与所述认证报文中的随机MAC地址相同;
    第一认证子单元,用于在所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址相同的情况下,将所述待分配MAC地址转移至所述已分配MAC地址池,并反馈认证成功;
    第二认证子单元,用于在所述预分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址不同的情况下,反馈认证失败。
  25. 根据权利要求23所述的装置,其特征在于,所述第二判定单元还包括:
    第二判定子单元,用于在所述第二判定单元的判断结果为否的情况下,判断所述认证报文中的待分配MAC地址是否为所述已分配MAC地址池中记录的MAC地址;
    第三判定单元,用于在所述认证报文中的待分配MAC地址是所述已分配MAC地址池中记录的MAC地址的情况下,判断所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址是否与所述认证报文中的随机MAC地址相同;
    第三认证子单元,用于在所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址相同的情况下,反馈认证成功;
    第四认证子单元,用于在所述已分配MAC地址池中记录的所述待分配MAC地址对应的随机MAC地址与所述认证报文中的随机MAC地址不同的情况下,反馈认证失败。
  26. 根据权利要求25所述的装置,其特征在于,所述装置还包括:
    第五认证子单元,用于在所述认证报文中的待分配MAC地址不是所述已分配MAC地址池中记录的MAC地址的情况下,反馈认证失败。
  27. 一种MAC地址的分配系统,其特征在于,包括:接入点AP和终端,所述AP与所述终端通信连接,其中,
    所述AP为权利要求14至26中任一项所述的MAC地址的分配装置。
PCT/CN2016/106849 2015-12-03 2016-11-23 Mac地址的分配方法、装置及系统 WO2017092588A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510884047.3 2015-12-03
CN201510884047.3A CN106850865A (zh) 2015-12-03 2015-12-03 Mac地址的分配方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2017092588A1 true WO2017092588A1 (zh) 2017-06-08

Family

ID=58796343

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/106849 WO2017092588A1 (zh) 2015-12-03 2016-11-23 Mac地址的分配方法、装置及系统

Country Status (2)

Country Link
CN (1) CN106850865A (zh)
WO (1) WO2017092588A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111711471A (zh) * 2020-06-12 2020-09-25 江苏集能易新能源技术有限公司 电力线载波通信自组网实现方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395785B (zh) * 2017-08-07 2020-09-18 福州市协成智慧科技有限公司 一种网络设备真实地址的获取方法及装置
CN110247992B (zh) * 2018-03-08 2022-09-02 阿里巴巴集团控股有限公司 地址更新方法、装置、终端及服务器
CN111093250B (zh) * 2019-12-26 2022-02-25 Oppo(重庆)智能科技有限公司 网络扫描方法、装置、终端及存储介质
CN114448944A (zh) * 2020-10-21 2022-05-06 华为技术有限公司 Mac地址分配方法及装置
CN113402014B (zh) * 2021-05-26 2022-04-05 安徽泓济环境科技有限公司 正压污水废气处理一体机

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1489339A (zh) * 2002-07-06 2004-04-14 ���ǵ�����ʽ���� 保证用户匿名的方法及其无线局域网系统
CN101035146A (zh) * 2006-03-10 2007-09-12 日本电气株式会社 无线通信设备,mac地址管理系统,无线通信方法和程序
US20150095501A1 (en) * 2013-10-02 2015-04-02 Sony Corporation Network discovery and connection using device addresses not correlated to a device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100403719C (zh) * 2006-02-10 2008-07-16 华为技术有限公司 一种虚链路建立方法及装置
CN104079686B (zh) * 2014-07-17 2017-11-21 福州瑞芯微电子股份有限公司 终端设备mac地址的设置方法以及分配方法
CN104994530B (zh) * 2015-07-09 2019-01-15 乐鑫信息科技(上海)有限公司 基于组MAC地址的多Wi-Fi物联网设备分组集体控制系统及方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1489339A (zh) * 2002-07-06 2004-04-14 ���ǵ�����ʽ���� 保证用户匿名的方法及其无线局域网系统
CN101035146A (zh) * 2006-03-10 2007-09-12 日本电气株式会社 无线通信设备,mac地址管理系统,无线通信方法和程序
US20150095501A1 (en) * 2013-10-02 2015-04-02 Sony Corporation Network discovery and connection using device addresses not correlated to a device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111711471A (zh) * 2020-06-12 2020-09-25 江苏集能易新能源技术有限公司 电力线载波通信自组网实现方法

Also Published As

Publication number Publication date
CN106850865A (zh) 2017-06-13

Similar Documents

Publication Publication Date Title
WO2017092588A1 (zh) Mac地址的分配方法、装置及系统
US9894630B2 (en) ADSS enabled global roaming system
US20120076072A1 (en) System and method for maintaining privacy in a wireless network
WO2015101125A1 (zh) 网络接入控制方法和设备
CN112437456A (zh) 一种非公共网络中的通信方法及设备
WO2019011203A1 (zh) 设备接入方法、设备及系统
WO2015051674A1 (zh) 基于无密码或任意密码的网络授权的方法、系统和装置
CN106713522B (zh) 一种无线保真Wi-Fi连接方法及移动终端
US20130223361A1 (en) Terminal and method for establishing wireless access channel
JP2014509468A (ja) 無線ネットワーククレデンシャルを帯域外配信するための方法及びシステム
US20180167354A1 (en) A network, a cloud-based server, and a method of registering for a service
CN106453370B (zh) 一种ipc向nvr进行注册的方法和装置
CN110581902A (zh) 一种地址分配方法、系统、dhcp服务器及认证服务器
US10505890B2 (en) Network access method, system and terminal device, and computer storage medium
US10505913B2 (en) Communication management system, access point, communication management device, connection control method, communication management method, and program
WO2017181626A1 (zh) 友邻共享网络建立方法、使用方法及友邻共享网络系统
US20200107332A1 (en) Wireless resource-allocating system and method
WO2016145826A1 (zh) Wifi热点的接入方法及装置
CN110913351B (zh) 组播控制方法、装置、网络设备及存储介质
CN111132090B (zh) 一种接入物联网的方法和装置
WO2014201783A1 (zh) 一种自组网的加密鉴权方法、系统及终端
CN110278558B (zh) 报文的交互方法及wlan系统
CN109451497B (zh) 无线网络连接方法及装置、电子设备、存储介质
WO2016131297A1 (zh) 一种限制非许可用户设备接入家庭网关的方法和装置
CN108307683B (zh) 通讯方法、微基站、微基站控制器、终端和系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16869898

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16869898

Country of ref document: EP

Kind code of ref document: A1