[ovs-discuss] [ovn] distributed router port and distributed SNAT

2020-09-23 Thread Tony Liu
Hi,

I read through this long discussion [1].

Here is what I am doing.

+--+
|external logical switch   |
+-+-++-+
  | ||
   +--+--+   +--+--+ +---++
   |dgp1 |   |dgp2 |   ...   |dgp1000 |
   +--+--+   +--+--+ +---++
  | ||
+-+-+ +-+-+  +---+---+
|LR1| |LR2|  |LR1000 |
+---+ +---+  +---+

First of all, I see the same flow explosion in lr_in_arp_resolve
table. I'd like to confirm the patch [2] will also avoid explosion
in my case?

In my case, LRs are not bound to any specific compute chassis.
All DGPs are bound on the central set of gateway chassis.
It's central SNAT and FIP.

I am looking for the possibility to do distributed SNAT and FIP to
avoid central gateway nodes. With OpenStack integration,
distributed FIP is supported, but not distributed SNAT. because
there is not chassis specific address can be used as the source
IP for SNAT.

Given the idea in [3], DPG can be bound on compute chassis.
I don't need the support to have multiple DPGs on one LR.
Then is that going to work for distributed SNAT?
Any details, like how to allocate chassis specific address
as the source IP for SNAT, and how ARP works for that address?

[1] https://www.mail-archive.com/ovs-discuss@openvswitch.org/msg06948.html
[2] https://www.mail-archive.com/ovs-dev@openvswitch.org/msg45681.html
[3] https://www.mail-archive.com/ovs-discuss@openvswitch.org/msg06987.html

Thanks!
Tony

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [OVN]: IP address representing external destinations

2020-09-23 Thread Han Zhou
On Fri, Sep 18, 2020 at 12:58 AM Alexander Constantinescu <
acons...@redhat.com> wrote:

> Hi Han
>
> Sorry for the late reply.
>
> Is this the current situation?
>>
>
> Yes, it is.
>
> When you say there are too many default routes, what do you mean in the
>> above example? How would the SOUTH_TO_NORTH_IP solve the problem?
>>
>
> Each  corresponds to a node in our cluster, like this:
>
>   ip4.src ==  && ip4.dst ==
> , allow
>   ip6.src ==  && ip6.dst ==
> , allow
>   ip4.src ==  && ip4.dst ==
> , allow
> ...
>   ip6.src ==  && ip6.dst ==
> , allow
>
> so on large clusters (say 1000 nodes) with IPv6 and IPv4 enabled we can
> reach ~2000 logical router policies. By having the SOUTH_TO_NORTH_IP we can
> completely remove all of them and have the "default route" logical router
> policy specify:
>
> default route (lowest priority): ip4.src == 
> ip4.dst == SOUTH_TO_NORTH_IP, nexthop = 
>
> In addition, if SOUTH_TO_NORTH_IP is a user defined IP,
>>
>
> I didn't think it should be user defined, more so "system defined", like
> 0.0.0.0/0
>
>  I am not sure how would it work,  because ip4.dst is the dst IP from
>> packet header
>>
>
> I didn't intend for such an IP to be used solely as a destination IP, but
> as source too, if the user requires it.
>
> Comparing it with SOUTH_TO_NORTH_IP would just result in mismatch, unless
>> all south-to-north traffic really has this IP as destination (I guess
>> that's not the case).
>>
>
> Sure, I just wanted to assess the feasibility of such an IP from OVN's
> point of view. Obviously the real destination IP would be different, but I
> (without knowing the underlying works of OVN) thought there might be a
> programmable way of saying: "this IP is unknown to my network topology, so
> I could use identifier/alias grouping all such IPs under an umbrella
> identifier such as X.X.X.X/X"
>
>
I see. You don't really want the packet's dst IP to be replaced, so what
you need is some value in metadata and then you could define a policy to
match that metadata and specify the nexthop. This is supported by the
policy route table.

However, what really matters here is how to define "unknown IPs". We can't
say an IP is unknown just because there is no port with the IP assigned.
There can still be east-west traffic for such IP, e.g. for nested workload
in a VM, etc. From OVN's point of view this is completely user defined, and
the best way for the user to tell OVN this information is through the route
policies (which means you don't really need that extra metadata to achieve
this). I think it is the way how k8s-ovn is using OVN that causes this many
routes required. If the IP allocation can be better managed so that a big
range of IP is for east-west and otherwise north-south, then you probably
end up with a much smaller number of policies.


>
> On Wed, Sep 16, 2020 at 11:09 PM Han Zhou  wrote:
>
>>
>>
>> On Wed, Sep 16, 2020 at 10:07 AM Alexander Constantinescu <
>> acons...@redhat.com> wrote:
>>
>>> In this example it is equivalent to just "ip4.src == 10.244.2.5/32"'.

>>>
>>> Yes, I was just using it as an example (though, granted, noop example)
>>>
>>> Some background to help steer the discussion:
>>>
>>> Essentially the functionality here is to have south -> north traffic
>>> from certain logical switch ports exit the cluster through a dedicated node
>>> (an egress node if you will). To do this we currently have a set of default
>>> logical router policies, intended to leave east <-> west traffic untouched,
>>> and then logical router policies with a lower priority, which specify
>>> reroute actions for this functionality to happen. However, on large
>>> clusters, there's this concern that the default logical router policies
>>> will become too many. Hence why the idea here would be to drop them
>>> completely and have this "special IP" that we can use to filter on the
>>> destination, south -> north, traffic .
>>>
>>> If you have a default route, anything "unknown" would just hit the
 default route, right? Why would you need another IP for this purpose?

>>>
>>> As to remove the default logical router policies, which can become a
>>> lot, on big clusters - as described above. With only reroute policies of
>>> type: "ip4.src == 10.244.2.5/32 && ip4.dst == SOUTH_TO_NORTH_IP" things
>>> would become lighter.
>>>
>>
>> Thanks for the background. So you have:
>> 
>> 
>> ...
>> default route (lowest priority): ip4.src == ,
>> nexthop = 
>> default route (lowest priority): ip4.src == ,
>> nexthop = 
>>
>> Is this the current situation?
>> When you say there are too many default routes, what do you mean in the
>> above example? How would the SOUTH_TO_NORTH_IP solve the problem?
>>
>> In addition, if SOUTH_TO_NORTH_IP is a user defined IP, I am not sure how
>> would it work, because ip4.dst is the dst IP from packet header. Comparing
>> it with SOUTH_TO_NORTH_IP would just result in mismatch, unless all
>> south-to-north traffic really has this IP as destination (I guess that's

[ovs-discuss] Does OVS support egress table specified in OpenFlow 1.5?

2020-09-23 Thread Shouxi Luo
Dear all,

Does OVS (say 2.13 for instance) support the egress table specified in
OpenFlow 1.5?
If so, how could I configure the first egress table manually with commands?
I tried to configure the egress table with Ryu but got the error codes of
|-- type: OFPET_TABLE_FEATURES_FAILED(13)
|-- code: OFPTFFC_EPERM(5)


Best,
Shouxi
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] [ovn] MAC in table acl and lb

2020-09-23 Thread Numan Siddique
On Wed, Sep 23, 2020 at 7:51 AM Tony Liu  wrote:

> That MAC is also in table 19.
> ==
>   table=19(ls_in_l2_lkup  ), priority=110  , match=(eth.dst ==
> 1a:d2:77:6e:42:98), action=(handle_svc_check(inport);)
> ==
>
> Thanks!
> Tony
> > -Original Message-
> > From: Tony Liu 
> > Sent: Tuesday, September 22, 2020 7:19 PM
> > To: ovs-discuss 
> > Subject: [ovn] MAC in table acl and lb
> >
> > Hi,
> >
> > When I look at a datapath ingress pipeline, =
> >   table=3 (ls_in_pre_acl  ), priority=110  , match=(eth.dst ==
> > 1a:d2:77:6e:42:98), action=(next;)
> >   table=3 (ls_in_pre_acl  ), priority=0, match=(1),
> > action=(next;)
> >   table=4 (ls_in_pre_lb   ), priority=110  , match=(eth.dst ==
> > 1a:d2:77:6e:42:98), action=(next;)
> >   table=4 (ls_in_pre_lb   ), priority=110  , match=(nd || nd_rs ||
> > nd_ra || icmp4.type == 3 ||icmp6.type == 1 || (tcp && tcp.flags == 20)),
> > action=(next;)
> >   table=4 (ls_in_pre_lb   ), priority=0, match=(1),
> > action=(next;)
> >   table=5 (ls_in_pre_stateful ), priority=100  , match=(reg0[0] == 1),
> > action=(ct_next;)
> >   table=5 (ls_in_pre_stateful ), priority=0, match=(1),
> > action=(next;)
> >   table=6 (ls_in_acl  ), priority=34000, match=(eth.dst ==
> > 1a:d2:77:6e:42:98), action=(next;)
> >   table=6 (ls_in_acl  ), priority=0, match=(1),
> > action=(next;)
> >   table=7 (ls_in_qos_mark ), priority=0, match=(1),
> > action=(next;)
> >   table=8 (ls_in_qos_meter), priority=0, match=(1),
> > action=(next;)
> >   table=9 (ls_in_lb   ), priority=0, match=(1),
> > action=(next;)
> > =
> > What's that MAC 1a:d2:77:6e:42:98? What's it for in acl and lb tables?
> > I can't find any port with that MAC.
> > This datapath is for a LS that is created from OpenStack.
>


Hi Tony,

This mac is used for service monitoring. ovn-northd generates this mac. You
can see this by running - ovn-nbctl list NB_Global.

Service monitoring is used by OVN octavia provider driver for health checks.

Look into the NB table - Load_Balancer_Health_Check and SB table
- Service_Monitor in the man pages for more details.

You see the flows in acl and lb tables to basically skip the service
monitor reply packets  from being sent to conntrack.
These packets will be sent to ovn-controller as packet-ins.

[1] - https://www.ovn.org/support/dist-docs/ovn-nb.5.html
[2] - https://www.ovn.org/support/dist-docs/ovn-sb.5.html

Thanks
Numan

Thanks
Numan



> >
> > Thanks!
> > Tony
>
> ___
> discuss mailing list
> disc...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss