CN112714021A - Method and device for obtaining flow statistical result in optical transport network based on packet network - Google Patents

Method and device for obtaining flow statistical result in optical transport network based on packet network Download PDF

Info

Publication number
CN112714021A
CN112714021A CN202011592791.3A CN202011592791A CN112714021A CN 112714021 A CN112714021 A CN 112714021A CN 202011592791 A CN202011592791 A CN 202011592791A CN 112714021 A CN112714021 A CN 112714021A
Authority
CN
China
Prior art keywords
statistical result
matching
data stream
handle list
list
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
CN202011592791.3A
Other languages
Chinese (zh)
Other versions
CN112714021B (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.)
Gw Delight Technology Co ltd
Beijing Gw Technologies Co ltd
Original Assignee
Gw Delight Technology Co ltd
Beijing Gw Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gw Delight Technology Co ltd, Beijing Gw Technologies Co ltd filed Critical Gw Delight Technology Co ltd
Priority to CN202011592791.3A priority Critical patent/CN112714021B/en
Publication of CN112714021A publication Critical patent/CN112714021A/en
Application granted granted Critical
Publication of CN112714021B publication Critical patent/CN112714021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate

Abstract

The application provides a method and a device for acquiring flow statistical results in an optical transport network based on a packet network. The method comprises the following steps: acquiring a matching table entry of the configured matching data stream; if the corresponding relation between the port identification and the data stream matching item in the matching list item is determined, a first handle list corresponding to the port identification is determined on a tester by calling a first function, and a first statistical result corresponding to the data stream is matched in the determined first handle list by using the data stream matching item and is output; the first handle list is used for storing a statistical result of the port receiving data flow. The method can simply, conveniently and efficiently obtain the expected statistical result.

Description

