CN107534585B - Communication method and terminal - Google Patents

Communication method and terminal Download PDF

Info

Publication number
CN107534585B
CN107534585B CN201680024794.2A CN201680024794A CN107534585B CN 107534585 B CN107534585 B CN 107534585B CN 201680024794 A CN201680024794 A CN 201680024794A CN 107534585 B CN107534585 B CN 107534585B
Authority
CN
China
Prior art keywords
address
gateway
terminal
gateways
external network
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
CN201680024794.2A
Other languages
Chinese (zh)
Other versions
CN107534585A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN107534585A publication Critical patent/CN107534585A/en
Application granted granted Critical
Publication of CN107534585B publication Critical patent/CN107534585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A communication method and a terminal comprise: a terminal in a local area network determines the IP address of a gateway of the local area network; the terminal determines an MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the MAC addresses correspond to a plurality of gateways one by one; the terminal determines a target gateway capable of being connected with an external network from a plurality of gateways; the terminal communicates with the external network through the target gateway. User experience can be improved.

Description

Communication method and terminal
Technical Field
The present invention relates to the field of communications, and in particular, to a communication method and a terminal in the field of communications.
Background
With the development of communication technology and the popularization of network broadband, two or more wireless routers can be used for networking in a home area with more living rooms or an office area with a larger area, so as to ensure that wireless network signals cover all places. And a Gateway (GW) is generally integrated in the wireless router in the prior art. For example, fig. 1 shows a schematic diagram of a network formed by two wireless routers. The built-in gateway of the first wireless router is connected with an external network, and the second wireless router is connected with the first wireless router through a network cable. The terminal can access the local area network through wireless network signals of the first wireless router or the second wireless router. If the network Protocol (IP) addresses of the default gateways of the routers in the lan are the same, there will be multiple gateways with the same IP address in the lan, and only one of the gateways that can really network. For example, in the network shown in fig. 1, only the gateway built in the first wireless router may be networked, and the gateway of the second wireless router is not used.
In general, after acquiring an IP Address of a gateway, a terminal first needs to perform Address Resolution Protocol (ARP) Resolution on the IP Address to acquire a Media Access Control (MAC) Address corresponding to the gateway. And sending data to the gateway according to the MAC address obtained by analysis. In a normal network, an IP address has a unique MAC address corresponding to it. In the networking case, if one IP address corresponds to multiple MAC addresses, data of the terminal may be sent to a wrong gateway. Therefore, a user can find that the terminal in the local area network can sometimes surf the internet and sometimes can not surf the internet, and user experience is affected.
Disclosure of Invention
The embodiment of the invention provides a communication method and a terminal, which are used for improving user experience.
In a first aspect, a communication method is provided, including: a terminal in a local area network determines a network protocol IP address of a target gateway of the local area network; the terminal determines a Media Access Control (MAC) address according to the IP address, wherein the MAC address comprises a plurality of MAC addresses; the terminal determines target equipment capable of realizing network interconnection from a plurality of pieces of equipment corresponding to the MAC addresses; and the terminal determines the target equipment as the target gateway.
After the terminal determines the MAC address corresponding to the IP address of the target gateway and when the MAC address comprises a plurality of MAC addresses, the terminal determines target equipment capable of realizing network interconnection from a plurality of pieces of equipment corresponding to the MAC addresses and determines the target equipment as the target gateway, so that the terminal does not need to be set by a user, the target gateway can be automatically determined, and user experience is improved.
In a possible implementation manner, the determining, by the terminal, a MAC address corresponding to the IP address includes: the terminal sends an Address Resolution Protocol (ARP) request packet to each device of the local area network, wherein the ARP request packet comprises the IP address; and the terminal receives a reply message of each device, wherein the reply message comprises the MAC address of the device corresponding to the IP address.
In one possible implementation, the communication method further includes: and the terminal binds the IP address and the MAC address static ARP of the target gateway.
In one possible implementation, the plurality of gateways are respectively located in a plurality of routers.
In a possible implementation manner, the determining, by the terminal, a target gateway capable of connecting to an external network from the plurality of gateways includes: the terminal binds the IP address with the MAC address of a first gateway in the plurality of gateways, wherein the first gateway is any one of the plurality of gateways; the terminal determines whether the first gateway can be connected with the external network; and when the external network can be connected through the first gateway, the terminal determines the first gateway as the target gateway.
In a second aspect, a terminal is provided, which includes means for performing the communication method of the first aspect. Based on the same inventive concept, since the principle of the terminal to solve the problem corresponds to the scheme in the method design of the first aspect, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
In a third aspect, a terminal is provided and includes a memory and a processor. The memory is used for storing programs and the processor is used for executing programs. The processor is configured to perform the communication method of the first aspect when the program is executed. Based on the same inventive concept, since the principle of the terminal to solve the problem corresponds to the scheme in the method design of the first aspect, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
In a fourth aspect, a system chip is provided, which includes an input interface, an output interface, at least one processor, and a memory, where the input interface, the output interface, the processor, and the memory are directly connected through a bus, and the processor is configured to execute codes in the memory, and when the codes are executed, the processor implements the communication method in the first aspect. Based on the same inventive concept, since the principle of solving the problem of the system chip corresponds to the scheme in the method design of the first aspect, the implementation of the system chip can refer to the implementation of the method, and repeated details are not repeated.
In a fifth aspect, a computer-readable medium is provided, where the computer-readable medium stores program codes for a terminal to execute, where the program codes are used to execute the instructions of the communication method of the first aspect, and repeated descriptions are omitted here.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic networking diagram of a communication method according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Fig. 3 is a schematic configuration diagram of another terminal of the embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a system chip of an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
It should be understood that the technical solutions of the embodiments of the present invention can be applied to various communication systems, for example: a Global System for Mobile communications (GSM) System, a Code Division Multiple Access (CDMA) System, a Wideband Code Division Multiple Access (WCDMA) System, a General Packet Radio Service (GPRS), a Long Term Evolution (LTE) System, a LTE Frequency Division Duplex (FDD) System, a LTE Time Division Duplex (TDD), a WiMAX (Universal Mobile telecommunications System, UMTS), or a Worldwide Interoperability for microwave Access (UMTS) communication System, etc.
It should be understood that in the embodiment of the present invention, the Terminal may be referred to as a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), a computer, a microcomputer, or the like. The terminal may communicate with one or more core networks via a Radio Access Network (RAN), for example, the terminal may be a mobile telephone (or "cellular" telephone), a computer with a mobile terminal, etc., for example, the terminal may also be a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device that exchanges voice and/or data with the RAN. The invention is not limited in this respect, for example, the terminal also includes a terminal with a wired access having a multi-bearer feature.
It should be understood that the local area network in the embodiment of the present invention may be a wired local area network or a wireless local area network. Alternatively, the local area network in the embodiment of the present invention may be formed by a wired network and a wireless network.
As described above, in some large-area home or office areas, multiple routers may be used for networking to ensure that network signals cover the entire area. Since gateways are usually integrated in routers in the prior art. Therefore, one of the plurality of routers may be connected to the external network through a built-in gateway. And other routers only use the routing function, and the gateway built in the router is not actually used. While typically, especially when the routers are from the same brand, the IP address of the default gateway set by the multiple routers is typically the same, which may typically be the IP address of the router, e.g., the vendor typically sets the IP address of the default gateway of the router to 192.168.0.1. Therefore, when a plurality of routers in the local area network are networked, a plurality of gateways with the same IP address may exist in the network, and only one gateway capable of actually accessing the internet is provided, and a terminal in the network may be connected to a wrong gateway according to the IP address, thereby resulting in that the internet cannot be accessed normally.
For example, in the networking diagram of fig. 1, the gateway built in the first wireless router in fig. 1 is connected to the external Network through a Wide Area Network (WAN) interface, while a Local Area Network (LAN) interface of the first wireless router is connected to a LAN interface of the second wireless router through a Network cable, and the first wireless router and the second wireless router are networked together, but only the gateway built in the first wireless router is connected to the external Network. If a user needs to send data from a terminal to a gateway, the IP of the gateway needs to be analyzed to obtain a Media Access Control (MAC) address of the gateway, and a process of obtaining the MAC address from the IP address, that is, Address Resolution Protocol (ARP) analysis. If the IP of the default gateway set by the first wireless router and the IP of the default gateway set by the second wireless router are the same, a situation that one IP address corresponds to two MAC addresses occurs in the network, when the ARP resolves the MAC address of the gateway of the first wireless router, if the first wireless router receives data sent by a user, the first wireless router can be connected with an external network through the gateway of the first wireless router, and if the second wireless router receives the data sent by the user, the second wireless router forwards the data to the first wireless router, and then the second wireless router is connected with the external network through the gateway of the first wireless router; when the ARP resolves the MAC address of the gateway of the second wireless router, if the second wireless router receives the data sent by the user, the second wireless router tries to connect to the external network through the gateway of the second wireless router, but the data is not transferred to the first wireless router. The user data will be sent to the wrong place with a 50% probability, so that the internet will not be available with a 50% probability. Moreover, the more routers in the local area network, the greater the probability of the user data transmission error, which affects the user experience.
For example, in the networking diagram of fig. 1, the first wireless router and the second wireless router belong to the same local area network, and the IP addresses of the gateways of the routers in the same local area network are the same (e.g., 192.168.0.1), but the MAC addresses of the gateways corresponding to the routers are different; assume the MAC address of the gateway GW1 of the first wireless router is MAC 1; the MAC address of GW2 of the second wireless router is MAC 2; when the terminal is connected to any router (the terminal may be connected to the first wireless router or the second wireless router), the terminal acquires the IP address (e.g., 192.168.0.1) of the local area network; when the terminal data needs to be sent to the gateway, the IP address (e.g. 192.168.0.1) of the gateway is first resolved by ARP to obtain the MAC address. After receiving the ARP request, the router in the local area network respectively replies messages to the terminals sending the ARP request packets, wherein the reply messages carry the MAC addresses of the routers; the terminal selects the MAC address carried in the message received firstly and connects with the external network through the gateway corresponding to the MAC address. As shown in fig. 1, the MAC addresses of the first wireless router and the second wireless router are MAC1 and MAC2, respectively. If the ARP analysis obtains mac1, the terminal can access the internet if the first wireless router is connected with an external network; if the second wireless router is connected to the external network, the terminal cannot access the network. In the networking diagram of fig. 1, internet access is possible. Similarly, if the ARP resolution results in mac2, the terminal may not access the internet if the first wireless router is connected to the external network, and the user may access the internet if the second wireless router is connected to the external network.
Considering that users are limited by professional knowledge and ability, most users can only perform simple operations of plugging and unplugging network cables and modifying router names and passwords, and some advanced settings cannot be mastered. The situation described above may not be able to find the problem in time and deal with it accordingly. Therefore, the embodiment of the invention provides a communication method, which can be executed by a terminal. The method has the main idea that after the terminal accesses the local area network through the router, when the IP address of the gateway is obtained, if the IP address corresponds to the MAC addresses of the gateways, the gateway capable of being connected with the external network is actively detected, the target gateway capable of being connected with the external network is determined from the gateways, the target gateway is communicated with the external network, the target gateway is automatically determined, the operation of a user is omitted, and the user experience is improved.
The following describes a communication method 100 according to an embodiment of the present invention, where the method 100 may be performed by a terminal, and the method 100 includes:
110, the terminal determines the IP address of the gateway of the accessed local area network;
it should be noted that the terminal may be a terminal accessing the local area network. The terminal can access the local area network through a wireless router or can access the local area network through a wire. The terminal determines the IP address of the gateway, which may be determined by preset default settings, or may obtain the IP address in other manners, which is not limited in the present invention. For example, the terminal may obtain the IP address of the gateway from the router through a Dynamic Host Configuration Protocol (DHCP), or the terminal may manually input the IP address of the gateway through a user.
120, the terminal determines a MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the plurality of MAC addresses correspond to a plurality of gateways of the local area network one to one;
alternatively, the terminal determines the MAC address corresponding to the IP address, and may send an ARP request packet to each device in the local area network, or the terminal broadcasts the ARP request packet to all hosts on the local area network. After receiving the ARP request packet, each device in the local area network determines whether the IP address in the ARP request packet matches with the local IP address. If not, no response is made. And if the IP address is matched with the MAC address, replying a message to the terminal which sends the ARP request packet, wherein the replying message carries the MAC address matched with the IP address. After the terminal receives the reply message, the MAC address of the gateway matching the IP address may be determined.
Alternatively, the plurality of gateways may be respectively located in a plurality of routers. The plurality of routers may be wireless routers.
130, the terminal determines a target gateway capable of connecting an external network from the plurality of gateways;
alternatively, the external network may be a network other than the local area network. The external network may be, for example, the internet, or it may be another local area network.
Alternatively, a specific method for the terminal to determine a target gateway capable of connecting to the external network from the multiple gateways may be that the terminal, after determining MAC addresses of the multiple gateways corresponding to the IP address, sequentially binds the IP address to the MAC addresses of the multiple gateways, and after binding the MAC address of the gateway each time, the terminal tests whether the external network can be connected through the bound gateway, and if the external network can be connected, the terminal determines the gateway as the target gateway and may perform static ARP binding on the IP address and the MAC address of the target gateway. If the external network can not be connected, the terminal binds the IP address with the MAC address of the next gateway again until a target gateway is determined or all gateways are tested.
Alternatively, the terminal tests whether the external network can be connected through the bound gateway, and the terminal tests whether the internet can be connected through the bound gateway. It is possible to test whether a known website such as hundredths, Google (Google), etc. can be connected.
140, the terminal communicates with the external network through the target gateway.
In the embodiment of the invention, after the terminal determines the plurality of MAC addresses corresponding to the IP addresses of the gateways of the accessed local area network, the terminal determines the target equipment capable of being connected with the external network from the plurality of equipment corresponding to the plurality of MAC addresses and determines the target equipment as the target gateway, so that the terminal does not need to be set by a user, can automatically determine the target gateway and improves the user experience.
The following describes a flow of a specific embodiment of the communication method according to an embodiment of the present invention in detail. As described below, the process includes, assuming that the terminal is located in a local area network networked by a plurality of wireless routers:
(1) the terminal accesses the local area network through any router and acquires the IP address of the gateway of the local area network;
(2) the terminal performs ARP detection (for example, a broadcast ARP detection packet) according to the IP address;
(3) if the terminal receives a plurality of MAC addresses responding to the ARP detection packet, the terminal indicates that a plurality of gateways in the local area network correspond to the IP addresses, and the gateways can be named as GW1 and GW2 …
(4) The terminal performs static ARP binding on the IP address and the MAC address of GW1, accesses an external network (for example, accesses a famous website such as Baidu or Google) and determines whether the external network can be connected through GW 1;
(5) if GW1 can connect with external network, then GW1 is determined as target gateway, and the process ends; if GW1 is not capable of connecting to the external network, proceed to the next step;
(6) the terminal performs static ARP binding on the IP address and the MAC address of the next gateway and determines whether the external network can be accessed or not until a target gateway which can access the external network is determined; or testing all gateways, if all gateways can not surf the internet, not binding any gateway, and ending the process.
Optionally, after the terminal determines the target gateway, the terminal may preferentially connect to the external network through the determined target gateway. If the terminal determines that the external network cannot be connected through the determined target gateway when the target gateway is changed due to a change in a networking mode or other reasons, the terminal may perform step 120 and step 130 again to re-determine the MAC address of the target gateway, and then connect the external network through the re-determined target gateway.
In the embodiment of the invention, under the condition that the IP address of the gateway corresponds to the MAC addresses of a plurality of gateways, the terminal can ensure that the user can normally connect the external network under the condition of a plurality of gateways by automatically detecting and binding the target gateway capable of connecting the external network, thereby improving the user experience.
The communication method according to the embodiment of the present invention is described in detail above with reference to fig. 1, and the terminal according to the embodiment of the present invention is described in detail below with reference to fig. 2.
Fig. 2 is a schematic configuration diagram of a terminal of an embodiment of the present invention. It should be understood that the terminal 200 of fig. 2 is capable of performing the various steps of the communication method previously performed by the terminal and will not be described in detail herein to avoid repetition. The terminal 200 includes:
a memory 210 for storing a program;
a processor 220 for executing a program stored in the memory 310, the processor 320 for determining an IP address of a gateway of a local area network to which the terminal accesses when the program is executed; determining an MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the MAC addresses correspond to a plurality of gateways of the local area network one by one; determining a target gateway capable of connecting with an external network from the plurality of gateways; and controlling the terminal to communicate with the external network through the target gateway. Based on the same inventive concept, because the principle of the terminal for solving the problem is similar to the communication method in the embodiment of the method of the present invention, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
In the embodiment of the invention, after the terminal determines the MAC address corresponding to the IP address of the target gateway and when the MAC address comprises a plurality of MAC addresses, the target equipment capable of realizing network interconnection is determined from a plurality of pieces of equipment corresponding to the plurality of MAC addresses, and the target equipment is determined as the target gateway, so that the terminal does not need to be set by a user, the target gateway can be automatically determined, and the user experience is improved.
Fig. 3 is a schematic configuration diagram of a terminal of an embodiment of the present invention. The modules in the terminal in fig. 3 may be part of the processor in fig. 2. It should be understood that the terminal 300 of fig. 3 is capable of performing the various steps of the communication method previously performed by the terminal and will not be described in detail herein to avoid repetition. The terminal 300 includes:
a first determining module 310, configured to determine an IP address of a gateway of a local area network to which the terminal accesses;
a second determining module 320, configured to determine a MAC address corresponding to the IP address, where the IP address corresponds to multiple MAC addresses, and the multiple MAC addresses correspond to multiple gateways of the local area network one to one;
a third determining module 330, configured to determine a target gateway capable of connecting to an external network from the plurality of gateways;
a communication module 340, configured to control the terminal to communicate with the external network through the target gateway.
Based on the same inventive concept, because the principle of the terminal for solving the problem is similar to the communication method in the embodiment of the method of the present invention, the implementation of the terminal may refer to the implementation of the method, and repeated details are not repeated.
In the embodiment of the invention, after the terminal determines the MAC address corresponding to the IP address of the target gateway and when the MAC address comprises a plurality of MAC addresses, the target equipment capable of realizing network interconnection is determined from a plurality of pieces of equipment corresponding to the plurality of MAC addresses, and the target equipment is determined as the target gateway, so that the terminal does not need to be set by a user, the target gateway can be automatically determined, and the user experience is improved.
Fig. 4 is a schematic structural diagram of a system chip of an embodiment of the present invention. The system chip 400 of fig. 4 includes an input interface 410, an output interface 420, at least one processor 430, and a memory 440, where the input interface 410, the output interface 420, the processor 430, and the memory 440 are connected by a bus, the processor 430 is configured to execute codes in the memory 440, and when the codes are executed, the processor 430 implements the communication method executed by the terminal in the foregoing.
Additionally, the terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that in the present embodiment, "B corresponding to a" means that B is associated with a, from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the unit is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention 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 form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a non-volatile storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Technical features and descriptions in one embodiment above can be understood and applied to other embodiments for brevity and clarity of the application document, and are not described in detail in other embodiments.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method of communication, comprising:
the terminal determines the IP address of the gateway of the accessed local area network;
the terminal determines an MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the MAC addresses correspond to a plurality of gateways one by one;
the terminal determines a target gateway capable of being connected with an external network from the plurality of gateways;
the terminal communicates with the external network through the target gateway;
wherein, the terminal determines a target gateway capable of connecting with an external network from the plurality of gateways, and the method comprises the following steps:
the terminal binds the IP address with the MAC address of a first gateway in the plurality of gateways, wherein the first gateway is any one of the plurality of gateways; the terminal determines whether the external network can be connected through the first gateway; and when the external network can be connected through the first gateway, the terminal determines the first gateway as the target gateway.
2. The communication method according to claim 1, wherein the determining, by the terminal, the MAC address corresponding to the IP address includes:
the terminal sends an Address Resolution Protocol (ARP) request packet to each device of the local area network, wherein the ARP request packet comprises the IP address;
and the terminal receives a reply message of each device, wherein the reply message comprises the MAC address of the device corresponding to the IP address.
3. The communication method according to claim 1 or 2, characterized in that the communication method further comprises:
and the terminal binds the IP address and the MAC address static ARP of the target gateway.
4. A terminal, comprising:
a first determining module, configured to determine an IP address of a gateway of a local area network to which the terminal is accessed;
a second determining module, configured to determine an MAC address corresponding to the IP address, where the IP address corresponds to multiple MAC addresses, and the multiple MAC addresses correspond to multiple gateways of the local area network one to one;
a third determining module, configured to determine a target gateway capable of connecting to an external network from the plurality of gateways;
the communication module is used for controlling the terminal to communicate with the external network through the target gateway;
wherein the third determining module is specifically configured to: binding the IP address with a MAC address of a first gateway of the plurality of gateways, wherein the first gateway is any one of the plurality of gateways; determining whether the external network can be connected through the first gateway; and when the external network can be connected through the first gateway, determining the first gateway as the target gateway.
5. The terminal of claim 4, wherein the second determining module is specifically configured to: sending an Address Resolution Protocol (ARP) request packet to each device of the local area network, wherein the ARP request packet comprises the IP address; and receiving a reply message of each device, wherein the reply message comprises the MAC address of the device corresponding to the IP address.
6. The terminal according to claim 4 or 5, characterized in that the terminal further comprises:
and the binding module is used for binding the IP address and the MAC address static ARP of the target gateway.
7. A terminal, comprising:
a memory for storing a program;
a processor for executing a program, which when executed, is operable to determine a network protocol, IP, address of a gateway of an accessed local area network; determining an MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the MAC addresses correspond to a plurality of gateways one to one; determining a target gateway capable of connecting with an external network from the plurality of gateways; communicating with the extranet through the target gateway;
wherein the processor is specifically configured to bind the IP address with a MAC address of a first gateway of the plurality of gateways, wherein the first gateway is any one of the plurality of gateways; determining whether the external network can be connected through the first gateway; and when the external network can be connected through the first gateway, the terminal determines the first gateway as the target gateway.
8. The terminal of claim 7, wherein the processor is specifically configured to send an address resolution protocol, ARP, request packet to each device of the local area network, the ARP request packet including the IP address; and receiving a reply message of each device, wherein the reply message comprises the MAC address of the device corresponding to the IP address.
9. The terminal of claim 7 or 8, wherein the processor is specifically configured to statically ARP bind the IP address and the MAC address of the target gateway.
10. A storage medium, characterized in that it is used for controlling a terminal to execute a method of inserting a code, said method comprising the steps of:
the terminal in the local area network determines the network protocol IP address of the gateway of the local area network;
the terminal determines an MAC address corresponding to the IP address, wherein the IP address corresponds to a plurality of MAC addresses, and the MAC addresses correspond to a plurality of gateways one by one;
the terminal determines a target gateway capable of being connected with an external network from the plurality of gateways;
the terminal communicates with the external network through the target gateway;
wherein, the terminal determines a target gateway capable of connecting with an external network from the plurality of gateways, and the method comprises the following steps: the terminal binds the IP address with the MAC address of a first gateway in the plurality of gateways, wherein the first gateway is any one of the plurality of gateways; the terminal determines whether the external network can be connected through the first gateway; and when the external network can be connected through the first gateway, the terminal determines the first gateway as the target gateway.
11. The storage medium of claim 10, wherein the terminal determining the MAC address corresponding to the IP address comprises:
the terminal sends an Address Resolution Protocol (ARP) request packet to each device of the local area network, wherein the ARP request packet comprises the IP address;
and the terminal receives a reply message of each device, wherein the reply message comprises the MAC address of the device corresponding to the IP address.
12. The storage medium of claim 10 or 11, wherein the communication method further comprises:
and the terminal binds the IP address and the MAC address static ARP of the target gateway.
CN201680024794.2A 2016-03-29 2016-03-29 Communication method and terminal Active CN107534585B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/077633 WO2017166038A1 (en) 2016-03-29 2016-03-29 Communication method and terminal

