ovn: Connect to remote lports through localnet port.
[cascardo/ovs.git] / ovn / ovn-architecture.7.xml
index 762384b..e0ab650 100644 (file)
       A field that denotes the logical datapath through which a packet is being
       processed.
       <!-- Keep the following in sync with MFF_LOG_DATAPATH in
-           ovn/controller/lflow.h. -->
+           ovn/lib/logical-fields.h. -->
       OVN uses the field that OpenFlow 1.1+ simply (and confusingly) calls
       ``metadata'' to store the logical datapath.  (This field is passed across
       tunnels as part of the tunnel key.)
         A field that denotes the logical port from which the packet
         entered the logical datapath.
         <!-- Keep the following in sync with MFF_LOG_INPORT in
-             ovn/controller/lflow.h. -->
+             ovn/lib/logical-fields.h. -->
         OVN stores this in Nicira extension register number 6.
       </p>
 
         leave the logical datapath.  This is initialized to 0 at the
         beginning of the logical ingress pipeline.
         <!-- Keep the following in sync with MFF_LOG_OUTPORT in
-             ovn/controller/lflow.h. -->
+             ovn/lib/logical-fields.h. -->
         OVN stores this in Nicira extension register number 7.
       </p>
 
         to enter the logical ingress pipeline.
       </p>
 
-      <p>
-        It's possible that a single ingress physical port maps to multiple
-        logical ports with a type of <code>localnet</code>. The logical datapath
-        and logical input port fields will be reset and the packet will be
-        resubmitted to table 16 multiple times.
-      </p>
-
       <p>
         Packets that originate from a container nested within a VM are treated
         in a slightly different way.  The originating container can be
         egress port are the same.
       </p>
 
+      <p>
+        Logical patch ports are a special case.  Logical patch ports do not
+        have a physical location and effectively reside on every hypervisor.
+        Thus, flow table 33, for output to ports on the local hypervisor,
+        naturally implements output to unicast logical patch ports too.
+        However, applying the same logic to a logical patch port that is part
+        of a logical multicast group yields packet duplication, because each
+        hypervisor that contains a logical port in the multicast group will
+        also output the packet to the logical patch port.  Thus, multicast
+        groups implement output to logical patch ports in table 32.
+      </p>
+
       <p>
         Each flow in table 32 matches on a logical output port for unicast or
         multicast logical ports that include a logical port on a remote
         34.
       </p>
 
+      <p>
+        A special case is that when a localnet port exists on the datapath,
+        remote port is connected by switching to the localnet port. In this
+        case, instead of adding a flow in table 32 to reach the remote port, a
+        flow is added in table 33 to switch the logical outport to the localnet
+        port, and resubmit to table 33 as if it were unicasted to a logical
+        port on the local hypervisor.
+      </p>
+
       <p>
         Table 34 matches and drops packets for which the logical input and
         output ports are the same.  It resubmits other packets to table 48.
         is a container nested with a VM, then before sending the packet the
         actions push on a VLAN header with an appropriate VLAN ID.
       </p>
+
+      <p>
+        If the logical egress port is a logical patch port, then table 64
+        outputs to an OVS patch port that represents the logical patch port.
+        The packet re-enters the OpenFlow flow table from the OVS patch port's
+        peer in table 0, which identifies the logical datapath and logical
+        input port based on the OVS patch port's OpenFlow port number.
+      </p>
     </li>
   </ol>
 
 
     <!-- Keep the following in sync with ovn/controller/physical.h. -->
     OVN transmits the logical ingress and logical egress ports in a TLV with
-    class 0xffff, type 0, and a 32-bit value encoded as follows, from MSB to
+    class 0x0102, type 0, and a 32-bit value encoded as follows, from MSB to
     LSB:
   </p>