Machine-Verified Controllers Arjun Guha, Mark Reitblatt, and Nate - - PowerPoint PPT Presentation

machine verified controllers
SMART_READER_LITE
LIVE PREVIEW

Machine-Verified Controllers Arjun Guha, Mark Reitblatt, and Nate - - PowerPoint PPT Presentation

Machine-Verified Controllers Arjun Guha, Mark Reitblatt, and Nate Foster Cornell University 1 Networks in the News 2 Networks in the News a network change was performed [] executed incorrectly [] more stuck volumes and added


slide-1
SLIDE 1

Machine-Verified Controllers

Arjun Guha, Mark Reitblatt, and Nate Foster

1

Cornell University

slide-2
SLIDE 2

2

Networks in the News

slide-3
SLIDE 3

2

a network change was performed […] executed incorrectly […] more “stuck” volumes and added more requests to the re-mirroring storm

Networks in the News

slide-4
SLIDE 4

2

a network change was performed […] executed incorrectly […] more “stuck” volumes and added more requests to the re-mirroring storm experienced a network connectivity issue […] interrupted the airline's flight departures, airport processing and reservations systems

Networks in the News

slide-5
SLIDE 5

2

service outage was due to a series of internal network events that corrupted router data tables a network change was performed […] executed incorrectly […] more “stuck” volumes and added more requests to the re-mirroring storm experienced a network connectivity issue […] interrupted the airline's flight departures, airport processing and reservations systems

Networks in the News

slide-6
SLIDE 6

3

slide-7
SLIDE 7

3

SDN Facilitates Formal Methods

slide-8
SLIDE 8

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

slide-9
SLIDE 9

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

slide-10
SLIDE 10

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
slide-11
SLIDE 11

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band

slide-12
SLIDE 12

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

slide-13
SLIDE 13

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

  • symbolic execution /

model checking

  • finds several bugs

statically

slide-14
SLIDE 14

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

  • symbolic execution /

model checking

  • finds several bugs

statically

  • seconds to days to

test, no runtime cost

slide-15
SLIDE 15

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

  • symbolic execution /

model checking

  • finds several bugs

statically

  • seconds to days to

test, no runtime cost

  • cannot prove the

absence of bugs

slide-16
SLIDE 16

3

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime safety

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

  • symbolic execution /

model checking

  • finds several bugs

statically

  • seconds to days to

test, no runtime cost

  • cannot prove the

absence of bugs Verified Controllers: this talk

  • program verification
  • proof of correctness
  • no runtime cost
  • proof w.r.t. a detailed

model of OpenFlow forwarding

slide-17
SLIDE 17

Bugs in Controllers

4

slide-18
SLIDE 18

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Running Example

slide-19
SLIDE 19

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

Running Example

slide-20
SLIDE 20

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop

Running Example

slide-21
SLIDE 21

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2

Running Example

slide-22
SLIDE 22

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

slide-23
SLIDE 23

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

never violated

slide-24
SLIDE 24

5

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

never violated

barring congestion / failure barring congestion / failure

slide-25
SLIDE 25

6

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

slide-26
SLIDE 26

6

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

Priority Pattern Action

slide-27
SLIDE 27

6

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

Priority Pattern Action 10 dstPort: ¡22 []

slide-28
SLIDE 28

6

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3

slide-29
SLIDE 29

6

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Running Example

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

slide-30
SLIDE 30

7

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

slide-31
SLIDE 31

7

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-32
SLIDE 32

flow_mod flow_mod flow_mod 7

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

What if ...

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-33
SLIDE 33

flow_mod flow_mod flow_mod 7

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

What if ...

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-34
SLIDE 34

flow_mod flow_mod flow_mod 7

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

What if ...

packet_in

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-35
SLIDE 35

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

8

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-36
SLIDE 36

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

8

must be equivalent

Block SSH traffic Forward other traffic normally Log Web requests

dstPort == 22 ⟹ Drop dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 dstPort == 80 ⟹ Fwd 3

slide-37
SLIDE 37

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

9

slide-38
SLIDE 38

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

9 dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2

slide-39
SLIDE 39

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

9 dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 dstPort: ¡22 [] dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3

slide-40
SLIDE 40

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2])

9 dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 dstPort: ¡22 [] dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2

Transient policy violation

slide-41
SLIDE 41

10

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

slide-42
SLIDE 42

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

11

slide-43
SLIDE 43

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

