CN113328905A - Method, system and device for realizing interface state reporting - Google Patents

Method, system and device for realizing interface state reporting Download PDF

Info

Publication number
CN113328905A
CN113328905A CN202110392035.4A CN202110392035A CN113328905A CN 113328905 A CN113328905 A CN 113328905A CN 202110392035 A CN202110392035 A CN 202110392035A CN 113328905 A CN113328905 A CN 113328905A
Authority
CN
China
Prior art keywords
interface
state
event
identifier
management state
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
CN202110392035.4A
Other languages
Chinese (zh)
Other versions
CN113328905B (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.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
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 New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN202110392035.4A priority Critical patent/CN113328905B/en
Publication of CN113328905A publication Critical patent/CN113328905A/en
Application granted granted Critical
Publication of CN113328905B publication Critical patent/CN113328905B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/321Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers

Abstract

The application provides a method, a system and a device for realizing interface state reporting, wherein the method comprises the following steps: acquiring a first interface state reporting event from the event queue; if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface; if the management state information of the first interface indicates that the association state of the interface is a DOWN state, a first interface state reporting event is sent to an upper layer protocol module; acquiring a second interface state reporting event from the event queue; if the processing core represented by the identifier of the second processing core is a non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface; and if the management state of the interface indicated by the management state information of the second interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module.

Description

Method, system and device for realizing interface state reporting
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, a system, and an apparatus for implementing interface status reporting.
Background
Network Function Virtualization (NFV) refers to a software process that uses generic hardware such as x86 and Virtualization technology to carry more service functions, thereby reducing the expensive equipment cost of the Network. The NFV can decouple software and hardware and abstract functions, so that the functions of network equipment do not depend on special hardware any more, resources can be shared fully and flexibly, rapid development and deployment of new services are realized, and automatic deployment, elastic expansion, fault isolation, self-healing and the like are carried out based on actual service requirements.
In the NFV architecture, various service software is deployed on a general purpose hardware device. When an enterprise needs to deploy a new service, the enterprise creates a corresponding virtual machine on an open virtual machine platform, and installs a software package with corresponding functions in the virtual machine to achieve deployment of the new service. The virtual machine interface is virtualized from the physical interface on the network device, and the state of the virtual machine interface depends on the state of the physical interface on the host machine.
The state of a virtual machine interface is generally divided into a physical state and a management state. The physical state refers to a physical link state of an interface, and is divided into an open (UP) state and a closed (DOWN) state, and if the physical link state is the DOWN state, the physical link state may be due to that a physical interface on a host corresponding to the interface is not connected or a link fails. The management state refers to a network function that a user manually closes an interface through shutdown and undo shutdown operations, and is also divided into an UP state and a DOWN state.
When the management state and the physical state of the interface are both the UP state, the state of the interface is the UP state, and the interface can normally run. If one of the management state and the physical state of the interface is the DOWN state, the state of the interface is the DOWN state, and the interface cannot normally operate. As a network device, it is important whether an interface operates normally, and therefore, it is necessary to report a state change of the interface to an upper protocol module accurately in time.
When the physical state of the interface changes, the virtual machine can continuously detect the state of the current interface through the timer started by the interface, and further know the physical state of the interface. The management state of the interface is generally manually operated by a user, and the virtual machine can quickly perceive the management state of the interface. In the multi-core virtual machine system, the interface-started timer runs in a non-control core (other cores, such as a forwarding core), and an instruction for processing the management state of the interface manually set by a user runs in the control core. For example, in one scenario, when the physical state of the interface is the UP state, the user manually closes the management state of the interface, and there are concurrent operations between the two.
As shown in fig. 1, fig. 1 is a schematic diagram of a concurrent reporting process of an existing interface state. In fig. 1, after the control core receives the instruction to close the management state of the interface, the control core determines whether the management state of the interface is the UP state. If the management state of the interface is not the UP state, the control core determines that the management state of the interface is the DOWN state, and the control core does not need to report an event that the management state of the interface is the DOWN state to an upper layer protocol module; if the management state of the interface is an UP state, the control core sets the management state of the interface to a DOWN state and reports an event that the management state of the interface is the DOWN state to an upper layer protocol module.
The timer started by the interface runs in other cores, and the other cores judge whether the management state of the interface is an UP state. If the management state of the interface is not the UP state, at the moment, other cores determine that the management state of the interface is the DOWN state, and the other cores do not need to report an event that the management state of the interface is the DOWN state to an upper layer protocol module; and if the management state of the interface is the UP state, reporting the event that the management state of the interface is the UP state to an upper layer protocol module by other cores.
Currently, there may be concurrent operations in a time sequence between an operation of setting the management state of the interface to the DOWN state by the control core and an operation of judging the management state of the interface by another core, which causes a management state event of the interface received by the upper layer protocol module to be inconsistent with an actual state of the interface.
In an implementation scenario, if a control core reports an event that a management state of an interface is a DOWN state to an upper layer protocol module first, and meanwhile, other cores do not detect that the management state of the interface is the DOWN state, and determine that the management state of the interface is still not an UP state, the other cores still report an event that the management state of the interface is an UP state to the upper layer protocol module, and finally, the upper layer protocol module determines that the management state of the interface is the UP state, and a user has manually closed the management state of the interface, and the management state of the interface should be the DOWN state. At this time, the management state event of the interface received by the upper layer protocol module is inconsistent with the actual state of the interface.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for implementing interface state reporting, so as to solve the problem that, in the existing interface state reporting scheme, a management state event of an interface received by an upper layer protocol module is inconsistent with an actual state of the interface.
In a first aspect, the present application provides a method for implementing interface state reporting, where the method is applied to a network device, where the network device includes a control core and a non-control core, where the control core has established an event queue, and multiple interface state reporting events have been stored in the event queue, and the multiple interface state reporting events are stored in the event queue by the control core and the non-control core, respectively, and the method includes:
acquiring a first interface state reporting event from the event queue, wherein the first interface state reporting event comprises an identifier of a first processing core, an identifier of a first interface and management state information of the first interface;
if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface;
if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending a first interface state reporting event to an upper layer protocol module;
acquiring a second interface state reporting event from the event queue, wherein the second interface state reporting event comprises an identifier of a second processing core, an identifier of a second interface and management state information of the second interface;
if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface;
if the management state information of the second interface indicates that the management state of the interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module any more;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
In a second aspect, the present application provides a system for implementing interface status reporting, where the system includes a control core and a non-control core, and the control core has established an event queue;
a plurality of interface state reporting events are stored in the event queue, and the plurality of interface state reporting events are stored in the event queue by the control core and the non-control core respectively;
the event queue is configured to obtain a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of a first processing core, an identifier of a first interface, and management state information of the first interface; if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface; if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending a first interface state reporting event to an upper layer protocol module;
the event queue is further configured to obtain a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface; if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface; if the management state information of the second interface indicates that the management state of the interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module any more;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
In a third aspect, the present application provides an apparatus for implementing interface state reporting, where the apparatus is applied to a network device, the network device includes a control core and a non-control core, the control core has established an event queue, the event queue has stored therein a plurality of interface state reporting events, and the plurality of interface state reporting events are stored in the event queue by the control core and the non-control core, respectively, and the apparatus includes:
an obtaining unit, configured to obtain a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of a first processing core, an identifier of a first interface, and management state information of the first interface;
the identification unit is used for identifying the management state information of the first interface if the processing core represented by the identifier of the first processing core is the control core;
a sending unit, configured to send, to an upper layer protocol module, a first interface state report event if the management state information of the first interface indicates that the management state of the interface is a DOWN state;
the obtaining unit is further configured to obtain a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface;
the identification unit is further configured to identify management state information of the second interface if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface represents the same interface as the identifier of the first interface;
a processing unit, configured to, if the management state information of the second interface indicates that the management state of the interface is an UP state, no longer send the second interface state reporting event to the upper protocol module;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
Therefore, by applying the method, the system and the device for realizing interface state reporting provided by the present application, the event queue obtains the first interface state reporting event from the event queue, where the first interface state reporting event includes the identifier of the first processing core, the identifier of the first interface and the management state information of the first interface. And if the processing core represented by the identifier of the first processing core is the control core, the event queue identifies the management state information of the first interface. And if the management state information of the first interface indicates that the management state of the interface is the DOWN state, the event queue sends a first interface state reporting event to the upper protocol module. And acquiring a second interface state reporting event from the event queue, wherein the second interface state reporting event comprises an identifier of a second processing core, an identifier of a second interface and management state information of the second interface. And if the processing core represented by the identifier of the first processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface by the event queue. And if the management state information of the second interface indicates that the management state of the interface is the UP state, the event queue does not send the second interface state reporting event to the upper layer protocol module any more. And the time for the first interface state reporting event to be written into the event queue is earlier than the time for the second interface state reporting event to be written into the event queue.
Therefore, by writing a plurality of interface state reporting events generated by the control core and the non-control core into the event queue, the event queue judges whether to send the interface state reporting event to the upper layer protocol module according to the writing time of the interface state reporting event of the same interface. The problem that in the existing interface state reporting scheme, the management state event of the interface received by the upper protocol module is inconsistent with the actual state of the interface is solved. Under the multi-core virtual machine system, the situation that the control core and the non-control core report the management state event of the interface concurrently is avoided, the accuracy of reporting the management state of the interface is ensured, meanwhile, the stable operation of an upper layer protocol module is also ensured, and the reliability of the multi-core virtual machine system is improved.
Drawings
Fig. 1 is a schematic diagram of a concurrent reporting process of a current interface state;
fig. 2 is a flowchart of a method for implementing interface status reporting according to an embodiment of the present application;
fig. 3 is a schematic diagram of an implementation system for interface state reporting according to an embodiment of the present application;
fig. 4 is a structural diagram of an apparatus for implementing interface status reporting according to an embodiment of 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 corresponding listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The following describes in detail a method for implementing interface status reporting provided in this embodiment. Referring to fig. 2, fig. 2 is a flowchart of a method for implementing interface status reporting according to an embodiment of the present application. The method is applied to an event queue, and the implementation method for reporting the interface state provided by the embodiment of the application can comprise the following steps.
Step 210, obtaining a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of the first processing core, an identifier of the first interface, and management state information of the first interface.
Specifically, a control core and a non-control core (e.g., a forwarding core) are included within the network device. An event queue (e.g., Epoll queue) is established within the control core. The event queue is used for storing a plurality of interface state reporting events. And the plurality of interface state reporting events are respectively stored in the event queue by the control core and the non-control core.
And calling a first callback function from the event queue to acquire a first interface state reporting event, wherein the first interface state reporting event comprises an identifier of the first processing core, an identifier of the first interface and management state information of the first interface.
It can be understood that, in the process of reporting an event to the event queue storage interface state, the control core and the non-control core specify a callback function corresponding to the interface state reporting event. The callback function is used for processing by calling the corresponding callback function when the event queue subsequently processes the interface state reporting event.
The first callback function is a callback function corresponding to a first interface state reporting event.
In the embodiment of the present application, the event queue may be specifically a first-in first-out queue. The first interface state reporting event may be the interface state reporting event written first in the event queue.
Step 220, if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface.
Specifically, according to the description in step 220, after the event queue obtains the first interface state reporting event, the identifier of the first processing core, the identifier of the first interface, and the management state information of the first interface are obtained therefrom.
The event queue identifies an identifier of the first processing core, and if the processing core represented by the identifier of the first processing core is the control core, the event queue identifies management state information of the first interface.
Step 230, if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending the first interface state reporting event to an upper protocol module.
Specifically, according to the description in step 220, if the management state information of the first interface indicates that the management state of the interface is the DOWN state, the event queue sends a first interface state reporting event to the upper protocol module.
Step 240, obtaining a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of the second processing core, an identifier of the second interface, and management state information of the second interface.
Specifically, after the event queue finishes processing the first interface state reporting event, the event queue calls a second callback function, and acquires a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface.
In this step, the second callback function is a callback function corresponding to the second interface state reporting event.
It can be understood that the time when the first interface status reports that the event is written into the event queue is earlier than the time when the second interface status reports that the event is written into the event queue.
Step 250, if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface.
Specifically, according to the description in step 240, after the event queue obtains the second interface state reporting event, the identifier of the second processing core, the identifier of the second interface, and the management state information of the second interface are obtained therefrom.
And the event queue identifies the identifier of the second processing core and the identifier of the second interface, and identifies the management state information of the second interface if the processing core represented by the identifier of the second processing core is a non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface.
Step 260, if the association state of the interface indicated by the management state information of the second interface is the UP state, no longer sending the second interface state reporting event to the upper layer protocol module.
Specifically, according to the description in step 250, if the management state information of the second interface indicates that the management state of the interface is the UP state, the event queue does not send the second interface state report event to the upper layer protocol module any more.
Therefore, by applying the method, the system and the device for realizing interface state reporting provided by the present application, the event queue obtains the first interface state reporting event from the event queue, where the first interface state reporting event includes the identifier of the first processing core, the identifier of the first interface and the management state information of the first interface. And if the processing core represented by the identifier of the first processing core is the control core, the event queue identifies the management state information of the first interface. And if the management state information of the first interface indicates that the management state of the interface is the DOWN state, the event queue sends a first interface state reporting event to the upper protocol module. And acquiring a second interface state reporting event from the event queue, wherein the second interface state reporting event comprises an identifier of a second processing core, an identifier of a second interface and management state information of the second interface. And if the processing core represented by the identifier of the first processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface by the event queue. And if the management state information of the second interface indicates that the management state of the interface is the UP state, the event queue does not send the second interface state reporting event to the upper layer protocol module any more. And the time for the first interface state reporting event to be written into the event queue is earlier than the time for the second interface state reporting event to be written into the event queue.
Therefore, by writing a plurality of interface state reporting events generated by the control core and the non-control core into the event queue, the event queue judges whether to send the interface state reporting event to the upper layer protocol module according to the writing time of the interface state reporting event of the same interface. The problem that in the existing interface state reporting scheme, the management state event of the interface received by the upper protocol module is inconsistent with the actual state of the interface is solved. Under the multi-core virtual machine system, the situation that the control core and the non-control core report the management state event of the interface concurrently is avoided, the accuracy of reporting the management state of the interface is ensured, meanwhile, the stable operation of an upper layer protocol module is also ensured, and the reliability of the multi-core virtual machine system is improved.
Optionally, in this embodiment of the present application, the method further includes a process that the event queue processes the interface state reporting event written by the non-control core first, and then processes the interface state reporting event written by the control core.
Specifically, the event queue calls a third callback function, and a third interface state reporting event is acquired from the event queue, where the third interface state reporting event includes an identifier of the third processing core, an identifier of the third interface, and management state information of the third interface. And the third callback function is a callback function corresponding to the third interface state reporting event.
And after the event queue acquires the state reporting event of the third interface, acquiring the identifier of the third processing core, the identifier of the third interface and the management state information of the third interface. The event queue identifies an identifier of the third processing core, and if the processing core represented by the identifier of the third processing core is a non-control core, the event queue identifies management state information of the third interface.
And if the management state information of the third interface indicates that the management state of the interface is the UP state, the event queue sends a third interface state reporting event to the upper protocol module.
And after the event queue finishes processing the third interface state reporting event, the event queue calls a fourth callback function to acquire a fourth interface state reporting event from the event queue, wherein the fourth interface state reporting event comprises an identifier of a fourth processing core, an identifier of a fourth interface and management state information of the fourth interface. And the fourth callback function is a callback function corresponding to the fourth interface state reporting event.
It can be understood that the time when the third interface status reports that the event is written into the event queue is earlier than the time when the fourth interface status reports that the event is written into the event queue.
And after the event queue acquires the state reporting event of the fourth interface, acquiring the identifier of the fourth processing core, the identifier of the fourth interface and the management state information of the fourth interface. And the event queue identifies the identifier of the fourth processing core and the identifier of the fourth interface, and if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the fourth interface and the identifier of the third interface represent the same interface, the event queue identifies the management state information of the fourth interface.
And if the management state information of the fourth interface indicates that the management state of the interface is the DOWN state, the event queue sends a fourth interface state reporting event to the upper protocol module.
Optionally, before step 210, a process of reporting an event to an event queue storage interface by the control core and the non-control core is further included.
Specifically, in one implementation, a user inputs an instruction to the network device to close the management state of the interface, where the instruction to close the management state of the interface includes an identification of the interface. And after receiving the command of closing the management state of the interface, the control core acquires the identifier of the interface.
And judging whether the current management state of the interface corresponding to the identifier of the interface is the UP state or not by the control core according to the identifier of the interface. And if the current management state of the interface is the UP state, the control core sets the current management state of the interface to be the DOWN state and generates a fifth interface state reporting event. And the control core writes the event reported by the fifth interface into the event queue.
If the current management state of the interface is the DOWN state, the control core does not generate any more and sends an interface state reporting event to the upper layer protocol module.
In another implementation, the non-controlling core runs a timer that periodically probes the current management state of the interface.
And in the timing period of the timer, the non-control core acquires and identifies the current management state of the interface. And if the current management state of the interface is the UP state, the non-control core generates a sixth interface state reporting event. And the non-control core writes the reported event of the sixth interface into the event queue.
If the current management state of the interface is the DOWN state, the non-control core does not generate any more and sends an interface state reporting event to the upper layer protocol module.
It can be understood that, when reporting an event to the event queue storage interface state, the control core and the non-control core sequentially write in the event queue according to the generation time of the interface state reporting event, so that the subsequent time queue sequentially processes the interface state reporting event according to the writing time sequence, thereby avoiding a scenario that the control core and the non-control core concurrently report the management state event of the interface, and ensuring the accuracy of the management state reporting of the interface.
Based on the same inventive concept, the embodiment of the application also provides an implementation system for reporting the interface state, which corresponds to the implementation method for reporting the interface state. Referring to fig. 3, fig. 3 is a schematic diagram of an implementation system for reporting an interface state according to an embodiment of the present application. The system includes a controlling core 310 that has established an event queue 330, and a non-controlling core 320.
The event queue 330 stores a plurality of interface state reporting events, which are stored in the event queue by the control core 310 and the non-control core 320, respectively.
The event queue 330 is configured to obtain a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of the first processing core, an identifier of the first interface, and management state information of the first interface; if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface; and if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending a first interface state reporting event to an upper layer protocol module.
The event queue 330 is further configured to obtain, from the event queue, a second interface state reporting event, where the second interface state reporting event includes an identifier of the second processing core, an identifier of the second interface, and management state information of the second interface; if the processing core represented by the identifier of the second processing core is a non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface; and if the management state of the interface indicated by the management state information of the second interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module.
And the time for the first interface state reporting event to be written into the event queue is earlier than the time for the second interface state reporting event to be written into the event queue.
Optionally, the event queue 330 is further configured to obtain, from the event queue, a third interface state reporting event, where the third interface state reporting event includes an identifier of the third processing core, an identifier of the third interface, and management state information of the third interface; if the processing core represented by the identifier of the third processing core is a non-control core, identifying the management state information of the third interface; and if the management state information of the third interface indicates that the management state of the interface is the UP state, sending a third interface state reporting event to the upper layer protocol module.
The event queue 330 is further configured to obtain a fourth interface state reporting event from the event queue, where the fourth interface state reporting event includes an identifier of a fourth processing core, an identifier of a fourth interface, and management state information of the fourth interface; if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the third interface and the identifier of the fourth interface represent the same interface, identifying the management state information of the fourth interface; and if the management state information of the fourth interface indicates that the management state of the interface is the DOWN state, sending a fourth interface state reporting event to the upper layer protocol module.
And the time for writing the report event of the third interface state into the event queue is earlier than the time for writing the report event of the fourth interface state into the event queue.
Optionally, the control core 310 is configured to receive an instruction for closing the management state of the interface, where the instruction for closing the management state of the interface includes an identifier of the interface;
judging whether the current management state of the interface corresponding to the interface identifier is an UP state or not according to the interface identifier;
if the current management state of the interface is an UP state, setting the current management state of the interface to be a DOWN state, and generating a fifth interface state reporting event;
writing the event reported by the fifth interface into an event queue;
if the current management state of the interface is the DOWN state, the interface state reporting event is not generated and sent to the upper layer protocol module.
Optionally, the non-control core 320 runs a timer for periodically probing the current management state of the interface;
the non-control core 320 is configured to, in a timing period of the timer, obtain a current management state of the interface;
if the current management state of the interface is the UP state, generating a sixth interface state reporting event;
writing the event reported by the sixth interface into the event queue;
if the current management state of the interface is the DOWN state, the interface state reporting event is not generated and sent to the upper layer protocol module.
Based on the same inventive concept, the embodiment of the present application further provides an implementation apparatus for interface state reporting corresponding to the implementation method for interface state reporting. Referring to fig. 4, fig. 4 is a structural diagram of an apparatus for implementing interface status reporting according to an embodiment of the present application. The device is applied to an event queue, the event queue is in a control core in network equipment, the network equipment further comprises a non-control core, a plurality of interface state reporting events are stored in the event queue, the plurality of interface state reporting events are respectively stored in the event queue by the control core and the non-control core, and the device comprises:
an obtaining unit 410, configured to obtain, from the event queue, a first interface state reporting event, where the first interface state reporting event includes an identifier of a first processing core, an identifier of a first interface, and management state information of the first interface;
an identifying unit 420, configured to identify management state information of the first interface if the processing core represented by the identifier of the first processing core is the control core;
a sending unit 430, configured to send, to an upper layer protocol module, the first interface state reporting event if the management state information of the first interface indicates that the management state of the interface is a DOWN state;
the obtaining unit 410 is further configured to obtain a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface;
the identifying unit 420 is further configured to identify management state information of the second interface if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface represents the same interface as the identifier of the first interface;
a processing unit 440, configured to, if the management state of the interface indicated by the management state information of the second interface is an UP state, no longer send the second interface state reporting event to the upper protocol module;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
Optionally, the obtaining unit 410 is further configured to obtain a third interface state reporting event from the event queue, where the third interface state reporting event includes an identifier of a third processing core, an identifier of a third interface, and management state information of the third interface;
the identifying unit 420 is further configured to identify management state information of the third interface if the processing core represented by the identifier of the third processing core is the non-control core;
the sending unit 430 is further configured to send, if the management state information of the third interface indicates that the management state of the interface is the UP state, the third interface state reporting event to an upper layer protocol module;
the obtaining unit 410 is further configured to obtain a fourth interface state reporting event from the event queue, where the fourth interface state reporting event includes an identifier of a fourth processing core, an identifier of a fourth interface, and management state information of the fourth interface;
the identifying unit 420 is further configured to identify management state information of the fourth interface if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the third interface and the identifier of the fourth interface represent the same interface;
the sending unit 430 is further configured to send the fourth interface state reporting event to the upper protocol module if the management state information of the fourth interface indicates that the management state of the interface is a DOWN state;
and the time for writing the third interface state reporting event into the event queue is earlier than the time for writing the fourth interface state reporting event into the event queue.
Therefore, by applying the method, the system and the device for realizing interface state reporting provided by the present application, the event queue obtains the first interface state reporting event from the event queue, where the first interface state reporting event includes the identifier of the first processing core, the identifier of the first interface and the management state information of the first interface. And if the processing core represented by the identifier of the first processing core is the control core, the event queue identifies the management state information of the first interface. And if the management state information of the first interface indicates that the management state of the interface is the DOWN state, the event queue sends a first interface state reporting event to the upper protocol module. And acquiring a second interface state reporting event from the event queue, wherein the second interface state reporting event comprises an identifier of a second processing core, an identifier of a second interface and management state information of the second interface. And if the processing core represented by the identifier of the first processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface by the event queue. And if the management state information of the second interface indicates that the management state of the interface is the UP state, the event queue does not send the second interface state reporting event to the upper layer protocol module any more. And the time for the first interface state reporting event to be written into the event queue is earlier than the time for the second interface state reporting event to be written into the event queue.
Therefore, by writing a plurality of interface state reporting events generated by the control core and the non-control core into the event queue, the event queue judges whether to send the interface state reporting event to the upper layer protocol module according to the writing time of the interface state reporting event of the same interface. The problem that in the existing interface state reporting scheme, the management state event of the interface received by the upper protocol module is inconsistent with the actual state of the interface is solved. Under the multi-core virtual machine system, the situation that the control core and the non-control core report the management state event of the interface concurrently is avoided, the accuracy of reporting the management state of the interface is ensured, meanwhile, the stable operation of an upper layer protocol module is also ensured, and the reliability of the multi-core virtual machine system is improved.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
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.
As for the implementation apparatus for reporting interface status and the machine-readable storage medium, the content of the related method is substantially similar to that of the foregoing method embodiment, so that the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiment.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A method for realizing interface state report is characterized in that the method is applied to an event queue, the event queue is arranged in a control core in network equipment, the network equipment also comprises a non-control core, a plurality of interface state report events are stored in the event queue, the plurality of interface state report events are respectively stored in the event queue by the control core and the non-control core, and the method comprises the following steps:
acquiring a first interface state reporting event from the event queue, wherein the first interface state reporting event comprises an identifier of a first processing core, an identifier of a first interface and management state information of the first interface;
if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface;
if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending a first interface state reporting event to an upper layer protocol module;
acquiring a second interface state reporting event from the event queue, wherein the second interface state reporting event comprises an identifier of a second processing core, an identifier of a second interface and management state information of the second interface;
if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface;
if the management state of the interface indicated by the management state information of the second interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module any more;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
2. The method of claim 1, further comprising:
acquiring a third interface state reporting event from the event queue, wherein the third interface state reporting event comprises an identifier of a third processing core, an identifier of a third interface and management state information of the third interface;
if the processing core represented by the identifier of the third processing core is the non-control core, identifying the management state information of the third interface;
if the management state information of the third interface indicates that the management state of the interface is the UP state, sending a third interface state reporting event to an upper layer protocol module;
acquiring a fourth interface state reporting event from the event queue, wherein the fourth interface state reporting event comprises an identifier of a fourth processing core, an identifier of a fourth interface and management state information of the fourth interface;
if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the third interface and the identifier of the fourth interface represent the same interface, identifying the management state information of the fourth interface;
if the management state information of the fourth interface indicates that the management state of the interface is the DOWN state, sending a fourth interface state reporting event to the upper layer protocol module;
and the time for writing the third interface state reporting event into the event queue is earlier than the time for writing the fourth interface state reporting event into the event queue.
3. The method of claim 1, wherein before the obtaining the first interface state reporting event from the event queue, the method further comprises:
the control core receives an instruction for closing the management state of the interface, which is input by a user, wherein the instruction for closing the management state of the interface comprises an identifier of the interface;
according to the identifier of the interface, the control core judges whether the current management state of the interface corresponding to the identifier of the interface is an UP state;
if the current management state of the interface is an UP state, the control core sets the current management state of the interface to be a DOWN state and generates a fifth interface state reporting event;
the control core writes the fifth interface reporting event into the event queue;
and if the current management state of the interface is the DOWN state, the control core does not generate any more and sends an interface state reporting event to the upper layer protocol module.
4. The method of claim 1, wherein the non-control core runs a timer that is used to periodically probe a current management state of an interface;
before the obtaining the first interface state reporting event from the event queue, the method further includes:
in the timing period of the timer, the non-control core acquires the current management state of the interface;
if the current management state of the interface is the UP state, the non-control core generates a sixth interface state reporting event;
the non-control core writes the reported event of the sixth interface into the event queue;
and if the current management state of the interface is the DOWN state, the non-control core does not generate any more and sends an interface state reporting event to the upper layer protocol module.
5. A system for realizing interface state report is characterized in that the system comprises a control core and a non-control core, wherein the control core establishes an event queue;
a plurality of interface state reporting events are stored in the event queue, and the plurality of interface state reporting events are stored in the event queue by the control core and the non-control core respectively;
the event queue is configured to obtain a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of a first processing core, an identifier of a first interface, and management state information of the first interface; if the processing core represented by the identifier of the first processing core is the control core, identifying the management state information of the first interface; if the management state information of the first interface indicates that the management state of the interface is the DOWN state, sending a first interface state reporting event to an upper layer protocol module;
the event queue is further configured to obtain a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface; if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface and the identifier of the first interface represent the same interface, identifying the management state information of the second interface; if the management state of the interface indicated by the management state information of the second interface is the UP state, the second interface state reporting event is not sent to the upper layer protocol module any more;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
6. The system according to claim 5, wherein the event queue is further configured to obtain a third interface state reporting event from the event queue, where the third interface state reporting event includes an identifier of a third processing core, an identifier of a third interface, and management state information of the third interface; if the processing core represented by the identifier of the third processing core is the non-control core, identifying the management state information of the third interface; if the management state information of the third interface indicates that the management state of the interface is the UP state, sending a third interface state reporting event to an upper layer protocol module;
the event queue is further configured to obtain a fourth interface state reporting event from the event queue, where the fourth interface state reporting event includes an identifier of a fourth processing core, an identifier of a fourth interface, and management state information of the fourth interface; if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the third interface and the identifier of the fourth interface represent the same interface, identifying the management state information of the fourth interface; if the management state information of the fourth interface indicates that the management state of the interface is the DOWN state, sending a fourth interface state reporting event to the upper layer protocol module;
and the time for writing the third interface state reporting event into the event queue is earlier than the time for writing the fourth interface state reporting event into the event queue.
7. The system of claim 5, wherein the control core is configured to receive a user-input instruction to close the management state of the interface, and the instruction to close the management state of the interface includes an identifier of the interface;
judging whether the current management state of the interface corresponding to the interface identifier is an UP state or not according to the interface identifier;
if the current management state of the interface is an UP state, setting the current management state of the interface to be a DOWN state, and generating a fifth interface state reporting event;
writing the event reported by the fifth interface into the event queue;
and if the current management state of the interface is the DOWN state, no interface state reporting event is generated and sent to the upper layer protocol module.
8. The system of claim 5, wherein the non-control core runs a timer for periodically probing a current management state of an interface;
the non-control core is used for acquiring the current management state of the interface in the timing period of the timer;
if the current management state of the interface is the UP state, generating a sixth interface state reporting event;
writing the event reported by the sixth interface into the event queue;
and if the current management state of the interface is the DOWN state, no interface state reporting event is generated and sent to the upper layer protocol module.
9. An apparatus for implementing interface state reporting is applied to an event queue, where the event queue is in a control core in a network device, the network device further includes a non-control core, multiple interface state reporting events have been stored in the event queue, and the multiple interface state reporting events are stored in the event queue by the control core and the non-control core, respectively, where the apparatus includes:
an obtaining unit, configured to obtain a first interface state reporting event from the event queue, where the first interface state reporting event includes an identifier of a first processing core, an identifier of a first interface, and management state information of the first interface;
the identification unit is used for identifying the management state information of the first interface if the processing core represented by the identifier of the first processing core is the control core;
a sending unit, configured to send, to an upper layer protocol module, a first interface state report event if the management state information of the first interface indicates that the management state of the interface is a DOWN state;
the obtaining unit is further configured to obtain a second interface state reporting event from the event queue, where the second interface state reporting event includes an identifier of a second processing core, an identifier of a second interface, and management state information of the second interface;
the identification unit is further configured to identify management state information of the second interface if the processing core represented by the identifier of the second processing core is the non-control core and the identifier of the second interface represents the same interface as the identifier of the first interface;
a processing unit, configured to, if the management state of the interface indicated by the management state information of the second interface is an UP state, no longer send the second interface state reporting event to the upper protocol module;
and the time for writing the first interface state reporting event into the event queue is earlier than the time for writing the second interface state reporting event into the event queue.
10. The apparatus according to claim 9, wherein the obtaining unit is further configured to obtain a third interface state reporting event from the event queue, where the third interface state reporting event includes an identifier of a third processing core, an identifier of a third interface, and management state information of the third interface;
the identification unit is further configured to identify management state information of the third interface if the processing core represented by the identifier of the third processing core is the non-control core;
the sending unit is further configured to send, to an upper layer protocol module, the third interface state reporting event if the management state information of the third interface indicates that the management state of the interface is the UP state;
the acquiring unit is further configured to acquire a fourth interface state reporting event from the event queue, where the fourth interface state reporting event includes an identifier of a fourth processing core, an identifier of a fourth interface, and management state information of the fourth interface;
the identification unit is further configured to identify management state information of the fourth interface if the processing core represented by the identifier of the fourth processing core is the control core and the identifier of the third interface and the identifier of the fourth interface represent the same interface;
the sending unit is further configured to send a fourth interface state reporting event to the upper protocol module if the management state information of the fourth interface indicates that the management state of the interface is a DOWN state;
and the time for writing the third interface state reporting event into the event queue is earlier than the time for writing the fourth interface state reporting event into the event queue.
CN202110392035.4A 2021-04-13 2021-04-13 Method, system and device for realizing interface state reporting Active CN113328905B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110392035.4A CN113328905B (en) 2021-04-13 2021-04-13 Method, system and device for realizing interface state reporting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110392035.4A CN113328905B (en) 2021-04-13 2021-04-13 Method, system and device for realizing interface state reporting

Publications (2)

Publication Number Publication Date
CN113328905A true CN113328905A (en) 2021-08-31
CN113328905B CN113328905B (en) 2022-02-22

Family

ID=77414724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110392035.4A Active CN113328905B (en) 2021-04-13 2021-04-13 Method, system and device for realizing interface state reporting

Country Status (1)

Country Link
CN (1) CN113328905B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553631A (en) * 2003-05-26 2004-12-08 华为技术有限公司 Uplink transmission method for interface status messages
CN101257463A (en) * 2007-03-01 2008-09-03 中兴通讯股份有限公司 Method for medium gateway to report Iu interface resource state
CN101483500A (en) * 2009-02-13 2009-07-15 杭州华三通信技术有限公司 Processing method and apparatus for member port status changing in stacking system
CN103684869A (en) * 2013-12-21 2014-03-26 中电科航空电子有限公司 Method and device for reporting status information of multi-interface airborne equipment
US20140215443A1 (en) * 2013-01-28 2014-07-31 Rackspace Us, Inc. Methods and Systems of Distributed Tracing
CN108134713A (en) * 2017-12-19 2018-06-08 新华三技术有限公司 A kind of communication means and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553631A (en) * 2003-05-26 2004-12-08 华为技术有限公司 Uplink transmission method for interface status messages
CN101257463A (en) * 2007-03-01 2008-09-03 中兴通讯股份有限公司 Method for medium gateway to report Iu interface resource state
CN101483500A (en) * 2009-02-13 2009-07-15 杭州华三通信技术有限公司 Processing method and apparatus for member port status changing in stacking system
US20140215443A1 (en) * 2013-01-28 2014-07-31 Rackspace Us, Inc. Methods and Systems of Distributed Tracing
CN103684869A (en) * 2013-12-21 2014-03-26 中电科航空电子有限公司 Method and device for reporting status information of multi-interface airborne equipment
CN108134713A (en) * 2017-12-19 2018-06-08 新华三技术有限公司 A kind of communication means and device

Also Published As

Publication number Publication date
CN113328905B (en) 2022-02-22

Similar Documents

Publication Publication Date Title
US7703091B1 (en) Methods and apparatus for installing agents in a managed network
US7870296B2 (en) High availability system and execution state control method
CN105354113B (en) A kind of system and method for server, management server
CN104461521B (en) A kind of application program playback method and system
WO2011023424A1 (en) A method and system for testing a computer program
KR20010072379A (en) Fault tolerant computer system
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN107908460A (en) Virtual machine rapid volume-expanding method, device, equipment and storage medium
CA2904253A1 (en) Computer system using in-service software upgrade
CN109597653A (en) Method, BIOS and the BMC of BIOS and BMC command interaction
CN111104336B (en) Online service interface testing method and device based on container and VNC
CN114416589B (en) Network target range comprehensive detection method, device, equipment and readable storage medium
JP4517923B2 (en) Object relief system and method
CN115203054A (en) Virtual chip test system
CN114168471A (en) Test method, test device, electronic equipment and storage medium
CN113328905B (en) Method, system and device for realizing interface state reporting
CN112596371A (en) Control card switching method and device, electronic equipment and storage medium
CN109426240B (en) Test method and device
CN112596750B (en) Application testing method and device, electronic equipment and computer readable storage medium
CN112148537A (en) Bus monitoring device and method, storage medium, and electronic device
Lovrek et al. Improving software maintenance by using agent-based remote maintenance shell
CN110365627B (en) Application program synchronization method and device, computing equipment and storage medium
CN109885495B (en) Group testing method and system for decentralized system
CN113495846A (en) Terminal test system and test device based on cluster
CN111581042B (en) Cluster deployment method, deployment platform and server to be deployed

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