Publications (2)

Publication Number Publication Date
CN107534585A CN107534585A (en) 2018-01-02
CN107534585B true CN107534585B (en) 2020-04-21

Family

ID=59963280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201680024794.2A Active CN107534585B (en) 2016-03-29 2016-03-29 Communication method and terminal

Country Status (2)

Country Link
CN (1) CN107534585B (en)
WO (1) WO2017166038A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114598571A (en) * 2020-12-07 2022-06-07 上汽通用汽车有限公司 Vehicle-mounted multi-gateway IP routing method and system based on application and vehicle
CN113625589B (en) * 2021-09-15 2023-12-12 云茂互联智能科技(厦门)有限公司 Equipment control method and device, electronic equipment and storage medium
CN114268383B (en) * 2021-12-21 2023-12-22 瑞德电子(信丰)有限公司 Wireless data transceiver module and testing method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1754374A (en) * 2003-03-28 2006-03-29 思科技术公司 Network address translation with gateway load distribution
CN1961542A (en) * 2004-06-30 2007-05-09 松下电器产业株式会社 Communication device, communication setting method, communication setting program, and recording medium for recording the communication setting program
CN102694771A (en) * 2011-03-22 2012-09-26 上海艾泰科技有限公司 A method for binding IP-MAC to gateway DHCP server side and gateway DHCP server side

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2519176B (en) * 2013-11-01 2015-12-09 Shared Band Ltd Bonding router

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1754374A (en) * 2003-03-28 2006-03-29 思科技术公司 Network address translation with gateway load distribution
CN1961542A (en) * 2004-06-30 2007-05-09 松下电器产业株式会社 Communication device, communication setting method, communication setting program, and recording medium for recording the communication setting program
CN102694771A (en) * 2011-03-22 2012-09-26 上海艾泰科技有限公司 A method for binding IP-MAC to gateway DHCP server side and gateway DHCP server side

