-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Everything #267
Implement Everything #267
Conversation
portId is currently a synonym for a VInt.t but that will likely change at some point to be a synonym for int64. Use the type consistently here, which may save time later.
This commit includes two important type definitions: * event - describes the types of events that frenetic applications will be exposed to, and will be expected to handle in some way. * result - the ultimate result of a frenetic application. A list of packet_outs to send to various switches, as well as the new policy that should be installed on those switches. It's on this type that sequence and union will be defined, and then lifted to a function type.
For all intents and purposes, Async_NetKAT.mli is a specification of the Frenetic application API. Closes #244.
The name did not imply that there was anything else being sequenced. Now it implies that after the action, the type of the module the function belongs to is also being sequenced.
matches determines whether or not some pattern-like structure matches a given packet.
from_pipe takes a Local.t, which a controller may cache per switch, and a packet, and determines the pipe that the packet belongs to. In general this is not always possible. For a brief interval during switch setup, packets may be sent to the controller not due to a policy. If a policy makes use of different pipe name in non-disjoint parallel compositions, then it may come from either, in which case the pipe the packet belongs to is ambiguous.
The user may have composed two applications that are interested in packets that match identical filters, but are sent to different pipes. from_pipe must account for this, and therefore return all pipes that match the packet. It is the job of the runtime to then deliver the packets to the proper pipe within the application, when possible.
(cherry picked from commit 434b1f8)
The from_pipes function now assumes that packets are not modified on the switch before being sent to the controller. That means that any modification of a field preceding a "port := <pipe>" is ignored for the purposes of compilation, and implemented at the controller.
Not sure why the code was clearing it before.
Any action that involves "port := <pipe>" should skip all other modifications, and send the packet straight to the controller. The skipped modifications will be applied there.
Skip filters that match on pipes.
When the controller receives a packet, it uses a cached representation of the policy installed on the switch to determine which pipe it should be sent to.
Previously called from_pipes. This function will evaluate a packet on a switch's policy, returning two lists. The first contains pairs of pipe names and modified packets. These will be sent to listening applications. The second is a list of modified packets. These will be used to generate packet out messages.
When a packet arrives at the controller, it's eval'd given the policy currently installed on the switch. If that produces packets located at physical locations, the controller will generate packet outs that will perform the appropriate modifications in the form of actions. Previously, the packet was not modified and no actions were inclued with the packet_out.
Was actually setting vlanPcp
Due to the flattening of seqs that involve Controller actions, this function may now produce duplicates. So, deduplicate. This approach does not preserve the order of the pars.
Right now, the compiler will not generates rules to modify packets if they'll ultimately be sent to the controller. It's up to the controller to implement those changes, which must happen before passing packets to the application.
The port optional port in a OFPT_PACKET_OUT is only used when the action list contains an action that would send the packet to the TABLE pseudoport. As of now, Frenetic does not allow this.
(cherry picked from commit fbfcc09)
If a branch of a union has side-effects, the user may want to ensure their ordering by using `Sequential, which will evaluate the left application to completion before running the right one. `Parallel provides no guarantee about evaluation order.
This reverts commit 8ba2bd0. Conflicts: lib/NetKAT_Types.ml
Fill out the rest of the topology events. These have some overlap. For example, the user will see a PortUp event as well as a LinkUp event containing the same switch_endpoint. It's up to each application to decide what level of detail they want to observe, and ignore the rest.
Use a custom instance of Network and stop using the topology disocvery stage from ocaml-openflow.
Asserts seem to not play nicely with async.
This reverts commit 2d4f046.
The unit argument indicates a partial application point. Anything computed in the partial application not be recomputed on applications of subsequent arguments.
Conflicts: _tags lib/LocalCompiler.ml lib/NetKAT_Types.ml lib/Semantics.ml lib/netcore.mllib setup.ml
tweaks to discovery
Move the creation of the event pipes to Ctl, and expose a functions to use it, as well as query to state of pending ports.
The Discovery.Host app will copy all arp traffic and send it to the controller. It assumes that the entire network is under the management of the controller.
The events written to the pipe will eventually get fed back into the app, so blocking on pushback was causing a deadlock.
Officially an "epic" pull request. |
I ran
It seems to be reproducible. Any ideas? |
A few things to try:
|
Also, note that in order for the policy to work you shoud run mn with the |
Ah. I think it has to do with the sizes we use for ports and switches. The On Sat, Mar 1, 2014 at 4:11 PM, Spiros Eliopoulos
|
I'm getting the error here: https://github.com/frenetic-lang/ocaml-openflow/blob/master/lib/VInt.ml#L23 With a little more debugging output, it prints the following:
From my console:
Can anyone else reproduce this? |
Wait, this is obviously bogus. I'm on a 64-bit platform. Besides, all these overflow checks should just use |
How has this not affected anyone else? Is everyone else using a 32-bit platform? |
Yes, this is a known issue. See frenetic-lang/ocaml-openflow#105. It needs to be fixed for the next release. Maybe everybody's still developing on the frenetic vm, which was 32-bit? |
Huzzah! |
This pull request subsumes #253 and #256, and implements additional functionality. Specifically, it: