CN111817962A - Android system multi-network-card intelligent routing method - Google Patents

Android system multi-network-card intelligent routing method Download PDF

Info

Publication number
CN111817962A
CN111817962A CN202010619043.3A CN202010619043A CN111817962A CN 111817962 A CN111817962 A CN 111817962A CN 202010619043 A CN202010619043 A CN 202010619043A CN 111817962 A CN111817962 A CN 111817962A
Authority
CN
China
Prior art keywords
network
android system
routing
destination
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010619043.3A
Other languages
Chinese (zh)
Other versions
CN111817962B (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.)
Xiamen Leelen Technology Co Ltd
Original Assignee
Xiamen Leelen Technology 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 Xiamen Leelen Technology Co Ltd filed Critical Xiamen Leelen Technology Co Ltd
Priority to CN202010619043.3A priority Critical patent/CN111817962B/en
Publication of CN111817962A publication Critical patent/CN111817962A/en
Application granted granted Critical
Publication of CN111817962B publication Critical patent/CN111817962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/121Shortest path evaluation by minimising delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/123Evaluation of link metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays

Abstract

The invention relates to a method for intelligent routing of a plurality of network cards in an android system, which comprises the following steps of 1, loading all Ethernet cards in the android system and registering the Ethernet cards in a frame; step 2, closing a network card scoring mechanism in the android system, and starting all Ethernet cards and WIFI network cards in the system; and 3, creating a routing daemon, and creating a modifiable custom routing table through the routing daemon, wherein the priority of the custom routing table is higher than that of all routing tables in the android system. The invention can realize the simultaneous operation of multiple networks, reduce the network delay and increase the network expansibility of equipment.

Description

Android system multi-network-card intelligent routing method
Technical Field
The invention relates to the field of android system communication, in particular to an android system multi-network-card intelligent routing method.
Background
At present, the network interface configuration of an android device generally supports only one wired ethernet, one WIFI, and 4G, bluetooth shared network, and the like. When the device has two wired Ethernet networks and WIFI (wireless fidelity) which are simultaneously connected to the Internet, the android selects the first loaded wired Ethernet network as a communication network interface based on a network card scoring mechanism preset by the system, and other network interfaces are closed or all communications are forwarded to the first wired Ethernet network through a routing table. If the first Ethernet is directly connected with a certain server in an application scene, the second Ethernet and WIFI are connected with the Internet, and the problem that the Internet cannot be accessed occurs in a native android system environment. This leads to a problem of three networks of devices, only one.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a method for intelligent routing of a multi-network card of an android system, which can realize simultaneous working of multiple networks, reduce network delay and increase network expansibility of equipment.
In order to achieve the purpose, the invention adopts the technical scheme that:
a method for android system multi-network card intelligent routing comprises
Step 1, loading all Ethernet cards in an android system, and registering the Ethernet cards in a frame;
step 2, closing a network card scoring mechanism in the android system, and starting all Ethernet cards and WIFI network cards in the system;
and 3, creating a routing daemon, and creating a modifiable custom routing table through the routing daemon, wherein the priority of the custom routing table is higher than that of all routing tables in the android system.
The method further comprises the following steps: and 4, configuring a default gateway according to the network card connection state and the network delay.
The method further comprises the following steps: and 5, monitoring the communication frequency of each destination address in real time, and establishing a special route for the destination address according to the frequency.
The step 4 is specifically as follows:
when the android system is connected with only one network card, the routing daemon configures the network card as a default gateway;
when the android system is connected with more than two network cards, the default gateway configuration is as follows:
the route daemon respectively sends ping messages through each network card to acquire a famous domain name on the Internet; judging whether the ping message is successfully sent, if only one network card is successfully sent, selecting the network card to configure into a default gateway; if more than two network cards are successfully sent, judging ping delay, and selecting the network card with short delay to configure into a default gateway; if all the network cards fail to ping, whether the connected network cards have WIFI network cards is judged, if yes, the WIFI network cards are configured into default gateways, and if not, the first connected network card is selected as the default gateway.
The step 5 is specifically as follows:
and acquiring the packet sending number of the destination IP address communicated with the android system, when the packet sending number of the destination IP address exceeds a set value and a plurality of network cards of the current android system are connected to the Ethernet, carrying out a routing test on the destination IP address by a routing daemon, and if the routing test result is not a default gateway, establishing a special route for the destination IP address.
The process of creating a private route for a destination IP address is as follows:
sending ping message to destination IP address from connected network card to calculate consumed time Rping(ii) a Sending message to destination IP address by ICMP protocol, calculating number of times R of forwarding by router on networkttl(ii) a Calculating the path length R of each local network card to the destination IP address through a dynamic routing formulalenThe calculation is as follows:
Rlen= Rn-ping×α + Rn-ttl×β;
wherein α and β are coefficient factors;
from each RlenThe minimum is selected as a special route, and the destination IP address is set as the matching condition of the special route, RlenThe smallest network card is set as the matching target for this route.
After the scheme is adopted, all network cards of the system are loaded and registered in the frame, and the network card grading mechanism is closed, so that the android system can simultaneously support a plurality of Ethernet and WIFI. In addition, the invention enables the user to dynamically adjust the network communication strategy by establishing the route daemon. When a plurality of network cards are connected to the Ethernet at the same time, the system can automatically configure the optimal default gateway, thereby ensuring the stability and high real-time performance of network communication. When the device communicates with the network, the route daemon process can automatically monitor which network card has the highest communication efficiency, and then dynamically adds the route, so that the communication time is kept low delay.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
As shown in fig. 1, the present invention discloses a method for android system multi-network card intelligent routing, which is characterized in that: the method comprises the following steps:
step 1, loading all Ethernet cards in the android system, and registering the Ethernet cards in a frame.
For example, when the android system supports two ethernet cards, the method is expanded on the basis of ethernet network efficiency. java, and ethernet network efficiency 2.java is added and registered in ethernet service impl, so that the android system simultaneously supports two ethernet cards eth0 and eth 1.
And 2, closing a network card scoring mechanism in the android system, and starting all Ethernet cards and WIFI network cards in the system.
Java, shielding the scoring mechanism of Ethernet and WIFI, and enabling the Ethernet card and the WIFI in the system to be all started.
And 3, creating a routing daemon, and creating a modifiable custom routing table through the routing daemon, wherein the priority of the custom routing table is higher than that of all routing tables in the android system. In the normal operation process of the android system, the routing daemon can modify the user-defined routing table in real time to achieve the purpose of dynamically adjusting the network communication strategy.
And 4, configuring a default gateway according to the network card connection state and the network delay.
Specifically, when the android system is connected with only one network card, the routing daemon configures the network card as a default gateway;
when the android system is connected with more than two network cards, the default gateway configuration is as follows:
the route daemon respectively sends ping messages through each network card to aim at a famous IP or a domain name on the Internet; judging whether the ping message is successfully sent, if only one network card is successfully sent, selecting the network card to configure into a default gateway; if more than two network cards are successfully sent, judging ping delay, and selecting the network card with short delay to configure into a default gateway; if all the network cards fail to ping, whether the connected network cards have WIFI network cards is judged, if yes, the WIFI network cards are configured into default gateways, and if not, the first connected network card is selected as the default gateway.
And 5, monitoring the communication frequency of each destination address in real time, and establishing a special route for the destination address according to the frequency.
Specifically, the packet sending number of the destination IP address communicated with the android system is obtained, when the packet sending number of a certain destination IP address exceeds a set value and the android system has a plurality of network cards connected to the ethernet, the routing daemon performs a routing test on the destination IP address, and if the routing test result is not a default gateway, a dedicated route is created for the destination IP address.
The process of creating a private route for a destination IP address is as follows:
sending ping message to destination IP address from connected network card to calculate consumed time Rping(ii) a Sending message to destination IP address by ICMP protocol, calculating number of times R of forwarding by router on networkttl(ii) a Calculating the path length R of each local network card to the destination IP address through a dynamic routing formulalenThe calculation is as follows:
Rlen= Rn-ping×α + Rn-ttl×β;
wherein α and β are coefficient factors;
from each RlenThe minimum is selected as a special route, and the destination IP address is set as the matching condition of the special route, RlenThe smallest network card is set as the matching target for this route.
In summary, the key point of the present invention is that the android system supports multiple ethernet networks and WIFI simultaneously by loading all network cards of the system and registering the network cards in a frame and closing the network card scoring mechanism. In addition, the invention enables a user to dynamically adjust the network communication strategy by establishing the route daemon process, namely, only one network card or a plurality of network cards can be connected at the same time, the network cards can be connected on the Ethernet, or any network card can be directly connected with a certain network device. When a plurality of network cards are connected to the Ethernet at the same time, the system can automatically configure the optimal default gateway, thereby ensuring the stability and high real-time performance of network communication. When the device communicates with the network, the route daemon process can automatically monitor which network card has the highest communication efficiency, and then dynamically adds the route, so that the communication time is kept low delay.
The above description is only exemplary of the present invention and is not intended to limit the technical scope of the present invention, so that any minor modifications, equivalent changes and modifications made to the above exemplary embodiments according to the technical spirit of the present invention are within the technical scope of the present invention.

