[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109922164B - Address translation method and device and computer storage medium - Google Patents

Address translation method and device and computer storage medium Download PDF

Info

Publication number
CN109922164B
CN109922164B CN201910111568.3A CN201910111568A CN109922164B CN 109922164 B CN109922164 B CN 109922164B CN 201910111568 A CN201910111568 A CN 201910111568A CN 109922164 B CN109922164 B CN 109922164B
Authority
CN
China
Prior art keywords
address
data message
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.)
Active
Application number
CN201910111568.3A
Other languages
Chinese (zh)
Other versions
CN109922164A (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

Images

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses an address conversion method, an address conversion device and a computer storage medium, wherein the method is applied to terminal equipment and comprises the following steps: after a bridging mode of the terminal equipment is started, receiving a data message, wherein the bridging mode is used for realizing Wireless Local Area Network (WLAN) sharing of the terminal equipment; determining the type of the data message according to the received data message, wherein the type of the data message comprises a first type corresponding to the forwarding of the data message to a network side through a client interface of a terminal device and a second type corresponding to the forwarding of the data message from the network side through the client interface; when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message; and after generating a new data message according to the address conversion, sending the new data message.

Description

Address translation method and device and computer storage medium
Technical Field
The present application relates to the field of wireless communications technologies, and in particular, to an address translation method, an address translation device, and a computer storage medium.
Background
With the continuous development of the application of the intelligent terminal, a Wireless Local Area Network (WLAN) hot spot function has become one of the standard modules of the intelligent terminal. And Wireless Fidelity (WiFi) is used as a Wireless access mode in the WLAN technology, a WLAN hotspot function of the intelligent terminal is turned on, and the intelligent terminal shares a WiFi network with other users (WLAN sharing for short) through the hotspot function, so that terminal devices of other Wireless Stations (STA) can connect and access the network.
For other wireless stations, Network Address Translation (NAT) and a client interface are required to access a remote Network. In the existing network access process, on one hand, NAT conversion needs to consume Central Processing Unit (CPU) resources, and the wireless throughput is affected when the CPU resources are in shortage; on the other hand, the Soft Access Point (Soft AP) must also be provided with a Dynamic Host Configuration Protocol Server (DHCP Server) service and maintain local IP address resources, and meanwhile, the Soft AP needs to avoid gateway collision with the wireless Access Point (Root AP).
Disclosure of Invention
The main purpose of the present application is to provide an Address Translation method, an Address Translation device, and a computer storage medium, in which an Address Translation Engine (ATE) mechanism is added in a client driving end to implement Address Translation and update and maintenance of an Address Translation table, thereby effectively solving the problems of CPU resource consumption and gateway conflict caused by the existing solution, and better implementing WLAN sharing in a bridge mode.
In order to achieve the purpose, the technical scheme of the application is realized as follows:
in a first aspect, an embodiment of the present application provides an address translation method, where the method is applied to a terminal device, and the method includes:
after the bridge connection mode of the terminal equipment is started, receiving a data message; wherein the bridge mode is used for realizing WLAN sharing of the terminal equipment;
determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, performing address conversion on a receiving address in the data message;
and after generating a new data message according to the address conversion, sending the new data message.
In a second aspect, an embodiment of the present application provides an address translation apparatus, where the address translation apparatus is applied to a terminal device, and the address translation apparatus includes: a receiving unit, a determining unit, a converting unit and a transmitting unit, wherein,
the receiving unit is configured to receive the data message after the bridge mode of the terminal device is started; wherein the bridge mode is used for realizing WLAN sharing of the terminal equipment;
the determining unit is configured to determine the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
the conversion unit is configured to perform address conversion on a sending address in the data packet when the type of the data packet is a first type; when the type of the data message is a second type, performing address conversion on a receiving address in the data message;
and the sending unit is configured to send a new data message after generating the new data message according to the address conversion.
In a third aspect, an embodiment of the present application provides an address translation apparatus, including: a memory and a processor; wherein,
the memory for storing a computer program operable on the processor;
the processor is adapted to perform the steps of the method according to the first aspect when running the computer program.
In a fourth aspect, embodiments of the present application provide a computer storage medium storing an address translation program, which when executed by at least one processor implements the steps of the method according to the first aspect.
The method is applied to terminal equipment, and receives a data message after a bridge mode of the terminal equipment is started; the bridge mode is used for realizing WLAN sharing of the terminal equipment; then determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface; when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message; finally, after generating a new data message according to the address conversion, sending the new data message; therefore, the terminal equipment adopts a bridge mode to realize WLAN sharing, and an ATE mechanism is added in a client interface of the terminal equipment to realize address conversion of a sending address or a receiving address in a data message, so that the problems of CPU resource consumption and gateway conflict brought by the existing scheme are effectively solved, and WLAN sharing is better realized.
Drawings
Fig. 1 is a schematic diagram of a structure of a common network topology provided in the related art;
fig. 2 is a schematic flowchart of an address translation method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a bridge mode network topology according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another bridge mode network topology according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a structure of an address translation table according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an address translation device according to an embodiment of the present disclosure;
fig. 7 is a schematic hardware structure diagram of an address translation device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
With the rapid development of smart terminals and mobile internet applications, mobile data traffic is proliferating at an immeasurable rate. In order to effectively relieve traffic pressure and continuously promote the development of mobile communication services, more and more operators around the world choose to vigorously develop WLAN technology. Because WLAN has the features of fast speed, mobility, easy expansion, and low cost, almost all terminal devices use WLAN technology as basic configuration. Therefore, the WLAN hotspot function of the terminal equipment is opened, and the terminal equipment is used as a mobile hotspot and can be connected and used by other users in a certain coverage range.
The WiFi browsing is widely applied in the terminal device, and mainly shares the WiFi network with other users through hot spot function, which may also be called as WLAN sharing. With WLAN sharing, other terminal devices can be enabled to connect and access the network, and a common constituent structure of a WiFi browsing network topology is shown in fig. 1. In the network topology shown in fig. 1, the topology includes a wireless router access point (denoted by Root AP), a terminal device with hotspot function (denoted by STA 0) and a surrounding wireless access station (denoted by STA1), the STA0 further includes a Client (Client) interface and a Soft wireless access point (Soft AP) interface; the STA0 is connected with the Root AP through a Client interface to access the network, and the STA1 realizes WLAN sharing with the STA0 through a Soft AP interface to access the network; to access the network, STA1 must go through NAT translation (Source NAT (SNAT)) and Destination NAT (DNAT) in STA0 and a Client interface to access the remote network (such as Root AP).
Based on the network topology shown in fig. 1, in Root AP, Gateway (Gateway) is assumed to be 192.168.0.1, DHCP Server is assumed to be 192.168.0.100/200, Basic Service Set Identifier (BSSID) corresponding to Root AP is represented by Root AP-BSSID, which is actually represented by MAC address of Root AP and used for identifying Basic Service Set (Basic Service Se, BSS) managed by Root AP side, and Root AP-BSSID is assumed to be xx: xx: xx: xx: xx: x 0; in STA0, for the Client interface side, the Media Access Control (MAC) address corresponding to the Client interface is represented by Client-MAC, the Client-MAC is assumed to be xx: xx: xx: xx: xx: x4, the Internet Protocol (IP) address corresponding to the Client interface is represented by Client-IP, and the Client-IP is assumed to be 192.168.0.100; for the Soft AP interface side, the Gateway (Gateway) is assumed to be 192.168.43.1, the DHCP Server is assumed to be 192.168.43.100/200, and the AP-BSSID is assumed to be xx: xx: xx: xx: xx: x 3; in STA1, the MAC address corresponding to STA1 is denoted by STA1-MAC, STA1-MAC assumes xx: xx: xx: x1, the IP address corresponding to STA1 is denoted by STA1-IP, and STA1-IP assumes 192.168.43.100.
Specifically, the STA0 can implement WLAN sharing by turning on a WiFi browsing hotspot function, while one network interface (i.e., a Client interface) of the STA0 is connected to the Root AP, and obtains a Client-IP value 192.168.0.100 from a DHCP Server of the Root AP, and then the STA0 can access a wireless network through the Client interface; the other network interface (i.e. Soft AP interface) of STA0 is provided to the surrounding wireless stations (e.g. STA1) by using an access point, and then STA1 acquires the corresponding STA1-IP 192.168.43.100 from the DHCP Server in the Soft AP, so that STA1 can realize network access. According to the network topology shown in fig. 1, if the STA1 wants to access a remote network, it must go through NAT translation and Client interface to access the remote network; the following drawbacks still exist in the network topology shown in fig. 1: on one hand, NAT conversion needs to be carried out in a protocol stack, CPU resources are consumed, and particularly, wireless throughput is influenced when the CPU resources are in shortage; on the other hand, the Soft AP side must be provided with a DHCP Server service and maintain local IP address resources, and meanwhile, because the setting of a gateway on the Soft AP side is different from that on the Root AP side, gateway conflict needs to be avoided.
In order to solve the above-mentioned defect problem, an embodiment of the present application provides an address translation method, which is applied to a terminal device having a bridge mode, and after the bridge mode of the terminal device is started, a data packet is received first; then, according to the received data message, determining the type of the data message; the types of the data messages comprise a first type corresponding to the forwarding of the data messages to a network side through a client interface of terminal equipment and a second type corresponding to the receiving of the data messages forwarded from the network side through the client interface; when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message; finally, after generating a new data message according to the address conversion, sending the new data message; the terminal equipment adopts a bridge mode to realize WLAN sharing, and an ATE mechanism is added in a client interface of the terminal equipment to realize address conversion of a sending address or a receiving address in a data message, so that the problems of CPU resource consumption and gateway conflict brought by the existing scheme are effectively solved, and WLAN sharing is better realized.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, it shows an address translation method provided in an embodiment of the present application, where the method is applied to a terminal device, and the method may include:
s201: after the bridge connection mode of the terminal equipment is started, receiving a data message; wherein the bridge mode is used for realizing WLAN sharing of the terminal equipment;
s202: determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
s203: when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, performing address conversion on a receiving address in the data message;
s204: and after generating a new data message according to the address conversion, sending the new data message.
It should be noted that the data packet transmitted in the embodiment of the present application is not limited to data information, and may also be request information, or even other types of information, and the embodiment of the present application is not specifically limited.
It should be noted that, in the bridge mode (also referred to as bridge mode), a wireless connection may be established with a network side (such as a wireless router, a base station, and the like) by using a bridge function of the terminal device, so that the terminal device sends a new wireless signal to form a new wireless coverage range, thereby effectively solving the wireless coverage problems of signal weakness and signal blind spots. That is, the terminal device can implement WLAN sharing by adopting the bridge mode; in this way, a network connection is established between the terminal device and the wireless router on the network side to access the remote network, and the surrounding wireless stations (such as the first wireless station and the second wireless station) can also access the network through WLAN sharing and perform data interactive communication.
It is understood that in WLAN sharing, data transmission between wireless stations employs the provisions of the IEEE 802.11 protocol. Among them, IEEE 802.11 is a standard protocol commonly used for wireless lan. According to the IEEE 802.11 protocol, the frame format of the data packet is generally the MAC frame format. Referring to table 1, which shows an example of a composition structure of a basic MAC frame format provided in an embodiment of the present application; as shown in table 1, the MAC frame includes 4 Address fields, such as Address1, Address2, Address3, and Address4, where Address1 is fixedly represented as a Receive Address (RA), Address2 is fixedly represented as a Transmit Address (TA), the Address3 is used for providing filtering between an access point and a Distributed System (DS) depending on the network type used by the MAC frame, and the Address4 is temporarily unused. In some cases, the receiving Address may be a Destination Address (destinationaddress, Dest Address, or DA), and the sending Address may be a Source Address (Source Address, SA), but the embodiment of the present application is not limited in particular. In addition, the MAC frame also comprises fields such as To DS and From DS; wherein, To DS: 1 represents a MAC frame transmitted from the wireless station STA side to the wireless router AP side, and 1 represents another MAC frame; from DS: a1 indicates a MAC frame from the wireless router AP side, and a0 indicates other MAC frames.
TABLE 1
Figure BDA0001968351680000071
As can be seen From table 1, when a MAC frame is sent From the wireless station STA side To the wireless router AP side (i.e., To AP), where To DS is 1, From DS is 0, and Address1 may be set as a BSSID corresponding To the AP side, where the BSSID is actually represented as a MAC Address of the AP; address2 may be set to the MAC Address of the STA (denoted by SA), Address3 denotes the destination Address of the MAC frame transmission (denoted by DA), and if the destination Address of the MAC frame transmission is on the AP side, Address3 may be equal to Address 1;
when a MAC frame is transmitted From the wireless router AP side To the wireless station STA side (i.e., From AP), since the MAC frame originates From a DS, when To DS is 0 and From DS is 1, Address1 may be set as the MAC Address of the STA, i.e., the destination Address (denoted by DA) To which the MAC frame is transmitted; address2 may be set to BSSID corresponding to the AP side, Address3 represents a source Address transmitted by the MAC frame, and Address3 may be equal to Address2 if the source Address transmitted by the MAC frame is on the AP side.
Referring to fig. 3, a schematic diagram of a component structure of a bridge mode network topology provided in an embodiment of the present application is shown; as shown in fig. 3, the topology includes a wireless router access point (denoted as Root AP), a terminal device with bridge mode (denoted as STA 0) and surrounding wireless access stations (denoted as STA1 and STA 2); the STA0 comprises a Client interface and an AP interface, wherein the Client interface and the AP interface are positioned in the same bridge (bridge); STA0, STA1, and STA2 may all access the network through the Root AP, but STA1 may also need to forward data packets to STA0 when accessing the network.
Based on the network topology shown in FIG. 3, in the Root AP, the Gateway (Gateway) is assumed to be 192.168.0.1, the DHCP Server is assumed to be 192.168.0.100/200, and the Root AP-BSSID is assumed to be xx: xx: xx: x 0; in STA0, for the Client interface side, the MAC address corresponding to the Client interface is expressed by Client-MAC, the Client-MAC assumes xx: xx: xx: x4, the IP address corresponding to the Client interface is expressed by Client-IP, and the Client-IP assumes 192.168.0.100; for the AP interface side, the AP-BSSID is assumed to be xx: xx: xx: xx: xx: x 3; in STA1, the MAC address corresponding to STA1 is represented by STA1-MAC, STA1-MAC is assumed to be xx: xx: xx: x1, the IP address corresponding to STA1 is represented by STA1-IP, and STA1-IP is assumed to be 192.168.43.100. As can be seen from fig. 3, the STA0 in the embodiment of the present application has the bridge mode, and the Client interface and the AP interface in the STA0 are located in the same bridge, and at this time, the STA0 does not need to set the DHCP Server and the Soft AP gateway, thereby avoiding possible gateway collision.
In some embodiments, prior to the receiving the data message, the method further comprises:
establishing network connection between the terminal equipment and a wireless router on a network side;
and controlling the first wireless station and the second wireless station to carry out WLAN sharing through the terminal equipment based on the bridge mode of the terminal equipment.
Further, in some embodiments, the receiving the data packet includes:
based on the WLAN sharing, judging whether the data message conforms to a Media Access Control (MAC) frame format of a WLAN protocol;
when the data message conforms to the MAC frame format of the WLAN protocol, receiving the data message;
after the receiving the data packet, the method further comprises:
in the network bridge of the terminal equipment, converting the data message in the MAC frame format into the data message in the Ethernet frame format; the network bridge of the terminal equipment comprises a client interface and a wireless Access Point (AP) interface, and the Ethernet-type data message is used for interacting the data message between the client interface and the AP interface.
Further, in some embodiments, the determining the type of the data packet includes:
when the data message in the MAC frame format is forwarded to a wireless router on a network side through the client interface, the sending address in the data message is obtained as the MAC address of a first wireless station, and the type of the data message is determined to be a first type; the first type of data message is sent by a first wireless station, received by an AP interface of the terminal equipment and then forwarded to the client interface;
when receiving a data message in an MAC frame format forwarded by a wireless router from a network side through the client interface, obtaining that a sending address in the data message is an MAC address of the wireless router, and determining that the type of the data message is a second type; and the second type of data message is sent by a second wireless site and forwarded to the client interface through the wireless router.
It should be noted that the client interface and the AP interface of the terminal device are located in the same bridge, and at this time, the terminal device does not need to set the DHCP Server and the Soft AP gateway, thereby avoiding possible gateway collision. The terminal equipment establishes network connection with the wireless router, and the first wireless station and the second wireless station can carry out data interactive communication through a bridge mode of the terminal equipment. The data message sent by the first wireless station or the data message forwarded by the wireless router side is a data message in an MAC Frame format, which is a data Packet Frame transmitted in the Air and may be referred to as an Air Packet Frame; in Bridge, the data Packet in MAC Frame format is converted into a data Packet in ethernet Frame format, which is a data Packet Frame propagated in the Bridge and may also be referred to as Bridge Packet Frame; the data message will then continue to be sent in the MAC frame format.
It should be further noted that the sending of the data packet includes two cases: one is that the data packet is sent From the wireless station STA side To the wireless router AP (i.e., To AP) on the network side through the client interface, and the other is that the data packet is sent From the wireless router AP on the network side To the wireless station STA side (i.e., From AP) through the client interface. Thus, the sending addresses of the data messages are different for different situations; for example, a data packet forwarded to a wireless router by a first wireless station through a client interface is sent by the first wireless station, where a sending address of the data packet is an MAC address of the first wireless station, and a type of the data packet is referred to as a first type; for example, a data packet forwarded from the wireless router is received through the client interface, the sending address of the data packet is the MAC address of the wireless router, and the type of the data packet is called as a second type.
Exemplarily, taking the network topology shown in fig. 3 as an example, according To the specification of the IEEE 802.11 protocol, the Data packet in the MAC frame format may be represented by Data [ To DS, From DS, Address1, Address2, Address3, Source IP, Dest IP ], and the Data packet in the ethernet frame format obtained in Bridge may be represented by Data [ Dest Address, Source IP, Dest IP ]. In the interactive process of the Data message, assuming that the first wireless station is STA1 and the second wireless station is STA2, the STA1 sends the Data message to the STA2, at this time, the type of the Data message is the first type, the STA0 receives the Data message in the MAC frame format sent by the STA1 through the AP interface, and the Data message is represented by Data [1,0, AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP and STA2-IP ], and then the Client interface forwards the Data message in the MAC frame format to the Root AP side; wherein, the Client interface side driver in bridge also converts the received Data message in MAC frame format into Data message in Ethernet frame format, and represents the Data message by Data [ STA2-MAC, STA1-MAC, STA1-IP, STA2-IP ]; similarly, assuming that the first wireless station is STA1 and the second wireless station is STA2, the STA2 sends the Data packet to the STA1, where the type of the Data packet is the second type, the STA0 receives, through the Client interface, the Data packet in the MAC frame format sent by the STA2, where the Data packet is forwarded by the STA2 through the Root AP and is represented by Data [0,1, Client-MAC, Root AP-MAC, STA2-MAC, STA2-IP, STA1-IP ]; the Client interface side driver in bridge also converts the received Data message in the MAC frame format into a Data message in the Ethernet protocol format, and the Data message is represented by Data [ Client-MAC, STA2-MAC, STA2-IP and STA1-IP ].
It can be understood that, for the first type of data packet, if the sending Address2 adopts a source Address (such as STA1-MAC shown in fig. 3), the Root AP side will not recognize and discard the data packet in the MAC frame format, and at this time, the Address2 must be forcibly converted into Client-MAC, so as to ensure that the Root AP side can normally receive the data packet; similarly, for the second type of data packet, in the bridge, the data packet in the MAC frame format is converted into the data packet in the ethernet frame format, and if the destination Address Dest Address adopts a receiving Address (such as Client-MAC shown in fig. 3), the bridge cannot normally forward the data packet in the ethernet frame format to the AP interface, and at this time, the Dest Address must be forcibly converted into STA1-MAC, that is, the receiving Address1 in the data packet in the MAC frame format is converted into STA1-MAC, so that it can be ensured that the STA1 normally receives the data packet. That is to say, in order to ensure normal interaction of data packets, an ATE mechanism needs to be added in the driver on the client interface side of the terminal device to perform address translation and update and maintain the address translation table, thereby solving the problems of CPU resource consumption and gateway conflict caused by the existing solutions.
In some embodiments, after the determining the type of the data packet, the method further comprises:
acquiring a stored address translation table through an address translation engine ATE in the client interface; the address translation table is used for performing address translation processing on a sending address and/or a receiving address in the data message.
Further, in some embodiments, when the type of the data packet is the first type, the address converting the sending address in the data packet includes:
and in the process of sending the data message from the first wireless station to the second wireless station, converting the sending address in the data message from the MAC address of the first wireless station to the MAC address of the client interface according to the obtained address conversion table to obtain a new data message.
Further, in some embodiments, when the type of the data packet is a second type, the performing address translation on the receiving address in the data packet includes:
and in the process of sending the data message from the second wireless station to the first wireless station, converting the receiving address in the data message from the MAC address of the client interface to the MAC address of the first wireless station according to the obtained address conversion table to obtain a new data message.
It should be noted that, an ATE mechanism is added in the client interface side driver of the terminal device; thus, when the type of the data message is the first type, that is, the data message in the MAC frame format forwarded to the wireless router side through the Client interface, the Address conversion table obtained from the ATE may be used to perform Address conversion on the sending Address2 in the data message, and convert the Address into Client-MAC, so as to obtain a new data message; when the type of the data packet is the second type, that is, the data packet in the MAC frame format forwarded from the wireless router side is received through the Client interface, Address conversion may be performed on the receive Address1 in the data packet through an Address conversion table obtained from ATE, the receive Address is converted into a real MAC Address of the STA (for example, the MAC Address of the first wireless station), and then the obtained new data packet is forwarded to the first wireless station through the AP interface.
Illustratively, still taking the network topology shown in fig. 3 as an example, assuming that STA1 sends a Data packet to STA2, the type of the Data packet is the first type, STA0 receives the Data packet in the MAC frame format sent by STA1 through the AP interface, and the Data packet is represented by Data [1,0, AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP, STA2-IP ]; in bridge, the Data message is converted into Ethernet frame format and represented by Data [ STA2-MAC, STA1-MAC, STA1-IP and STA2-IP ]; then the Client interface sends the data message to the Root AP side according to the MAC frame format, wherein, if the sending Address2 adopts a source Address (such as STA1-MAC in FIG. 3), the Data message of the MAC frame format obtained by the Root AP side is Data [1,0, Root AP-BSSID, STA1-MAC, STA2-MAC, STA1-IP, STA2-IP ], since the transmission Address2 is STA1-MAC, the Root AP side cannot recognize the data packet in the MAC frame format and discards the data packet directly, at this time, the transmission Address2 needs to be converted into Client-MAC forcibly through an Address conversion table, namely, the Data message in the MAC frame format obtained by the Root AP side is Data [1,0, Root AP-BSSID, Client-MAC, STA2-MAC, STA1-IP, STA2-IP ], so that the Root AP side can be ensured to normally receive the Data message. Similarly, assuming that the STA2 sends the Data packet to the STA1, the type of the Data packet is the second type, and the STA0 receives the Data packet in the MAC frame format forwarded by the Root AP side through the Client interface, and the Data packet is represented by Data [0,1, Client-MAC, Root AP-BSSID, STA2-MAC, STA2-IP, and STA1-IP ]; in bridge, the Data message is converted into Ethernet frame format and represented by Data [ Client-MAC, STA2-MAC, STA2-IP and STA1-IP ]; then the Client interface sends the data message to the AP interface side according to the Ethernet frame format, and the data message is forwarded to STA1 through the AP interface; in the bridge, if the destination Address Dest Address adopts a receiving Address (such as Client-MAC in fig. 3), the bridge cannot normally forward the Data packet in the ethernet frame format obtained by the Client interface side to the AP interface and directly discards the Data packet, at this time, the receiving Address1 needs to be forcibly converted into STA1-MAC by an Address translation table, that is, the Data packet in the MAC frame format forwarded to the STA1 side by the AP interface is Data [0,1, STA1-MAC, AP-BSSID, STA2-MAC, STA2-IP, STA1-IP ], so that the STA1 side can normally receive the Data packet.
Referring to fig. 4, it shows a schematic structural diagram of another bridge mode network topology provided in this application embodiment; as shown in FIG. 4, an ATE mechanism is added to the device of FIG. 3; specifically, between the Root AP and the client interface in the STA0, the address translation table stored in the ATE mechanism may be used to perform address translation on the sending address or the receiving address of the data packet, so as to ensure that the data packet can be sent normally. Wherein, the ATE mechanism comprises a network address translation Table (represented by ATE Table); the ATE Table may include Address translation tables of a plurality of Protocol families, such as an Address Resolution Protocol (ARP) Address translation Table (denoted by ARP Table), a DHCP Protocol Address translation Table (denoted by DHCP Table), and an Internet Protocol Version 4 (IPV 4) Address translation Table (denoted by IPV4 Table), and the like, which is not particularly limited in this embodiment of the present invention.
In the embodiment of the present application, the IPV4 address translation table will be specifically described as an example, but the embodiment of the present application is also applicable to address translation tables of other protocol families. Referring to fig. 5, a schematic diagram of a component structure of an address translation table provided in an embodiment of the present application is shown; as shown in fig. 5, taking the IPV4 address translation table as an example, the IPV4 address translation table includes a protocol (protocol) and an Entry (Entry); wherein, an Entry may contain a plurality of entries (such as Entry1, Entry 2.. and.) and each Entry record may be represented by [ Entry index MAC IP ], where Entry index is represented as an index value of the Entry; for example, as shown in FIG. 5, when the entry is entry1, then entry1 records xx: xx: xx: x4 and 192.168.0.104, which can be expressed as [ entry1xx: xx: xx: xx: xx: xx: x4192.168.0.104 ]; when the entry is entry2, then entry2 records xx: xx: xx: x1 and 192.168.0.101, which can be expressed as [ entry2xx: xx: xx: xx: xx: x1192.168.0.101 ].
Further, in some embodiments, when the type of the data packet is a first type, the method further includes:
in a network bridge of the terminal equipment, converting a data message in an MAC frame format into a data message in an Ethernet frame format, and sending the data message in the Ethernet frame format to the client interface;
acquiring an MAC address and an Internet Protocol (IP) address corresponding to a source address in the data message;
and updating the stored address translation table through ATE in the client interface according to the obtained MAC address and the obtained IP address.
Further, in some embodiments, when the type of the data packet is a second type, the converting, according to the obtained address translation table, the receiving address in the data packet from the MAC address of the client interface to the MAC address of the first wireless station includes:
receiving a data message in an MAC frame format through the client interface;
according to the IP address corresponding to the destination address in the data message, inquiring the MAC address corresponding to the IP address from the address translation table;
taking the inquired MAC address as a receiving address in the data message; wherein the queried MAC address is the MAC address of the first wireless station.
It should be noted that, with reference to the IPV4 address translation table shown in fig. 5, when the type of the Data packet is the first type, that is, the Data packet in the MAC frame format is forwarded to the wireless router side through the client interface, taking fig. 4 as an example, the first wireless station is STA1, the second wireless station is STA2, and it is assumed that STA1 sends the Data packet to STA2, at this time, in the bridge of the terminal device, the Data packet in the MAC frame format is first converted into the Data packet in the ethernet frame format (for example, Data [ STA2-MAC, STA1-MAC, STA1-IP, STA2-IP ] shown in fig. 4), and then the Data packet in the ethernet frame format is sent to the client interface; starting updating of an Address forwarding table at a client interface side through ATE, for example, updating a Source Address and a Source IP in a data packet in an Ethernet frame format into [ entryindex STA1-MAC STA1-IP ]; firstly, determining the entry corresponding to the source address, and assuming that the entry is entry2 shown in fig. 5, then obtaining entries corresponding to the source address from fig. 5 as [ entry2xx: xx: xx: xx: xx: x1192.168.0.101 ], that is, obtaining MAC addresses and IP addresses corresponding to the source address as xx: xx: xx: xx: x1 and 192.168.0.101, so as to update the address translation table, thereby realizing the maintenance of the address translation table, and the method is also suitable for updating and maintaining address translation tables corresponding to other protocol families; thus, when the Client interface forwards the Data message in the MAC frame format to the wireless router side to reconstruct the Data message, the sending Address2 in the Data message in the MAC frame format is converted into Client-MAC, and the Data message in the MAC frame format finally forwarded to the wireless router side is represented by Data [1,0, RootAP-BSSID, Client-MAC, STA2-MAC, STA1-IP and STA2-IP ].
It should be further noted that, with reference to the IPV4 address translation table shown in fig. 5, when the type of the Data packet is a second type, that is, the Data packet in the MAC frame format from the wireless router side is received through the Client interface, taking fig. 4 as an example, the first wireless station is STA1, the second wireless station is STA2, and it is assumed that the STA2 sends the Data packet to the STA1, at this time, in the bridge of the terminal device, the Data packet in the MAC frame format (for example, Data [0,1, Client-MAC, RootAP-MAC, STA2-MAC, STA2-IP, STA1-IP ] received by the Client interface is first converted into the Data packet in the ethernet frame format shown in fig. 4, and then the Data packet in the ethernet frame format is sent to the AP interface; starting an Address forwarding table at a client interface side through ATE (automatic test equipment), for example, performing Address translation on a Dest Address in a data packet in an Ethernet frame format, firstly, querying a MAC Address corresponding to the Address forwarding table from the Address translation table through a Dest IP (Internet protocol), for example, finding an entry corresponding to the Address forwarding table as [ entryindex STA1-MAC STA1-IP ] from the Address translation table, and identifying the queried MAC Address as STA 1-MAC; thus, when the Data message in the MAC frame format is re-constructed by being forwarded to the STA1 side by the AP interface, at this time, the receiving Address1 in the Data message in the MAC frame format needs to be converted into the STA1-MAC, and thus, the Data message in the MAC frame format finally forwarded to the STA1 side is represented by Data [0,1, STA1-MAC, AP-BSSID, STA2-MAC, STA2-IP, and STA1-IP ], so that normal transmission of the Data message between the STA1 and the STA2 is ensured.
The embodiment provides an address conversion method, which is applied to a terminal device and receives a data message after a bridge mode of the terminal device is started; wherein the bridge mode is used for realizing WLAN sharing of the terminal equipment; determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface; when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message; after generating a new data message according to the address conversion, sending the new data message; therefore, the terminal equipment realizes WLAN sharing by adopting a bridge mode, and an ATE mechanism is added in a client interface of the terminal equipment to realize address translation of a data message and update and maintenance of an address translation table, so that the problems of CPU resource consumption and gateway conflict brought by the existing scheme are effectively solved, and WLAN sharing is better realized.
Based on the same inventive concept of the foregoing embodiments, referring to fig. 6, which shows an example of a composition structure of an address translation apparatus 60 provided in an embodiment of the present application, where the address translation apparatus 60 is applied to a terminal device, a client interface and an AP interface of the terminal device are in the same bridge, and the address translation apparatus 60 may include: a receiving unit 601, a determining unit 602, a converting unit 603, and a sending unit 604, where the receiving unit 601 is configured to receive a data packet after the bridge mode of the terminal device is turned on; the bridge mode is used for realizing WLAN sharing of the terminal equipment;
the determining unit 602 is configured to determine the type of the data packet according to the received data packet; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
the converting unit 603 is configured to perform address conversion on a sending address in the data packet when the type of the data packet is a first type; when the type of the data message is a second type, performing address conversion on a receiving address in the data message;
the sending unit 604 is configured to send a new data packet after generating the new data packet according to the address translation.
In the above solution, referring to fig. 6, the address translation apparatus 60 further includes an establishing unit 605 configured to establish a network connection between the terminal device and a wireless router on the network side; and controlling the first wireless station and the second wireless station to carry out WLAN sharing through the terminal equipment based on the bridge mode of the terminal equipment.
In the above solution, the receiving unit 601 is specifically configured to determine, based on the WLAN sharing, whether the data packet conforms to a MAC frame format of a WLAN protocol; when the data message conforms to the MAC frame format of the WLAN protocol, receiving the data message;
the converting unit 603 is further configured to convert the data packet in the MAC frame format into the data packet in the ethernet frame format in the bridge of the terminal device; the network bridge of the terminal equipment comprises a client interface and a wireless Access Point (AP) interface, and the Ethernet-type data message is used for interacting the data message between the client interface and the AP interface.
In the above solution, the determining unit 602 is specifically configured to, when forwarding a data packet in an MAC frame format to a wireless router on a network side through the client interface, obtain that a sending address in the data packet is an MAC address of a first wireless station, and determine that the type of the data packet is a first type; the first type of data message is sent by a first wireless station, received by an AP (access point) interface of the terminal equipment and then forwarded to the client interface; when receiving a data message in an MAC frame format forwarded by a wireless router from a network side through the client interface, obtaining that a sending address in the data message is an MAC address of the wireless router, and determining that the type of the data message is a second type; and the second type of data message is sent by a second wireless site and forwarded to the client interface through the wireless router.
In the above solution, referring to fig. 6, the address translation apparatus 60 further includes an obtaining unit 606 configured to obtain the stored address translation table through an address translation engine ATE in the client interface; the address translation table is used for performing address translation processing on a sending address and/or a receiving address in the data message.
In the foregoing solution, when the type of the data packet is the first type, the converting unit 603 is specifically configured to, during a process of sending the data packet from the first wireless station to the second wireless station, convert the sending address in the data packet from the MAC address of the first wireless station to the MAC address of the client interface according to the obtained address conversion table, so as to obtain a new data packet.
In the above solution, referring to fig. 6, the address translation apparatus 60 further includes an update unit 607, wherein,
the sending unit 604 is further configured to convert, in the bridge of the terminal device, the data packet in the MAC frame format into the data packet in the ethernet frame format, and send the data packet in the ethernet frame format to the client interface;
the obtaining unit 606 is further configured to obtain an MAC address and an internet protocol IP address corresponding to a source address in the data packet;
the updating unit 607 is configured to update the stored address translation table through ATE in the client interface according to the acquired MAC address and the acquired IP address.
In the foregoing solution, when the type of the data packet is the second type, the converting unit 603 is specifically configured to, during a process of sending the data packet from the second wireless station to the first wireless station, convert the receiving address in the data packet from the MAC address of the client interface to the MAC address of the first wireless station according to the obtained address conversion table, so as to obtain a new data packet.
In the above solution, referring to fig. 6, the address translation apparatus 60 further includes a query unit 608, wherein,
the receiving unit 601 is further configured to receive a data packet in an MAC frame format through the client interface;
the querying unit 608 is configured to query, according to an IP address corresponding to a destination address in the data packet, a MAC address corresponding to the IP address from the address translation table; taking the inquired MAC address as a receiving address in the data message; wherein the queried MAC address is the MAC address of the first wireless station.
It is understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may also be a module, or may be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware mode, and can also be realized in a software functional module mode.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Accordingly, the present embodiments provide a computer storage medium storing an address translation program that, when executed by at least one processor, implements the steps of the method described in the preceding embodiments.
Based on the above-mentioned composition of the address translation device 60 and the computer storage medium, referring to fig. 7, it shows a specific hardware structure of the address translation device 60 provided in this embodiment, which may include: a network interface 701, a memory 702, and a processor 703; the various components are coupled together by a bus system 704. It is understood that the bus system 704 is used to enable connected communication between these components. The bus system 704 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are designated as bus system 704 in FIG. 7. The network interface 701 is configured to receive and transmit signals in a process of receiving and transmitting information with other external network elements;
a memory 702 for storing a computer program capable of running on the processor 703;
a processor 703, configured to execute, when running the computer program:
after the bridge connection mode of the terminal equipment is started, receiving a data message; the bridge mode is used for realizing WLAN sharing of the terminal equipment;
determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
when the type of the data message is a first type, address conversion is carried out on a sending address in the data message; when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message;
and after generating a new data message according to the address conversion, sending the new data message.
It will be appreciated that the memory 702 in the subject embodiment can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM) which serves as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 702 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The processor 703 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the method may be implemented by hardware integrated logic circuits in the processor 703 or by instructions in the form of software. The Processor 703 may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in the memory 702, and the processor 703 reads the information in the memory 702 and performs the steps of the above method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, as another embodiment, the processor 703 is further configured to, when running the computer program, perform the steps of the method in the foregoing embodiments.
Referring to fig. 8, a schematic structural diagram of a terminal device 80 provided in the embodiment of the present application is shown; wherein the terminal device 80 comprises at least any one address translation device 60 as referred to in the previous embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element identified by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the present embodiments are not limited to those precise embodiments, which are intended to be illustrative rather than restrictive, and that various changes and modifications may be effected therein by one skilled in the art without departing from the scope of the appended claims.

Claims (12)

1. An address translation method, which is applied to a terminal device, includes:
establishing network connection between the terminal equipment and a wireless router on a network side;
controlling a first wireless station and a second wireless station to share WLAN through the terminal equipment based on the bridge mode of the terminal equipment; the bridge mode is used for realizing Wireless Local Area Network (WLAN) sharing of the terminal equipment;
based on the WLAN sharing, judging whether the data message conforms to a Media Access Control (MAC) frame format of a WLAN protocol;
when the data message conforms to the MAC frame format of the WLAN protocol, receiving the data message;
in the network bridge of the terminal equipment, converting the data message in the MAC frame format into the data message in the Ethernet frame format; the network bridge of the terminal equipment comprises a client interface and a wireless Access Point (AP) interface, and the data message in the Ethernet frame format is used for interacting the data message between the client interface and the AP interface;
determining the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of a terminal device and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
acquiring a stored address translation table through an address translation engine ATE in the client interface; the address translation table is used for performing address translation processing on a sending address and/or a receiving address in the data message;
when the type of the data message is a first type, performing address translation on a sending address in the data message, sending the data message in an Ethernet frame format to the client interface, acquiring an MAC address and an Internet Protocol (IP) address corresponding to a source address in the data message, and updating a stored address translation table through ATE (automatic equipment control) in the client interface according to the acquired MAC address and the IP address;
when the type of the data message is a second type, carrying out address conversion on a receiving address in the data message;
and after generating a new data message according to the address conversion, sending the new data message.
2. The method of claim 1, wherein the determining the type of the data packet comprises:
when the data message in the MAC frame format is forwarded to a wireless router on a network side through the client interface, the sending address in the data message is obtained as the MAC address of a first wireless station, and the type of the data message is determined to be a first type; the first type of data message is sent by a first wireless station, received by an AP (access point) interface of the terminal equipment and then forwarded to the client interface;
when receiving a data message in an MAC frame format forwarded by a wireless router from a network side through the client interface, obtaining that a sending address in the data message is an MAC address of the wireless router, and determining that the type of the data message is a second type; and the second type of data message is sent by a second wireless site and forwarded to the client interface through the wireless router.
3. The method of claim 1, wherein when the type of the data packet is a first type, the address translation of the sending address in the data packet comprises:
and in the process of sending the data message from the first wireless station to the second wireless station, converting the sending address in the data message from the MAC address of the first wireless station to the MAC address of the client interface according to the obtained address conversion table to obtain a new data message.
4. The method of claim 1, wherein when the type of the data packet is a second type, the address translation of the receiving address in the data packet comprises:
and in the process of sending the data message from the second wireless station to the first wireless station, converting the receiving address in the data message from the MAC address of the client interface to the MAC address of the first wireless station according to the obtained address conversion table to obtain a new data message.
5. The method according to claim 4, wherein the converting, according to the obtained address translation table, the receiving address in the data packet from the MAC address of the client interface to the MAC address of the first wireless station includes:
receiving a data message in an MAC frame format through the client interface;
inquiring a MAC address corresponding to the IP address from the address translation table according to the IP address corresponding to the destination address in the data message;
taking the inquired MAC address as a receiving address in the data message; wherein the queried MAC address is the MAC address of the first wireless station.
6. An address conversion apparatus applied to a terminal device, the address conversion apparatus comprising: a building unit, a receiving unit, a determining unit, an obtaining unit, a converting unit, an updating unit and a sending unit, wherein,
the establishing unit is configured to establish network connection between the terminal device and a wireless router on a network side; controlling the first wireless station and the second wireless station to share the WLAN through the terminal equipment based on the bridge mode of the terminal equipment; wherein the bridge mode is used for realizing WLAN sharing of the terminal equipment;
the receiving unit is configured to determine whether the data packet conforms to a Media Access Control (MAC) frame format of a WLAN protocol based on the WLAN sharing; when the data message conforms to the MAC frame format of the WLAN protocol, receiving the data message;
the conversion unit is configured to convert the data packet in the MAC frame format into the data packet in the ethernet frame format in the network bridge of the terminal device; the network bridge of the terminal equipment comprises a client interface and a wireless Access Point (AP) interface, and the data message in the Ethernet frame format is used for interacting the data message between the client interface and the AP interface;
the determining unit is configured to determine the type of the data message according to the received data message; the types of the data messages comprise a first type corresponding to the data messages forwarded to a network side through a client interface of terminal equipment and a second type corresponding to the data messages forwarded from the network side and received through the client interface;
the obtaining unit is configured to obtain the stored address translation table through an address translation engine ATE in the client interface; the address translation table is used for performing address translation processing on a sending address and/or a receiving address in the data message;
the conversion unit is further configured to perform address conversion on a sending address in the data packet when the type of the data packet is a first type;
the sending unit is configured to send the data message in the ethernet frame format to the client interface;
the acquiring unit is further configured to acquire an MAC address and an Internet Protocol (IP) address corresponding to a source address in the data message;
the updating unit is configured to update the stored address translation table through ATE in the client interface according to the acquired MAC address and the acquired IP address;
the conversion unit is further configured to perform address conversion on a receiving address in the data packet when the type of the data packet is a second type;
and the sending unit is also configured to send a new data message after generating the new data message according to the address conversion.
7. The address translation device according to claim 6, wherein the determining unit is specifically configured to, when forwarding a data packet in an MAC frame format to a wireless router on a network side through the client interface, obtain that a sending address in the data packet is an MAC address of a first wireless station, and determine that the type of the data packet is a first type; the first type of data message is sent by a first wireless station, received by an AP (access point) interface of the terminal equipment and then forwarded to the client interface; when receiving a data message in an MAC frame format forwarded by a wireless router from a network side through the client interface, obtaining that a sending address in the data message is an MAC address of the wireless router, and determining that the type of the data message is a second type; and the second type of data message is sent by a second wireless site and forwarded to the client interface through the wireless router.
8. The address translation device according to claim 6, wherein when the type of the data packet is a first type, the translation unit is specifically configured to, during a transmission process of the data packet from a first wireless station to a second wireless station, translate a transmission address in the data packet from an MAC address of the first wireless station to an MAC address of the client interface according to the obtained address translation table, so as to obtain a new data packet.
9. The address translation device according to claim 6, wherein when the type of the data packet is a second type, the translation unit is specifically configured to, during a transmission process of the data packet from a second wireless station to a first wireless station, translate a receiving address in the data packet from the MAC address of the client interface to the MAC address of the first wireless station according to the obtained address translation table, so as to obtain a new data packet.
10. The address translation device of claim 9, further comprising a lookup unit, wherein,
the receiving unit is also configured to receive a data message in an MAC frame format through the client interface;
the query unit is configured to query a MAC address corresponding to the IP address from the address translation table according to the IP address corresponding to the destination address in the data message; taking the inquired MAC address as a receiving address in the data message; wherein the queried MAC address is the MAC address of the first wireless station.
11. An address translation device, comprising: a memory and a processor; wherein,
the memory for storing a computer program operable on the processor;
the processor, when executing the computer program, is adapted to perform the steps of the method of any of claims 1 to 5.
12. A computer storage medium, characterized in that the computer storage medium stores an address translation program which, when executed by at least one processor, implements the steps of the method according to any one of claims 1 to 5.
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 CN109922164A (en) 2019-06-21
CN109922164B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Citations (9)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5741312B2 (en) * 2011-08-12 2015-07-01 富士通株式会社 Address translation device, communication system, address translation program, and address translation method

Patent Citations (9)

* 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
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

Also Published As

Publication number Publication date
CN109922164A (en) 2019-06-21

Similar Documents

Publication Publication Date Title
EP2364543B1 (en) Broadband network access
EP2466801B1 (en) Communication method and corresponding access service node
JP5335886B2 (en) Method and apparatus for communicating data packets between local networks
EP2708001B1 (en) Label switched routing to connect low power network domains
US20050018677A1 (en) Method and system for generating IP addresses of access terminals and transmitting messages for generation of IP addresses in an IP system
US7760666B2 (en) Method of generating and managing connection identifiers for supporting multicast for each group in IPv6-based wireless network and network interface using the method
KR20060125630A (en) System for providing tunnel service capable of data communication between different type of networks
WO2011119019A1 (en) Method of communicating signals in 6lowpan network to ipv6 network
KR20040048143A (en) A location management server and ethernet based wireless local area network system and embodiment method with location management server
WO2011032492A1 (en) Identity identification, across-network communication and service migration method, and information intercommunication network architecture
CN107707476B (en) Efficient wireless forwarding device and method based on FPGA
CN109922164B (en) Address translation method and device and computer storage medium
EP2466815B1 (en) Method and system for initiating forwarding of communicaiton, information and data message and for routing configuration
US20100260203A1 (en) TUNNELING IPv6 PACKET THROUGH IPv4 NETWORK USING A TUNNEL ENTRY BASED ON IPv6 PREFIX AND TUNNELING IPv4 PACKET USING A TUNNEL ENTRY BASED ON IPv4 PREFIX
WO2022052661A1 (en) Address acquisition method and apparatus, and computer-readable storage medium
US20180270882A1 (en) Operation method of communication node in communication network
US20080215754A1 (en) Bridging Data Network Communications
US20240129271A1 (en) Communication apparatus and communication method for multi-link address resolution
US20130114503A1 (en) Communication System and Method
WO2011041972A1 (en) Method and system for implementing active push of data packets
JP2008160890A (en) Communication apparatus
CN115314463A (en) Data transmission method of hierarchical 6LoWPAN mesh network
JP2006211457A (en) Converter device and method of controlling communication
CN118175136A (en) Communication method, device and equipment
KR20070021903A (en) The transport method of mobile IP broadcasting message in unmanaged mode for high speed portable internet

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