everyone here be okay right so the last few years the networking community has been embarking on a major rethinking of the relationship between network switches and the people in systems that manage them and a particular there's a move towards greater programmability so does that Scott gave a really nice talked yesterday and giving a nice overview of why this trend is happening why is taking off now and the promise that it has for helping us develop greater abstractions for reasoning about the network and what I'm gonna talk about today so work I've been doing at Princeton
with programming languages colleagues at both princeton and cornell looking at ways to raise the level of abstraction for programming the network so in particular ap eyes like open flow and software-defined networking in general make it possible to program the network but it doesn't make it easy it's what we're going to talk about today are ways to make it much easier to do and the language that we're developing is called phonetic so just to give a quick overview of software-defined networking building on the tox cave yesterday in a software-defined Network you have a logically centralized controller
that can run arbitrary programs that manages a distributed collection of switches by responding to events that happen on those switches and installing rules that dictate the packet handling functionality on the switches and an open flow is a good example of such an API so what's interesting in this model is you've got at the top a smart but relatively slow controller that can run arbitrary software and then the switches you have things that are pretty dumb but extremely fast and so one of the major challenges here is to figure out how to present to the programmer
an appealing abstraction of white writing one program that runs in one place with network-wide visibility when in practice that work needs to be partitioned between a small number of operations that happen on the smart bit slow controller and the vast majority of operations happening in the in the dumb but fast switches and that's exactly what we're trying to do in frenetic so part of the challenge of programming these kinds of networks one thing that does help a lot is you have first of all very simple abstraction of the data plane and I'll elaborate on that
a little more detail in a moment you have a centralized architecture which makes it easier to reason about network-wide visibility and network-wide control and you have direct control over the underlying switches rather than sort of indirect baroque mechanisms at today's control planes offer so that's good unfortunately the interface that open flow provides is extremely low level it's just very thin veneer on the capabilities of the underlying hardware that's not a bad thing but it's not the interface we necessarily want the programmer to program too because the functionality ends up being very tied to the hardware
and very tucked I did very specific kind of bid and packet header level manipulations that one wants to do and you also have to manage control over the resources these switches have a relatively small amount of space for storing the rules that are going to process the packets and this forces the programmer to reason about the sizes of those tables the amount of information they can hold much like doing register allocation if you're writing assembly language code so and then finally the ugly is that in practice we often want to write multiple program modules that
doom different things routing access control network monitoring server load balancing we want to be able to write those as separate modules and compose them together and yet in practice they're sharing a single set of rules and the underlying switches and so we force the programmer today and in networking networking technologies like open flow to reason about how to compose their programs together if we had a higher-level language we could do that much better and that's exactly what we're trying to do is to add on top of the logically centralized controller programming language abstractions that will
make it easier for people to write programs on top and if we pick those abstractions well we can run off write a whole bunch of different modules for doing anything from topology discovery to routing an access control in a modular way and make these programs portable across switches from different vendors with different capabilities and resources and so that's essentially the vision we have on the frenetic project so so how do we approach doing that well before I go to that I want to give you a really quick overview of open flow just to kind of
set the stage for what we're building on top of so open flow is an API that's developed by folks at Stanford that provides an ability to interact directly with the underlying switch hardware in a programmatic way and the basic obstruction is that you have a prioritized list of rules where each rule has a pattern that indicates which packets match that rule and it matches on a subset of bits in the in the packet headers MAC addresses IP addresses port numbers and so on and a collection of actions drop the packet forwarded out a particular interface
flood go to the controller and so on and then a priority to disambiguate rules that are overlapping so an open flow switch could act like an IP router if the rules match only on a prefix of the destination IP address prioritized by their length it could be an Ethernet switch if it matches on mac addresses it could be a firewall if it matches on the five tuple and simply drops her forward to the package it could be a network address translator ever it rewrites the packets so the really nice thing about open flow is it
unifies all these different marketing terms we use to talk about different kinds of devices in the network into one simple simple API and all of these different kinds of network functionality that we think of as a fundamental end up just being differences in how you choose to program to that interface in addition there are usually a series of counters associated with each rule they give you the number of bytes of the number of packets that match that particular rule so an open flow switch then is just a simple box that takes packets in finds the
highest priority matching rule applies the options associated with that role and increments the counters newer versions of open flow do this on a wider range of header field with a wider range of actions and even support things like multiple levels of tables in a pipeline but the simple basic model will take you through the rest of the top if you're not already familiar with the newer versions of open flow so the API to open flow just allows you primarily to install rules of this type and to query the counters associated with these rules and uninstall
the rules and to see events happening from the underlying Network and so most of the higher level action is taking place on the controller which you can think of is running a sort of network operating system and I think the design of this network operating system is so very active and vibrant area of research that's going on now so what does this network OS do what processes events that come in from the network topology changes like switches going up or down or links going up or down statistics arriving from the network and even occasional packets
that have an option that says forward this packet to the controller because the switch doesn't know what to do and in response an event handler that runs in the application will usually affect some sort of change in the network like adding or removing rules reading the counters even sending a packet that previously was sent to the controller it's a big question here is what should the abstractions on this controller be to be able to write programs that control open flow networks effectively and that's exactly the space that we're in so what I want to do
next is just give you two examples of applications running on it below people at a lot of different places I've built a lot of interesting applications anywhere from energy-efficient networking to seamless mobility and so on I'm just going to give you two examples mainly to illustrate how the API works and also come back to these examples later as when I talk more about frenetic so a very simple example that we've developed at Princeton is a server load balancer here we just have two servers offering the same sir us with the same IP address today if
you're running a load balancer you'd buy a dedicated box and install it in your network it would be expensive it would be a single point of failure and a single point of attack in this setting you could imagine a collection of open flow switches acting as that load balancer by having rules installed in them that split the traffic going to the same destination to the different different instances of that service so here for example based on the client IP address I'm saying half the clients the ones whose address start with 0 go to one of
the two server replicas and the other half that start with 1 go to the other so by simply installing those rules in the network i can now partition the traffic between the two server replicas and essentially obviate the need to have a separate load balancer so in this case the controller is not doing very much at all when the switches come up it's installing these rules on the network and unless something fails there's not really anything else to do so this is very much a proactive application that no packets would go to the controller a
second example if you look at supporting mobility or migration here think vm migration in the data center or device mobility and I'm enterprise and here I'm showing it as device mobility where this iphone is going to move so let's suppose these two hosts have been communicating for a while and one of these hosts moves to a new location the traffic is going to the wrong location now because the host is moved but if the switch at the new location has a default rule that says hey I don't know what packets from this source are supposed
to be handled it'll send that packet to the controller and in the response the controller will learn where this host is located now and can install new rules in the switches that direct the traffic to the hosts new location so without either of the two hosts of the network knowing the wraps in the network have followed the host to its new location just by sending a single event to the controller and having the controller respond by installing updated rules in the new path and removing the old rules in the old path so those are just
two very simple examples of applications you can run on top of open flow so how can you build better abstractions for writing these applications today when you write one of these applications you essentially write a collection of event handlers that respond to these topology change packets and so on coming to the controller and then install new rules so I want to walk through three different things that make programming these networks hard and then walk through three different abstractions we developed in frenetic for doing that and so one way to view this as a sort of
control loop where when you manage a network essentially measure what's going on in the network which is a form of reading of network state you do some sort of policy computation to decide how you're going to adapt the way the network is behaving based on this new information and you may have multiple policies for different aspects of your network and so those may need to be composed together so that's the second thing we're going to do is compose policy and finally you want to build the right policy into the network and even though it's a
distributed collection of switches you'd like to view this as taking place and one fell swoop for the entire network is now running the new policy and so we're going to look at each of these three problems in turn and why they're hard and what abstractions might make them easier so I'm going to start with reading of network state and so one form of reading of network state is looking at the traffic counters right so these rules and open flow have by Tim packet counters and they can tell you quite a bit about what's going on
in the network but when difficulty there is if you want to understand that traffic you may have to have more than one rule to represent all the traffic you want to want to measure so a good example I show here is let's suppose you want to look at web server traffic except traffic for a particular source IP address so to be able to do that simple expression of saying I want to look at all port 80 traffic except the traffic coming from source one two three four you might have to install two rules and use
priorities to disambiguate between them so that you have one counter that's counting the traffic that does have that source IP address and all other traffic falling through to the second rule so that the remaining traffic has a separate counter associated with it and this can get progressively more complicated as you want to slice and dice the traffic in more complex ways so a very simple thing that we do it's not particularly deep but it helps in making programming easier is to allow the programmer to write these kinds of queries with predicates to say you know
using simple boolean logic which traffic they want to be able to collect statistics for and later in the run time system underneath the program the user rights will be able to translate that into a list prioritized list of rules that accurately represent that predicate so that's the first thing we do the second thing we do is in fact in practice we often have a limited number of rules that we can store in the switch and sometimes you want to be able to actually ask something of a network like I want to have a histogram of
traffic by IP address this is tricky because they're too to the 32 potential IP addresses although practice don't see a very small fraction of them so it's not really reasonable ahead of time to install rules for all the IP addresses you might reasonably see just in the hope that you'll have a counter there when you need it so in practice you want to be able to have a rule that say if there has been a packet from host one dot to dot 3 dot 4 there should be a rule there and whenever you see a
packet from a new source IP address you'd like to reactively install a new rule to have a counter associated with that traffic this is a big burden on the programmer they have to essentially subscribe to these kinds of events from the network reactively install rules instead we allow the programmer to just say I want to collect something by grouped by source IP address and the runtime system will automatically dynamically unfold the rules as necessary to install rules for each IP address that manifests itself and timeout the rules that are no longer needed when a particular
host is no longer active so the programmer just says hey I want traffic group by IP address the runtime system takes care of the rest a third example is a very common programming idiom in open flow and one that's extremely error-prone which is the idea of sending the first packet of a group of traffic to the controller we saw this example in the dynamic unfolding I just described a moment ago we saw it in the mobility example a few slides ago so the idea here is by default when you don't know what to do with
the packet you send it to the controller and the controller in response is going to set up some sort of rule in the network to handle this packet and other packets that look like it unfortunately there is delay between the switches and the controller and some practice it's possible that while the rule is being installed triggered by the first packet a second packet of this group goes to the controller as well that may be fine but now the program we can't just fire and forget he has to remember the action he's taking for the first
packet to make sure the arrival of the second packet doesn't lead to any kind of inconsistency and also it requires a lot of extra bookkeeping so in practice what we'd prefer to do is essentially hide that detail from the programmer so if the programmer can just say hey I only want to see one such packet and let the runtime system take care of whatever race conditions might arise so if the second packet in this example goes to the controller the controller can hide that detail from the application and handle that packet the way the programmer
has already said he wants packets like that handled the switch may not have known yet what to do but the runtime system of the controller does and so it can suppress that information from the application and take the action associated with those rules without the program we're having to see that detail now just to digress on this for a moment we did a study at nst I this year of doing model checking to a bunch of different open flow applications that people have written on top of the Knox operating system and trying to find programming
errors and in fact this error was made over and over and over again it's a very easy and very I'm a very easy novice mistake to make they're assume that you have central and instantaneous control over the network and wrongly expect that other packets you don't think you're going to see will come to the controller in fact I have a paper of my own that had a bug in my master's students thesis exactly like this and I was teasing him the other day that it's a good thing for him the ink is already dry in
his diploma because they're actually in fact we found several bugs in his coat it's not at all uncommon to make these sort of subtle mistakes that might only manifest themselves in corner cases where the timing of packets or the timing of the delays between the switch and the controller end up being different than you expect so putting all these things together what we've put together is essentially essentially a very simple sql-like query model that allows the programmer to say what events or statistics the programmer needs to see from the network and the key thing is
we'd have them tell us exactly what they want to see nothing more nothing less whatever they ask for is what they'll see and they won't see extra stuff they didn't ask for we used SQL because frankly it's just a simple and very appealing abstraction people already know about it and it in our case what it does is it returns a stream of statistics or events that correspond to the things the users asking about the other reason we use SQL is the terms in the SQL query will help give the programmer a sense of the overhead
of what kind of things he's asking the network to do now give a couple examples of that and in particular we have constructs in the sql-like language that we have that allow the things that the user rights to be translated very naturally and the things open flow switches can naturally do so as to give two examples imagine I want to collect traffic statistics arriving from the internet on input port two with TCP port number 80 so think of this as traffic from web servers internal clients here i can say i just want to see the
number of bytes just for this particular subset of traffic using this predicate grouped by destination MAC address I want to know who in my network is receiving all of these packets and I want to see that over 60 seconds by doing that the runtime system will take care of letting the program this just once and under the hood it's going to apply that predicate to create rules dynamically unfold as new destination MAC addresses appear and do the essential callbacks to be able every 60 seconds to pull all the counters some their results in return a
single stream of bite counts back to the programmer hiding all the asynchronous details from the programmer here's a second example that corresponds to the mobility example I had earlier where the programmer says well I want to see packets in this case not just counters of the number of bytes but the actual packets themselves every time a source MAC address arrives on a new input port to learn that this host is moved to a new location then i would say ok I want to see packets I want to see them every time there's a new mac
address split every time that MAC address has a new input port and I only want to see one such packet that's exactly what a learning switch or in this mobility case of something doing mobility needs to see and the programmer again doesn't have to deal with the unfolding of these rules and will always know that it sees just one packet even if more than one happens to find its way to the controller so that's the first part of frenetic is providing this this query language that will allow the programmer to outsource to the underlying runtime
system the details of getting the statistics they need and as we'll see in a moment we'll make sure that these queries always work even if there are other things going on in the network like other queries from other program modules that might want to see a different subset of traffic or a different subset of events and also compose with it whatever policies might also be installing rules to be able to take forwarding actions on the packets so that that really leads to the need for some form of composition which is the next thing that we
have in phonetics so now the programmer knows what's going on in the network and wants to be able to affect change in the underlying behavior of the network this could be computing new paths when a link fails or links are congested this could be traffic monitoring of the type we just talked about a moment ago this could be access control policy server load balancing and so on and all these different modules may need to run at the same time something is dealing with connectivity something is with measurement something is dealing with security will coexist at
the same time rather than being an independent program so problem is in the end all of these are sharing the exact same state and switch not unlike needing to share registers when you're when you're doing programming and assembly language and so we would like the ideally to be able to write these things separately and let the runtime system take care of arbitrating the use of the the shared resource and the network and a particular to make sure if a single packet needs to be handled by more than one of these modules that the underlying rules
and the switches reflect that correctly and that's that that's the thing that open flow doesn't do because it essentially is just a thin veneer on the hardware for installing and uninstalling these rules so just to illustrate that I'm going to take two very simple programs a repeater which is the simplest form of routing you can imagine packets to come in one interface go out the other and vice versa and a simple monitor similar to the type we're talking about earlier that's just doing traffic counting so here's the repeater it's written in sort of an ox
like pearl style whenever a switch joins the network this event handler runs and it just installs two rules each one has a pattern that says ok the pattern is of traffic's arriving on input port 1 then the associated action should be to forward the packets out on output port to you and the second does the opposite except it has a typo it should be actually anything coming in on input port two should go out on output for one that's it so no packets going to the controller just two rules one in the forwarding traffic in
each direction the second program does simple monitoring a port 80 traffic and I've written this again in this sort of stylized knock style that says hey for all traffic coming in on input port to that has source port of 80 web traffic install a rule that has no actions because I just want the counters and I'm going to query it using this event handler every every 30 seconds to be able to get those stats it's a relatively simple program no packets again go to the controller I'm just gonna install one rule and periodically query it
for its counters now imagine I want to do both of these two things you would think it's as simple as saying do a and B but in practice this is what you get a handwritten program that interleaves the behavior of the two I just described so what's in black here is borrowed from the repeater program what's in red is borrowed from the monitoring program and what's in white is from neither if something that exists just to disambiguate the behavior of the two programs so just to kind of go through that I've got three rules one
matching input traffic sending it out and two matching incoming traffic from the external internet one matching just on web traffic because i want the counters for that traffic and another falling through to match on everything else to make sure that the forwarding is done correctly so this middle rule that has all three colors is matching web traffic it has to have a high priority to make sure it gets precedence over the remaining rule that matches the rest of the traffic and it has to forward the traffic out output port one to have the effect of
a repeater so simultaneously do monitoring repeating and using high priority to indicate that this monitoring rule should get precedence over the rest of the traffic being forwarded now in this simple example this is already pretty complicated you could imagine that this could get quite a bit more complicated if the two programs you're composing a more complex or if you're composing more than two modules now in practice we really do need these three rules so there's no free lunch here or the key is to find a way for the runtime system to do this rather than
the programmer and that's that's exactly what we've done so so how do we do that well so in way the way this would look in frenetic is you would write a simple repeater that looks not very different than the program i showed you before you would write a simple monitor using our sql-like query language and then you would just say do both so from the programmers point of view these two modules can be written separately they can be written by different people like one can be software you've bought from someone else someone can be locally
written software and you can just compose them together so the action here is not that not that because that's that's actually just the goal we want to be able to write programs like this the key question is how do we do it so in our initial runtime system we took a very simple approach to doing this and I'll describe the more sophisticated approach in the next slide so essentially what we do in frenetic is the frenetic program runs on top of a runtime system that takes care of interacting with the lower level operating system like
Knox and what the frenetic program does is subscribe to queries using our sql-like query language and also register policies register sets of rules they want the module wants installed in the network the runtime system will take care of translating that into the low-level rules that need to be installed and uninstalled in the network and make sure that each module running on top sees exactly what it needs to see and nothing more so our initial implementation of this was reactive and micro flow based so what I mean by that is every UDP or TCP flow had
the first packet of that flow go to the controller for similar to a lot of applications written and in the beginning in the early days of Volkin flow this is clearly inefficient for some of the examples I described a moment ago that didn't need to send package to the controller our initial implementation would so this is not the end state we want to get to this is just an easy way to describe a way of implementing a runtime system that works correctly so when the first packet comes to the controller we'll figure out how to
handle that packet and if possible will install rules to handle all the rest of the packets that look like this one so what do we do we look at all the policies that are registered by all the modules and accumulate all the actions that those policies would do and if it's if in fact no queries care about this data no queries need to see other packets than this one then we can install that rule that we've just generated in the previous step and not have any other remaining packets of this flow go to the controller
and that's essentially the implementation good thing is we can reason about correctness because we know we're doing all the appropriate actions and we know that we can afford whenever no queries care about a packet of a particular type we know we can safely outsource to the network the handling of all the remaining packets using the same set of actions now the more interesting runtime system which is develop on my collaborators at at Princeton and Cornell was published at pople this year it's a really really nice paper I can't do it justice here but just to
give you a hint of how it works it essentially does the same operation I described to manually earlier we have two different kind of programs one that's doing the repeater the first thing that's boarding on patterns like input port one input port two and we have this monitoring predicate that's looking at logic like looking at traffic coming in on input port two with TCP port number 80 and it's not see what we're gonna do is a cross product of the the predicates on the left with the predicate saan the right and generate all combinations that
are not reveal and that's that's the result we have after the equal sign so the only interesting ones that are here are input port one input port 2 is source port 80 and input port 2 in that order and that becomes a set of rules that get generated by the runtime system to correctly mimic the behavior of both of these two modules now this is still a little bit challenging because each of these predicates may themselves we have to be represented by more than one rule in this example they don't they're relatively simple but in
more general cases they could so each of these predicates would then get unrolled into a prioritized list of rules just for that one predicate and we may in fact also have to dynamically install rules as packets arrive particularly when we have you know things that are grouping by IP address things that are much more complicated than what I show here but essentially what's going on in the runtime system then is this cross product operation and then optimizations of the resulting list to send the rules to the rules of the switches yeah so that's the second
case is being able to do composition so now the programmer can query the network for the information that he needs to see can write multiple modules and compose them without having to modify the code to make it work and then finally the third thing is how to actually affect changes to the network so men of the main challenges and networking is whenever you make change to the network you have transient disruptions is a classic problem comes up in firewall configuration and routing protocols in a variety of other settings that whenever you transition the network from
one set of policies to another you have a transient period of time where packets in flight may experience something you don't want so why are you changing the network well you might be changing network for very mundane reasons like maintenance you might be changing you might responding to a failure might be updating your access control policy you might be doing traffic engineering for any of these reasons you want to be able to change the set of rules and one or more switches in the network and you would likely ideally like during the transition not to
have things like forwarding loops black holes access control violations or other properties that you care about like all traffic should go through a particular middle box you don't want those to be violated so we've got a bunch of things causing change and a bunch of invariance we'd like to not have not be violated during the change now in the networking community over the past decade there have been paper after paper solving this problem for particular cases of invariants and particular kinds of changes and for firewalls for each of the different routing protocols we have but
this is a perfect example of what Scott was getting at yesterday then we can have general abstractions now because we've got a single model of the data plane we can have one one way of handling consistently updating the state of the network they can apply across a wide variety of different reasons you're changing the network and different invariant that you want to hold while you do so just to go through that in a little more detail what do we do well give you one example using shortest path routing policy so here we are routing based
on shortest paths and the controller is essentially picking what those shortest paths would be based on some sort of let's say link weights and it's forwarding all the traffic on the upper path now let's suppose for whatever reason one of these links is congested we might decide we want to make this link a little heavier so that traffic is deflected away from it that would lead to a change in the network where the traffic actually goes to the lower path but during the transition depending on order you update these two switches in the middle you
might have one switch forwarding to the other which in turn is forwarding back classic example of a loop this can easily happen during a convergence of ospf for example now let's centralized controller we can decide what order in which we update these switches so that that doesn't happen but that's extremely tedious for the programmer and in fact in many cases finding an exact ordering for doing that is actually not only computationally difficult but sometimes not even feasible so we want to take all of that out of the hands of the programmer and so the way
we do that I'll describe in a moment is to provide a single API for just saying change my network from this policy to that policy just to give a second example this is another very common bug in open flow programs is to assume that when you install rules from the controller on multiple switches that it happens at the same time across all the switches so imagine you've got a program that is sending a packet to the controller and then the controller is installing rules to set up a path if the rule of the first switch
gets installed before the rules of the second and third switch commit is possible the packet in flight will hit the second switch before the rules have gotten there in the world in the simplest case this packet might go to the controller and the program would have to remember Oh packet like this I've already decided how I want to handle it and send it back that's already a burden worse yet that packet might match something else that's sitting on the switch that's of lower priority because the rule that should be above it hasn't arrived yet in
which case the packet will be handled incorrectly different than what the program are intended these kind of bugs are extremely subtle and very easy to get wrong and hard to detect because again they depend on subtle differences in the timing and ordering of packets and the timing and ordering of message is going to different switches all of which in a best-effort network can manifest on a lot of very interesting and complex ways so that's the second example where the programmer could easily get this wrong so so what do we do a way to rather than
have the programmer have to think about all this will have a simple abstraction that just says I want to transition my entire network from policy one policy to and so we define a couple of different definitions of what a consistent policy would look like for doing that so one is per packet consistency which is the name suggests implies that if any individual packet in the network at the time of the update is either processed entirely by policy p1 or entirely by policy p2 never some weird mixture of the two never having one of the switches
in the network still applying policy p1 while the rest are applying policy p2 this is very useful for a lot of applications like access control reconfiguration avoiding loops and black holes and so on but it's not enough in some cases for example server load balancing you might want all the packets of a single flow like all the packets of a TCP connection to go to the same replica of a web server even if a change in load balancing policy is in the midst of happening so in this case we have a set of related packets
that we want to be processed entirely by p1 or entirely by p2 and not again not a mixture of the two so those are the two abstractions we want to provide per packet updates and / flow updates so you might be thinking that the natural thing to do is it is an atomic update but an atomic update itself is not enough either because we have to worry about these packets in flight wait to make sure a packet in flight doesn't experience life before or after the change so essentially what we're going to do is equivalent
of a two-phase commit or some optimizations that allow us to avoid that in common cases so the abstraction the programmer has is that they just say this is the particular update abstraction i want i want per packet updates and here's my new policy the runtime system will take care of analyzing the old policy in the new one and figure out the right way to do an update so that the properties all the properties of p1 and p2 have in common will be obeyed so one thing I should state here that's actually very nice about this
is if you have this consistent update semantics the programmer gets something nice not only does the program would not have to worry about how to do the update but if there's some property the programmer cares about they can verify directly on p1 and on p2 and know for certain it holds during the transition rather than having to verify that policy on all possible interleaving of updates that might happen between p1 and p2 so for example if you care about not having loops you just verify p1 doesn't have loops and p2 doesn't have loops and you
know no packets will get stuck in loops the nice thing too is that the programmer doesn't have to tell the runtime system which property he cares about because all properties that hold for both p1 and p2 inherently hold during the transition because all packets during the transition follow one or two one or the other of those policies in their entirety so essentially that meat reduces the burden the programmer doesn't have to tell us he cares about lube freedom or no black holes or anything else and if they do care to verify that they know they
only have to verify it on the old and the new policy and nothing during the transition and so finally the runtime system takes care of all the heavy lifting of making sure there's a schedule of updates to the network that will ensure the p1 and p2 are per packet consistent update and the nice thing is and this is another gift from open flow is open flow provides us a lot of nice mechanisms for doing this the central controller gives us a single place from which to orchestrate the network to be able to decide which switches
to get updated in what order and we have additional mechanisms we can use like VLAN tagging our MPLS tagging that we can use to assign version numbers to packets which something a lot of the existing solutions couldn't do so roughly how this works is first we use a VLAN tag or an MPLS tag to be able to stamp as a packet enters the network a version number essentially indicating whether its policy p1 or policy p2 or p3 or so on that's being applied to this packet we do that as a packet enters the network and
then throughout its journey it will only match rules that have in its pattern that particular stamp yeah that's the first thing second thing we're going to do is when we're getting ready to apply update number two for policy p2 we first update the inside of the network with what we call unobservable updates these are going to be rules that match on the tag p2 but no packets are being tagged with p2 yet they're also being tagged with p1 so these rules are not going to match anything so we can safely apply all of those updates
concurrently and wait for them all to complete once they've all completed now we can safely go around the perimeter of the network and change how we stamp packets that are entering the network since each packet enters the network just once it doesn't matter that we can do these updates asynchronously around the perimeter of the network and now all packets are gradually being applied a new version number matching the rules we previously installed in the interior of the network finally after packets in-flight have had time to clear the network based on let's say the maximum queue
depth times the propagation delay through the network we can essentially know that it's safe to remove all the rules throughout the network that relate to policy p1 so that we're not wasting space during rules for old policies so that's essentially what we do snap packets as they come in apply the interior part of the new policy apply the exterior part of the new paulo to delete the old policy a two-phase commit but implemented all using open flow messages so that's the basic idea now of course the two-phase commit can be expensive in the worst case
we might be applying twice as many rules to the switches as necessary so nice thing is first of all often when you're making a change in policy or not making a wholesale change in the way all packets are handled at all switches so we can essentially narrow the scope of this two phase commit to just the parts of the network that change and just the portions of flow space the header fields that are actually changing so for example in this picture here these two switches might be the only ones that change and we can redefine
what the perimeter of that little sub graph of the network is and apply our two phase commit they're also many policies often add or remove rules for a particular portion of traffic that were not previously handled for those we can do much simpler policies like just updating everything but the first switch and only after that's done updating the the internal switch and so we do that as well so the runtime system under the hood is applying all these optimizations is doing a delta between policy p1 and p2 figuring out which of these optimizations if any
are safe to apply and then doing all the steps of the update and what the programmer sees is just a smooth transition from p1 to p2 without having to worry about it now I'm not going to go through the details of the per flow consistent update it's much more technically involved but fortunately it too can be done using just open flow mechanisms so again without any changes to the switches we can offer the programmer or per flow consistent update without them having to worry about the gory details all the low-level bookkeeping is done just once
by us and as long as we've implemented it correctly we're golden so just to kind of summarize them what we've got are three different abstractions and sql-like query language for asking the network what's going on a way to do policy composition so that multiple independent modules can be composed and then finally a way to do consistent updates once those policies have effected a change in the network we've got essentially pieces for each of the three parts of the control loop just a little bit of related work on this is drawn quite heavily on a very
interesting body of work from the programming languages community called functional reactive programming frp and a related project particularly the OpenFlow areas the nettle work by paul hewitt acts group at Yale but there are a number of systems we borrow mechanisms from not only in the frp community but also in the streaming processing literature and a particularly Giga scope which is a project a TTT on doing queries of package streams running in the network I'll say a lot of work on open flow including by folks in this room different languages different controller platforms and different tools
for testing and debugging the openflow software and of course all the work that's going on in the open networking foundation plays a big role here as well so finally just to conclude I think playing off of the talk Scott gave yesterday software-defined networking is really exciting it's enabling innovation and networking it's enabling a broad rethinking of how we provide network software and I think it's starting to happen we see a lot of commercial switches supporting open flow we see operational networks like Google's and a number of university campuses and research background networks supporting open flow
and we're starting to see a rich community of work on abstractions for network software like the kinds that Scott talked about the work we're doing the work Nick teamster and folks at Yale are doing and so on that are gradually adding to the set of abstractions we can use to build really interesting applications that are hopefully more likely to be correct and concise and compact than the ones we have today and I would just like the stress for those views not already tuned in to what's going on in the software-defined networking community is a really
great space to be in for being able to do research work that is extremely practically grounded there are real deployments of this stuff as well as something that can have a lot of rigor to it because of the nice general abstractions that are that are already in place so I think I'll stop there these are my frenetic collaborators the joint project between programming languages folks and distributed systems folks like Mike Friedman at both Cornell and at Princeton may be happy to take questions if there's time so the questions about having multiple controllers this is a
fantastic question because of being able to have multiple distributed controllers is key to making suffered by network scale and be more reliable and i think it's a it's a big open question how to do that I agree supporting the switches is certainly one one direction to go one hope we have is that some of these higher level programming language abstractions will be easier for us to reason about what kind of work can be safely partitioned a good example is our consistent updates abstraction there's a lot of work that can be done concurrently to update the
interior of the network they can easily be split across multiple controller replicas that are each managing a subset of the network so I think the most allowed on exactly how to solve the problem you mentioned but I think that's the best the elephant in the room how do you make this logically centralized controller truly distributed