CN110661663A - Interface state synchronization method and device - Google Patents

Interface state synchronization method and device Download PDF

Info

Publication number
CN110661663A
CN110661663A CN201910925940.4A CN201910925940A CN110661663A CN 110661663 A CN110661663 A CN 110661663A CN 201910925940 A CN201910925940 A CN 201910925940A CN 110661663 A CN110661663 A CN 110661663A
Authority
CN
China
Prior art keywords
interface
state
network
synchronization group
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910925940.4A
Other languages
Chinese (zh)
Other versions
CN110661663B (en
Inventor
李飞朋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201910925940.4A priority Critical patent/CN110661663B/en
Publication of CN110661663A publication Critical patent/CN110661663A/en
Application granted granted Critical
Publication of CN110661663B publication Critical patent/CN110661663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a method and a device for synchronizing interface states, which are applied to network equipment and are characterized in that a plurality of interfaces of the network equipment are configured into an interface state synchronization group; the interface in the interface state synchronization group comprises a master state and a slave state; the method comprises the following steps: determining whether the network connected with each interface in the interface state synchronization group has state change; if the state of the network connected with any interface in the interface state synchronization group changes, updating the main state of the interface to the interface state corresponding to the network state after the state of the network changes; and updating the slave state of each interface except the interface in the interface state synchronization group to the interface state respectively.

Description

Interface state synchronization method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for synchronizing interface states.
Background
In network communication technology, a network device plays a role of network data transmission as a node device in a network link. Multiple network links typically exist in the same network device.
In order to ensure that data can be transmitted normally, when an interface of a network device determines that a network connected to the interface has a failure, the network device needs to quickly notify other network devices connected to the interface so that the device can select other network links for data transmission.
In practical applications, an interface state synchronization group function exists in a network device (e.g., network device 1). By this function, the administrator can configure some interfaces in the network device 1 as members in the same interface state synchronization group, and the interface states of the members in the group will remain automatically synchronized. Under the above situation, when any interface of the network device is in a failure state due to a failure of the network connected to the interface, the other interfaces in the interface state synchronization group automatically synchronize their interface states to a failure state, so that the network device connected to the network device 1 through the other interfaces can quickly acquire the other interface states of the network device 1, and accordingly, determine that the network link where the network device 1 is located is unavailable, and thereby replace the other network links for data transmission.
Disclosure of Invention
In view of the above, the present application provides an interface state synchronization method, applied to a network device, where a plurality of interfaces of the network device are configured as an interface state synchronization group; the interface in the interface state synchronization group comprises a master state and a slave state; the method comprises the following steps:
determining whether the network connected with each interface in the interface state synchronization group has state change;
if the state of the network connected with any target interface in the interface state synchronization group changes, updating the main state of the target interface to the interface state corresponding to the network state after the state of the network changes; and the number of the first and second groups,
and updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
The application also provides an interface state synchronization device, which is applied to network equipment, wherein a plurality of interfaces of the network equipment are configured into an interface state synchronization group; the interface in the interface state synchronization group comprises a master state and a slave state; the above-mentioned device includes:
the determining module is used for determining whether the network connected with each interface in the interface state synchronization group has state change;
the updating module is used for updating the main state of the target interface into an interface state corresponding to the network state after the state change of the network if the state of the network connected with any target interface in the interface state synchronization group changes; and the number of the first and second groups,
and updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
As can be seen from the above-described technical solutions, when a network connected to any one of the interfaces in the interface state synchronization group changes, the master state of the interface is updated to an interface state corresponding to the network state after the network state changes, and the slave states of the interfaces other than the target interface in the interface state synchronization group are updated to the interface states, so that it is possible to distinguish whether the interface state in the interface state synchronization group is actively changed due to a change in the network connected to the interface or passively changed due to a change in the other interface states.
Drawings
Fig. 1 is a flowchart illustrating an interface state synchronization method according to the present application;
FIG. 2 is a network device networking diagram of the present application;
FIG. 3a is a schematic diagram of an array of structures shown in the present application;
FIG. 3b is a schematic diagram of an array of structures shown in the present application;
FIG. 3c is a schematic diagram of an array of structures shown in the present application;
FIG. 3d is a schematic diagram of an array of structures shown in the present application;
FIG. 3e is a schematic diagram of an array of structures shown in the present application;
fig. 4 is a structural diagram of an interface state synchronization apparatus according to the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should also be understood that the word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
The method aims to provide a technical scheme for distinguishing whether the interface state in the interface state synchronization group is actively changed due to the change of a network connected with the interface or passively changed due to the change of other interface states by setting a master state and a slave state for the interface in the interface state synchronization group.
In implementation, please refer to fig. 1, where fig. 1 is a flowchart of an interface state synchronization method shown in the present application.
The method is applied to the network equipment. The plurality of interfaces of the network device are configured as an interface state synchronization group; the interface in the interface state synchronization group comprises a master state and a slave state.
The method comprises the following steps:
s101, determining whether the network connected with each interface in the interface state synchronization group has state change;
s102, if the state of the network connected with any target interface in the interface state synchronization group changes, updating the main state of the target interface to the interface state corresponding to the network state after the state of the network changes;
and S103, updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
As can be seen from the above-described technical solutions, when a network connected to any one of the interfaces in the interface state synchronization group changes, the master state of the interface is updated to an interface state corresponding to the network state after the network state changes, and the slave states of the interfaces other than the target interface in the interface state synchronization group are updated to the interface states, so that it is possible to distinguish whether the interface state in the interface state synchronization group is actively changed due to a change in the network connected to the interface or passively changed due to a change in the other interface states.
The technical means described in the present application will be described below with reference to specific examples.
Referring to fig. 2, fig. 2 is a network device networking diagram shown in the present application. As shown in fig. 2, the network device 1 (hereinafter referred to as device 1) may include an interface A, B, C, and the three interfaces may be in the same interface state synchronization group. The device 1 can be communicatively connected to a network device 2 (hereinafter referred to as device 2) and a network device 3 (hereinafter referred to as device 3) through an interface B and an interface C, respectively. The device 1 is connected to the network via an interface a.
It should be noted that the network may be composed of a plurality of network devices and links connecting the network devices, and represents a plurality of objects and their interconnections, and the structure of the network is not particularly limited herein. The network failure described in this application may refer to a situation where the network is disconnected, for example, one or several network devices in the network fail, or a link fails to open, and the like, and is not limited herein. In addition, those skilled in the art will understand that the type of network device illustrated in fig. 2 is merely illustrative, and the network device in this application may be a switch, a router, a firewall gateway, etc., and is not limited herein.
In the above situation, since the interface A, B, C is in the same interface state synchronization group, if any one of the interfaces has a state change, each of the other interfaces will change its own interface state to automatically synchronize the interface states in the same interface state synchronization group.
It should be noted that the interface states of the above interface may include UP and DOWN (where UP may indicate a normal state and DOWN may indicate a fault state); the state change of any interface can be caused by the change of the working state of the interface hardware or the change of the network state of the network connected with the interface.
In the illustrated embodiment of the present application, the interface A, B, C has a master state and a slave state. Any one of the master state and the slave state is DOWN, and the interface state can be indicated as DOWN; the master state and the slave state are both UP, which may indicate that the interface state is UP.
In an embodiment, the master state, the slave state and the interface index may be stored in the network device in a form of a linked list. For example, the master state information and the slave state information of a certain interface and the unique identification information of the interface are hung in the use linked list as a linked list node.
It should be noted that, each node (state information of each interface) of the above-mentioned linked list is scattered in the memory due to independent application of memory space, and therefore, when setting the state of each interface, CACHE MISS (where CACHE refers to the CACHE of the CPU, data is obtained from the CACHE when the CPU runs, and if the required data is not on the CACHE, the data on the CACHE needs to be swapped out, the required data is swapped in the CACHE, and then the required data is obtained from the CACHE; CACHEMISS refers to that the CPU does not find the data needed to be used on the CACHE), and thus, the speed of setting the state of each interface (updating the master and slave state information of the interface) is slow.
In order to increase the speed of setting the states of the interfaces, in an embodiment, the master state, the slave state, and the interface index may be stored in the network device in the form of a structure array. For example, the master status information and the slave status information of a certain interface and the unique identification information of the interface are stored as one structure element in a section of structure array applied in advance.
Specifically, in order to ensure that the structure array is stored continuously, a memory space with a specified size may be allocated in the memory in the form of the structure array for the interface state synchronization group, each structure represents an interface in the interface state synchronization group, and the structure has master state information, slave state information, and unique identification information of the interface. Because the storage space of the structure array is continuous, CACHE MISS will not occur when setting each interface state (updating the master and slave state information of the interface), and the speed of setting each interface state is greatly improved.
In the scenario as shown in fig. 2, a memory space of 16 interface structure bodies may be allocated in advance in the memory in the form of a structure body array for the interface state synchronization group. The interface a, the interface B and the interface C can be stored in the above structure array. For example, the interface A, B, C is stored in the first three locations of the array of structures, with the other locations all set to 0.
S101, determining whether the network connected with each interface in the interface state synchronization group has state change;
in an embodiment, the interface of the device 1 may monitor itself the network status of the network to which it is connected. For example, the interface of the device 1 may interact with the opposite-end interface through a specific protocol to confirm that the network therebetween is in a normal state. In this embodiment, if the interface of the device 1 does not receive the response of the opposite end interface within the preset time length, it may be considered that the network fails, that is, it may be considered that the network state of the network changes from normal to failure; at this time, if the interface of the device 1 can continue to interact with the opposite-end interface through the specific protocol, it may be considered that the network is recovered to be normal, that is, it may be considered that the network state of the network is recovered from the failure to be normal.
S102, if the state of the network connected with any target interface in the interface state synchronization group changes, updating the main state of the target interface to the interface state corresponding to the network state after the state of the network changes;
in an embodiment, if any interface of the device 1 confirms that the network connected to the interface has a status change, the interface may send the information of the status change (including the interface index information and the network status information after the status change) to the CPU of the device 1. After the CPU obtains the information, the CPU may update the master status of the interface to an interface status corresponding to a network status after the status of the network has changed.
For example, when the interface a of the device 1 detects that the network state of the network connected thereto changes from normal to failure, the interface sends the information that the interface identifier a of the interface itself and the network state are failure to the CPU. After the CPU obtains the information, the CPU can traverse each structural body in the structural body array, and update the main state of the structural body with the index mark A to DOWM.
Here, it is understood that when the interface a detects that the network state of the network connected thereto is recovered from the failure to be normal, the network device will perform similar steps as described above, and will not be described in detail herein.
And S103, updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
In an embodiment, if any interface of the device 1 confirms that the network connected to the interface has a status change, the interface may send the information of the status change (including the interface index and the network status information after the status change) to the CPU of the device 1. The CPU may update the slave status of each interface other than the interface to the interface status corresponding to the network status after the status change of the network after acquiring the information.
For example, when the interface a of the device 1 detects that the network state of the network connected thereto changes from normal to failure, the interface sends the information that the interface identifier a of the interface itself and the network state are failure to the CPU. After obtaining the information, the CPU may traverse each structure in the structure array, and update the slave state of the structure with the index identifiers other than a (in this embodiment, the index identifiers are B and C) to DOWM. Here, it is understood that when the interface a detects that the network state of the network connected thereto is recovered from the failure to be normal, the network device will perform similar steps as described above, and will not be described in detail herein.
It should be noted that, the method for synchronizing the states of the interfaces after the interface hardware fails is the same as the method for synchronizing the states of the interfaces after the network connected to the interfaces fails, and details are not described herein.
As can be seen from the above-described technical solutions, when a network connected to any one of the interfaces in the interface state synchronization group changes, the master state of the interface is updated to an interface state corresponding to the network state after the network state changes, and the slave states of the interfaces other than the target interface in the interface state synchronization group are updated to the interface states, so that it is possible to distinguish whether the interface state in the interface state synchronization group is actively changed due to a change in the network connected to the interface or passively changed due to a change in the other interface states.
In an embodiment shown in the present application, a method of indicating an interface state corresponding to a slave state by a count value is proposed; when the counting value is a first preset value, the interface state corresponding to the slave state is a normal state; and when the counting value is not a first preset value, the interface state corresponding to the slave state is a fault state.
If the network state of any interface connection in the interface state synchronization group is changed from normal to fault, increasing the count value in the slave state of each interface except the interface in the interface state synchronization group by a second preset value;
and if the network state of any interface connection in the interface state synchronization group is changed from fault to normal, reducing the count value in the slave state of each interface except the interface in the interface state synchronization group by the second preset value.
Here, it should be noted that, in this embodiment, the master state of the interface may indicate the corresponding interface state through a count value, or may indicate the corresponding interface state through another method, which is not limited herein. The following description will take an example in which the master status of the interface also indicates the corresponding interface status through the count value, and the first preset value is 0 and the second preset value is 1.
Referring to fig. 3a, fig. 3a is a schematic diagram of a structure array shown in the present application.
As shown in fig. 3a, when the link in which the device 1 is located is in the normal operating state, the master state and the slave state of the interface A, B, C are both UP, that is, the interface A, B, C is both in the UP state. This is consistent with the actual state of each interface described above.
If the interface A monitors that the network state of the network connected with the interface A is changed from normal to fault, the interface A uploads the self interface identification A and the information that the network state is fault to the CPU. After the CPU obtains the information, it may traverse each structure in the structure array, and increment a count value in the master state of the structure having an index identifier a by one, and increment a count value in the slave state of the structures having index identifiers B and C by one. Specifically, referring to fig. 3b, fig. 3b is a schematic diagram of a structure array shown in the present application.
As shown in fig. 3b, the master state of interface a is 1 and the slave state is 0; the master state and the slave state of the interface B and the interface C are respectively 0 and 1; indicating that interface a is actively changing to the DOWN state due to a change in the network to which it is connected, and that interface B, C is passively changing to the DOWN state due to a change in the state of the other interfaces. This is consistent with the above-described actual situation of interface state change of each interface.
Under the above situation, if the interface B monitors that the network status of the network connected to the interface B is also changed from normal to failure (in this application, the device 2 may have a hardware or network failure), the interface B will send the information that the own interface identifier B and the network status are failure to the CPU. After the CPU obtains the information, it may traverse each structure in the structure array, and increment a count value in the master state of the structure having an index id B by one, and increment a count value in the slave state of the structures having index ids a and C by one. Specifically, referring to fig. 3c, fig. 3c is a schematic diagram of a structure array shown in the present application.
As shown in fig. 3c, the master state of the interface A, B is 1, and the slave state is 1; the state of the interface C is 0, and the slave state is 2; i.e. to indicate that interface a and interface B need to change to DOWN either actively due to a change in the network to which the interface is connected or else due to a change in the state of the other interface, while interface C is passively changed to DOWN due to a change in the state of the other interface. This is consistent with the above-described actual situation of interface state change of each interface.
In the above situation, if the interface a detects that the network state of the network connected thereto is recovered from the failure to normal, the count value in the master state of the interface a is decreased by one, and the slave states of the interface B and the interface C are decreased by one. Specifically, referring to fig. 3d, fig. 3d is a schematic diagram of a structure array shown in the present application.
As shown in fig. 3d, the master state of the interface A, C is 0 and the slave state is 1; the master state of the interface B is 1, and the slave state is 0; indicating that interface B is actively changing to the DOWN state due to a change in the network to which it is connected, and that interface A, C is passively changing to the DOWN state due to a change in the state of the other interfaces. This is consistent with the above-described actual situation of interface state change of each interface.
In the above situation, if the interface B detects that the network status of the network connected to the interface B is recovered from the failure to normal, the count value in the master status of the interface B is decreased by one, and the slave statuses of the interface a and the interface C are decreased by one. Specifically, referring to fig. 3e, fig. 3e is a schematic diagram of a structure array shown in the present application.
As shown in fig. 3e, the master state of the interface A, B, C is 0, and the slave states are both 0; i.e., indicating that the interface A, B, C is in an UP state. This is consistent with the actual state of each interface described above.
In an embodiment shown in the present application, the number of interfaces with network faults in the interface state synchronization group to which the interface belongs may also be obtained from the count value of the state record through any interface.
In practical application, a value obtained by subtracting a first preset value from a count value of a slave state of the target interface and then dividing the value by a second preset value is calculated and is output as the number of interfaces which are connected in the interface state synchronization group and have faults except the target interface; wherein the second preset value is not 0.
For example, as shown in fig. 3C, the interface C counts the value 2 from the state, the first preset value is 0, and the second preset value is 1. The numerical value 2 can be obtained after the calculation of the steps, so that the two interfaces except the target interface in the interface state synchronization group have network faults. This is consistent with the actual state of each interface described above.
As can be seen from the above description of the solution, the present application is a method for indicating the interface state corresponding to the slave state by the count value; when the counting value is a first preset value, the interface state corresponding to the slave state is a normal state; when the counting value is not a first preset value, the interface state corresponding to the slave state is a fault state; if the network state of any interface connection in the interface state synchronization group is changed from normal to fault, updating the main state of the interface to the interface state corresponding to the network state after the state change of the network, and increasing the count value in the slave state of each interface except the interface in the interface state synchronization group by a second preset value; if the network state of any interface connection in the interface state synchronization group is changed from fault to normal, updating the main state of the interface to the interface state corresponding to the network state after the state change of the network, and reducing the count value in the slave state of each interface except the interface in the interface state synchronization group by the second preset value; therefore, the interface state change situation of the interface indicated by the master state and the slave state of the interface in the structure body is consistent with the actual interface state change situation of the interface in the interface state synchronization group, so that the interface state of each interface in the interface state synchronization group is ensured to be represented as the actual state of a network connected with each interface.
Corresponding to the above method embodiment, the present application further provides an interface state synchronization apparatus, which is applied to a network device. A plurality of interfaces of the network device are configured as an interface state synchronization group; the interface in the interface state synchronization group comprises a master state and a slave state.
Referring to fig. 4, fig. 4 is a structural diagram of an interface state synchronization apparatus shown in the present application.
As shown in fig. 4, the apparatus 400 includes:
a determining module 410, configured to determine whether a network connected to each interface in the interface state synchronization group has a state change;
an updating module 420, configured to update the main state of the target interface to an interface state corresponding to a network state after a state change of the network if the network connected to any target interface in the interface state synchronization group has a state change; and the number of the first and second groups,
and updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
In an embodiment, the interface state synchronization group is stored in the network device in a structure array; the structure array comprises a plurality of structures which are in one-to-one correspondence with the plurality of interfaces; the structure body comprises a unique identifier of the interface, a master state of the interface and a slave state of the interface.
In one embodiment shown, the interface state corresponding to the slave state is indicated by a count value; when the counting value is a first preset value, the interface state corresponding to the slave state is a normal state; when the counting value is not a first preset value, the interface state corresponding to the slave state is a fault state;
the update module 420 further includes:
and if the network state of any target interface in the interface state synchronization group is changed from normal to fault, increasing the count value in the slave state of each interface except the interface in the interface state synchronization group by a second preset value.
In an illustrated embodiment, the update module 420 further includes:
and if the network state of any target interface in the interface state synchronization group is changed from a fault state to a normal state, reducing the count value of the slave state of each interface except the target interface in the interface state synchronization group by the second preset value.
In an embodiment, the apparatus 400 further comprises:
the calculation module is used for calculating a numerical value obtained by subtracting a first preset value from a count value of the slave state of the target interface and then dividing the numerical value by the second preset value, and outputting the numerical value which is used as the number of interfaces which are connected in the interface state synchronization group and have faults except the target interface; wherein the second preset value is not 0.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows described above can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer may not have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (10)

1. An interface state synchronization method is applied to network equipment, and is characterized in that a plurality of interfaces of the network equipment are configured into an interface state synchronization group; wherein the interfaces in the interface state synchronization group comprise a master state and a slave state; the method comprises the following steps:
determining whether the network connected with each interface in the interface state synchronization group has state change;
if the state of the network connected with any target interface in the interface state synchronization group changes, updating the main state of the target interface to the interface state corresponding to the network state after the state of the network changes; and the number of the first and second groups,
and updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
2. The method of claim 1, wherein the interface state synchronization group is stored in the network device in the form of a structured array; the structure array comprises a plurality of structures which are in one-to-one correspondence with the plurality of interfaces; the structure body comprises a unique identifier of the interface, a master state of the interface and a slave state of the interface.
3. The method of claim 1, wherein the interface state corresponding to the slave state is indicated by a count value; when the count value is a first preset value, the interface state corresponding to the slave state is a normal state; when the counting value is not a first preset value, the interface state corresponding to the slave state is a fault state; the updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively includes:
and if the network state of any target interface in the interface state synchronization group is changed from normal to fault, increasing the count value in the slave state of each interface except the interface in the interface state synchronization group by a second preset value.
4. The method of claim 3, wherein the updating the slave status of each interface except the target interface in the interface status synchronization group to the target interface status respectively comprises:
and if the network state of any target interface in the interface state synchronization group is changed from the fault state to the normal state, reducing the count value of the slave state of each interface except the target interface in the interface state synchronization group by the second preset value.
5. The method of claim 4, further comprising:
calculating a value obtained by subtracting a first preset value from a count value of the slave state of the target interface and then dividing the value by the second preset value, and outputting the value as the number of interfaces which are connected in the interface state synchronization group and have faults except the target interface; wherein the second preset value is not 0.
6. An interface state synchronization device is applied to a network device, and is characterized in that a plurality of interfaces of the network device are configured into an interface state synchronization group; wherein the interfaces in the interface state synchronization group comprise a master state and a slave state; the device comprises:
the determining module is used for determining whether the network connected with each interface in the interface state synchronization group has state change;
the updating module is used for updating the main state of the target interface into an interface state corresponding to the network state after the state change of the network if the state of the network connected with any target interface in the interface state synchronization group changes; and the number of the first and second groups,
and updating the slave states of the interfaces except the target interface in the interface state synchronization group to the interface states respectively.
7. The apparatus of claim 6, wherein the interface state synchronization group is stored in the network device in the form of a structure array; the structure array comprises a plurality of structures which are in one-to-one correspondence with the plurality of interfaces; the structure body comprises a unique identifier of the interface, a master state of the interface and a slave state of the interface.
8. The apparatus of claim 6, wherein the interface state corresponding to the slave state is indicated by a count value; when the count value is a first preset value, the interface state corresponding to the slave state is a normal state; when the counting value is not a first preset value, the interface state corresponding to the slave state is a fault state;
the update module further includes:
and if the network state of any target interface in the interface state synchronization group is changed from normal to fault, increasing the count value in the slave state of each interface except the interface in the interface state synchronization group by a second preset value.
9. The apparatus of claim 8, wherein the update module further comprises:
and if the network state of any target interface in the interface state synchronization group is changed from the fault state to the normal state, reducing the count value of the slave state of each interface except the target interface in the interface state synchronization group by the second preset value.
10. The apparatus of claim 9, further comprising:
the calculation module is used for calculating a numerical value obtained by subtracting a first preset value from a count value of the slave state of the target interface and then dividing the numerical value by the second preset value, and outputting the numerical value which is used as the number of interfaces which are connected in the interface state synchronization group and have faults except the target interface; wherein the second preset value is not 0.
CN201910925940.4A 2019-09-27 2019-09-27 Interface state synchronization method and device Active CN110661663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910925940.4A CN110661663B (en) 2019-09-27 2019-09-27 Interface state synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910925940.4A CN110661663B (en) 2019-09-27 2019-09-27 Interface state synchronization method and device

Publications (2)

Publication Number Publication Date
CN110661663A true CN110661663A (en) 2020-01-07
CN110661663B CN110661663B (en) 2022-06-28

Family

ID=69039670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910925940.4A Active CN110661663B (en) 2019-09-27 2019-09-27 Interface state synchronization method and device

Country Status (1)

Country Link
CN (1) CN110661663B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1545268A (en) * 2003-11-27 2004-11-10 中兴通讯股份有限公司 A method and system for Ethernet interface node backup
US20070239872A1 (en) * 2006-04-07 2007-10-11 Hon Hai Precision Industry Co., Ltd. Network device and information synchronization method thereof
CN101159534A (en) * 2007-11-19 2008-04-09 杭州华三通信技术有限公司 Method and apparatus for implementing interface condition synchronization
CN101931550A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Method and device for synchronizing main and standby main control boards
CN105591902A (en) * 2015-08-24 2016-05-18 杭州华三通信技术有限公司 Main-standby switching method and device
CN110061917A (en) * 2019-04-08 2019-07-26 新华三技术有限公司 Creation method, device, the network equipment and the storage medium of interface group

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1545268A (en) * 2003-11-27 2004-11-10 中兴通讯股份有限公司 A method and system for Ethernet interface node backup
US20070239872A1 (en) * 2006-04-07 2007-10-11 Hon Hai Precision Industry Co., Ltd. Network device and information synchronization method thereof
CN101159534A (en) * 2007-11-19 2008-04-09 杭州华三通信技术有限公司 Method and apparatus for implementing interface condition synchronization
CN101931550A (en) * 2009-06-23 2010-12-29 中兴通讯股份有限公司 Method and device for synchronizing main and standby main control boards
CN105591902A (en) * 2015-08-24 2016-05-18 杭州华三通信技术有限公司 Main-standby switching method and device
CN110061917A (en) * 2019-04-08 2019-07-26 新华三技术有限公司 Creation method, device, the network equipment and the storage medium of interface group

Also Published As

Publication number Publication date
CN110661663B (en) 2022-06-28

Similar Documents

Publication Publication Date Title
EP3029893B1 (en) Method, controller, device and system for protecting service path
CN105591857B (en) A kind of method and apparatus of 485 multi-host communication
JP2012108905A (en) Deterministic sas discovery and method for configuration
US9413552B2 (en) Internet protocol addressing of devices employing the network ring topology
WO2013147767A1 (en) Configurable and fault-tolerant baseboard management controller arrangement
CN109101357A (en) A kind of detection method and device of OSD failure
CN105357069A (en) Distributed node service state monitoring method, device and system
US9032118B2 (en) Administration device, information processing device, and data transfer method
CN107852344A (en) Store NE Discovery method and device
EP3523947A1 (en) Method and system for synchronizing policy in a control plane
CN110661663B (en) Interface state synchronization method and device
WO2018196969A1 (en) Robust data replication among data centers
US8681645B2 (en) System and method for coordinated discovery of the status of network routes by hosts in a network
JP2005277978A (en) Method and device for automatically setting identification number
JP6526836B2 (en) Switching network synchronization method and switching device, access device, storage medium
CN112804115B (en) Method, device and equipment for detecting abnormity of virtual network function
JP2015231217A (en) Communication system, communication device, connection state determination method, and control program
JP2010278639A (en) Network communication channel switch method and transmitter/receiver
CN102571443A (en) Abnormality handling method and device
EP3082298B1 (en) Slave device and method for controlling the same
CN109218206B (en) Method and device for limiting link state advertisement quantity
US8918557B2 (en) SAS expander and method to arbitrate traffic in a redundant expander system
JP6415847B2 (en) Communication apparatus and communication method
CN111030884B (en) Method and device for acquiring interface packet loss
JP2013168815A (en) Apparatus and method for identifying transmission source causing congestion

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