11

Match all packets!?

slide-44
SLIDE 44

12

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

slide-45
SLIDE 45

12

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

slide-46
SLIDE 46

13

Recap: Bugs in Controllers

slide-47
SLIDE 47

13

Recap: Bugs in Controllers

Violation Guilty Controllers

slide-48
SLIDE 48

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly

slide-49
SLIDE 49

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved)

slide-50
SLIDE 50

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers

slide-51
SLIDE 51

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP

slide-52
SLIDE 52

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

† Nettle is only affected by missing protocol numbers

slide-53
SLIDE 53

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

slide-54
SLIDE 54

13

Recap: Bugs in Controllers

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

discovered by formalizing OpenFlow

slide-55
SLIDE 55

14

SDN Facilitates Formal Methods

Run-time Monitoring: VeriFlow

by Khurshid, Zhou, Caesar, and Godfrey

  • runtime property

checking

  • detects errors

dynamically

  • small runtime
  • verhead
  • fixes must be out-of-

band Static Bug-Finding: NICE

by Canini, Venzano, Perešíni, Kostić, and Rexford

  • symbolic execution /

model checking

  • finds several bugs

statically

  • seconds to days to

test, no runtime cost

  • cannot prove the

absence of bugs Verified Controllers: this talk

  • program verification
  • proof of correctness
  • no runtime cost
  • proof w.r.t. a detailed

model of OpenFlow

slide-56
SLIDE 56

15

VeriFlow: Reachability

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

slide-57
SLIDE 57

15

VeriFlow: Reachability

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

liveness: eventually produces packet_out

slide-58
SLIDE 58

15

VeriFlow: Reachability

Violation Guilty Controllers

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

liveness: eventually produces packet_out “acceptable violation”?

slide-59
SLIDE 59

16

NICE: Library of Properties

Violation Guilty Controller

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

slide-60
SLIDE 60

16

NICE: Library of Properties

Violation Guilty Controller

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

assumes FIFO message processing

slide-61
SLIDE 61

16

NICE: Library of Properties

Violation Guilty Controller

handles packet_in incorrectly PANE (absolved) does not use barriers NetCore, PANE, Nettle-FRP synthesizes malformed patterns NetCore, PANE, Nettle-FRP†

  • ptimizer breaks flow tables

NetCore (absolved)

† Nettle is only affected by missing protocol numbers

assumes FIFO message processing requires high-level policy

slide-62
SLIDE 62

17

slide-63
SLIDE 63

A Sample of Recent Verification

17

Successes: Tools: Textbooks:

slide-64
SLIDE 64

A Sample of Recent Verification

17

Operating Systems Compilers seL4 SOSP 2009 CompCert CACM, July 2009 Verve PLDI 2010 F* POPL 2012

Successes: Tools: Textbooks:

slide-65
SLIDE 65

A Sample of Recent Verification

17

Operating Systems Compilers seL4 SOSP 2009 CompCert CACM, July 2009 Verve PLDI 2010 F* POPL 2012

Successes: Tools: Textbooks:

slide-66
SLIDE 66

A Sample of Recent Verification

17

Operating Systems Compilers seL4 SOSP 2009 CompCert CACM, July 2009 Verve PLDI 2010 F* POPL 2012

Successes: Tools: Textbooks:

Certified Programming with Dependent Types

slide-67
SLIDE 67

Mathematical Foundations of SDN

18

slide-68
SLIDE 68

19

42 pages of prose and C structs ...

OpenFlow 1.0 specification

slide-69
SLIDE 69

19

42 pages of prose and C structs ...

OpenFlow 1.0 specification

Definition ¡Switch ¡:= ¡Id ¡* ¡Ports ¡* ¡FlowTbl ¡* ¡InBuf ¡* ¡OutBuf ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡* ¡OFInBuf ¡* ¡OFOutBuf.

slide-70
SLIDE 70

19

42 pages of prose and C structs ...

OpenFlow 1.0 specification

Definition ¡Switch ¡:= ¡Id ¡* ¡Ports ¡* ¡FlowTbl ¡* ¡InBuf ¡* ¡OutBuf ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡* ¡OFInBuf ¡* ¡OFOutBuf. Definition ¡Controller ¡:= ¡State ¡* ¡InFunc ¡* ¡OutFunc.

slide-71
SLIDE 71

19

42 pages of prose and C structs ...

OpenFlow 1.0 specification

Definition ¡Switch ¡:= ¡Id ¡* ¡Ports ¡* ¡FlowTbl ¡* ¡InBuf ¡* ¡OutBuf ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡* ¡OFInBuf ¡* ¡OFOutBuf. Definition ¡Controller ¡:= ¡State ¡* ¡InFunc ¡* ¡OutFunc. Definition ¡Link ¡:= ¡(Switch ¡* ¡Port) ¡* ¡list ¡Packet ¡* ¡(Switch ¡* ¡Port).

slide-72
SLIDE 72

19

42 pages of prose and C structs ...

OpenFlow 1.0 specification

Definition ¡Switch ¡:= ¡Id ¡* ¡Ports ¡* ¡FlowTbl ¡* ¡InBuf ¡* ¡OutBuf ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡* ¡OFInBuf ¡* ¡OFOutBuf. Definition ¡Controller ¡:= ¡State ¡* ¡InFunc ¡* ¡OutFunc. Definition ¡Link ¡:= ¡(Switch ¡* ¡Port) ¡* ¡list ¡Packet ¡* ¡(Switch ¡* ¡Port). Definition ¡OpenFlowLink ¡:= ¡Id ¡* ¡list ¡SwitchMsg ¡* ¡list ¡CtrlMsg.

slide-73
SLIDE 73

20

