CN102281184B - Router and method for determining Internet line protocol - Google Patents
Router and method for determining Internet line protocol Download PDFInfo
- Publication number
- CN102281184B CN102281184B CN201010196644.4A CN201010196644A CN102281184B CN 102281184 B CN102281184 B CN 102281184B CN 201010196644 A CN201010196644 A CN 201010196644A CN 102281184 B CN102281184 B CN 102281184B
- Authority
- CN
- China
- Prior art keywords
- point
- protocol
- back message
- router
- message
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a router. The router comprises a communication module, a recording module, a judgment module and a protocol determination module, wherein the communication module sends a request message to a server; the recording module records the times of sending the request message by the communication module; the communication module receives a reply message from the server; the judgment module judges whether the recorded times in the recording module are more than or equal to preset times when the communication module does not receive the reply message after waiting for preset time; and the protocol determination module determines that the internet line protocol of the router is a static internet protocol when the judgment module judges that the recorded times in the recording module are more than or equal to the preset times. The invention also provides a method for determining an internet line protocol of the router. According to the router and the method for determining the internet line protocol of the router provided by the invention, the time for determining the internet line protocol is reduced.
Description
Technical field
The present invention relates to router, relate in particular to a kind of router and determine the method for Internet line protocol.
Background technology
Generally speaking, router carries out line by Internet line protocol and internet, along with the development of the network communications technology, the type of Internet line protocol is also tending towards variation, router before communicating first confirm the type of its Internet line protocol so that better and internet carry out line.
Refer to Fig. 1, be depicted as the applied environment figure of router 10 in present technology, as can be seen from Figure 1, router one 0 is communicated by letter with the server 30 in Internet 20.Server 30 comprises DHCP (Dynamic Host Configuration Protocol, DHCP) server 32, Point-to-Point Protocol over Ethernet (Point-to-Point Protocol over Ethernet, PPPoE) server 34 and Point to Point Tunnel Protocol (Point to Point Tunneling Protocol, PPTP) server 36, is respectively used to provide the different service content such as DynamicHost configuration service, Ethernet ptp services and point-to-point tunneling service.
In order to obtain correct service, before communication, router one 0 will be determined corresponding line agreement with server 30.Refer to Fig. 2, be depicted as the method for router 10 definite Internet line protocols in present technology.At step S200, router one 0 sends PPPoE request message to server 30.At step S202, router one 0 is waited for 3 seconds.At step S204, router one 0 judges whether the PPPoE back message using of receiving that server 30 sends.Receive the PPPoE back message using that server 30 sends if having, at step S226, router one 0 determines that its Internet line protocol is PPPoE, and utilizes PPPoE to carry out network connectivity; If do not receive the PPPoE back message using that server 30 sends, at step S206, router one 0 judges whether the number of times that sends PPPoE request message is more than or equal to 3.Be less than 3 if send the number of times of PPPoE request message, return to step S200, router one 0 continues to send PPPoE request message to server 30.
Be more than or equal to 3 if send the number of times of PPPoE request message, at step S208, router one 0 sends DHCP request message to server 30.At step S210, router one 0 is waited for 3 seconds.At step S212, router one 0 judges whether the DHCP back message using of receiving that server 30 sends.Receive the DHCP back message using that server 30 sends if having, at step S228, router one 0 determines that its Internet line protocol is DHCP, and utilizes DHCP to carry out network connectivity.If do not receive the DHCP back message using that server 30 sends, at step S214, router one 0 judges whether the number of times that sends DHCP request message is more than or equal to 3.Be less than 3 if send the number of times of DHCP request message, return to step S208, router one 0 continues to send DHCP request message to server 30.
Be more than or equal to 3 if send the number of times of DHCP request message, at step S216, router one 0 sends PPTP request message to server 30.At step S218, router one 0 is waited for 3 seconds.At step S220, router one 0 judges whether the PPTP back message using of receiving that server 30 sends.Receive the PPTP back message using that server 30 sends if having, at step S230, router one 0 determines that its Internet line protocol is PPTP.If do not receive the PPTP back message using that server 30 sends, at step S222, router one 0 judges whether the number of times that sends PPTP request message is more than or equal to 3.Be less than 3 if send the number of times of PPTP request message, return to step S216, router one 0 continues to send PPTP request message to server 30.Be more than or equal to 3 if send the number of times of PPTP request message, at step S224, router one 0 determines that its Internet line protocol is static Internet Protocol (IP), and utilizes static IP to carry out network connectivity.
As can be seen here, in technology, router 10 determines that the method for the type of Internet line protocol is to send in order PPPoE request message, DHCP request message and PPTP message now, and all need to wait for 3 seconds after sending request each time message, if the Internet line protocol of router one 0 is static Internet Protocol, Internet line protocol institute's time spent of determining router one 0 can be greater than 27 seconds, and the used time is too of a specified duration.Therefore, be badly in need of providing a kind of router, can determine fast Internet line protocol.
Summary of the invention
In view of this, a kind of router need be provided, Internet line protocol can be determined fast.
In addition, also need to provide a kind of router to determine the method for Internet line protocol, can determine fast the type of Internet line protocol.
Router in embodiment of the present invention carries out line by Internet line protocol and internet, for determining described Internet line protocol, wherein said Internet line protocol comprises Point-to-Point Protocol over Ethernet, DHCP, Point to Point Tunnel Protocol and static Internet Protocol, described internet comprises server, be used for providing Ethernet ptp services, DynamicHost configuration service and point-to-point tunneling service, described router comprises communication module, logging modle, judge module and agreement determination module.Communication module sends request message to server, and wherein request message comprises Point-to-Point Protocol over Ethernet request message, dhcp request message and Point to Point Tunnel Protocol request message.Logging modle record communication module sends request the number of times of message.Judge module is waited for the back message using that judges whether to receive from server request message after the scheduled time, and judges whether the number of times recording logging modle is more than or equal to pre-determined number in the time of back message using less than receive request message from server.The type of determining Internet line protocol when the number of times that agreement determination module records in logging modle is more than or equal to pre-determined number is static Internet Protocol.
Router in embodiment of the present invention is determined the method for Internet line protocol, wherein router carries out line by Internet line protocol and internet, Internet line protocol comprises Point-to-Point Protocol over Ethernet, DHCP, Point to Point Tunnel Protocol and static Internet Protocol, described internet comprises server, be used for providing Ethernet ptp services, DynamicHost configuration service and point-to-point tunneling service, router determines that the method for the type of Internet line protocol comprises the following steps: send request message to server, wherein request message comprises Point-to-Point Protocol over Ethernet request message, dhcp request message and Point to Point Tunnel Protocol request message, record sends request the number of times of message, after waiting for the scheduled time, judge whether the back message using of the request message receiving from server, if do not receive the back message using of request message, judge whether the number of times that sends request message is more than or equal to pre-determined number, be more than or equal to pre-determined number if send request the number of times of message, determine that Internet line protocol is static Internet Protocol.
Router in embodiment of the present invention and the method for definite Internet line protocol thereof are by send Point-to-Point Protocol over Ethernet request message, dhcp request message and Point to Point Tunnel Protocol request message simultaneously, and judge whether to receive that corresponding back message using determines its Internet line protocol after the scheduled time waiting for, effectively reduce the time of the Internet line protocol of definite router.
Accompanying drawing explanation
Figure 1 shows that the applied environment figure of router in prior art.
Figure 2 shows that router in prior art determines the flow chart of the method for the type of Internet line protocol.
Figure 3 shows that the module map of router one execution mode of the present invention.
Figure 4 shows that router of the present invention determines the flow chart of method one execution mode of Internet line protocol.
Main element symbol description
Router one 0,100
Internet 20
Server 30
Dynamic Host Configuration Protocol server 32
PPPoE server 34
PPTP server 36
Logging modle 120
Embodiment
Refer to Fig. 3, be depicted as the module map of router one 00 1 execution modes of the present invention.In the present embodiment, router one 00 is applicable to, in the applied environment figure shown in Fig. 1, play the part of the role of router 10 in Fig. 1.In the present embodiment, router one 00 carries out line by the server 30 on Internet line protocol and Internet 20, for determining the type of described Internet line protocol.Described server 30 comprises DHCP (Dynamic Host Configuration Protocol, DHCP) server 32, Point-to-Point Protocol over Ethernet (Point-to-Point Protocol over Ethernet, PPPoE) server 34 and Point to Point Tunnel Protocol (Point to Point Tunneling Protocol, PPTP) server 36, is respectively used to provide Ethernet ptp services, DynamicHost configuration service and point-to-point tunneling service.Internet line protocol comprises Point-to-Point Protocol over Ethernet, DHCP, Point to Point Tunnel Protocol and this Four types of static Internet Protocol.In other execution modes of the present invention, described Dynamic Host Configuration Protocol server 32, Point-to-Point Protocol over Ethernet server 34 and Point to Point Tunnel Protocol server 36 are respectively the functional module in server 30, realize respectively DHCP service, Point-to-Point Protocol over Ethernet service and Point to Point Tunnel Protocol service.
If router one 00 carries out line by Point-to-Point Protocol over Ethernet, DHCP or Point to Point Tunnel Protocol and Internet 20, need the service of server 30 could obtain the service of internet.If router one 00 carries out line by static Internet Protocol and Internet 20, do not need the service of server 30 but obtain voluntarily the service of internet.
In the present embodiment, router one 00 comprises communication module 110, logging modle 120, timer 130, judge module 140, agreement determination module 150, memory 160 and at least one processor 170.Processor 170 is for executive communication module 110, logging modle 120, judge module 140 and agreement determination module 150.
In the present embodiment, communication module 110 sends PPPoE request message, DHCP request message and PPTP request message to server 30 with broadcast mode simultaneously.
In the present embodiment, Dynamic Host Configuration Protocol server 32 can only receive DHCP request message, and receiving that after DHCP request message, judge whether can be for the router one 00 that sends this DHCP request message provides service, and in the time providing service for router one 00, send DHCP back message using; PPPoE server 34 can only receive PPPoE request message, and is receiving that after PPPoE request message, judge whether can be for the router one 00 that sends this PPPoE request message provides service, and in the time providing service for router one 00, sends PPPoE back message using; PPTP server 36 can only receive PPTP request message, and is receiving that after PPTP request message, judge whether can be for the router one 00 that sends this PPTP request message provides service, and in the time providing service for router one 00, sends PPTP back message using.
Logging modle 120 sends request the number of times of message for record communication module 110, timer 130 starts timing simultaneously.
In the present embodiment, timer 130 is for the timing scheduled time, and wherein the scheduled time is generally 3 seconds.
In the present embodiment, if communication module 110 receives back message using, judge module 140 is also for judging whether this back message using is PPPoE back message using, if this back message using is PPPoE back message using, agreement determination module 150 determines that the Internet line protocol of router one 00 is PPPoE.
In the present embodiment, judge module 140 is also for judging in the time that described back message using is not PPPoE back message using whether this back message using is PPTP back message using, if this back message using is PPTP back message using, agreement determination module 150 determines that the Internet line protocol of router one 00 is PPTP.
In the present embodiment, not PPTP back message using if judge module 140 judges described back message using, can determine thus that described back message using is DHCP back message using, agreement determination module 150 determines that the Internet line protocol of router one 00 is DHCP.
Router one 00 in embodiment of the present invention is by send PPPoE request message, DHCP request message and PPTP request message simultaneously, and judge whether to receive that corresponding back message using determines its Internet line protocol after the scheduled time waiting for, effectively reduce the time of the Internet line protocol of definite router one 00.
Refer to Fig. 4, be depicted as the present invention and determine the flow chart of method one execution mode of the Internet line protocol of router one 00.Described method is for the router shown in Fig. 3.In the present embodiment, in the time that router one 00 starts, just determine its Internet line protocol by described method.
At step S400, communication module 110 sends request message to server 30.In the present embodiment, request message comprises Point-to-Point Protocol over Ethernet (PPPoE) request message, DHCP (DHCP) request message and Point to Point Tunnel Protocol (PPTP) request message.
At step S402, logging modle 120 record communication modules 110 send request the number of times of message.
At step S404, timer 130 starts timing according to the scheduled time.In the present embodiment, the scheduled time is 3 seconds.
At step S406, judge module 140 judges in the time that timing finishes whether communication module 110 receives the back message using of server 30.In the present embodiment, back message using be these three kinds of PPPoE back message using, PPTP back message using and DHCP back message usings one of them.
In the present embodiment, Dynamic Host Configuration Protocol server 32 can only receive DHCP request message, and receiving that after DHCP request message, judge whether can be for the router one 00 that sends this DHCP request message provides service, and in the time providing service for router one 00, send DHCP back message using; PPPoE server 34 can only receive PPPoE request message, and is receiving that after PPPoE request message, judge whether can be for the router one 00 that sends this PPPoE request message provides service, and in the time providing service for router one 00, sends PPPoE back message using; PPTP server 36 can only receive PPTP request message, and is receiving that after PPTP request message, judge whether can be for the router one 00 that sends this PPTP request message provides service, and in the time providing service for router one 00, sends PPTP back message using.
If communication module 110 is not received back message using, at step S408, judge module 140 judges whether the number of times that sends request message recording in logging modle 120 is more than or equal to pre-determined number.In the present embodiment, pre-determined number is 3.
Be more than or equal to pre-determined number if send request the number of times of message, at step S410, agreement determination module 150 determines that the Internet line protocol of router one 00 is static Internet Protocol (IP).
If communication module 110 is received back message using, at step S412, judge module 140 judges whether back message using is PPPoE back message using.
If back message using is not PPPoE back message using, at step S414, judge module 140 judges whether back message using is PPTP back message using.
If back message using is not PPTP back message using, can determine that thus this back message using is DHCP message, at step S416, agreement determination module 150 determines that the Internet line protocol of router one 00 is DHCP.
If back message using is PPPoE back message using, at step S418, agreement determination module 150 determines that the Internet line protocol of router one 00 is PPPoE.
If back message using is PPTP back message using, at step S420, agreement determination module 150 determines that the Internet line protocol of router one 00 is PPTP.
Be less than pre-determined number if send request the number of times of message, return to step S400, communication module 110 continues to send request message to server 30.
Router one 00 in embodiment of the present invention and the method for definite Internet line protocol thereof are by send PPPoE request message, DHCP request message and PPTP request message simultaneously, and judge whether to receive that corresponding back message using determines its Internet line protocol after the scheduled time waiting for, effectively reduce the time of the Internet line protocol of definite router one 00.
Claims (10)
1. a router, carry out line by Internet line protocol and internet, for determining described Internet line protocol, wherein said Internet line protocol comprises Point-to-Point Protocol over Ethernet, DHCP, Point to Point Tunnel Protocol and static Internet Protocol, described internet comprises server, be used for providing Ethernet ptp services, DynamicHost configuration service and point-to-point tunneling service, it is characterized in that, described router comprises:
Communication module, for send multiple request messages to described server simultaneously, wherein said multiple request messages comprise Point-to-Point Protocol over Ethernet request message, dhcp request message and Point to Point Tunnel Protocol request message;
Logging modle, for recording the number of times of the described multiple request messages of described communication module transmission;
Judge module, for judging whether to receive from described server the back message using of described multiple request messages after waiting for the scheduled time, and judge whether the number of times recording described logging modle is more than or equal to pre-determined number in the time of back message using less than receive described multiple request messages from described server; And
Agreement determination module, the type of determining described Internet line protocol while being more than or equal to pre-determined number for the number of times recording in described logging modle is static Internet Protocol.
2. router as claimed in claim 1, is characterized in that, the back message using of described multiple request messages comprise Point-to-Point Protocol over Ethernet back message using, DHCP back message using and Point to Point Tunnel Protocol back message using one of them.
3. router as claimed in claim 2, it is characterized in that, whether described judge module is also Point-to-Point Protocol over Ethernet back message using for the back message using that judges described multiple request messages when receive the back message using of described multiple request messages from described server, and described agreement determination module determines that in the time that the back message using of described multiple request messages is Point-to-Point Protocol over Ethernet back message using described Internet line protocol is Point-to-Point Protocol over Ethernet.
4. router as claimed in claim 3, it is characterized in that, described judge module also for judging whether described back message using is Point to Point Tunnel Protocol back message using in the time that the back message using of described multiple request messages is not Point-to-Point Protocol over Ethernet back message using, and described agreement determination module determines that in the time that described back message using is Point to Point Tunnel Protocol back message using described Internet line protocol is Point to Point Tunnel Protocol.
5. router as claimed in claim 4, is characterized in that, described agreement determination module is also for determining that in the time that described back message using is not Point to Point Tunnel Protocol back message using described Internet line protocol is DHCP.
6. a router is determined the method for Internet line protocol, wherein said router carries out line by Internet line protocol and internet, described Internet line protocol comprises Point-to-Point Protocol over Ethernet, DHCP, Point to Point Tunnel Protocol and static Internet Protocol, described internet comprises server, be used for providing Ethernet ptp services, DynamicHost configuration service and point-to-point tunneling service, it is characterized in that, described router determines that the method for the type of Internet line protocol comprises the following steps:
Send multiple request messages to described server, wherein said multiple request messages comprise Point-to-Point Protocol over Ethernet request message, dhcp request message and Point to Point Tunnel Protocol request message simultaneously;
Record sends the number of times of described multiple request messages;
After waiting for the scheduled time, judge whether the back message using of the described multiple request messages that receive from described server;
If do not receive the back message using of described multiple request messages, judge whether the number of times that sends described multiple request messages is more than or equal to pre-determined number; And
Be more than or equal to pre-determined number if send the number of times of described multiple request messages, determine that described Internet line protocol is static Internet Protocol.
7. router as claimed in claim 6 is determined the method for Internet line protocol, it is characterized in that, the back message using of described multiple request messages comprise Point-to-Point Protocol over Ethernet back message using, DHCP back message using and Point to Point Tunnel Protocol back message using one of them.
8. router as claimed in claim 7 is determined the method for Internet line protocol, it is characterized in that, further comprising the steps of:
If receive in the given time the back message using of described multiple request messages from described server, judge whether the back message using of described multiple request messages is Point-to-Point Protocol over Ethernet back message using; And
If the back message using of described multiple request messages is Point-to-Point Protocol over Ethernet back message using, determine that described Internet line protocol is Point-to-Point Protocol over Ethernet.
9. router as claimed in claim 8 is determined the method for Internet line protocol, it is characterized in that, further comprising the steps of:
If the back message using of described multiple request messages is not Point-to-Point Protocol over Ethernet back message using, judge whether the back message using of described multiple request messages is Point to Point Tunnel Protocol back message using; And
If the back message using of described multiple request messages is Point to Point Tunnel Protocol back message using, determine that the Internet line protocol of described router is Point to Point Tunnel Protocol.
10. router as claimed in claim 9 is determined the method for Internet line protocol, it is characterized in that, further comprising the steps of:
If the back message using of described multiple request messages is not Point to Point Tunnel Protocol back message using, determine that the Internet line protocol of described router is DHCP.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010196644.4A CN102281184B (en) | 2010-06-10 | 2010-06-10 | Router and method for determining Internet line protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010196644.4A CN102281184B (en) | 2010-06-10 | 2010-06-10 | Router and method for determining Internet line protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102281184A CN102281184A (en) | 2011-12-14 |
CN102281184B true CN102281184B (en) | 2014-06-18 |
Family
ID=45106378
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010196644.4A Active CN102281184B (en) | 2010-06-10 | 2010-06-10 | Router and method for determining Internet line protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102281184B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140215034A1 (en) * | 2013-01-29 | 2014-07-31 | Huawei Device Co., Ltd. | Processing Method and Processing Device for Automatically Setting Internet Access Mode |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6958996B2 (en) * | 2002-04-05 | 2005-10-25 | Actiontec Electronics, Inc. | Router with automatic protocol configuration and methods of use |
US20070058538A1 (en) * | 2005-09-15 | 2007-03-15 | Wei Chiang | Method of setting up a wireless router |
-
2010
- 2010-06-10 CN CN201010196644.4A patent/CN102281184B/en active Active
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140215034A1 (en) * | 2013-01-29 | 2014-07-31 | Huawei Device Co., Ltd. | Processing Method and Processing Device for Automatically Setting Internet Access Mode |
Also Published As
Publication number | Publication date |
---|---|
CN102281184A (en) | 2011-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8811248B2 (en) | Method for extending battery life in a wireless device | |
WO2005069732A3 (en) | Upper-level protocol authentication | |
CN102291320A (en) | MAC (media access control) address learning method and edge device | |
CN101453711A (en) | Automatic test system and test method for mobile phone short message | |
JP2009516279A (en) | Method and system for coordinating routing information in a cluster of computer systems (sending routing data based on the time the server joined the cluster) | |
CN109167762B (en) | IEC104 message checking method and device | |
US20090125773A1 (en) | Apparatus and method for transmitting/receiving content in a mobile communication system | |
WO2013131867A1 (en) | Method for preselecting a router in an rpl network | |
CN102394944B (en) | Method and equipment for correcting IP (Internet Protocol) address in Web access | |
US8054749B2 (en) | Method and apparatus for checking maintenance association integrity and method and apparatus for adding maintenance end point | |
CN102594628B (en) | Method, terminal and system for detecting availability of communication link and service | |
CN101075924B (en) | Method for accessing server by customer end | |
CN114422289B (en) | Method and device for transmitting CAN message of electric automobile | |
CN104168140A (en) | VTEP abnormal condition processing method and device | |
CN103973555A (en) | GRE protocol tunnel building method, communication device and communication system | |
CN111726196A (en) | Vehicle-mounted data transmission method and system | |
CN102387083B (en) | Network access control method and system | |
CN102325200A (en) | Method for rapidly acquiring IPv6 (Internet Protocol Version 6) address and DHCP (Dynamic Host Configuration Protocol) snooping equipment | |
CN103260210A (en) | Building method, system and device of multi-hop routing in multi-hop network | |
CN110336752B (en) | Method and system for improving local broadcast push efficiency | |
CN102281184B (en) | Router and method for determining Internet line protocol | |
EP2308266B1 (en) | Method and apparatus for providing cell configuration information to a network element | |
CN106717068A (en) | Method of measuring distance between nan device, and nan device | |
US20140244726A1 (en) | Assignment of Point-to-Point Over Ethernet (PPPoE) Session IDs | |
US20180145848A1 (en) | Method and apparatus for reproducing contents based on presentation time in automotive network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20180224 Address after: Shanghai City, Songjiang Export Processing Zone South Road No. 1925 Patentee after: Ambit Microsystems (Shanghai) Co., Ltd. Address before: 201613 Shanghai city south of Songjiang Export Processing Zone Road No. 1925 Co-patentee before: Hon Hai Precision Industry Co., Ltd. Patentee before: Ambit Microsystems (Shanghai) Co., Ltd. |
|
TR01 | Transfer of patent right |