Also Published As

Publication number Publication date
CN107534585A (en) 2018-01-02
WO2017166038A1 (en) 2017-10-05

Similar Documents

Publication Publication Date Title
US10505908B2 (en) System and method for automatic wireless connection between a portable terminal and a digital device
JP6726426B2 (en) Login-free method and device between terminals
JP5348094B2 (en) Support device and computer program
US10104716B2 (en) Apparatus and method for relaying by mobile device, and storage medium
US8238315B2 (en) Rapid local address assignment for wireless communication networks
CN110248364B (en) IOT equipment network distribution method, device, equipment and medium
EP3614649A1 (en) Ip address allocation method and device
JP6402583B2 (en) Relay device, relay system, relay method, and program
CN107534585B (en) Communication method and terminal
CN102833364A (en) Domain name resolution agent method and gateway device
CN106507414B (en) Message forwarding method and device
CN108093390B (en) Intelligent device discovery method based on characteristic information
KR102310027B1 (en) Determination method and corresponding terminal, computer program product and storage medium
US20140136597A1 (en) Relay enabled dynamic virtual private network
TW201114221A (en) Method and system of smart detection and recovery
TW201611549A (en) Network device and method for routing
US20140211692A1 (en) Communication system and method
JP6406045B2 (en) Karaoke system, address lease server, management server, karaoke equipment
CN104243626B (en) Information processing apparatus
CN103516820A (en) Port forwarding method and apparatus based on MAC address
CN105429880A (en) Network equipment and method for performing router forwarding by network equipment
US10873561B2 (en) Method and apparatus for allocating IP parameter
CN110290230B (en) Method, device and storage medium for detecting dialing mode supported by network environment
JP6314500B2 (en) COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
CN107113295B (en) Communication method, device and system

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