Detailed Description
A plurality of examples shown in the drawings will be described in detail. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the application. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the examples.
The terms "comprising" and "including" are used in the sense of including but not limited to, including the numbers "above", "within" and "below" and not including the numbers. The term "based on" means based at least in part on a portion thereof.
Fig. 1 is an embodiment of a method for implementing remote data collection, which is applied to a service board of a frame communication device and includes the following steps:
Step 101, creating a remote procedure call task of a service board;
102, when a remote procedure call task arrives at a data acquisition period of a local board, calling a data acquisition function corresponding to a subscription table item of the local board to acquire data to be written;
Step 103, when the data acquisition function acquires data, the remote procedure call task writes the data acquired by the data acquisition function into the subscription table entry of the local board and sets the written identification;
step 104, when the remote process calling task arrives at the remote acquisition period, calling a data reporting function corresponding to the subscription table item of the board;
step 105, the remote procedure call task data call reporting function verifies that the board subscription table entry has been written based on the writing identification of the board subscription table entry;
Step 106, the remote procedure call task data call data reporting function encapsulates the local board identification, the written data of each table entry record of the local board subscription table entry and the indication index of the written data of each table entry record in the remote procedure call protocol message;
step 107, send a remote procedure call protocol message to the collector.
The application has the beneficial effects that the service board directly pushes the collected data to the collector, improves the real-time performance of data collection, realizes distributed collection in frame type communication equipment manufacturers, and reduces the collection time. And the user can identify the collected data according to the service board identification and the indication index of the remote procedure call protocol message, and can freely process the collected data, thereby improving the processing flexibility of the user on the collected data of the frame type communication device.
In the embodiment of fig. 1, the remote procedure call task of the service board may call the device state information (such as CPU and memory states) of the service board, call the physical port state information (such as optical module state and bandwidth utilization of the port), the packet/queue statistics data (such as interface packet loss and packet error statistics, queue packet loss statistics, and queue buffer resource occupation state) of the port, and the table entry/resource data (such as usage conditions of forwarding table entry resources, ACL flow table resources, and virtual interface resources) of the exchange chip. The method comprises the steps of configuring a collector, configuring a collection period, configuring subscription table items, calling corresponding data collection parameters by a bottom layer driving data acquisition module of the service board through executing a remote procedure call task, writing the data into the corresponding subscription table items, and then sending the written subscription table items to the collector through a remote procedure call protocol message when the collection period arrives.
The data collected by each service board of the frame type equipment is independently sent to the collector, the data is sent to the collector through a distributed data sending mechanism, the collected data is not required to be concentrated in the frame type communication equipment through IPC communication, the CPU burden of each service board is lightened, the data collection efficiency is improved, a client can also count the data of a certain service board or a plurality of service boards or the whole frame according to the collected data sent by each service board independently, and the statistic mode is more flexible.
Fig. 2 is a flowchart of an embodiment of collecting port packet loss data by a service board according to the present application;
Step 201, traversing each service module of the board;
The service board receives a remote acquisition period configured by the main control board, an indication index, an operation action of adding a subscription table item, a configured port packet loss number subscription table item, a port overrun subscription table item, a port queue packet loss number subscription table item and a port queue overrun subscription table item, and triggers a remote procedure call process.
The bottom layer driving data acquisition module of the service board starts a remote procedure call task, a timer is set according to a remote acquisition period, when the timer arrives, the remote procedure call task of the service board calls a data reporting function of the written subscription table item, a remote procedure call protocol message is sent to the acquisition device, and acquired data is pushed to the acquisition device.
Therefore, before the timer arrives, the data to be collected needs to be written into the four subscription table entries. Thus, the plate data acquisition period is a time interval different from the remote acquisition period, and the remote procedure call task starts traversing each business Module (MOD) of the plate when the plate data acquisition period arrives.
Step 202, traversing each port of the board;
the remote procedure call task traverses the physical ports on each switch chip on the board.
Step 203, obtaining a virtual output queue identifier corresponding to the service module identifier and the port identifier;
in the frame communication device, an identification MOD ID of each service module and an identification Port ID of one physical Port on the service board correspond to a VOQ (Virtual Output Queue ) index. By traversing each service module and each physical Port, the VOQ index on the service board can be obtained according to the identifier MOD ID and the physical Port ID of the service module obtained by traversing.
Step 204, polling whether the corresponding multiple queues of the virtual output queue identification have packet loss numbers and overrun numbers, if not, executing step 205, if so, executing step 206;
the multiple virtual queues (e.g., 8 virtual queues) of each physical port to which each VOQ index points are polled to obtain whether each virtual queue has a packet loss number or an overrun number (number of times virtual queue bandwidth is exceeded).
Step 205, not setting the subscription table item;
When the multiple virtual queues pointed by the VOQ index of the remote procedure call task poll have no packet loss number or overrun number, the data of the four subscription table items do not need to be written, and the four subscription table items are not set.
In the application, when the data needing to be collected is not written into each subscription table entry, the writing state of each subscription table entry keeps the initial value, so that the remote procedure call task can confirm whether the subscription table entry writes the data needing to be collected or not by checking whether the writing state of each subscription table entry is set or not.
If the remote procedure call task determines that any subscription table item is not written in through verification, the data uploading parameters of the subscription table item do not need to be called, the transmission of empty acquisition data to the acquisition device is avoided, and the bandwidth occupied by useless remote procedure call protocol messages and the processing resources of the acquisition device are avoided.
Step 206, writing the data into the corresponding subscription table item;
When one or more virtual queues pointed by the task polling VOQ index have packet loss numbers or overrun numbers, the remote procedure call task is used for writing the port identification, the queue identification and the packet loss numbers into the port queue packet loss number subscription table entry and setting the port identification, the queue identification and the overrun numbers into the port queue overrun subscription table entry and setting the port identification, the queue identification and the overrun numbers.
And counting the packet loss number of a plurality of virtual queues pointed by the VOQ index by the remote procedure call task, calculating the packet loss number of the port of the local board corresponding to the VOQ index, writing the port identification and the packet loss number into a port packet loss number subscription table entry, and setting.
And counting packet loss numbers of a plurality of virtual queues pointed by the VOQ index by the remote procedure call task, calculating the packet loss number of the port of the local plate corresponding to the VOQ index, writing the port identification and the overrun number into the port overrun subscription table entry, and setting.
Based on the embodiment shown in fig. 2, the remote procedure call task has completed writing the collected data into the port packet loss number subscription table entry, the port overrun subscription table entry, the port queue packet loss number subscription table entry, and the port queue overrun subscription table entry.
When the timer of the remote acquisition period arrives, the remote procedure call task verifies that the port packet loss number subscription table entry is set, calls a data reporting function corresponding to the port packet loss number subscription table entry, and encapsulates the local plate identifier of the service plate, the port identifier and the packet loss number recorded by each table entry of the port packet loss number subscription table entry and the indication index thereof in the remote procedure call protocol message. For example, the three entries of the port packet loss number subscription table entry record the packet loss numbers of the three ports respectively, and the local board identifier of the service board, the port identifier and the packet loss number recorded in the table entry 1 and the indication index 1, the port identifier and the packet loss number recorded in the table entry 2 and the indication index 2, and the port identifier and the packet loss number recorded in the table entry 3 and the indication index 3 are encapsulated in the remote procedure call protocol message. Therefore, the method not only can support one-time uploading of multiple groups of data, but also can enable a user to select the number of packet loss of the port to be counted according to the counting requirement, so that the following data counting is more flexible.
The remote procedure call task verifies that the port overrun subscription table entry is set, and calls a data reporting function of the port overrun subscription table entry to encapsulate the service board identifier, the port identifier and the overrun number of each table entry record of the port overrun subscription table entry and the indication index of the port overrun subscription table entry in the remote procedure call protocol message. For example, 2 entries of the port overrun subscription entries record overrun numbers of 2 ports respectively, the local board identifier of the service board, the port identifier and overrun number recorded in the entry 1 and the indication index 1 are packaged in a remote procedure call protocol message, and the port identifier and overrun number recorded in the entry 2 and the indication index 2 are packaged in the remote procedure call protocol message.
The remote procedure call task verifies that the queue packet loss number subscription table entry is set, and calls a data reporting function corresponding to the queue packet loss number subscription table entry to package the service board identifier, the port identifier, the queue identifier and the packet loss number of each table entry record and the indication index thereof in a remote procedure call protocol message. For example, 2 entries of the port overrun subscription entries record packet loss numbers of virtual queues queue1 and queue8 of port1 respectively, a local board identifier of a service board, a port1 identifier recorded by the entry 1, a virtual queue identifier queue1 and a packet loss number indication index 1 are packaged in a remote procedure call protocol message, and a port1 identifier, a virtual queue identifier queue8 and a packet loss number indication index 2 recorded by the entry 2 are packaged in the remote procedure call protocol message.
And the remote procedure call task verifies that the queue overrun subscription table entry is set, calls a data reporting function corresponding to the queue overrun subscription table entry, and encapsulates the service board identifier, the port identifier, the queue identifier and the overrun number of each table entry record and the indication index of the service board identifier, the queue identifier and the overrun number in the remote procedure call protocol message. For example, 2 entries of the port overrun subscription table entry record overrun numbers of virtual queues queue1 and queue8 of port1 respectively, a service board identifier, a port1 identifier recorded by the table entry 1, a virtual queue identifier queue1 and a packet loss number indication index 1, and a port1 identifier recorded by the table entry 2, a virtual queue identifier queue8 and a packet loss number indication index 2 are packaged in a remote procedure call protocol message.
The application adopts a service board distributed reporting mode to upload the acquired data to the collector, and each service board is independently processed, so that the CPU occupancy rate of the process on the main control board is not influenced, the performance bottleneck is reduced, a user can flexibly select the statistical object and the statistical direction from the acquired data reported by each service board, and the flexibility of data statistics is improved for the user.
Fig. 3 is a schematic diagram of an embodiment of the present remote data acquisition device provided by the present application. The 30 equipment is applied as a service board of frame type communication equipment, and the service board comprises a plurality of ports, a switching unit, a processor and a memory, wherein the bottom layer driving data acquisition module of the switching unit which can be used as a switching chip is used for executing the following operations;
Newly-built remote procedure call tasks; when the remote procedure call task arrives at the remote acquisition period, the data reporting function corresponding to the plate subscription table item is called, the data reporting function verifies that the plate subscription table item is written based on the writing identification of the plate subscription table item, and encapsulates the plate identification, the written data recorded by each table item of the plate subscription table item and the indication index of the written data recorded by each table item in a remote procedure call protocol message based on the collector network address.
When the remote procedure call task executed by the bottom driving data acquisition module arrives in the remote acquisition period, the data reporting function corresponding to the plate subscription table item is called, and the data reporting function verifies that the plate subscription table item is not written based on the unwritten identification of the plate subscription table item, and waits for the next remote acquisition period.
The processor executes processor executable instructions in the memory for performing operations including receiving a remote acquisition period configured by the main control board, receiving an indication index configured by the main control board, receiving an operation action to add a subscription table configured by the main control board, receiving a local board subscription table configured by the main control board, synchronously creating a remote procedure call task remote acquisition period, an indication index, an operation action to add a subscription table, and a local board subscription table to the bottom drive data.
The plate subscription table item is a port packet loss number subscription table item, a port overrun subscription table item, a port queue packet loss number subscription table item and a port queue overrun subscription table item.
The method comprises the steps of traversing each local board service module and each local board port, identifying a virtual output queue index based on an identification of each local board service module and an ID of each local board port, polling whether a plurality of queues pointed by each virtual output queue index have packet loss and overrun, if yes, counting the packet loss and overrun of the corresponding local board ports of each virtual output queue index based on the packet loss and overrun of the corresponding local board ports of each virtual output queue index, writing the port identification and the packet loss of the corresponding local board ports of each virtual output queue index into the port packet loss subscription table entry, writing the port identification and the overrun of the corresponding local board ports of each virtual output queue index into the port packet loss subscription table entry, and writing the port identification and the overrun of the corresponding virtual output queue index into the port packet loss subscription table entry, and writing the port identification and the port identification of the overrun of the corresponding virtual output queue of each virtual output queue index.
The method comprises the steps of enabling a remote procedure call task to call a data reporting function corresponding to a port packet loss number subscription table item, enabling a local board identifier of a service board, a port identifier and a packet loss number of each table item record of the port packet loss number subscription table item and an indication index of the port packet loss number subscription table item to be packaged in a remote procedure call protocol message, enabling the remote procedure call task to call the data reporting function corresponding to the port overrun subscription table item, enabling the local board identifier of the service board, the port identifier and the overrun number of each table item record of the port overrun subscription table item and the indication index of the port overrun subscription table item to be packaged in the remote procedure call protocol message, enabling the local board identifier of the service board, the port identifier and the port identifier of each table item record of the port packet loss number subscription table item and the indication index of the port packet loss number subscription table item to be packaged in the remote procedure call protocol message, and enabling the remote procedure call task to call the data reporting function corresponding to call the port identifier of the port overrun subscription table item, and the port identifier and the overrun number of each table item record of the port overrun subscription table item and the indication index of the port overrun subscription table item to be packaged in the remote procedure call protocol message.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.