CN109922164A - A kind of address conversion method, device and computer storage medium - Google Patents

A kind of address conversion method, device and computer storage medium Download PDF

Info

Publication number
CN109922164A
CN109922164A CN201910111568.3A CN201910111568A CN109922164A CN 109922164 A CN109922164 A CN 109922164A CN 201910111568 A CN201910111568 A CN 201910111568A CN 109922164 A CN109922164 A CN 109922164A
Authority
CN
China
Prior art keywords
data message
address
type
mac
client interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910111568.3A
Other languages
Chinese (zh)
Other versions
CN109922164B (en
Inventor
林进全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910111568.3A priority Critical patent/CN109922164B/en
Publication of CN109922164A publication Critical patent/CN109922164A/en
Application granted granted Critical
Publication of CN109922164B publication Critical patent/CN109922164B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the present application discloses a kind of address conversion method, device and computer storage medium, this method is applied to terminal device, this method comprises: after the bridge mode of opening terminal apparatus, data message is received, the bridge mode is shared for realizing the WLAN WLAN of terminal device;According to the data message received, determine the type of the data message, the type of the data message includes by the client interface of terminal device to Second Type corresponding to the first kind corresponding to network side forwarding data packets and the data message forwarded by the client interface from network side;When the type of the data message is the first kind, address conversion is carried out to the transmission address in the data message;When the type of the data message is Second Type, address conversion is carried out to the reception address in the data message;After generating new data message according to the address conversion, the new data message is sent.

Description

A kind of address conversion method, device and computer storage medium
Technical field
This application involves wireless communication technology fields more particularly to a kind of address conversion method, device and computer to deposit Storage media.
Background technique
With intelligent terminal apply continuous development, WLAN (Wireless Local Area Networks, WLAN) hot spot function has become one of standard configuration module of intelligent terminal.And Wireless Fidelity (Wireless Fidelity, WiFi) as one of WLAN technology wireless access way, the WLAN hot spot function of intelligent terminal is opened, intelligent terminal will WiFi network is shared with other users (referred to as WLAN shared) by hot spot function, so that other wireless sites (Station, STA terminal device) can connect and access network.
For other wireless sites, need by network address translation (Network Address Translation, NAT) and client (client) interface could access far-end network.In existing network access procedure, one side NAT turns It changes and needs to consume central processing unit (Central Processing Unit, CPU) resource, and will affect nothing when cpu resource anxiety Line handling capacity;The thin-skinned wireless access point of another party (Soft Access Point, Soft AP) must also be provided with DynamicHost Protocol server (Dynamic Host Configuration Protocol Server, DHCP Server) is arranged to service simultaneously Safeguard local ip address resource, at the same Soft AP also need to avoid with wireless routing access point (Root Access Point, Root AP) between gateway conflict.
Summary of the invention
The main purpose of the application is to propose a kind of address conversion method, device and computer storage medium, passes through Increase address translation engine (Address Translation Engine, ATE) mechanism in client driving end to realize ground The updating maintenance of location conversion and address translation table efficiently solves the consumption of cpu resource brought by existing scheme and gateway conflict Problem, the WLAN being better achieved under bridge mode are shared.
In order to achieve the above objectives, the technical solution of the application is achieved in that
In a first aspect, the embodiment of the present application provides a kind of address conversion method, the method is applied to terminal device, institute The method of stating includes:
After the bridge mode of opening terminal apparatus, data message is received;Wherein, the bridge mode is for realizing institute The WLAN for stating terminal device is shared;
According to the data message received, the type of the data message is determined;Wherein, the type packet of the data message It includes and the first kind corresponding to the data message is forwarded to network side by the client interface of terminal device and is passed through described Second Type corresponding to the data message that client interface is forwarded from network side;
When the type of the data message is the first kind, address is carried out to the transmission address in the data message and is turned It changes;When the type of the data message is Second Type, address conversion is carried out to the reception address in the data message;
After generating new data message according to the address conversion, the new data message is sent.
Second aspect, the embodiment of the present application provide a kind of address converting device, and the address converting device is applied to eventually End equipment, the address converting device include: receiving unit, determination unit, converting unit and transmission unit, wherein
The receiving unit is configured to after the bridge mode of opening terminal apparatus, receives data message;Wherein, institute It is shared for realizing the WLAN of the terminal device to state bridge mode;
The determination unit is configured to determine the type of the data message according to the data message received;Wherein, The type of the data message includes being forwarded corresponding to the data message by the client interface of terminal device to network side The first kind and the data message that is forwarded by the client interface from network side corresponding to second Type;
The converting unit is configured to when the type of the data message is the first kind, in the data message Transmission address carry out address conversion;When the type of the data message is Second Type, to connecing in the data message It receives address and carries out address conversion;
The transmission unit is configured to after generating new data message according to the address conversion, sends the new number According to message.
The third aspect, the embodiment of the present application provide a kind of address converting device, and the address converting device includes: storage Device and processor;Wherein,
The memory, for storing the computer program that can be run on the processor;
The processor, for the step of when running the computer program, executing method as described in relation to the first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer storage medium, the computer storage medium storage There is an address translator, method as described in relation to the first aspect is realized when the address translator is executed by least one processor Step.
A kind of address conversion method, device provided by the embodiment of the present application and computer storage medium, this method are answered For terminal device, after the bridge mode of opening terminal apparatus, data message is received;Wherein, the bridge mode is used for Realize that the WLAN of the terminal device is shared;Then according to the data message received, the type of the data message is determined;Its In, the type of the data message includes forwarding the data message institute right to network side by the client interface of terminal device Corresponding to the first kind answered and the data message forwarded by the client interface from network side Two types;When the type of the data message is the first kind, address is carried out to the transmission address in the data message and is turned It changes;When the type of the data message is Second Type, address conversion is carried out to the reception address in the data message;Most After generating new data message according to the address conversion afterwards, the new data message is sent;In this way, since terminal device is adopted It is shared that WLAN is realized with bridge mode, and increases ATE mechanism in the client interface of terminal device to realize data The address conversion for sending address or receiving address in message, to efficiently solve cpu resource brought by existing scheme It is shared that WLAN has been better achieved in consumption and gateway collision problem.
Detailed description of the invention
Fig. 1 is a kind of composed structure schematic diagram for classical network topology that related art scheme provides;
Fig. 2 is a kind of flow diagram of address conversion method provided by the embodiments of the present application;
Fig. 3 is a kind of composed structure schematic diagram of bridge mode network topology provided by the embodiments of the present application;
Fig. 4 is the composed structure schematic diagram of another bridge mode network topology provided by the embodiments of the present application;
Fig. 5 is a kind of composed structure schematic diagram of address translation table provided by the embodiments of the present application;
Fig. 6 is a kind of composed structure schematic diagram of address converting device provided by the embodiments of the present application;
Fig. 7 is a kind of specific hardware structure schematic diagram of address converting device provided by the embodiments of the present application;
Fig. 8 is a kind of composed structure schematic diagram of terminal device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description.
With the fast development that intelligent terminal and mobile Internet are applied, so that mobile data flow is to be difficult to estimate Speed increase sharply.In order to which flow pressure is effectively relieved, persistently pushes the development of mobile communication business, the more and more operations in the whole world WLAN technology is greatly developed in quotient's selection.Due to WLAN have the characteristics that speed it is fast, removable, easy extension and it is at low cost, at present it is several All terminal devices are all using WLAN technology as basic configuration.In this way, the WLAN hot spot function for the equipment that opens a terminal, eventually End equipment can be connected for the other users in certain coverage area and be used as mobile hot spot.
Wherein, WiFi Tehering is very widely used in terminal device, and WiFi network is mainly passed through hot spot function Other users can be shared with, it is shared to be referred to as WLAN.It is shared using WLAN, other terminal devices can be enabled to connect And network is accessed, and the composed structure example of common WiFi Tehering network topology is as shown in Figure 1.Net shown in Fig. 1 In network topological structure, which includes wireless router access point (being indicated with Root AP), the terminal for having hot spot function Equipment (being indicated with STA0) and surrounding wireless access website (being indicated with STA1), STA0 further include client (Client) interface and Soft wireless access point (Soft AP) interface;Wherein, STA0 is connect with Root AP by Client interface to access network, and STA1 realizes that WLAN is shared to access network by Soft AP interface and STA0;And STA1 will access network and then have to pass through NAT Conversion (including in STA0 source address conversion (Source NAT, SNAT) and destination address convert (Destination NAT, DNAT)) and Client interface could access far-end network (such as Root AP).
Based on network topology structure shown in FIG. 1, in Root AP, gateway (Gateway) is assumed to 192.168.0.1, DHCP Server is assumed to 192.168.0.100/200, the corresponding basic service set identifier (Basic of Root AP Service Set Identifier, BSSID) it is indicated with RootAP-BSSID, BSSID is actually expressed as the MAC of Root AP Address, for identifying the basic service set (Basic Service Se, BSS) that the side Root AP is managed, RootAP-BSSID is false It is set to xx:xx:xx:xx:xx:x0;In STA0, for Client interface side, the corresponding media access control of Client interface The address (Media Access Control, MAC) indicates that Client-MAC is assumed to xx:xx:xx:xx with Client-MAC: The address the corresponding Internet protocol of xx:x4, Client interface (Internet Protocol, IP) indicates with Client-IP, Client-IP is assumed to 192.168.0.100;For Soft AP interface side, gateway (Gateway) is assumed to 192.168.43.1 DHCP Server is assumed to 192.168.43.100/200, AP-BSSID is assumed to xx:xx:xx:xx: xx:x3;In STA1, the corresponding MAC Address of STA1 indicates that STA1-MAC is assumed to xx:xx:xx:xx:xx with STA1-MAC: The corresponding IP address of x1, STA1 indicates that STA1-IP is assumed to 192.168.43.100 with STA1-IP.
Specifically, to may be implemented WLAN shared by opening WiFi Tehering hot spot function by STA0, and the one of STA0 A network interface (i.e. Client interface) connect with Root AP, and gets from the DHCP Server of Root AP Client-IP is 192.168.0.100, and then STA0 can access wireless network by Client interface;And STA0's is another Network interface (i.e. Soft AP interface) is then supplied to wireless site (such as STA1) around to access point mode, then STA1 from It is 192.168.43.100 that DHCP Server in Soft AP, which gets corresponding STA1-IP, and such STA1 also can be real Existing network access.Network topology structure according to figure 1, if STA1 will access far-end network, have to pass through NAT conversion with And far-end network could be accessed by Client interface;But following defect is still had in network topology structure shown in FIG. 1: One side NAT conversion needs to carry out in protocol stack and can consume cpu resource, especially cpu resource anxiety when will affect and wirelessly gulp down The amount of spitting;The side another aspect Soft AP is necessarily provided with DHCP Server and services and safeguard local ip address resource, simultaneously because The setting of the side Soft AP gateway is different from the side Root AP, it is also necessary to avoid gateway conflict.
In order to solve above-mentioned defect problem, the embodiment of the present application provides a kind of address conversion method, this method application In the terminal device with bridge joint (bridge) mode, after the bridge mode of opening terminal apparatus, datagram is received first Text;Then according to the data message received, the type of the data message is determined;Wherein, the type packet of the data message It includes and the first kind corresponding to the data message is forwarded to network side by the client interface of terminal device and is passed through described Second Type corresponding to the data message that client interface is forwarded from network side;When the data message When type is the first kind, address conversion is carried out to the transmission address in the data message;When the type of the data message When for Second Type, address conversion is carried out to the reception address in the data message;Finally generated according to the address conversion After new data message, the new data message is sent;Since terminal device realizes that WLAN is shared using bridge mode, and And ATE mechanism is increased in the client interface of terminal device to realize the transmission address in data message or receive address Address conversion, thus efficiently solve cpu resource brought by existing scheme consumption and gateway collision problem, be better achieved WLAN is shared.
Each embodiment of the application is described in detail below in conjunction with attached drawing.
Referring to fig. 2, it illustrates a kind of address conversion method provided by the embodiments of the present application, this method is set applied to terminal Standby, this method may include:
S201: after the bridge mode of opening terminal apparatus, data message is received;Wherein, the bridge mode is used for Realize that the WLAN of the terminal device is shared;
S202: according to the data message received, the type of the data message is determined;Wherein, the data message Type includes forwarding the first kind corresponding to the data message to network side by the client interface of terminal device and leading to Cross Second Type corresponding to the data message that the client interface is forwarded from network side;
S203: when the type of the data message is the first kind, the transmission address in the data message is carried out Address conversion;When the type of the data message is Second Type, address is carried out to the reception address in the data message Conversion;
S204: after generating new data message according to the address conversion, the new data message is sent.
It should be noted that the data message that the embodiment of the present application is transmitted, it is not limited to which data information can also be Solicited message, even other types information, the embodiment of the present application are not especially limited.
It should also be noted that, bridge mode (also referred to as bridge mode) is the bridging functionality using terminal device, it can It is wirelessly connected with being established with network side (such as wireless router, base station etc.), to issue newly wireless by terminal device itself Signal efficiently solves the problems, such as that signal is weak and the wireless coverage of signal blind spot to form new wireless coverage.That is, Terminal device may be implemented WLAN by using bridge mode and share;In this way, the wireless router of terminal device and network side it Between establish network connection to access far-end network, and surrounding wireless site (such as the first wireless site and second wireless site) is logical It crosses the shared also accessible network of WLAN and carries out data and interactively communicate.
It is to be appreciated that data transmission between wireless site uses the rule of 802.11 agreement of IEEE in WLAN is shared It is fixed.Wherein, IEEE 802.11 is the general standard agreement of WLAN.According to the regulation of 802.11 agreement of IEEE, for Mac frame format is usually used in the frame format of data message.Referring to table 1, it illustrates a kind of bases provided by the embodiments of the present application The composed structure example of plinth type mac frame format;It as shown in table 1, include Address1, Address2 in mac frame, 4 address fields such as Address3, Address4, wherein Address1 is fixed to be expressed as receiving address (Receiver Address, RA), Address2 is fixed to be expressed as sending address (Transmitter Address, TA), and Address3 is depended on Network type used in mac frame, for providing the filtering of access point Yu distributed system (Distributed System, DS) It is used, Address4 is temporarily not used.In some cases, receiving address can the address (Destination for the purpose of Address, Dest Address or DA), sending address can be source address (Source Address, SA), but the application Embodiment is not especially limited.In addition, also including the fields such as To DS and From DS in mac frame;Wherein, To DS:1 is indicated The mac frame of the side wireless router AP is sent to from the side wireless site STA, 1 indicates other mac frames;From DS:1 indicate from The mac frame of the side wireless router AP, 0 indicates other mac frames.
Table 1
It can be seen that (the i.e. To when mac frame is sent to the wireless router side AP by the side wireless site STA according to table 1 AP), it is that 0, Address1 can be set to the corresponding BSSID in the side AP that To DS, which is 1, From DS, at this time, wherein BSSID is practical On be expressed as the MAC Address of AP;Address2 can be set to the MAC Address (being indicated with SA) of STA, and Address3 indicates MAC Destination address transmitted by frame (is indicated) with DA, if destination address transmitted by mac frame is the side AP, Address3 can be equal to Address1;
When mac frame is sent to the wireless site side STA by the side wireless router AP (i.e. From AP), since the mac frame comes Derived from DS, it is the MAC Address that 1, Address1 can be set to STA that To DS, which is 0, From DS, at this time, i.e., transmitted by mac frame Destination address (is indicated) with DA;Address2 can be set to the corresponding BSSID in the side AP, and Address3 is indicated transmitted by mac frame Source address, if source address transmitted by mac frame is the side AP, Address3 can be equal to Address2.
Referring to Fig. 3, it illustrates a kind of composed structure signals of bridge mode network topology provided by the embodiments of the present application Figure;As shown in figure 3, the topological structure includes wireless router access point (being indicated with Root AP), the terminal for having bridge mode Equipment (being indicated with STA0) and surrounding wireless access website (being indicated with STA1 and STA2);Wherein, STA0 includes Client interface With AP interface, and Client interface and AP interface are located in the same bridge (bridge);STA0, STA1 and STA2 can lead to Root AP is crossed to access network, but also needs the forwarding of STA0 progress data message when STA1 access network.
Based on network topology structure shown in Fig. 3, in Root AP, gateway (Gateway) is assumed to 192.168.0.1, DHCP Server is assumed to 192.168.0.100/200, and RootAP-BSSID is assumed to xx:xx:xx:xx:xx:x0;In STA0 In, for Client interface side, the corresponding MAC Address of Client interface indicates that Client-MAC is assumed to Client-MAC The corresponding IP address of xx:xx:xx:xx:xx:x4, Client interface indicates that Client-IP is assumed to Client-IP 192.168.0.100;For AP interface side, AP-BSSID is assumed to xx:xx:xx:xx:xx:x3;In STA1, STA1 is corresponding MAC Address indicate that STA1-MAC is assumed to xx:xx:xx:xx:xx:x1 with STA1-MAC, the corresponding IP address of STA1 is used STA1-IP indicates that STA1-IP is assumed to 192.168.43.100.From figure 3, it can be seen that the STA0 in the embodiment of the present application Have bridge mode, and Client interface in STA0 and AP interface are located in the same bridge, at this time in STA0 without The setting of DHCP Server and Soft AP gateway need to be carried out, to also avoid gateway conflict that may be present.
In some embodiments, before the reception data message, the method also includes:
Establish the network connection between the terminal device and the wireless router of network side;
Based on the bridge mode of the terminal device, controls the first wireless site and the second wireless site passes through the terminal It is shared that equipment carries out WLAN.
Further, in some embodiments, the reception data message, comprising:
It is shared based on the WLAN, judge whether the data message meets the media access control MAC frame of WLAN protocol Format;
When the data message meets the mac frame format of WLAN protocol, the data message is received;
After the reception data message, the method also includes:
In the bridge of the terminal device, the data message of mac frame format is converted to the data of ethernet frame format Message;It wherein, include client interface and wireless access point AP interface, the ethernet format in the bridge of the terminal device Data message between the client interface and the AP interface carry out data message interaction.
Further, in some embodiments, the type of the determination data message, comprising:
When forwarding the data message of mac frame format to the wireless router of network side by the client interface, obtain The MAC Address that address is the first wireless site of sending into the data message, determines that the type of the data message is The first kind;Wherein, the data message of the first kind is to be sent by the first wireless site and passed through the terminal device The client interface is forwarded to after AP interface;
When the data of the mac frame format forwarded by the client interface from the wireless router of network side When message, the MAC Address that address is wireless router of sending in the data message is obtained, determines the data message Type is Second Type;Wherein, the data message of the Second Type be sent by the second wireless site and passed through it is described wireless Router is forwarded to the client interface.
It should be noted that the client interface and AP interface of terminal device are located in the same bridge, terminal at this time It has been not necessarily to carry out the setting of DHCP Server and Soft AP gateway in equipment, to also avoid gateway that may be present Conflict.Terminal device and wireless router, which are established, to be connected to the network, and the first wireless site and the second wireless site are set by terminal Standby bridge mode is able to carry out data interaction communication.Wherein, data message transmitted by the first wireless site or by wireless The data message that router side is forwarded is the data message of mac frame format, it is the data packet frame propagated in air, can With referred to as Air Packet Frame;The data message of mac frame format can be converted to ethernet frame format in bridge Data message, it is the data packet frame propagated in bridge, is referred to as Bridge Packet Frame at this time;Then should Data message will continue to send with the data message of mac frame format.
It should also be noted that, the transmission of data message includes two kinds of situations: one is data messages by wireless site STA Side is sent to the wireless router AP (i.e. To AP) of network side by client interface, another is data message by network The wireless router AP of side is sent to the side wireless site STA (i.e. From AP) by client interface.In this way, for different The transmission address of situation, data message is also different;For example client interface is passed through to wireless routing from the first wireless site The data message that device is forwarded, the data message send the MAC Address that address is the first wireless site, the class of the data message Type is known as the first kind;Such as the data message forwarded by client interface from wireless router, the data Message sends the MAC Address that address is wireless router, and the type of the data message is known as Second Type.
Illustratively, it by taking network topology structure shown in Fig. 3 as an example, according to the regulation of 802.11 agreement of IEEE, obtains The data message of mac frame format can use Data [To DS, From DS, Address1, Address2, Address3, Source IP, Dest IP] it indicates, and the data message that ethernet frame format is obtained in Bridge can use Data [Dest Address, Source Address, Source IP, Dest IP] it indicates.In the interactive process of data message, it is assumed that first Wireless site is STA1, and the second wireless site is STA2, send STA2 for data message by STA1, at this time the data message Type is the first kind, and STA0 will receive the data message of mac frame format transmitted by STA1 by AP interface, use Data [1,0, AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP, STA2-IP] is indicated, then by Client interface by the MAC The data message forwarding of frame format is to the side Root AP;Wherein, the driving of Client interface side can will also receive in bridge The data message of mac frame format is converted to the data message of ethernet frame format, with Data [STA2-MAC, STA1-MAC, STA1-IP, STA2-IP] it indicates;Similarly, it is assumed that the first wireless site is STA1, and the second wireless site is STA2, will by STA2 Data message is sent to STA1, and the type of the data message is Second Type at this time, and STA0 will be received by client interface The data message of mac frame format transmitted by STA2, the data message are to be forwarded by STA2 by Root AP, with Data [0, 1, Client-MAC, Root AP-MAC, STA2-MAC, STA2-IP, STA1-IP] it indicates;Wherein, the Client in bridge Interface side drives the data message that the data message of the mac frame format received can be also converted to Ethernet protocol format, uses Data [Client-MAC, STA2-MAC, STA2-IP, STA1-IP] is indicated.
It is to be appreciated that be directed to the first kind data message, if send address Address2 using source address (such as STA1-MAC shown in Fig. 3), then the side Root AP will can not identify and abandon the data message of the mac frame format, this Shi Bixu unsteady state operation Address2 is Client-MAC, just can ensure that the side Root AP normally receives the data message; Similarly, for the data message of Second Type, in bridge, the data message of mac frame format is converted into ethernet frame lattice The data message of formula, if destination address Dest Address, which is used, receives address (than Client-MAC as shown in Figure 3), So bridge meeting can not be normally by the data message forwarding of the ethernet frame format to AP interface, at this time must unsteady state operation Dest Address is STA1-MAC, i.e., the reception address Address1 in the data message of mac frame format is converted to STA1- MAC can ensure that STA1 normally receives the data message in this way.That is, in order to guarantee data message just Often interaction needs to increase ATE mechanism in the client interface side driving of terminal device to carry out address conversion and address conversion The updating maintenance of table, to solve the consumption of cpu resource brought by existing scheme and gateway collision problem.
In some embodiments, after the type of the determination data message, the method also includes:
By the address translation engine ATE in the client interface, stored address translation table is obtained;Wherein, institute Address translation table is stated to be used for the transmission address in the data message and/or receive address progress address conversion processing.
Further, in some embodiments, described to the number when the type of the data message is the first kind Address conversion is carried out according to the transmission address in message, comprising:
The data message from the first wireless site into the transmission process of the second wireless site, according to the ground got Transmission address in the data message is converted to the client by the MAC Address of the first wireless site and connect by location conversion table The MAC Address of mouth, obtains new data message.
Further, in some embodiments, described to the number when the type of the data message is Second Type Address conversion is carried out according to the reception address in message, comprising:
The data message from the second wireless site into the transmission process of the first wireless site, according to the ground got Reception address in the data message is converted to first nothing by the MAC Address of the client interface by location conversion table The MAC Address of line website obtains new data message.
It should be noted that increasing ATE mechanism in the client interface side driving of terminal device;In this way, working as data message Type be the first kind when, i.e., the datagram of the mac frame format forwarded by the client interface to wireless router side Text can be turned by carrying out address to the transmission address Address2 in data message from the address translation table got in ATE It changes, is converted into Client-MAC, obtain new data message;When the type of data message is Second Type, that is, pass through The data message for the mac frame format that the Client interface is forwarded from wireless router side, can be by from ATE The address translation table got carries out address conversion to the reception address Address1 in data message, is converted into really The MAC Address (such as MAC Address of the first wireless site) of STA then will obtain new data message and pass through the AP interface It is forwarded to the first wireless site.
Illustratively, still by taking network topology structure shown in Fig. 3 as an example, it is assumed that data message is sent STA2 by STA1, So the type of the data message is the first kind, and STA0 will receive mac frame format transmitted by STA1 by AP interface Data message is indicated with Data [1,0, AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP, STA2-IP];In bridge In, which can then be converted to ethernet frame format, with Data [STA2-MAC, STA1-MAC, STA1-IP, STA2-IP] It indicates;Then the side Root AP is sent according to mac frame format by the data message by Client interface again, wherein if sent Address Address2 uses source address (such as STA1-MAC in Fig. 3), then the obtained mac frame format in the side Root AP Data message is Data [1,0, Root AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP, STA2-IP], due to sending Address Address2 is STA1-MAC, it will causes the side Root AP that can not identify the data message of the mac frame format and directly lose It abandons, it is Client-MAC, the i.e. side Root AP institute that address Address2 unsteady state operation will be sent by address translation table at this time by, which needing, The data message of obtained mac frame format is Data [1,0, Root AP-BSSID, Client-MAC, STA2-MAC, STA1- IP, STA2-IP], it just may insure that the side Root AP can normally receive the data message in this way.Similarly, it is assumed that STA2 is by data Message is sent to STA1, then the type of the data message is Second Type, STA0 will receive Root by Client interface The data message for the mac frame format that the side AP is forwarded, with Data [0,1, Client-MAC, Root AP-BSSID, STA2-MAC, STA2-IP, STA1-IP] it indicates;In bridge, which can then be converted to ethernet frame format, use Data [Client-MAC, STA2-MAC, STA2-IP, STA1-IP] is indicated;Then again by Client interface by the data message according to Ethernet frame format is sent to AP interface side, is forwarded to STA1 by AP interface;Wherein, in bridge, if destination address Dest Address is using address (such as Client-MAC in Fig. 3) is received, then the obtained ether of Client interface side The data message of net frame format will will lead to bridge and it normally can not be forwarded to AP interface and directly be abandoned, and need to lead at this time Crossing address translation table and receiving address Address1 unsteady state operation is STA1-MAC, i.e., is forwarded by AP interface to the side STA1 The data message of mac frame format is Data [0,1, STA1-MAC, AP-BSSID, STA2-MAC, STA2-IP, STA1-IP], this Sample just may insure that the side STA1 can normally receive the data message.
Referring to fig. 4, it illustrates the composed structures of another bridge mode network topology provided by the embodiments of the present application to show It is intended to;As shown in figure 4, increasing ATE mechanism on the basis of Fig. 3;Specifically, the client in Root AP and STA0 connects Between mouthful, can by the address translation table that is stored in ATE mechanism to the transmission address of data message or receive address into Row address conversion, to ensure that data message can normally be sent.It wherein, include that network address translation table (is used in the ATE mechanism ATE Table is indicated);And it may include the address translation table of multiple protocol suites in ATE Table, such as address resolution protocol (Address Resolution Protocol, ARP) address translation table (being indicated with ARP Table), DHCP protocol address conversion Table (being indicated with DHCP Table) and the address (Internet Protocol Version 4, IPV4) of Internet protocol the 4th edition turn Table (being indicated with IPV4Table) etc. is changed, the embodiment of the present application is not especially limited this.
In the embodiment of the present application, it will be specifically described by taking IPV4 address translation table as an example below, but the application is implemented Example is equally applicable to the address translation table of other protocol suites.Referring to Fig. 5, it illustrates a kind of addresses provided by the embodiments of the present application The composed structure schematic diagram of conversion table;As shown in figure 5, IPV4 address translation table includes association by taking IPV4 address translation table as an example Discuss (protocol) and entry (Entry);Wherein, Entry may include multinomial entry (such as entry1, Entry2 ...), and each Entry record can be indicated with [entryindex MAC IP], here Entryindex is expressed as the index value of entry;Than as shown in Figure 5, when entryindex is entry1, then entry1 Xx:xx:xx:xx:xx:x4 and 192.168.0.104 are had recorded, [entry1xx:xx:xx:xx:xx:x4 can be expressed as 192.168.0.104];When entryindex be entry2 when, then entry2 have recorded xx:xx:xx:xx:xx:x1 and 192.168.0.101 [entry2xx:xx:xx:xx:xx:x1 192.168.0.101] can be expressed as.
Further, in some embodiments, when the type of the data message is the first kind, the method is also wrapped It includes:
In the bridge of the terminal device, the data message of mac frame format is converted to the data of ethernet frame format Message, and the client interface is sent by the data message of the ethernet frame format;
Obtain MAC Address corresponding with source address in the data message and internet protocol address;
According to the MAC Address and the IP address got, by the ATE in the client interface to being stored Address translation table be updated.
Further, in some embodiments, described according to acquisition when the type of the data message is Second Type The address translation table arrived is converted to by the MAC Address of the client interface reception address in the data message described The MAC Address of first wireless site, comprising:
Pass through the data message of the client interface mac frame format;
According to the corresponding IP address of destination address in the data message, inquiry and the IP from the address translation table The corresponding MAC Address in address;
Using the MAC Address inquired as the reception address in the data message;Wherein, the MAC inquired Location is the MAC Address of first wireless site.
It should be noted that IPV4 address translation table as shown in connection with fig. 5, when the type of data message is the first kind When, i.e., the data message of mac frame format, by taking Fig. 4 as an example, the first radio station are forwarded to wireless router side by client interface Point is STA1, and the second wireless site is STA2, it is assumed that is sent datagram from STA1 to STA2, at this time in terminal device In bridge, the data message of mac frame format can be converted to data message (such as the institute in Fig. 4 of ethernet frame format first The Data [STA2-MAC, STA1-MAC, STA1-IP, STA2-IP] shown), then the data message of the ethernet frame format is sent To client interface;The update for starting addresses forwarding table by ATE in client interface side, such as ethernet frame format Source Address and Source IP in data message is updated to [entryindex STA1-MAC STA1-IP]; The corresponding entryindex of source address is determined first, it is assumed that the entryindex is entry2 shown in fig. 5, then from Fig. 5 The corresponding entry of available source address is [entry2xx:xx:xx:xx:xx:x1 192.168.0.101], can also be obtained It is respectively xx:xx:xx:xx:xx:x1 and 192.168.0.101 to the corresponding MAC Address of source address and IP address, over the ground with this Location conversion table is updated, to realize the maintenance to address translation table, and it is equally applicable to other protocol suites and corresponds to Address translation table update and maintenance;In this way, when setting up mac frame again from client interface to the forwarding of wireless router side When the data message of format, the transmission address Address2 in the data message of mac frame format is converted into Client- at this time MAC, and be ultimately forwarded to the data message of the mac frame format of wireless router side with Data [1,0, RootAP-BSSID, Client-MAC, STA2-MAC, STA1-IP, STA2-IP] it is indicated.
It should also be noted that, IPV4 address translation table as shown in connection with fig. 5, when the type of data message is Second Type When, i.e., by client interface from the data message of the mac frame format of wireless router side, by taking Fig. 4 as an example, first Wireless site is STA1, and the second wireless site is STA2, it is assumed that is sent datagram from STA2 to STA1, at this time in terminal device Bridge in, first can by client interface received mac frame format data message (than Data as shown in Figure 4 [0,1, Client-MAC, RootAP-MAC, STA2-MAC, STA2-IP, STA1-IP]) be converted to the data of ethernet frame format Message, then AP interface is sent by the data message of the ethernet frame format;Start address by ATE in client interface side to turn It delivers, carries out address conversion such as Dest Address in the data message of ethernet frame format, pass through Dest IP first Corresponding MAC Address can be inquired from address translation table, for example is found from address translation table corresponding Entry is [entryindex STA1-MAC STA1-IP], can be confirmed out that the MAC Address inquired is STA1-MAC;In this way, When being forwarded from AP interface to the side STA1 and set up the data message of mac frame format again, needed at this time by the number of mac frame format STA1-MAC is converted to according to the reception address Address1 in message, is ultimately forwarded to the obtained mac frame lattice in the side STA1 in this way The data message of formula is indicated with Data [0,1, STA1-MAC, AP-BSSID, STA2-MAC, STA2-IP, STA1-IP], from And ensure normal transmission of the data message between STA1 and STA2.
Above mentioned embodiment provide a kind of address conversion methods, and this method is applied to terminal device, in opening terminal apparatus Bridge mode after, receive data message;Wherein, the bridge mode is shared for realizing the WLAN of the terminal device; According to the data message received, the type of the data message is determined;Wherein, the type of the data message includes passing through end The client interface of end equipment forwards the first kind corresponding to the data message to network side and is connect by the client Mouth receives Second Type corresponding to the data message forwarded from network side;When the type of the data message is the When one type, address conversion is carried out to the transmission address in the data message;When the type of the data message is the second class When type, address conversion is carried out to the reception address in the data message;New data message is generated according to the address conversion Afterwards, the new data message is sent;In this way, since terminal device realizes that WLAN is shared using bridge mode, but also ATE mechanism is increased in the client interface of terminal device to realize the update of the address conversion and address translation table of data message WLAN has been better achieved to efficiently solve the consumption of cpu resource brought by existing scheme and gateway collision problem in maintenance It is shared.
Based on the identical inventive concept of previous embodiment, referring to Fig. 6, it illustrates it is provided by the embodiments of the present application a kind ofly The composed structure example of location conversion equipment 60, the address converting device 60 are applied to terminal device, the client of the terminal device Interface and AP interface are in the same bridge, the address converting device 60 may include: receiving unit 601, determination unit 602, converting unit 603 and transmission unit 604, wherein the receiving unit 601 is configured to the bridge joint in opening terminal apparatus After mode, data message is received;Wherein, the bridge mode is shared for realizing the WLAN of the terminal device;
The determination unit 602 is configured to determine the type of the data message according to the data message received;Its In, the type of the data message includes forwarding the data message institute right to network side by the client interface of terminal device Corresponding to the first kind answered and the data message forwarded by the client interface from network side Two types;
The converting unit 603 is configured to when the type of the data message is the first kind, to the data message In transmission address carry out address conversion;When the type of the data message is Second Type, in the data message It receives address and carries out address conversion;
The transmission unit 604 is configured to after generating new data message according to the address conversion, is sent described new Data message.
In the above scheme, referring to Fig. 6, the address converting device 60 further includes establishing unit 605, is configured to establish institute State the network connection between terminal device and the wireless router of network side;And the bridge mode based on the terminal device, It is shared by terminal device progress WLAN to control the first wireless site and the second wireless site.
In the above scheme, the receiving unit 601, concrete configuration are to be shared based on the WLAN, judge the data Whether message meets the media access control MAC frame format of WLAN protocol;And when the data message meets WLAN protocol When mac frame format, the data message is received;
The converting unit 603, is additionally configured in the bridge of the terminal device, by the data message of mac frame format Be converted to the data message of ethernet frame format;It wherein, include client interface and wirelessly connecing in the bridge of the terminal device Access point AP interface, the data message of the ethernet format between the client interface and the AP interface for being counted According to the interaction of message.
In the above scheme, the determination unit 602, concrete configuration are to work as to pass through the client interface to network side When wireless router forwards the data message of mac frame format, obtaining the transmission address in the data message is the first radio station The MAC Address of point determines that the type of the data message is the first kind;Wherein, the data message of the first kind is It is sent by the first wireless site and is forwarded to the client interface after passing through the AP interface of the terminal device;And work as When by the client interface from the data message for the mac frame format that the wireless router of network side forwards, obtain The MAC Address that address is wireless router of sending into the data message determines that the type of the data message is the Two types;Wherein, the data message of the Second Type is to be sent by the second wireless site and passed through the wireless router to turn It is dealt into the client interface.
In the above scheme, referring to Fig. 6, the address converting device 60 further includes acquiring unit 606, is configured to pass through institute The address translation engine ATE in client interface is stated, stored address translation table is obtained;Wherein, the address translation table is used In in the data message transmission address and/or receive address carry out address conversion processing.
In the above scheme, when the type of the data message is the first kind, the converting unit 603 is specifically matched It is set in the data message from the first wireless site into the transmission process of the second wireless site, is turned according to the address got Table is changed, the transmission address in the data message is converted into the client interface by the MAC Address of the first wireless site MAC Address obtains new data message.
In the above scheme, referring to Fig. 6, the address converting device 60 further includes updating unit 607, wherein
The transmission unit 604, is additionally configured in the bridge of the terminal device, by the data message of mac frame format The data message of ethernet frame format is converted to, and sends the client for the data message of the ethernet frame format and connects Mouthful;
The acquiring unit 606 is additionally configured to obtain MAC Address corresponding with source address in the data message and interconnection FidonetFido IP address;
The updating unit 607 is configured to according to the MAC Address and the IP address got, by described ATE in client interface is updated the address translation table stored.
In the above scheme, when the type of the data message is Second Type, the converting unit 603 is specifically matched It is set in the data message from the second wireless site into the transmission process of the first wireless site, is turned according to the address got Table is changed, the reception address in the data message is converted into first radio station by the MAC Address of the client interface The MAC Address of point, obtains new data message.
In the above scheme, referring to Fig. 6, the address converting device 60 further includes query unit 608, wherein
The receiving unit 601 is additionally configured to the data message by the client interface mac frame format;
The query unit 608 is configured to according to the corresponding IP address of destination address in the data message, from describedly MAC Address corresponding with the IP address is inquired in the conversion table of location;Using the MAC Address inquired as in the data message Receive address;Wherein, the MAC Address inquired is the MAC Address of first wireless site.
It is to be appreciated that in the present embodiment, " unit " can be partial circuit, segment processor, subprogram or soft Part etc., naturally it is also possible to be module, can also be non-modularization.And each component part in the present embodiment can collect It is physically existed alone at each unit in one processing unit, is also possible to, it can also be integrated with two or more units In a unit.Above-mentioned integrated unit both can take the form of hardware realization, can also be using software function module Form is realized.
If the integrated unit realizes that being not intended as independent product is sold in the form of software function module Or in use, can store in a computer readable storage medium, based on this understanding, the technical side of the present embodiment Substantially all or part of the part that contributes to existing technology or the technical solution can be produced case in other words with software The form of product embodies, which is stored in a storage medium, including some instructions are used so that one Platform computer equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute sheet The all or part of the steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk Etc. the various media that can store program code.
Therefore, a kind of computer storage medium is present embodiments provided, which is stored with address conversion Program, when the address translator is executed by least one processor the step of method described in realization previous embodiment.
Composition and computer storage medium based on address above mentioned conversion equipment 60, referring to Fig. 7, it illustrates the application The specific hardware structure for the address converting device 60 that embodiment provides may include: network interface 701, memory 702 and processing Device 703;Various components are coupled by bus system 704.It is understood that bus system 704 for realizing these components it Between connection communication.Bus system 704 further includes power bus, control bus and status signal in addition to including data/address bus Bus.But for the sake of clear explanation, various buses are all designated as bus system 704 in Fig. 7.Wherein, network interface 701, during for being received and sent messages between other ext nal network elements, signal is sended and received;
Memory 702, for storing the computer program that can be run on processor 703;
Processor 703, for executing when running the computer program:
After the bridge mode of opening terminal apparatus, data message is received;Wherein, the bridge mode is for realizing institute The WLAN for stating terminal device is shared;
According to the data message received, the type of the data message is determined;Wherein, the type packet of the data message It includes and the first kind corresponding to the data message is forwarded to network side by the client interface of terminal device and is passed through described Second Type corresponding to the data message that client interface is forwarded from network side;
When the type of the data message is the first kind, address is carried out to the transmission address in the data message and is turned It changes;When the type of the data message is Second Type, address conversion is carried out to the reception address in the data message;
After generating new data message according to the address conversion, the new data message is sent.
It is appreciated that the memory 702 in the embodiment of the present application can be volatile memory or nonvolatile memory, It or may include both volatile and non-volatile memories.Wherein, nonvolatile memory can be read-only memory (Read- Only Memory, ROM), programmable read only memory (Programmable ROM, PROM), the read-only storage of erasable programmable Device (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or Flash memory.Volatile memory can be random access memory (Random Access Memory, RAM), be used as external high Speed caching.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), double data speed synchronous dynamic RAM (Double Data Rate SDRAM, DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized links Dynamic random access memory (Synchlink DRAM, SLDRAM) and direct rambus random access memory (Direct Rambus RAM, DRRAM).The memory 702 of system and method described herein is intended to include but is not limited to these and arbitrarily its It is suitble to the memory of type.
And processor 703 may be a kind of IC chip, the processing capacity with signal.During realization, on Each step for stating method can be completed by the integrated logic circuit of the hardware in processor 703 or the instruction of software form. Above-mentioned processor 703 can be general processor, digital signal processor (Digital Signal Processor, DSP), Specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor are patrolled Collect device, discrete hardware components.It may be implemented or execute disclosed each method, step and the logical box in the embodiment of the present application Figure.General processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with the application The step of method disclosed in embodiment, can be embodied directly in hardware decoding processor and execute completion, or use decoding processor In hardware and software module combination execute completion.Software module can be located at random access memory, and flash memory, read-only memory can In the storage medium of this fields such as program read-only memory or electrically erasable programmable memory, register maturation.The storage Medium is located at memory 702, and processor 703 reads the information in memory 702, and the step of the above method is completed in conjunction with its hardware Suddenly.
It is understood that embodiments described herein can with hardware, software, firmware, middleware, microcode or its Combination is to realize.For hardware realization, processing unit be may be implemented in one or more specific integrated circuit (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing appts (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general processor, In controller, microcontroller, microprocessor, other electronic units for executing herein described function or combinations thereof.
For software implementations, it can be realized herein by executing the module (such as process, function etc.) of function described herein The technology.Software code is storable in memory and is executed by processor.Memory can in the processor or It is realized outside processor.
Optionally, as another embodiment, processor 703 is additionally configured to when running the computer program, is executed Described in previous embodiment the step of method.
Referring to Fig. 8, it illustrates a kind of composed structure schematic diagrames of terminal device 80 provided by the embodiments of the present application;Its In, the terminal device 80 includes at least any one address converting device 60 as involved in previous embodiment.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, the technical solution of the application substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the application.
Embodiments herein is described above in conjunction with attached drawing, but the application be not limited to it is above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the enlightenment of the application, when not departing from the application objective and scope of the claimed protection, can also it make very much Form, these are belonged within the protection of the application.

Claims (20)

1. a kind of address conversion method, the method is applied to terminal device, which comprises
After the bridge mode of opening terminal apparatus, data message is received;Wherein, the bridge mode is for realizing the end The WLAN WLAN of end equipment is shared;
According to the data message received, the type of the data message is determined;Wherein, the type of the data message includes logical The client interface for crossing terminal device forwards the first kind corresponding to the data message to network side and passes through institute State Second Type corresponding to the data message that client interface is forwarded from network side;
When the type of the data message is the first kind, address conversion is carried out to the transmission address in the data message; When the type of the data message is Second Type, address conversion is carried out to the reception address in the data message;
After generating new data message according to the address conversion, the new data message is sent.
2. the method according to claim 1, wherein the method is also wrapped before the reception data message It includes:
Establish the network connection between the terminal device and the wireless router of network side;
Based on the bridge mode of the terminal device, controls the first wireless site and the second wireless site passes through the terminal device It is shared to carry out WLAN.
3. according to the method described in claim 2, it is characterized in that, the reception data message, comprising:
It is shared based on the WLAN, judge whether the data message meets the media access control MAC frame format of WLAN protocol;
When the data message meets the mac frame format of WLAN protocol, the data message is received;
After the reception data message, the method also includes:
In the bridge of the terminal device, the data message of mac frame format is converted to the data message of ethernet frame format; It wherein, include client interface and wireless access point AP interface, the number of the ethernet format in the bridge of the terminal device According to message for carrying out the interaction of data message between the client interface and the AP interface.
4. according to the method described in claim 3, it is characterized in that, the type of the determination data message, comprising:
When forwarding the data message of mac frame format to the wireless router of network side by the client interface, institute is obtained The MAC Address that address is the first wireless site of sending in data message is stated, determines that the type of the data message is first Type;Wherein, the data message of the first kind is to be sent by the first wireless site and passed through the AP of the terminal device to connect Mouth is forwarded to the client interface after receiving;
When the data message of the mac frame format forwarded by the client interface from the wireless router of network side When, the MAC Address that address is wireless router of sending in the data message is obtained, determines the type of the data message For Second Type;Wherein, the data message of the Second Type is to be sent by the second wireless site and passed through the wireless routing Device is forwarded to the client interface.
5. the method according to claim 1, wherein after the type of the determination data message, institute State method further include:
By the address translation engine ATE in the client interface, stored address translation table is obtained;Wherein, describedly Location conversion table is used for the transmission address in the data message and/or receives address progress address conversion processing.
6. according to the method described in claim 5, it is characterized in that, when the type of the data message be the first kind when, institute It states and address conversion is carried out to the transmission address in the data message, comprising:
The data message from the first wireless site into the transmission process of the second wireless site, according to the address got turn Table is changed, the transmission address in the data message is converted into the client interface by the MAC Address of the first wireless site MAC Address obtains new data message.
7. according to the method described in claim 6, it is characterized in that, when the type of the data message be the first kind when, institute State method further include:
In the bridge of the terminal device, the data message of mac frame format is converted to the data message of ethernet frame format, And the client interface is sent by the data message of the ethernet frame format;
Obtain MAC Address corresponding with source address in the data message and internet protocol address;
According to the MAC Address and the IP address got, by the ATE in the client interface to the ground stored Location conversion table is updated.
8. according to the method described in claim 5, it is characterized in that, when the type of the data message be Second Type when, institute It states and address conversion is carried out to the reception address in the data message, comprising:
The data message from the second wireless site into the transmission process of the first wireless site, according to the address got turn Table is changed, the reception address in the data message is converted into first radio station by the MAC Address of the client interface The MAC Address of point, obtains new data message.
9. according to the method described in claim 8, it is characterized in that, the address translation table that the basis is got, by the number The MAC Address of first wireless site is converted to by the MAC Address of the client interface according to the reception address in message, is wrapped It includes:
Pass through the data message of the client interface mac frame format;
According to the corresponding IP address of destination address in the data message, inquiry and the IP address from the address translation table Corresponding MAC Address;
Using the MAC Address inquired as the reception address in the data message;Wherein, the MAC Address inquired is The MAC Address of first wireless site.
10. a kind of address converting device, the address converting device is applied to terminal device, and the address converting device includes: Receiving unit, determination unit, converting unit and transmission unit, wherein
The receiving unit is configured to after the bridge mode of opening terminal apparatus, receives data message;Wherein, the bridge It is shared for realizing the WLAN of the terminal device to connect mode;
The determination unit is configured to determine the type of the data message according to the data message received;Wherein, described The type of data message includes being forwarded corresponding to the data message by the client interface of terminal device to network side Second Type corresponding to one type and the data message forwarded by the client interface from network side;
The converting unit is configured to when the type of the data message is the first kind, to the hair in the data message Address is sent to carry out address conversion;When the type of the data message is Second Type, to the reception in the data message Location carries out address conversion;
The transmission unit is configured to after generating new data message according to the address conversion, sends the new datagram Text.
11. address converting device according to claim 10, which is characterized in that the address converting device further includes establishing Unit is configured to the network connection established between the terminal device and the wireless router of network side;And it is based on the end It is shared by terminal device progress WLAN to control the first wireless site and the second wireless site for the bridge mode of end equipment.
12. address converting device according to claim 11, which is characterized in that the receiving unit, concrete configuration are base It is shared in the WLAN, judge whether the data message meets the media access control MAC frame format of WLAN protocol;And work as When the data message meets the mac frame format of WLAN protocol, the data message is received;
The converting unit is additionally configured in the bridge of the terminal device, by the data message of mac frame format be converted to The too data message of net frame format;It wherein, include that client interface and wireless access point AP connect in the bridge of the terminal device Mouthful, the data message of the ethernet format between the client interface and the AP interface for carrying out data message Interaction.
13. address converting device according to claim 12, which is characterized in that the determination unit, concrete configuration are to work as When forwarding the data message of mac frame format to the wireless router of network side by the client interface, the data are obtained The MAC Address that address is the first wireless site of sending in message determines that the type of the data message is the first kind;Its In, after the data message of the first kind is the AP interface for sending and passing through the terminal device by the first wireless site It is forwarded to the client interface;And when the wireless router by the client interface from network side forwards Mac frame format data message when, obtain in the data message send address be wireless router MAC Address, really The type for making the data message is Second Type;Wherein, the data message of the Second Type is by the second wireless site It sends and passes through the wireless router and be forwarded to the client interface.
14. address converting device according to claim 10, which is characterized in that the address converting device further includes obtaining Unit is configured to obtain stored address translation table by the address translation engine ATE in the client interface;Wherein, The address translation table is used for the transmission address in the data message and/or receives address progress address conversion processing.
15. address converting device according to claim 14, which is characterized in that when the type of the data message is first When type, the converting unit, concrete configuration is in the data message from the first wireless site to the hair of the second wireless site During sending, according to the address translation table got, address will be sent by the MAC of the first wireless site in the data message Address conversion is the MAC Address of the client interface, obtains new data message.
16. address converting device according to claim 15, which is characterized in that the address converting device further includes updating Unit, wherein
The transmission unit is additionally configured in the bridge of the terminal device, by the data message of mac frame format be converted to The too data message of net frame format, and the client interface is sent by the data message of the ethernet frame format;
The acquiring unit is additionally configured to obtain MAC Address corresponding with source address in the data message and Internet protocol IP address;
The updating unit is configured to pass through the client interface according to the MAC Address and the IP address that get Interior ATE is updated the address translation table stored.
17. address converting device according to claim 14, which is characterized in that when the type of the data message is second When type, the converting unit, concrete configuration is in the data message from the second wireless site to the hair of the first wireless site During sending, according to the address translation table got, by the reception address in the data message by the client interface MAC Address is converted to the MAC Address of first wireless site, obtains new data message.
18. address converting device according to claim 17, which is characterized in that the address converting device further includes inquiry Unit, wherein
The receiving unit is additionally configured to the data message by the client interface mac frame format;
The query unit is configured to according to the corresponding IP address of destination address in the data message, from the address conversion MAC Address corresponding with the IP address is inquired in table;As the reception in the data message using the MAC Address inquired Location;Wherein, the MAC Address inquired is the MAC Address of first wireless site.
19. a kind of address converting device, which is characterized in that the address converting device includes: memory and processor;Wherein,
The memory, for storing the computer program that can be run on the processor;
The processor, for executing such as any one of claim 1 to 9 the method when running the computer program Step.
20. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with address translator, institute It states and is realized when address translator is executed by least one processor such as the step of any one of claim 1 to 9 the method.
CN201910111568.3A 2019-02-12 2019-02-12 Address translation method and device and computer storage medium Active CN109922164B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910111568.3A CN109922164B (en) 2019-02-12 2019-02-12 Address translation method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910111568.3A CN109922164B (en) 2019-02-12 2019-02-12 Address translation method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN109922164A true CN109922164A (en) 2019-06-21
CN109922164B CN109922164B (en) 2022-07-26

Family

ID=66961404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910111568.3A Active CN109922164B (en) 2019-02-12 2019-02-12 Address translation method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN109922164B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112601255A (en) * 2020-12-16 2021-04-02 北京银牧微电子科技有限公司 MAC frame sending method and device and PHY frame aggregation method and device
WO2022261961A1 (en) * 2021-06-18 2022-12-22 华为技术有限公司 Method for forwarding message, and switch and network interface card

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043430A (en) * 2006-06-20 2007-09-26 华为技术有限公司 Method for converting network address between equipments
CN101204071A (en) * 2005-06-23 2008-06-18 Xds有限公司 Methods and apparatus for network address change for mobile devices
CN101510853A (en) * 2009-04-09 2009-08-19 杭州华三通信技术有限公司 Method and apparatus for implementing WLAN wireless bridge, and wireless access client terminal
CN101800690A (en) * 2009-02-05 2010-08-11 北京启明星辰信息技术股份有限公司 Method and device for realizing source address conversion by using address pool
CN102780602A (en) * 2012-07-31 2012-11-14 深圳市共进电子股份有限公司 Method and device for data transmission
US20130039365A1 (en) * 2011-08-12 2013-02-14 Fujitsu Limited Address translation apparatus and communication system
CN103313308A (en) * 2013-06-18 2013-09-18 杭州华三通信技术有限公司 Data transmission method and device
CN103685588A (en) * 2012-09-10 2014-03-26 中兴通讯股份有限公司 Bridge packet forwarding method and device for wireless network equipment in client mode
CN104994178A (en) * 2015-05-12 2015-10-21 广东睿江科技有限公司 Network address translation method and device
CN106130908A (en) * 2016-06-03 2016-11-16 北京小米移动软件有限公司 Message transmitting method and device, intelligent terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101204071A (en) * 2005-06-23 2008-06-18 Xds有限公司 Methods and apparatus for network address change for mobile devices
CN101043430A (en) * 2006-06-20 2007-09-26 华为技术有限公司 Method for converting network address between equipments
CN101800690A (en) * 2009-02-05 2010-08-11 北京启明星辰信息技术股份有限公司 Method and device for realizing source address conversion by using address pool
CN101510853A (en) * 2009-04-09 2009-08-19 杭州华三通信技术有限公司 Method and apparatus for implementing WLAN wireless bridge, and wireless access client terminal
US20130039365A1 (en) * 2011-08-12 2013-02-14 Fujitsu Limited Address translation apparatus and communication system
CN102780602A (en) * 2012-07-31 2012-11-14 深圳市共进电子股份有限公司 Method and device for data transmission
CN103685588A (en) * 2012-09-10 2014-03-26 中兴通讯股份有限公司 Bridge packet forwarding method and device for wireless network equipment in client mode
CN103313308A (en) * 2013-06-18 2013-09-18 杭州华三通信技术有限公司 Data transmission method and device
CN104994178A (en) * 2015-05-12 2015-10-21 广东睿江科技有限公司 Network address translation method and device
CN106130908A (en) * 2016-06-03 2016-11-16 北京小米移动软件有限公司 Message transmitting method and device, intelligent terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112601255A (en) * 2020-12-16 2021-04-02 北京银牧微电子科技有限公司 MAC frame sending method and device and PHY frame aggregation method and device
CN112601255B (en) * 2020-12-16 2023-05-26 北京银牧微电子科技有限公司 MAC frame transmitting method and device, PHY frame aggregation method and device
WO2022261961A1 (en) * 2021-06-18 2022-12-22 华为技术有限公司 Method for forwarding message, and switch and network interface card

Also Published As

Publication number Publication date
CN109922164B (en) 2022-07-26

Similar Documents

Publication Publication Date Title
US20240022511A1 (en) Stateless Protocol Translation
WO2022078509A1 (en) Method and apparatus for encapsulating extension header of ipv6 packet
US7657642B2 (en) IP network node and middleware for establishing connectivity to both the IPv4 and IPv6 networks
US9622072B2 (en) Communication method, method for forwarding data message during the communication process and communication node thereof
CN102244688B (en) Message forwarding method, apparatus thereof and system threof
CN108092830B (en) Method for applying TCP/IP protocol in Mesh network
JP5551247B2 (en) Method and host node for multi-NAT64 environment
US20070147421A1 (en) ISATAP router for tunneling packets and method thereof
CN108933756B (en) Data packet processing method, access network equipment and computer readable storage medium
EP3731472A1 (en) Method and device for transmitting data, and network system
US8724630B2 (en) Method and system for implementing network intercommunication
JP6118122B2 (en) COMMUNICATION DEVICE, ITS CONTROL METHOD, PROGRAM
CN104821904B (en) Network repeater and relaying data packets method
CN107071079B (en) Method and system for private network terminal to acquire public network IP
CN105227466A (en) Communication processing method and device
WO2020132984A1 (en) Ipv6 address configuration method and router device
CN109922164A (en) A kind of address conversion method, device and computer storage medium
EP3145162B1 (en) Access device and method implemented by access device for allowing user equipment to access network
WO2020192565A1 (en) Communication method and related device
CN1875573B (en) Method, node and server for providing tunnel service capable of data communication between different types of networks
US11683275B2 (en) Device and method for interconnecting two subnetworks
US8457111B2 (en) Voice communication method and system in ubiquitous robotic companion environment
WO2017166038A1 (en) Communication method and terminal
US8923311B2 (en) Communication system and method
WO2021052241A1 (en) Address acquisition method and related device

Legal Events

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