CN106375224B - Router and method for network connection by using same - Google Patents

Router and method for network connection by using same Download PDF

Info

Publication number
CN106375224B
CN106375224B CN201510435990.6A CN201510435990A CN106375224B CN 106375224 B CN106375224 B CN 106375224B CN 201510435990 A CN201510435990 A CN 201510435990A CN 106375224 B CN106375224 B CN 106375224B
Authority
CN
China
Prior art keywords
router
time period
client
area network
data packet
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
CN201510435990.6A
Other languages
Chinese (zh)
Other versions
CN106375224A (en
Inventor
杨世国
Original Assignee
Ambit Microsystems Shanghai 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 Ambit Microsystems Shanghai Ltd filed Critical Ambit Microsystems Shanghai Ltd
Priority to CN201510435990.6A priority Critical patent/CN106375224B/en
Publication of CN106375224A publication Critical patent/CN106375224A/en
Application granted granted Critical
Publication of CN106375224B publication Critical patent/CN106375224B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a router and a method for network connection by using the router. The router includes: the receiving module is used for receiving the information of the switching of the internet access mode of the router; the detection module is used for detecting whether the router has network communication currently; the first processing module is used for forcing all the clients to log out of the connected local area network ports and rejecting re-authentication requests of the clients when detecting that the router does not have network communication currently; and the second processing module is used for re-receiving the authentication request of the client after waiting for the first preset time. The invention can update the IP address of the client in time to realize network connection.

Description

Router and method for network connection by using same
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a router and a method for network connection using the router.
Background
A Router (Router) is a device that connects Local Area Networks (LAN) and Wide Area Networks (WAN) in the internet. Most routers include wan port jacks, lan port jacks, and 3G network card jacks (USB). The wan port is used to connect an external network, such as an ethernet cable or an Asymmetric Digital Subscriber Line (ADSL) Modem. The lan port is used to connect to an internal network, and is mainly connected to a switch, a hub or a Personal Computer (PC) in the lan.
The WAN port of the router typically has two interfaces, one is 3G/4G and the other is Wi-Fi. When the router is in the bridge mode, the two interfaces of the WAN port can be switched automatically, and the IP address of the WAN port can be changed. Therefore, the client of the lan port also needs to re-acquire the IP address. However, a client of a local area network port in an existing Dynamic Host Configuration Protocol (DHCP) mode cannot automatically update an IP address in time, and only waits for a user to manually update or update after a lease expires, which brings poor experience to the user.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a router, which can automatically update the IP address of the client of the router lan port to realize network connection when switching the internet access mode of the router.
In addition, it is necessary to provide a network connection method.
A router comprising a wide area network port and a local area network port, the local area network port being connected to a client, the router comprising: the receiving module is used for receiving the information of the switching of the internet access mode of the router; the detection module is used for detecting whether the router has network communication currently; the first processing module is used for forcing all the clients to log out of the connected local area network ports and rejecting re-authentication requests of the clients when detecting that the router does not have network communication currently; and the second processing module is used for re-receiving the authentication request of the client after waiting for the first preset time.
A network connection method is applied to a router, the router comprises a wide area network port and a local area network port, the local area network port is connected with a client, and the method comprises the following steps: receiving, namely receiving information of switching of the internet access mode of the router; a detecting step, detecting whether the router has network communication currently; a first processing step, if detecting that the router does not have network communication currently, forcing all clients to log out of the connected local area network ports, and rejecting re-authentication requests of the clients; and a second processing step of re-receiving the authentication request of the client after waiting for a first preset time.
Compared with the prior art, the router and the method for network connection by using the router provided by the invention can enable the client connected with the router to automatically acquire the IP address to realize network connection when the router switches the internet access mode.
Drawings
Fig. 1 is a hardware architecture diagram for connecting a client to a network using a router.
Fig. 2 is a functional block diagram of a preferred embodiment of the router of the present invention.
Fig. 3 is a flow chart of a preferred embodiment of the network connection method of the present invention.
Description of the main elements
Router 1
Client 2
Network 3
LAN port 11
WAN port 12
Receiving module 101
Detecting module 102
First processing module 103
Second processing module 104
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
Referring to fig. 1, a diagram of a hardware architecture for connecting a client to a network using a router is shown. In the present embodiment, a plurality of clients 2 (such as personal computers and mobile phones) are connected to a Local Area Network (LAN) port 11 of the router 1. The Wide Area Network (WAN) port 12 of the router 1 is connected to the Network 3 via 3G/4G or Wi-Fi. The network 3 may be a wide area network.
Fig. 2 is a functional block diagram of the router 1 according to the preferred embodiment of the router of the present invention. The functional modules of the router 1 include a receiving module 101, a detecting module 102, a first processing module 103, and a second processing module 104. The modules referred to in the present invention are program segments capable of performing a specific function, and are more suitable than programs for describing the execution process of software in the router 1, and the detailed functions of the modules will be described in detail in the flow chart of fig. 3 later.
Fig. 3 is a flow chart of a preferred embodiment of the network connection method of the present invention. The order of the steps in the flow chart may be changed, and some steps may be omitted or combined according to different requirements.
In step S01, the receiving module 101 receives the information of switching the internet access mode of the router 1. In this embodiment, the router 1 not only supports wan port connection, but also supports 3G/4G internet card connection. In addition, the router 1 also supports automatic switching between internet access modes, that is, when one mode fails to connect, the router 1 can also automatically switch to another mode to connect. Specifically, the user may set the internet mode of the router 1, such as 3G priority. In this mode, router 1 will first attempt to connect to the 3G network. When the 3G connection fails or the router 1 does not detect the 3G network card and the WAN port connection is available, the router 1 switches to the WAN port connection; when router 1 is able to successfully connect to the 3G network, router 1 immediately disconnects the wan port and switches to the 3G connection.
In step S02, the detecting module 102 detects whether the router 1 has network communication currently. If no network communication is currently occurring, the process proceeds to step S03, and if a network communication is currently occurring, the process proceeds to step S05.
In this embodiment, the detecting, by the router 1, whether there is network communication currently includes: detecting whether a difference value between a data packet sent by the wan port 12 in a current time period and a data packet sent by the wan port 12 in a previous time period is greater than a preset value, and whether a difference value between a data packet received by the wan port 12 in the current time period and a data packet received by the wan port 12 in the previous time period is greater than the preset value; detecting whether a difference value between a data packet sent by the lan port 11 in a current time period and a data packet sent by the lan port 11 in a previous time period is greater than the preset value, and whether a difference value between a data packet received by the lan port 11 in the current time period and a data packet received by the lan port 11 in the previous time period is greater than the preset value; and detecting whether the amount of data packets transmitted/received between the clients of the lan port 11 within a certain time period is greater than the preset value. The preset value is equal to or larger than zero, and is defaulted to zero.
When detecting that the difference between the data packet sent by the wan port 12 in the current time period and the data packet sent in the previous time period is greater than the preset value, and the difference between the data packet received by the wan port 12 in the current time period and the data packet received in the previous time period is greater than the preset value; or it is detected that a difference between a data packet sent by the lan port 11 in the current time period and a data packet sent by the lan port 11 in the previous time period is greater than the preset value, and a difference between a data packet received by the lan port 11 in the current time period and a data packet received by the lan port 11 in the previous time period is greater than the preset value; or when detecting that the amount of data packets sent/received between the clients 2 of the lan port 11 within a certain time period is greater than the preset value, it indicates that the router 1 has network communication currently.
When detecting that the difference between the data packet sent by the wan port 12 in the current time period and the data packet sent in the previous time period is less than or equal to the preset value, and the difference between the data packet received by the wan port 12 in the current time period and the data packet received in the previous time period is less than or equal to the preset value; detecting that a difference value between a data packet sent by the lan port 11 in the current time period and a data packet sent by the lan port 11 in the previous time period is less than or equal to the preset value, and that a difference value between a data packet received by the lan port 11 in the current time period and a data packet received by the lan port 11 in the previous time period is less than or equal to the preset value; and when detecting that the amount of data packets sent/received between the clients 2 of the lan port 11 in a certain period of time is less than or equal to the preset value, it indicates that no network communication is currently occurring in the router 1.
In step S03, the first processing module 103 forces all the clients 2 to log out of the connected lan port 11, and rejects the re-authentication request of the client 2. In this embodiment, when the first processing module 103 forces all the clients 2 to log out of the connected lan ports 11, the clients 2 are forced to automatically uplink broadcast DHCP (Dynamic Host configuration protocol) DISCOVER packets to find a DHCP server for re-authentication. The uplink refers to information transmission from the client 2 to the network.
In step S04, the second processing module 104 receives the authentication request of the client 2 again after waiting for a first preset time (e.g. 10 seconds). In this embodiment, after the first processing module 103 rejects the re-authentication request of the client 2 and waits for the first preset time, the IP layer of the client 2 finds that its own IP cannot be used any more. Then, the DHCPDISCOVER packet is continuously broadcasted to obtain authentication, and after the DHCP server monitors the DHCP DISCOVER packet sent by the client 2, a DHCP OFFER packet is responded to the client 2. At this time, the second processing module 104 receives the DHCP OFFER packet of the client 2, and sends a DHCP REQUEST packet to the network 3 to notify the DHCP server. After receiving the DHCP REQUEST packet of the client 2, the DHCP server sends a DHCP ACK response to the client 2 to receive the authentication REQUEST of the client 2, update the IP address of the client 2, and implement network connection.
In step S05, after the second processing module 104 waits for a second predetermined time (e.g., 0.5 second), it returns to step S02 to continue detecting whether the router 1 has network communication currently.
Through the steps, the IP address of the client connected with the router is automatically updated when the router switches the internet access mode, so that the network connection of the client is realized.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the above preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (8)

1. A network connection method is applied to a router, the router comprises a wide area network port and a local area network port, the local area network port is connected with a client, and the method is characterized by comprising the following steps:
receiving, namely receiving information of switching of the internet access mode of the router;
a detecting step, detecting whether the router has network communication currently;
a first processing step, if detecting that the router does not have network communication currently, forcing all clients to log out of the connected local area network ports, and rejecting re-authentication requests of the clients; and
and a second processing step, after waiting for a first preset time, the client continuously broadcasts a DHCP DISCOVER packet to acquire authentication, after monitoring the DHCP DISCOVER packet sent by the client, a DHCP OFFER packet is responded to the client, the router receives the DHCP OFFER packet of the client, sends a DHCP REQUEST packet to a network, informs the DHCP server, and sends a DHCP ACK response to the client after receiving the DHCPRrequest packet of the client so as to receive the authentication REQUEST of the client again.
2. The method according to claim 1, further comprising a step of returning to the detecting step after waiting a second predetermined time if it is detected that the router currently has network communication.
3. The network connection method of claim 1, wherein detecting whether the router currently has network traffic comprises:
detecting whether a difference value between a data packet sent by the WAN port in a current time period and a data packet sent by the WAN port in a previous time period is greater than a preset value, and whether a difference value between a data packet received by the WAN port in the current time period and a data packet received by the WAN port in the previous time period is greater than the preset value;
detecting whether the difference value between a data packet sent by the local area network port in the current time period and a data packet sent by the local area network port in the previous time period is greater than the preset value, and whether the difference value between the data packet received by the local area network port in the current time period and the data packet received by the local area network port in the previous time period is greater than the preset value; and
and detecting whether the quantity of data packets transmitted/received between the clients of the local area network port in a certain time period is greater than the preset value.
4. The network connection method of claim 3, wherein the preset value is equal to or greater than zero and is zero by default.
5. A router comprising a wide area network port and a local area network port, the local area network port being connected to a client, the router comprising:
the receiving module is used for receiving the information of the switching of the internet access mode of the router;
the detection module is used for detecting whether the router has network communication currently;
the first processing module is used for forcing all the clients to log out of the connected local area network ports and rejecting re-authentication requests of the clients when detecting that the router does not have network communication currently; and
the second processing module is used for continuously broadcasting a DHCP DISCOVER packet to acquire authentication after waiting for a first preset time, responding to the client by a DHCP OFFER packet after the DHCP server monitors the DHCP DISCOVER packet sent by the client, receiving the DHCP OFFER packet of the client by the second processing module, sending a DHCP REQUEST packet to a network to inform the DHCP server, and sending a DHCP ACK response to the client after the DHCP server receives the DHCP REQUEST packet of the client so as to receive the authentication REQUEST of the client again.
6. The router of claim 5, wherein when it is detected that the router currently has network communication, the router is re-detected whether the router currently has network communication after waiting for a second predetermined time.
7. The router of claim 5, wherein detecting whether the router currently has network traffic comprises:
detecting whether a difference value between a data packet sent by the WAN port in a current time period and a data packet sent by the WAN port in a previous time period is greater than a preset value, and whether a difference value between a data packet received by the WAN port in the current time period and a data packet received by the WAN port in the previous time period is greater than the preset value;
detecting whether the difference value between a data packet sent by the local area network port in the current time period and a data packet sent by the local area network port in the previous time period is greater than the preset value, and whether the difference value between the data packet received by the local area network port in the current time period and the data packet received by the local area network port in the previous time period is greater than the preset value; and
and detecting whether the quantity of data packets transmitted/received between the clients of the local area network port in a certain time period is greater than the preset value.
8. The router of claim 7, wherein the preset value is equal to or greater than zero and defaults to zero.
CN201510435990.6A 2015-07-22 2015-07-22 Router and method for network connection by using same Active CN106375224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510435990.6A CN106375224B (en) 2015-07-22 2015-07-22 Router and method for network connection by using same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510435990.6A CN106375224B (en) 2015-07-22 2015-07-22 Router and method for network connection by using same

Publications (2)

Publication Number Publication Date
CN106375224A CN106375224A (en) 2017-02-01
CN106375224B true CN106375224B (en) 2020-03-17

Family

ID=57879741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510435990.6A Active CN106375224B (en) 2015-07-22 2015-07-22 Router and method for network connection by using same

Country Status (1)

Country Link
CN (1) CN106375224B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113747533B (en) * 2021-08-16 2024-04-16 湖南恒茂高科股份有限公司 Automatic switching method of router link and dual-frequency router

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287017A (en) * 2008-05-19 2008-10-15 郑宽永 Active IP address allocating method and system
CN102104536A (en) * 2009-12-18 2011-06-22 国基电子(上海)有限公司 Router and method thereof for balancing load
CN102244866A (en) * 2011-08-18 2011-11-16 杭州华三通信技术有限公司 Portal verifying method and access controller
CN103188740A (en) * 2011-12-28 2013-07-03 华为技术有限公司 Method and equipment for triggering network switching
CN103516617A (en) * 2012-06-25 2014-01-15 国基电子(上海)有限公司 Router, network connection recovering system and network connection recovering method
CN103648181A (en) * 2013-12-24 2014-03-19 广州爱的信息科技有限公司 Wireless network connection method for wireless network audio equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7818255B2 (en) * 2006-06-02 2010-10-19 Microsoft Corporation Logon and machine unlock integration
CN101483906B (en) * 2009-02-10 2012-10-03 华为终端有限公司 Method, system and apparatus for access network
CN102868672A (en) * 2011-07-05 2013-01-09 横河电机株式会社 Authentication and access control system and method
CN103327482B (en) * 2013-06-27 2016-09-21 宇龙计算机通信科技(深圳)有限公司 Terminal and network method for handover control
CN103475590A (en) * 2013-09-11 2013-12-25 上海斐讯数据通信技术有限公司 Device and method for automatically switching network topology
CN104320819B (en) * 2014-11-20 2017-08-29 广东欧珀移动通信有限公司 A kind of method for switching network and device
CN104618522B (en) * 2014-12-22 2018-09-25 迈普通信技术股份有限公司 The method and Ethernet access equipment that IP address of terminal automatically updates

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287017A (en) * 2008-05-19 2008-10-15 郑宽永 Active IP address allocating method and system
CN102104536A (en) * 2009-12-18 2011-06-22 国基电子(上海)有限公司 Router and method thereof for balancing load
CN102244866A (en) * 2011-08-18 2011-11-16 杭州华三通信技术有限公司 Portal verifying method and access controller
CN103188740A (en) * 2011-12-28 2013-07-03 华为技术有限公司 Method and equipment for triggering network switching
CN103516617A (en) * 2012-06-25 2014-01-15 国基电子(上海)有限公司 Router, network connection recovering system and network connection recovering method
CN103648181A (en) * 2013-12-24 2014-03-19 广州爱的信息科技有限公司 Wireless network connection method for wireless network audio equipment

Also Published As

Publication number Publication date
CN106375224A (en) 2017-02-01

Similar Documents

Publication Publication Date Title
US8787200B2 (en) Device, system, and method for automatically configuring application terminals in home network
US8255543B2 (en) Systems and methods for IP session keepalive using BFD protocols
US20130103807A1 (en) Method and apparatus for exchanging configuration information in a wireless local area network
EP3267759B1 (en) Gateway device automatic networking
US7991856B2 (en) Network system
US20160162377A1 (en) Access Control Method and System, and Access Point
EP2725868B1 (en) System and method for controlling connection timeout in a communication network
CN103873472A (en) Method for automatically having access to network
WO2022078475A1 (en) Application service path establishing method and apparatus for multi-card terminal, and storage medium, and terminal
WO2017088101A1 (en) Network access information acquiring method, and router
WO2008131632A1 (en) Method and apparatus for supporting user terminal to access network in the fixed access network
US11057283B2 (en) Service creation within a telecommunications network in order to provide automated communication services to client devices being connected to the telecommunications network
US8619651B2 (en) Customer facing interface power cycling of wireless terminals
US20140280467A1 (en) Method of managing port dhcp server protocol addresses
WO2015074537A1 (en) Method and apparatus for controlling communication protocol in smart tv device
WO2016173269A1 (en) Message processing method and related device during pppoe authentication
CN105721189A (en) Network port configuration method and device for network equipment
CN106375224B (en) Router and method for network connection by using same
US20130086259A1 (en) Method for acquiring an ip address and network access device
CN102075588A (en) Method and system for realizing network address translation (NAT) transversing and equipment
TWI566553B (en) A Router and a Method for Establishing Network Connection Using the Router
US9654369B2 (en) Mobile terminal network port management method and device
JP3793193B2 (en) Mobile terminal and mobile terminal control method
EP2891299A1 (en) Systems and methods for efficient remote security panel configuration and management
CN103856571A (en) Self-adaptive network connection method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20180224

Address after: 201613 Shanghai city south of Songjiang Export Processing Zone Road No. 1925

Applicant after: Ambit Microsystems (Shanghai) Co., Ltd.

Address before: 201613 Shanghai City, Songjiang District Songjiang Export Processing Zone South Road No. 1925

Applicant before: Ambit Microsystems (Shanghai) Co., Ltd.

Applicant before: Hon Hai Precision Industry Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant