CN108667951B - Virtual MAC address mapping method and device, storage medium and relay equipment - Google Patents

Virtual MAC address mapping method and device, storage medium and relay equipment Download PDF

Info

Publication number
CN108667951B
CN108667951B CN201810335755.5A CN201810335755A CN108667951B CN 108667951 B CN108667951 B CN 108667951B CN 201810335755 A CN201810335755 A CN 201810335755A CN 108667951 B CN108667951 B CN 108667951B
Authority
CN
China
Prior art keywords
mac address
mapped
virtual
bytes
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810335755.5A
Other languages
Chinese (zh)
Other versions
CN108667951A (en
Inventor
梁亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Lianzhou International Technology Co ltd
Original Assignee
TP Link Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN201810335755.5A priority Critical patent/CN108667951B/en
Publication of CN108667951A publication Critical patent/CN108667951A/en
Application granted granted Critical
Publication of CN108667951B publication Critical patent/CN108667951B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/255Maintenance or indexing of mapping tables
    • 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

Abstract

The invention discloses a mapping method of a virtual MAC address, when the MAC address to be mapped is judged to be a physical MAC address, the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped are obtained according to the first 3 bytes of the physical MAC address of the wireless relay equipment, and the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped are obtained according to the last 3 bytes of the MAC address to be mapped; and when the MAC address to be mapped is judged to be the virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped. Correspondingly, the invention also discloses a mapping device of the virtual MAC address, a computer storage medium and wireless relay equipment. By adopting the technical scheme of the invention, the problem of virtual MAC address repetition can be solved, so that communication abnormity caused by virtual MAC address repetition is effectively reduced.

Description

Virtual MAC address mapping method and device, storage medium and relay equipment
Technical Field
The present invention relates to the field of wireless network technologies, and in particular, to a method and an apparatus for mapping a virtual MAC address, a computer storage medium, and a wireless relay device.
Background
The wireless relay device (Repeater) is a wireless device for wireless signal expansion, and can receive signals of a front-end wireless AP, and also can serve as a wireless AP to provide a wireless network for a back-end device connected to the wireless AP, so as to implement a wireless relay function. In the wireless relay network, each time the back end of the wireless relay device is connected with one more back end device, one more wireless connection is established between the wireless relay device and the front end wireless AP, and the MAC address of the wireless connection, namely the virtual MAC address, can not directly adopt the MAC address of the back end device, nor can the MAC address be preset by the wireless relay device.
The prior art provides a mapping method for a MAC address of a backend device and a virtual MAC address, where the first 3 bytes of the virtual MAC address adopt the first 3 bytes of a MAC address of a wireless relay device (OUI, organization Unique Identifier), and set the G/L bit therein to 1, and the last 3 bytes of the virtual MAC address adopt the last 3 bytes of the MAC address of the backend device.
However, since the first 3 bytes of the MAC address of the wireless relay device directly use the first 3 bytes of the MAC address of the wireless relay device, and the first 3 bytes of the MAC address of the wireless relay device is OUI, that is, an identifier related to a manufacturer, and the first 3 bytes are very likely to be the same for wireless relay devices produced by the same manufacturer, in a wireless relay network topology in which a plurality of wireless relay devices are cascaded, for the same backend device, there is a high possibility that wireless relay devices in different levels map the same virtual MAC address, as shown in fig. 1, it is a usage scenario diagram of a mapping method of the MAC address and the virtual MAC address of the backend device provided in the prior art, when the backend device is connected to the wireless relay device 1, since the MAC addresses of the wireless relay devices 1 to N in the diagram are the same as the first 3 bytes, all the virtual MAC addresses are '00: 0A: EB', the virtual MAC addresses of the corresponding back-end equipment obtained by the wireless relay equipment 1 to the wireless relay equipment N respectively by adopting the mapping method provided by the prior art are completely consistent and are '02: 0A: EB:11:22: 33', and therefore the communication abnormity can be caused when the same virtual MAC address appears in the wireless relay network.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a mapping method and apparatus for a virtual MAC address, a computer storage medium, and a wireless relay device, which can solve the problem of virtual MAC address duplication, thereby effectively reducing communication anomalies caused by virtual MAC address duplication.
In order to solve the above technical problem, an embodiment of the present invention provides a method for mapping a virtual MAC address, where the method is performed by each wireless relay device in a wireless relay network, and includes:
acquiring an MAC address table of a back-end device connected with the wireless relay device to obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
for each MAC address to be mapped, judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address;
when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay equipment, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
when the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped;
obtaining an MAC address table of the wireless relay equipment according to a virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the back-end equipment and a physical MAC address of the wireless relay equipment;
when the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped, specifically:
and when the MAC address to be mapped is a virtual MAC address, adding 1 to the upper 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
Further, for each MAC address to be mapped, determining whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
and judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of a preset judgment bit in the MAC address to be mapped.
Further, the determining, according to a value of a preset determination bit in the MAC address to be mapped, whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of the G/L bit in the MAC address to be mapped; wherein the content of the first and second substances,
if the value of the G/L bit in the MAC address to be mapped is 0, the MAC address to be mapped is a physical MAC address;
if the value of the G/L bit in the MAC address to be mapped is 1, the MAC address to be mapped is a virtual MAC address;
then, when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the physical MAC address to be mapped, specifically:
when the MAC address to be mapped is a physical MAC address, setting the first 3 bytes of the physical MAC address of the wireless relay device as the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped, setting the last 3 bytes of the MAC address to be mapped as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and setting the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped as 1.
In order to solve the above technical problem, an embodiment of the present invention further provides an apparatus for mapping a virtual MAC address, where the apparatus is disposed in each wireless relay device in a wireless relay network, and includes:
the MAC address acquisition module is used for acquiring an MAC address table of the back-end equipment connected with the wireless relay equipment to obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
the MAC address judging module is used for judging whether each MAC address to be mapped is a physical MAC address or a virtual MAC address;
the first virtual MAC address mapping module is used for obtaining the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device when the MAC address to be mapped is the physical MAC address, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
the second virtual MAC address mapping module is used for processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule when the MAC address to be mapped is a virtual MAC address, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped; and the number of the first and second groups,
the MAC address table acquisition module is used for acquiring the MAC address table of the wireless relay equipment according to the virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the back-end equipment and the physical MAC address of the wireless relay equipment;
the second virtual MAC address mapping module specifically includes:
and the second virtual MAC address mapping unit is used for adding 1 to the high 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule when the MAC address to be mapped is a virtual MAC address, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
In order to solve the above technical problem, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium includes a stored computer program; wherein, the computer program controls the device where the computer storage medium is located to execute any one of the above mapping methods for the virtual MAC address when running.
In order to solve the technical problem, an embodiment of the present invention further provides a wireless relay device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the mapping method of the virtual MAC address described in any one of the above when executing the computer program.
Compared with the prior art, the embodiment of the invention provides a virtual MAC address mapping method and device, a computer storage medium and a wireless relay device, wherein by judging whether an MAC address to be mapped is a physical MAC address or a virtual MAC address, when the MAC address is the physical MAC address, a corresponding virtual MAC address is obtained according to the first 3 bytes of the physical MAC address of the wireless relay device and the last 3 bytes of the MAC address to be mapped; when the address is a virtual MAC address, the first 3 bytes of the MAC address to be mapped are processed according to a preset processing rule, and the processed MAC address is set as a corresponding virtual MAC address, so that the problem of virtual MAC address repetition can be solved, and communication abnormity caused by virtual MAC address repetition is effectively reduced.
Drawings
Fig. 1 is a usage scenario diagram of a mapping method between a MAC address and a virtual MAC address of a backend device provided in the prior art;
FIG. 2 is a flow chart of a preferred embodiment of a virtual MAC address mapping method provided by the present invention;
FIG. 3 is a usage scenario diagram of a mapping method for virtual MAC addresses according to the present invention;
fig. 4 is a block diagram illustrating a preferred embodiment of a mapping apparatus for virtual MAC addresses according to the present invention;
fig. 5 is a block diagram of a preferred embodiment of a wireless relay device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without any inventive step, are within the scope of the present invention.
Referring to fig. 2, it is a flowchart of a preferred embodiment of a mapping method of virtual MAC addresses provided in the present invention, where the method is executed by each wireless relay device in a wireless relay network, and includes steps S11 to S15:
step S11, obtaining the MAC address table of the back-end equipment connected with the wireless relay equipment to obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
step S12, for each MAC address to be mapped, judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address;
step S13, when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
step S14, when the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped;
step S15, obtaining the MAC address table of the wireless relay device according to the virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the backend device and the physical MAC address of the wireless relay device.
Specifically, a back-end device directly connected to the wireless relay device sends a data packet to the wireless relay device, and the wireless relay device obtains an MAC address table of the back-end device according to the received data packet, where the MAC address table stores all MAC addresses to be mapped corresponding to the back-end device, where the MAC addresses at least include a physical MAC address of the back-end device; for each MAC address to be mapped in the MAC address table of the back-end equipment, judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address; if the MAC address to be mapped is a physical MAC address, the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped are obtained according to the first 3 bytes of the physical MAC address of the wireless relay device, and the last 3 bytes are obtained according to the last 3 bytes of the MAC address to be mapped; if the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and taking the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped; after all the MAC addresses to be mapped in the MAC address table of the back-end device are mapped, the MAC address table of the wireless relay device can be obtained according to all the correspondingly obtained virtual MAC addresses and the physical MAC address of the wireless relay device.
According to the mapping method of the virtual MAC address provided by the embodiment of the invention, when the MAC address to be mapped is a physical MAC address, a corresponding virtual MAC address is obtained according to the first 3 bytes of the physical MAC address of the wireless relay equipment and the last 3 bytes of the physical MAC address to be mapped; when the MAC address to be mapped is a virtual MAC address, further processing the first 3 bytes of the MAC address to be mapped to obtain a corresponding virtual MAC address; the problem of the repetition of the virtual MAC address is solved, so that communication abnormity caused by the repetition of the virtual MAC address is effectively reduced; and the last 3 bytes of the virtual MAC address all adopt the last 3 bytes of the MAC address to be mapped, so that the uniqueness and the correlation of the virtual MAC address obtained by mapping are ensured.
In another preferred embodiment, for each MAC address to be mapped, determining whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
and judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of a preset judgment bit in the MAC address to be mapped.
Specifically, a certain bit in the MAC address to be mapped is preset as a determination bit, and whether the MAC address to be mapped is a physical MAC address or a virtual MAC address is determined by determining a specific value of the determination bit.
In another preferred embodiment, the determining, according to a value of a preset determination bit in the MAC address to be mapped, whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of the G/L bit in the MAC address to be mapped; wherein the content of the first and second substances,
if the value of the G/L bit in the MAC address to be mapped is 0, the MAC address to be mapped is a physical MAC address;
if the value of the G/L bit in the MAC address to be mapped is 1, the MAC address to be mapped is a virtual MAC address;
then, when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the physical MAC address to be mapped, specifically:
when the MAC address to be mapped is a physical MAC address, setting the first 3 bytes of the physical MAC address of the wireless relay device as the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped, setting the last 3 bytes of the MAC address to be mapped as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and setting the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped as 1.
In this embodiment, the preset determination bit is a G/L bit in the MAC address to be mapped, and when the wireless relay device obtains the MAC address to be mapped, the wireless relay device may read a value of the G/L bit, and if the value of the G/L bit is 0, the wireless relay device indicates that the MAC address to be mapped is a physical MAC address; if the value of the G/L bit is 1, the MAC address to be mapped is a virtual MAC address.
Correspondingly, when the value of the G/L bit in the MAC address to be mapped is 0, that is, the MAC address to be mapped is a physical MAC address, the first 3 bytes of the physical MAC address of the wireless relay device are used as the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, the last 3 bytes of the physical MAC address to be mapped are used as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped is set to 1, so that the virtual MAC address corresponding to the MAC address to be mapped is finally obtained.
In another preferred embodiment, when the MAC address to be mapped is a virtual MAC address, the first 3 bytes of the MAC address to be mapped are processed according to a preset processing rule, and the processed MAC address is set as the virtual MAC address corresponding to the MAC address to be mapped, specifically:
and when the MAC address to be mapped is a virtual MAC address, processing the high 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
In this embodiment, when the value of the G/L bit in the MAC address to be mapped is 1, that is, the MAC address to be mapped is a virtual MAC address, the upper 6 bits of the 1 st byte of the MAC address to be mapped are further processed according to a preset processing rule, and the processed MAC address to be mapped is used as the corresponding virtual MAC address, so as to finally obtain the virtual MAC address corresponding to the MAC address to be mapped.
In another preferred embodiment, when the MAC address to be mapped is a virtual MAC address, the upper 6 bits of the 1 st byte of the MAC address to be mapped are processed according to a preset processing rule, and the processed MAC address is set as the virtual MAC address corresponding to the MAC address to be mapped, specifically:
and when the MAC address to be mapped is a virtual MAC address, adding 1 to the high 6 bits of the 1 st byte of the MAC address to be mapped, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
In this embodiment, when the value of the G/L bit in the MAC address to be mapped is 1, that is, the MAC address to be mapped is a virtual MAC address, 1 is added to the high 6 bits of the 1 st byte of the MAC address to be mapped, and the processed MAC address to be mapped is used as its corresponding virtual MAC address, so as to finally obtain the virtual MAC address corresponding to the MAC address to be mapped.
For example, if the first byte of the MAC address to be mapped is 00000010, the second last bit thereof is a G/L bit, and the value is 1, which indicates that the MAC address to be mapped is a virtual MAC address, 1 is added to the high 6 bits of the 1 st byte, and the processed first byte is 00000110, and similarly, if the first byte of the MAC address to be mapped is 00000110, the processed first byte is 00001010.
Referring to fig. 3, which is a usage scenario diagram of the mapping method of the virtual MAC address provided in the present invention, in the usage scenario diagram, a front-end wireless AP is connected to the Internet, and cascaded wireless relay devices 1 to N are respectively connected to the front-end wireless AP and a back-end wireless STA.
Taking the wireless relay device 1 as an example, when a back-end wireless STA is connected with the wireless relay device 1, sending a data packet to the wireless relay device 1, the wireless relay device 1 obtaining a MAC address table of the back-end wireless STA according to the received data packet, wherein only a physical MAC address 64: BC:0C:11:22:33 of the back-end STA is in the MAC address table of the back-end wireless STA, if the MAC address to be mapped is the physical MAC address 64: BC:0C:11:22:33 of the back-end STA, judging that a value of a G/L bit is 0, indicating that the MAC address to be mapped is the physical MAC address, taking a first 3 bytes of the physical MAC address 00:0A: EB: ×: xx: x 1 as a first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped, and taking a last 3 bytes of the MAC address to be mapped as a second 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped (obtaining a virtual MAC address corresponding virtual MAC address) after the physical MAC address to be mapped is obtained The MAC address is 00:0A: EB:11:22: 33), and the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped is set to be 1, so that the virtual MAC address corresponding to the MAC address to be mapped is finally obtained as 02:0A: EB:11:22: 33.
Since the back end of the wireless relay device 1 is connected with only one back end wireless STA, the MAC address table of the wireless relay device 1 can be obtained according to the obtained virtual MAC address corresponding to the MAC address to be mapped and the physical MAC address of the wireless relay device 1, wherein the MAC address table specifically includes the virtual MAC address 02:0A: EB:11:22:33 corresponding to the physical MAC address of the back end wireless STA and the physical MAC address 00:0A: EB: ×: xx: ×: x 1 of the wireless relay device 1.
Taking the wireless relay device 2 as an example, the wireless relay device 2 obtains a MAC address table of the wireless relay device 1 according to a received data packet sent by the wireless relay device 1, so as to obtain that a MAC address to be mapped is 02:0A: EB:11:22:33 and 00:0A: EB: xx: x 1, for the MAC address to be mapped is 02:0A: EB:11:22:33, the value of the G/L bit is judged to be 1, the MAC address to be mapped is a virtual MAC address, 1 is added to the high 6 bits of the 1 st byte of the MAC address to be mapped, the binary system of the first byte after processing is 00000110, and the corresponding hexadecimal system is 06, so that the virtual MAC address corresponding to the MAC address to be mapped is finally obtained, wherein the virtual MAC address corresponding to be mapped is 06:0A: EB:11:22: 33; for MAC addresses 00:0A to be mapped: EB: x: x: x 1, judging the value of the G/L bit to be 0, indicating that the MAC address to be mapped is a physical MAC address, the physical MAC address 00:0A of the wireless relay apparatus 2 is: EB: x: x: the first 3 bytes of x 2 are used as the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and the MAC address to be mapped 00:0A: EB: x: x: the last 3 bytes of x 1 are used as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped (the correspondingly obtained virtual MAC address is 00:0A: EB:x ×: x:x1), and the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped is set to 1, so as to finally obtain the MAC addresses 00:0A to be mapped: EB: x: x: the virtual MAC address for x 1 is 02:0A: EB: x: x: x 1.
Since the back end of the wireless relay device 2 is connected to the wireless relay device 1 and the back end wireless STA, the MAC address table of the wireless relay device 2 can be obtained according to the obtained virtual MAC address corresponding to the MAC address to be mapped and the physical MAC address of the wireless relay device 2, wherein the MAC address table specifically includes the virtual MAC address 06:0A: EB:11:22:33, the virtual address 02:0A: EB:x: x: x 1, and the physical MAC address 00:0A: EB:x: x: 2 of the wireless relay device 2.
Similarly, the wireless relay devices 1 to N in the cascade connection in the figure respectively obtain the virtual MAC address corresponding to the MAC address to be mapped and the MAC address table of the wireless relay device N through the mapping method of the virtual MAC address provided in the embodiment of the present invention.
For the same device, for example, a back-end wireless STA, the corresponding virtual MAC address obtained through mapping by the wireless relay device 1 is 02:0A: EB:11:22:33, the corresponding virtual MAC address obtained through mapping by the wireless relay device 2 is 06:0A: EB:11:22:33, · · · · · · · ·, the corresponding virtual MAC address obtained through mapping by the wireless relay device N is XX:0A: EB:11:22:33, wherein the decimal value corresponding to XX can be obtained through (N-1) · 4+2 calculation; and so on for other cases.
It should be noted that the purpose of the wireless relay device mapping to obtain the virtual MAC address is to enable the connected backend device to have an independent and unique MAC address in the front-end network of the wireless relay device to ensure normal communication, and for the wireless relay device 1, if a wireless STA is connected to the wireless relay device 2, that is, the wireless STA is in the front-end network of the wireless relay device 1, the wireless relay device 1 does not need to map the corresponding virtual MAC address to the wireless STA.
The wireless relay device cascade scenario shown in fig. 3 can implement mapping of a unique and related virtual MAC address under at most 64-level cascade, and the mapping method of the virtual MAC address provided by the embodiment of the present invention can be applied to wireless relay devices supporting Proxy modes of different chip schemes, and has strong practicability and popularization.
Referring to fig. 4, it is a block diagram of a preferred embodiment of an apparatus for mapping a virtual MAC address provided in the present invention, where the apparatus is disposed in each wireless relay device in a wireless relay network, and includes:
the MAC address obtaining module 11 is configured to obtain an MAC address table of a back-end device connected to the wireless relay device, and obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
the MAC address determination module 12 is configured to determine, for each MAC address to be mapped, whether the MAC address to be mapped is a physical MAC address or a virtual MAC address;
the first virtual MAC address mapping module 13 is configured to, when the MAC address to be mapped is a physical MAC address, obtain the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device, and obtain the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
the second virtual MAC address mapping module 14 is configured to, when the MAC address to be mapped is a virtual MAC address, process the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and set the processed MAC address as a virtual MAC address corresponding to the MAC address to be mapped; and the number of the first and second groups,
the MAC address table obtaining module 15 is configured to obtain an MAC address table of the wireless relay device according to a virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the backend device and a physical MAC address of the wireless relay device.
Preferably, the MAC address determining module 12 specifically includes:
and the MAC address judging unit is used for judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of a preset judging bit in the MAC address to be mapped.
Preferably, the MAC address determining unit specifically includes:
the MAC address judging subunit is used for judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of the G/L bit in the MAC address to be mapped; wherein the content of the first and second substances,
if the value of the G/L bit in the MAC address to be mapped is 0, the MAC address to be mapped is a physical MAC address;
if the value of the G/L bit in the MAC address to be mapped is 1, the MAC address to be mapped is a virtual MAC address;
the first virtual MAC address mapping module 13 specifically includes:
a first virtual MAC address mapping unit, configured to, when the MAC address to be mapped is a physical MAC address, set the first 3 bytes of the physical MAC address of the wireless relay device as the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, set the last 3 bytes of the MAC address to be mapped as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and set a value of a G/L bit in the virtual MAC address corresponding to the MAC address to be mapped to 1.
Preferably, the second virtual MAC address mapping module 14 specifically includes:
and the second virtual MAC address mapping unit is used for processing the high 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule when the MAC address to be mapped is a virtual MAC address, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
Preferably, the second virtual MAC address mapping unit specifically includes:
and the second virtual MAC address mapping subunit is configured to, when the MAC address to be mapped is a virtual MAC address, add 1 to the upper 6 bits of the 1 st byte of the MAC address to be mapped, and set the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
The mapping apparatus for a virtual MAC address provided in the embodiments of the present invention can implement all the processes of the mapping method for a virtual MAC address in any one of the embodiments, and the functions and technical effects of each module and unit in the apparatus are respectively the same as those of the mapping method for a virtual MAC address in the embodiments described above, and are not described herein again.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium includes a stored computer program; wherein, when running, the computer program controls the device where the computer storage medium is located to execute the mapping method of the virtual MAC address according to any of the above embodiments.
An embodiment of the present invention further provides a wireless relay device, which is shown in fig. 5 and is a block diagram of a preferred embodiment of the wireless relay device provided in the present invention, and the wireless relay device includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10, where the processor 10, when executing the computer program, implements the mapping method for the virtual MAC address described in any one of the embodiments above.
Preferably, the computer program can be divided into one or more modules/units (e.g. computer program 1, computer program 2,) which are stored in the memory 20 and executed by the processor 10 to accomplish the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the wireless relay device.
The Processor 10 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc., the general purpose Processor may be a microprocessor, or the Processor 10 may be any conventional Processor, the Processor 10 is a control center of the wireless relay device, and various interfaces and lines are used to connect various parts of the wireless relay device.
The memory 20 mainly includes a program storage area that may store an operating system, an application program required for at least one function, and the like, and a data storage area that may store related data and the like. In addition, the memory 20 may be a high speed random access memory, may also be a non-volatile memory, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), and the like, or the memory 20 may also be other volatile solid state memory devices.
It should be noted that the wireless relay device may include, but is not limited to, a processor and a memory, and those skilled in the art will understand that the structural block diagram of fig. 5 is only an example of the wireless relay device, and does not constitute a limitation of the wireless relay device, and may include more or less components than those shown in the figure, or combine some components, or different components.
To sum up, according to the mapping method and apparatus for a virtual MAC address, the computer storage medium, and the wireless relay device provided in the embodiments of the present invention, when an MAC address to be mapped is a physical MAC address, a corresponding virtual MAC address is obtained according to the first 3 bytes of the physical MAC address of the wireless relay device and the last 3 bytes of the physical MAC address to be mapped; when the MAC address to be mapped is a virtual MAC address, further processing the first 3 bytes of the MAC address to be mapped to obtain a corresponding virtual MAC address; the problem of the repetition of the virtual MAC address is solved, so that communication abnormity caused by the repetition of the virtual MAC address is effectively reduced; and the last 3 bytes of the virtual MAC address all adopt the last 3 bytes of the MAC address to be mapped, so that the uniqueness and the correlation of the virtual MAC address obtained by mapping are ensured.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (6)

1. A mapping method of virtual MAC addresses, which is respectively executed by each wireless relay device in a wireless relay network, is characterized in that the method comprises the following steps:
acquiring an MAC address table of a back-end device connected with the wireless relay device to obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
for each MAC address to be mapped, judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address;
when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay equipment, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
when the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped;
obtaining an MAC address table of the wireless relay equipment according to a virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the back-end equipment and a physical MAC address of the wireless relay equipment;
when the MAC address to be mapped is a virtual MAC address, processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped, specifically:
and when the MAC address to be mapped is a virtual MAC address, adding 1 to the upper 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
2. The method for mapping a virtual MAC address according to claim 1, wherein the determining, for each MAC address to be mapped, whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
and judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of a preset judgment bit in the MAC address to be mapped.
3. The method for mapping a virtual MAC address according to claim 2, wherein the determining, according to the value of the preset determination bit in the MAC address to be mapped, whether the MAC address to be mapped is a physical MAC address or a virtual MAC address specifically includes:
judging whether the MAC address to be mapped is a physical MAC address or a virtual MAC address according to the value of the G/L bit in the MAC address to be mapped; wherein the content of the first and second substances,
if the value of the G/L bit in the MAC address to be mapped is 0, the MAC address to be mapped is a physical MAC address;
if the value of the G/L bit in the MAC address to be mapped is 1, the MAC address to be mapped is a virtual MAC address;
then, when the MAC address to be mapped is a physical MAC address, obtaining the first 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the physical MAC address to be mapped, specifically:
when the MAC address to be mapped is a physical MAC address, setting the first 3 bytes of the physical MAC address of the wireless relay device as the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped, setting the last 3 bytes of the MAC address to be mapped as the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped, and setting the value of the G/L bit in the virtual MAC address corresponding to the MAC address to be mapped as 1.
4. An apparatus for mapping a virtual MAC address, the apparatus being provided in each wireless relay device in a wireless relay network, comprising:
the MAC address acquisition module is used for acquiring an MAC address table of the back-end equipment connected with the wireless relay equipment to obtain each MAC address to be mapped; wherein, the MAC address table of the back-end equipment at least comprises the physical MAC address of the back-end equipment;
the MAC address judging module is used for judging whether each MAC address to be mapped is a physical MAC address or a virtual MAC address;
the first virtual MAC address mapping module is used for obtaining the first 3 bytes of a virtual MAC address corresponding to the MAC address to be mapped according to the first 3 bytes of the physical MAC address of the wireless relay device when the MAC address to be mapped is the physical MAC address, and obtaining the last 3 bytes of the virtual MAC address corresponding to the MAC address to be mapped according to the last 3 bytes of the MAC address to be mapped;
the second virtual MAC address mapping module is used for processing the first 3 bytes of the MAC address to be mapped according to a preset processing rule when the MAC address to be mapped is a virtual MAC address, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped; and the number of the first and second groups,
the MAC address table acquisition module is used for acquiring the MAC address table of the wireless relay equipment according to the virtual MAC address corresponding to each MAC address to be mapped in the MAC address table of the back-end equipment and the physical MAC address of the wireless relay equipment;
the second virtual MAC address mapping module specifically includes:
and the second virtual MAC address mapping unit is used for adding 1 to the high 6 bits of the 1 st byte of the MAC address to be mapped according to a preset processing rule when the MAC address to be mapped is a virtual MAC address, and setting the processed MAC address as the virtual MAC address corresponding to the MAC address to be mapped.
5. A computer storage medium, characterized in that the computer storage medium comprises a stored computer program; wherein the computer program, when running, controls an apparatus in which the computer storage medium is located to perform the mapping method of the virtual MAC address according to any one of claims 1 to 3.
6. A wireless relay device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the virtual MAC address mapping method of any one of claims 1 to 3 when executing the computer program.
CN201810335755.5A 2018-04-13 2018-04-13 Virtual MAC address mapping method and device, storage medium and relay equipment Active CN108667951B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810335755.5A CN108667951B (en) 2018-04-13 2018-04-13 Virtual MAC address mapping method and device, storage medium and relay equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810335755.5A CN108667951B (en) 2018-04-13 2018-04-13 Virtual MAC address mapping method and device, storage medium and relay equipment

Publications (2)

Publication Number Publication Date
CN108667951A CN108667951A (en) 2018-10-16
CN108667951B true CN108667951B (en) 2021-04-27

Family

ID=63783512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810335755.5A Active CN108667951B (en) 2018-04-13 2018-04-13 Virtual MAC address mapping method and device, storage medium and relay equipment

Country Status (1)

Country Link
CN (1) CN108667951B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023241855A1 (en) * 2022-06-13 2023-12-21 British Telecommunications Public Limited Company Telecommunications network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523628A (en) * 2011-12-23 2012-06-27 华为终端有限公司 Wireless relay equipment and relaying method thereof
US9160633B1 (en) * 2011-10-07 2015-10-13 Adtran, Inc. Systems and methods for dynamically learning virtual local area network (VLAN) tags
CN105827532A (en) * 2016-05-12 2016-08-03 深圳市蜂联科技有限公司 Methods for discovering and converting true MACs of STAs linked under repeater by router
CN106301859A (en) * 2015-06-09 2017-01-04 华为技术有限公司 A kind of manage the method for network interface card, Apparatus and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9900250B2 (en) * 2015-03-26 2018-02-20 Cisco Technology, Inc. Scalable handling of BGP route information in VXLAN with EVPN control plane

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9160633B1 (en) * 2011-10-07 2015-10-13 Adtran, Inc. Systems and methods for dynamically learning virtual local area network (VLAN) tags
CN102523628A (en) * 2011-12-23 2012-06-27 华为终端有限公司 Wireless relay equipment and relaying method thereof
CN105392126A (en) * 2011-12-23 2016-03-09 华为终端有限公司 Repeating method of wireless repeating device, and wireless repeating device
CN106301859A (en) * 2015-06-09 2017-01-04 华为技术有限公司 A kind of manage the method for network interface card, Apparatus and system
CN105827532A (en) * 2016-05-12 2016-08-03 深圳市蜂联科技有限公司 Methods for discovering and converting true MACs of STAs linked under repeater by router