Method and device for obtaining flow statistical result in optical transport network based on packet network
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a method and an apparatus for obtaining a flow statistic result in an optical transport network based on a packet network.
Background
At present, the flow statistical result processing is respectively processed in each module, the flow statistical conditions encountered by the module are summarized in each module, the conditions with the same offset and the same matching field value are written into a function, and different functions are used for processing different offsets and different numbers of matching fields and matching field values. One module will have multiple flow statistical processing functions. This results in the need to add several stream processing functions each time we add a module, and if we modify or add the module's flow, we also need to modify our flow statistics function synchronously.
In the process of implementing the present application, the inventors found that the above processing method has high complexity and low efficiency in obtaining the stream statistics result.
Disclosure of Invention
In view of the above, the present application provides a method and an apparatus for obtaining a flow statistic result in a packet network or an optical transport network, which can simply, conveniently and efficiently obtain a desired statistic result.
In order to solve the technical problem, the technical scheme of the application is realized as follows:
in one embodiment, a method for obtaining flow statistics in a packet network-based optical transport network is provided, the method comprising:
acquiring a matching table entry of the configured matching data stream;
if the corresponding relation between the port identification and the data stream matching item in the matching list item is determined, a first handle list corresponding to the port identification is determined on a tester by calling a first function, and a first statistical result corresponding to the data stream is matched in the determined first handle list by using the data stream matching item and is output;
the first handle list is used for storing a statistical result of the port receiving data flow.
In another embodiment, there is provided an apparatus for obtaining statistical results in a packet network-based optical transport network, the apparatus including: the device comprises an acquisition unit, a determination unit, a calling unit and an output unit;
the acquiring unit is used for acquiring the configured matching table entry of the matching data stream;
the determining unit is configured to determine the content of the matching entry acquired by the acquiring unit;
the calling unit is configured to, if the determining unit determines that the matching entry includes a corresponding relationship between a port identifier and a data stream matching item, determine a first handle list corresponding to the port identifier on a tester by calling a first function, and match a first statistical result corresponding to a data stream in the determined first handle list by using the data stream matching item; the first handle list is used for storing a statistical result of a port receiving data flow;
and the output unit is used for outputting the first statistical result obtained by the calling unit.
In another embodiment, an electronic device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the flow statistics obtaining method when executing the program.
In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor, performs the steps of the flow statistic result acquisition method.
As can be seen from the above technical solution, in the above embodiment, when the configured entry includes the port identifier, the first function is called to obtain the first statistical result from the first handle list on the test, and the first statistical result is output. In the embodiment of the application, the number of the searched data streams, the number of the matching items of a certain data stream and the value of the matching items are not limited, the returned data stream attribute can be added at will, and the method has strong universality, usability and transportability. The scheme can simply, conveniently and efficiently acquire the expected statistical result.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flow chart illustrating a flow statistical result obtaining process in an embodiment of the present application;
FIG. 2 is a schematic diagram of a flow chart for obtaining statistical results of flows in the second embodiment of the present application
FIG. 3 is a schematic diagram of an apparatus for implementing the above technique in an embodiment of the present application;
fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail with specific examples. Several of the following embodiments may be combined with each other and some details of the same or similar concepts or processes may not be repeated in some embodiments.
The embodiment of the application provides a method for acquiring flow statistical results in a packet network and an optical transport network, which is applied to a flow statistical result acquisition device, messages of various types of data flows and protocols can be sent as required when module testing is carried out, the messages can generate changes after passing through a tested system, and whether the changes are correct is judged by verifying the field value of the received data flow, the receiving rate of the data flow and the like. All data stream reception statistical functions need to be written to process the data streams expected to be received, and receive information of the data streams is obtained, such as: l1 rate, number of received frames, number of lost packets, etc.
In the embodiment of the application, the flow statistical results of the data flows of all data types are obtained through two functions; the two functions have good expansibility and portability. Any data stream matching the field and field value can be looked up and also looked up according to the name of the data stream, and the actual value of a certain field of the return receiving stream can also be specified. The attribute of the sending and receiving result information of the returned data stream can be added at will, so that the method has good expansibility. The function is not dependent on specific transceiving value matching, so that the function is suitable for all flow result analysis, and all module flow analysis can use the function.
When the method is realized, the two functions can be called a first function and a second function;
wherein the function of the first function is: matching the data stream according to the field of the data stream to obtain a corresponding statistical result, and returning the field value of the field;
such as may be: STC _ classificationsisttics function, but is not limited to the implementation of this function.
The function of the second function is: acquiring a flow statistic result of the data flow according to the flow identification;
such as may be: the STC _ detailedstearstatlnformation function, but is not limited to implementation of the function.
The flow statistics obtaining process in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
Example one
Referring to fig. 1, fig. 1 is a schematic view illustrating a flow statistical result obtaining process in an embodiment of the present application. The method comprises the following specific steps:
step 101, obtaining a matching entry of the configured matching data stream.
After the matching entry is obtained, the content included in the matching entry needs to be determined, and if it is determined that the matching entry includes the corresponding relationship between the port identifier and the data stream matching entry, step 102 is executed.
Step 102, if it is determined that the matching table entry includes a corresponding relationship between a port identifier and a data stream matching item, determining a first handle list corresponding to the port identifier on a tester by calling a first function, and matching a first statistical result corresponding to a data stream in the determined first handle list by using the data stream matching item.
The first handle list is used for storing a statistical result of the port receiving data flow.
In an interface of a tester, analysis flow statistics results are port-based, a statistics result of each port can exist in one analyzer result handle, and the situation of receiving flows of how many ports need to be counted is not fixed, so that a first statistics result corresponding to a data flow needs to be obtained through a receiving port statistics result handle list, which is referred to as a first handle list.
The data flow matching item in the matching table entry may include one or any combination of the following:
source MAC address, VLAN ID, ethernet class type.
In a specific implementation, the setting of the data stream matching item is not limited, and the relevant setting may be performed according to a specific application.
During specific implementation, the matching of the data stream matching item to the first statistical result corresponding to the data stream in the determined first handle list includes:
traversing the data stream in the first handle list;
for the data stream matched with all the matching items, acquiring a statistical result corresponding to the data stream;
and if the matching item with the matching value of the none exists, acquiring a first statistical result of the data stream matched with the matching items except the matching item corresponding to the none.
For each matching value corresponding to each data stream matching entry in the matching entries, if the matching value corresponding to one of the matching entries is: MAC address 1, VLAN1, the flow to be matched needs to meet the two conditions that the source MAC address is MAC address 1 and the VLAN ID is VLAN 1;
in a specific implementation, the matching value of the matching entry may also be set to none, and for example, the content corresponding to one of the matching entries is: if the source MAC address is MAC address 1 and the VLAN ID is none, the matched stream needs to satisfy the condition that the source MAC address is MAC address 1.
If the matching value corresponding to the none does not exist in the matching item, directly outputting a first statistical result corresponding to the matched data stream;
and if the matching value corresponding to the none exists in the matching items, when the first statistical result is obtained, obtaining the matching value corresponding to the matching item corresponding to the none in the first handle list, and when the first statistical result corresponding to the matched data stream is output, outputting the obtained matching value.
If the corresponding first statistical result is obtained for the MAC address 1 and the VLAN1, outputting: MAC address 1, VLAN1, first statistic result 1;
if the corresponding first statistical result is obtained for the MAC address 1 and the none (VLAN), if the MAC address 1 corresponds to the VLAN1 and the VLAN2, the output statistical result is:
MAC address 1, VLAN1, first statistic result 2;
MAC address 1, VLAN2, first statistic result 3.
The first statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet loss percentage.
The statistical result is an example, and in the concrete implementation, the statistical result to be output can be set according to actual needs, and the statistical result can be expanded.
Obtaining the mark of the statistical result of whether the instrument is emptied after the statistical result is obtained:
the statistics of the meter is generally cleared in order to prevent the influence on the next statistical result after the first statistical result is obtained, but sometimes the statistics in the test process needs to be obtained, and the total packet loss statistics needs to be carried out for a long time or after abnormal tests, and the statistical result of the meter cannot be cleared at this time. Therefore, a parameter is needed to identify whether statistical information is emptied after statistics, and the statistical information needs to be cleared in general, so that the parameter is set as an optional parameter and the default value is clear. The concrete implementation is as follows:
if the processing flag set for the statistical result is clear, clearing the first handle list after the first statistical result is obtained; otherwise, the content in the first handle list is kept.
And when the corresponding data stream is not matched in the first handle list, assigning a specified value to the corresponding statistical result and outputting the specified value, so as to prevent errors caused by the fact that the statistical result of a certain expected data stream is not obtained.
And step 103, outputting the obtained first statistical result.
A specific example is given below to describe in detail a specific implementation of obtaining the first statistical result by the first function:
the first function: matching the data stream according to the field of the data stream to obtain a corresponding statistical result, and returning the field value of the field;
such as may be: STC _ classificationsisttics function.
Inputting parameters: lFilterName: matching table entries of the matching data stream, including the corresponding relation between the port identification and the matching entries;
dFilter: matching value of matching item, matching item (key) must contain value of hAna \
Examples are: { $ hAna-f1{ 10002: 00:00:00: 0101000015 } \\
$hAna-f2{200 02:00:00:00:00:02 0102 0016}\
$hAna-f3{300 02:00:00:00:00:01 0100 0015}}
If there is a none value in the value of the match value of dFilter, then this value is not used for matching but the value #is derived from the matching stream
lHAna: port analyzer handle
# lHAnaResult: receive statistics after port push analyzer matching
# ifClear: whether the empty classification statistic is 1 empty (default configuration) and 0 not empty
# return value: flag: "0" means no filter _ err. "1" indicates that there is filter _ err
Output parameter # output: dResult { $ hAna-f1{ frameCnt 30L1 BitRNAte 0getValue { { holdTime (hex) } { 000 f } } }
#$hAna-f2{frameCnt 10L1BitRate 0getValue{{holdTime(hex)}{002d}}}}
# where getValue is the matching value for the matching entry from the match result when the matching value in dFilter is none
The function call is: proc STC _ classificationsististiciscs function.
In the embodiment of the application, when the configured entry includes the port identifier, a first function is called to obtain a first statistical result from a first handle list on a test, and the first statistical result is output. In the embodiment of the application, the number of the searched data streams, the number of the matching items of a certain data stream and the value of the matching items are not limited, the returned data stream attribute can be added at will, and the method has strong universality, usability and transportability. The scheme can simply, conveniently and efficiently acquire the expected statistical result.
Example two
Referring to fig. 2, fig. 2 is a schematic view of a flow statistical result obtaining process in the second embodiment of the present application. The method comprises the following specific steps:
step 201, obtaining a matching entry of the configured matching data stream.
After the matching entry is obtained, the content included in the matching entry needs to be determined, and if it is determined that the matching entry includes the corresponding relationship between the port identifier and the data stream matching entry, step 202 is executed; if it is determined that the matching representation includes the data stream identification, step 204 is performed.
Step 202, if it is determined that the matching table entry includes a corresponding relationship between a port identifier and a data stream matching item, determining a first handle list corresponding to the port identifier on a tester by calling a first function, and matching a first statistical result corresponding to a data stream in the determined first handle list by using the data stream matching item.
The first handle list is used for storing a statistical result of the port receiving data flow.
In an interface of a tester, analysis flow statistics results are port-based, a statistics result of each port can exist in one analyzer result handle, and the situation of receiving flows of how many ports need to be counted is not fixed, so that a first statistics result corresponding to a data flow needs to be obtained through a receiving port statistics result handle list, which is referred to as a first handle list.
The data flow matching item in the matching table entry may include one or any combination of the following:
source MAC address, VLAN ID, ethernet class type.
In a specific implementation, the setting of the data stream matching item is not limited, and the relevant setting may be performed according to a specific application.
During specific implementation, the matching of the data stream matching item to the first statistical result corresponding to the data stream in the determined first handle list includes:
traversing the data stream in the first handle list;
for the data stream matched with all the matching items, acquiring a statistical result corresponding to the data stream;
and if the matching item with the matching value of the none exists, acquiring a first statistical result of the data stream matched with the matching items except the matching item corresponding to the none.
For each matching value corresponding to each data stream matching entry in the matching entries, if the matching value corresponding to one of the matching entries is: MAC address 1, VLAN1, the flow to be matched needs to meet the two conditions that the source MAC address is MAC address 1 and the VLAN ID is VLAN 1;
in a specific implementation, the matching value of the matching entry may also be set to none, and for example, the content corresponding to one of the matching entries is: if the source MAC address is MAC address 1 and the VLAN ID is none, the matched stream needs to satisfy the condition that the source MAC address is MAC address 1.
If the matching value corresponding to the none does not exist in the matching item, directly outputting a first statistical result corresponding to the matched data stream;
and if the matching value corresponding to the none exists in the matching items, when the first statistical result is obtained, obtaining the matching value corresponding to the matching item corresponding to the none in the first handle list, and when the first statistical result corresponding to the matched data stream is output, outputting the obtained matching value.
If the corresponding first statistical result is obtained for the MAC address 1 and the VLAN1, outputting: MAC address 1, VLAN1, first statistic result 1;
if the corresponding first statistical result is obtained for the MAC address 1 and the none (VLAN), if the MAC address 1 corresponds to the VLAN1 and the VLAN2, the output statistical result is:
MAC address 1, VLAN1, first statistic result 2;
MAC address 1, VLAN2, first statistic result 3.
The first statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet loss percentage.
The statistical result is an example, and in the concrete implementation, the statistical result to be output can be set according to actual needs, and the statistical result can be expanded.
Obtaining the mark of the statistical result of whether the instrument is emptied after the statistical result is obtained:
the statistics of the meter is generally cleared in order to prevent the influence on the next statistical result after the first statistical result is obtained, but sometimes the statistics in the test process needs to be obtained, and the total packet loss statistics needs to be carried out for a long time or after abnormal tests, and the statistical result of the meter cannot be cleared at this time. Therefore, a parameter is needed to identify whether statistical information is emptied after statistics, and the statistical information needs to be cleared in general, so that the parameter is set as an optional parameter and the default value is clear. The concrete implementation is as follows:
if the processing flag set for the statistical result is clear, clearing the first handle list after the first statistical result is obtained; otherwise, the content in the first handle list is kept.
And when the corresponding data stream is not matched in the first handle list, assigning a specified value to the corresponding statistical result and outputting the specified value, so as to prevent errors caused by the fact that the statistical result of a certain expected data stream is not obtained.
And step 203, outputting the obtained first statistical result. The flow is ended.
Step 204, if it is determined that the matching table entry includes the data flow identifier, a second statistical result corresponding to the data flow identifier in the second handle list and a third statistical result corresponding to the data flow identifier in the third handle list are obtained on the tester by calling a second function.
The second handle list is used for storing a corresponding second statistical result by taking the stream identifier as an index; and the third handle list is used for storing a third statistical result corresponding to the stream receiving by taking the stream identifier as an index.
Since the data stream is not able to count the sending information of the data stream according to the matching item in the tester interface, when we need the sending information of the data stream (such as sending rate, sending number, etc.) and do not care whether the specific field value of the received data stream meets our expectation, i need to obtain the flow statistic result according to the flow identifier, where the flow identifier may be a flow name or a flow ID.
When the corresponding data stream is not matched in the second handle list or the third handle list, assigning a specified value to the corresponding statistical result, and outputting the specified value; prevent errors caused by failure to obtain statistics of a certain expected data stream.
The second statistical result comprises one or a combination of the following parameters:
sending rate and sending number;
the second statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet loss percentage.
The statistical result is an example, and in the concrete implementation, the statistical result to be output can be set according to actual needs, and the statistical result can be expanded.
Obtaining the mark of the statistical result of whether the instrument is emptied after the statistical result is obtained:
after the second statistical result or the third statistical result is obtained, statistics of the meter is generally cleared in order to prevent the influence on the next statistical result, but sometimes statistics in the test process need to be obtained, and total packet loss statistics needs to be carried out for a long time or after abnormal tests, and the statistical result of the meter cannot be cleared. Therefore, a parameter is needed to identify whether statistical information is emptied after statistics, and the statistical information needs to be cleared in general, so that the parameter is set as an optional parameter and the default value is clear. The concrete implementation is as follows:
if the processing flag set for the first statistical result is clear, clearing the first handle list after the first statistical result is obtained; otherwise, the content in the first handle list is kept.
If the processing flag set for the second statistical result is clear, clearing the second handle list after the second statistical result is obtained; otherwise, the content in the second handle list is kept.
If the processing flag set for the third statistical result is clear, clearing the third handle list after the third statistical result is obtained; otherwise, the content in the third handle list is kept.
And the set processing mark is used as an input parameter of the calling function, and after the calling function obtains the statistical result, the handle list is correspondingly processed according to the processing mark.
And when the corresponding data stream is not matched in the second handle list and the third handle list, assigning a specified value to the corresponding statistical result and outputting the specified value, so that errors caused by the fact that the statistical result of a certain expected data stream is not obtained are prevented.
And step 205, outputting the second statistical result and the third statistical result.
A specific example is given below to illustrate in detail the specific implementation of obtaining the second statistical result and the third statistical result on the tester through the second function:
function of the second function: obtaining a statistical result of the corresponding data stream according to the stream identification of the data stream;
# input parameters: lStreamName: matching list items of the data flow needing the statistical result, wherein the matching list items comprise flow identifications;
# resultDataSetTx: sending of data streams specifies statistical results txstreamresults
# resultDataSetRx: reception of a data stream specifies a statistical result rxstreamummaryresults
# return value: flag: "0" indicates that the acquisition was successful. "1" indicates acquisition failure
Output parameter # output: dResult { streamName1{ txFramecnt 1000rxFramecnt 1000l1BitRa 100frameRate \
10droppedFrameCount 0droppedFramePercent 0streamId 0}\streamName2{txFrameCnt 1000rxFrameCnt 1000l1BitRate 100frameRate 10\droppedFrameCount 0droppedFramePercent 0streamId 0}}
The function call is: proc STC _ detailedStreamStatiticalinformation function.
In the embodiment of the application, when the configured entry includes the port identifier, a first function is called to obtain a first statistical result from a first handle list on a test, and when the configured entry includes the stream identifier of the data stream, a second function is called to obtain a second statistical result and a third statistical result from a second handle list and a third handle list respectively, and the second statistical result and the third statistical result are output. In the embodiment of the application, the number of the searched data streams, the number of the matching items of a certain data stream and the value of the matching items are not limited, the returned data stream attribute can be added at will, and the method has strong universality, usability and transportability. The scheme can simply, conveniently and efficiently acquire the expected statistical result.
EXAMPLE III
The following example illustrates the invocation of different functions for different contents in the matching entry:
1. and obtaining a statistical result according to the field matching item of the data stream, and returning the matching value of the matching item. Matching items are Ids of a source mac address, Tpid and vlan in sequence;
acquisition is required for port 1:
(1) the source mac address is 0000.0000.0001, Tpid is 8100, and vlan is 100;
(2) the source mac address is 0000.0000.0002, Tpid is none, and vlan is 200;
acquisition is required for port 2:
the source mac address is 0000.0000.0003, Tpid is none, vlan is 300;
if the expected value of a certain item is none, the item is indicated to be a matching value in the actual flow statistical result, and the function is required to return the matching value.
The method comprises the following steps:
(1) setting entry parameters
set lFilterName{{Source MAC}{Tpid(hex)}{vlanId(hex)}}
dict set dFilter$hGPNPort1Ana-f1{00:00:00:00:00:01{81 00}{00 64}}
dict set dFilter$hGPNPort1Ana-f2{00:00:00:00:00:02{none}{00 C8}}
dict set dFilter$hGPNPort2Ana-f1{00:00:00:00:00:03{none}{01 2C}}
set lHAna "$ hgnport 1Ana $ hgnport 2 Ana"; # Analyzer handle
set lHAnaResult "resultDataSet 1 resultDataSet 2"; # Analyzer results handle
(2) Calling a first function:
in the statistical function, the statistical results, such as the L1 rate and the receiving number, of the data stream with the source mac address of 00:00:00:00:00:01tpid of 8100vlan of 100 are obtained (1) under port 1. (2) The statistics of the data stream with source mac address 00:00:00:00:00:02vlan 200 are also obtained under port1, and the actual value of data stream tpid is put into the output statistics.
The statistics for the data flow with mac address 00:00:00:00:00:03vlan 300 are obtained under port2 and the actual value of tpid is put into the output statistics.
(3) Function output value:
dResult{$hGPNPort1Ana-f1{frameCnt 30L1BitRate 0}$hGPNPort1Ana-f2{frameCnt 10L1BitRate 0getValue{{Tpid(hex)}{91 00}}}$hGPNPort2Ana–f1{frameCnt 500L1BitRate 1000getValue{{Tpid(hex)}{88a8}}}}
returning to the explanation: the number of data streams which receive the source mac address of 00:00:00:00:00:01tpid of 8100vlan of 100 and the rate of L1 layer of 0 are 30 in port 1; the number of data streams received with the source mac address of 00:00:00:02vlan of 200 is 10, the L1 layer rate is 0, and the measured value of tpid of the data stream is 9100; port2 receives the actual value of tpid 88a8, which is 500 data streams with source mac address 00:00:00:00:00:03vlan 300, L1 level rate 1000, and data streams.
2. Acquiring the transceiving condition of each data stream according to the stream identification of the data stream:
and acquiring the transceiving results of the data streams with stream identifiers of streamName1 and streamName 2.
(1) Setting entry parameters
set lStreamName“streamName1 streamName2”。
(2) Calling a statistical function:
and traversing the statistical results of all data streams obtained by the tester according to the stream statistics in the statistical function to find the statistical results of the data streams with the names streamName1 and streamName 2.
(3) Output value of data stream:
dResult{streamName1{txFrameCnt 1000rxFrameCnt 1000l1BitRate 100frameRate\10droppedFrameCount 0droppedFramePercent 0streamId16122}\streamName2{txFrameCnt 2000rxFrameCnt 1500l1BitRate 200frameRate20\droppedFrameCount 0droppedFramePercent 0streamId 0}}。
returning to the explanation: the number of transmitted packets of the data stream with the streamName1 is 1000, the number of received packets is 1000, the L1 layer rate is 100, the frame rate is 10, the number of packet losses is 0, the packet loss percentage is 0, and the stream identifier of the data stream is 16122.
The number of transmitted packets of the data stream with the streamName2 is 2000, the number of received packets is 1500, the rate of L1 layer is 200, the frame rate is 20, the number of dropped packets is 500, the percentage of dropped packets is 25, and the stream identifier of the data stream is 16123.
Based on the same inventive concept, the embodiment of the present application further provides a device for obtaining the flow statistical result in the packet network and the optical transport network. Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus applied to the above technology in the embodiment of the present application. The device comprises: an acquisition unit 301, a determination unit 302, a calling unit 303 and an output unit 304;
an obtaining unit 301, configured to obtain a matching entry of a configured matching data stream;
a determining unit 302, configured to determine the content of the matching entry acquired by the acquiring unit 301;
a calling unit 303, configured to, if the determining unit 302 determines that the matching entry includes a corresponding relationship between a port identifier and a data stream matching item, determine, on a tester, a first handle list corresponding to the port identifier by calling a first function, and match, in the determined first handle list, a first statistical result corresponding to a data stream using the data stream matching item; the first handle list is used for storing a statistical result of a port receiving data flow;
an output unit 304, configured to output the first statistical result obtained by the invoking unit 303.
Preferably, the first and second electrodes are formed of a metal,
the invoking unit 303 is specifically configured to traverse the data stream in the first handle list when the first statistical result corresponding to the data stream is matched in the determined first handle list by using the data stream matching item; for the data stream matched with all the matching items, acquiring a statistical result corresponding to the data stream; and if the matching item with the matching value of the none exists, acquiring a first statistical result of the data stream matched with the matching items except the matching item corresponding to the none.
Preferably, the first and second electrodes are formed of a metal,
the invoking unit 303 is further configured to, when a statistical result of a data stream that matches all matching items except the matching item corresponding to the none is obtained, obtain a matching value of the matching item corresponding to the none in the first handle list;
the output unit 304 is further configured to output the obtained matching value when the first statistical result is output.
Preferably, the first and second electrodes are formed of a metal,
the calling unit 303 is further configured to, if the determining unit 302 determines that the matching entry includes the data flow identifier, obtain, on the tester, a second statistical result corresponding to the data flow identifier in the second handle list and a third statistical result corresponding to the data flow identifier in the third handle list by calling a second function; the second handle list is used for storing a corresponding second statistical result by taking the stream identifier as an index; the third handle list is used for storing a third statistical result corresponding to the stream receiving by taking the stream identifier as an index;
the output unit 304 is further configured to output a second statistical result and the third statistical result.
Preferably, the first and second electrodes are formed of a metal,
the first statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet lost percentage;
the second statistical result comprises one or a combination of the following parameters:
sending rate and sending number;
the second statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet loss percentage.
Preferably, the first and second electrodes are formed of a metal,
the calling unit 303 is further configured to assign a specified value to the corresponding statistical result when the corresponding data stream is not matched in the first handle list, the second handle list, or the third handle list;
the output unit 304 is further configured to output the specified value assigned by the calling unit 303.
Preferably, the first and second electrodes are formed of a metal,
the invoking unit 303 is further configured to clear the first handle list after the first statistical result is obtained if the processing flag set for the first statistical result is clear; if the processing flag set for the second statistical result is clear, clearing the second handle list after the second statistical result is obtained; and if the processing flag set for the third statistical result is clear, clearing the third handle list after the third statistical result is obtained.
The units of the above embodiments may be integrated into one body, or may be separately deployed; may be combined into one unit or further divided into a plurality of sub-units.
In another embodiment, an electronic device is further provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method for obtaining flow statistics in a packet-based network and an optical transport network when executing the program.
In another embodiment, a computer readable storage medium is also provided, on which computer instructions are stored, which when executed by a processor, can implement the steps in the method for obtaining flow statistics in a packet-based network and an optical transport network.
Fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 4, the electronic device may include: a Processor (Processor)410, a communication interface (communication interface)420, a Memory (Memory)430 and a communication bus 440, wherein the Processor 410, the communication interface 420 and the Memory 430 are communicated with each other via the communication bus 440. The processor 410 may call logic instructions in the memory 430 to perform the following method:
acquiring a matching table entry of the configured matching data stream;
if the corresponding relation between the port identification and the data stream matching item in the matching list item is determined, a first handle list corresponding to the port identification is determined on a tester by calling a first function, and a first statistical result corresponding to the data stream is matched in the determined first handle list by using the data stream matching item and is output;
the first handle list is used for storing a statistical result of the port receiving data flow.
In addition, the logic instructions in the memory 430 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
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 may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for obtaining flow statistics result in an optical transport network based on a packet network is characterized in that the method comprises the following steps:
acquiring a matching table entry of the configured matching data stream;
if the corresponding relation between the port identification and the data stream matching item in the matching list item is determined, a first handle list corresponding to the port identification is determined on a tester by calling a first function, and a first statistical result corresponding to the data stream is matched in the determined first handle list by using the data stream matching item and is output;
the first handle list is used for storing a statistical result of the port receiving data flow.
2. The method according to claim 1, wherein the matching, using the data flow matching item, to the first statistical result corresponding to the data flow in the determined first handle list comprises:
traversing the data stream in the first handle list;
for the data stream matched with all the matching items, acquiring a statistical result corresponding to the data stream;
and if the matching item with the matching value of the none exists, acquiring a first statistical result of the data stream matched with the matching items except the matching item corresponding to the none.
3. The method according to claim 2, wherein when obtaining the statistical result of the data stream in which the matching items other than the matching item corresponding to the none are all matched, the method further comprises:
acquiring a matching value corresponding to the matching item corresponding to the none in the first handle list;
and outputting the acquired matching value when outputting the first statistical result.
4. The method according to any one of claims 1-3, wherein the method further comprises:
if the matching table entry comprises the data flow identification, acquiring a second statistical result corresponding to the data flow identification in a second handle list and a third statistical result corresponding to the data flow identification in a third handle list on the tester by calling a second function, and outputting the second statistical result and the third statistical result;
the second handle list is used for storing a corresponding second statistical result by taking the stream identifier as an index; and the third handle list is used for storing a third statistical result corresponding to the stream receiving by taking the stream identifier as an index.
5. The method of claim 4,
the first statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet lost percentage;
the second statistical result comprises one or a combination of the following parameters:
sending rate and sending number;
the second statistical result comprises one or any combination of the following parameters:
l1 layer rate, number of received packets, frame rate, number of packet lost, packet loss percentage.
6. The method of claim 4, further comprising:
and when the corresponding data stream is not matched in the first handle list, the second handle list or the third handle list, assigning a specified value to the corresponding statistical result and outputting the specified value.
7. The method of claim 4, further comprising:
if the processing flag set for the first statistical result is clear, clearing the first handle list after the first statistical result is obtained;
if the processing flag set for the second statistical result is clear, clearing the second handle list after the second statistical result is obtained;
and if the processing flag set for the third statistical result is clear, clearing the third handle list after the third statistical result is obtained.
8. An apparatus for obtaining a flow statistic result in a packet network-based optical transport network, the apparatus comprising: the device comprises an acquisition unit, a determination unit, a calling unit and an output unit;
the acquiring unit is used for acquiring the configured matching table entry of the matching data stream;
the determining unit is configured to determine the content of the matching entry acquired by the acquiring unit;
the calling unit is configured to, if the determining unit determines that the matching entry includes a corresponding relationship between a port identifier and a data stream matching item, determine a first handle list corresponding to the port identifier on a tester by calling a first function, and match a first statistical result corresponding to a data stream in the determined first handle list by using the data stream matching item; the first handle list is used for storing a statistical result of a port receiving data flow;
and the output unit is used for outputting the first statistical result obtained by the calling unit.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 7.
CN202011592791.3A 2020-12-29 2020-12-29 Method and device for obtaining flow statistical result in optical transport network based on packet network Active CN112714021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011592791.3A CN112714021B (en) 2020-12-29 2020-12-29 Method and device for obtaining flow statistical result in optical transport network based on packet network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011592791.3A CN112714021B (en) 2020-12-29 2020-12-29 Method and device for obtaining flow statistical result in optical transport network based on packet network

