nv a framework for modeling and verifying network
play

NV: A Framework for Modeling and Verifying Network Configurations - PowerPoint PPT Presentation

NV: A Framework for Modeling and Verifying Network Configurations LangSec 2020 David Walker Princeton University Collaborators Nick Giannarakis Devon Loehr Tim Thijm Ratul Mahajan Ryan Beckett Aarti Gupta (UW) (Microsoft) Language-Based


  1. NV: A Framework for Modeling and Verifying Network Configurations LangSec 2020 David Walker Princeton University

  2. Collaborators Nick Giannarakis Devon Loehr Tim Thijm Ratul Mahajan Ryan Beckett Aarti Gupta (UW) (Microsoft)

  3. Language-Based Security

  4. Language-Based Security for Networks

  5. Routing 101 Hoolie 𝑆 � “I can reach subnet X” “I can reach subnet X” 𝑆 � 𝑆 � 𝑆 � “I can reach subnet X” subnet X traffic Pied Piper

  6. An Example Route Hijack Hoolie subnet Y subnet X

  7. An Example Route Hijack Hoolie subnet Y subnet X

  8. An Example Route Hijack Pied Piper “I can reach subnet X” Hoolie subnet Y subnet X

  9. An Example Route Hijack Pied Piper Hoolie subnet Y subnet X

  10. This Kind of Thing Happens Too Often

  11. Why? Networks are: • Large (100K+ LOC) • Distributed • Low-level • Multiple vendors • Subject to failures Too much for humans to handle

  12. We need automated analysis! Generic Network Models To model the many ad hoc vendor languages in a uniform way [Griffin 2002, Sobrinho 2005] [SIGCOMM 2017, SIGCOMM 2018, PLDI 2020] Effective Abstractions and Efficient Algorithms To analyze these model at scale [POPL 2020, PLDI 2020]

  13. Network Models

  14. Routing Algebra [Griffin 2002, Sobrinho 2005] �𝑊 , 𝐹� 𝐔𝐩𝐪𝐩𝐦𝐩𝐡𝐳 : �𝑇 , ⊕ , 𝑔 , 𝑗𝑜𝑗𝑢� 𝐁𝐦𝐡𝐟𝐜𝐬𝐛 : set of routes initial route merge transfer S → 𝑇 → 𝑇 V → 𝑇 (protocol messages) E → 𝑇 → 𝑇 � select preferred route � Given an algebra, one can simulate it, looking for its solutions .

  15. Routing Example (Idealized BGP) (no route) S = { ∞ } U { ( preference , path , set of tags ) } ⊕ = “select the most preferred route” (route with higher preference, shorter path) 𝑔 (src,dst) = add src to path; adjust preference, tags according to configuration init = given by configuration

  16. Routing Example (Idealized BGP) messages S = { ∞ } U { ( preference , path , set of tags ) } 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) ∞ � 100, �𝑆 � � , � 8075: 30 �� 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � � 100, �𝑆 � , 𝑆 � , 𝑆 � � , � 8075: 30 �� ∞ � 100, �𝑆 � , 𝑆 � � , ∅� ∞ � 100, �� , ∅� � 200, �𝑆 � , 𝑆 � � , � 8075: 30 �� � 200, �𝑆 � , 𝑆 � � , � 8075: 30 �� ⊕ � 100, �𝑆 � , 𝑆 � � , ∅� � 100, �𝑆 � � , ∅� ∞ ⊕ � 100, �𝑆 � � , ∅� ∞ Further propagation of routes causes no change? We have found a solution .

  17. Research Progress Cycle �𝑇 , ⊕ , 𝑔 , 𝑗𝑜𝑗𝑢� Iterate Research idea Evaluate 1 year prototype Cisco (IOS, NX ‐ OS) Juniper, Arista BGP, OSPF, ISIS, RIP, iBGP Route Reflectors, Redistribution, Conditional advertisement, aggregation, ACLs, MPLS, GRE, …

  18. NV: A Language for Modelling Networks Cisco NV Juniper Ryan Beckett Nick Giannarakis Devon Loehr (Microsoft) • ad hoc • standard • non ‐ uniform • uniform • compositional • non ‐ compositional • concise • complex • 23+ commands to set protocol fields • 1 command to get a record field

  19. NV Language idealized_bgp.nv let nodes = 5; let edges = { 1-2; 1-3; 2-4; 3-4; 4-5; } type route = {pref:int; len:int; orig:node; tags:int set} type message = option[route] let init n = if n = 1 then Some {pref=100; len=0; orig=1; tags=empty;} else None let f e m = let protocol m = {pref=m.pref; len=m.len + 1; orig=orig; tags=tags;} in let config e m = ... in m |> protocol |> config e let merge n m1 m2 = if is_preferred m1 m2 then m1 else m2

  20. NV Language idealized_bgp.nv let nodes = 5; let edges = { 1-2; 1-3; 2-4; 3-4; 4-5; } let init n = ... let f e m = ... let merge n m1 m2 = ... let sol = solution {init= init ; trans= f ; merge= merge ;} (* Does router R5 have a route to R1? *) let prop sol = match sol[5] with None –> false | Some {pref=_; len=_; orig=n; comm=_;} -> (n = 1) assert prop(sol);

  21. The Power of Language: Exploring New Models Iterate �𝑇 , ⊕ , 𝑔 , 𝑗𝑜𝑗𝑢� Success Research idea Implement Evaluate prototype prototype (NV)

  22. Recall: A BGP Hijack Pied piper Hoolie host 2 host 1

  23. Can Pied Piper Hijack Hoolie? Hoolie 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � 1. if peer = R6 2. pref := 200 𝑆 � 3. permit Pied Piper

  24. Can Pied Piper Hijack Hoolie? let nodes = 6 let edges = { 1-2; 1-3; 2-4; 3-4; 4-5; 6-2; } type route = {pref:int; len:int; orig:node; tags:int set} type message = option[route] symbolic u : route (* unknown route *) require u.orig = 6; let init n = if n = 6 then Some u else ... let f e m = let protocol m = ... in let config e m = match e with | 6~2 -> {pref=200; ... } | _ -> ... in m |> protocol |> config e assert prop(sol);

  25. Is Hoolie’s Network Fault Tolerant? Hoolie 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 �

  26. Is Hoolie’s Network Fault Tolerant? Hoolie 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � duh ...

  27. Is Hoolie’s Network Fault Tolerant? let nodes = 5 let edges = { 1-2; 1-3; 2-4; 3-4; 4-5} type route = {pref:int; len:int; orig:node; tags:int set} type message = option[route] symbolic failure : edge (* the failed edge *) let f e m = let fail e m = if e = failure then None else m in let protocol m = ... in let config e m = ... in m |> fail e |> protocol |> config e assert prop(sol);

  28. Aside: Eliminating Symbolic Values type message = option[route] symbolic failure : edge let f e m = let fail e m = if e = failure then None else m in ... type message = dict[edge , option[route]] let f e m = let fail e m = mapif (fun e -> e = failure then None else m) m ...

  29. Aside: Eliminating Symbolic Values type message = option[route] symbolic failure : edge let f e m = let fail e m = if e = failure then None else m in ... type message = dict[edge, option[route]] let f e m = let fail e m = mapif (fun e -> e = failure) (fun m -> None) m ...

  30. More Realistic Networks type ospf = { ad : int; weight : int; areaType : int4; areaId : int;} type bgp = { ad : int; lp : int; aslen : int; comms : set[int16]; origin : int;} type rib_entry = { connected : option[edge]; static : option[edge]; ospf : option[ospf]; bgp : option[bgp]; selected : option[int2] } type prefixV4 = { ip : int32; len : int5; } type attribute = dict[prefixV4, rib_entry]

  31. NV Tools Cisco NV Juniper Z3 Simulation

  32. The Scalability Problem control plane simulation CBGP [Mai 2011] Batfish [Fogel 2015] control plane verification [Gember ‐ Jacobsen 2016] ARC 400 [Beckett 2017] Minesweeper Simulation time 350 300 (seconds) 250 32GB RAM 200 150 100 50 0 10,000 0 100 200 300 400 500 600 700 (Large modern data center) Datacenter Size (routers)

  33. The Scalability Problem (AWS) Software control plane simulation [Mai 2011] Network [Fogel 2015] control plane verification Cost [Gember ‐ Jacobsen 2016] ARC Storage [Beckett 2017] Minesweeper Compute Cloud growth by quarter (AWS) 2018 2009 Time 228x growth in networks in a decad

  34. Effective Abstractions & Efficient Algorithms

  35. Abstract Interpretation of Routing Algebras Aarti Ratul Ryan Mahajan Gupta Beckett Message Abstraction: asympototic improvements in time and space

  36. Abstract Interpretation of Routing Algebras Base Model Idealized BGP option[(preference, Abstract Model option[(preference, length, path, option[ tag abstraction ] origin, tag set)] tag set)] true, false, *

  37. Abstract Interpretation of Routing Algebras 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) None 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � Some false None None None Property: Does R5 obtain any route?

  38. Abstract Interpretation of Routing Algebras 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) Some true 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � Some false None None Some false Property: Does R5 obtain any route?

  39. Abstract Interpretation of Routing Algebras 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) Some true 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � Some false (Some true) None ⊕ (Some false) = (Some *) Some false Property: Does R5 obtain any route?

  40. Abstract Interpretation of Routing Algebras 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) Some true 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � Some false (Some *) (Some *) Some false Property: Does R5 obtain any route?

  41. Abstract Interpretation of Routing Algebras 1. if attached(8075:30) 2. set localpref 200 1. if peer = R3 3. permit 2. add tag(8075:30) Some true 4. else 3. permit 5. default permit 𝑆 � 𝑆 � 𝑆 � 𝑆 � 𝑆 � Some false (Some *) (Some *) Some false Yes Property: Does R5 obtain any route?

  42. Example 2: Datacenter Simulation 𝑇 � Spine Routers (S) 𝐵 � 𝐵 � Aggregation Routers (A) 𝑈 � 𝑈 𝑈 � 𝑈 � 𝑈 𝑈 � � � Top-of-Rack Routers (T)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend