[ovs-dev] [PATCH v4 0/4] Support native dhcp in ovn controller

Numan Siddique nusiddiq at redhat.com
Wed Mar 9 13:39:55 UTC 2016


On 12/22/2015 01:31 PM, Ben Pfaff wrote:
> Hi Babu and Numan.
>
> So far, we've been able to build OVN so that the logic of the system is
> implemented in terms of OVN logical flows.  That is, the logical flow
> table determines what happens in every significant way in OVN.  It would
> be nice to preserve this property for DHCP.  A design of this form would
> have to include a way for the flow table to extract DHCP header and
> option information from packets, and for the flow table to create new
> DHCP packets and set their header and option values.  It would be more
> work, but then the DHCP behavior could be controlled entirely from
> ovn-northd by modifying the flow table.
>
> I'd like to discuss whether this is practical and worth the effort.
>
> Do you have any initial thoughts?

Hi Ben and everyone,

We propose to support native dhcp in OVN in the following way

 - For every logical switch port a new logical flow will be added if the
   Logical_Port.options has atleast "dhcp-opt-router=<ROUTER_IP>" defined.
  
   For eg. If there is a logical port "por1" with Logical_Port.options defined as
   ["dhcp-opt-router=10.0.0.1", "dhcp-opt-netmask=255.255.254.0"] and it has ip address
   "10.0.0.3", then the flow would look like

   table=1( ls_in_dhcp), priority= 50, match=(inport == "port1" && eth.src == <ETH_ADDR> && ip4.src == 0.0.0.0 && ip4.dst == 255.255.255.255 && udp.src == 68 && udp.dst == 67), action=(dhcp_offer { offerip = 10.0.0.3; router = 10.0.0.1; netmask = 255.255.254.0; }; eth.dst = eth.src; ip4.dst = 10.0.0.3; udp.src = 67; udp.dst = 68; outport = inport; inport = ""; / Allow sending out inport. / output;)

  - ovn-controller would parse the action 'dhcp_offer' and store the dhcp options in the
    'userdata' of the packet-in and set 'pause' to true.

   The corresponding OF Flow would look like

    table=17, n_packets=7, n_bytes=2394, idle_age=1197, hard_age=2535, priority=50,udp,reg6=0x2,metadata=0x1,dl_src=fa:16:3e:0b:73:79,nw_src=0.0.0.0,nw_dst=255.255.255.255,tp_src=68,tp_dst=67 actions=controller(userdata=00.00.00.02.00.00.00.00.0a.00.00.03.03.04.0a.00.00.01.01.04.ff.ff.fe.00,pause),move:NXM_OF_ETH_SRC[]->NXM_OF_ETH_DST[],mod_nw_dst:10.0.0.3,mod_tp_src:67,mod_tp_dst:68,move:NXM_NX_REG6[]->NXM_NX_REG7[],load:0->NXM_NX_REG6[],load:0->NXM_OF_IN_PORT[],resubmit(,32)


 - When the ovn-controller receives the packet-in for the dhcp request, it would
   frame a new dhcp packet with almost the same contents of the original packet
   and copy the dhcp options from the 'userdata' to the packet dhcp options
   and resume the flow. OpenvSwitch would resume and apply the other actions.

We have a dirty poc code based on this approach here [1].

We would like to know if this solution is reasonable, so that we can proceed
further with the implementation.

Please let us know your comments.

[1] - https://github.com/numansiddique/ovs/commit/13c4a2865bb81ce32e323bdabcb576598c411eb8

Thanks
Babu and Numan




More information about the dev mailing list