Publications (2)

Publication Number Publication Date
CN112714021A true CN112714021A (en) 2021-04-27
CN112714021B CN112714021B (en) 2023-04-18

Family

ID=75546210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011592791.3A Active CN112714021B (en) 2020-12-29 2020-12-29 Method and device for obtaining flow statistical result in optical transport network based on packet network

Country Status (1)

Country Link
CN (1) CN112714021B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120076153A1 (en) * 2009-04-27 2012-03-29 Lsi Corporation Statistics module for network processors in virtual local area networks
CN105191212A (en) * 2014-03-25 2015-12-23 华为技术有限公司 Data flow statistics collection method, system and apparatus
CN105245412A (en) * 2015-11-20 2016-01-13 上海斐讯数据通信技术有限公司 Port traffic monitoring method, system and network equipment
CN108521351A (en) * 2018-03-21 2018-09-11 东软集团股份有限公司 Session traffic statistical method, processor core, storage medium, electronic equipment
CN110071878A (en) * 2019-04-15 2019-07-30 杭州迪普信息技术有限公司 Message flow statistical method, device, electronic equipment
CN110868360A (en) * 2019-11-19 2020-03-06 深圳市网心科技有限公司 Flow statistical method, electronic device, system and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120076153A1 (en) * 2009-04-27 2012-03-29 Lsi Corporation Statistics module for network processors in virtual local area networks
CN105191212A (en) * 2014-03-25 2015-12-23 华为技术有限公司 Data flow statistics collection method, system and apparatus
CN105245412A (en) * 2015-11-20 2016-01-13 上海斐讯数据通信技术有限公司 Port traffic monitoring method, system and network equipment
CN108521351A (en) * 2018-03-21 2018-09-11 东软集团股份有限公司 Session traffic statistical method, processor core, storage medium, electronic equipment
CN110071878A (en) * 2019-04-15 2019-07-30 杭州迪普信息技术有限公司 Message flow statistical method, device, electronic equipment
CN110868360A (en) * 2019-11-19 2020-03-06 深圳市网心科技有限公司 Flow statistical method, electronic device, system and medium

