9.1 Programming SDNs Flashcards
Consistent updates in SDN Problems
- Updates may disrupt packets along an end to end path
2. Packets from the same flow may be disrupted
SDN Programming 3 steps
- Read/monitor network state as well as events in the network (such as failures, topology changes, security events)
- compute policy based on state controller sees from network (decision plane)
- write policy back to switches by installing appropriate flow table state into switches
Which steps in SDN program can present an issue
Reading and writing
Reading State Problem: Limited # of rules
Limited # of rules due to space on switches. Cannot install all possible patterns
Reading state problem: Limited # of rules - SOLUTION
Dynamically unfold rules as traffic arrives.
Programmer specifies GroupBy(srcip)
Runtime dynamically adds rules as traffic arrives
Reading State Problem: Extra Unexpected events
extra unexpected events may cause inconsistencies
If a packet arrives as another one is being processed by the controller (installing a rule), it could cause issues.
Reading State Problem: Extra Unexpected events - SOLUTION
Programmer specifies “Limit(1)”
Runtime system hides the extra events
Approaches to maintaining consistency while reading state
predicates
unfolding
suppression
Reasons to write policies
maintenance
unexpected failure
traffic failure
Things to ensure when writing policies
no forwarding loops
no black holes
no security violations
black hole
router or switch receives a packet but doesn’t know what to do with it.
Writing Consistent Policy: Two Phase Commit
Version numbers in packets {P1, P2}
tag the packet on ingress so that the switches keep copies of both P1 and P2 for some time
When all switches have received rules corresponding to the new policy then incoming packets can be tagged with P2.
After time/sure no more P1 come in, we trash P1 ruleset
Writing Consistent Policy: Two Phase Commit - Optimization
don’t run on all switches.
only apply mechanism on switches affected by packets under old ruleset
Network Virtualization
Abstraction of physical network.
Multiple logical networks on shared physical substrate
Why virtual networking
network virtualization enables evolution by letting multiple architectures exist in parallel
Promise of Network Virtualization
- Rapid innovation
- New forms of network control
- (potentially) simpler programming
SDN vs Network Virtualization
SDN = separate data & control
Network Virtualization = separate logical & physical
Design goals for network virtualization
flexible manageable scalable secure programmable able to support different technologies
how are virtual networks implemented?
Nodes: VMs
Edges: Tunnels
Process of one packet from vm1 to vm2 through tunnel
encapsulate ethernet packet as it leaves vm in an ip packet which is destined for a new vm and the new host will decapsulate the packet
Programming SDNs: Problems
programming openflow is not easy
low level of abstraction
controller only sees events that switches do not know how to handle
race conditions if switch level rules not installed properly
Programming SDNs: Solution
Provide “northbound” api - programming interface that allows applications to program the network
Northbound api
allows an application to at a high level tell the controller what it wants the switch to do.
Northbound api benefits
vender independence
ability to quickly modify or customize control through various popular languages (python)
Frenetic
Sql like query language
sits ontop of a northbound api
Problem: Modules affect same traffic
too many cooks it’ll spoil the broth baby i think thats not true, ooooooo too many cooks can spoil the broth but will fill our hearts with so much, so much love. Too many cooks.
Problem: Modules affect same traffic - SOLUTION
Composition operators - ways that specify how individual modules combine to create a cohesive program
Policy Composition: Parallel
Perform both operations simultaneously
count and forward at the same time
Policy Composition: Sequential
Perform one operation, then the next
firewall, then switch
Pyretic features
Network policy as function
Boolean predicates
Virtual packet header fields
composition
Pyretic sequential policy composition syntax
match(dstIP=2.2.2.8)»_space; fwd(1)
|»_space;
Pyretic parallel policy composition syntax
match(dstIP=2.2.2.8)»_space; fwd(1) +
match(dstIP=2.2.2.9)»_space; fwd(2)
+
Dynamic policies
timeseries of static policies
current policy is self.policy
- set a default policy
- Register callback that updates policy
Pyretic summary/overview
- Network policy as function
- predicates on packets
- virtual packet headers
- policy composition