Claims (6)

1. A method for android system multi-network card intelligent routing is characterized in that: comprises that
Step 1, loading all Ethernet cards in an android system, and registering the Ethernet cards in a frame;
step 2, closing a network card scoring mechanism in the android system, and starting all Ethernet cards and WIFI network cards in the system;
and 3, creating a routing daemon, and creating a modifiable custom routing table through the routing daemon, wherein the priority of the custom routing table is higher than that of all routing tables in the android system.
2. The method for android system multi-network-card smart routing according to claim 1, wherein: the method further comprises the following steps:
and 4, configuring a default gateway according to the network card connection state and the network delay.
3. The method for android system multi-network-card smart routing according to claim 2, wherein: the method further comprises the following steps:
and 5, monitoring the communication frequency of each destination address in real time, and establishing a special route for the destination address according to the frequency.
4. The method for android system multi-network-card smart routing according to claim 2, wherein: the step 4 is specifically as follows:
when the android system is connected with only one network card, the routing daemon configures the network card as a default gateway;
when the android system is connected with more than two network cards, the default gateway configuration is as follows:
the route daemon respectively sends ping messages through each network card to acquire a famous domain name on the Internet; judging whether the ping message is successfully sent, if only one network card is successfully sent, selecting the network card to configure into a default gateway; if more than two network cards are successfully sent, judging ping delay, and selecting the network card with short delay to configure into a default gateway; if all the network cards fail to ping, whether the connected network cards have WIFI network cards is judged, if yes, the WIFI network cards are configured into default gateways, and if not, the first connected network card is selected as the default gateway.
5. The method for android system multi-network-card smart routing according to claim 3, wherein: the step 5 is specifically as follows:
and acquiring the packet sending number of the destination IP address communicated with the android system, when the packet sending number of the destination IP address exceeds a set value and a plurality of network cards of the current android system are connected to the Ethernet, carrying out a routing test on the destination IP address by a routing daemon, and if the routing test result is not a default gateway, establishing a special route for the destination IP address.
6. The method for android system multi-network-card smart routing of claim 5, wherein: the process of creating a private route for a destination IP address is as follows:
sending ping message to destination IP address from connected network card to calculate consumed time Rping(ii) a Sending message to destination IP address by ICMP protocol, calculating number of times R of forwarding by router on networkttl(ii) a Calculating the path length R of each local network card to the destination IP address through a dynamic routing formulalenThe calculation is as follows:
Rlen= Rn-ping×α + Rn-ttl×β;
wherein α and β are coefficient factors;
from each RlenThe minimum is selected as a special route, and the destination IP address is set as the matching condition of the special route, RlenThe smallest network card is set as the matching target for this route.
CN202010619043.3A 2020-07-01 2020-07-01 Android system multi-network-card intelligent routing method Active CN111817962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010619043.3A CN111817962B (en) 2020-07-01 2020-07-01 Android system multi-network-card intelligent routing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010619043.3A CN111817962B (en) 2020-07-01 2020-07-01 Android system multi-network-card intelligent routing method

Publications (2)

Publication Number Publication Date
CN111817962A true CN111817962A (en) 2020-10-23
CN111817962B CN111817962B (en) 2022-06-14

Family

ID=72855144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010619043.3A Active CN111817962B (en) 2020-07-01 2020-07-01 Android system multi-network-card intelligent routing method

Country Status (1)

