CN105119679B - A kind of method and system for realizing that SNTP client times are synchronous - Google Patents
A kind of method and system for realizing that SNTP client times are synchronous Download PDFInfo
- Publication number
- CN105119679B CN105119679B CN201510617535.8A CN201510617535A CN105119679B CN 105119679 B CN105119679 B CN 105119679B CN 201510617535 A CN201510617535 A CN 201510617535A CN 105119679 B CN105119679 B CN 105119679B
- Authority
- CN
- China
- Prior art keywords
- sntp
- time synchronized
- dns
- address
- passages
- 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
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of method and system for realizing that SNTP client times are synchronous, this method comprises the following steps:Whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages, if it is not, then time synchronized is carried out by default route, if it is, obtaining the WAN mouth dns address of time synchronized passage;Adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;Domain name mapping is carried out to SNTP servers by policybased routing;After the completion of domain name mapping, deletion strategy route;NTP messages are built, SNTP clients carry out network service by the IP address of NTP messages and the SNTP servers parsed, realize the time synchronized of SNTP clients.The present invention, not changed by network structure is influenceed, and does not influence user to surf the Net, and flexibility is high, highly reliable, compensate for carrying out the deficiency of time synchronized by default route and traditional Time Synchronization Mechanism.
Description
Technical field
The present invention relates to family gateway equipment field, and in particular to a kind of method for realizing that SNTP client times are synchronous and
System.
Background technology
With the adjustment of the increase of home gateway service function, and networking structure, the time synchronized of home gateway is not only
Rely only on INTERNET WAN connections configuration i.e. default route, traditional Time Synchronization Mechanism such as NTP (Network Time
Procotol, NTP), NTP time synchronizeds refer to carrying out time school with time source by the Network Time Protocol of network
Standard, precondition is that time source output must be by network interface, and data output format is had to comply with Network Time Protocol, LAN
All PC, server and miscellaneous equipments are synchronous with time server holding by network, and Network Time Protocol automatic decision network prolongs
When, and time bias is carried out to obtained data, so that the lan device time keeps unified accurate.However, working as
INTERNET WAN are connected as bridge joint networking mode or INTERNET passages when not having time server, by default route or
The traditional Time Synchronization Mechanism of person can not realize the time synchronized of family gateway equipment.
The content of the invention
The technical problems to be solved by the invention be when INTERNET WAN be connected as bridge joint networking mode or
When INTERNET passages do not have time server, home network can not be realized by default route or traditional Time Synchronization Mechanism
The problem of closing equipment time synchronized.
In order to solve the above-mentioned technical problem, when the technical solution adopted in the present invention is to provide one kind and realizes SNTP clients
Between synchronous method, comprise the following steps:
Step 101:Whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages, if
It is to go to step 102;Otherwise, time synchronized is carried out by default route;
Step 102:Obtain the WAN mouth dns address of time synchronized passage;
Step 103:Adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
Step 104:Domain name mapping is carried out to SNTP servers by policybased routing;
Step 105:After the completion of domain name mapping, deletion strategy route;
Step 106:Structure NTP messages, SNTP clients are with passing through the IP of NTP messages and the SNTP servers parsed
Location carries out network service, realizes the time synchronized of SNTP clients.
In the above-mentioned technical solutions, domain name parsing specifically includes following steps:
Dns address is obtained from the DNS configuration files of time synchronized passage;
Whether be empty, if so, then terminating if judging the dns address;Otherwise, mesh is added in the routing table of time synchronized passage
Address be dns address policybased routing;
It whether there is SNTP server domain names and corresponding IP relations in lookup/etc/hosts files, if in the presence of DNS
Successfully resolved, deletion strategy route;Otherwise, DNS query message is built, is forwarded by policybased routing, the query name of DNS query message
For SNTP server domain names, deletion strategy is route after dns resolution success.
In the above-mentioned technical solutions, if the time synchronized passage there are two dns address, two plans are added
Slightly it route.
Present invention also offers a kind of system for realizing that SNTP client times are synchronous, including:
Judging unit, whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages;
Acquiring unit, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages, obtains the time
The WAN mouth dns address of synchronizing channel;
Very first time synchronization unit, when the non-TR069 passages of the time synchronized passage of SNTP clients or VOIP passages,
SNTP clients carry out time synchronized by default route;
First adding unit, adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
Domain name resolution unit, domain name mapping is carried out by policybased routing to SNTP servers;
Unit is deleted, after the completion of domain name mapping, deletion strategy route;
Second time synchronized unit, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages,
NTP messages are built, SNTP clients carry out network service by the IP address of NTP messages and the SNTP servers parsed,
Realize the time synchronized of SNTP clients.
In the above-mentioned technical solutions, domain name resolution unit is specifically included:
Processing unit, dns address is obtained from the DNS configuration files of time synchronized passage;Judge the dns address whether be
Sky, if so, then terminating, otherwise, adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
It whether there is SNTP server domain names and and corresponding IP in domain name mapping subelement, lookup/etc/hosts files
Relation, if in the presence of dns resolution success, deletion strategy route;Otherwise, DNS query message is built, is forwarded by policybased routing,
The entitled SNTP server domain names of inquiry of DNS query message, deletion strategy is route after dns resolution success.
In the above-mentioned technical solutions, in addition to the second adding unit, when the time synchronized passage with having two DNS
During location, two policybased routings are added.
The present invention, by configuring the time synchronized passage of SNTP clients, when the time synchronized passage is not TR069 passages
Or during VOIP passages, time synchronized is carried out by default route, when the time synchronized passage is that TR069 passages or VOIP are logical
During road, by adding policybased routing in the routing table of the time synchronized passage, SNTP servers are carried out by policybased routing
Domain name mapping, and after the completion of domain name mapping, deletion strategy route builds NTP messages, SNTP clients by NTP messages with
The IP address of the SNTP servers parsed carries out network service, realizes the time synchronized of SNTP clients.This programme not by
The influence of network structure change, and does not influence user to surf the Net, and flexibility is high, highly reliable, compensate for by default route and
Traditional Time Synchronization Mechanism carries out the deficiency of time synchronized.
Brief description of the drawings
Fig. 1 is a kind of method flow diagram for realizing that SNTP client times are synchronous provided in an embodiment of the present invention;
Fig. 2 is the flow chart of domain name mapping provided in an embodiment of the present invention;
Fig. 3 is a kind of system structure diagram for realizing that SNTP client times are synchronous provided in an embodiment of the present invention.
Embodiment
The present invention is described in detail with reference to specification drawings and specific embodiments.
The embodiments of the invention provide a kind of method for realizing that SNTP client times are synchronous, by configuring CPE
SNTP (the Simple Network Time of (Customer Premise Equipment, ustomer premises access equipment) equipment
Protocol, SNTP) client time synchronized passage, obtain the WAN (Wide of the time synchronized passage
Area Network, wide area network) mouth IP address and corresponding DNS (Domain Name System, domain name system) address, at this
Adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage, and SNTP is taken by the policybased routing
Business device carries out domain name mapping, and deletion strategy is route after the completion of domain name mapping, builds NTP (Network Time Protocol, net
Network time protocol) message, it is logical that SNTP clients carry out network by the IP address of NTP messages and the SNTP servers parsed
Letter, so that the time synchronized of SNTP clients is realized, as shown in figure 1, methods described specifically includes following steps:
Step 101, the time synchronized passage for configuring SNTP clients.
Step 102, judge whether the time synchronized passage is TR069 passages or VOIP passages, if it is, performing step
Rapid 103;Otherwise, step 108 is performed.
Step 103, the WAN mouth dns address for obtaining TR069 passages or VOIP passages.
Step 104, in the routing table of TR069 passages or VOIP passages adding purpose address be dns address strategy
Route.
If it should be noted that TR069 passages or VOIP passages have two dns address, adding two policybased routings.
Step 105, by the policybased routing in the routing table of TR069 passages or VOIP passages to SNTP servers carry out
Domain name mapping.
After the completion of step 106, domain name mapping, the policybased routing in the routing table of TR069 passages or VOIP passages is deleted.
Step 107, structure NTP messages, SNTP clients are with passing through the IP of NTP messages and the SNTP servers parsed
Location carries out network service, realizes the time synchronized of SNTP clients, has performed this step, no longer performs step 108.
Step 108, time synchronized carried out by default route.
Below by setup time synchronizing channel be TR069 come exemplified by carrying out time synchronized, domain name mapping is carried out specifically
It is bright, as shown in Fig. 2 this method specifically includes following steps:
Step 201, the acquisition TR069 passages from DNS configuration files/etc/resolv_TR069.conf of TR069 passages
Dns address.
Step 202, judge whether the dns address is empty, if so, then performing step 207;Otherwise, step 203 is performed.
Step 203, in the routing table of TR069 passages adding purpose address be dns address policybased routing.
If it should be noted that TR069 passages have two dns address, adding two policybased routings.
Step 204, search cpe device /etc/hosts files in whether there is SNTP server domain names and corresponding IP
Relation, if in the presence of execution step 206;Otherwise, step 205 is performed.
Step 205, DNS query message is built, destination address is the dns address of TR069 passages, in DNS query message
Inquire about entitled SNTP server domain names.
Step 206, dns resolution success, deletion strategy route.
It should be noted that forward DNS query message to use when the policybased routing in step 203 is for dns resolution, example
Such as, policybased routing of the destination address for the dns address of TR069WAN connections is added in the routing table of TR069 passages, then
The DNS query message sent from TR069 passages can be forwarded from the policybased routing, realize the domain name mapping of SNTP servers.
The policybased routing is deleted after the completion of dns resolution, otherwise when the dns address and TR069 of INTERNET WAN connections
Or VOIP WAN connections dns address it is identical when, user online data can be forwarded by TR069 or VOIP passages, from
And influence the function of surfing the Net of family gateway equipment.
Step 207, end dns resolution.
The embodiment of the present invention additionally provides a kind of system for realizing that SNTP client times are synchronous, as shown in figure 3, including:
Judging unit 10, whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages;
Acquiring unit 20, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages, during acquisition
Between synchronizing channel WAN mouth dns address;
Very first time synchronization unit 30, when the non-TR069 passages of the time synchronized passage of SNTP clients or VOIP passages
When, SNTP clients carry out time synchronized by default route;
First adding unit 40, adding purpose address is the tactful road of dns address in the routing table of time synchronized passage
By;
Domain name resolution unit 50, domain name mapping is carried out by policybased routing to SNTP servers;
Unit 60 is deleted, after the completion of domain name mapping, deletion strategy route;
Second time synchronized unit 70, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages
When, NTP messages are built, SNTP clients carry out network by the IP address of NTP messages and the SNTP servers parsed and led to
Letter, realizes the time synchronized of SNTP clients.
The present invention is not limited to above-mentioned preferred forms, and anyone should learn that the knot made under the enlightenment of the present invention
Structure changes, and the technical schemes that are same or similar to the present invention are each fallen within protection scope of the present invention.
Claims (4)
1. a kind of method for realizing that SNTP client times are synchronous, it is characterised in that comprise the following steps:
Step 101:Whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages, if it is, turning
Step 102;Otherwise, time synchronized is carried out by default route;
Step 102:Obtain the WAN mouth dns address of time synchronized passage;
Step 103:Adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
Step 104:Domain name mapping is carried out to SNTP servers by policybased routing;
Step 105:After the completion of domain name mapping, deletion strategy route;
Step 106:NTP messages are built, the IP address of SNTP server of the SNTP clients by NTP messages with parsing is entered
Row network service, realizes the time synchronized of SNTP clients;
Domain name parsing specifically includes following steps:
Dns address is obtained from the DNS configuration files of time synchronized passage;
Whether be empty, if so, then terminating if judging the dns address;Otherwise, the adding purpose in the routing table of time synchronized passage
Location is the policybased routing of dns address;
It whether there is SNTP server domain names and corresponding IP relations in lookup/etc/hosts files, if in the presence of dns resolution
Success, deletion strategy route;Otherwise, DNS query message is built, is forwarded by policybased routing, the inquiry of DNS query message is entitled
SNTP server domain names, deletion strategy is route after dns resolution success.
2. the method as described in claim 1, it is characterised in that if the time synchronized passage has two dns address,
Add two policybased routings.
3. a kind of system for realizing that SNTP client times are synchronous, it is characterised in that including:
Judging unit, whether the time synchronized passage for judging SNTP clients is TR069 passages or VOIP passages;
Acquiring unit, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages, obtains time synchronized
The WAN mouth dns address of passage;
Very first time synchronization unit, when the non-TR069 passages of the time synchronized passage of SNTP clients or VOIP passages, SNTP
Client carries out time synchronized by default route;
First adding unit, adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
Domain name resolution unit, domain name mapping is carried out by policybased routing to SNTP servers;
Unit is deleted, after the completion of domain name mapping, deletion strategy route;
Second time synchronized unit, when the time synchronized passage of SNTP clients is TR069 passages or VOIP passages, builds
NTP messages, SNTP clients carry out network service by the IP address of NTP messages and the SNTP servers parsed, realize
The time synchronized of SNTP clients;
Domain name resolution unit is specifically included:
Processing unit, dns address is obtained from the DNS configuration files of time synchronized passage;Whether judge the dns address is sky,
If so, then terminating, otherwise, adding purpose address is the policybased routing of dns address in the routing table of time synchronized passage;
With the presence or absence of SNTP server domain names and and corresponding IP passes in domain name mapping subelement, lookup/etc/hosts files
System, if in the presence of dns resolution success, deletion strategy route;Otherwise, DNS query message is built, is forwarded by policybased routing, DNS
The entitled SNTP server domain names of inquiry of query message, deletion strategy is route after dns resolution success.
4. system as claimed in claim 3, it is characterised in that also including the second adding unit, when the time synchronized passage
When there are two dns address, two policybased routings are added.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510617535.8A CN105119679B (en) | 2015-09-24 | 2015-09-24 | A kind of method and system for realizing that SNTP client times are synchronous |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510617535.8A CN105119679B (en) | 2015-09-24 | 2015-09-24 | A kind of method and system for realizing that SNTP client times are synchronous |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105119679A CN105119679A (en) | 2015-12-02 |
CN105119679B true CN105119679B (en) | 2017-09-29 |
Family
ID=54667587
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510617535.8A Active CN105119679B (en) | 2015-09-24 | 2015-09-24 | A kind of method and system for realizing that SNTP client times are synchronous |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105119679B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3756306A4 (en) | 2018-03-14 | 2021-04-21 | Huawei Technologies Co., Ltd. | Distributed network time protocol |
CN108540251A (en) * | 2018-06-27 | 2018-09-14 | 四川斐讯信息技术有限公司 | A kind of setting means and system of router |
CN113489564A (en) * | 2021-07-04 | 2021-10-08 | 芯河半导体科技(无锡)有限公司 | Method for realizing SNTP client time synchronization |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101771661A (en) * | 2008-12-29 | 2010-07-07 | 华为技术有限公司 | Method, device and system for determining clock source |
CN101895589A (en) * | 2010-07-26 | 2010-11-24 | 杭州华三通信技术有限公司 | Wide area network router and method for establishing routing table items therein |
CN102439905A (en) * | 2011-09-30 | 2012-05-02 | 华为技术有限公司 | Method, device and system of finding network topology automatically |
CN104052565A (en) * | 2014-06-26 | 2014-09-17 | 青岛海信移动通信技术股份有限公司 | Time synchronization method and communication terminal |
CN104202204A (en) * | 2014-09-26 | 2014-12-10 | 浙江中控技术股份有限公司 | Clock synchronous control method, device and system based on SNTP |
CN104202219A (en) * | 2014-09-17 | 2014-12-10 | 上海斐讯数据通信技术有限公司 | Multi-service wan connection binding testing method and system |
-
2015
- 2015-09-24 CN CN201510617535.8A patent/CN105119679B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101771661A (en) * | 2008-12-29 | 2010-07-07 | 华为技术有限公司 | Method, device and system for determining clock source |
CN101895589A (en) * | 2010-07-26 | 2010-11-24 | 杭州华三通信技术有限公司 | Wide area network router and method for establishing routing table items therein |
CN102439905A (en) * | 2011-09-30 | 2012-05-02 | 华为技术有限公司 | Method, device and system of finding network topology automatically |
CN104052565A (en) * | 2014-06-26 | 2014-09-17 | 青岛海信移动通信技术股份有限公司 | Time synchronization method and communication terminal |
CN104202219A (en) * | 2014-09-17 | 2014-12-10 | 上海斐讯数据通信技术有限公司 | Multi-service wan connection binding testing method and system |
CN104202204A (en) * | 2014-09-26 | 2014-12-10 | 浙江中控技术股份有限公司 | Clock synchronous control method, device and system based on SNTP |
Also Published As
Publication number | Publication date |
---|---|
CN105119679A (en) | 2015-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Goralski | The illustrated network: how TCP/IP works in a modern network | |
CN103546374B (en) | A kind of method and apparatus E-Packeted in edge double layer network | |
US8045488B2 (en) | Using spanning tree protocol (STP) to enhance layer-2 network topology maps | |
US7362760B2 (en) | Method for providing an internal server with reduced IP addresses | |
CN101431440B (en) | Flux monitoring method and apparatus | |
US20050188106A1 (en) | Managing L3 VPN virtual routing tables | |
CN102970227A (en) | Method and device for achieving virtual extensible local area network (VXLAN) message transmitting in application specific integrated circuit (ASIC) | |
CN105119679B (en) | A kind of method and system for realizing that SNTP client times are synchronous | |
CN105591798B (en) | The method, apparatus of OAM Information is transmitted in DCN | |
EP3588859A1 (en) | Network device configuration versioning | |
US20030147395A1 (en) | Method and apparatus for parameter borrowing for network address translator configuration | |
JP7077367B2 (en) | Methods for synchronizing topology information in SFC networks, and routing network elements | |
US9219616B2 (en) | Supporting multiple IEC-101/IEC-104 masters on an IEC-101/IEC-104 translation gateway | |
CN103166854A (en) | Local area network (LAN) and wide area network (WAN) service binding method and service binding system | |
Howser | Computer Networks and the Internet | |
CN102624619B (en) | Method for performing message forwarding route selection based on source address under multi-default gateway condition | |
CN104219149B (en) | A kind of message transmitting method and equipment based on virtual connections | |
US20150012664A1 (en) | Routing data based on a naming service | |
Martey | IS-IS network design solutions | |
US8510419B2 (en) | Identifying a subnet address range from DNS information | |
US8355347B2 (en) | Creating multipoint-to-multipoint MPLS trees in an inter-domain environment | |
CN105282034B (en) | ARP/NDP learning system and learning method | |
WO2003069443A3 (en) | Method and system for forwarding smtp traffic | |
CN106789525B (en) | Message forwarding method and device in a kind of VPLS network | |
CN103152255B (en) | The method and apparatus that a kind of data forward |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |