An Efficient Design of Intelligent Network Data Plane

本文实际上是将决策树的inference阶段offload到可编程交换机上,因为大小比较产生的状态爆炸问题是本文最重要的贡献。

Introduction & Background

在数据平面执行model inference有两个优点:线速、reaction time小。

目前来说主要有两种已有的prior art

  • 关注extracting useful flow information from the data plane,但是它们并不直接把learning models放到数据平面
  • 第二种take a step further,但是它们没有处理flow-level feature

Programmable Data Plane

介绍了一些背景知识

Motivation

首先对比了已有工作

  • NetWarden,FlowLens
  • Poseidon,Jaqen
  • Planter,Mousika

然后做了两个试验证明flow-level feature很重要

  • feature importance:和per-packet feature对比
  • accuracy:和per-packet feature对比

The Overview of NetBeacon

图不错,整个design主要三个部分

  • data plane aware model design
  • model deployment
  • stateful storage management model

Data Plane Aware Model Design

Feature Engineering

per-packet的feature比较好提取,比如packet size或者TTL。 flow-level features是通过combining attributes from other packets in the same flow获得的。

处理方法是aggregate/summary

  • 对需要aggregate的,F=aggr(a,c,d)。比如F=aggr(packet size,[96, 112),+1)就是当packet size满足[96,112)的时候+1。
  • 对需要summary的,一般就是max/min,mean,variance等等

Multi-Phase Sequential Models

实现的是随机森林和XGBoost。

但是只用single model有一个问题:per-packet的feature中所有的packet可以一视同仁,但是per-flow的并不是,packet在flow中的位置不同,所携带的信息也不一样。

因此采用的是multi-phase model,apply different models at different phases of flows。在每个阶段,flow-level features at the n-th packet are computed based on the first n packets

Model Deployment

Data Plane Model Representation

这边其实主要解决的就是状态爆炸的问题。因为PISA是只能用0/1/*来去做match的,如果是直接用01*串去做,就状态爆炸了 对于single model来说,这边主要分成两个部分: Model Table和Feature Table,相当于Feature Table先做,匹配完拿到一个Tag,Model Table再做

Range Marking。后缀状态压缩。这样就能满足它的一些限定条件,比如consecutive的merge之类的。这个主要用来生成Feature Table的range unit到value其中的value的

Range Coding in Feature Table。feature的具体编码就用prefix最少的。差不多就是按照幂次去切的思想。也就是生成Feature Table的key。

然后Feature Table到Model Table就很简单,组合就可以了。

Handling Forest Models。对forest model来说,状态简单,组合一下就行了。有一些复杂的model,用了比如说sigmoid,这东西运算不支持,因此有一些方法去解决。 比如merge feature table的操作基本上就是对forest的每棵树全部考虑在内,然后创一个新的tree。对model来说,就是tree的leaf的组合,offline算一下。 此外还有一些优化。

Stateful Storage Management

存储用hardware hashing。但是要解决hash collision的问题。

  1. 尽可能减少collision的概率:就是不处理短流,代价是精度。怎么判断短流?用一个模型(82%精度)。
  2. 如果collide了,那么新流就用per-packet的分类器,直到老流判断完了,可以update了。

有个问题:前面collide的long flow的状态就丢了?

Integrated Data Plane Processing Logic

整个流程串了一下。

有一个注意的:resubmit去触发

  1. update the new inference result for an existing flow
  2. initiate storage for a new flow

Control Plane Logic

负责

  • installing the feature tables and model table on the data plane at the very beginning
  • updating the flow class table upon receiving requests

1300 LoC P4 / 300 LoC Python

Implementation

Computing Flow-level Features

讲了一下怎么计算mean和variance

Multi-phase Model Inference

对于multi-phase的来说,作者represent each individual model at each phase separately, with its own feature tables and model table. 大概是通过total packets来进行phase的转换。

此外,model inference takes two stages: one stage for matching feature tables in parallel and one stage for matching the (aggregated) model table.