Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MidoNet Deep Dive

MidoNet Deep Dive

Deep dive into MidoNet.

This slide deck explains the internal architecture of MidoNet to make an introduction.

Taku Fukushima

February 16, 2015
Tweet

More Decks by Taku Fukushima

Other Decks in Technology

Transcript

  1. NSDB NSDB NSDB Open vSwitch Datapath IF IF Interfaces on

    the host IF VM VM VM Midolman (MidoNet agent) Network Flow Table MidoNet API Nova API Horizon MidoNet CLI Watch/modify Add/remove flows Neutron API MidoNet Plugin Host Cache + local state Store virtual topology information Clients / Users Nova compute
  2. Midolman (MidoNet agent) NSDB NSDB NSDB Open vSwitch Datapath IF

    IF Interfaces on the host IF VM VM VM Midolman (MidoNet agent) Network Flow Table Watch/modify Add/remove flows Host Cache + local state Store virtual topology information Nova compute
  3. Foundations • Java and Scala • Java 8 migration is

    coming • Guava and Guice • Akka Actor • Future and RxJava • Jackson → Protocol Buffers • Disruptor
  4. Upcall Lifecycle 1. Input stage • Get upcalls with packets

    from the datapath 2. Packet processing stage 1. Deduplicate and queue packets 2. Simulate packets on the virtual topology 3. Deal with the wildcard flows 4. Determine the egress physical port 3. Output stage • Emit packets and install flows based on the sims
  5. MidolmanActorsService Fl PacketsEntryPoint RoutingManager Actor DatapathReady Vir Ph HealthMonitor MtuIncreaser

    PacketWorkflow UpcallDatapath ConnectionManager (NetlinkInputChannel) Fast Path State Management Flow Invalidation by Tag W DatapathReady Midolman.java
  6. F PacketsEntryPoint NetlinkCallback Dispatcher PacketWorkflow Coordinator UpcallDatapath ConnectionManager One-to-Man One-to-On

    HTB Supended Packets Waiting Room (NetlinkInputChannel) NetlinkChannel Fast Path State Management Open vSwitch Datapath Flow Table Upcall Packet 1. Input stage Select Loop
  7. Datapath Controller Flow Controller PacketsEntryPoint NetlinkCallback Dispatcher PacketWorkflow Coordinator UpcallDatapath

    ConnectionManager One-to-Many One-to-One HTB Supended Packets Waiting Room (NetlinkInputChannel) NetlinkChannel (NetlinkOutputChannel) DatapathChannel ment path Open WildcardFlow Pa Wildcard Flows Flow Managem 2. Packet processing stage PacketContext PacketContext PacketContext PacketContext PacketContext PacketContext Routing by hashing with FlowKey
  8. Datapath Controller Flow Controller PacketsEntryPoint RoutingManager Actor DatapathReady VirtualTopology Actor

    VirtualTo PhysicalMapper PacketWorkflow Coordinator atapath nManager NSDB NSD NSDB Disrupto Ring Buff putChannel) (NetlinkOutputChannel) DatapathReady WildcardFlow Flow Invalidation by Tag Virtual Topolog State data / Mess Wildcard Flows DatapathReady Datapath port operations Flow Management 2. Packet processing stage Retrieve virtual resources Virtual Resource Virtual Resource Virtual Resource Future • Completed • NotYetException
  9. Datapath Controller Flow Controller PacketsEntryPoint RoutingManager Actor DatapathReady VirtualTopology Actor

    VirtualTo PhysicalMapper PacketWorkflow UpcallDatapath nnectionManager NS etlinkInputChannel) (NetlinkOutputChannel) DatapathReady WildcardFlow Flow Invalidation by Tag Virt State Wildcard Flows DatapathReady Datap oper Flow Management 2. Packet processing stage Manage virtual to local and physical mapping • Interface name to UUID • UUID to local port number • Which host has the interface • …
  10. Datapath Controller Flow Controller PacketsEntryPoint NetlinkCallback Dispatcher PacketWorkflow Coordinator UpcallDatapath

    ConnectionManager One-to-Many One-to-One HTB Supended Packets Waiting Room (NetlinkInputChannel) NetlinkChannel (NetlinkOutputChannel) DatapathChannel ment path Open WildcardFlow Pa Wildcard Flows Flow Managem 2. Packet processing stage PacketContext PacketContext PacketContext PacketContext PacketContext PacketContext Simulation
  11. Datapath Controller Flow Controller PacketsEntryPoint VirtualTo PhysicalMapper PacketWorkflow Coordinator Disruptor

    Ring Buffer Supended Packets Waiting Room el) (NetlinkOutputChannel) DatapathChannel Flow Table DatapathReady WildcardFlow validation y Tag Virtual Topology State data / Messages Packet Flow Wildcard Flows DatapathReady Datapath port operations Flow Management 2. Packet processing stage Local datapath management • Create local datapath ports • Track UUID to port # mapping • Manage overlay tunnels PacketContext
  12. Datapath Controller Flow Controller PacketsEntryPoint VirtualTo PhysicalMapper PacketWorkflow Coordinator Disruptor

    Ring Buffer Supended Packets Waiting Room (NetlinkOutputChannel) DatapathChannel Flow Table DatapathReady WildcardFlow n Virtual Topology State data / Messages Packet Flow Wildcard Flows DatapathReady Datapath port operations Flow Management 2. Packet processing stage Flow Flow Flow Flow Query statistics Invalidate flows PacketContext Flow management • Cache flows • Invalidate flows when the virtual topology changed • Add flow to the datapath
  13. Datapath Controller Flow Controller PacketsEntryPoint NetlinkCallback Dispatcher PacketWorkflow Coordinator One-to-Many

    One-to-One B Disruptor Ring Buffer Supended Packets Waiting Room (NetlinkOutputChannel) DatapathChannel Open vSwitch Datapath Flow Table WildcardFlow Virtual Topology State data / Messages Packet Flow Wildcard Flows Datapath port operations Flow Management 3. Output stage Select Loop
  14. Prerequisites • JDK7 • JDK8 is coming • protoc (Protocol

    Buffer >= 2.6.0) • build-essential (for packaging deb packages) • rpm (for packaging RPM packages) • fpm (for packaging)
  15. Dev environment (recommended) • JDK 7 (required) • JDK8 is

    coming • Protocol Buffers >= 2.6.0 (required) • IntelliJ IDEA 14 community edition (OSS!) (optional) • Scala plugin + protoc plugin • Nice displays and keyboards
  16. Midolman deep dive • Upcall lifecycle 1. Input stage 2.

    Packet processing stage 3. Output stage • Fast path and state management • Read the docs • Getting started with coding