Tracking P4 Program Execution in the Data Plane SOSR 20 Suriya - - PowerPoint PPT Presentation

tracking p4 program execution in the data plane
SMART_READER_LITE
LIVE PREVIEW

Tracking P4 Program Execution in the Data Plane SOSR 20 Suriya - - PowerPoint PPT Presentation

Tracking P4 Program Execution in the Data Plane SOSR 20 Suriya Kodeswaran Mina Arashloo, Praveen Tammana, Jennifer Rexford 1 Background: P4 Compilation Input program Compiler maps programs to hardware target Optimizes to work


slide-1
SLIDE 1

Tracking P4 Program Execution in the Data Plane

SOSR ‘20

Suriya Kodeswaran Mina Arashloo, Praveen Tammana, Jennifer Rexford

1

slide-2
SLIDE 2

Background: P4 Compilation

  • Compiler maps programs to hardware target
  • Optimizes to work around hardware restraints
  • Compiler bugs
  • If-Else statements always taking one branch
  • Mapping multiple variables to the same registers
  • These bugs change the way packets are processed

2

p4c

Input program P4 compiler Hardware target

Optimization #1 Optimization #2 Optimization #3 Optimization #4 … Optimization #n

slide-3
SLIDE 3

Software: P4 Control Flow

3

  • Bug when packet takes wrong path
slide-4
SLIDE 4

Goal: Tracking Packet Execution Path

  • Naïve solution: Reserve a bit for each decision
  • Challenges:
  • Switch.p4: 1034 ways to process packets with longest path length of 44 tables
  • Limited per-packet state
  • Need an efficient solution!

4

slide-5
SLIDE 5

Expected vs Actual Behavior

5

  • Series of match-action units placed by compiler
  • Actions happen concurrently on a stage
  • Fast packet processing
  • Actions are dependent on each other
  • Order in pipeline != order in control flow
slide-6
SLIDE 6

How do you trace path execution?

  • Key observation: P4 control flow is always a DAG
  • Ball-Larus (BL) algorithm
  • Provides path encoding for DAGs
  • Update a variable on edge transitions
  • Paths are uniquely identified by sum of edges

6

slide-7
SLIDE 7

Enabling Ball-Larus in P4

7

p4c BL Encoding

Input program Encoded program Encoding algorithm P4 compiler Hardware target

slide-8
SLIDE 8

Challenges of naïve BL encoding

  • Single variable does not scale
  • Extra dependencies during compiler mapping
  • Don’t change the system we are tracking!

8

p4c BL Encoding

Input program Encoded program Encoding algorithm P4 compiler Hardware target

slide-9
SLIDE 9

Example: Challenge of naïve BL encoding

9

slide-10
SLIDE 10

Idea: DAG Partitioning

10

slide-11
SLIDE 11

Our Solution: Multivariable Ball-Larus

  • Partition the control flow DAG
  • One BL variable per partition
  • Mutually exclusive actions can be in same partition
  • Actions from the same table
  • Actions on different stages
  • Path is uniquely identified by tuple of BL variables: {

V1, V2, …, Vn }

11

slide-12
SLIDE 12

Minimizing Hardware Overhead

  • DAG partitioning introduces additional overhead
  • Solution: Use Linear Program to optimize # bits required for encoding
  • Constraints:
  • Hardware’s maximum bit size
  • Actions update one variable
  • Dependent actions update different variables

12

slide-13
SLIDE 13

Results

13

slide-14
SLIDE 14

Conclusion and Future Work

  • Data-plane primitive for tracking every packet’s execution path
  • Idea: Multivariable Ball-Larus encoding
  • Implemented on T
  • fino
  • Future work: Detection and localization of bugs in P4 compiler and

control plane

14

slide-15
SLIDE 15

15

Questions?

Contact: suriyak@princeton.edu