6 888 Lecture 16 Header Space Analysis Mohammad

  • Slides: 36
Download presentation
6. 888 Lecture 16: Header Space Analysis Mohammad Alizadeh ² Slides courtesy of Peyman

6. 888 Lecture 16: Header Space Analysis Mohammad Alizadeh ² Slides courtesy of Peyman Kazemian (Stanford) Spring 2016 1

Digital Hardware Design Specification Functional Description (RTL) Testbench & Vectors Functional Verification $10 B

Digital Hardware Design Specification Functional Description (RTL) Testbench & Vectors Functional Verification $10 B tool business supports a $250 B chip industry Logical Synthesis 100 s of Books >10, 000 Papers 10 s of Classes Static Timing Place & Route Design Rule Checking (DRC) Layout vs Schematic (LVS) Layout Parasitic Extraction (LPE) Manufacture & Validate 2

Software Design Specification Functional Description (Code) Static Code Analysis Run-time Checker Testbench Invariant Checker

Software Design Specification Functional Description (Code) Static Code Analysis Run-time Checker Testbench Invariant Checker Model Checking Interactive Debugger $10 B tool business supports a $300 B S/W industry 100 s of Books >100, 000 Papers 10 s of Classes 3

Managing Networks (Today) traceroute, ping, tcpdump, SNMP, Netflow …. er, that’s about it. 4

Managing Networks (Today) traceroute, ping, tcpdump, SNMP, Netflow …. er, that’s about it. 4

Why is network debugging hard? • Complex interaction o o Between multiple protocols on

Why is network debugging hard? • Complex interaction o o Between multiple protocols on a switch/router. Between state on different switches/routers. • Multiple uncoordinated writers of state. • Network owner can’t… o o Observe all state. Control all state.

Networks are kept working by “Masters of Complexity”

Networks are kept working by “Masters of Complexity”

Simple questions are hard to answer o o o Can host A talk to

Simple questions are hard to answer o o o Can host A talk to host B? What are all the packet headers from A that can reach B? Is Group X provably isolated from Group Y? Are there any loops in the network? What happens if I remove this line in the config file? 7

How have other fields overcome similar challenges? 8

How have other fields overcome similar challenges? 8

Communication Engineering S Frequency Modulation Cos(wt) Antenna De. Modulation Antenna Band Pass Filter D

Communication Engineering S Frequency Modulation Cos(wt) Antenna De. Modulation Antenna Band Pass Filter D Amplifier Cos(wt) 9

Digital Hardware Design B clock out A 10

Digital Hardware Design B clock out A 10

Digital Hardware Design B clock out A 11

Digital Hardware Design B clock out A 11

“Systems” Framework for Networks VLAN Table Spanning Tree IP Table MAC Table MPLS Mappings

“Systems” Framework for Networks VLAN Table Spanning Tree IP Table MAC Table MPLS Mappings Input ACL IP table Output ACL ARP Table MAC Table Spanning MAC Table Filtering Rules Tree Input ACL IP table Output ACL ARP Table MAC Table Spanning Tree 12

“Systems” Framework for Networks VLAN Table Spanning Tree IP Table MAC Table MPLS Mappings

“Systems” Framework for Networks VLAN Table Spanning Tree IP Table MAC Table MPLS Mappings Input ACL IP table Output ACL ARP Table MAC Table Spanning MAC Table Filtering Rules Tree Input ACL IP table Output ACL ARP Table MAC Table Spanning Tree 13

Header Space Analysis 14

Header Space Analysis 14

Header Space Framework • Step 1: o o Ignore protocol dependent meaning of header

Header Space Framework • Step 1: o o Ignore protocol dependent meaning of header bits and see it as a flat sequence of 0 s and 1 s. Model a packet as a point in {0, 1}L space – The Header Space SRC MAC DST MAC 0101. . 1 1010. . 1 SRC IP DST IP 0010. . 0 Header Data 0101. . 11010. . 10010. . 0 010 xxx 011. . x 001 xxxxx 01110 L 15

Header Space Framework • Step 2 – Model all networking boxes as transformers of

Header Space Framework • Step 2 – Model all networking boxes as transformers of header space 1101. . 00 Transfer Function: 1 1110. . 00 Match 0 xx 1. . x 1 11 xx. . 0 x 3 Packet Forwarding Action + 2 Send to port 2 3 Rewrite with 1 xx 011. . x 1 1 x 01 xx. . x 1 Why is the output a set of packets? 16

Transfer Function Example • IPv 4 Router – Forwarding Behavior o o o 172.

Transfer Function Example • IPv 4 Router – Forwarding Behavior o o o 172. 24. 74. x 172. 24. 128. x 171. 67. x. x T(h, p) = 1 Port 2 Port 3 2 3 (h, 1) if dst_ip(h) = 172. 24. 74. x (h, 2) if dst_ip(h) = 172. 24. 128. x (h, 3) if dst_ip(h) = 171. 67. x. x 17

Transfer Function Example • IPv 4 Router – forwarding + Time to Live (TTL)

Transfer Function Example • IPv 4 Router – forwarding + Time to Live (TTL) o o o 172. 24. 74. x 172. 24. 128. x 171. 67. x. x T(h, p) = Port 1 Port 2 Port 3 1 2 3 (dec_ttl(h), 1) if dst_ip(h) = 172. 24. 74. x (dec_ttl(h), 2) if dst_ip(h) = 172. 24. 128. x (dec_ttl(h), 3) if dst_ip(h) = 171. 67. x. x 18

Transfer Function Example • IPv 4 Router – forwarding + TTL + MAC rewrite