/* ¡Fields ¡to ¡match ¡against ¡flows ¡*/ struct ¡ofp_match ¡{ ¡ ¡ ¡ ¡uint32_t ¡wildcards; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Wildcard ¡fields. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡in_port; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡switch ¡port. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_src[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_dst[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡dl_vlan; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_vlan_pcp; ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN ¡priority. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad1[1]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint16_5 ¡dl_type; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Ethernet ¡frame ¡type. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_tos; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡ToS ¡(DSCP ¡field, ¡6 ¡bits). ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_proto; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡protocol ¡or ¡lower ¡8 ¡bits ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ARP ¡opcode. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad2[2]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡source ¡port. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡destination ¡port. ¡*/ }; OFP_ASSERT(sizeof(struct ¡ofp_match) ¡== ¡40);

slide-74
SLIDE 74

20

/* ¡Fields ¡to ¡match ¡against ¡flows ¡*/ struct ¡ofp_match ¡{ ¡ ¡ ¡ ¡uint32_t ¡wildcards; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Wildcard ¡fields. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡in_port; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡switch ¡port. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_src[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_dst[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡dl_vlan; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_vlan_pcp; ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN ¡priority. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad1[1]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint16_5 ¡dl_type; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Ethernet ¡frame ¡type. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_tos; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡ToS ¡(DSCP ¡field, ¡6 ¡bits). ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_proto; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡protocol ¡or ¡lower ¡8 ¡bits ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ARP ¡opcode. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad2[2]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡source ¡port. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡destination ¡port. ¡*/ }; OFP_ASSERT(sizeof(struct ¡ofp_match) ¡== ¡40); Record ¡Pattern ¡: ¡Type ¡:= ¡MkPattern ¡{ ¡ ¡dlSrc ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlDst ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlType ¡: ¡Wildcard ¡EthernetType; ¡ ¡dlVlan ¡: ¡Wildcard ¡VLAN; ¡ ¡dlVlanPcp ¡: ¡Wildcard ¡VLANPriority; ¡ ¡nwSrc ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwDst ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwProto ¡: ¡Wildcard ¡IPProtocol; ¡ ¡nwTos ¡: ¡Wildcard ¡IPTypeOfService; ¡ ¡tpSrc ¡: ¡Wildcard ¡TransportPort; ¡ ¡tpDst ¡: ¡Wildcard ¡TransportPort; ¡ ¡inPort ¡: ¡Wildcard ¡Port }.

slide-75
SLIDE 75

20

/* ¡Fields ¡to ¡match ¡against ¡flows ¡*/ struct ¡ofp_match ¡{ ¡ ¡ ¡ ¡uint32_t ¡wildcards; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Wildcard ¡fields. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡in_port; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡switch ¡port. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_src[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_dst[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡dl_vlan; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_vlan_pcp; ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN ¡priority. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad1[1]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint16_5 ¡dl_type; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Ethernet ¡frame ¡type. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_tos; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡ToS ¡(DSCP ¡field, ¡6 ¡bits). ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_proto; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡protocol ¡or ¡lower ¡8 ¡bits ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ARP ¡opcode. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad2[2]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡source ¡port. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡destination ¡port. ¡*/ }; OFP_ASSERT(sizeof(struct ¡ofp_match) ¡== ¡40); Record ¡Pattern ¡: ¡Type ¡:= ¡MkPattern ¡{ ¡ ¡dlSrc ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlDst ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlType ¡: ¡Wildcard ¡EthernetType; ¡ ¡dlVlan ¡: ¡Wildcard ¡VLAN; ¡ ¡dlVlanPcp ¡: ¡Wildcard ¡VLANPriority; ¡ ¡nwSrc ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwDst ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwProto ¡: ¡Wildcard ¡IPProtocol; ¡ ¡nwTos ¡: ¡Wildcard ¡IPTypeOfService; ¡ ¡tpSrc ¡: ¡Wildcard ¡TransportPort; ¡ ¡tpDst ¡: ¡Wildcard ¡TransportPort; ¡ ¡inPort ¡: ¡Wildcard ¡Port }.

slide-76
SLIDE 76

20

Definition ¡Pattern_inter ¡(p ¡p':Pattern) ¡:= ¡ ¡let ¡dlSrc ¡:= ¡Wildcard_inter ¡EthernetAddress.eqdec ¡(ptrnDlSrc ¡p) ¡(ptrnDlSrc ¡p') ¡in ¡ ¡let ¡dlDst ¡:= ¡Wildcard_inter ¡EthernetAddress.eqdec ¡(ptrnDlDst ¡p) ¡(ptrnDlDst ¡p') ¡in ¡ ¡let ¡dlType ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnDlType ¡p) ¡(ptrnDlType ¡p') ¡in ¡ ¡let ¡dlVlan ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnDlVlan ¡p) ¡(ptrnDlVlan ¡p') ¡in ¡ ¡let ¡dlVlanPcp ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnDlVlanPcp ¡p) ¡(ptrnDlVlanPcp ¡p') ¡in ¡ ¡let ¡nwSrc ¡:= ¡Wildcard_inter ¡Word32.eqdec ¡(ptrnNwSrc ¡p) ¡(ptrnNwSrc ¡p') ¡in ¡ ¡let ¡nwDst ¡:= ¡Wildcard_inter ¡Word32.eqdec ¡(ptrnNwDst ¡p) ¡(ptrnNwDst ¡p') ¡in ¡ ¡let ¡nwProto ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnNwProto ¡p) ¡(ptrnNwProto ¡p') ¡in ¡ ¡let ¡nwTos ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnNwTos ¡p) ¡(ptrnNwTos ¡p') ¡in ¡ ¡let ¡tpSrc ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnTpSrc ¡p) ¡(ptrnTpSrc ¡p') ¡in ¡ ¡let ¡tpDst ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnTpDst ¡p) ¡(ptrnTpDst ¡p') ¡in ¡ ¡let ¡inPort ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnInPort ¡p) ¡(ptrnInPort ¡p') ¡in ¡ ¡ ¡ ¡MkPattern ¡dlSrc ¡dlDst ¡dlType ¡dlVlan ¡dlVlanPcp ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡nwSrc ¡nwDst ¡nwProto ¡nwTos ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡tpSrc ¡tpDst ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡inPort. Definition ¡exact_pattern ¡(pk ¡: ¡Packet) ¡(pt ¡: ¡Word16.T) ¡: ¡Pattern ¡:= ¡ ¡MkPattern ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlSrc ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlTyp ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlVlan ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlVlanPcp ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwSrc ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwProto ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwTos ¡pk)) ¡ ¡ ¡ ¡(Wildcard_of_option ¡(pktTpSrc ¡pk)) ¡ ¡ ¡ ¡(Wildcard_of_option ¡(pktTpDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡pt). Definition ¡match_packet ¡(pt ¡: ¡Word16.T) ¡(pk ¡: ¡Packet) ¡(pat ¡: ¡Pattern) ¡: ¡bool ¡:= ¡ ¡negb ¡(Pattern_is_empty ¡(Pattern_inter ¡(exact_pattern ¡pk ¡pt) ¡pat)).

/* ¡Fields ¡to ¡match ¡against ¡flows ¡*/ struct ¡ofp_match ¡{ ¡ ¡ ¡ ¡uint32_t ¡wildcards; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Wildcard ¡fields. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡in_port; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡switch ¡port. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_src[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_dst[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡dl_vlan; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_vlan_pcp; ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN ¡priority. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad1[1]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint16_5 ¡dl_type; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Ethernet ¡frame ¡type. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_tos; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡ToS ¡(DSCP ¡field, ¡6 ¡bits). ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_proto; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡protocol ¡or ¡lower ¡8 ¡bits ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ARP ¡opcode. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad2[2]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡source ¡port. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡destination ¡port. ¡*/ }; OFP_ASSERT(sizeof(struct ¡ofp_match) ¡== ¡40); Record ¡Pattern ¡: ¡Type ¡:= ¡MkPattern ¡{ ¡ ¡dlSrc ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlDst ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlType ¡: ¡Wildcard ¡EthernetType; ¡ ¡dlVlan ¡: ¡Wildcard ¡VLAN; ¡ ¡dlVlanPcp ¡: ¡Wildcard ¡VLANPriority; ¡ ¡nwSrc ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwDst ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwProto ¡: ¡Wildcard ¡IPProtocol; ¡ ¡nwTos ¡: ¡Wildcard ¡IPTypeOfService; ¡ ¡tpSrc ¡: ¡Wildcard ¡TransportPort; ¡ ¡tpDst ¡: ¡Wildcard ¡TransportPort; ¡ ¡inPort ¡: ¡Wildcard ¡Port }.

slide-77
SLIDE 77

20

Definition ¡Pattern_inter ¡(p ¡p':Pattern) ¡:= ¡ ¡let ¡dlSrc ¡:= ¡Wildcard_inter ¡EthernetAddress.eqdec ¡(ptrnDlSrc ¡p) ¡(ptrnDlSrc ¡p') ¡in ¡ ¡let ¡dlDst ¡:= ¡Wildcard_inter ¡EthernetAddress.eqdec ¡(ptrnDlDst ¡p) ¡(ptrnDlDst ¡p') ¡in ¡ ¡let ¡dlType ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnDlType ¡p) ¡(ptrnDlType ¡p') ¡in ¡ ¡let ¡dlVlan ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnDlVlan ¡p) ¡(ptrnDlVlan ¡p') ¡in ¡ ¡let ¡dlVlanPcp ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnDlVlanPcp ¡p) ¡(ptrnDlVlanPcp ¡p') ¡in ¡ ¡let ¡nwSrc ¡:= ¡Wildcard_inter ¡Word32.eqdec ¡(ptrnNwSrc ¡p) ¡(ptrnNwSrc ¡p') ¡in ¡ ¡let ¡nwDst ¡:= ¡Wildcard_inter ¡Word32.eqdec ¡(ptrnNwDst ¡p) ¡(ptrnNwDst ¡p') ¡in ¡ ¡let ¡nwProto ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnNwProto ¡p) ¡(ptrnNwProto ¡p') ¡in ¡ ¡let ¡nwTos ¡:= ¡Wildcard_inter ¡Word8.eqdec ¡(ptrnNwTos ¡p) ¡(ptrnNwTos ¡p') ¡in ¡ ¡let ¡tpSrc ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnTpSrc ¡p) ¡(ptrnTpSrc ¡p') ¡in ¡ ¡let ¡tpDst ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnTpDst ¡p) ¡(ptrnTpDst ¡p') ¡in ¡ ¡let ¡inPort ¡:= ¡Wildcard_inter ¡Word16.eqdec ¡(ptrnInPort ¡p) ¡(ptrnInPort ¡p') ¡in ¡ ¡ ¡ ¡MkPattern ¡dlSrc ¡dlDst ¡dlType ¡dlVlan ¡dlVlanPcp ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡nwSrc ¡nwDst ¡nwProto ¡nwTos ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡tpSrc ¡tpDst ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡inPort. Definition ¡exact_pattern ¡(pk ¡: ¡Packet) ¡(pt ¡: ¡Word16.T) ¡: ¡Pattern ¡:= ¡ ¡MkPattern ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlSrc ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlTyp ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlVlan ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktDlVlanPcp ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwSrc ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwProto ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡(pktNwTos ¡pk)) ¡ ¡ ¡ ¡(Wildcard_of_option ¡(pktTpSrc ¡pk)) ¡ ¡ ¡ ¡(Wildcard_of_option ¡(pktTpDst ¡pk)) ¡ ¡ ¡ ¡(WildcardExact ¡pt). Definition ¡match_packet ¡(pt ¡: ¡Word16.T) ¡(pk ¡: ¡Packet) ¡(pat ¡: ¡Pattern) ¡: ¡bool ¡:= ¡ ¡negb ¡(Pattern_is_empty ¡(Pattern_inter ¡(exact_pattern ¡pk ¡pt) ¡pat)).

/* ¡Fields ¡to ¡match ¡against ¡flows ¡*/ struct ¡ofp_match ¡{ ¡ ¡ ¡ ¡uint32_t ¡wildcards; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Wildcard ¡fields. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡in_port; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡switch ¡port. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_src[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_dst[OFP_ETH_ALEN]; ¡/* ¡Ethernet ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡dl_vlan; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡dl_vlan_pcp; ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Input ¡VLAN ¡priority. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad1[1]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint16_5 ¡dl_type; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Ethernet ¡frame ¡type. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_tos; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡ToS ¡(DSCP ¡field, ¡6 ¡bits). ¡*/ ¡ ¡ ¡ ¡uint8_t ¡nw_proto; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡protocol ¡or ¡lower ¡8 ¡bits ¡of ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ARP ¡opcode. ¡*/ ¡ ¡ ¡ ¡uint8_t ¡pad2[2]; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡Align ¡to ¡64-­‑bits. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡source ¡address. ¡*/ ¡ ¡ ¡ ¡uint32_t ¡nw_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡IP ¡destination ¡address. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_src; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡source ¡port. ¡*/ ¡ ¡ ¡ ¡uint16_t ¡tp_dst; ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡/* ¡TCP/UDP ¡destination ¡port. ¡*/ }; OFP_ASSERT(sizeof(struct ¡ofp_match) ¡== ¡40); Record ¡Pattern ¡: ¡Type ¡:= ¡MkPattern ¡{ ¡ ¡dlSrc ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlDst ¡: ¡Wildcard ¡EthernetAddress; ¡ ¡dlType ¡: ¡Wildcard ¡EthernetType; ¡ ¡dlVlan ¡: ¡Wildcard ¡VLAN; ¡ ¡dlVlanPcp ¡: ¡Wildcard ¡VLANPriority; ¡ ¡nwSrc ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwDst ¡: ¡Wildcard ¡IPAddress; ¡ ¡nwProto ¡: ¡Wildcard ¡IPProtocol; ¡ ¡nwTos ¡: ¡Wildcard ¡IPTypeOfService; ¡ ¡tpSrc ¡: ¡Wildcard ¡TransportPort; ¡ ¡tpDst ¡: ¡Wildcard ¡TransportPort; ¡ ¡inPort ¡: ¡Wildcard ¡Port }.

detailed model of matching, forwarding, and flow table update

slide-78
SLIDE 78

21

“In the absence of barrier messages, switches may arbitrarily reorder messages to maximize performance.” “There is no packet output ordering guaranteed within a port.”

slide-79
SLIDE 79

21

“In the absence of barrier messages, switches may arbitrarily reorder messages to maximize performance.” “There is no packet output ordering guaranteed within a port.” ¡ ¡Definition ¡InBuf ¡:= ¡MultiSet ¡Packet. ¡ ¡Definition ¡OutBuf ¡:= ¡MultiSet ¡Packet. ¡ ¡Definition ¡OFInBuf ¡:= ¡MultiSet ¡SwitchMsg. ¡ ¡Definition ¡OFOutBuf ¡:= ¡MultiSet ¡CtrlMsg.

slide-80
SLIDE 80

21

“In the absence of barrier messages, switches may arbitrarily reorder messages to maximize performance.” “There is no packet output ordering guaranteed within a port.” ¡ ¡Definition ¡InBuf ¡:= ¡MultiSet ¡Packet. ¡ ¡Definition ¡OutBuf ¡:= ¡MultiSet ¡Packet. ¡ ¡Definition ¡OFInBuf ¡:= ¡MultiSet ¡SwitchMsg. ¡ ¡Definition ¡OFOutBuf ¡:= ¡MultiSet ¡CtrlMsg.

essential asynchrony: packet buffers, message reordering, and barriers

slide-81
SLIDE 81

22

controller model: fully abstract

State : abstract type fout : State → Switch ⨉ CtrlMsg ⨉ State' fin : Switch ⨉ SwitchMsg ⨉ State → State’

slide-82
SLIDE 82

23

Featherweight OpenFlow

detailed model of matching, forwarding, and flow table update essential asynchrony: packet buffers, message reordering, and barriers controller model: fully abstract

slide-83
SLIDE 83

23

Featherweight OpenFlow

Only possible because the specification is simple and open

detailed model of matching, forwarding, and flow table update essential asynchrony: packet buffers, message reordering, and barriers controller model: fully abstract

slide-84
SLIDE 84

23

Featherweight OpenFlow

Only possible because the specification is simple and open

Future Work: counters and failures Intentionally Omitted serializing OpenFlow messages

detailed model of matching, forwarding, and flow table update essential asynchrony: packet buffers, message reordering, and barriers controller model: fully abstract

slide-85
SLIDE 85

A Verified Controller

24

slide-86
SLIDE 86

25

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

slide-87
SLIDE 87

25

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

slide-88
SLIDE 88

25

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

slide-89
SLIDE 89

25

Host 1 Host 2 Web Request Logger

Port 1 Port 2 Port 3

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

Barriers packet_in handler Frame type / protocol numbers

slide-90
SLIDE 90

26

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

slide-91
SLIDE 91

26

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

written by OpenFlow programmer

slide-92
SLIDE 92

26

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

written by OpenFlow programmer inserted by controller

slide-93
SLIDE 93

26

Desired Policy: Block SSH traffic Forward other traffic normally Log Web requests

def ¡switch_join(sw): ¡ ¡sw.flow_mod(10, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstPort: ¡22 ¡}, ¡[]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H1, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡1, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(9, ¡{ ¡eth: ¡0x800, ¡proto: ¡6, ¡dstIP: ¡H2, ¡dstPort: ¡80 ¡}, ¡[Fwd ¡2, ¡Fwd ¡3]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H1 ¡}, ¡[Fwd ¡1]) ¡ ¡sw.barrier_request() ¡ ¡sw.flow_mod(8, ¡{ ¡eth: ¡0x800, ¡dstIP: ¡H2 ¡}, ¡[Fwd ¡2]) def ¡packet_in(sw, ¡pkt): ¡ ¡actions ¡= ¡[] ¡ ¡if ¡pkt.dstPort ¡== ¡22: ¡ ¡ ¡ ¡return ¡ ¡if ¡pkt.dstPort ¡== ¡80: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡3] ¡ ¡if ¡pkt.dstIP ¡== ¡H1: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡1] ¡ ¡if ¡pkt.dstIP ¡== ¡H2: ¡ ¡ ¡ ¡actions ¡= ¡actions ¡+ ¡[Fwd ¡2] ¡ ¡sw.packet_out(pkt, ¡actions)

Actual Controller ...

dstPort: ¡22 [] dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 dstIP: ¡H1 Fwd ¡1 dstIP: ¡H2 Fwd ¡2 Desired Flow Table:

written by OpenFlow programmer inserted by controller formally verified

Barriers packet_in handler Frame type / protocol numbers transparent optimizations

slide-94
SLIDE 94

27

verified code

serialization and physical network

slide-95
SLIDE 95

27

Flow Table

verified code

serialization and physical network

slide-96
SLIDE 96

27

Flow Table Smaller Flow Table

Optimize

verified code

serialization and physical network

slide-97
SLIDE 97

27

Flow Table Smaller Flow Table

Optimize

verified code

serialization and physical network

Runtime System

OpenFlow Messages

slide-98
SLIDE 98

27

Flow Table Smaller Flow Table

Optimize

verified code

serialization and physical network

Runtime System

OpenFlow Messages Nettle

Serialize

slide-99
SLIDE 99

28

Controller

Bisimulation

abstract model actual OpenFlow network

slide-100
SLIDE 100

28

Controller

Bisimulation

abstract model actual OpenFlow network

slide-101
SLIDE 101

28

Controller

Bisimulation

abstract model actual OpenFlow network

slide-102
SLIDE 102

28

Controller

Bisimulation

abstract model actual OpenFlow network

slide-103
SLIDE 103

29

Performance

theorems are slow

slide-104
SLIDE 104

29

Performance

Verified Controller 3.5K messages / second NetCore Controller 3.0K messages / second

Throughput (CBench):

theorems are slow

slide-105
SLIDE 105

29

Performance

Verified Controller 3.5K messages / second NetCore Controller 3.0K messages / second

Throughput (CBench): Controller Traffic

ping-all five times on fattree with six switches

theorems are slow

slide-106
SLIDE 106

29

Performance

Verified Controller 3.5K messages / second NetCore Controller 3.0K messages / second

Throughput (CBench):

500 1000 1500 2000 Routing Broadcast Monitor Verified NetCore

Controller Traffic

ping-all five times on fattree with six switches

theorems are slow

slide-107
SLIDE 107

29

Performance

Verified Controller 3.5K messages / second NetCore Controller 3.0K messages / second

Throughput (CBench):

500 1000 1500 2000 Routing Broadcast Monitor Verified NetCore

Controller Traffic

ping-all five times on fattree with six switches

naive barriers between all flow_mods

theorems are slow

slide-108
SLIDE 108

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

slide-109
SLIDE 109

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

slide-110
SLIDE 110

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22)

  • NetCore. Monsanto et al., POPL 2012.