Also Published As

Publication number Publication date
CN112714021B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN105745870B (en) Extend operation from for detecting the serial multistage filter flowed greatly removal nose filter to remove stream to realize
CN109033471B (en) Information asset identification method and device
US9680720B1 (en) Operations, administration, and maintenance (OAM) engine
CN103095475B (en) The method for inspecting and system of multimode communication device
US8203962B2 (en) Network monitoring device, network monitoring method, and network monitoring program
JP2012253735A (en) Method and apparatus for efficient netflow data analysis
US8954578B2 (en) System and method for heuristic determination of network protocols
JP2007336512A (en) Statistical information collecting system, and apparatus thereof
US20130250777A1 (en) Packet descriptor trace indicators
US8005000B1 (en) Effective measurement/notification of SLA in a service oriented networked environment
US20100094994A1 (en) Network structure information acquiring method and device
CN106850568B (en) Session aging method and device of multi-channel protocol
CN110417801B (en) Server side identification method and device, equipment and storage medium
CN106130827B (en) The detection method and device of network equipment accessibility
CN108647043A (en) A kind of realization method and system of order line input
CN111865628A (en) Statistical system, method, server and storage medium for influencing user by home wide fault
CN108234345A (en) A kind of traffic characteristic recognition methods of terminal network application, device and system
EP2530873A1 (en) Method and apparatus for streaming netflow data analysis
US20070043851A1 (en) Facilitating a user to detect desired anomalies in data flows of networks
CN112714021B (en) Method and device for obtaining flow statistical result in optical transport network based on packet network
CN113098852B (en) Log processing method and device
EP1620996B1 (en) Communication path analysis
WO2021027420A1 (en) Method and device used for transmitting data
CN112272192A (en) Domain name blasting method and device, storage medium and electronic equipment
CN112532467B (en) Method, device and system for realizing fault detection

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