Transfer Function Example • IPv 4 Router – forwarding + TTL + MAC rewrite o o o 172. 24. 74. x 172. 24. 128. x 171. 67. x. x T(h, p) = Port 1 Port 2 Port 3 1 2 3 (rw_mac(dec_ttl(h), next_mac) , 1) if dst_ip(h) = 172. 24. 74. x (rw_mac(dec_ttl(h), next_mac) , 2) if dst_ip(h) = 172. 24. 128. x (rw_mac(dec_ttl(h), next_mac) , 3) if dst_ip(h) = 171. 67. x. x 19

Other Examples: • Rewrite: rewrite bits 0 -2 with value 101 o (h &

Other Examples: • Rewrite: rewrite bits 0 -2 with value 101 o (h & 000111…) | 101000… • Encapsulation: encap packet in a 1010 header. o (h >> 4) | 1010…. • Decapsulation: decap 1010 xxx… packets o (h << 4) | 000…xxxx • TTL Decrement: o o if ttl(h) == 0: if ttl(h) > 0: Drop h – 0… 000000010… 0 • Load Balancing: o LB(h, p) = {(h, P 1), …(h, Pn)} 20

Composing Transfer Functions • By composing transfer functions, we can find the end to

Composing Transfer Functions • By composing transfer functions, we can find the end to end behavior of networks. R 1 R 2 R 3 T 1(h, p) 21

Inverting Transfer Functions • Tell us all possible input packets that can generate an

Inverting Transfer Functions • Tell us all possible input packets that can generate an output packet. -1(h, p) TT(h, p) Input Header Space Output Header Space 22

Header Space Framework • Step 3 - Header Space Set Algebra. o o Intersection

Header Space Framework • Step 3 - Header Space Set Algebra. o o Intersection Complementation Difference Check subset and equality condition. • Every region of Header Space, can be described by union of Wildcard Expressions. (example: 10 xx U 011 x) • Goal: do set operation on wildcard expressions. 23

HS Set Algebra- Intersection • Bit by bit intersect using intersection table: o o

HS Set Algebra- Intersection • Bit by bit intersect using intersection table: o o o Example: If result has any ‘z’, then intersection is empty: Example: wildcard empty 24

Algorithms 25

Algorithms 25

Finding Reachability All Packets that A A can use Packets that can send with

Finding Reachability All Packets that A A can use Packets that can send with B topossibly communicate A All Packets that A can possibly send to box 2 through box 1 T-11 Box 1 T-1 1 All Packets that A can possibly send to box 4 through box 1 T 1(X, A) T-14 T-12 Box 2 T 2(T 1(X, A)) T 4(T 1(X, A)) Box 4 Box 3 B T-13 T 3(T 2(T 1(X, A)) U T 3(T 4(T 1(X, A)) 26

Finding Loops • Is there a loop in the network? o o Inject an

Finding Loops • Is there a loop in the network? o o Inject an all-x test packet from every switch-port Follow the packet until it comes back to injection port T 1(X, P) Box 2 T 2(T 1(X, P)) T-12 Box 1 T-13 T-11 Box 3 T-14 Original HS Returned HS T 4(T 3(T 2(T 1(X, P)))) T 3(T 2(T 1(X, P))) Box 4 27

Finding Loops • Is the loop infinite? Finite Loop Infinite Loop ? 28

Finding Loops • Is the loop infinite? Finite Loop Infinite Loop ? 28

Checking Isolation of Slices • How to check if two slices are isolated? o

Checking Isolation of Slices • How to check if two slices are isolated? o o Slice definitions don’t intersect. Packets don’t leak after forwarding. 29

Header Space Library (Hassel) 30

Header Space Library (Hassel) 30

Header Space Library (Hassel) • Two versions – Python and C. • Foundation Layer

Header Space Library (Hassel) • Two versions – Python and C. • Foundation Layer o Implements Header Space and Transfer Function objects. • Application Layer o o Reachability, Loop Detection and Slice Isolation checks. < 100 Lo. C for these checks. • Parser (only available in Python) o CLI Parsing tool for Cisco IOS, Juniper Junos and Open. Flow table dump. • Example: for Cisco IOS, reads IP table, ARP table, MAC table, Spanning tree output and Config file. o • Keeps mapping from TF Rule to CLI line number. Available online: git clone https: //bitbucket. org/peymank/hassel-public. git 31

Optimizations: 10, 000 X Speedup • IP Table compression • Lazy subtraction • Dead

Optimizations: 10, 000 X Speedup • IP Table compression • Lazy subtraction • Dead object deletion • Lookup based search • Lazy TE evaluation 32

Stanford backbone network • Loop detection test Vlan RED Spanning Tree Vlan BLUE Spanning

Stanford backbone network • Loop detection test Vlan RED Spanning Tree Vlan BLUE Spanning Tree Owns 6 x /16 IP domains. ~750 K IP fwd rule. ~1. 5 K ACL rules. ~100 Vlans. Vlan forwarding. 33

Limitations 1. When I add a new forwarding rule, how can I dynamically check

Limitations 1. When I add a new forwarding rule, how can I dynamically check in real-time if it will violate my network policy? 1. How do I track down the source code that was the root cause of a data plane error? 1. Is the network causing poor performance or the server? Are Qo. S settings to blame, poor load balancing, etc? 1. If switch hardware is malfunctioning, how will I know? How will I identify the switch/rule? 34

Related Research Frenetic, Net. Core, Pyretic, Procera, … [2012] Formal specification languages Policy Control

Related Research Frenetic, Net. Core, Pyretic, Procera, … [2012] Formal specification languages Policy Control Program Veriflow, Net. Plumber [2012] Control Plane Anteater, HSA [2011] Static checking of lowest level design Dynamic checking of lowest level design (several) Consistent Updates ATPG [2012], Net. SONAR [2013] Packet forwarding NETWORK WWW, ndb [2012] Dynamic troubleshooting to Identify root cause

36

36