其他分享
首页 > 其他分享> > Testing & Paper reading——Sketchvisor

Testing & Paper reading——Sketchvisor

作者:互联网

Paper——SIGCOMM 17 : Reading SketchVisor Robust Network Measurement for Sofeware Packet Processing

A Partial User-space Implementation of SketchVisor's Logoc using Python and Mininet.

 

一、Introduction

SketchVisor is an paper presented in SIGCOMM17 and suggests a method to perform common network measurement task such as Heavy-Hitter-Detection, Heavy-Changers, DDos ,Cardinality基数, Flow-Size-Distribution流量大小分布, etc. While minding Performance, Resource efficiency, Accuracy(不基于采样)and Generality(支持各种基于sketch的解决方案)。

SketchVisor是一种基于纯软件包转发的网络测量框架,并改进现有算法提出了两种算法。此网络测量框架具有高性能(line-rate)、高精度、广泛性(适用于多种sketch算法)、自动化(自动掉结负载)的特点。框架包括数据平面和控制平面,每个软件交换机对应一个数据平面,每个数据平面包括normal path和fast path。一旦流量过载,SketchVisor就将过载的额流量重定向到Fast path,以保持高性能和高精度(虽然有轻微损失),其中在Fast path 设计了Top-k算法。有一个总的控制平面,设计Compressing Sensing算法,对分布的交换机提供的数据加以整合,恢复出全网的数据。最后实验证明,SktechVisor使一系列基于sketch的测量方法达到流高性能和高精度。

二、Background

Terminopogy

Measurement Tasks

Performance Flaws 性能缺陷

Microbenchmark 微基准

三、Problem

四、Goals

Our Goal

Being able to track as many flows as possible simultaneously, to perform the above tasks.

 

 

Design Goals

五、How does it work?

SketchVisor utilizes principles laid by Misra-Gires Algorithm by introducing a "Fast Path " which tracks major flows, while being able to restore恢复 the full sketch at the end of the process.

The following diagram shows the main architecture of SketchVisor.Note that figure(a) is being run on each host, while figure(b) is the single control-plane.

 (b) SketchVisor control plane

 

Date Plane

Control Plane

SketchVisor

Fast Path

Compressive Sensing 压缩感测

Explanation

Once the regular(Normal-path) sketch is unable to keep up with the rate of incoming packets, they're being sent to the Fast Path.The Fast Path is the "twist" upon Misra-Gries algorithm, the key differences are:

  1. Instead of <key,count> Pair foe each flow, we store <key, byte-count>*;
  2. Instead of increasing the counter by 1 when a new item arrives, we increase by it's byte-count.

*Note: we actually store 3 counters: <key, e_f, r_f, d_f>    (e_f: the maximum possible byte count that can be missed before f is inserted 在插入f之前可能会丢失的最大字节数.   r_f: the residual byte count of f.  d_f: the decremented byte count after f is inserted 插入f之后减少的字节数)

BUT...what happens when the table is full, and a new item arrive?

  1. In Misra-Gries Algorithm we subtract all counters by 1.
  2. In Fast Path we subtract by some e threshold 我们减去一些e阈值.

Consider all existing flows in the table, |k|, SORTED by size, with the addition of the new flow, so that's |k+1| items: Desired e needs to be at least larger than the smallest flow in the table, in order to be able to take out any existing item. But, e shouldn't be too big to avoid taking out the rest of the items. We could've set e=a[k+1] and simply take out the smallest item, instead, the paper suggests a method allowing us to take out more than a single flow at a time 该文章介绍流一种方法允许我们一次能取出多个流, calculating a "smart" value e that ensures probability of some small delta=0.05 to take out an item bigger than the minimal one 计算出一个“智能”值e以确保某个小的delta=0.05,可以取出比最小值更大的项。

Addressing Data-Loss on Fast-Path 解决快速路径上的数据丢失

By tracking the larger, dominating flows on the Fast-Path, we allegedly lose information about smaller flows which are necessary for some tasks丢失了一些任务所必须的关于较小流量的信息, for example, DDoS-Detection.

The paper suggests a way of reconstructing the "original" sketch as if all flows we're being tracked, by formulating a convex optimization problem通过构造一个凸优化问题. This project does not implement the convex-optimization and therefore unable to accuratly answer tasks that are small-flow dependant依赖小流量(like DDoS detection).

六、Implementation

For my implementation, a Mininet VM is used. Like the experiment in the paper, it consists of a single switch topology with 9 hosts. The implementation is done in Python and relies on Mininet's Python API, and Consists of Modules: PacketCapture Module, NormalPath, Buffer, FastPath, ControlPlane. Like the paper suggests, inter-process communication is done via ZeroMQ. In order to run, execute Start.py. The following steps will occur:

  1. Initialize Network topology, setup virtual hosts and switch.
  2. Configure switch.
  3. Deploy NormalPath.py, Buffer.py, FastPath.py Modules on each host.
  4. Deploy ControlPlane.py on the Switch, and launch xterm for the user to watch the results LIVE启动xterm供用户实时观看结果.
  5. Start injecting dummy traffic in the network, generate several flows between each pair of hosts (h_i, h_j) | i!=j
  6. Monitor the data rate of each flow in the xterm window that's opened, which shows our ability to detect heavy hitters as an example.

Data Plane( Runs on each Host)

 

Control Plane( Runs on Swithch)

 

 

CapturePackets.py: captures from selected interface via Pcapy library, parse the packet header and content to extract a  5-Tuple Flow-ID of the form: (SRC_IP, DST_IP, SRC_PORT, DST_PORT, PROTOCOL), then forwards them via ZeroMQ socket to Buffer.py

Buffer.py:listens for incoming packets and fills up the buffer.The NormalPath.py requests new flows to process at a certain rate, and once the buffer is full packets are being forwarded to the FastPath.py process via it's own socket.

NormalPath.py:tracks incoming flows using a Count-Min-Sketch. Updates ControlPlane.py with it's sketch matrix(Let it be M) once every defined interval.

FastPath.py:listens to incoming flows.Implements the Fast-Path concept as shown in the paper, which has a hash table H where it stores top-k flows.The algorithm for updating the hash table is:

ControlPlane.py:listen for incoming flows from both FastPath and NormalPath.It can receive 2 typps of message denoted by the index in the message tuple 它可以接收由消息元组中的索引表示的两种类型的信息.

0-Message contains a FastPath hash table to be merged with the general H hash table.

1-Message contains a sketch matrix M, to be added with matrix addition to the general sketch.

七、Related Work

八、Advantages

九、Conclusion

Design and implement SketchVisor, a robust network-wide measurement architecture for software packet processing, with a primary goal of preserving performance and accuracy guarantees even under high traffic load.SketchVisor employs sketches as basic measurement primitives, and achieves high data plane perfomance with a fast path to offload sketch-based measurement under high traffic load.It further leverages compressive sensing to achieve accurate network-wide measurement. Experiments demonstrate that SketchVisor achieves high performance and high accuracy for a rich set of sketch-based solutions.

标签:sketch,py,Testing,Sketchvisor,Fast,measurement,flows,path,reading
来源: https://www.cnblogs.com/lxixi/p/12307314.html