CN107769979B - Method for synchronous configuration between routers - Google Patents
Method for synchronous configuration between routers Download PDFInfo
- Publication number
- CN107769979B CN107769979B CN201711057380.2A CN201711057380A CN107769979B CN 107769979 B CN107769979 B CN 107769979B CN 201711057380 A CN201711057380 A CN 201711057380A CN 107769979 B CN107769979 B CN 107769979B
- Authority
- CN
- China
- Prior art keywords
- router
- message
- configuration parameter
- internal
- configuration
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
- H04L41/0886—Fully automatic configuration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Abstract
The invention discloses a method for synchronous configuration between routers, wherein a LAN interface of an entrance router starts a DHCP server, and a LAN interface of an internal router starts a DHCP client; meanwhile, each router in the network creates a TCP socket and binds a LAN interface; the entrance router monitors network data; after the internal router establishes TCP connection with the entrance router, the internal router sends a device information message to the entrance router; the entrance router receives the equipment information message, acquires and packages the configuration parameters of the local machine and then generates a configuration parameter message; the entrance router sends the configuration parameter message to the internal router; and after synchronous configuration is carried out on the internal router according to the configuration parameter message, the TCP connection with the entrance router is disconnected. The invention can realize automatic synchronous configuration among the routers in the home network, does not need manual configuration, saves time and labor, improves the synchronous configuration efficiency among the routers, and is convenient for the unified management of the routers in the network.
Description
Technical Field
The invention relates to the technical field of network communication, in particular to a method for synchronous configuration among routers.
Background
In a home, for a small network formed by interconnecting a plurality of routers, when a configuration parameter of one router changes, configuration parameter information changed by the router often needs to be synchronized to other routers in the network, so as to implement synchronization and sharing of data of each router.
At present, in a home network environment, when a configuration parameter of one router changes, other internal routers need to be reconfigured one by one in a manual mode, and this mode needs to invest a large amount of human resources, and is complex in operation and prone to errors, which results in low efficiency of synchronization of configuration among routers, and is time-consuming and labor-consuming.
Disclosure of Invention
The invention provides a method for synchronous configuration among routers, which aims to solve the problem of low efficiency of synchronous configuration among routers in a home network.
In a first aspect, the present invention provides a method for synchronous configuration between routers, where the method is applied to a network formed by a plurality of routers, where the network includes an ingress router and an internal router, where the ingress router corresponds to a server and the internal router corresponds to a client, and then the method includes:
the LAN interface of the entrance router starts a DHCP server, and the LAN interface of the internal router starts a DHCP client; meanwhile, each router in the network creates a TCP socket and binds a LAN interface; the entry router monitors network data;
after the internal router establishes TCP connection with the entrance router, the internal router sends a device information message to the entrance router;
the entrance router receives the equipment information message, acquires and packages the configuration parameters of the local machine and generates a configuration parameter message; the entrance router sends the configuration parameter message to the internal router;
and after the internal router carries out synchronous configuration according to the configuration parameter message, the internal router disconnects the TCP connection with the entrance router.
Optionally, after the internal router establishes a TCP connection with the ingress router, the step of sending, by the internal router, the device information packet to the ingress router includes:
the internal router sends a TCP connection request to the ingress router;
if the entrance router responds to the TCP connection request and TCP connection is successful, the internal router sends a device information message to the entrance router; if the entrance router does not respond to the TCP connection request, TCP connection fails, the internal router is not synchronous with the entrance router, and the entrance router continues to monitor network data.
Optionally, after the ingress router receives the device information packet, the method further includes:
judging whether an entry router corresponding to the equipment information message is in an equipment information list or not; the device information list includes a plurality of internal routers that have historically established TCP connections with the ingress router;
if the entry router corresponding to the equipment information message is in an equipment information list, updating the equipment information list according to the equipment information message;
otherwise, adding the ingress router corresponding to the device information message into the device information list.
Optionally, the device information packet and the configuration parameter packet include custom TCP data, where the custom TCP data includes: the Data packet Data comprises an ID for identifying message Data, a Type for acquiring the message Type, Data of the message and CRC for performing cyclic redundancy check on the TCP Data.
Optionally, before the internal router performs synchronous configuration according to the configuration parameter packet, the method further includes:
after receiving the configuration parameter message, the internal router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the internal router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the internal router does not carry out synchronous configuration, and the ingress router regenerates and sends the configuration parameter message.
In a second aspect, the present invention provides a method for synchronous configuration between routers, where the method is applied to a network formed by a plurality of routers, the network includes an ingress router and an internal router, the ingress router corresponds to a client, and the internal router corresponds to a server, and then the method includes:
the user modifies the configuration parameters of the ingress router;
the LAN interface of the internal router starts a DHCP client, automatically acquires an IP address, updates a TCP socket and monitors network data;
the entrance router inquires an equipment information list and establishes TCP connection with a target router in the equipment information list; the device information list includes a plurality of internal routers that have historically established TCP connections with the ingress router;
the entrance router acquires and packages the configuration parameters modified by the local router to generate a configuration parameter message; the entrance router sends the configuration parameter message to the target router;
and after the target router carries out synchronous configuration according to the configuration parameter message, the TCP connection with the entrance router is disconnected.
Optionally, the step of the ingress router querying the device information list and establishing a TCP connection with a target router in the device information list includes:
the entrance router inquires the equipment information list and judges whether a user designates a target router;
if the user specifies a target router, the entrance router establishes TCP connection with the target router specified by the user;
otherwise, the entrance router sends a TCP connection request to the internal router in the equipment information list, screens out a target router responding to the TCP connection request from the equipment information list, and establishes TCP connection at the target router.
Optionally, the configuration parameter packet includes customized TCP data, where the customized TCP data includes: the Data packet Data comprises an ID for identifying message Data, a Type for acquiring the message Type, Data of the message and CRC for performing cyclic redundancy check on the TCP Data.
Optionally, before the target router performs synchronous configuration according to the configuration parameter packet, the method further includes:
after receiving the configuration parameter message, the target router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the target router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the target router does not carry out synchronous configuration, and the entry router regenerates and sends the configuration parameter message.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
on the first hand, an entrance router is equivalent to a server, an internal router is equivalent to a client, the internal router actively establishes TCP connection with the entrance router, the entrance router acquires and encapsulates configuration parameters of the local machine after receiving a device information message sent by the internal router, and generates a configuration parameter message, and the internal router automatically completes synchronous configuration according to the configuration parameter message, thereby realizing automatic synchronous configuration among routers in a home network; in the second aspect, the entry router is equivalent to a client, the internal router is equivalent to a server, when a user modifies the configuration parameters of the entry router, the entry router queries the device information list, actively establishes TCP connection with a target router in the device information list, then acquires and encapsulates the modified configuration parameters of the local device to generate a configuration parameter message, and the internal router automatically completes synchronous configuration according to the configuration parameter message. The two aspects can realize automatic synchronous configuration between the routers, the configuration mode is more flexible, manual configuration is not needed, time and labor are saved, the efficiency of synchronous configuration between the routers is improved, and unified management of all routing devices in a network is facilitated.
Drawings
FIG. 1 is a schematic diagram of a network environment formed by a plurality of routers;
fig. 2 is a flowchart illustrating a method for synchronously configuring routers according to an embodiment of the present invention;
fig. 3 is a diagram illustrating a packet data encapsulation structure according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for synchronously configuring routers according to a second embodiment of the present invention;
fig. 5 is a flowchart of a method for synchronously configuring routers according to a third embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
Fig. 1 is a home network environment constructed by multiple routers according to an embodiment of the present invention, and includes a router a, a router B, and a router C, where the router a may obtain a public network address from a network service provider in a DHCP (Dynamic Host Configuration Protocol) or PPPOE (Point to Point Protocol Over Ethernet) manner, and implement extension of a local area network range by router concatenation inside the public network address. The router a is used as an ingress router device, and a WAN (Wide Area Network) interface of the router a is used to connect to a Wide Area Network and automatically obtain an IP address, and a LAN (Local Area Network) interface of the router a is used to connect to a Local Area Network and start a DHCP server. The router B and the router C are used as internal routers, the WAN interface is in a bridge mode, namely the WAN interface and the LAN interface can be accessed without address conversion, and a DHCP client program is started at the same time.
It should be noted that fig. 1 shows an example of a network environment including one ingress router (router a) and two internal routers (router B and router C), and the number of the actual internal routers is not limited to that shown in the embodiment of the present invention.
Example one
Fig. 2 is a flowchart of a method for synchronous configuration between routers according to an embodiment of the present invention, and referring to fig. 1, the method is applied to a network formed by a plurality of routers, where the network includes an ingress router and an internal router, in this embodiment, the ingress router corresponds to a server, and the internal router corresponds to a client, and then the method includes:
step S101: the LAN interface of the entrance router starts a DHCP server, and the LAN interface of the internal router starts a DHCP client; meanwhile, each router in the network creates a TCP socket and binds a LAN interface; the ingress router listens for network data. Each router in the network described herein includes an ingress router and an internal router.
Step S102: and after the internal router establishes TCP connection with the entrance router, the internal router sends a device information message to the entrance router. The device information packet carries device information of the internal router, and the device information includes information such as an MAC address and an IP address of the internal router.
Optionally, step S102 includes:
the internal router sends a TCP connection request to the ingress router;
if the entrance router responds to the TCP connection request and TCP connection is successful, the internal router sends a device information message to the entrance router; if the entrance router does not respond to the TCP connection request, TCP connection fails, the internal router is not synchronous with the entrance router, and the entrance router continues to monitor network data.
Taking the router a and the router B in fig. 1 as examples, in this embodiment, the router a is used as an ingress router in a home lan and is equivalent to a server; the router B is an internal router in the home lan, and corresponds to a client. The premise that the router a and the router B can perform data transmission is that a TCP (Transfer Control Protocol) connection is successfully established, so that the router B actively sends a TCP connection request to the router a, if the router a can respond to the TCP connection request of the router B, a TCP connection can be established between the router a and the router B, and after the connection is successful, the router B sends a device information message to the router a; if the router A cannot respond to the TCP connection request of the router B, the connection fails, and the router B cannot perform synchronous configuration with the router A, at this time, the router A continues to monitor network data, namely receives TCP connection requests of other internal routers (such as the router C), and continues to perform synchronous configuration with other internal routers.
Step S103: the entrance router receives the equipment information message, acquires and packages the configuration parameters of the local machine and generates a configuration parameter message; and the entrance router sends the configuration parameter message to the internal router. The configuration parameter packet carries router configuration parameters to be synchronized, such as a WIFI name and a WIFI password.
As shown in fig. 3, an embodiment of the present application provides a self-defined packet data encapsulation structure, which facilitates encapsulation and analysis of packet data, and implements configuration synchronization between routers. The overall structure of the device information packet and the configuration parameter packet includes a device IP address, TCP data, and a Cyclic Redundancy Check (CRC) for checking the IP and TCP data. Wherein, the TCP data includes: the Data packet Data comprises an ID for identifying message Data, a Type for acquiring the message Type, Data of the message and CRC for performing cyclic redundancy check on the TCP Data.
In this embodiment, the ID and the CRC in the TCP data are both 4Byte, and the ID is fixed to 0x 54422626; CRC in TCP Data is used for checking ID, Type and Data of Data packets of messages; the Type is 2Byte, and the message Type is discerned through the different values of Type, and when the Type value was 0x101, the message Type was the equipment information message, and when the Type value was 0x201, the message Type was the configuration parameter message.
Step S104: and after the internal router carries out synchronous configuration according to the configuration parameter message, the internal router disconnects the TCP connection with the entrance router. After receiving the configuration parameter message sent by the entrance router, the internal router identifies and analyzes the configuration parameter message to obtain the configuration parameter information required to be synchronized, and automatically reconfigures the local router according to the obtained synchronous configuration parameter information, so that the configuration synchronization between the entrance router and the internal router is realized.
Optionally, in step S104, before the internal router performs synchronous configuration according to the configuration parameter packet, the method further includes:
after receiving the configuration parameter message, the internal router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the internal router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the internal router does not carry out synchronous configuration, and the ingress router regenerates and sends the configuration parameter message.
After receiving the configuration parameter message, the internal router needs to verify whether TCP data of the message meets the synchronous configuration condition, at the moment, the configuration parameter message needs to be verified, if the ID authentication passes and the CRC check result shows that the data is correct, the synchronous configuration condition is met, and the internal router can load related data to carry out synchronous configuration on the local router; if at least one condition is not satisfied in the data without errors after the ID authentication and the CRC check, the synchronous configuration condition is not satisfied, the internal router does not perform synchronous configuration, and the entrance router needs to regenerate and send the configuration parameter message.
Optionally, if the internal router verifies that the configuration parameter message is incorrect, an error information message is generated according to a verification result, and the error information message is sent to the ingress router, and the ingress router re-corrects the configuration parameter message according to information indicated in the error information message, and sends the corrected new configuration parameter message to the corresponding internal router.
According to the technical scheme, when the entrance router is equivalent to the server and the internal router is equivalent to the client, the internal router actively establishes TCP connection with the entrance router, the entrance router acquires and encapsulates the configuration parameters of the home machine after receiving the equipment information message sent by the internal router to generate the configuration parameter message, and the internal router automatically reconfigures the home machine according to the configuration parameter message, so that automatic synchronous configuration among the routers in the home network is realized, manual configuration is not needed, time and labor are saved, and the efficiency of synchronous configuration among the routers is improved.
Example two
Fig. 4 is a flowchart of a method for synchronous configuration between routers according to a second embodiment of the present invention, and referring to fig. 1, the method is applied to a network established by a plurality of routers, where the network includes an ingress router and an internal router, in this embodiment, the ingress router corresponds to a client, and the internal router corresponds to a server, and then the method includes:
step S201: and modifying the configuration parameters of the entrance router by the user, wherein the configuration parameters comprise a WIFI name, a WIFI password and the like. Since the ingress router behaves as a client, the client can select configuration parameters in the ingress router to modify, and then synchronize the modified configuration parameters to internal routers in the network as follows.
Step S202: the LAN interface of the internal router starts a DHCP client, automatically acquires an IP address, updates a TCP socket and monitors network data.
Step S203: the entrance router inquires an equipment information list and establishes TCP connection with a target router in the equipment information list; the device information list includes a number of internal routers that have historically established TCP connections with the ingress router.
In this embodiment, a network environment is assumed: the router A is used as an entrance router and is equivalent to a client; the router B, the router C, the router D, and the router E serve as internal routers and correspond to servers. In the router B, the router C, the router D, and the router E, only if the router B, the router D, and the router E have previously established TCP connection with the router a, the router a will add all the history connection records and the corresponding router device information to the device information list of the router, that is, the router B, the router D, and the router E are in the device information list, and the router a will establish TCP connection with the router B, the router D, and the router E, respectively.
Optionally, step S203 further includes:
the entrance router inquires the equipment information list and judges whether a user designates a target router;
if the user specifies a target router, the entrance router establishes TCP connection with the target router specified by the user;
otherwise, the entrance router sends a TCP connection request to the internal router in the equipment information list, screens out a target router responding to the TCP connection request from the equipment information list, and establishes TCP connection at the target router.
According to the assumed network environment, the device information list includes router B, router D, and router E, and since router a corresponds to a client, a manner is provided for selecting a target router by a client, first, it is determined whether a user designates the target router, and if the user designates router B and router D in the device information list as target routers, that is, the user designates router B and router D to participate in the synchronization configuration, router a establishes TCP connection only with router B and router D, and router E in the device information list does not participate in the synchronization configuration.
If the user does not specify a target router, router B, router D, and router E in the device information list may all participate in the synchronization configuration, at which time, router a sends TCP connection requests to router B, router D, and router E, respectively. Assuming that only the router B and the router E respond to the TCP connection request among the router B, the router D and the router E, the router B and the router E are screened out as target routers, the router A establishes TCP connection with the router B and the router E respectively, and the router D does not participate in synchronous configuration. If router B, router D, and router E all respond to the TCP connection request, router B, router D, and router E all serve as target routers, i.e., router a establishes TCP connections with all internal routers in the device information list.
In this embodiment, the user may modify the configuration parameters in the ingress router, the ingress router actively establishes a TCP connection with the internal router by querying the device information list, and the internal router receives a TCP connection request of the ingress router by monitoring network data, thereby embodying a feature that the ingress router is equivalent to a client and the internal server is equivalent to a server. On the contrary, for the first embodiment, the internal router actively establishes the TCP connection with the ingress router and sends the device information packet, and the ingress router monitors the network data and receives the TCP connection request of the internal router, so that the first embodiment embodies the characteristic that the ingress router is equivalent to a server and the internal server is equivalent to a client.
Step S204: the entrance router acquires and packages the configuration parameters modified by the local router to generate a configuration parameter message; and the entrance router sends the configuration parameter message to the target router.
The data structure of the configuration parameter packet may refer to fig. 3 and the related description of the first embodiment, and is not described herein again.
Step S205: and after the target router carries out synchronous configuration according to the configuration parameter message, the TCP connection with the entrance router is disconnected. After receiving the configuration parameter message sent by the entrance router, the internal router identifies and analyzes the configuration parameter message to obtain the configuration parameter information required to be synchronized, and automatically reconfigures the local router according to the obtained synchronous configuration parameter information, so that the configuration synchronization between the entrance router and the internal router is realized.
Optionally, in step S205, before the target router performs synchronous configuration according to the configuration parameter packet, the method further includes:
after receiving the configuration parameter message, the target router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the target router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the target router does not carry out synchronous configuration, and the entry router regenerates and sends the configuration parameter message.
According to the assumed network environment, assuming that the target router is the router B, the router a sends a configuration parameter message to the router B. If the router B passes the ID authentication and the data after the CRC check is correct, the router B reconfigures the local computer according to the configuration parameter message to realize the configuration synchronization with the router A; if at least one of the ID and the CRC passes the authentication and the data is correct, the router B does not carry out synchronous configuration and needs the router A to regenerate and send the configuration parameter message. Optionally, if the router B verifies that the configuration parameter message is incorrect, an error information message is generated according to the verification result, and the error information message is sent to the router a, and the router a revises the configuration parameter message according to information indicated in the error information message, and sends the revised new configuration parameter message to the router B.
According to the technical scheme, the entrance router is equivalent to a client, the internal router is equivalent to a server, after a user modifies configuration parameters of the entrance router, the entrance router inquires an equipment information list, actively establishes TCP connection with a target router in the equipment information list, acquires and encapsulates the modified configuration parameters of the home machine to generate configuration parameter messages, and the internal router automatically reconfigures the home machine according to the configuration parameter messages, so that automatic synchronous configuration among the routers in the home network is realized, manual configuration is not needed, time and labor are saved, and the efficiency of synchronous configuration among the routers is improved.
EXAMPLE III
Fig. 5 is a flowchart of a method for synchronous configuration between routers according to a third embodiment of the present invention, which is based on the first and second embodiments, and enables the two methods to work cooperatively to implement automatic synchronous configuration between routers.
Specifically, in the present embodiment, a description is given taking an example of a synchronous configuration between the ingress router a and the internal router B in fig. 1. When the router a corresponds to a server and the router B corresponds to a client, the synchronization configuration flow is as follows:
after the router A and the router B are started and initialized, respectively establishing TCP sockets and binding LAN interfaces, simultaneously starting a DHCP server by the LAN interface of the router A, and starting a DHCP client by the LAN interface of the router B; the router A monitors network data, the router B automatically acquires an IP address and judges whether the router A is connected to a 5442 port of a gateway (namely the router A); if router B is connected to the 5442 port of router A, a TCP connection is established with router A; if the router B and the router A successfully carry out TCP connection, the router B sends a device information message to the router A, otherwise, if the router B and the router A fail to carry out TCP connection, the router A continues to monitor network data.
After the ingress router receives the device information packet, the method further includes:
judging whether an entry router corresponding to the equipment information message is in an equipment information list or not; the device information list includes a plurality of internal routers that have historically established TCP connections with the ingress router;
if the entry router corresponding to the equipment information message is in an equipment information list, updating the equipment information list according to the equipment information message;
otherwise, adding the ingress router corresponding to the device information message into the device information list.
For example, assuming that the device information list of the router a includes the router B, the router C, and the router D, after receiving the device information packet sent by the router B, the router a determines that the router B is in the device information list of the router, and updates the device information of the router B in the device information list, so as to ensure validity and reliability of subsequent synchronization configuration.
For another example, the device information list of the router a includes a router C and a router D, and after receiving the device information packet sent by the router B, the router a determines that the router B is not in the device information list of the router, and then the router a needs to add the device information of the router B to the device information list of the router, so as to expand the device information list of the router, and implement coverage on each internal router in the home local area network.
Then, the router A acquires and packages the configuration parameters of the router, generates a configuration parameter message and sends the configuration parameter message to the router B; the router B performs ID authentication and CRC verification on the received configuration parameter message, and if the synchronous configuration condition is met, the router B acquires the equipment parameter of the router A carried in the configuration parameter message and reconfigures the router B again to realize the configuration synchronization of the router B and the router A; if the synchronous configuration condition is not met, the router B does not perform synchronous configuration, and the router A regenerates and sends the configuration parameter message.
When the router a is equivalent to a server and the router B is equivalent to a client, the device information list of the router a is updated and expanded, when the method described in the second embodiment is executed, the router a may directly query the device information list, and if the router B is a selected target router, the router a actively performs TCP connection with the router B and sends a configuration parameter message to the router B, thereby implementing synchronous configuration of the router a and the router B.
In this embodiment, reference may be made to the related descriptions of the first embodiment and the second embodiment, which are not described herein again.
According to the technical scheme, the two methods in the first embodiment and the second embodiment are associated by updating the device information list of the extended entry router, so that automatic synchronous configuration between the routers is realized, the two methods can be flexibly switched without manual configuration, time and labor are saved, the efficiency of synchronous configuration between the routers is improved, and unified management of each routing device in a network is facilitated.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
Claims (6)
1. A method for synchronous configuration between routers, the method being applied to a network formed by a plurality of routers, wherein the network includes an ingress router and an internal router, the method comprising:
the LAN interface of the entrance router starts a DHCP server, and the LAN interface of the internal router starts a DHCP client; meanwhile, each router in the network creates a TCP socket and binds a LAN interface; the entry router monitors network data;
the internal router sends a TCP connection request to the ingress router;
if the entrance router responds to the TCP connection request, TCP connection is successful, and after the internal router establishes TCP connection with the entrance router, the internal router sends a device information message to the entrance router; if the entrance router does not respond to the TCP connection request, TCP connection fails, the internal router and the entrance router are not synchronous, and the entrance router continues to monitor network data;
the entrance router receives the equipment information message and judges whether the entrance router corresponding to the equipment information message is in an equipment information list or not; the device information list includes a plurality of internal routers that have historically established TCP connections with the ingress router;
if the entry router corresponding to the equipment information message is in an equipment information list, updating the equipment information list according to the equipment information message;
otherwise, adding the ingress router corresponding to the equipment information message into the equipment information list;
acquiring and packaging configuration parameters of a local computer and then generating a configuration parameter message; the entrance router sends the configuration parameter message to the internal router;
after receiving the configuration parameter message, the internal router verifies the configuration parameter message;
if the internal router verifies that the configuration parameter message is wrong, generating an error information message according to a verification result, sending the error information message to the inlet router, revising the configuration parameter message by the inlet router according to the information indicated in the error information message, and sending the revised new configuration parameter message to the corresponding internal router;
and after the internal router carries out synchronous configuration according to the configuration parameter message, the internal router disconnects the TCP connection with the entrance router.
2. The method of claim 1, wherein the device information message and the configuration parameter message comprise custom TCP data, the custom TCP data comprising: the Data packet Data comprises an ID for identifying message Data, a Type for acquiring the message Type, Data of the message and CRC for performing cyclic redundancy check on the TCP Data.
3. The method according to claim 2, wherein before the internal router performs the synchronous configuration according to the configuration parameter packet, the method further comprises:
after receiving the configuration parameter message, the internal router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the internal router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the internal router does not carry out synchronous configuration, and the ingress router regenerates and sends the configuration parameter message.
4. A method for synchronous configuration between routers, the method being applied to a network formed by a plurality of routers, wherein the network includes an ingress router and an internal router, the method comprising:
the user modifies the configuration parameters of the ingress router;
the LAN interface of the internal router starts a DHCP client, automatically acquires an IP address, updates a TCP socket and monitors network data;
the entrance router inquires an equipment information list, judges whether a user designates a target router or not and establishes TCP connection with the target router in the equipment information list; the device information list includes a plurality of internal routers that have historically established TCP connections with the ingress router;
if the user specifies a target router, the entrance router establishes TCP connection with the target router specified by the user;
otherwise, the entrance router sends a TCP connection request to an internal router in the equipment information list, selects a target router responding to the TCP connection request from the equipment information list, and establishes TCP connection with the target router;
the entrance router acquires and packages the configuration parameters modified by the local router to generate a configuration parameter message; the entrance router sends the configuration parameter message to the target router;
and after the target router carries out synchronous configuration according to the configuration parameter message, the TCP connection with the entrance router is disconnected.
5. The method of claim 4, wherein the configuration parameter message comprises customized TCP data, and wherein the customized TCP data comprises: the Data packet Data comprises an ID for identifying message Data, a Type for acquiring the message Type, Data of the message and CRC for performing cyclic redundancy check on the TCP Data.
6. The method of claim 5, wherein before the target router performs the synchronous configuration according to the configuration parameter packet, the method further comprises:
after receiving the configuration parameter message, the target router performs ID authentication and CRC check on the configuration parameter message;
if the configuration parameter message passes ID authentication and data after CRC check is correct, the target router carries out synchronous configuration according to the configuration parameter message;
and if the configuration parameter message fails the ID authentication or the data is wrong after the CRC check, the target router does not carry out synchronous configuration, and the target router is regenerated by the entrance router and sends the configuration parameter message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711057380.2A CN107769979B (en) | 2017-11-01 | 2017-11-01 | Method for synchronous configuration between routers |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711057380.2A CN107769979B (en) | 2017-11-01 | 2017-11-01 | Method for synchronous configuration between routers |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107769979A CN107769979A (en) | 2018-03-06 |
CN107769979B true CN107769979B (en) | 2021-04-30 |
Family
ID=61272123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711057380.2A Active CN107769979B (en) | 2017-11-01 | 2017-11-01 | Method for synchronous configuration between routers |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107769979B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110896337B (en) * | 2018-09-12 | 2022-06-21 | 中兴通讯股份有限公司 | Clock, time synchronization method, device and multi-router system |
CN108966256A (en) * | 2018-09-30 | 2018-12-07 | 普联技术有限公司 | A kind of wireless device configuration method, system and equipment |
CN111064819B (en) * | 2019-12-18 | 2022-07-29 | 杭州迪普科技股份有限公司 | Address backup method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104335554A (en) * | 2014-06-27 | 2015-02-04 | 华为技术有限公司 | Wireless access network configuration automatic synchronizaing method and device |
CN105245382A (en) * | 2015-10-23 | 2016-01-13 | 小米科技有限责任公司 | Router configuration information modifying method and device |
CN105392140A (en) * | 2015-11-19 | 2016-03-09 | 上海斐讯数据通信技术有限公司 | Key configuration automatic synchronization method among wireless routers |
CN107124729A (en) * | 2017-04-19 | 2017-09-01 | 福建江夏学院 | A kind of radio relay method and its system |
-
2017
- 2017-11-01 CN CN201711057380.2A patent/CN107769979B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104335554A (en) * | 2014-06-27 | 2015-02-04 | 华为技术有限公司 | Wireless access network configuration automatic synchronizaing method and device |
CN105245382A (en) * | 2015-10-23 | 2016-01-13 | 小米科技有限责任公司 | Router configuration information modifying method and device |
CN105392140A (en) * | 2015-11-19 | 2016-03-09 | 上海斐讯数据通信技术有限公司 | Key configuration automatic synchronization method among wireless routers |
CN107124729A (en) * | 2017-04-19 | 2017-09-01 | 福建江夏学院 | A kind of radio relay method and its system |
Also Published As
Publication number | Publication date |
---|---|
CN107769979A (en) | 2018-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200228374A1 (en) | Method for implementing residential gateway service function, and server | |
US8918531B2 (en) | Automated network device provisioning using dynamic host configuration protocol | |
US9485147B2 (en) | Method and device thereof for automatically finding and configuring virtual network | |
US7523185B1 (en) | Method and apparatus for providing automatic frame relay and ATM provisioning of network devices | |
US9455866B2 (en) | Auto-configuration of network devices | |
EP2482502A2 (en) | Message handling method and apparatus | |
CN107769979B (en) | Method for synchronous configuration between routers | |
US8432833B2 (en) | Auto MEP ID assignment within CFM maintenance association | |
JP5424007B2 (en) | Method for providing information, home gateway and home network system | |
US20190109784A1 (en) | Packet processing method and apparatus | |
CN105450779A (en) | Method for achieving connection between one household electric appliance and multiple servers | |
WO2018149701A1 (en) | Method for an improved deployment and use of network nodes of a switching fabric of a data center or within a central office point of delivery of a broadband access network of a telecommunications network | |
CN109640181B (en) | Method for upgrading home gateway through set top box | |
US20120269092A1 (en) | Auto-configuration of network devices | |
CN112910704B (en) | Local area network system, method and device supporting dynamic self-adaptive network configuration | |
US11817970B2 (en) | Method, device, and system for determining generic routing encapsulation GRE tunnel identifier | |
EP3059907B1 (en) | Network packet forwarding method and device | |
KR100821400B1 (en) | System and method for programmatically changing the network location of a network component | |
CN107547467B (en) | Circuit authentication processing method, system and controller | |
WO2012155571A1 (en) | Base station self-configuration method and device | |
Cisco | Dial Solutions Configuration Guide Cisco IOS Release 11.3 | |
EP2858415B1 (en) | Multi-link-based data transmission method and device | |
CN113783971A (en) | Address management method, network device, and storage medium | |
WO2015143824A1 (en) | Method, apparatus and system for processing ipv6 transition technology type | |
CN114374582B (en) | Communication method and device |
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 |