WO2014056437A1 - Method and apparatus for processing wifi frame - Google Patents

Method and apparatus for processing wifi frame Download PDF

Info

Publication number
WO2014056437A1
WO2014056437A1 PCT/CN2013/084931 CN2013084931W WO2014056437A1 WO 2014056437 A1 WO2014056437 A1 WO 2014056437A1 CN 2013084931 W CN2013084931 W CN 2013084931W WO 2014056437 A1 WO2014056437 A1 WO 2014056437A1
Authority
WO
WIPO (PCT)
Prior art keywords
wifi
mac address
data frame
frame
base station
Prior art date
Application number
PCT/CN2013/084931
Other languages
French (fr)
Chinese (zh)
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 WO2014056437A1 publication Critical patent/WO2014056437A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/20Selecting an access point
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/22Communication route or path selection, e.g. power-based or shortest path routing using selective relaying for reaching a BTS [Base Transceiver Station] or an access point

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and apparatus for processing a WiFi frame. Background technique
  • a WiFi relay can be installed at the junction between the indoor and outdoor (such as the window), as shown in Figure 1.
  • the WiFi relay receives the outdoor WiFi signal, and performs demodulation and regeneration to send to the indoor, so that the indoor WiFi terminal can receive a relatively strong WiFi signal.
  • the WiFi relay can also be installed indoors to achieve indoor WiFi signal enhancement.
  • the WiFi terminal here refers to a WiFi-enabled terminal, such as a WiFi-enabled mobile phone, a notebook, a tablet, and the like.
  • the base station AP can only perceive the WiFi relay, and the WiFi terminal is invisible to the base station AP, and the base station AP cannot sense the existence of the WiFi terminal. Therefore, for the operator, it cannot be very Good management of the WiFi terminal (such as IP address management, accounting, authentication, etc. based on Dynamic Host Configuration Protocol DHCP). Summary of the invention
  • the embodiment of the invention provides a method for processing a WiFi frame by using a WiFi relay, which is used to solve the problem that the operator cannot manage the WiFi terminal well.
  • the embodiment provides a method for processing a WiFi frame, which is applied to a WiFi relay, where the WiFi relay is used to implement communication between a WiFi terminal and a base station access point AP, and the method includes: Receiving a first association request sent by the WiFi terminal, where the source MAC address carried in the first association request is the first MAC address of the WiFi terminal;
  • the WiFi frame is a data frame and the first association list stores a source MAC address in the data frame
  • the source MAC address is a field of the first MAC address
  • the user data in the new data frame is the same as the user data in the received data frame
  • the user data of the WiFi terminal corresponding to the first MAC address performs service processing.
  • the method further includes:
  • the destination MAC address is a field of the first MAC address, in the new data frame
  • User data is the user data in the received second data frame
  • the second possible implementation form further includes:
  • the control frame is terminated, so that the control frame is not forwarded to the base station AP, and is sent back to the WiFi terminal and sent Control frame corresponding to the control frame, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
  • control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol
  • the control frame corresponding to the transmitted control frame is a CTS control frame defined by the WiFi protocol.
  • the reconfiguring a new data frame that can be sent to the base station AP includes: constructing the new data frame At the same time, the value of the BSSID field of the original data frame is modified, and the BSSID value originally identifying the WiFi relay is changed to the BSSID value of the base station AP.
  • the present embodiment provides a WiFi frame processing apparatus, which is applied to a WiFi relay, where the WiFi relay is used to implement communication between a WiFi terminal and a base station access point AP, and the apparatus includes:
  • a first association request receiving unit configured to receive a first association request sent by the WiFi terminal, where a source MAC address carried in the first association request is a first MAC address of the WiFi terminal;
  • a storage unit configured to store, by the first association request receiving unit, the first MAC address in the first association request to the first association list
  • a first association response sending unit configured to send the first association response to the WiFi terminal after the first association request receiving unit receives the first association request, thereby completing the WiFi termination The association between the end and the WiFi relay;
  • a second association request sending unit configured to send, after the first association request receiving unit receives the first association request, a second association request to the base station AP, where the source MAC address carried by the second association request
  • the base station AP acquires the first MAC address after receiving the second association request, and stores the first MAC address, and stores the first MAC address to the second association list.
  • a second association response receiving unit configured to receive the second association response, to complete an association between the WiFi terminal and the base station AP;
  • a WiFi frame receiving unit configured to receive a WiFi frame sent by the WiFi terminal
  • a first constructing unit configured to: when the WiFi frame received by the WiFi frame receiving unit is a data frame, and the first association list stores a source MAC address in the data frame, reconstruct a device that can be sent to the base station a new data frame of the AP, where the source MAC address carried in the new data frame is a field of the first MAC address, and user data in the new data frame is the same as user data in the received data frame;
  • a data frame sending unit configured to send the new data frame constructed by the first building unit to the base station AP, so that the base station AP receives the new data frame and determines that the second associated list is stored After the first MAC address carried in the new data frame, the user data of the WiFi terminal corresponding to the first MAC address is processed.
  • the apparatus further includes:
  • a second data frame receiving unit configured to receive a second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address;
  • a second constructing unit configured to: when determining, according to the first association list, that the first MAC address in the second frame received by the second data frame receiving unit is located in the first association list, Constructing a new second data frame that can be sent to the WiFi terminal, where the destination MAC address carried in the new second data frame is a field of the first MAC address, and the user in the new data frame The data is the user data in the received second data frame;
  • a second data frame sending unit configured to send the new second data frame constructed by the second building unit to the WiFi terminal, so that the WiFi terminal acquires the user inside after receiving the new second data frame data.
  • the method further includes: a control frame processing unit, configured to: when the received WiFi terminal sends the When the WiFi frame is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and the control frame corresponding to the sent control frame is returned to the WiFi terminal, so that the WiFi is enabled. After receiving the corresponding control frame, the terminal sends the data frame.
  • a control frame processing unit configured to: when the received WiFi terminal sends the When the WiFi frame is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and the control frame corresponding to the sent control frame is returned to the WiFi terminal, so that the WiFi is enabled.
  • control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol; and the control corresponding to the sent control frame
  • the frame is a CTS control frame defined by the WiFi protocol.
  • the first building unit includes a BSSID modifying unit, configured to modify when constructing the new data frame The value of the BSSID field of the original data frame is changed from the BSSID value originally identifying the WiFi relay to the BSSID value identifying the base station AP.
  • the relay saves the first MAC address of the WiFi terminal, and the relay still uses the first MAC address to initiate an association request to the base station AP, so that After receiving the base station AP, the first MAC address of the WiFi terminal is also saved, so that the WiFi is associated with the relay and the base station AP.
  • the relay terminates the control frame sent by the terminal and replies to the response to the control frame, and adaptively modifies the data frame sent by the terminal to construct a new data frame and send it to the base station AP, so that the base station AP can receive
  • the new data frame processes the user data therein, thus realizing the "perception" of the base station AP to the terminal (ie, because the base station AP has the second associated list, it can know which terminal is the data), and the base station AP
  • operators deploy them. Therefore, operators can better manage WiFi terminals (for example, IP address management, accounting, authentication, etc. based on DHCP). Made).
  • FIG. 1 is a schematic diagram of communication between a WiFi terminal and a base station AP based on a WiFi relay;
  • FIG. 2 is a schematic flowchart of a relay processing a WiFi frame according to Embodiment 1;
  • FIG. 3 is a schematic structural diagram of a relay of Embodiment 2;
  • FIG. 4 is a schematic diagram of a WiFi terminal associated with a relay and a base station AP;
  • FIG. 5 is a schematic structural diagram of a WiFi frame;
  • FIG. 6 is a schematic diagram of correspondence between fields and frame types in a WiFi frame
  • FIG. 7 is a schematic diagram of sending a data frame after requesting permission by a control frame
  • Figure 8 is a schematic diagram of a new data frame
  • FIG. 9 is a schematic flow chart of the third embodiment relaying data sent by the base station AP to the WiFi terminal;
  • FIG. 10 is a schematic flowchart of a third embodiment of a base station AP transmitting a data frame through a control frame
  • FIG. 11 is a schematic structural diagram of a WiFi frame processing apparatus according to Embodiment 4;
  • FIG. 12 is another schematic structural diagram of a WiFi frame processing apparatus according to Embodiment 4.
  • FIG. 13 is a schematic diagram of a fifth embodiment of a WiFi relay structure. detailed description
  • Embodiment 1 The embodiment of the present invention provides a method for processing a WiFi frame by using a WiFi relay.
  • the application scenario of the WiFi relay may be referred to the application scenario shown in FIG. 1 , and the WiFi relay is used to demodulate the access point of the regenerated base station (Access Point). , AP ) signals are used by various WiFi terminals in the room.
  • the "base station AP” cartridge is also referred to as "AP”
  • the "WiFi relay” cartridge is referred to as "relay”.
  • the terminal "cartridge” is called “terminal”.
  • the WiFi signal sent by the base station AP is represented by an SSID (Service Set Identifier), assuming that SSID_1 is used here, and the WiFi signal identified by SSID_1 also has a BSSID identifier to identify the device providing the WiFi signal, assuming Here BSS_1 is used to identify that the base station AP provides this signal.
  • SSID Service Set Identifier
  • BSS_1 BSSID identifier
  • the embodiment provides a method for processing a WiFi frame by using a WiFi relay, which is applied to a WiFi relay.
  • the method includes the following steps:
  • the association request is a request defined by the WiFi protocol, and the prefix "first” is used to distinguish it from other “association requests” that appear later, and subsequent other prefixed (such as "second") association requests are also followed.
  • the association request here is similar, except that the sender and the object are different.
  • the sequence number prefix is also used to similarly define other nouns (such as MAC addresses), and will not be described in detail later.
  • the association request carries the source MAC address and the destination MAC address of a device. If the terminal sends the packet to the relay, the source MAC address is the MAC address of the terminal. Here, the first MAC address is used to represent the destination MAC address. The MAC address of the relay, which is not required in this step. The destination MAC address is specially processed, and the MAC address of the destination device to be sent (such as the relay in the step) is still filled.
  • the first association list is a logical concept.
  • the specific implementation is not limited. For example, physically, it can also be understood as a physical storage area, and the first MAC address is stored.
  • the relay will receive an association request from multiple terminals, so that the table will include the MAC address of one or more WiFi terminals.
  • the role of the association list is to let the relay know which devices need to be maintained. If the source MAC addresses in the WiFi frames sent by some terminals are not in their own association list, then the terminals do not have their own. To associate, then discard these frames directly.
  • the association list also has other terminal-related information (such as the assigned Association ID). This embodiment still uses the information and does not tamper with it.
  • the WiFi terminal After receiving the association response, the WiFi terminal indicates that the WiFi terminal has been associated with the WiFi relay, and the subsequent WiFi relay processes the data from the WiFi terminal.
  • the relay After receiving the first association request, the relay sends a second association request to the base station AP, and sets the source MAC address in the second association request as the first MAC address, and the destination MAC address does not change here, or is the real target device.
  • Address which is the address of the base station AP.
  • the base station AP After receiving the second association request, the base station AP is the first MAC address because the source MAC address is seen. Therefore, in the view of the base station AP, the association request is sent by the terminal identified by the first MAC address, so that the base station AP can The terminal is associated with the base station AP. Relay is equivalent to "pseudo" in this process
  • the source MAC address is created (normally because the relay is sent from the relay to the base station AP, and the source MAC address should be the relayed MAC address), so that the base station AP considers that the terminal sends the second association request.
  • the terminal does not directly initiate the association request to the base station AP, but completes it through the relay. Therefore, this process can be considered as an "indirect" association process.
  • the base station AP After receiving the second association request, the base station AP adds the first MAC address to the second association list for subsequent maintenance.
  • the principle is similar to the previous first association list (of course, some other information, such as the assigned Association ID) is added.
  • the implementation of this part of the base station AP can also be performed based on the existing process, and will not be described here.
  • the base station AP After receiving the second association request, the base station AP replies with a second association response (Association Request), where the destination MAC address is the first MAC address. That is, for the base station AP, the presence of the relay is not perceived, and only the terminal exists. After receiving the association from the first MAC address, the associated response is also for the first MAC address.
  • Association Request the second association response
  • the order in which the relay sends the second association request to the base station AP and the sequence in which the relay sends the first association response to the WiFi terminal are not limited.
  • the label S14 in this step does not mean that the step must be located after S13.
  • WiFi frame management (Management) frames, Control (Control) frames, and Data (Data) frames The management frame is used to transmit some management signals, such as the association request, association response, etc. mentioned above.
  • Control frames are used to transmit some control signals related to data transmission, such as RTS (Request to Send), CTS (Allow to Send) and other control signals.
  • Data frames are used to transfer user data. The specifics of these frames See Figure 6 for the meaning.
  • the WiFi frame is a control frame
  • the control frame is terminated, so that the control frame is not forwarded to the base station AP, and the control frame corresponding to the sent control frame is returned to the WiFi terminal, so that the WiFi terminal receives the corresponding Sending a data frame after controlling the frame;
  • This step is an optional step.
  • the data frame can be directly sent after the association, and the control frame does not need to be sent.
  • the control frame can also be sent to better control the data sent by the WiFi terminal.
  • the purpose of the control frame interaction between the WiFi terminal and the WiFi relay is to allow the WiFi terminal to apply for the transmission permission.
  • the control frame sent by the WiFi is received, the control frame is "terminated", so that the control frame is not forwarded to the data frame, and the corresponding control frame is returned to allow the terminal to send the data frame, so that the terminal receives the data.
  • Data can be sent after the control frame of the response.
  • the WiFi frame is a data frame and the first association list stores the source MAC address in the data frame, reconstruct a new data frame that can be sent to the base station AP, where the source MAC address carried in the new data frame is the first MAC address.
  • the field of the address, the user data in the new data frame is the same as the user data in the received data frame;
  • This step can be performed after S16, and does not need to be performed after step S17.
  • step S17 it can also be executed after S17 (first request to send data frame permission through S17, and then process the received data frame).
  • the source MAC address in the data frame in the first association list indicates that the data frame is associated with the relay and needs to be processed, that is, a new data frame is reconstructed.
  • the user data in the FRAMebody field
  • the data frame carries the source MAC address.
  • the terminal sends the relay to the relay the first MAC address It is located in the Address2 field. In this embodiment, the value of this field is still not modified, that is, it is still set to the first MAC address.
  • the base station AP In order to be able to send to the base station AP (that is, the base station AP can receive and perform normal processing, no discarding occurs, and an error occurs), some other fields need to be modified in this step, for example, in the Address1 field of the data frame received from the terminal.
  • the BSSID is changed from the original BSS_2 (identification relay) to BSS_1 (identification base station), in addition, the FCS field needs to be refilled (this field It is used to verify the data frame.
  • the remaining fields can be adaptively adjusted or remain unchanged, so that the new data frame can be transmitted to the base station AP.
  • the key here is to maintain the value of the field of the first MAC address unchanged, so that after receiving the second association list, the base station AP knows that the data is sent by the associated terminal, and then processes it.
  • the final purpose of the modification of the remaining fields is to maintain the integrity of the packet and to enable the packet to be transmitted to the AP of the base station, which may be modified according to actual conditions, and details are not described herein again.
  • the base station AP determines that the second association list stores the first MAC address carried in the new data frame, it performs service processing on the user data of the WiFi terminal corresponding to the first MAC address.
  • the specific processing may be determined according to the actual application, for example, the service request corresponding to the terminal user data may be determined, and then the corresponding service data is returned to the terminal.
  • the relay saves the first MAC address of the WiFi terminal, and the relay still uses the first MAC address to initiate an association request to the base station AP, so that After receiving the base station AP, the first MAC address of the WiFi terminal is also saved, so that the WiFi is associated with the relay and the base station AP.
  • the relay terminates the control frame sent by the terminal and replies to the response to the control frame, and adaptively modifies the data frame sent by the terminal to construct a new data frame and send it to the base station AP, so that the base station AP can receive
  • the new data frame processes the user data therein, thus realizing the "perception" of the base station AP to the terminal (ie, because the base station AP has the second associated list, it can know which terminal is the data), and the base station AP
  • operators deploy them. Therefore, operators can better manage WiFi terminals (for example, IP address management, accounting, and authentication based on DHCP).
  • the application scenario of the present embodiment can still be seen in the application scenario shown in FIG. 1 , where the internal structure of the WiFi relay is as shown in FIG. 3 , which mainly includes : RFIC (Radio Frequency Integrated Circuit), baseband processor, MAC (Medium Access Controller) controller, etc., where RFIC is used to transmit and receive RF signals (such as 2.4G RF signals) of WiFi protocol (in combination with antenna); Modulating the signal, transmitting it through the RFIC, or demodulating the signal received by the RFIC, and transmitting the demodulated signal to the MAC controller (in conjunction with an analog-to-digital converter ADC or a digital-to-analog converter DAC);
  • the device is used to process the signal demodulated by the baseband processor, or the signal to be transmitted is modulated by the baseband processor and then transmitted through the RFIC.
  • it can also include RAM, flash memory, etc.
  • RAM is generally used to store data during the running of the program.
  • the frame can be cached
  • the method in this embodiment may be performed based on the relay having the hardware architecture described above.
  • the hardware unit through which each method step passes is not specifically described herein.
  • the "processing” step can be understood as follows: the relay receives (via the antenna) through the RFIC to the wireless signal carrying the "some kind of frame”, and then demodulates the signal through the baseband processor to obtain the "some kind” The frame ", then the "some kind of frame” is passed to the MAC processor, and the MAC processor performs "some processing.”
  • the relay includes two modules, one of which is used to perform the function as a terminal with respect to the base station AP.
  • This embodiment is called a "relay terminal”, and the other module is used to perform the function as an AP with respect to the WiFi terminal.
  • "Relay AP” therefore, the relay will have two MAC addresses, named MAC0 (as the terminal) and MAC_Relay AP (as the AP). These two MAC addresses can be implemented using two different The physical MAC address of the physical chip, or a physical MAC address is also used.
  • relay terminal and “relay AP” are not physically strict areas.
  • the two modules are divided into a logical division. In actual use, you can share the same hardware (such as RFIC, baseband processor, etc.).
  • relay a person skilled in the art can judge which module is completed by the signal flow direction unless otherwise specified.
  • the relay may include other processing modules in a logical sense. Of course, some or even all functions of other processing modules may be placed on the two modules. One or two of them are implemented. Therefore, the relay is not strictly logically divided below, and those skilled in the art can implement the solution in combination with the steps given in this embodiment.
  • the two terminals include a first terminal and a second terminal, which use MAC1 and MAC2 to identify the MAC addresses of the two WiFi terminals, respectively.
  • the MAC address of the base station AP is identified by the MAC_Base Station AP.
  • the association phase in this embodiment corresponds to the steps S11-S14 in the embodiment, and is mainly used to complete the association between each terminal and the relay, and the association between each terminal and the AP.
  • the relay can be performed with the base station AP.
  • Communication also associates itself with the base station AP.
  • a rectangular box labeled "WiFi Terminal" in the upper left corner is used to indicate two WiFi terminals), including:
  • the relay sends an Association request to the AP.
  • the AP associates the relay with the AP, and sends an Association request to the relay.
  • the relay After the relay is powered on, the AP scans the signal.
  • the above methods are associated, obviously, this part of the function can be completed by the relay terminal module.
  • the association request is a management frame defined by the WiFi protocol. See FIG. 5, which is a structural diagram of a WiFi frame. The meaning of the specific field is defined in the standard, and is not described here. Those skilled in the art can send different frames (such as management frames, control frames, data frames, etc.) by setting the Type and Subtype sub-segments in the FRAMe Control field to different values. See Figure 6, the meaning of each frame represented by Type and Subtype:
  • the trunk After the trunk is associated with the AP, the trunk sets its own relay wireless parameters according to the wireless parameters of the AP, and enables its own "downlink relay AP" function.
  • the relay sets the wireless parameter SSID to the same SSID as the AP (assuming all are SSID_1), and sets the BSSID from the base station AP's BSSID (such as BSSID_1) to its own BSSID (such as BSSID_2).
  • the function of relay to enable its own “downlink relay AP” means that the relay itself becomes an "AP” through the MAC processor, baseband processor and RFIC (here "AP” does not mean “base station AP” It is used to provide a WiFi signal for the terminal in the room.
  • this function of the relay is referred to as a "downlink relay AP" function.
  • the above-mentioned relays are associated with each other, and the parameters are set to enable the downlink relay AP function to be known to those skilled in the art, and details are not described herein again.
  • steps S11-S14 specifically:
  • the first terminal sends an association request to the relay, and the source MAC address carried is its own MAC address, that is, MAC1, and the destination MAC address is the MAC address of the WiFi relay.
  • the WiFi relay is a "relative to the first terminal".
  • AP therefore, the destination MAC address uses the MAC_Relay AP;
  • the relay After receiving the association request, the relay sends a first terminal reply association response, and records the MAC1 of the first terminal in the first association list, so that the first terminal can be associated with the relay; After the association request sent by the first terminal, the association request is also sent to the base station AP. At this time, the relay does not use its own MAC address (MAC0), but still uses the address MAC1 of the first terminal as the source MAC address, the destination address.
  • MAC0 MAC0
  • the step of replying the association response to the first terminal and the step of sending the association request to the base station AP by the relay are not strictly sequential, as long as the two steps can be completed;
  • the base station AP After receiving the association request sent by the relay, the base station AP adds the MAC1 to the second association list, and sends an association response to the relay to complete the association between the first terminal and the base station AP.
  • the base station AP sends the association response, the source MAC address is filled with its own MAC address (MAC_base station AP), and the destination MAC address is filled with the MAC address of the first terminal (MAC1). This is because the base station AP does not pay attention to it. Which physical device is actually sent, it will only judge which terminal to send according to the received MAC address. Since it receives MAC1, the reply is also for MAC1.
  • the base station AP does not need to be modified relative to the prior art, and the manner of adding the association list and other methods can refer to the existing base station AP processing flow.
  • the association between the first terminal and the relay and the association between the first terminal and the base station AP can be completed. Since the first terminal does not directly send a message to the base station AP, the first terminal is associated with the base station AP by "forging" an association request with the source destination address being MAC1, from a certain point of view. It can also be considered that there is a "virtual terminal” (actually, it can be regarded as a functional module corresponding to the step of "associating with the base station AP"), and the association between the virtual terminal and the base station AP is completed by the virtual terminal, and Both the virtual terminal and the actual first terminal use the MAC 1 address. Therefore, the association between the first terminal and the base station AP is completed indirectly.
  • the specific processing method is similar to that of S42, and will not be described in detail here.
  • the execution time of S43 is not to be after S42. These two steps are parallel steps, and the order of execution is not strictly sequential.
  • the MAC address (MAC2) of the second terminal is also stored in the first association list of the relay and the second association list of the base station AP, and the second terminal and the relay and the base station AP are completed. The relationship between.
  • the data frame can be sent.
  • This method is also called Point Coordination Function.
  • the terminal sends data to the AP, it sends an RTS control frame first. A CTS control frame is replied, and the terminal starts transmitting data after receiving the CTS control frame.
  • the relay when the relay receives a control frame for requesting data transmission authority from the terminal, the relay returns a corresponding control frame to the terminal to allow the terminal to send the data frame. At the same time, the relay terminates the control frames sent by these terminals, and does not allow these control frames to be transmitted to the base station AP.
  • a flow chart of data transmission based on a control frame in this embodiment includes the following steps:
  • the WiFi terminal sends an RTS control frame to the WiFi relay, requests the sending permission, and the relay returns a CTS response to the WiFi terminal, and terminates the frame, and does not pass it to the base station AP.
  • the WiFi terminal in the step here is assumed to be the second WiFi terminal mentioned above, and the MAC address is MAC2, the time source MAC address of the RTS request is MAC2, and the destination MAC address is the MAC_Relay AP.
  • the relay responds to the CTS response, the destination MAC address is MAC2.
  • the WiFi terminal After receiving the CTS reply, the WiFi terminal starts to send a data frame, and the WiFi relay responds with an ACK response and buffers the data frame.
  • the source MAC address carried in the data frame is MAC2, and the destination MAC address is MAC_Relay AP.
  • the destination MAC address in the ACK response is MAC2.
  • the relay requests the base station AP to send the data frame permission through the control frame, and also sends the RTS control frame, but the source MAC address is filled in the MAC2, and is still "forged" into the second terminal to send to the base station AP, so that the base station AP is from the MAC2.
  • the control frame of this address is processed, and after receiving by the base station AP, the ACK control frame is returned for the MAC2 address.
  • the relay obtains the sending right after receiving the ACK control frame, and after constructing the new data frame by using the method shown in step S17, sending a data frame to the base station AP (using MAC2 as the source MAC address), so that the base station AP receives the data frame.
  • the user data in the data frame is then processed.
  • the base station AP also replies to the ACK control frame, notifying that the relay has received the data frame.
  • the step of refactoring is not strictly limited to be performed in this step. In practice, it is only necessary to complete the reconstruction before sending, for example, it may be reconstructed after being cached in step S52, or may be after the RTS is sent in step S53. Start refactoring and more.
  • the key to the reconstruction is to maintain the value of the field carrying the terminal MAC address in the data frame and the user data unchanged.
  • the upper part of Figure 8 is the frame format of a received WiFi frame
  • the table in the lower part of Figure 8 is an explanation of the meaning of the Address bit.
  • a data frame When a data frame is sent from a terminal to a relay, when the terminal constructs a data frame, it selects which field to carry its own source MAC address according to the sending direction (defined by To DS and From DS conditions), for example, when the direction is When the terminal sends the relay to the relay (To DS is 1 and From DS is 0), the terminal records its own MAC address in the Address2 field, and the To DS is 1 in the meaning table of the Address bit in the lower part of Figure 8.
  • the value of TA under the condition that From DS is 0 is the terminal MAC address, such as MAC1 or MAC2.
  • the relay When the relay receives the data frame to reconstruct a new data frame, the sending direction of the new data frame is relayed to the base station AP.
  • the address is still in the meaning of the Address bit table. From DS is a 0" transmission scenario.
  • the relay keeps the TA value in Address2 unchanged (still the terminal's MAC address, such as MAC1 or MAC2), and keeps the user data unchanged (the FRAMe Body field is used here to carry user data, therefore, the FRAMe Body field The value is unchanged, and the remaining values are adaptively modified so that the new data frame can be sent to the base station AP.
  • the RA value in Address1 is changed from the original BSS_2 (originally identified to the relay) to BSS_1 (now identified) Send to the base station AP); and recalculate the value of the FCS (ie, the check value).
  • FCS ie, the check value
  • this embodiment provides a method for how a relay processes a data frame sent by a base station AP. Referring to FIG. 9, the following steps are included:
  • the base station AP After the base station AP processes the message from the terminal, it can reply to a data frame. Since the base station AP directly "perceives" the WiFi terminal, the destination MAC address is the first MAC address, and the first MAC address in this embodiment. The meaning of "address" is the same as in the first embodiment.
  • the data frame sent by the relay processing base station AP is similar to the processing method of processing the data frame sent by the WiFi terminal, and is also constructed to construct a new data frame. Since this frame is to be forwarded to the WiFi terminal, when constructing the frame, the purpose is The MAC address is to be filled with the MAC address of the WiFi terminal, and the user data is kept unchanged. For the changes of the remaining fields (such as BSSID, FCS), refer to the description of the previous embodiment, and details are not described herein again.
  • the data sent by the base station AP can be transmitted to the WiFi terminal.
  • a flow diagram for obtaining a transmission right by using a control frame, and then transmitting a data frame includes the following steps:
  • the base station AP applies for sending permission by using each WiFi relay of the control frame.
  • the application is made through the RTS control frame, and the relay sends a CTS control frame to indicate the consent.
  • the destination MAC address used in the base station AP control frame is the MAC address of the target WiFi terminal (4 is set as the second terminal in the second embodiment, and the MAC address is MAC2);
  • the base station AP sends a data frame to the WiFi relay, and the relay responds to the response, and buffers the data frame.
  • the relay requests a sending permission to the WiFi terminal by using a control frame.
  • the source MAC address is the relay's own MAC address.
  • the MAC_Relay AP (which is an AP with respect to the terminal) is used
  • the destination MAC address is the MAC address of the WiFi terminal, that is, M AC2.
  • the relay After obtaining the transmission permission, the relay reconstructs a new data frame and sends it to the WiFi terminal.
  • the source MAC address is the MAC address of the "Relay AP" (MAC-Relay AP), and the destination MAC address is the MAC address (MAC2) of the WiFi terminal.
  • the WiFi terminal can also receive the response sent by the base station AP through the processing of the relay, thereby implementing data transmission between the WiFi terminal and the base station AP.
  • Embodiment 4
  • the present embodiment provides an apparatus for processing a WiFi frame, which is applied to a WiFi relay, where the WiFi relay is used to connect a WiFi terminal and a base station access point AP.
  • the device 110 is provided. Includes:
  • a first association request receiving unit 111 configured to receive a first association request sent by the WiFi terminal, where a source MAC address carried in the first association request is a first MAC address of the WiFi terminal, and a storage unit 112, configured to: The first MAC address in the first association request received by the first association request receiving unit 111 is stored in the first association list;
  • a first association response sending unit 113 configured to receive by the first association request receiving unit 111 After the first association request, sending a first association response to the WiFi terminal, thereby completing an association between the WiFi terminal and the WiFi relay;
  • the second association request sending unit 114 is configured to: after the first association request receiving unit 111 receives the first association request, send a second association request to the base station AP, where the second association request carries the source
  • the MAC address is the first MAC address, so that the base station AP acquires the first MAC address after receiving the second association request, and stores the first MAC address, and stores the information in the second association list.
  • the second association response receiving unit 115 is configured to receive the second association response, so as to complete an association between the WiFi terminal and the base station AP.
  • the WiFi frame receiving unit 116 is configured to receive the WiFi frame sent by the WiFi terminal, and the first constructing unit 117 is configured to: when the WiFi frame received by the WiFi frame receiving unit 116 is a data frame, and the first associated list is stored Reconstructing a new data frame that can be sent to the base station AP, where the source MAC address carried in the new data frame is a field of the first MAC address, the new The user data in the data frame is the same as the user data in the received data frame;
  • the data frame sending unit 118 is configured to send the new data frame constructed by the first building unit 117 to the base station AP, so that the base station AP receives the new data frame and determines that the second associated list is stored. After the first MAC address carried by the new data frame, the user data of the WiFi terminal corresponding to the first MAC address is processed.
  • the first building unit may include a BSSID modifying unit 1171, configured to modify a value of a BSSID field of an original data frame when the new data frame is constructed, and identify the WiFi data by the original The subsequent BSSID value is changed to identify the BSSID value of the base station AP.
  • a BSSID modifying unit 1171 configured to modify a value of a BSSID field of an original data frame when the new data frame is constructed, and identify the WiFi data by the original
  • the subsequent BSSID value is changed to identify the BSSID value of the base station AP.
  • the embodiment may further include:
  • a second data frame receiving unit 119 configured to receive a second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address; a second constructing unit 120, configured to: when determining, according to the first association list, that the first MAC address in the second frame received by the second data frame receiving unit 119 is located in the first association list Reconstructing a new second data frame that can be sent to the WiFi terminal, where the destination MAC address carried in the new second data frame is a field of the first MAC address, and user data in the new data frame And the user data in the received second data frame;
  • a second data frame sending unit 121 configured to send the new second data frame constructed by the second building unit to the WiFi terminal, so that the WiFi terminal acquires the new second data frame User data.
  • the control frame processing unit 122 is configured to: when the received WiFi frame sent by the WiFi terminal is a control frame, terminate the control frame, so that the control frame is not forwarded to the base station AP, and Responding to the control frame corresponding to the sent control frame by the WiFi terminal, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
  • the control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol; and the control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol.
  • RTS control frame defined by the WiFi protocol
  • CTS control frame defined by the WiFi protocol
  • the association between the terminal and the relay and the base station AP is implemented by using the relay, so that the base station AP can "see" ("perceive") the terminal, and after the association, the relay can utilize the new data frame.
  • the method transmits the data sent by the terminal to the base station AP, so that the base station AP can process the data after receiving the data.
  • the base station AP is generally deployed by the operator, so the operator can achieve better management of the terminal.
  • This embodiment provides a WiFi relay, which is used to connect a WiFi terminal and a base station AP.
  • Figure 13 includes a processor 131 and a memory 132;
  • the memory 132 is configured to store program instructions
  • the processor 131 is configured to read and execute program instructions stored in the memory, wherein when the program instructions stored in the memory 132 are read and executed by the processor, performing the following steps :
  • the WiFi frame is a data frame and the first association list stores a source MAC address in the data frame
  • the source MAC address is a field of the first MAC address
  • the user data in the new data frame is the same as the user data in the received data frame
  • the user data of the WiFi terminal corresponding to the first MAC address performs service processing.
  • the method further includes the following steps: receiving a second data frame sent by the base station AP, and the destination carried in the second data frame
  • the MAC address is the first MAC address
  • the first MAC address is located in the first association list according to the first association list
  • the destination MAC address is a field of the first MAC address
  • the user data in the new data frame is the user data in the received second data frame
  • the control frame is terminated, so that the control frame is not forwarded to the base station AP, and is replied to the WiFi terminal. And a control frame corresponding to the sent control frame, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
  • control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol
  • control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol.
  • the value of the BSSID field of the original data frame is modified, and the BSSID value originally identifying the WiFi relay is changed to the BSSID value of the base station AP.
  • FIG. 13 is a schematic diagram of a trunking structure of a relay according to an embodiment of the present invention.
  • the processor in this embodiment may be the MAC controller in FIG. 3 or other processors having similar processing capabilities.
  • the memory in this embodiment may be the flash memory in FIG. 3 and the frame buffer RAM or other similar storage medium.
  • the processor can send and receive WiFi frames through physical layer processing devices (such as baseband processors, RFICs, antennas, etc.), and some of the techniques are those skilled in the art.
  • the well-known techniques are not described in detail in this embodiment.
  • the program may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, and when executed, the program may include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Abstract