Also Published As

Publication number Publication date
CN108667951A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
CN109428943B (en) Request processing method, system on chip and public cloud management component
US8660130B2 (en) Transmitting a packet
US20090049295A1 (en) Determining a boot image based on a requesting client address
CN110266763B (en) Method, system and storage medium for implementing block chain network interconnected across network segments
US11568092B2 (en) Method of dynamically configuring FPGA and network security device
CN111416880A (en) IP address addressing method and device, computer storage medium and electronic equipment
CN113890879A (en) Load balancing method and device for data access, computer equipment and medium
CN111064786B (en) Account identifier management method and device
CN110858838A (en) Method and apparatus for bridging communications
CN108667951B (en) Virtual MAC address mapping method and device, storage medium and relay equipment
US11339989B2 (en) Communication method and device for air conditioner, outdoor unit, indoor unit, and air conditioner
CN112422485B (en) Communication method and device of transmission control protocol
CN112087401A (en) Method and device for realizing service quality in distributed storage
CN108183926B (en) Data packet processing method and device
CN113660134B (en) Port detection method, device, electronic device and storage medium
CN113472911B (en) Subnet dividing method and device
CN111679909B (en) Data processing method and device and terminal equipment
CN109639555B (en) Link layer message generation method, link layer message generation device and terminal equipment
CN108667769B (en) Domain name tracing method and device
CN108965169B (en) Message transmission method, network card controller, network card and electronic equipment
CN112565482B (en) Electronic equipment, domain name query method and related product
CN111124445B (en) Home gateway upgrading method and home gateway
CN107086965B (en) ARP (Address resolution protocol) table entry generation method and device and switch
CN111953384B (en) Communication address sending method and device, electric energy meter and storage medium
CN115190102B (en) Information broadcasting method, information broadcasting device, electronic unit, SOC (system on chip) and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220614

Address after: Floor 12-17, unit 1, building 2, No. 466, Xinyu Road, high tech Zone, Chengdu, Sichuan 610000

Patentee after: Chengdu Lianzhou International Technology Co.,Ltd.

Address before: 518000 the 1st and 3rd floors of the south section of building 24 and the 1st-4th floor of the north section of building 28, Shennan Road Science and Technology Park, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: TP-LINK TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right