slide-111
SLIDE 111

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪

  • NetCore. Monsanto et al., POPL 2012.
slide-112
SLIDE 112

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪

  • NetCore. Monsanto et al., POPL 2012.
slide-113
SLIDE 113

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪ ¡ ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3

  • NetCore. Monsanto et al., POPL 2012.
slide-114
SLIDE 114

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪ ¡ ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3

  • NetCore. Monsanto et al., POPL 2012.

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪

slide-115
SLIDE 115

30

Block SSH traffic dstPort == 22 ⟹ Drop Forward other traffic normally dstIP == H1 ⟹ Fwd 1 dstIP == H2 ⟹ Fwd 2 Log Web requests dstPort == 80 ⟹ Fwd 3

Priority Pattern Action 10 dstPort: ¡22 [] 9 dstIP: ¡H1, ¡dstPort: ¡80 Fwd ¡1, ¡Fwd ¡3 9 dstIP: ¡H2, ¡dstPort: ¡80 Fwd ¡2, ¡Fwd ¡3 8 dstIP: ¡H1 Fwd ¡1 8 dstIP: ¡H2 Fwd ¡2

how?

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪ ¡ ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3

  • NetCore. Monsanto et al., POPL 2012.

new, verified compiler

restrictTo ¡(tcpPort ¡!= ¡22) ¡ ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡∪ ¡ ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡∪

slide-116
SLIDE 116

OpenFlow (Nettle) Featherweight OpenFlow Messages

31

Flow Table Smaller Flow Table

Runtime System Optimize Serialize

verified code

serialization and physical network

slide-117
SLIDE 117

OpenFlow (Nettle) Featherweight OpenFlow Messages

31

Flow Table Smaller Flow Table

Runtime System Optimize Serialize

verified code

serialization and physical network

NetCore

Compiler

slide-118
SLIDE 118

Conclusion

32

slide-119
SLIDE 119

Conclusion

32

Featherweight OpenFlow

A foundational model for verifying SDN

slide-120
SLIDE 120

Conclusion

32

Featherweight OpenFlow

A foundational model for verifying SDN

Verified Controller

inserts barriers, handles packet_in messages, and

  • ptimizes flow tables
slide-121
SLIDE 121

Conclusion

32

Featherweight OpenFlow

A foundational model for verifying SDN

Verified Controller

inserts barriers, handles packet_in messages, and

  • ptimizes flow tables

restrictTo ¡(tcpPort ¡!= ¡22) ¡dstIP ¡ ¡ ¡== ¡H1 ¡⟹ ¡Fwd ¡1 ¡|| ¡dstIP ¡ ¡ ¡== ¡H2 ¡⟹ ¡Fwd ¡2 ¡|| ¡tcpPort ¡== ¡80 ¡⟹ ¡Fwd ¡3

Verified NetCore Compiler

compiles to flow tables, uses the verified controller

slide-122
SLIDE 122

A Grand Collaboration:

Languages + Networking

Frenetic Cornell Shrutarshi Basu (PhD) Nate Foster (Faculty) Arjun Guha (Postdoc) Stephen Gutz (Undergrad) Mark Reitblatt (PhD) Robert Soulé (Postdoc) Alec Story (Undergrad)

http://frenetic-­‑lang.org

Frenetic Princeton Chris Monsanto (PhD) Joshua Reich (Postdoc) Jen Rexford (Faculty) Cole Schlesinger (PhD) Dave Walker (Faculty) Naga Praveen Katta (PhD)

33