Disclosed are a method and apparatus for processing a WiFi frame. The method is applied to a WiFi relay, comprising: associating a WiFi terminal with a relay by receiving a WiFi terminal association request, and meanwhile, the relay sending the association request to a base station AP by using a MAC address of the terminal so as to associate the terminal with the base station AP; when a received WiFi frame sent by the terminal is a data frame and a first association list stores a source MAC address in the data frame, rebuilding a new data frame which can be sent to the base station AP, wherein the source MAC address carried in the new data frame is a field of a first MAC address, and the user data in the new data frame is the same as the user data in the received data frame; and sending a new data frame to the base station AP, and after the base station AP receives the new data frame and judges that a second association list stores a first MAC address carried in the new data frame, performing service processing on the user data of the terminal corresponding to the first MAC address. The present embodiment enables the AP side of a base station to sense a terminal, so as to realize better management of the terminal.

Description

一种处理 WiFi帧的方法及装置 技术领域  Method and device for processing WiFi frame
本发明涉及通信技术领域, 尤其涉及一种处理 WiFi帧的方法及装置。 背景技术  The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for processing a WiFi frame. Background technique
随着 WiFi热点的普及, 运营商逐步开始将 WLAN作为一张单独的网络 进行建设, 并开始大规模部署室外接入点 (基站 AP, Access Point ), 通过室 外基站 AP实现对室内的 WLAN覆盖。  With the popularity of WiFi hotspots, operators gradually began to build WLANs as a single network, and began to deploy large-scale outdoor access points (APs, Access Point) to achieve indoor WLAN coverage through the outdoor base station AP.
由于距离、 干扰等原因, 室外基站 AP传到室内的 WiFi信号很多情况下 都比较弱,此时,可以在室内与室外的交界处(如窗边)安装一个 WiFi中继, 如图 1所示, WiFi中继接收室外的 WiFi信号, 并进行解调再生后向室内发 送, 从而可以让室内的 WiFi终端接收到比较强的 WiFi信号。 当然, WiFi中 继也可以安装在室内, 以实现室内的 WiFi信号增强。 这里的 WiFi终端是指 有 WiFi功能的终端, 如带 WiFi功能的手机、 笔记本、 平板电脑等。  Due to distance, interference, etc., the WiFi signal transmitted by the outdoor base station AP to the indoor is weak in many cases. At this time, a WiFi relay can be installed at the junction between the indoor and outdoor (such as the window), as shown in Figure 1. The WiFi relay receives the outdoor WiFi signal, and performs demodulation and regeneration to send to the indoor, so that the indoor WiFi terminal can receive a relatively strong WiFi signal. Of course, the WiFi relay can also be installed indoors to achieve indoor WiFi signal enhancement. The WiFi terminal here refers to a WiFi-enabled terminal, such as a WiFi-enabled mobile phone, a notebook, a tablet, and the like.
现有方案中, 基站 AP只能感知到 WiFi中继, WiFi终端对于基站 AP来 说来说是不可见的, 基站 AP并不能感知 WiFi终端的存在, 因此, 对于运营 商来说, 并不能很好地实现对 WiFi 终端的管理(如基于动态主机配置协议 DHCP进行 IP地址管理、 计费、 认证等操作)。 发明内容  In the existing solution, the base station AP can only perceive the WiFi relay, and the WiFi terminal is invisible to the base station AP, and the base station AP cannot sense the existence of the WiFi terminal. Therefore, for the operator, it cannot be very Good management of the WiFi terminal (such as IP address management, accounting, authentication, etc. based on Dynamic Host Configuration Protocol DHCP). Summary of the invention
本发明实施例提供一种 WiFi中继处理 WiFi帧的方法, 用于解决现有技 术存在着的运营商无法很好地对 WiFi终端进行管理的问题。  The embodiment of the invention provides a method for processing a WiFi frame by using a WiFi relay, which is used to solve the problem that the operator cannot manage the WiFi terminal well.
第一方面, 本实施例提供了一种处理 WiFi帧方法, 应用于 WiFi中继, 所述 WiFi中继用于实现 WiFi终端以及基站接入点 AP之间的通信, 该方法 包括: 接收 WiFi终端发送的第一关联请求,所述第一关联请求中携带的源 Mac 地址为所述 WiFi终端的第一 MAC地址; In a first aspect, the embodiment provides a method for processing a WiFi frame, which is applied to a WiFi relay, where the WiFi relay is used to implement communication between a WiFi terminal and a base station access point AP, and the method includes: Receiving a first association request sent by the WiFi terminal, where the source MAC address carried in the first association request is the first MAC address of the WiFi terminal;
存储所述第一 MAC地址到第一关联列表;  And storing the first MAC address to the first association list;
向所述 WiFi终端发送第一关联响应,从而完成所述 WiFi终端与所述 WiFi 中继之间的关联;  Transmitting a first association response to the WiFi terminal, thereby completing an association between the WiFi terminal and the WiFi relay;
向所述基站 AP发送第二关联请求,所述第二关联请求携带的源 MAC地 址为所述第一 MAC地址,使得所述基站 AP收到所述第二关联请求后获取所 述第一 MAC地址, 并存储到第二关联列表; 并且, 使得所述基站 AP收到所 述第二关联请求后回复第二关联响应,所述第二响应请求中携带的目的 MAC 地址为所述第一 MAC地址;  Sending a second association request to the base station AP, where the source MAC address carried by the second association request is the first MAC address, so that the base station AP acquires the first MAC after receiving the second association request An address is stored in the second association list; and the base station AP is configured to reply to the second association response after receiving the second association request, where the destination MAC address carried in the second response request is the first MAC address. Address
接收所述第二关联响应, 从而完成所述 WiFi终端与所述基站 AP之间的 关联;  Receiving the second association response, thereby completing an association between the WiFi terminal and the base station AP;
接收所述 WiFi终端发送的 WiFi帧;  Receiving a WiFi frame sent by the WiFi terminal;
当所述 WiFi 帧为数据帧且所述第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构建一个能发送到所述基站 AP的新数据帧, 所述新数据 帧中携带的源 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用 户数据与收到的数据帧中的用户数据相同;  When the WiFi frame is a data frame and the first association list stores a source MAC address in the data frame, reconstruct a new data frame that can be sent to the base station AP, where the new data frame carries The source MAC address is a field of the first MAC address, and the user data in the new data frame is the same as the user data in the received data frame;
向所述基站 AP发送所述新数据帧,使得所述基站 AP收到所述新数据帧 且判断所述第二关联列表存储有所述新数据帧携带的第一 MAC地址后, 对 与所述第一 MAC地址对应的所述 WiFi终端的用户数据进行业务处理。  Sending the new data frame to the base station AP, so that the base station AP receives the new data frame and determines that the second association list stores the first MAC address carried by the new data frame, The user data of the WiFi terminal corresponding to the first MAC address performs service processing.
在第一方面的第一种可能的实现方式中, 还包括:  In a first possible implementation manner of the first aspect, the method further includes:
接收所述基站 AP 发送的第二数据帧, 所述第二数据帧中携带的目的 MAC地址为所述第一 MAC地址;  Receiving a second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address;
当根据所述第一关联列表判断所述第一 MAC地址位于所述第一关联列 表时, 重新构建一个能发送到所述 WiFi终端的新第二数据帧, 所述新第二数 据帧中携带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据帧中 的用户数据为与收到的所述第二数据帧中的用户数据; When it is determined that the first MAC address is located in the first association list according to the first association list, reconstruct a new second data frame that can be sent to the WiFi terminal, where the new second data frame is carried The destination MAC address is a field of the first MAC address, in the new data frame User data is the user data in the received second data frame;
向所述 WiFi终端发送所述新第二数据帧, 使得所述 WiFi终端收到所述 新第二数据帧后获取里面的用户数据。  Sending the new second data frame to the WiFi terminal, so that the WiFi terminal acquires the user data in the new second data frame.
结合第一方面以及第一方面的第一种可能的实现形式, 第二种可能的实 现形式还包括:  In conjunction with the first aspect and the first possible implementation of the first aspect, the second possible implementation form further includes:
当接收到的所述 WiFi终端发送的所述 WiFi帧为控制帧时, 将所述控制 帧进行终结,使得所述控制帧不被转发给所述基站 AP,并且回复给所述 WiFi 终端与发送的控制帧对应的控制帧,使得所述 WiFi终端收到所述对应的控制 帧后发送所述数据帧。  When the received WiFi frame sent by the WiFi terminal is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and is sent back to the WiFi terminal and sent Control frame corresponding to the control frame, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
结合第一方面的第二种可能的实现形式, 第三种可能的实现形式中: 所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制帧;  With reference to the second possible implementation of the first aspect, in a third possible implementation, the control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol;
所述与发送的控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧。 结合第一方面以及第一方面的任意一种可能的实现形式, 第四种可能的 实现形式中: 所述重新构建一个能发送到所述基站 AP的新数据帧包括: 构建所述新数据帧时, 修改原来的数据帧的 BSSID字段的值, 将其由原 来标识所述 WiFi中继的 BSSID值改为标识所述基站 AP的 BSSID值。 第二方面, 本实施例提供了一种 WiFi帧处理装置, 应用于 WiFi中继, 所述 WiFi中继用于实现 WiFi终端以及基站接入点 AP之间的通信, 所述装 置包括:  The control frame corresponding to the transmitted control frame is a CTS control frame defined by the WiFi protocol. With reference to the first aspect and any possible implementation form of the first aspect, in a fourth possible implementation form, the reconfiguring a new data frame that can be sent to the base station AP includes: constructing the new data frame At the same time, the value of the BSSID field of the original data frame is modified, and the BSSID value originally identifying the WiFi relay is changed to the BSSID value of the base station AP. In a second aspect, the present embodiment provides a WiFi frame processing apparatus, which is applied to a WiFi relay, where the WiFi relay is used to implement communication between a WiFi terminal and a base station access point AP, and the apparatus includes:
第一关联请求接收单元, 用于接收 WiFi终端发送的第一关联请求, 所述 第一关联请求中携带的源 Mac地址为所述 WiFi终端的第一 MAC地址;  a first association request receiving unit, configured to receive a first association request sent by the WiFi terminal, where a source MAC address carried in the first association request is a first MAC address of the WiFi terminal;
存储单元, 用于将所述第一关联请求接收单元接收到的所述第一关联请 求中的第一 MAC地址存储到所述第一关联列表;  a storage unit, configured to store, by the first association request receiving unit, the first MAC address in the first association request to the first association list;
第一关联响应发送单元, 用于所述第一关联请求接收单元接收到所述第 一关联请求后, 向所述 WiFi终端发送第一关联响应, 从而完成所述 WiFi终 端与所述 WiFi中继之间的关联; a first association response sending unit, configured to send the first association response to the WiFi terminal after the first association request receiving unit receives the first association request, thereby completing the WiFi termination The association between the end and the WiFi relay;
第二关联请求发送单元, 用于在所述第一关联请求接收单元接收到所述 第一关联请求后, 向所述基站 AP发送第二关联请求, 所述第二关联请求携 带的源 MAC地址为所述第一 MAC地址, 使得所述基站 AP收到所述第二关 联请求后获取所述第一 MAC地址, 并存储到第二关联列表; 并且, 使得所 述基站 AP收到所述第二关联请求后回复第二关联响应, 所述第二响应请求 中携带的目的 MAC地址为所述第一 MAC地址;  a second association request sending unit, configured to send, after the first association request receiving unit receives the first association request, a second association request to the base station AP, where the source MAC address carried by the second association request For the first MAC address, the base station AP acquires the first MAC address after receiving the second association request, and stores the first MAC address, and stores the first MAC address to the second association list. Responding to the second association response after the second association request, where the destination MAC address carried in the second response request is the first MAC address;
第二关联响应接收单元,用于接收所述第二关联响应,从而完成所述 WiFi 终端与所述基站 AP之间的关联;  a second association response receiving unit, configured to receive the second association response, to complete an association between the WiFi terminal and the base station AP;
WiFi帧接收单元, 用于接收所述 WiFi终端发送的 WiFi帧;  a WiFi frame receiving unit, configured to receive a WiFi frame sent by the WiFi terminal;
第一构建单元, 用于当所述 WiFi帧接收单元接收的 WiFi帧为数据帧且 所述第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构建一个能 发送到所述基站 AP的新数据帧,所述新数据帧中携带的源 MAC地址为所述 第一 MAC地址的字段, 所述新数据帧中的用户数据与收到的数据帧中的用 户数据相同;  a first constructing unit, configured to: when the WiFi frame received by the WiFi frame receiving unit is a data frame, and the first association list stores a source MAC address in the data frame, reconstruct a device that can be sent to the base station a new data frame of the AP, where the source MAC address carried in the new data frame is a field of the first MAC address, and user data in the new data frame is the same as user data in the received data frame;
数据帧发送单元, 用于向所述基站 AP发送所述第一构建单元构建的所 述新数据帧, 使得所述基站 AP收到所述新数据帧且判断所述第二关联列表 存储有所述新数据帧携带的第一 MAC地址后,对与所述第一 MAC地址对应 的所述 WiFi终端的用户数据进行业务处理。  a data frame sending unit, configured to send the new data frame constructed by the first building unit to the base station AP, so that the base station AP receives the new data frame and determines that the second associated list is stored After the first MAC address carried in the new data frame, the user data of the WiFi terminal corresponding to the first MAC address is processed.
在第二个方面第一种可能的实现方式中, 该装置还包括:  In a first possible implementation of the second aspect, the apparatus further includes:
第二数据帧接收单元, 用于接收所述基站 AP发送的第二数据帧, 所述 第二数据帧中携带的目的 MAC地址为所述第一 MAC地址;  a second data frame receiving unit, configured to receive a second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address;
第二构建单元, 用于当根据所述第一关联列表判断所述第二数据帧接收 单元接收到的所述第二帧中的所述第一 MAC地址位于所述第一关联列表时, 重新构建一个能发送到所述 WiFi终端的新第二数据帧,所述新第二数据帧中 携带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用户 数据为与收到的所述第二数据帧中的用户数据; a second constructing unit, configured to: when determining, according to the first association list, that the first MAC address in the second frame received by the second data frame receiving unit is located in the first association list, Constructing a new second data frame that can be sent to the WiFi terminal, where the destination MAC address carried in the new second data frame is a field of the first MAC address, and the user in the new data frame The data is the user data in the received second data frame;
第二数据帧发送单元,用于向所述 WiFi终端发送所述第二构建单元构建 的所述新第二数据帧,使得所述 WiFi终端收到所述新第二数据帧后获取里面 的用户数据。  a second data frame sending unit, configured to send the new second data frame constructed by the second building unit to the WiFi terminal, so that the WiFi terminal acquires the user inside after receiving the new second data frame data.
结合第二个方面以及第二个方面的第一种可能实现形式, 在第二种可能 的实现形式中, 还包括: 控制帧处理单元, 用于当接收到的所述 WiFi终端发 送的所述 WiFi帧为控制帧时, 将所述控制帧进行终结, 使得所述控制帧不被 转发给所述基站 AP, 并且回复给所述 WiFi终端与发送的控制帧对应的控制 帧, 使得所述 WiFi终端收到所述对应的控制帧后发送所述数据帧。  With reference to the second aspect, and the first possible implementation form of the second aspect, in a second possible implementation, the method further includes: a control frame processing unit, configured to: when the received WiFi terminal sends the When the WiFi frame is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and the control frame corresponding to the sent control frame is returned to the WiFi terminal, so that the WiFi is enabled. After receiving the corresponding control frame, the terminal sends the data frame.
结合第二个方面的第二种可能实现形式, 在第三种可能的实现形式中, 所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制帧; 所述与发送的 控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧。  With reference to the second possible implementation of the second aspect, in a third possible implementation, the control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol; and the control corresponding to the sent control frame The frame is a CTS control frame defined by the WiFi protocol.
结合第二个方面以及第二个方面的任意一种可能实现形式, 在第四种可 能的实现形式中, 所述第一构建单元包括 BSSID修改单元, 用于构建所述新 数据帧时,修改原来的数据帧的 BSSID字段的值,将其由原来标识所述 WiFi 中继的 BSSID值改为标识所述基站 AP的 BSSID值。  With reference to the second aspect, and any one possible implementation form of the second aspect, in a fourth possible implementation, the first building unit includes a BSSID modifying unit, configured to modify when constructing the new data frame The value of the BSSID field of the original data frame is changed from the BSSID value originally identifying the WiFi relay to the BSSID value identifying the base station AP.
本实施例中, WiFi终端 (对应第一 MAC地址)发起关联请求后, 中继 保存了 WiFi终端的第一 MAC地址, 并且, 中继还仍然使用第一 MAC地址 向基站 AP发起关联请求,使得基站 AP收到后也保存 WiFi终端的第一 MAC 地址, 从而使得 WiFi与中继以及基站 AP都进行了关联。 在关联后, 中继对 终端发送的控制帧进行终结并回复针对控制帧的响应, 对终端发送的数据帧 进行适应性修改后构建一个新的数据帧发送给基站 AP, 使得基站 AP能够收 到新数据帧并对里面的用户数据进行处理, 这样, 就实现了基站 AP对终端 的 "感知" (即由于基站 AP有第二关联列表, 就可以知道是哪个终端来的数 据), 而基站 AP—般都是运营商进行部署的, 因此, 运营商就可以对 WiFi 终端进行更好的管理(例如, 基于 DHCP进行 IP地址管理, 计费, 认证等操 作)。 附图说明 In this embodiment, after the WiFi terminal (corresponding to the first MAC address) initiates the association request, the relay saves the first MAC address of the WiFi terminal, and the relay still uses the first MAC address to initiate an association request to the base station AP, so that After receiving the base station AP, the first MAC address of the WiFi terminal is also saved, so that the WiFi is associated with the relay and the base station AP. After the association, the relay terminates the control frame sent by the terminal and replies to the response to the control frame, and adaptively modifies the data frame sent by the terminal to construct a new data frame and send it to the base station AP, so that the base station AP can receive The new data frame processes the user data therein, thus realizing the "perception" of the base station AP to the terminal (ie, because the base station AP has the second associated list, it can know which terminal is the data), and the base station AP Generally, operators deploy them. Therefore, operators can better manage WiFi terminals (for example, IP address management, accounting, authentication, etc. based on DHCP). Made). DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附 图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创 造性劳动的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are merely the present invention. Some of the embodiments can be obtained by those skilled in the art from the drawings without any creative work.
图 1为现有技术 WiFi终端基于 WiFi中继与基站 AP进行通信的示意图; 图 2为实施例一中继处理 WiFi帧的流程示意图;  1 is a schematic diagram of communication between a WiFi terminal and a base station AP based on a WiFi relay; FIG. 2 is a schematic flowchart of a relay processing a WiFi frame according to Embodiment 1;
图 3为实施例二中继的一个结构示意图;  3 is a schematic structural diagram of a relay of Embodiment 2;
图 4为实施例二 WiFi终端与中继以及基站 AP进行关联的示意图; 图 5为 WiFi帧的结构示意图;  4 is a schematic diagram of a WiFi terminal associated with a relay and a base station AP; FIG. 5 is a schematic structural diagram of a WiFi frame;
图 6为 WiFi帧中各字段与帧类型之间的对应关系的示意图;  6 is a schematic diagram of correspondence between fields and frame types in a WiFi frame;
图 7为通过控制帧申请权限后发送数据帧的示意图;  7 is a schematic diagram of sending a data frame after requesting permission by a control frame;
图 8构建新数据帧时的示意图;  Figure 8 is a schematic diagram of a new data frame;
图 9为实施例三中继将基站 AP发送的数据转发给 WiFi终端的流程示意 图;  FIG. 9 is a schematic flow chart of the third embodiment relaying data sent by the base station AP to the WiFi terminal;
图 10为实施例三基站 AP通过控制帧发送数据帧的流程示意图; 图 11为实施例四 WiFi帧处理装置的结构示意图;  10 is a schematic flowchart of a third embodiment of a base station AP transmitting a data frame through a control frame; FIG. 11 is a schematic structural diagram of a WiFi frame processing apparatus according to Embodiment 4;
图 12为实施例四 WiFi帧处理装置的另一结构示意图;  12 is another schematic structural diagram of a WiFi frame processing apparatus according to Embodiment 4;
图 13为实施例五 WiFi中继结构示意图。 具体实施方式  FIG. 13 is a schematic diagram of a fifth embodiment of a WiFi relay structure. detailed description
为使本发明的目的、 技术方案及优点更加清楚明白, 以下将通过具体实 施例和相关附图, 对本发明作进一步详细说明。  In order to make the objects, the technical solutions and the advantages of the present invention more comprehensible, the present invention will be further described in detail by the specific embodiments and the accompanying drawings.
实施例一 本发明实施例提供了一种 WiFi中继处理 WiFi帧的方法,这里针对 WiFi 中继的应用场景可以参考图 1所示的应用场景, WiFi中继用于解调再生基站 接入点 (Access Point, AP ) 的信号以供室内的各种 WiFi终端使用, 下文为 了说明方便, 也将 "基站 AP"筒称为 "AP" , 将 "WiFi中继"筒称为 "中继", 将 "WiFi终端" 筒称为 "终端"。 Embodiment 1 The embodiment of the present invention provides a method for processing a WiFi frame by using a WiFi relay. The application scenario of the WiFi relay may be referred to the application scenario shown in FIG. 1 , and the WiFi relay is used to demodulate the access point of the regenerated base station (Access Point). , AP ) signals are used by various WiFi terminals in the room. For convenience of explanation, the "base station AP" cartridge is also referred to as "AP", and the "WiFi relay" cartridge is referred to as "relay". The terminal "cartridge" is called "terminal".
WiFi中继在搜索到基站 AP发送的 WiFi信号后进行中继处理(解调再生 并发送 WiFi信号)后, 使得终端能够获得更强的 WiFi信号。 基站 AP发送 的 WiFi信号用一个 SSID ( Service Set Identifier, 服务集标识 )来表示, 假设 这里使用 SSID_1 , 同时,这个用 SSID_1标识的 WiFi信号还会有一个 BSSID 标识来标识提供 WiFi信号的设备,假设这里用 BSS_1来标识是基站 AP提供 了这个信号。 当中继对 WiFi信号进行中继处理后, 中继发送的 WiFi信号的 SSID仍然为 SSID_1,但 BSSID变为 WiFi中继的对应的标识(假设是 BSS_2 )。 以上中继如何进行信号中继的具体技术实现为本领域技术人员所公知的技 术, 这里不再赘述。  After the WiFi relay searches for the WiFi signal sent by the base station AP and performs relay processing (demodulation and regeneration and transmitting the WiFi signal), the terminal can obtain a stronger WiFi signal. The WiFi signal sent by the base station AP is represented by an SSID (Service Set Identifier), assuming that SSID_1 is used here, and the WiFi signal identified by SSID_1 also has a BSSID identifier to identify the device providing the WiFi signal, assuming Here BSS_1 is used to identify that the base station AP provides this signal. When the relay relays the WiFi signal, the SSID of the WiFi signal sent by the relay is still SSID_1, but the BSSID becomes the corresponding identifier of the WiFi relay (assumed to be BSS_2). The specific technology of how the above relay performs signal relay is implemented by those skilled in the art, and details are not described herein.
具体的, 本实施例提供了一种 WiFi 中继处理 WiFi 帧的方法, 应用于 WiFi中继, 参见图 2, 该方法包括如下步骤:  Specifically, the embodiment provides a method for processing a WiFi frame by using a WiFi relay, which is applied to a WiFi relay. Referring to FIG. 2, the method includes the following steps:
S11、 接收 WiFi终端发送的第一关联请求( Association request ), 第一关 联请求中携带的源 Mac地址为 WiFi终端的第一 MAC地址;  S11. Receive a first association request (Association request) sent by the WiFi terminal, where the source MAC address carried in the first association request is a first MAC address of the WiFi terminal;
关联请求为 WiFi协议定义的一个请求, 这里加了前缀 "第一,,用于与后 续出现的其他 "关联请求" 进行区分, 后续其他加前缀的(如 "第二")的关 联请求也跟这里的关联请求类似, 只是发送的主体及对象不一样。 同理, 这 种序号前缀也用于对其他名词 (如 MAC地址)进行类似的限定, 后续不再 详细描述。  The association request is a request defined by the WiFi protocol, and the prefix "first" is used to distinguish it from other "association requests" that appear later, and subsequent other prefixed (such as "second") association requests are also followed. The association request here is similar, except that the sender and the object are different. Similarly, the sequence number prefix is also used to similarly define other nouns (such as MAC addresses), and will not be described in detail later.
关联请求中会携带一个设备的源 MAC地址以及目的 MAC地址,假设是 终端发往中继,那么源 MAC地址就是终端的 MAC地址,这里用 "第一 MAC 地址" 来表示, 目的 MAC地址即为中继的 MAC地址, 本步骤中并不需要对 目的 MAC地址进行特殊处理, 仍然填要发送的目的设备(如在步骤中是中 继 ) 的 MAC地址即可。 The association request carries the source MAC address and the destination MAC address of a device. If the terminal sends the packet to the relay, the source MAC address is the MAC address of the terminal. Here, the first MAC address is used to represent the destination MAC address. The MAC address of the relay, which is not required in this step. The destination MAC address is specially processed, and the MAC address of the destination device to be sent (such as the relay in the step) is still filled.
S12、 存储所述第一 MAC地址到第一关联列表;  S12. Store the first MAC address to the first association list.
中继收到关联请求后, 将与终端对应的第一 MAC地址保存到第一关联 列表。 这里的第一关联列表是个逻辑上的概念, 具体实现形式并不限定, 例 如, 在物理上, 也可以理解为一个物理存储区, 存储了第一 MAC地址。 实 际当中, 中继会收到多个终端的关联请求, 这样的话这个表会包括一个或多 个 WiFi终端的 MAC地址。 关联列表的作用是用于让中继知道哪些设备是自 己需要维护的, 如果收到的一些终端发送的 WiFi帧中的源 MAC地址并不在 自己的关联列表中, 则说明这些终端并没有与自己进行关联, 那么直接丟弃 这些帧即可。 实际当中, 关联列表还会有其他跟终端有关的信息 (如分配的 Association ID ), 本实施例仍然延用这些信息, 并不进行爹改。  After receiving the association request, the relay saves the first MAC address corresponding to the terminal to the first association list. The first association list is a logical concept. The specific implementation is not limited. For example, physically, it can also be understood as a physical storage area, and the first MAC address is stored. In practice, the relay will receive an association request from multiple terminals, so that the table will include the MAC address of one or more WiFi terminals. The role of the association list is to let the relay know which devices need to be maintained. If the source MAC addresses in the WiFi frames sent by some terminals are not in their own association list, then the terminals do not have their own. To associate, then discard these frames directly. In practice, the association list also has other terminal-related information (such as the assigned Association ID). This embodiment still uses the information and does not tamper with it.
513、 向 WiFi终端发送第一关联响应, 从而完成 WiFi终端与 WiFi中继 之间的关联;  513. Send a first association response to the WiFi terminal, so as to complete an association between the WiFi terminal and the WiFi relay.
WiFi终端收到关联响应后,表示 WiFi终端已经与 WiFi中继进行了关联, 后续 WiFi中继就会对 WiFi终端来的数据进行处理。  After receiving the association response, the WiFi terminal indicates that the WiFi terminal has been associated with the WiFi relay, and the subsequent WiFi relay processes the data from the WiFi terminal.
514、 向基站 AP发送第二关联请求, 第二关联请求携带的源 MAC地址 为第一 MAC地址, 使得基站 AP收到第二关联请求后获取第一 MAC地址, 并存储到第二关联列表; 并且, 使得基站 AP收到第二关联请求后回复第二 关联响应, 第二响应请求中携带的目的 MAC地址为第一 MAC地址;  514. Send a second association request to the base station AP, where the source MAC address carried by the second association request is the first MAC address, so that the base station AP obtains the first MAC address after receiving the second association request, and stores the first MAC address in the second association list. And causing the base station AP to reply to the second association response after receiving the second association request, where the destination MAC address carried in the second response request is the first MAC address;
中继收到第一关联请求后, 向基站 AP发送第二关联请求, 将第二关联 请求中的源 MAC地址设为第一 MAC地址, 目的 MAC地址这里并不改动, 还是真实的目标设备的地址, 也即基站 AP的地址。  After receiving the first association request, the relay sends a second association request to the base station AP, and sets the source MAC address in the second association request as the first MAC address, and the destination MAC address does not change here, or is the real target device. Address, which is the address of the base station AP.
基站 AP在收到第二关联请求后, 由于看到的源 MAC地址是第一 MAC 地址, 因此, 在基站 AP看来, 这个关联请求是第一 MAC地址标识的终端发 的, 这样就可以将终端与基站 AP进行关联。 中继在这个过程当中相当于 "伪 造" 了源 MAC地址(正常来说由于是从中继发到基站 AP, 源 MAC地址应 该是中继的 MAC地址 ),让基站 AP收到第二关联请求后认为是终端发送的。 由于这个过程并非终端直接向基站 AP发起关联请求完成, 而是通过中继来 来完成, 因此, 这个过程可认为是个 "间接" 的关联过程。 After receiving the second association request, the base station AP is the first MAC address because the source MAC address is seen. Therefore, in the view of the base station AP, the association request is sent by the terminal identified by the first MAC address, so that the base station AP can The terminal is associated with the base station AP. Relay is equivalent to "pseudo" in this process The source MAC address is created (normally because the relay is sent from the relay to the base station AP, and the source MAC address should be the relayed MAC address), so that the base station AP considers that the terminal sends the second association request. The terminal does not directly initiate the association request to the base station AP, but completes it through the relay. Therefore, this process can be considered as an "indirect" association process.
基站 AP收到第二关联请求后, 将第一 MAC地址加入到第二关联列表, 以便后续维护, 原理同前面的第一关联列表类似(当然也会加一些其他信息, 如分配的 Association ID ),基站 AP这部分的实现也都可以基于现有的流程进 行, 这里不再赘述。  After receiving the second association request, the base station AP adds the first MAC address to the second association list for subsequent maintenance. The principle is similar to the previous first association list (of course, some other information, such as the assigned Association ID) is added. The implementation of this part of the base station AP can also be performed based on the existing process, and will not be described here.
基站 AP 收到第二关联请求后, 回复一个第二关联响应 (Association request ), 第二关联响应中目的 MAC地址为第一 MAC地址。 即对于基站 AP 来讲, 并不感知中继的存在, 只感知终端存在, 收到来自第一 MAC地址的 关联后, 回的也是针对第一 MAC地址的关联响应。  After receiving the second association request, the base station AP replies with a second association response (Association Request), where the destination MAC address is the first MAC address. That is, for the base station AP, the presence of the relay is not perceived, and only the terminal exists. After receiving the association from the first MAC address, the associated response is also for the first MAC address.
需要说明的是, 中继向基站 AP发送第二关联请求的顺序与中继向 WiFi 终端发送第一关联响应的顺序并不限定, 本步骤中的标号 S14并不表示该步 骤一定位于 S13之后。  It should be noted that the order in which the relay sends the second association request to the base station AP and the sequence in which the relay sends the first association response to the WiFi terminal are not limited. The label S14 in this step does not mean that the step must be located after S13.
515、 接收第二关联响应, 从而完成 WiFi终端与基站 AP之间的关联; 收到第二关联响应,表示基站 AP已经收到第二关联请求,并将第一 MAC 地址加入到了关联列表,从而完成了 WiFi终端与基站 AP之间的关联。 当然, 这个关联并非通过 WiFi终端直接向基站 AP发送关联请求, 而是通过 WiFi 中继 "伪造,, 一个第一终端发起的关联请求来实现, 可以认为是通过间接的 方式进行了关联。  515. Receive a second association response, thereby completing an association between the WiFi terminal and the base station AP. Receiving a second association response, indicating that the base station AP has received the second association request, and adding the first MAC address to the association list, thereby The association between the WiFi terminal and the base station AP is completed. Of course, this association does not directly send an association request to the base station AP through the WiFi terminal, but is implemented by the WiFi relay "forgery, an association request initiated by the first terminal, which can be considered as being indirectly connected.
516、 接收 WiFi终端发送的 WiFi帧;  516. Receive a WiFi frame sent by the WiFi terminal.
WiFi帧分管理(Management ) 帧、 控制 (Control ) 帧以及数据 (Data ) 帧。 管理帧用于传送一些管理信号, 如上面提到的关联请求、 关联响应等。 控制帧用于传送一些跟数据传输有关的一些控制信号, 如 RTS (请求发送)、 CTS (允许发送)等控制信号。 数据帧用于传送用户数据。 这些帧的具体定 义可参见图 6。 WiFi frame management (Management) frames, Control (Control) frames, and Data (Data) frames. The management frame is used to transmit some management signals, such as the association request, association response, etc. mentioned above. Control frames are used to transmit some control signals related to data transmission, such as RTS (Request to Send), CTS (Allow to Send) and other control signals. Data frames are used to transfer user data. The specifics of these frames See Figure 6 for the meaning.
517、 当 WiFi帧为控制帧时, 将控制帧进行终结, 使得所述控制帧不被 转发给基站 AP, 并且回复给 WiFi终端与发送的控制帧对应的控制帧, 使得 WiFi终端收到对应的控制帧后发送数据帧;  517. When the WiFi frame is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and the control frame corresponding to the sent control frame is returned to the WiFi terminal, so that the WiFi terminal receives the corresponding Sending a data frame after controlling the frame;
该步骤为可选步骤。 实际应用中, 关联完后可以直接发送数据帧, 并不 需要发送控制帧, 当然, 也可以加入控制帧的发送, 以便更好地 WiFi终端发 送的数据进行控制。 WiFi终端与 WiFi中继之间控制帧的交互目的是让 WiFi 终端申请到发送权限。 本实施例中, 如果收到 WiFi发送的控制帧, 则将控制 帧 "终结", 使得控制帧不被转发给数据帧, 同时, 回复对应的控制帧表示允 许终端发送数据帧, 使得让终端收到响应的控制帧后可以发送数据。  This step is an optional step. In practical applications, the data frame can be directly sent after the association, and the control frame does not need to be sent. Of course, the control frame can also be sent to better control the data sent by the WiFi terminal. The purpose of the control frame interaction between the WiFi terminal and the WiFi relay is to allow the WiFi terminal to apply for the transmission permission. In this embodiment, if the control frame sent by the WiFi is received, the control frame is "terminated", so that the control frame is not forwarded to the data frame, and the corresponding control frame is returned to allow the terminal to send the data frame, so that the terminal receives the data. Data can be sent after the control frame of the response.
518、 当 WiFi帧为数据帧且第一关联列表存储有数据帧中的源 MAC地 址时,重新构建一个能发送到基站 AP的新数据帧,新数据帧中携带的源 MAC 地址为第一 MAC地址的字段, 新数据帧中的用户数据与收到的数据帧中的 用户数据相同;  518. When the WiFi frame is a data frame and the first association list stores the source MAC address in the data frame, reconstruct a new data frame that can be sent to the base station AP, where the source MAC address carried in the new data frame is the first MAC address. The field of the address, the user data in the new data frame is the same as the user data in the received data frame;
此步骤可在 S16后执行, 并非需要在步骤 S17后执行, 当然, 如果有步 骤 S17, 则也可以在 S17后执行(先通过 S17申请发送数据帧权限, 然后对 接收的数据帧进行处理)。  This step can be performed after S16, and does not need to be performed after step S17. Of course, if there is step S17, it can also be executed after S17 (first request to send data frame permission through S17, and then process the received data frame).
第一关联列表中有数据帧中的源 MAC地址表示这个数据帧是与中继关 联过的, 需要进行处理, 即重新构建一个新数据帧。 构建新数据帧时, 用户 数据(位于 FRAMebody字段)仍为 WiFi终端发送的数据帧里的用户数据, 同时, 数据帧中会携带源 MAC地址, 当终端发往中继时, 这个第一 MAC地 址位于 Address2字段中, 本实施例中仍然不修改这个字段的值, 即仍然设置 为第一 MAC地址。 为了能够发送到基站 AP (即基站 AP能够接收并进行正 常处理, 不会发生丟弃, 出错的情况), 本步骤中需要修改一些其他字段, 例 如将从终端收到的数据帧的 Addressl字段中的 BSSID由原来的 BSS_2(标识 中继) 更改为 BSS_1 (标识基站), 另外, 需要重新填写 FCS字段(该字段 用于对数据帧进行校验), 其余字段可以需求进行适应性调整或维持不变, 从 而可以使得新数据帧能够传送到基站 AP。 The source MAC address in the data frame in the first association list indicates that the data frame is associated with the relay and needs to be processed, that is, a new data frame is reconstructed. When constructing a new data frame, the user data (in the FRAMebody field) is still the user data in the data frame sent by the WiFi terminal, and the data frame carries the source MAC address. When the terminal sends the relay to the relay, the first MAC address It is located in the Address2 field. In this embodiment, the value of this field is still not modified, that is, it is still set to the first MAC address. In order to be able to send to the base station AP (that is, the base station AP can receive and perform normal processing, no discarding occurs, and an error occurs), some other fields need to be modified in this step, for example, in the Address1 field of the data frame received from the terminal. The BSSID is changed from the original BSS_2 (identification relay) to BSS_1 (identification base station), in addition, the FCS field needs to be refilled (this field It is used to verify the data frame. The remaining fields can be adaptively adjusted or remain unchanged, so that the new data frame can be transmitted to the base station AP.
这里的关键是要维持第一 MAC地址的字段的值不变,这样基站 AP收到 后根据第二关联列表就知道这个数据是关联过的终端发的, 就会进行处理。 其余字段的修改的最终目的是为了保持包的完整性以及能让包传送到基站 AP, 具体可以根据实际情况进行修改, 这里不再赘述。  The key here is to maintain the value of the field of the first MAC address unchanged, so that after receiving the second association list, the base station AP knows that the data is sent by the associated terminal, and then processes it. The final purpose of the modification of the remaining fields is to maintain the integrity of the packet and to enable the packet to be transmitted to the AP of the base station, which may be modified according to actual conditions, and details are not described herein again.
S19、 向基站 AP发送新数据帧, 使得基站 AP收到新数据帧且判断第二 关联列表存储有新数据帧携带的第一 MAC地址后,对与第一 MAC地址对应 的 WiFi终端的用户数据进行业务处理。  S19. Send a new data frame to the base station AP, so that the base station AP receives the new data frame and determines that the second association list stores the first MAC address carried by the new data frame, and then the user data of the WiFi terminal corresponding to the first MAC address. Conduct business processing.
基站 AP判断第二关联列表存储有新数据帧携带的第一 MAC地址时,就 会对与第一 MAC地址对应的 WiFi终端的用户数据进行业务处理。 具体处理 流程可根据实际应用情况而定, 例如可以是判断终端用户数据对应的业务请 求, 然后返回对应的业务数据给终端等。  When the base station AP determines that the second association list stores the first MAC address carried in the new data frame, it performs service processing on the user data of the WiFi terminal corresponding to the first MAC address. The specific processing may be determined according to the actual application, for example, the service request corresponding to the terminal user data may be determined, and then the corresponding service data is returned to the terminal.
本实施例中, WiFi终端 (对应第一 MAC地址)发起关联请求后, 中继 保存了 WiFi终端的第一 MAC地址, 并且, 中继还仍然使用第一 MAC地址 向基站 AP发起关联请求,使得基站 AP收到后也保存 WiFi终端的第一 MAC 地址, 从而使得 WiFi与中继以及基站 AP都进行了关联。 在关联后, 中继对 终端发送的控制帧进行终结并回复针对控制帧的响应, 对终端发送的数据帧 进行适应性修改后构建一个新的数据帧发送给基站 AP, 使得基站 AP能够收 到新数据帧并对里面的用户数据进行处理, 这样, 就实现了基站 AP对终端 的 "感知" (即由于基站 AP有第二关联列表, 就可以知道是哪个终端来的数 据), 而基站 AP—般都是运营商进行部署的, 因此, 运营商就可以对 WiFi 终端进行更好的管理(例如, 基于 DHCP进行 IP地址管理, 计费, 认证等操 作)。 实施例二 基于实施例一, 本实施例对上述方案进行更详细地说明, 本实施例的应 用场景仍可参见图 1所示的应用场景, 其中, WiFi中继的内部结构如图 3所 示, 主要包括: RFIC (射频集成电路)、 基带处理器、 MAC ( Medium Access Controller )控制器等部件, 其中, RFIC用于实现 WiFi协议的射频信号 (如 2.4G射频信号) 收发(结合天线); 基带处理器用于对信号进行调制, 通过 RFIC发送出去, 或者对通过 RFIC接收的信号进行解调, 将解调后的信号发 送给 MAC控制器(结合模数转化器 ADC或者数模转换器 DAC ); MAC控 制器用于对基带处理器解调后的信号进行处理, 或者将需要发送的信号通过 基带处理器调制后通过 RFIC进行发送。此外,还可以包括 RAM、闪存( flash ) 等存储器, RAM—般用于存储程序运行过程当中的数据, 例如可以对帧进行 緩存, 闪存或其他存储器可以存储程序运行需要代码, 以供 MAC控制器读 取并执行。 In this embodiment, after the WiFi terminal (corresponding to the first MAC address) initiates the association request, the relay saves the first MAC address of the WiFi terminal, and the relay still uses the first MAC address to initiate an association request to the base station AP, so that After receiving the base station AP, the first MAC address of the WiFi terminal is also saved, so that the WiFi is associated with the relay and the base station AP. After the association, the relay terminates the control frame sent by the terminal and replies to the response to the control frame, and adaptively modifies the data frame sent by the terminal to construct a new data frame and send it to the base station AP, so that the base station AP can receive The new data frame processes the user data therein, thus realizing the "perception" of the base station AP to the terminal (ie, because the base station AP has the second associated list, it can know which terminal is the data), and the base station AP Generally, operators deploy them. Therefore, operators can better manage WiFi terminals (for example, IP address management, accounting, and authentication based on DHCP). Embodiment 2 Based on the first embodiment, the solution is described in more detail in this embodiment. The application scenario of the present embodiment can still be seen in the application scenario shown in FIG. 1 , where the internal structure of the WiFi relay is as shown in FIG. 3 , which mainly includes : RFIC (Radio Frequency Integrated Circuit), baseband processor, MAC (Medium Access Controller) controller, etc., where RFIC is used to transmit and receive RF signals (such as 2.4G RF signals) of WiFi protocol (in combination with antenna); Modulating the signal, transmitting it through the RFIC, or demodulating the signal received by the RFIC, and transmitting the demodulated signal to the MAC controller (in conjunction with an analog-to-digital converter ADC or a digital-to-analog converter DAC); The device is used to process the signal demodulated by the baseband processor, or the signal to be transmitted is modulated by the baseband processor and then transmitted through the RFIC. In addition, it can also include RAM, flash memory, etc. RAM is generally used to store data during the running of the program. For example, the frame can be cached, and the flash memory or other memory can store the program running code for the MAC controller. Read and execute.
本实施例中的方法可以基于具有上述硬件架构的中继执行, 为了说明方 便, 这里不对每一个方法步骤所经过的硬件单元进行具体描述, 本领域技术 继对收到的某种帧进行某种处理"的步骤,那么,可以理解为: 中继通过 RFIC 接收(通过天线配合)到承载该 "某种帧" 的无线信号, 再通过基带处理器 将该信号进行解调, 得到该 "某种帧", 再将该 "某种帧"传给 MAC处理器, 由 MAC处理器来进行 "某种处理"。  The method in this embodiment may be performed based on the relay having the hardware architecture described above. For convenience of description, the hardware unit through which each method step passes is not specifically described herein. The "processing" step can be understood as follows: the relay receives (via the antenna) through the RFIC to the wireless signal carrying the "some kind of frame", and then demodulates the signal through the baseband processor to obtain the "some kind" The frame ", then the "some kind of frame" is passed to the MAC processor, and the MAC processor performs "some processing."
假设现在有一个中继, 两个 WiFi终端, 一个基站 AP。 中继包括两个模 块, 一个模块用于完成相对于基站 AP作为终端的功能, 本实施例称 "中继 终端", 另一个模块用于完成相对于 WiFi终端作为 AP的功能, 本实施例称 "中继 AP" , 因此, 中继会有两个 MAC地址, 这里命名成 MAC0 (作为终 端 )以及 MAC_中继 AP (作为 AP ), 这两个 MAC地址在实现上可以使用两 个不同的物理芯片的物理 MAC地址, 或者也使用一个物理 MAC地址。  Suppose now there is a trunk, two WiFi terminals, and one base station AP. The relay includes two modules, one of which is used to perform the function as a terminal with respect to the base station AP. This embodiment is called a "relay terminal", and the other module is used to perform the function as an AP with respect to the WiFi terminal. "Relay AP", therefore, the relay will have two MAC addresses, named MAC0 (as the terminal) and MAC_Relay AP (as the AP). These two MAC addresses can be implemented using two different The physical MAC address of the physical chip, or a physical MAC address is also used.
需要说明的是, 上述 "中继终端" 以及 "中继 AP" 并不是物理上严格区 分的两个模块, 只是一个逻辑意义上的划分。 实际使用过程中, 可以共享同 一些硬件(如 RFIC、 基带处理器等)。 下文提及 "中继" 时, 如无特殊说明, 本领域技术人员可以根据信号流向来判断该步骤是由哪个模块来完成。 还需 要说明的是, 这中继除了这两个逻辑意义上的模块外, 还可以包括其他逻辑 意义上的处理模块, 当然, 其他处理模块的部分甚至全部功能也可以放在这 两个模块上的一个或两个来实现, 因此, 下文并不对中继进行严格的逻辑划 分, 本领域技术人员可以结合本实施例给出的步骤实现本方案。 It should be noted that the above "relay terminal" and "relay AP" are not physically strict areas. The two modules are divided into a logical division. In actual use, you can share the same hardware (such as RFIC, baseband processor, etc.). When "relay" is mentioned hereinafter, a person skilled in the art can judge which module is completed by the signal flow direction unless otherwise specified. It should also be noted that, in addition to the modules in the two logical senses, the relay may include other processing modules in a logical sense. Of course, some or even all functions of other processing modules may be placed on the two modules. One or two of them are implemented. Therefore, the relay is not strictly logically divided below, and those skilled in the art can implement the solution in combination with the steps given in this embodiment.
两个终端包括第一终端以及第二终端,分别使用 MAC1以及 MAC2标识 这两个 WiFi终端的 MAC地址。基站 AP的 MAC地址用 MAC_基站 AP来标 识。 本实施例基于上述应用场景来对本方案进行具体介绍, 具体的, 主要包 括关联以及数据传输两阶段, 下面针对这两个阶段进行具体介绍:  The two terminals include a first terminal and a second terminal, which use MAC1 and MAC2 to identify the MAC addresses of the two WiFi terminals, respectively. The MAC address of the base station AP is identified by the MAC_Base Station AP. This embodiment introduces the solution in detail based on the above application scenarios. Specifically, it mainly includes two phases of association and data transmission. The following two phases are specifically introduced:
( 1 ) 关联阶段  (1) association phase
本实施例关联阶段对应于实施例中的步骤 S11-S14, 主要用于完成各终 端与中继之间的关联, 以及各终端与 AP之间的关联, 当然, 中继为了能与 基站 AP进行通信, 也会将自己与基站 AP进行关联。 参见图 4 (图中为了描 述方便, 左上角标有 "WiFi终端" 的矩形框用于表示两个 WiFi终端), 包括: The association phase in this embodiment corresponds to the steps S11-S14 in the embodiment, and is mainly used to complete the association between each terminal and the relay, and the association between each terminal and the AP. Of course, the relay can be performed with the base station AP. Communication also associates itself with the base station AP. Referring to Figure 4 (for the sake of convenience in the figure, a rectangular box labeled "WiFi Terminal" in the upper left corner is used to indicate two WiFi terminals), including:
S41、中继向 AP发送 Association request(关联请求), AP收到 Association request后将中继关联到 AP, 并发送 Association request (关联响应 )给中继; 中继开机后, 扫描 AP的信号, 通过上述方法进行关联, 显然, 这部分 功能可以由中继终端模块来完成。 其中, 关联请求为 WiFi协议定义的一种管 理帧, 参见图 5 , 为一个 WiFi帧的结构图, 具体字段的含义在标准中都有定 义, 这里不再赘述。 本领域技术人员可以通过设置 FRAMe Control (帧控制) 字段中的 Type (类型) 以及 Subtype (子类型)子段为不同值来发送不同的 帧(如管理帧、 控制帧、 数据帧等)。 参见图 6, 为 Type及 Subtype表示的各 个帧的含义: S41. The relay sends an Association request to the AP. After receiving the Association request, the AP associates the relay with the AP, and sends an Association request to the relay. After the relay is powered on, the AP scans the signal. The above methods are associated, obviously, this part of the function can be completed by the relay terminal module. The association request is a management frame defined by the WiFi protocol. See FIG. 5, which is a structural diagram of a WiFi frame. The meaning of the specific field is defined in the standard, and is not described here. Those skilled in the art can send different frames (such as management frames, control frames, data frames, etc.) by setting the Type and Subtype sub-segments in the FRAMe Control field to different values. See Figure 6, the meaning of each frame represented by Type and Subtype:
当 Type=00时, 表示管理(Management ) 帧; 当 Type=01时, 表示控制 (Control ) 帧; When Type=00, it means a management (Management) frame; When Type=01, it indicates a control (Control) frame;
当 Type=10时, 表示数据 (Data ) 帧;  When Type=10, it means data (Data) frame;
同时, 每个 Type又可结合 Subtype表示多种不同的具体子类型, 如本步 骤中提到的 Association request为 Type=00,且 Subtype=0000时表示的一个具 有特定含义的管理帧;类似的,如果要传输 Association response ,只要将 Type 设置成 00, 将 Subtype设置成 0001即可。  At the same time, each Type can be combined with Subtype to represent a plurality of different specific subtypes, such as the Association request mentioned in this step is Type=00, and Subtype=0000 represents a management frame with a specific meaning; similarly, If you want to transfer the Association response, just set the Type to 00 and set the Subtype to 0001.
中继与 AP关联后, 中继根据 AP的无线参数设置自己的中继无线参数, 并使能自己的 "下行中继 AP" 的功能。 例如中继将无线参数 SSID设置成与 AP一样的 SSID (假设都是 SSID_1 ), 将 BSSID 由基站 AP的 BSSID (如 BSSID_1 )设置成自己的 BSSID (如 BSSID_2 )。 中继使能自己的 "下行中继 AP" 的功能是指通过 MAC处理器、 基带处理器以及 RFIC使中继本身成为 一个 "AP" (这里的 "AP" 并不指 "基站 AP" 的缩写), 用于为室内的终端 提供 WiFi信号, 为了与基站 AP区分, 这里称中继的这个功能为 "下行中继 AP" 功能。 上述中继关联, 并设置参数, 使能下行中继 AP功能为本领域技 术人员所公知的技术, 这里不再赘述。  After the trunk is associated with the AP, the trunk sets its own relay wireless parameters according to the wireless parameters of the AP, and enables its own "downlink relay AP" function. For example, the relay sets the wireless parameter SSID to the same SSID as the AP (assuming all are SSID_1), and sets the BSSID from the base station AP's BSSID (such as BSSID_1) to its own BSSID (such as BSSID_2). The function of relay to enable its own "downlink relay AP" means that the relay itself becomes an "AP" through the MAC processor, baseband processor and RFIC (here "AP" does not mean "base station AP" It is used to provide a WiFi signal for the terminal in the room. In order to distinguish it from the base station AP, this function of the relay is referred to as a "downlink relay AP" function. The above-mentioned relays are associated with each other, and the parameters are set to enable the downlink relay AP function to be known to those skilled in the art, and details are not described herein again.
S42、 完成第一终端与中继、 基站 AP之间的关联。  S42. Perform association between the first terminal and the relay, and the base station AP.
本步骤的具体流程基于步骤 S11-S14进行, 具体的:  The specific process of this step is performed based on steps S11-S14, specifically:
第一终端向中继发送一个关联请求,携带的源 MAC地址为自己的 MAC 地址, 即 MAC1 , 目的 MAC地址为 WiFi中继的 MAC地址, 这里的 WiFi 中继相对于第一终端来说是个 " AP" , 因此, 目的 MAC地址使用 MAC_中继 AP;  The first terminal sends an association request to the relay, and the source MAC address carried is its own MAC address, that is, MAC1, and the destination MAC address is the MAC address of the WiFi relay. Here, the WiFi relay is a "relative to the first terminal". AP", therefore, the destination MAC address uses the MAC_Relay AP;
中继收到关联请求后, 会给出第一终端回复关联响应, 并且将第一终端 的 MAC1记录在第一关联列表中, 这样可以将第一终端与中继进行关联; 同时, 中继收到第一终端发送的关联请求后, 也向基站 AP发送关联请 求, 此时, 中继并不使用自己的 MAC地址(MAC0 ), 而仍然使用第一终端 的地址 MAC1作为源 MAC地址, 目的地址填基站的 MAC地址 MAC_基站 AP, 这样做的目的是让基站收到后认为是来自第一终端的关联请求; 需要说明的是, 这里的 "同时" 并不意味着绝对意义上的同一时刻, 而 表示是两个都要做的步骤, 本实施例中, 中继向第一终端回复关联响应的步 骤以及中继向基站 AP发送关联请求的步骤并没有严格的先后顺序要求, 只 要能够完成这两个步骤即可; After receiving the association request, the relay sends a first terminal reply association response, and records the MAC1 of the first terminal in the first association list, so that the first terminal can be associated with the relay; After the association request sent by the first terminal, the association request is also sent to the base station AP. At this time, the relay does not use its own MAC address (MAC0), but still uses the address MAC1 of the first terminal as the source MAC address, the destination address. Fill in the base station's MAC address MAC_ base station AP, the purpose of this is to let the base station receive the association request that is considered to be from the first terminal; it should be noted that the "simultaneous" here does not mean the same moment in absolute sense, but the representation is two Steps to be performed, in this embodiment, the step of replying the association response to the first terminal and the step of sending the association request to the base station AP by the relay are not strictly sequential, as long as the two steps can be completed;
基站 AP收到中继发送的关联请求后,会将 MAC1加入到第二关联列表, 并发关联响应给中继, 以完成第一终端与基站 AP之间的关联。基站 AP发送 关联响应时, 源 MAC地址填自己的 MAC地址( MAC_基站 AP ), 目的 MAC 地址填第一终端的 MAC地址(MAC1 ), 这是因为对基站 AP来说, 并不会 去关注实际是哪个物理设备发送的, 只会根据收到 MAC地址来判断是哪个 终端来发送, 由于收到的是 MAC1 , 因此, 回复的也是针对 MAC1。 基站 AP 相对于现有技术并不需要进行改动, 添加关联列表的方式以及其他方式参考 现有的基站 AP处理流程即可。  After receiving the association request sent by the relay, the base station AP adds the MAC1 to the second association list, and sends an association response to the relay to complete the association between the first terminal and the base station AP. When the base station AP sends the association response, the source MAC address is filled with its own MAC address (MAC_base station AP), and the destination MAC address is filled with the MAC address of the first terminal (MAC1). This is because the base station AP does not pay attention to it. Which physical device is actually sent, it will only judge which terminal to send according to the received MAC address. Since it receives MAC1, the reply is also for MAC1. The base station AP does not need to be modified relative to the prior art, and the manner of adding the association list and other methods can refer to the existing base station AP processing flow.
通过上述处理流程, 即可完成第一终端与中继之间的关联, 以及第一终 端与基站 AP之间的关联。由于第一终端实际上并没有直接给基站 AP发送消 息, 而是通过中继 "伪造" 一个源目的地址为 MAC1的关联请求后让第一终 端与基站 AP进行了关联, 从某个角度来看, 也可以认为中有一个 "虚终端" (实际上可认为是对应于 "向基站 AP进行关联" 有关步骤的功能模块), 通 过这个虚终端完成了虚终端与基站 AP之间的关联, 而虚终端跟实际的第一 终端都是使用 MAC 1地址, 因此, 间接地完成了第一终端与基站 AP之间的 关联。  Through the foregoing processing procedure, the association between the first terminal and the relay and the association between the first terminal and the base station AP can be completed. Since the first terminal does not directly send a message to the base station AP, the first terminal is associated with the base station AP by "forging" an association request with the source destination address being MAC1, from a certain point of view. It can also be considered that there is a "virtual terminal" (actually, it can be regarded as a functional module corresponding to the step of "associating with the base station AP"), and the association between the virtual terminal and the base station AP is completed by the virtual terminal, and Both the virtual terminal and the actual first terminal use the MAC 1 address. Therefore, the association between the first terminal and the base station AP is completed indirectly.
S43、 完成第二终端与中继、 基站 AP之间的关联。  S43. Complete association between the second terminal and the relay, and the base station AP.
具体的处理方法与 S42类似, 这里不再详细描述。 S43的执行时间也并 非要在 S42之后, 这两个步骤为并列的步骤, 并不严格的先后执行顺序。 通 过执行这一步, 第二终端的 MAC地址( MAC2 )也被存储在中继的第一关联 列表以及基站 AP的第二关联列表中, 并完成了第二终端与中继以及基站 AP 之间的关联。 The specific processing method is similar to that of S42, and will not be described in detail here. The execution time of S43 is not to be after S42. These two steps are parallel steps, and the order of execution is not strictly sequential. By performing this step, the MAC address (MAC2) of the second terminal is also stored in the first association list of the relay and the second association list of the base station AP, and the second terminal and the relay and the base station AP are completed. The relationship between.
( 2 )数据传输阶段  (2) Data transmission phase
当终端完成与中继关联(终端收到中继发的关联响应),即可发送数据帧。 发送数据帧时一般包括两种方法: 一种方法是直接发送。 另一种方法是终端 先发控制帧请求发送数据帧权限, 获取权限后再发送数据帧。 例如, 可以使 用免竟争服务的方式来获取发送数据帧权限, 这种方式也称为点协调功能 ( Point Coordination Function ), 终端向 AP发数据时, 先发一个 RTS控制帧, AP同意后会回复一个 CTS控制帧, 终端收到 CTS控制帧后开始发送数据。  When the terminal completes the association with the relay (the terminal receives the association response sent by the relay), the data frame can be sent. There are two ways to send a data frame: One method is to send it directly. Another method is that the terminal first sends a control frame request to send a data frame permission, and then acquires the right and then sends the data frame. For example, you can use the exemption service to obtain the permission to send data frames. This method is also called Point Coordination Function. When the terminal sends data to the AP, it sends an RTS control frame first. A CTS control frame is replied, and the terminal starts transmitting data after receiving the CTS control frame.
本实施例中, 当中继收到来自终端这类用于请求数据发送权限的控制帧 时, 向终端回复对应的控制帧, 以允许终端发送数据帧。 同时, 中继将这些 终端发来的控制帧终结, 不让这些控制帧传输到基站 AP。  In this embodiment, when the relay receives a control frame for requesting data transmission authority from the terminal, the relay returns a corresponding control frame to the terminal to allow the terminal to send the data frame. At the same time, the relay terminates the control frames sent by these terminals, and does not allow these control frames to be transmitted to the base station AP.
参见图 7, 为本实施例基于控制帧进行数据传输的一个流程示意图, 包 括步骤:  Referring to FIG. 7, a flow chart of data transmission based on a control frame in this embodiment includes the following steps:
551、 WiFi终端向 WiFi中继发送 RTS控制帧, 请求发送权限, 中继收 到后向 WiFi终端回复一个 CTS响应, 并终结该帧, 不让其传到基站 AP。  551. The WiFi terminal sends an RTS control frame to the WiFi relay, requests the sending permission, and the relay returns a CTS response to the WiFi terminal, and terminates the frame, and does not pass it to the base station AP.
这里步骤里的 WiFi终端假设是上述提到的第二 WiFi终端, 其 MAC地 址为 MAC2, 则发送 RTS请求的时间源 MAC地址为 MAC2, 目的 MAC地 址为 MAC_中继 AP。 中继回复 CTS响应时, 目的 MAC地址为 MAC2。  The WiFi terminal in the step here is assumed to be the second WiFi terminal mentioned above, and the MAC address is MAC2, the time source MAC address of the RTS request is MAC2, and the destination MAC address is the MAC_Relay AP. When the relay responds to the CTS response, the destination MAC address is MAC2.
552、 WiFi终端收到 CTS回复后开始发送数据帧, WiFi中继回复 ACK 响应, 并緩存数据帧。  552. After receiving the CTS reply, the WiFi terminal starts to send a data frame, and the WiFi relay responds with an ACK response and buffers the data frame.
数据帧中携带的源 MAC地址为 MAC2 , 目的 MAC地址为 MAC_中继 AP。 ACK响应中的目的 MAC地址为 MAC2。  The source MAC address carried in the data frame is MAC2, and the destination MAC address is MAC_Relay AP. The destination MAC address in the ACK response is MAC2.
553、 中继通过控制帧向基站 AP 申请发送数据帧权限, 也是发送 RTS 控制帧, 但里面的源 MAC地址填 MAC2 , 仍然 "伪造" 成第二终端向基站 AP发送, 让基站 AP对来自 MAC2这个地址的控制帧进行处理, 基站 AP收 到后, 针对 MAC2地址回复 ACK控制帧。 S54、 中继收到 ACK控制帧即获取了发送权限, 采用步骤 S17所示的方 法构建新数据帧后,向基站 AP发送数据帧(使用 MAC2作为源 MAC地址 ), 使得基站 AP收到数据帧后对数据帧里的用户数据进行处理。 并且, 与步骤 S52—样, 基站 AP也会回复 ACK控制帧, 通知中继已经接收到了数据帧。 553. The relay requests the base station AP to send the data frame permission through the control frame, and also sends the RTS control frame, but the source MAC address is filled in the MAC2, and is still "forged" into the second terminal to send to the base station AP, so that the base station AP is from the MAC2. The control frame of this address is processed, and after receiving by the base station AP, the ACK control frame is returned for the MAC2 address. S54. The relay obtains the sending right after receiving the ACK control frame, and after constructing the new data frame by using the method shown in step S17, sending a data frame to the base station AP (using MAC2 as the source MAC address), so that the base station AP receives the data frame. The user data in the data frame is then processed. And, as in step S52, the base station AP also replies to the ACK control frame, notifying that the relay has received the data frame.
重构的步骤并不严格限定在这个步骤中执行, 实际中, 只需要在发送前 完成重构即可, 例如, 可以在步骤 S52緩存后就可以重构, 或者也可以在步 骤 S53发送 RTS后开始重构等等。  The step of refactoring is not strictly limited to be performed in this step. In practice, it is only necessary to complete the reconstruction before sending, for example, it may be reconstructed after being cached in step S52, or may be after the RTS is sent in step S53. Start refactoring and more.
为进行重构过程的示意图, 重构的关键是要维持数据帧里面携带终端 MAC地址的字段的值以及用户数据不变。 具体的, 参见图 8, 图 8上半部分 为收到的一个 WiFi帧的帧格式, 图 8下半部分的表格是对 Address位含义的 解释。  For the schematic diagram of the reconstruction process, the key to the reconstruction is to maintain the value of the field carrying the terminal MAC address in the data frame and the user data unchanged. Specifically, see Figure 8, the upper part of Figure 8 is the frame format of a received WiFi frame, and the table in the lower part of Figure 8 is an explanation of the meaning of the Address bit.
当数据帧是从终端发往中继时,终端构建数据帧时,会根据发送方向(由 To DS , From DS两个条件限定 )选择在哪个字段携带自己的源 MAC地址, 例如, 当方向为终端发往中继时 (To DS为 1 , From DS为 0 ), 则终端会将 自己的 MAC地址的记录在 Address2字段, 图 8下半部分的 Address位含义 表中的在 To DS为 1 , From DS为 0条件下的 TA的值即为终端 MAC地址, 如 MAC1或者 MAC2等。  When a data frame is sent from a terminal to a relay, when the terminal constructs a data frame, it selects which field to carry its own source MAC address according to the sending direction (defined by To DS and From DS conditions), for example, when the direction is When the terminal sends the relay to the relay (To DS is 1 and From DS is 0), the terminal records its own MAC address in the Address2 field, and the To DS is 1 in the meaning table of the Address bit in the lower part of Figure 8. The value of TA under the condition that From DS is 0 is the terminal MAC address, such as MAC1 or MAC2.
中继收到这个数据帧进行重构新数据帧时, 新数据帧的发送方向是中继 发往基站 AP, 对于中继来讲, 仍然针对的是 Address位含义表中 "To DS为 1 , From DS为 0" 的发送场景。 此时, 中继保持 Address2中 TA值不变 (仍 然为终端的 MAC地址, 如 MAC1或 MAC2 ), 同时, 保持用户数据不变(这 里用 FRAMe Body字段来承载用户数据,因此, FRAMe Body字段的值不变 ), 其余的值进行适应性修改, 使新数据帧能够发送到基站 AP, 如将 Addressl 中的 RA值由原来的 BSS_2 (原来标识是发给中继的) 改为 BSS_1 (现标识 发给基站 AP ); 并重新计算 FCS的值(即校验值), 这些适应性修改为本领 域技术人员所公知的技术, 这里不再详细描述。 构建完新的数据帧后, 就可以发送数据帧, 使得基站 AP可以接收到数 据帧, 并进行处理, 由于终端可以直接 "看到,, ("感知")终端(即保存有终 端的 MAC地址,可以基于终端的 MAC地址进行处理)并对数据帧进行处理, 因此, 基站 AP侧 (运营商)可以更好地对 WiFi终端进行管理。 实施例三 When the relay receives the data frame to reconstruct a new data frame, the sending direction of the new data frame is relayed to the base station AP. For the relay, the address is still in the meaning of the Address bit table. From DS is a 0" transmission scenario. At this time, the relay keeps the TA value in Address2 unchanged (still the terminal's MAC address, such as MAC1 or MAC2), and keeps the user data unchanged (the FRAMe Body field is used here to carry user data, therefore, the FRAMe Body field The value is unchanged, and the remaining values are adaptively modified so that the new data frame can be sent to the base station AP. For example, the RA value in Address1 is changed from the original BSS_2 (originally identified to the relay) to BSS_1 (now identified) Send to the base station AP); and recalculate the value of the FCS (ie, the check value). These adaptive modifications are well known to those skilled in the art and will not be described in detail herein. After the new data frame is constructed, the data frame can be sent, so that the base station AP can receive the data frame and process it, because the terminal can directly "see,"("perceive") the terminal (that is, the MAC address of the terminal is saved) The processing can be performed based on the MAC address of the terminal, and the data frame is processed. Therefore, the AP side (operator) can better manage the WiFi terminal.
基于上述各实施例, 本实施例提供了中继如何处理基站 AP发送的数据 帧的方法, 参见图 9, 包括如下步骤:  Based on the foregoing embodiments, this embodiment provides a method for how a relay processes a data frame sent by a base station AP. Referring to FIG. 9, the following steps are included:
561、 接收基站 AP发送的第二数据帧, 第二数据帧中携带的目的 MAC 地址为第一 MAC地址;  561. Receive a second data frame sent by the base station, where the destination MAC address carried in the second data frame is the first MAC address.
基站 AP处理完来自终端的消息后, 可以回复一个数据帧, 由于基站 AP 是直接 "感知" WiFi终端的, 因此, 填的目的 MAC地址为第一 MAC地址, 本实施例中的 "第一 MAC地址" 的含义与实施例一中的一致。  After the base station AP processes the message from the terminal, it can reply to a data frame. Since the base station AP directly "perceives" the WiFi terminal, the destination MAC address is the first MAC address, and the first MAC address in this embodiment. The meaning of "address" is the same as in the first embodiment.
562、 当根据第一关联列表判断第一 MAC地址位于第一关联列表时, 重 新构建一个能发送到 WiFi终端的新第二数据帧,新第二数据帧中携带的目的 MAC地址为第一 MAC地址的字段, 新数据帧中的用户数据为与收到的第二 数据帧中的用户数据;  562. When determining that the first MAC address is located in the first association list according to the first association list, reconstruct a new second data frame that can be sent to the WiFi terminal, where the destination MAC address carried in the new second data frame is the first MAC address. The field of the address, the user data in the new data frame is the user data in the received second data frame;
中继处理基站 AP发送的数据帧与处理 WiFi终端发送的数据帧的思路类 似,也是收到后构建一个新的数据帧, 由于这个帧要转发给 WiFi终端, 因此, 构建这个帧的时候, 目的 MAC地址要填 WiFi终端的 MAC地址, 并保持用 户数据不变。 其余字段(如 BSSID、 FCS ) 的变化可以参见前面实施例的描 述, 这里不再赘述。  The data frame sent by the relay processing base station AP is similar to the processing method of processing the data frame sent by the WiFi terminal, and is also constructed to construct a new data frame. Since this frame is to be forwarded to the WiFi terminal, when constructing the frame, the purpose is The MAC address is to be filled with the MAC address of the WiFi terminal, and the user data is kept unchanged. For the changes of the remaining fields (such as BSSID, FCS), refer to the description of the previous embodiment, and details are not described herein again.
563、 向 WiFi终端发送新第二数据帧, 使得 WiFi终端收到新第二数据 帧后获取里面的用户数据。  563. Send a new second data frame to the WiFi terminal, so that the WiFi terminal acquires the user data in the new second data frame.
通过本实施例, 可以将基站 AP发送的数据传递给 WiFi终端。  With this embodiment, the data sent by the base station AP can be transmitted to the WiFi terminal.
此外,与 WiFi终端发送数据帧的情况类似,基站 AP向中继发送数据时, 可以直接发送,也可以先通过控制帧的交互获取发送权限后发送。参见图 x6, 为使用控制帧获取发送权限, 然后再发送数据帧的流程示意图, 包括如下步 骤: In addition, similar to the case where the WiFi terminal transmits a data frame, when the base station AP sends data to the relay, It can be sent directly, or it can be sent after the transmission permission is obtained through the interaction of the control frame. Referring to Figure x6, a flow diagram for obtaining a transmission right by using a control frame, and then transmitting a data frame, includes the following steps:
571、 基站 AP通过控制帧各 WiFi中继申请发送权限;  571. The base station AP applies for sending permission by using each WiFi relay of the control frame.
通过 RTS控制帧进行申请, 中继发送 CTS控制帧表示同意。基站 AP控 制帧中使用的目的 MAC地址为目标 WiFi终端( 4叚设为实施例二中的第二终 端, MAC地址为 MAC2 ) 的 MAC地址;  The application is made through the RTS control frame, and the relay sends a CTS control frame to indicate the consent. The destination MAC address used in the base station AP control frame is the MAC address of the target WiFi terminal (4 is set as the second terminal in the second embodiment, and the MAC address is MAC2);
572、 基站 AP发送数据帧到 WiFi中继, 中继回应响应, 并緩存数据帧; 572. The base station AP sends a data frame to the WiFi relay, and the relay responds to the response, and buffers the data frame.
573、 中继通过控制帧向 WiFi终端请求发送权限; 573. The relay requests a sending permission to the WiFi terminal by using a control frame.
源 MAC地址为中继自己的 MAC地址, 这里使用 MAC_中继 AP (相对 于终端是个 AP ) , 目标 MAC地址为 WiFi终端的 MAC地址, 即 M AC2。  The source MAC address is the relay's own MAC address. Here, the MAC_Relay AP (which is an AP with respect to the terminal) is used, and the destination MAC address is the MAC address of the WiFi terminal, that is, M AC2.
S74、 中继获得发送权限后, 重新构建新数据帧, 并发送给 WiFi终端。 源 MAC地址为 "中继 AP" 的 MAC地址( MAC—中继 AP ), 目标 MAC 地址为 WiFi终端的 MAC地址( MAC2 )。  S74. After obtaining the transmission permission, the relay reconstructs a new data frame and sends it to the WiFi terminal. The source MAC address is the MAC address of the "Relay AP" (MAC-Relay AP), and the destination MAC address is the MAC address (MAC2) of the WiFi terminal.
通过本实施例, WiFi终端也能通过中继的处理收到基站 AP发送的响应, 从而实现 WiFi终端与基站 AP之间的数据传输。 实施例四  In this embodiment, the WiFi terminal can also receive the response sent by the base station AP through the processing of the relay, thereby implementing data transmission between the WiFi terminal and the base station AP. Embodiment 4
基于上述各实施例, 本实施例提供了一种处理 WiFi 帧的装置, 应用于 WiFi中继, 所述 WiFi中继用于连接 WiFi终端以及基站接入点 AP, 参见图 11 , 所述装置 110包括:  Based on the above embodiments, the present embodiment provides an apparatus for processing a WiFi frame, which is applied to a WiFi relay, where the WiFi relay is used to connect a WiFi terminal and a base station access point AP. Referring to FIG. 11, the device 110 is provided. Includes:
第一关联请求接收单元 111 , 用于接收 WiFi终端发送的第一关联请求, 所述第一关联请求中携带的源 Mac地址为所述 WiFi终端的第一 MAC地址; 存储单元 112, 用于将所述第一关联请求接收单元 111接收到的所述第 一关联请求中的第一 MAC地址存储到所述第一关联列表;  a first association request receiving unit 111, configured to receive a first association request sent by the WiFi terminal, where a source MAC address carried in the first association request is a first MAC address of the WiFi terminal, and a storage unit 112, configured to: The first MAC address in the first association request received by the first association request receiving unit 111 is stored in the first association list;
第一关联响应发送单元 113 , 用于所述第一关联请求接收单元 111接收 到所述第一关联请求后, 向所述 WiFi终端发送第一关联响应, 从而完成所述 WiFi终端与所述 WiFi中继之间的关联; a first association response sending unit 113, configured to receive by the first association request receiving unit 111 After the first association request, sending a first association response to the WiFi terminal, thereby completing an association between the WiFi terminal and the WiFi relay;
第二关联请求发送单元 114 , 用于在所述第一关联请求接收单元 111接 收到所述第一关联请求后, 向所述基站 AP发送第二关联请求, 所述第二关 联请求携带的源 MAC地址为所述第一 MAC地址, 使得所述基站 AP收到所 述第二关联请求后获取所述第一 MAC地址, 并存储到第二关联列表; 并且, 使得所述基站 AP收到所述第二关联请求后回复第二关联响应, 所述第二响 应请求中携带的目的 MAC地址为所述第一 MAC地址;  The second association request sending unit 114 is configured to: after the first association request receiving unit 111 receives the first association request, send a second association request to the base station AP, where the second association request carries the source The MAC address is the first MAC address, so that the base station AP acquires the first MAC address after receiving the second association request, and stores the first MAC address, and stores the information in the second association list. Responding to the second association response after the second association request, where the destination MAC address carried in the second response request is the first MAC address;
第二关联响应接收单元 115 , 用于接收所述第二关联响应, 从而完成所 述 WiFi终端与所述基站 AP之间的关联;  The second association response receiving unit 115 is configured to receive the second association response, so as to complete an association between the WiFi terminal and the base station AP.
WiFi帧接收单元 116, 用于接收所述 WiFi终端发送的 WiFi帧; 第一构建单元 117, 用于当所述 WiFi帧接收单元 116接收的 WiFi帧为 数据帧且所述第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构 建一个能发送到所述基站 AP的新数据帧,所述新数据帧中携带的源 MAC地 址为所述第一 MAC地址的字段, 所述新数据帧中的用户数据与收到的数据 帧中的用户数据相同;  The WiFi frame receiving unit 116 is configured to receive the WiFi frame sent by the WiFi terminal, and the first constructing unit 117 is configured to: when the WiFi frame received by the WiFi frame receiving unit 116 is a data frame, and the first associated list is stored Reconstructing a new data frame that can be sent to the base station AP, where the source MAC address carried in the new data frame is a field of the first MAC address, the new The user data in the data frame is the same as the user data in the received data frame;
数据帧发送单元 118, 用于向所述基站 AP发送所述第一构建单元 117 构建的所述新数据帧, 使得所述基站 AP收到所述新数据帧且判断所述第二 关联列表存储有所述新数据帧携带的第一 MAC地址后, 对与所述第一 MAC 地址对应的所述 WiFi终端的用户数据进行业务处理。  The data frame sending unit 118 is configured to send the new data frame constructed by the first building unit 117 to the base station AP, so that the base station AP receives the new data frame and determines that the second associated list is stored. After the first MAC address carried by the new data frame, the user data of the WiFi terminal corresponding to the first MAC address is processed.
参见图 13 , 具体的, 所述第一构建单元可以包括 BSSID修改单元 1171 , 用于构建所述新数据帧时, 修改原来的数据帧的 BSSID字段的值, 将其由原 来标识所述 WiFi中继的 BSSID值改为标识所述基站 AP的 BSSID值。  Referring to FIG. 13, in particular, the first building unit may include a BSSID modifying unit 1171, configured to modify a value of a BSSID field of an original data frame when the new data frame is constructed, and identify the WiFi data by the original The subsequent BSSID value is changed to identify the BSSID value of the base station AP.
参见图 13 , 本实施例还可以包括:  Referring to FIG. 13, the embodiment may further include:
第二数据帧接收单元 119,用于接收所述基站 AP发送的第二数据帧,所 述第二数据帧中携带的目的 MAC地址为所述第一 MAC地址; 第二构建单元 120, 用于当根据所述第一关联列表判断所述第二数据帧 接收单元 119接收到的所述第二帧中的所述第一 MAC地址位于所述第一关 联列表时, 重新构建一个能发送到所述 WiFi终端的新第二数据帧, 所述新第 二数据帧中携带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据 帧中的用户数据为与收到的所述第二数据帧中的用户数据; a second data frame receiving unit 119, configured to receive a second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address; a second constructing unit 120, configured to: when determining, according to the first association list, that the first MAC address in the second frame received by the second data frame receiving unit 119 is located in the first association list Reconstructing a new second data frame that can be sent to the WiFi terminal, where the destination MAC address carried in the new second data frame is a field of the first MAC address, and user data in the new data frame And the user data in the received second data frame;
第二数据帧发送单元 121 ,用于向所述 WiFi终端发送所述第二构建单元 构建的所述新第二数据帧,使得所述 WiFi终端收到所述新第二数据帧后获取 里面的用户数据。  a second data frame sending unit 121, configured to send the new second data frame constructed by the second building unit to the WiFi terminal, so that the WiFi terminal acquires the new second data frame User data.
本实施例还可以包括:  This embodiment may further include:
控制帧处理单元 122, 用于当接收到的所述 WiFi终端发送的所述 WiFi 帧为控制帧时, 将所述控制帧进行终结, 使得所述控制帧不被转发给所述基 站 AP, 并且回复给所述 WiFi终端与发送的控制帧对应的控制帧, 使得所述 WiFi终端收到所述对应的控制帧后发送所述数据帧。  The control frame processing unit 122 is configured to: when the received WiFi frame sent by the WiFi terminal is a control frame, terminate the control frame, so that the control frame is not forwarded to the base station AP, and Responding to the control frame corresponding to the sent control frame by the WiFi terminal, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
其中, 所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制帧; 所述与发送的控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧。 需要说明的是, 本实施例中的各单元为逻辑意义上的划分, 并不严格限 定实际产品中有对应这些单元的物理单元。 同时, 各逻辑单元执行相应功能 时具体实现可以参见前面各实施例中的具体实现, 这里不再详细描述。  The control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol; and the control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol. It should be noted that the units in this embodiment are logically divided, and the physical units corresponding to the units in the actual product are not strictly limited. For details, refer to the specific implementations in the foregoing embodiments, and the details are not described in detail herein.
本实施例通过中继来实现终端与中继以及基站 AP之间关联, 从而可以 让基站 AP "看到" ("感知")终端, 并且, 在关联后, 中继可以利用构建新 数据帧的方式将终端发送的数据传给基站 AP, 使得基站 AP能够在收到数据 后对数据进行处理。 而基站 AP—般都是由运营商进行部署的, 因此, 运营 商就可以实现对终端的更好的管理。 实施例五  In this embodiment, the association between the terminal and the relay and the base station AP is implemented by using the relay, so that the base station AP can "see" ("perceive") the terminal, and after the association, the relay can utilize the new data frame. The method transmits the data sent by the terminal to the base station AP, so that the base station AP can process the data after receiving the data. The base station AP is generally deployed by the operator, so the operator can achieve better management of the terminal. Embodiment 5
本实施例提供了一种 WiFi中继,用于连接 WiFi终端以及基站 AP,参见 图 13包括处理器 131以及存储器 132; This embodiment provides a WiFi relay, which is used to connect a WiFi terminal and a base station AP. Figure 13 includes a processor 131 and a memory 132;
存储器 132用于存储程序指令, 所述处理器 131用于读取并执行存储器 中存储的程序指令, 其中, 当存储在存储器 132中的所述程序指令被处理器 读取执行时, 执行如下步骤:  The memory 132 is configured to store program instructions, and the processor 131 is configured to read and execute program instructions stored in the memory, wherein when the program instructions stored in the memory 132 are read and executed by the processor, performing the following steps :
接收 WiFi终端发送的第一关联请求,所述第一关联请求中携带的源 Mac 地址为所述 WiFi终端的第一 MAC地址;  Receiving a first association request sent by the WiFi terminal, where the source MAC address carried in the first association request is the first MAC address of the WiFi terminal;
存储所述第一 MAC地址到第一关联列表;  And storing the first MAC address to the first association list;
向所述 WiFi终端发送第一关联响应, 从而完成所述 WiFi终端与所述 WiFi中继之间的关联;  Transmitting a first association response to the WiFi terminal, thereby completing an association between the WiFi terminal and the WiFi relay;
向所述基站 AP发送第二关联请求, 所述第二关联请求携带的源 MAC 地址为所述第一 MAC地址,使得所述基站 AP收到所述第二关联请求后获取 所述第一 MAC地址, 并存储到第二关联列表; 并且, 使得所述基站 AP收到 所述第二关联请求后回复第二关联响应, 所述第二响应请求中携带的目的 MAC地址为所述第一 MAC地址;  Sending a second association request to the base station AP, where the source MAC address carried by the second association request is the first MAC address, so that the base station AP acquires the first MAC after receiving the second association request An address is stored in the second association list; and the base station AP is configured to reply to the second association response after receiving the second association request, where the destination MAC address carried in the second response request is the first MAC address Address
接收所述第二关联响应,从而完成所述 WiFi终端与所述基站 AP之间的 关联;  Receiving the second association response, thereby completing an association between the WiFi terminal and the base station AP;
接收所述 WiFi终端发送的 WiFi帧;  Receiving a WiFi frame sent by the WiFi terminal;
当所述 WiFi 帧为数据帧且所述第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构建一个能发送到所述基站 AP的新数据帧, 所述新数据 帧中携带的源 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用 户数据与收到的数据帧中的用户数据相同;  When the WiFi frame is a data frame and the first association list stores a source MAC address in the data frame, reconstruct a new data frame that can be sent to the base station AP, where the new data frame carries The source MAC address is a field of the first MAC address, and the user data in the new data frame is the same as the user data in the received data frame;
向所述基站 AP发送所述新数据帧,使得所述基站 AP收到所述新数据帧 且判断所述第二关联列表存储有所述新数据帧携带的第一 MAC地址后, 对 与所述第一 MAC地址对应的所述 WiFi终端的用户数据进行业务处理。  Sending the new data frame to the base station AP, so that the base station AP receives the new data frame and determines that the second association list stores the first MAC address carried by the new data frame, The user data of the WiFi terminal corresponding to the first MAC address performs service processing.
当所述程序指令被处理器读取并执行时, 还包括执行下列步骤: 接收所述基站 AP发送的第二数据帧, 所述第二数据帧中携带的目的 MAC地址为所述第一 MAC地址; When the program instruction is read and executed by the processor, the method further includes the following steps: receiving a second data frame sent by the base station AP, and the destination carried in the second data frame The MAC address is the first MAC address;
当根据所述第一关联列表判断所述第一 MAC地址位于所述第一关联列 表时, 重新构建一个能发送到所述 WiFi终端的新第二数据帧, 所述新第二数 据帧中携带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据帧中 的用户数据为与收到的所述第二数据帧中的用户数据;  When it is determined that the first MAC address is located in the first association list according to the first association list, reconstruct a new second data frame that can be sent to the WiFi terminal, where the new second data frame is carried The destination MAC address is a field of the first MAC address, and the user data in the new data frame is the user data in the received second data frame;
向所述 WiFi终端发送所述新第二数据帧, 使得所述 WiFi终端收到所述 新第二数据帧后获取里面的用户数据。  Sending the new second data frame to the WiFi terminal, so that the WiFi terminal acquires the user data in the new second data frame.
此外, 当接收到的所述 WiFi终端发送的所述 WiFi帧为控制帧时, 将所 述控制帧进行终结, 使得所述控制帧不被转发给所述基站 AP, 并且回复给所 述 WiFi终端与发送的控制帧对应的控制帧, 使得所述 WiFi终端收到所述对 应的控制帧后发送所述数据帧。  In addition, when the received WiFi frame sent by the WiFi terminal is a control frame, the control frame is terminated, so that the control frame is not forwarded to the base station AP, and is replied to the WiFi terminal. And a control frame corresponding to the sent control frame, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
本实施例中,所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制 帧; 所述与发送的控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧; 本实施例中, 构建所述新数据帧时, 修改原来的数据帧的 BSSID字段的 值, 将其由原来标识所述 WiFi 中继的 BSSID 值改为标识所述基站 AP 的 BSSID值。  In this embodiment, the control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol, and the control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol. In this embodiment, In the new data frame, the value of the BSSID field of the original data frame is modified, and the BSSID value originally identifying the WiFi relay is changed to the BSSID value of the base station AP.
需要说明的是, 图 13为本实施例一种中继的筒化结构示意图, 更具体的 示意图可以参见图 3所示, 图 3中各物理模块的功能已经在实施例二中进行 介绍, 这里不再赘述。 本实施例中的处理器可以是图 3中的 MAC控制器或 其他具有类似处理能力的处理器, 本实施例中的存储器可以是图 3中的闪存 以及帧緩存 RAM或者其他类似的存储介质。  It should be noted that FIG. 13 is a schematic diagram of a trunking structure of a relay according to an embodiment of the present invention. For a more specific schematic diagram, reference may be made to FIG. 3, and the functions of the physical modules in FIG. 3 have been introduced in the second embodiment. No longer. The processor in this embodiment may be the MAC controller in FIG. 3 or other processors having similar processing capabilities. The memory in this embodiment may be the flash memory in FIG. 3 and the frame buffer RAM or other similar storage medium.
此外, 本领域技术人员可以理解的是, 具体实现过程中, 处理器收发 WiFi帧可以通过物理层的处理装置(如基带处理器、 RFIC、天线等)来完成, 这部分技术为本领域技术人员所公知的技术, 本实施例不再详细描述。 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存储记忆体 ( Random Access Memory, RAM )等。 In addition, those skilled in the art can understand that, in a specific implementation process, the processor can send and receive WiFi frames through physical layer processing devices (such as baseband processors, RFICs, antennas, etc.), and some of the techniques are those skilled in the art. The well-known techniques are not described in detail in this embodiment. Those skilled in the art can understand that all or part of the flow in the method of the above embodiment is implemented. The program may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, and when executed, the program may include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
上列较佳实施例, 对本发明的目的、 技术方案和优点进行了进一步详细 说明, 所应理解的是, 以上所述仅为本发明的较佳实施例而已, 并不用以限 制本发明, 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改 进等, 均应包含在本发明的保护范围之内。  The present invention has been described in detail with reference to the preferred embodiments of the present invention. All modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 书 claims
1、 一种处理 WiFi帧的方法, 其特征在于, 应用于 WiFi中继, 所述 WiFi中 继用于实现 WiFi终端以及基站接入点 AP之间的通信, 所述方法包括: 1. A method of processing WiFi frames, characterized in that it is applied to WiFi relay, and the WiFi relay is used to realize communication between WiFi terminals and base station access points AP. The method includes:
接收 WiFi终端发送的第一关联请求, 所述第一关联请求中携带的源 Mac地 址为所述 WiFi终端的第一 MAC地址; Receive the first association request sent by the WiFi terminal, where the source Mac address carried in the first association request is the first MAC address of the WiFi terminal;
存储所述第一 MAC地址到第一关联列表; Store the first MAC address in a first association list;
向所述 WiFi终端发送第一关联响应, 从而完成所述 WiFi终端与所述 WiFi 中继之间的关联; Send a first association response to the WiFi terminal, thereby completing the association between the WiFi terminal and the WiFi relay;
向所述基站 AP发送第二关联请求, 所述第二关联请求携带的源 MAC地址 为所述第一 MAC地址 ,使得所述基站 AP收到所述第二关联请求后获取所述第 一 MAC地址, 并存储到第二关联列表; 并且, 使得所述基站 AP收到所述第二 关联请求后回复第二关联响应, 所述第二响应请求中携带的目的 MAC地址为 所述第一 MAC地址; Send a second association request to the base station AP, where the source MAC address carried by the second association request is the first MAC address, so that the base station AP obtains the first MAC after receiving the second association request. address, and store it in the second association list; and, causing the base station AP to reply a second association response after receiving the second association request, and the destination MAC address carried in the second response request is the first MAC address;
接收所述第二关联响应, 从而完成所述 WiFi终端与所述基站 AP之间的关 联; Receive the second association response, thereby completing the association between the WiFi terminal and the base station AP;
接收所述 WiFi终端发送的 WiFi帧; Receive WiFi frames sent by the WiFi terminal;
当所述 WiFi帧为数据帧且所述第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构建一个能发送到所述基站 AP的新数据帧, 所述新数据帧 中携带的源 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用户数 据与收到的数据帧中的用户数据相同; When the WiFi frame is a data frame and the first association list stores the source MAC address in the data frame, a new data frame that can be sent to the base station AP is reconstructed, and the new data frame carries The source MAC address is a field of the first MAC address, and the user data in the new data frame is the same as the user data in the received data frame;
向所述基站 AP发送所述新数据帧, 使得所述基站 AP收到所述新数据帧且 判断所述第二关联列表存储有所述新数据帧携带的第一 MAC地址后, 对与所 述第一 MAC地址对应的所述 WiFi终端的用户数据进行业务处理。 Send the new data frame to the base station AP, so that after the base station AP receives the new data frame and determines that the second association list stores the first MAC address carried by the new data frame, Perform service processing on the user data of the WiFi terminal corresponding to the first MAC address.
2、 如权利要求 1所述方法, 其特征在于, 还包括: 2. The method of claim 1, further comprising:
接收所述基站 AP发送的第二数据帧, 所述第二数据帧中携带的目的 MAC 地址为所述第一 MAC地址; Receive the second data frame sent by the base station AP, the destination MAC carried in the second data frame The address is the first MAC address;
当根据所述第一关联列表判断所述第一 MAC地址位于所述第一关联列表 时, 重新构建一个能发送到所述 WiFi终端的新第二数据帧, 所述新第二数据 帧中携带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用 户数据为与收到的所述第二数据帧中的用户数据; When it is determined according to the first association list that the first MAC address is located in the first association list, a new second data frame that can be sent to the WiFi terminal is reconstructed, and the new second data frame carries The destination MAC address is the field of the first MAC address, and the user data in the new data frame is the same as the user data in the received second data frame;
向所述 WiFi终端发送所述新第二数据帧,使得所述 WiFi终端收到所述新第 二数据帧后获取里面的用户数据。 Send the new second data frame to the WiFi terminal, so that the WiFi terminal obtains the user data in the new second data frame after receiving it.
3、 如权利要求 1或 2任一所述的方法, 其特征在于, 还包括: 3. The method according to claim 1 or 2, further comprising:
当接收到的所述 WiFi终端发送的所述 WiFi帧为控制帧时,将所述控制帧进 行终结, 使得所述控制帧不被转发给所述基站 AP, 并且回复给所述 WiFi终端 与发送的控制帧对应的控制帧, 使得所述 WiFi终端收到所述对应的控制帧后 发送所述数据帧。 When the received WiFi frame sent by the WiFi terminal is a control frame, the control frame is terminated so that the control frame is not forwarded to the base station AP, and a reply is sent to the WiFi terminal and sent The control frame corresponding to the control frame causes the WiFi terminal to send the data frame after receiving the corresponding control frame.
4、 如权利要求 3所述的方法, 其特征在于: 4. The method of claim 3, characterized in that:
所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制帧; The control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol;
所述与发送的控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧。 The control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol.
5、 如权利要求 1-4任一所述的方法, 其特征在于, 所述重新构建一个能发 送到所述基站 AP的新数据帧包括: 5. The method according to any one of claims 1 to 4, wherein said reconstructing a new data frame that can be sent to the base station AP includes:
构建所述新数据帧时, 修改原来的数据帧的 BSSID字段的值, 将其由原来 标识所述 WiFi中继的 BSSID值改为标识所述基站 AP的 BSSID值。 When constructing the new data frame, modify the value of the BSSID field of the original data frame from the original BSSID value that identifies the WiFi relay to the BSSID value that identifies the base station AP.
6、 一种处理 WiFi帧的装置, 其特征在于, 应用于 WiFi中继, 所述 WiFi中 继用于实现 WiFi终端以及基站接入点 AP之间的通信, 所述装置包括: 6. A device for processing WiFi frames, characterized in that it is applied to WiFi relay, and the WiFi relay is used to realize communication between WiFi terminals and base station access points AP. The device includes:
第一关联请求接收单元, 用于接收 WiFi终端发送的第一关联请求, 所述第 一关联请求中携带的源 Mac地址为所述 WiFi终端的第一 MAC地址; 存储单元,用于将所述第一关联请求接收单元接收到的所述第一关联请求 中的第一 MAC地址存储到所述第一关联列表; The first association request receiving unit is configured to receive the first association request sent by the WiFi terminal, the The source Mac address carried in an association request is the first MAC address of the WiFi terminal; a storage unit configured to store the first MAC address in the first association request received by the first association request receiving unit to the first association list;
第一关联响应发送单元,用于所述第一关联请求接收单元接收到所述第一 关联请求后, 向所述 WiFi终端发送第一关联响应, 从而完成所述 WiFi终端与 所述 WiFi中继之间的关联; A first association response sending unit configured to send a first association response to the WiFi terminal after the first association request receiving unit receives the first association request, thereby completing the connection between the WiFi terminal and the WiFi relay. the connection between;
第二关联请求发送单元,用于在所述第一关联请求接收单元接收到所述第 一关联请求后, 向所述基站 AP发送第二关联请求, 所述第二关联请求携带的 源 MAC地址为所述第一 MAC地址, 使得所述基站 AP收到所述第二关联请求 后获取所述第一 MAC地址, 并存储到第二关联列表; 并且, 使得所述基站 AP 收到所述第二关联请求后回复第二关联响应, 所述第二响应请求中携带的目 的 MAC地址为所述第一 MAC地址; The second association request sending unit is configured to send a second association request to the base station AP after the first association request receiving unit receives the first association request. The source MAC address carried by the second association request is the first MAC address, so that the base station AP obtains the first MAC address after receiving the second association request, and stores it in the second association list; and, causes the base station AP to receive the first MAC address. Reply a second association response after the second association request, and the destination MAC address carried in the second response request is the first MAC address;
第二关联响应接收单元, 用于接收所述第二关联响应,从而完成所述 WiFi 终端与所述基站 AP之间的关联; A second association response receiving unit, configured to receive the second association response, thereby completing the association between the WiFi terminal and the base station AP;
WiFi帧接收单元, 用于接收所述 WiFi终端发送的 WiFi帧; A WiFi frame receiving unit, configured to receive WiFi frames sent by the WiFi terminal;
第一构建单元,用于当所述 WiFi帧接收单元接收的 WiFi帧为数据帧且所述 第一关联列表存储有所述数据帧中的源 MAC地址时, 重新构建一个能发送到 所述基站 AP的新数据帧, 所述新数据帧中携带的源 MAC地址为所述第一 MAC地址的字段, 所述新数据帧中的用户数据与收到的数据帧中的用户数据 相同; A first construction unit configured to reconstruct a data frame that can be sent to the base station when the WiFi frame received by the WiFi frame receiving unit is a data frame and the first association list stores the source MAC address in the data frame. A new data frame of the AP, the source MAC address carried in the new data frame is the field of the first MAC address, and the user data in the new data frame is the same as the user data in the received data frame;
数据帧发送单元, 用于向所述基站 AP发送所述第一构建单元构建的所述 新数据帧, 使得所述基站 AP收到所述新数据帧且判断所述第二关联列表存储 有所述新数据帧携带的第一 MAC地址后,对与所述第一 MAC地址对应的所述 WiFi终端的用户数据进行业务处理。 A data frame sending unit, configured to send the new data frame constructed by the first construction unit to the base station AP, so that the base station AP receives the new data frame and determines that the second association list stores After describing the first MAC address carried in the new data frame, service processing is performed on the user data of the WiFi terminal corresponding to the first MAC address.
7、 如权利要求 6所述的装置, 其特征在于, 还包括: 第二数据帧接收单元, 用于接收所述基站 AP发送的第二数据帧, 所述第 二数据帧中携带的目的 MAC地址为所述第一 MAC地址; 7. The device according to claim 6, further comprising: The second data frame receiving unit is configured to receive the second data frame sent by the base station AP, where the destination MAC address carried in the second data frame is the first MAC address;
第二构建单元,用于当根据所述第一关联列表判断所述第二数据帧接收单 元接收到的所述第二帧中的所述第一 MAC地址位于所述第一关联列表时, 重 新构建一个能发送到所述 WiFi终端的新第二数据帧, 所述新第二数据帧中携 带的目的 MAC地址为所述第一 MAC地址的字段,所述新数据帧中的用户数据 为与收到的所述第二数据帧中的用户数据; A second construction unit configured to re- Construct a new second data frame that can be sent to the WiFi terminal, the destination MAC address carried in the new second data frame is the field of the first MAC address, and the user data in the new data frame is the same as User data in the received second data frame;
第二数据帧发送单元,用于向所述 WiFi终端发送所述第二构建单元构建的 所述新第二数据帧, 使得所述 WiFi终端收到所述新第二数据帧后获取里面的 用户数据。 The second data frame sending unit is configured to send the new second data frame constructed by the second construction unit to the WiFi terminal, so that the WiFi terminal obtains the user information in the new second data frame after receiving the new second data frame. data.
8、 如权利要求 6-7任一所述的装置, 其特征在于, 还包括: 8. The device according to any one of claims 6-7, further comprising:
控制帧处理单元,用于当接收到的所述 WiFi终端发送的所述 WiFi帧为控制 帧时, 将所述控制帧进行终结, 使得所述控制帧不被转发给所述基站 AP, 并 且回复给所述 WiFi终端与发送的控制帧对应的控制帧, 使得所述 WiFi终端收 到所述对应的控制帧后发送所述数据帧。 A control frame processing unit configured to terminate the control frame when the received WiFi frame sent by the WiFi terminal is a control frame so that the control frame is not forwarded to the base station AP, and reply Give the WiFi terminal a control frame corresponding to the sent control frame, so that the WiFi terminal sends the data frame after receiving the corresponding control frame.
9、 如权利要求 8所述的装置, 其特征在于: 9. The device according to claim 8, characterized in that:
所述 WiFi终端发送的控制帧为 WiFi协议定义的 RTS控制帧; The control frame sent by the WiFi terminal is an RTS control frame defined by the WiFi protocol;
所述与发送的控制帧对应的控制帧为所述 WiFi协议定义的 CTS控制帧。 The control frame corresponding to the sent control frame is a CTS control frame defined by the WiFi protocol.
10、 如权利要求 6-9任一所述的装置, 其特征在于: 10. The device according to any one of claims 6-9, characterized in that:
所述第一构建单元包括 BSSID修改单元, 用于构建所述新数据帧时, 修改 原来的数据帧的 BSSID字段的值, 将其由原来标识所述 WiFi中继的 BSSID值 改为标识所述基站 AP的 BSSID值。 The first construction unit includes a BSSID modification unit, which is used to modify the value of the BSSID field of the original data frame from the original BSSID value that identifies the WiFi relay to the BSSID value that identifies the new data frame. BSSID value of the base station AP.
PCT/CN2013/084931 2012-10-09 2013-10-09 Method and apparatus for processing wifi frame WO2014056437A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210379730.8A CN103716860B (en) 2012-10-09 2012-10-09 Method and apparatus for processing Wifi frame
CN201210379730.8 2012-10-09

Publications (1)

Publication Number Publication Date
WO2014056437A1 true WO2014056437A1 (en) 2014-04-17

Family

ID=50409315

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084931 WO2014056437A1 (en) 2012-10-09 2013-10-09 Method and apparatus for processing wifi frame

Country Status (2)

Country Link
CN (1) CN103716860B (en)
WO (1) WO2014056437A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3557915A1 (en) * 2018-04-17 2019-10-23 Huawei Technologies Co., Ltd. Communication method in wireless local area network, device, and access point

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104113425B (en) * 2014-07-17 2017-12-05 普联技术有限公司 Set and detect method, MiFi equipment and the mobile terminal of charging mode
CN106717053B (en) * 2014-08-29 2020-11-06 株式会社东芝 Wireless communication device
CN105530681B (en) * 2014-09-28 2019-02-19 华为技术有限公司 Method for processing business and device
CN105050154A (en) * 2015-07-30 2015-11-11 青岛海尔智能家电科技有限公司 High frequency WiFi relay communication method and device
WO2017120954A1 (en) * 2016-01-17 2017-07-20 衣佳鑫 Internet of things connection-establishing method and system
CN105873086A (en) * 2016-06-16 2016-08-17 中国民用航空总局第二研究所 Airport surface wireless communication system and wireless terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110007692A1 (en) * 2008-03-14 2011-01-13 Yong Ho Seok Method and apparatus for transmitting data in dls wireless network
CN102469410A (en) * 2010-11-02 2012-05-23 中国移动通信集团公司 Method, equipment and system for transmitting data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050243769A1 (en) * 2004-04-28 2005-11-03 Walker Jesse R Apparatus and method capable of pre-keying associations in a wireless local area network
CN102143509B (en) * 2010-12-16 2014-04-02 华为终端有限公司 Method, device and system for managing wireless repeater by using access point (AP)

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110007692A1 (en) * 2008-03-14 2011-01-13 Yong Ho Seok Method and apparatus for transmitting data in dls wireless network
CN102469410A (en) * 2010-11-02 2012-05-23 中国移动通信集团公司 Method, equipment and system for transmitting data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3557915A1 (en) * 2018-04-17 2019-10-23 Huawei Technologies Co., Ltd. Communication method in wireless local area network, device, and access point

Also Published As

Publication number Publication date
CN103716860B (en) 2017-02-01
CN103716860A (en) 2014-04-09

Similar Documents

Publication Publication Date Title
US8325679B2 (en) Interworking of networks with single radio handover
WO2014056437A1 (en) Method and apparatus for processing wifi frame
RU2602338C1 (en) Method of relaying wireless relay device and wireless relay device
US9008041B2 (en) Processing method supporting handover, communication apparatus, and communication system
US9119121B2 (en) Systems and methods for WLAN roaming
JP2017538345A (en) Method, apparatus and system
US20080159242A1 (en) Personal area network implementation within an infrastructure network
WO2007149598A1 (en) System and method for provisioning of emergency calls in a shared resource network
WO2016109921A1 (en) Data transmission method, station, access point and access controller
WO2010130191A1 (en) Authentication method of switching access networks, system and device thereof
CN102026163B (en) Method and device for selecting access to Internet through wireless fidelity access network
WO2008106880A1 (en) Methods, wireless communication systems, mobile relay stations and base stations of ms network entry
CN104066083B (en) Method and device for accessing wireless local area network
CN114071510A (en) Communication method and device
WO2006074592A1 (en) A method and device for supporting multiple logic networks in the wlan
WO2010130198A1 (en) Method, system and equipment for handover between access networks
CN111917626B (en) Centralized forwarding method for Wlan AC service data and electronic equipment
EP4090081A1 (en) Method and apparatus for automatic access of internet of things device to wireless local area network
WO2022048441A1 (en) Application data transmission method, system, and electronic device
TWI416903B (en) Method and apparatus for communicating over multiple networks
WO2011091630A1 (en) Method and system for data transmission in wireless fidelity (wifi) network
TWI820874B (en) Transmission method and apparatus applied to channel direct link establishment
JP2013066001A (en) Wireless communication device
WO2022242749A1 (en) Data transmission method, communication apparatus, computer-readable storage medium and chip
WO2015089717A1 (en) Station access method, station apparatus, and access system

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: 13845564

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: 13845564

Country of ref document: EP

Kind code of ref document: A1