Forwarding Plane Correctness
Nick ¡McKeown ¡
Stanford ¡University ¡ ¡
Horizontal Vertically integrated Open interfaces Closed, - - PowerPoint PPT Presentation
Forwarding Plane Correctness Nick McKeown Stanford University App App App App App App App App App App App Specialized Open Interface Applications Windows
Nick ¡McKeown ¡
Stanford ¡University ¡ ¡
Vertically integrated Closed, proprietary Slow innovation Small industry
Specialized Operating System Specialized Hardware
App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡
Specialized Applications
Horizontal Open interfaces Rapid innovation Huge industry
Microprocessor
Open Interface
Linux ¡ Mac ¡ OS ¡
Windows ¡ (OS) ¡
Open Interface
Vertically integrated Closed, proprietary Slow innovation
App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡ App ¡
Horizontal Open interfaces Rapid innovation
Control ¡ Plane ¡ Control ¡ Plane ¡ Control ¡ Plane ¡
Open Interface
Specialized Control Plane Specialized Hardware Specialized Features Merchant Switching Chips
Open Interface
(when ¡we ¡clear ¡away ¡all ¡the ¡hype) ¡
A ¡network ¡in ¡which ¡the ¡control ¡plane ¡is ¡ ¡ physically ¡separate ¡from ¡the ¡forwarding ¡plane. ¡ ¡ and ¡ ¡ A ¡single ¡control ¡plane ¡controls ¡ ¡ several ¡forwarding ¡devices. ¡ (That’s ¡it) ¡
$10B ¡tool ¡business ¡ supports ¡a ¡ $250B ¡chip ¡industry ¡ ¡
SpecificaTon ¡
FuncTonal ¡ DescripTon ¡(RTL) ¡ Testbench ¡& ¡ Vectors ¡ FuncTonal ¡ VerificaTon ¡ Logical ¡Synthesis ¡ StaTc ¡Timing ¡ Place ¡& ¡Route ¡ Design ¡Rule ¡ Checking ¡(DRC) ¡ Layout ¡vs ¡ SchemaTc ¡(LVS) ¡ Layout ¡ParasiTc ¡ ExtracTon ¡(LPE) ¡ Manufacture ¡ & ¡Validate ¡
100s ¡of ¡Books ¡ >10,000 ¡Papers ¡ 10s ¡of ¡Classes ¡
StaTc ¡Code ¡ Analysis ¡ Invariant ¡ ¡ Checker ¡ InteracTve ¡ Debugger ¡ Model ¡ Checking ¡ Run-‑Tme ¡Checker ¡
SpecificaTon ¡
Testbench ¡ FuncTonal ¡ DescripTon ¡(Code) ¡
$10B ¡tool ¡business ¡ supports ¡a ¡ $300B ¡S/W ¡industry ¡ ¡
100s ¡of ¡Books ¡ >100,000 ¡Papers ¡ 10s ¡of ¡Classes ¡
traceroute, ping, tcpdump, SNMP, Netflow
¡ …. ¡er, ¡that’s ¡about ¡it. ¡
A ¡handful ¡of ¡books ¡ Almost ¡no ¡papers ¡ No ¡classes ¡
“You’re ¡On ¡Your ¡Own” ¡
can ¡reach ¡B? ¡ ¡
file? ¡
12
Tue, ¡Oct ¡2, ¡2012 ¡at ¡7:54 ¡PM: ¡ ¡
“Between ¡18:20-‑19:00 ¡tonight ¡we ¡experienced ¡a ¡ complete ¡network ¡outage ¡in ¡the ¡building ¡when ¡a ¡ loop ¡was ¡accidentally ¡created ¡by ¡CSD-‑CF ¡staff. ¡We're ¡ invesTgaTng ¡the ¡exact ¡circumstances ¡to ¡understand ¡ why ¡this ¡caused ¡a ¡problem, ¡since ¡automaTc ¡ protecTons ¡are ¡supposed ¡to ¡be ¡in ¡place ¡to ¡prevent ¡ loops ¡from ¡disabling ¡the ¡network.” ¡
13 ¡
¡ ¡ ¡ ¡ ¡ ¡
14 ¡
If ¡dst ¡MAC ¡ ¡ address ¡is ¡X ¡ Send ¡out ¡port ¡1 ¡
L2 ¡Switch ¡
If ¡dst ¡port ¡ is ¡22 ¡ Drop ¡packet ¡
Firewall ¡
Match ¡ AcTon ¡
Forwarding ¡State ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
15 ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
If ¡dst ¡IP ¡address ¡ ¡ is ¡Y ¡ Decrement ¡TTL, ¡ Update ¡checksum, ¡ Modify ¡dst ¡MAC, ¡ Send ¡out ¡port ¡2 ¡
L3 ¡Router ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
Control ¡Plane ¡
16 ¡
Forwarding ¡
State ¡
Control ¡Plane ¡
Forwarding ¡
State ¡
Control ¡Plane ¡
Forwarding ¡
State ¡
Control ¡Plane ¡
Forwarding ¡
State ¡
Control ¡Plane ¡
¡ ¡ ¡ ¡ ¡ ¡
17 ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
¡ ¡ ¡ ¡ ¡ ¡
18 ¡
ping traceroute tcpdump SNMP
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
– Between ¡mulTple ¡protocols ¡on ¡a ¡switch/router. ¡ – Between ¡state ¡on ¡different ¡switches/routers. ¡
¡
– Observe ¡all ¡state. ¡ – Control ¡all ¡state. ¡
“The ¡Future ¡of ¡Networking ¡and ¡the ¡Past ¡of ¡Protocols” ¡
Global Network View
Network ¡VirtualizaTon ¡
Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡
Network ¡OS ¡
Abstract Network View
Control Programs
f View
Control Programs
f View
Control Programs
f View
Abstract Forwarding Model (e.g. OpenFlow)
– Control ¡plane ¡can ¡run ¡on ¡modern ¡servers ¡ – Can ¡adopt ¡so\ware ¡engineering ¡best-‑pracTces ¡ – Easier ¡to ¡add ¡new ¡control ¡programs ¡ – …or ¡customize ¡locally ¡ – Solve ¡distributed ¡systems ¡problem ¡once, ¡rather ¡ than ¡for ¡every ¡protocol ¡
Specialized Hardware
OS ¡
OSPF ¡ ¡
¡ ¡ ¡ ¡
¡
Dijkstra ¡
Network ¡ Map ¡
95% ¡ 5% ¡
OSPF ¡ ¡ Dijkstra ¡ Network ¡OS ¡
Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡
Global Network Map
– e.g. ¡OpenFlow ¡ – Vendor-‑agnosTc ¡interface ¡to ¡forwarding ¡plane ¡ – Simpler, ¡lower-‑cost, ¡lower-‑power ¡hardware ¡
If ¡dst ¡MAC ¡ ¡ address ¡is ¡X ¡ Send ¡out ¡port ¡1 ¡
L2 ¡Switch ¡
If ¡dst ¡port ¡ is ¡22 ¡ Drop ¡packet ¡
Firewall ¡
Match ¡ AcTon ¡
Forwarding ¡State ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
28 ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
If ¡dst ¡IP ¡address ¡ ¡ is ¡Y ¡ Decrement ¡TTL, ¡ Update ¡checksum, ¡ Modify ¡dst ¡MAC, ¡ Send ¡out ¡port ¡2 ¡
L3 ¡Router ¡
Match Action
F Action(F) G Action(G) H Action(H) H
H’
Ac<on ¡Primi<ves ¡
“Plumbing ¡primiTves” ¡
Match Action
F1 Action(F) G1 Action(G) H1 Action(H)
Match Action
Fn Action(F) Gn Action(G) Hn Action(H)
Hn H1 H’
Match: ¡Very ¡general, ¡not ¡protocol ¡specific. ¡ ¡ Ac<on: ¡Small ¡instrucTon ¡set, ¡not ¡protocol ¡specific. ¡ – Make ¡it ¡easy ¡to ¡add ¡new ¡headers ¡and ¡acTons. ¡ – Any ¡network ¡(packet, ¡circuit, ¡radio). ¡ ¡
Match: ¡include ¡well-‑known ¡header ¡fields. ¡ Ac<on: ¡necessary ¡set ¡for ¡exisTng ¡protocols. ¡ – Support ¡exisTng ¡protocols ¡on ¡exisTng ¡switch ¡chips. ¡
Well-‑defined ¡forwarding ¡behavior ¡
– The ¡forwarding ¡tables ¡capture ¡the ¡enTre ¡ forwarding ¡behavior. ¡ – Control ¡plane ¡writes ¡the ¡forwarding ¡state. ¡ – Therefore, ¡we ¡can ¡verify ¡its ¡correctness. ¡
Global Network Map Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Control Program Control Program Control Program
firewall.c … if( TCP_port == SMTP ) dropPacket(); …
Match Action
F Action(F) G Action(G) H Action(H)
Match Action
A Action(A) G Action(G) D Action(D)
Match Action
A Action(A) B Action(B) C Action(C)
Match Action
X Action(X) Y Action(Y) Z Action(Z)
Match Action
A Action(A) G Action(G) H Action(H)
Network ¡OS ¡
Global Network Map Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Control Program Control Program Control Program
Match Action
F Action(F) G Action(G) H Action(H)
Match Action
A Action(A) G Action(G) D Action(D)
Match Action
A Action(A) B Action(B) C Action(C)
Match Action
X Action(X) Y Action(Y) Z Action(Z)
Match Action
A Action(A) G Action(G) H Action(H)
Network ¡OS ¡
firewall.c … if( TCP_port == SMTP) dropPacket(); …
Global Network Map Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Packet ¡ Forwarding ¡ ¡ ¡ Control Program Control Program Control Program
Match Action
F Action(F) G Action(G) H Action(H)
Match Action
A Action(A) G Action(G) D Action(D)
Match Action
A Action(A) B Action(B) C Action(C)
Match Action
X Action(X) Y Action(Y) Z Action(Z)
Match Action
A Action(A) G Action(G) H Action(H)
Network ¡OS ¡
¡ “A ¡can ¡talk ¡to ¡B” ¡ ¡ “Guests ¡can’t ¡reach ¡ PaTentRecords” ¡ ¡ “No ¡loops” ¡
Policy ¡
Forwarding ¡ Behavior ¡
“Independently ¡checking ¡correctness” ¡
¡
“Checking ¡new ¡state ¡before ¡it ¡is ¡added” ¡
“Is ¡the ¡datapath ¡behaving ¡correctly?” ¡
“Finding ¡bugs, ¡and ¡their ¡root ¡cause, ¡ ¡ in ¡an ¡operaTonal ¡network” ¡
L
Header ¡ Data ¡
01110011…1 ¡
Header ¡ Data ¡
111..100000 ¡
1 2
Match ¡+ ¡AcTon ¡
T1(h, p)
T2(h, p)
T3(h, p)
T1(X, Pin) T1(X, Pin)
T2(T1(X, Pin))
T4(T1(X, Pin))
T3(T2(T1(X, Pin))) ∪ T3(T4(T1(X, Pin)))
T4(h, p)
T1(h, p)
T2(h, p)
T3(h, p)
T4(h, p)
“Independently ¡checking ¡correctness” ¡
¡
“Checking ¡new ¡state ¡before ¡it ¡is ¡added” ¡
“Is ¡the ¡datapath ¡behaving ¡correctly?” ¡
“Finding ¡bugs, ¡and ¡their ¡root ¡cause, ¡ ¡ in ¡an ¡operaTonal ¡network” ¡
Basic ¡idea: ¡
¡ Enormous ¡amounts ¡of ¡data: ¡
45 ¡
46 ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Symptom: ¡ Errant ¡packet ¡ behavior ¡in ¡the ¡ dataplane ¡ ¡
Cause: ¡ Forwarding ¡ State ¡ ¡
Packet ¡ History ¡ ¡
A ¡ B ¡
47 ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Packet ¡history ¡ ¡= ¡ ¡Path ¡taken ¡by ¡a ¡packet ¡ ¡ ¡ ¡ ¡ ¡ ¡+ ¡Header ¡modificaTons ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡+ ¡Switch ¡state ¡encountered ¡
48 ¡
¡ ¡ ¡ ¡ ¡ ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡
Forwarding ¡
State ¡ A ¡
B ¡
49 ¡
¡ ¡ ¡ ¡ ¡ ¡
Packet ¡History ¡Filter: ¡A ¡regular-‑expression-‑like ¡ language ¡to ¡specify ¡packet ¡histories ¡of ¡interest ¡
50 ¡
Switch 1: { header: H1, inport: p0,
mods: [...] state version: 3 }
¡ ¡ ¡ ¡ ¡ ¡
Switch 2: { header: H2, inport: p0,
mods: [...] state version: 5 } Switch N: { header: HN, inport: p3,
mods: [...] state version: 13 }
51 ¡
Switch 1: { header: H1, inport: p0,
mods: [...] state version: 3 }
Postcard ¡Filter ¡
¡
Example: ¡
¡
¡ ¡
PHF ¡to ¡match ¡packets ¡that: ¡
{{--dpid X}}.*{{--dpid Y}}$
Y: ¡ ¡
{{--bpf "udp" –-dpid X}}[^{{--dpid Y}}]*$
52 ¡
Postcard ¡ Collector ¡
53 ¡
¡ ¡ ¡ ¡ ¡ ¡
Control ¡Plane ¡ Flow ¡Table ¡State ¡Recorder ¡
Postcard ¡ Collector ¡
54 ¡
¡ ¡ ¡ ¡ ¡ ¡
Control ¡Plane ¡ Flow ¡Table ¡State ¡Recorder ¡
Match ¡ ACT ¡ Match ¡ ACT ¡
InformaTon” ¡
specific ¡port ¡
Postcard ¡ Collector ¡
55 ¡
¡ ¡ ¡ ¡ ¡ ¡
Control ¡Plane ¡ Flow ¡Table ¡State ¡Recorder ¡
Postcard ¡ Collector ¡
56 ¡
¡ ¡ ¡ ¡ ¡ ¡
Control ¡Plane ¡ Flow ¡Table ¡State ¡Recorder ¡
Version ¡-‑> ¡Flow ¡Table ¡ State ¡ Packet ¡Header ¡ Switch ¡ID ¡ Output ¡port ¡ Version ¡
Postcard ¡ Collector ¡
57 ¡
¡ ¡ ¡ ¡ ¡ ¡
Control ¡Plane ¡ Flow ¡Table ¡State ¡Recorder ¡
“Independently ¡checking ¡correctness” ¡
¡
“Checking ¡new ¡state ¡before ¡it ¡is ¡added” ¡
“Is ¡the ¡datapath ¡behaving ¡correctly?” ¡
“Finding ¡bugs, ¡and ¡their ¡root ¡cause, ¡ ¡ in ¡an ¡operaTonal ¡network” ¡