Country Link
CN (1) CN111817962B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765802A (en) * 2021-07-26 2021-12-07 深圳市智微智能科技股份有限公司 android device network card dynamic switching method, system, terminal and storage medium
CN114340046A (en) * 2021-11-19 2022-04-12 南京瀚元科技有限公司 Multi-network-card equipment networking communication method based on Android system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090092142A1 (en) * 2007-10-04 2009-04-09 Barrett Kreiner Methods, systems and computer program products for dynamic communication data routing by a multi-network remote communication terminal
US20110276699A1 (en) * 2010-05-09 2011-11-10 Pedersen Bradley J Systems and methods for allocation of classes of service to network connections corresponding to virtual channels
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
CN103973800A (en) * 2014-05-19 2014-08-06 普天信息技术有限公司 Android-based double-network-card concurrence implementation method
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards
CN108347351A (en) * 2018-01-26 2018-07-31 广州视源电子科技股份有限公司 The method, apparatus and system of equipment Dual-Ethernet card compatibility
CN109510766A (en) * 2018-12-13 2019-03-22 深圳市鼎泰富科技有限公司 Dynamic routing method and system under a kind of intelligent terminal multiple-network connection environment
CN110392416A (en) * 2019-08-12 2019-10-29 广州鲁邦通物联网科技有限公司 A kind of network selecting method of Android system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090092142A1 (en) * 2007-10-04 2009-04-09 Barrett Kreiner Methods, systems and computer program products for dynamic communication data routing by a multi-network remote communication terminal
US20110276699A1 (en) * 2010-05-09 2011-11-10 Pedersen Bradley J Systems and methods for allocation of classes of service to network connections corresponding to virtual channels
CN102986189A (en) * 2010-05-09 2013-03-20 思杰***有限公司 Systems and methods for allocation of classes of service to network connections corresponding to virtual channels
CN103973800A (en) * 2014-05-19 2014-08-06 普天信息技术有限公司 Android-based double-network-card concurrence implementation method
CN103957572A (en) * 2014-05-20 2014-07-30 普天信息技术有限公司 Android-system-based distribution method through multi-network route policy
CN106953795A (en) * 2016-01-07 2017-07-14 中兴通讯股份有限公司 Configure the method and device of many network interface cards
CN108347351A (en) * 2018-01-26 2018-07-31 广州视源电子科技股份有限公司 The method, apparatus and system of equipment Dual-Ethernet card compatibility
CN109510766A (en) * 2018-12-13 2019-03-22 深圳市鼎泰富科技有限公司 Dynamic routing method and system under a kind of intelligent terminal multiple-network connection environment
CN110392416A (en) * 2019-08-12 2019-10-29 广州鲁邦通物联网科技有限公司 A kind of network selecting method of Android system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈小辉: "《Windows平台上多网卡路由配置方法》", 《华南金融电脑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113765802A (en) * 2021-07-26 2021-12-07 深圳市智微智能科技股份有限公司 android device network card dynamic switching method, system, terminal and storage medium
CN114340046A (en) * 2021-11-19 2022-04-12 南京瀚元科技有限公司 Multi-network-card equipment networking communication method based on Android system
CN114340046B (en) * 2021-11-19 2024-03-29 南京瀚元科技有限公司 Multi-network card equipment networking communication method based on Android system

Also Published As

Publication number Publication date
CN111817962B (en) 2022-06-14

Similar Documents

Publication Publication Date Title
US20220070648A1 (en) Methods, systems, and computer readable media for service communications proxy (scp)-specific prioritized network function (nf) discovery and routing
US10084706B2 (en) Method and device for processing service function chaining
US8380828B1 (en) System and method for locating offending network device and maintaining network integrity
CN103262506B (en) Method and apparatus for allowing to distinguish disposal mobile network data business
JP5636113B2 (en) Distinct processing of data traffic using adaptation of network address lookup
EP2642691A1 (en) Method and device for link fault detecting and recovering based on arp interaction
CN109842574B (en) Multi-homed network route forwarding method based on programmable network technology
CN108429680B (en) Route configuration method, system, medium and equipment based on virtual private cloud
CN102801623B (en) Multi-access data transmitting method and device
CN104821905A (en) Network relay device, and method for relaying data packet
US11134009B2 (en) Packet processing method and apparatus
CN111817962B (en) Android system multi-network-card intelligent routing method
CN101924689A (en) Negotiation method of maximum segmentation parameters and network forwarding equipment
CN110233834B (en) Network system, method, device and equipment for intercepting attack message
CN109150723B (en) Routing communication implementation method of Internet of things
CN104821904A (en) Network relay device, and method for relaying data packet
EP3614794A1 (en) Multi-path access network
US11463349B2 (en) Fault diagnosis method and apparatus thereof
EP2792196B1 (en) Mobile communication terminal, communication method, communication system, and control apparatus
WO2015192705A1 (en) Access device and method implemented by access device for allowing user equipment to access network
KR20140124116A (en) Apparatus and method for optimizing data-path in mobile communication network
CN108737277B (en) Message forwarding method and device
EP3788748B1 (en) First network node, second network node, and methods performed thereby for tracing a packet in a pipeline
EP4333385A1 (en) Method, data processing device, computer program and computer-readable medium for routing packets in a packet-switched network
EP4366271A1 (en) Address generation system for a wireless communication network

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