Disclosure of Invention
The embodiment of the invention provides a quality of service (Qos) optimization method and device, which are used for solving the technical problem of low Qos optimization accuracy of tunnel data in the prior art.
The embodiment of the invention provides a quality of service (Qos) optimization method, which comprises the following steps:
analyzing a tunnel protocol type corresponding to the tunnel data;
acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data;
and determining a Qos forwarding strategy corresponding to the tunnel data according to the data mark.
Optionally, the analyzing the type of the tunnel protocol corresponding to the tunnel data includes:
analyzing the tunnel header of the tunnel data;
and acquiring the tunneling protocol type corresponding to the tunneling data from the tunneling header.
Optionally, the obtaining, according to the type of the tunneling protocol, a data tag corresponding to the tunneling data includes:
extracting label information capable of representing the user characteristics from the tunnel data according to the tunnel protocol type;
mapping the label information to a data label outside the tunnel data;
and acquiring a data mark for characterizing the user characteristics of the user corresponding to the tunnel data from the data label.
Optionally, the determining, according to the data flag, a Qos forwarding policy corresponding to the tunnel data includes:
determining whether the data tag belongs to a first sub-classification in a first classification;
if not, taking the QoS forwarding strategy corresponding to the first classification as the forwarding strategy corresponding to the tunnel data;
and if so, taking the QoS forwarding strategy corresponding to the first sub-classification as the forwarding strategy corresponding to the tunnel data.
Optionally, the Qos forwarding policy includes any one of:
a discard policy;
a speed limit strategy;
a direct forwarding policy;
and forwarding and caching strategies according to the Qos priority.
An embodiment of the present invention further provides a quality of service Qos optimization apparatus, including:
the analysis unit is used for analyzing the tunnel protocol type corresponding to the tunnel data;
the acquisition unit is used for acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data;
and the determining unit is used for determining a QoS forwarding strategy corresponding to the tunnel data according to the data mark.
Optionally, the analysis unit is configured to:
analyzing the tunnel header of the tunnel data;
and acquiring the tunneling protocol type corresponding to the tunneling data from the tunneling header.
Optionally, the obtaining unit is configured to:
extracting label information capable of representing the user characteristics from the tunnel data according to the tunnel protocol type;
mapping the label information to a data label outside the tunnel data;
and acquiring a data mark for characterizing the user characteristics of the user corresponding to the tunnel data from the data label.
Optionally, the determining unit is configured to:
determining whether the data tag belongs to a first sub-classification in a first classification;
if not, taking the QoS forwarding strategy corresponding to the first classification as the forwarding strategy corresponding to the tunnel data;
and if so, taking the QoS forwarding strategy corresponding to the first sub-classification as the forwarding strategy corresponding to the tunnel data.
Optionally, the Qos forwarding policy includes any one of:
a discard policy;
a speed limit strategy;
a direct forwarding policy;
and forwarding and caching strategies according to the Qos priority.
The embodiment of the invention provides a method and a device for optimizing quality of service (Qos), which analyze a tunnel protocol type corresponding to tunnel data; acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data; and determining a Qos forwarding strategy corresponding to the tunnel data according to the data mark. That is, in the embodiment of the present invention, a Qos forwarding policy of tunnel data is determined according to a data label corresponding to the tunnel data, instead of setting Qos of user data when a tunnel is encapsulated or performing Qos optimization according to different tunnel channels, so that Qos optimization at a user level of the tunnel data is implemented, and Qos optimization granularity and accuracy of the tunnel data on a forwarding device are improved. Therefore, the technical problem that the QoS optimization accuracy of the tunnel data is low in the prior art can be effectively solved, and the technical effect of improving the QoS optimization accuracy of the tunnel data is achieved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
First, a technical term related to an embodiment of the present invention, tunnel technology, is a manner of transmitting data between networks through an internet infrastructure. The data communicated using the tunnel may be data frames or packets of different protocols, the tunnel protocol re-encapsulates these data frames or packets of other protocols for transmission in a new header, the encapsulated data packets are routed between the two endpoints of the tunnel through the public interconnect network, and once the network endpoint is reached, the data will be unpacked and forwarded to the final destination.
Qos, quality of service, refers to the performance of an IP packet or flow passing through a network, and this performance is described by a series of measurable parameters, which are used to provide end-to-end quality of service guarantee and improve the utilization rate of network resources.
Further, it should be understood that the technical solution of the embodiment of the present invention is applied to a transmission link, and performs Qos optimization on various tunnel data passing through a device, that is, user data encapsulating various tunnel protocols, to implement priority-based forwarding of user-level data.
Fig. 1 exemplarily shows a flow diagram of a quality of service Qos optimization method provided by an embodiment of the present invention, as shown in fig. 1, including the following steps:
step 101: analyzing a tunnel protocol type corresponding to the tunnel data;
step 102: acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data;
step 103: and determining a Qos forwarding strategy corresponding to the tunnel data according to the data mark.
In the embodiment of the present invention, step 101 is first executed: and analyzing the tunnel protocol type corresponding to the tunnel data.
In the embodiment of the present invention, the tunneling protocol types include, but are not limited to, the following: CAPWAP (Control and provisioning of Wireless Access Points protocol Specification, Wireless Access Point Control and configuration protocol); l2TP (Layer Two tunneling Protocol); PPTP (point to point Tunneling Protocol); PPPOE (Point to Point Protocol over ethernet); IPSec (Internet peer security, secure IP protocol), etc., or another tunneling protocol type, which is not limited in the embodiments of the present invention.
In the embodiment of the present invention, as to the specific implementation process of step 101, the following steps are specifically included:
analyzing the tunnel header of the tunnel data;
and acquiring the tunneling protocol type corresponding to the tunneling data from the tunneling header.
In the specific implementation process, the tunnel data may be encapsulated with one more packet header than the outside of the normal data packet, the encapsulated more packet header is a tunnel header of the tunnel data, and the tunnel header often includes a new source address (tunnel entry address), a new destination address (tunnel exit address), and some flags and/or variables used by the tunnel protocol.
In the specific implementation process, when the protocol type included in the tunnel header is analyzed to be 50, it indicates that an IPSec message is encapsulated therein, and it can also indicate that the tunnel protocol type of the tunnel data is IPSec; or the protocol type contained in the tunnel header is analyzed to be 47, which indicates that the inside is packaged with a PPTP message, and the tunnel protocol type capable of surfacing tunnel data is PPTP; or when the tunnel header is analyzed to include a UDP (User Datagram Protocol), the CAPWAP communicates through the UDP, the tunnel type of the CAPWAP is indicated according to a port number of the UDP, the port 5246 is a CAPWAP control tunnel, and the port 5247 is a CAPWAP data tunnel, so that it can be determined that the tunnel Protocol type corresponding to the tunnel data is the CAPWAP, or otherwise, which is not illustrated herein.
In the embodiment of the invention, the multiple tunnel protocols can be automatically identified and analyzed, so that the technical scheme has wider applicability and universality.
In the embodiment of the present invention, after the step 101 is executed, the step 102 is executed: acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data tag is used for characterizing user characteristics of a user corresponding to the tunnel data.
In the embodiment of the present invention, the specific implementation process of step 102 specifically includes the following steps:
extracting label information capable of representing the user characteristics from the tunnel data according to the tunnel protocol type;
mapping the label information to a data label outside the tunnel data;
and acquiring a data mark for characterizing the user characteristics of the user corresponding to the tunnel data from the data label.
In the specific implementation process, the methods for extracting the tag information capable of characterizing the user features are different for different tunneling protocols, and the following description is respectively given one by one.
(1) If the tunnel protocol type corresponding to the tunnel data is determined to be the L2TP protocol type, and the tunnel data header contains a SessionID for indicating a session identifier in the tunnel, the SessionID may be used as tag information for identifying the user;
in a specific implementation process, for the L2TP tunnel, the L2TP tunnel works in a multi-channel mode, that is, the L2TP tunnel uses a call as a user data transmission channel for each user independently, and can use SessionID as tag information for identifying the user;
whereas in the case of the L2TP tunnel, where the IPSec protocol is not used, the L2TP tunnel operates in a single channel, i.e. all users transmit using the same call. Then to accommodate this, the tunnel inner layer source IP is extracted as label information identifying the user.
(2) If the tunnel protocol type corresponding to the tunnel data is determined to be the CAPWAP tunnel protocol, the tunnel header of the tunnel data comprises a CAPWAP H, namely a CAPWAP header, which is used for recording relevant information of the CAPWAP protocol, such as: and the IP is used for representing an IP address of a CAPWAP destination device, and the destination AP device or destination AC, UDP, ETH and the like are indicated through the IP, wherein label information which can be used for representing the characteristics of the user does not exist, so that the tunnel inner layer source IP is required to be extracted from a tunnel data field of tunnel data to be used as label information for identifying the user.
(3) If the tunnel protocol type corresponding to the tunnel data is determined to be the PPTP tunnel protocol, a PPP header is added to the PPTP data packet, and a PPP frame is formed by encapsulation. The PPP frame is further added with a GRE header, and a GRE message is formed through second layer encapsulation, and the client protocol of the No. 47 IP protocol is adopted, so that for the PPTP tunnel protocol, the inner layer source IP of the GRE tunnel is extracted as the label information for identifying the user.
(4) And if the tunnel protocol type corresponding to the tunnel data is determined to be the PPPOE tunnel protocol, extracting the Session ID of the tunnel header of the tunnel data as the label information for identifying the user.
(5) And if the tunnel protocol type corresponding to the tunnel data is determined to be the IPIP tunnel protocol, extracting an IPIP tunnel inner layer source IP from a tunnel data field of the tunnel data as label information for identifying the user.
In the embodiment of the invention, after the label information capable of representing the user characteristics is obtained, in order to avoid analyzing the tunnel data message again, the label information is mapped into the data label outside the tunnel data according to the preset rule.
In the embodiment of the present invention, the data tag is a field with a certain data bit length, and is used to indicate an identifier corresponding to tag information of a user. The data bit length may specifically be: 1bit or 2bit, or other bit lengths, which are not specifically limited in the embodiments of the present invention.
In the embodiment of the present invention, the preset rule may specifically be mapping the tag information to a digital identifier, such as: 0. 1, …; or a letter designation, such as: a. b, …; or a combination of numbers and letters, or other mapping rules, which can be selected by one skilled in the art according to practical needs and are not specifically limited in the embodiments of the present invention.
In the embodiment of the invention, as long as the tunnel protocol type corresponding to the tunnel data is identified, the position of the label information which can be used for representing the user characteristics can be found immediately according to the regular mapping relation, and the mapping is completed according to the preset rule, so that the processing time for forwarding the tunnel data can be occupied to the minimum extent.
Furthermore, in the embodiment of the invention, the data markers are extracted by using a mapping mode, so that the operation redundancy in the classification process is not increased, and the data forwarding efficiency is ensured while the data markers are classified.
In the embodiment of the present invention, after the step 102 is executed, the step 103 is executed: and determining a Qos forwarding strategy corresponding to the tunnel data according to the data mark.
In the embodiment of the present invention, the specific implementation process of step 103 specifically includes the following steps:
determining whether the data tag belongs to a first sub-classification in a first classification;
if not, taking the QoS forwarding strategy corresponding to the first classification as the forwarding strategy corresponding to the tunnel data;
and if so, taking the QoS forwarding strategy corresponding to the first sub-classification as the forwarding strategy corresponding to the tunnel data.
In a specific implementation process, the first classification may be a classification that needs to be forwarded in a high-low order according to the Qos priority; or according to certain speed limit standards, such as: the forwarding classification is carried out according to the bandwidth of 50M (megabandwidth), or 100M or 200M; or a category that needs to be discarded, or another category, a person skilled in the art may set a classification criterion according to different users, and is not limited in the embodiment of the present invention.
In the embodiment of the present invention, in order to further improve the granularity and the accuracy of classification, further classification operations may be performed under the first classification, for example: the data with the priority higher than the preset level (for example, level 3 or higher) in the first classification is further classified into a classification that needs to be forwarded according to a certain speed limit standard, and the like, which is not specifically limited in the embodiment of the present invention.
In the embodiment of the present invention, the first category and the first sub-category in the first category correspond to preset data labels respectively.
In a specific implementation process, if the acquired data label is 1, comparing the data label 1 with the data label corresponding to the first classification, and if the data label corresponding to the first classification comprises the data label 1, indicating that the data label 1 is classified into the first classification; then comparing the data label 1 with a data label corresponding to a first sub-classification under the first classification, if the data label corresponding to the first sub-classification contains the data label 1, classifying the data label 1 into the first sub-classification, and taking a Qos forwarding strategy corresponding to the first sub-classification as a forwarding strategy corresponding to the tunnel data; and if the data mark corresponding to the first sub-classification does not contain the data mark 1, classifying the data mark 1 into the first classification, and using the QoS forwarding strategy corresponding to the first classification as the forwarding strategy corresponding to the tunnel data.
Further, in this embodiment of the present invention, the Qos forwarding policy includes any one of the following:
a discard policy;
a speed limit strategy;
a direct forwarding policy;
the Qos priority based forwarding and caching policy includes a discard policy, a speed limit policy, a direct forwarding policy, or any one of the Qos priority based forwarding and caching policies, or another forwarding policy, which is not specifically limited in the embodiment of the present invention.
In a specific implementation process, if the QoS forwarding strategy corresponding to the tunnel data is determined to be a discarding strategy, discarding all matched tunnel data;
if the Qos forwarding policy corresponding to the tunnel data is determined, according to the speed limit standard defined by the classification, for example: forwarding the tunnel data with a bandwidth of 50M (megabyte), or 100M or 200M, and realizing rate control on the data exceeding the standard by a discarding or buffering method;
if the QoS forwarding strategy corresponding to the tunnel data is determined to be a direct forwarding strategy, directly forwarding the tunnel data without caching;
if the QoS forwarding strategy corresponding to the tunnel data is determined to be a strategy for forwarding according to the QoS priority, storing the tunnel data in a cache queue corresponding to the classification, and forwarding the tunnel data in the queue according to the QoS priority sequence and the weight by the CPU according to the time slice;
and if the QoS forwarding strategy corresponding to the tunnel data is determined to be a cache forwarding strategy, caching the tunnel data.
In the embodiment of the invention, different Qos forwarding strategies are given to the tunnel data according to the data label, so that the user-level Qos management is realized, and the technical effect of improving the granularity of the Qos management is achieved.
Based on the same conception, the apparatus for quality of service Qos optimization according to the embodiment of the present invention, as shown in fig. 2, includes an analyzing unit 201, an obtaining unit 202, and a determining unit 203. Wherein:
an analyzing unit 201, configured to analyze a tunneling protocol type corresponding to the tunneling data;
an obtaining unit 202, configured to obtain a data tag corresponding to the tunnel data according to the tunnel protocol type; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data;
a determining unit 203, configured to determine a Qos forwarding policy corresponding to the tunnel data according to the data flag.
Optionally, the analysis unit 201 is configured to:
analyzing the tunnel header of the tunnel data;
and acquiring the tunneling protocol type corresponding to the tunneling data from the tunneling header.
Optionally, the obtaining unit 202 is configured to:
extracting label information capable of representing the user characteristics from the tunnel data according to the tunnel protocol type;
mapping the label information to a data label outside the tunnel data;
and acquiring a data mark for characterizing the user characteristics of the user corresponding to the tunnel data from the data label.
Optionally, the determining unit 203 is configured to:
determining whether the data tag belongs to a first sub-classification in a first classification;
if not, taking the QoS forwarding strategy corresponding to the first classification as the forwarding strategy corresponding to the tunnel data;
and if so, taking the QoS forwarding strategy corresponding to the first sub-classification as the forwarding strategy corresponding to the tunnel data.
Optionally, the Qos forwarding policy includes any one of:
a discard policy;
a speed limit strategy;
a direct forwarding policy;
and forwarding and caching strategies according to the Qos priority.
As can be seen from the foregoing, embodiments of the present invention provide a method and an apparatus for Qos optimization, where a tunneling protocol type corresponding to tunneling data is analyzed; acquiring a data mark corresponding to the tunnel data according to the type of the tunnel protocol; the data mark is used for representing the user characteristics of the user corresponding to the tunnel data; and determining a Qos forwarding strategy corresponding to the tunnel data according to the data mark. That is, in the embodiment of the present invention, a Qos forwarding policy of tunnel data is determined according to a data label corresponding to the tunnel data, instead of setting Qos of user data when a tunnel is encapsulated or performing Qos optimization according to different tunnel channels, so that Qos optimization at a user level of the tunnel data is implemented, and Qos optimization granularity and accuracy of the tunnel data on a forwarding device are improved. Therefore, the technical problem that the QoS optimization accuracy of the tunnel data is low in the prior art can be effectively solved, and the technical effect of improving the QoS optimization accuracy of the tunnel data is achieved.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.