[P4-dev] A question about reconfiguration bmv2 dynamically.

Antonin Bas antonin at barefootnetworks.com
Wed Apr 19 12:26:17 EDT 2017


On Wed, Apr 19, 2017 at 12:56 AM, <ding.rui at zte.com.cn> wrote:

> Thanks, I still have some questions.
>
> 1)Why is Thrift RPC API  not portable? In my opinion,Thrift RPC API  and  protobuf
> / gRPC API  are functionally similar.
>
It is non-portable in the sense that we are not going to standardize this
API across P4 targets. It was written for bmv2 and is only implemented for
bmv2.

> 2)Is Thrift RPC API only used for bmv2's CLI? Will Thrift RPC API  and  protobuf
> / gRPC API exist simultaneously or not?
>
A target-independent CLI will ultimately be built on top of the gRPC API.
The current implementation of the gRPC API for bmv2 actually uses the
Thrift API, so yes at the moment both exist simultaneously. The current
design is like this: there is one gRPC server for a "chassis" of bmv2
instances. This gRPC server communicates with each bmv2 instance / process
using the Thrift API. Because each bmv2 instance runs its own Thrift
server, the bmv2 CLI can still be used. However, this is a little silly
because we have a dependency on 2 different RPC mechanisms and there is the
overhead of translation from protobuf to Thrift in the middle. There is a
version of simple_switch in the bmv2 repo (
https://github.com/p4lang/behavioral-model/tree/master/targets/simple_switch_grpc)
which does not use Thrift at all, but simply starts a gRPC server. Of
course this means that one gRPC server can only manage on bmv2 instance
(instead of a chassis of instances). In the future, we may need to be able
to run multiple bmv2 instances in a single process (and with a single gRPC
server). Of course this code is still experimental.

> 3)What about PI? Is PI CLI use the new protobuf / gRPC API?
>
Ultimately there will be a target-independent CLI built on top of the gRPC
API. The current PI CLI in the PI repo was more a proof of concept and uses
some ad-hoc RPC mechanism. It will be quickly deprecated once we have a
proper CLI using the gRPC API.

>
>
>
> 原始邮件
> *发件人:* <antonin at barefootnetworks.com>;
> *收件人:*丁瑞10106591; <p4-dev at lists.p4.org>;
> *日 期 :*2017年04月19日 03:14
> *主 题 :**Re: Re: [P4-dev] A question about reconfiguration bmv2
> dynamically.*
>
>
> Adding back the mailing list (my bad for removing it).
> If you don't want to use the CLI, your options are limited right now. You
> can use the bmv2 Thrift RPC API directly to swap the config:
> https://github.com/p4lang/behavioral-model/blob/
> master/thrift_src/standard.thrift#L560 (this is the API that the CLI is
> implemented with). The problem with this Thrift API is that it is not
> portable: your code will only work with bmv2.
> We are working on a new protobuf / gRPC API (https://github.com/p4lang/PI/
> blob/master/proto/p4/p4runtime.proto) but it is still in the works and
> won't be ready for use for a while.
>
> On Mon, Apr 17, 2017 at 7:56 PM,  <ding.rui at zte.com.cn> wrote:
>
>> Thanks for your reply. I want to ask another question. I am trying to
>> reconfigure bmv2 by SDN controller.
>>
>> Could you give some advice?
>>
>>
>>
>>
>>
>> 原始邮件
>> *发件人:* <antonin at barefootnetworks.com>;
>> *收件人:*丁瑞10106591;
>> *日 期 :*2017年04月18日 00:09
>> *主 题 :**Re: [P4-dev] A question about reconfiguration bmv2 dynamically.*
>>
>>
>> Hi,
>> I sent a detailed answer to the community a couple months ago:
>> http://lists.p4.org/pipermail/p4-dev_lists.p4.org/2017-
>> February/000740.html
>>
>> On Sun, Apr 16, 2017 at 7:18 PM,  <ding.rui at zte.com.cn> wrote:
>>
>>> Hi,
>>>
>>>     I want to ask a question. Who can tell me how to upgrade bmv2 logic
>>> with json file dynamically?
>>> In other words, reconfiguration bmv2 dynamically.
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> P4-dev mailing list
>>> P4-dev at lists.p4.org
>>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>>
>>
>>
>>
>> --
>> Antonin
>>
>>
>>
>>
>
>
> --
> Antonin
>
>
>
>


-- 
Antonin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170419/447ae9e3/attachment-0002.html>


More information about the P4-dev mailing list