The invention relates to a priority-based high-
visibility stream-by-
stream data
packet sampling method and
system. Comprising the following steps: step 1, flow
initiation and priority marking; step 2, flow establishment and controller
decision making; step 3, rule issuing and
strategy execution; and step 4, data forwarding, scheduling and sampling: a
priority scheduling mechanism of a data plane and
global optimization of a control plane are decoupled and coordinated. In a data plane, a terminal host marks a degradation priority for a data packet according to the number of bytes sent by a
stream, and a switch performs strict
queue scheduling and probability sampling based on the priority. In a control plane, a controller carries out collaborative modeling on the configuration of routing, sampling probability and degradation threshold as a
nonlinear optimization problem with maximization of sampling utility as a target, and an efficient online primitive-dual
interior point method is adopted for solving. According to the method, high
visibility and load balancing are finally ensured, and meanwhile, the control and calculation overhead is remarkably reduced.