Service type determining method and related device
AssigneeHuawei Technologies Co., Ltd.
InventorsWanyu Li, Qingping Yang, Chuntao Wang, Linjie Huang
Life of this patent
Estimating the term…
Abstract
Embodiments of this application disclose a service type determining method and a related device. A first device obtains a dataset, where the dataset includes at least two 5-tuples. The first device determines a target feature (the target feature is used to indicate a service type corresponding to a target triplet) corresponding to the target triplet based on the dataset. In this way, the first device can identify the service type corresponding to the target triplet based on the target feature, to facilitate operations such as packet transmission traffic control or application identification based on the importance indicated by the service type.
Claims9
A service type determining method, comprising:
- receiving a plurality of packets transmitted by a second device;
- obtaining, by a first device, a dataset corresponding to the plurality of packets, wherein the dataset comprises at least two 5-tuples, the at least two 5-tuples comprise a first 5-tuple, and the first 5-tuple comprises a source address, a destination address, a source port, a destination port, and a communications protocol;
- determining, by the first device based on the dataset, a target feature corresponding to a target triplet, wherein the target triplet comprises an address, a port, and the communications protocol, and the target feature is used to indicate a service type corresponding to the target triplet, and
- wherein the address is the source address and the port is the source port, or the address is the destination address and the port is the destination port;
- determining the service type based on the target feature;
- and
- forwarding the plurality of packets based on the service type;
- wherein the first device has two sides with one side connected to a terminal device and one side connected to a network device, wherein the target feature comprises:
- a client-server (CS) mode, a peer-to-peer (P2P) mode, a port-same mode, a voice over Internet Protocol (VoIP) mode, an instant message mode, or a port reservation mode on the two sides, and the port-same mode indicates that a port number of the source port is the same as a port number of the destination port;
- wherein the determining, by the first device based on the dataset, a target feature corresponding to a target triplet comprises:
- either
- obtaining, by the first device based on the dataset, a quantity of peer ports, wherein the peer port is not a random port nor a service port, and an address in the target triplet is not a client address;
- when the port in the target triplet is the destination port, the peer port is the source port, or when the port in the target triplet is the source port, the peer port is the destination port;
- and
- determining, by the first device based on the quantity of peer ports, that the target feature comprises the port reservation mode on both sides and that the port in the target triplet is a service port in the port reservation mode on both sides;
- or
- obtaining, by the first device based on the dataset, an address quantity set of each port in the peer ports, wherein the address quantity set comprises a first value;
- when the port in the target triplet is the destination port, the peer port is the source port;
- or when the port in the target triplet is the source port, the peer port is the destination port;
- obtaining, by the first device based on the address quantity set, a second value, wherein the second value is a sum of all values comprised in the address quantity set;
- and
- determining, by the first device based on a first target ratio, that the peer port is a service port in the instant message mode, wherein the first target ratio is a ratio of the first value to the second value.
Dependencies are inferred from the claim text.