behavioral-model icon indicating copy to clipboard operation
behavioral-model copied to clipboard

No API to add LAG to Multicast Node using P4Runtime GRPC

Open simoelazzab opened this issue 4 years ago • 2 comments

I wrote a simple C++ controller app to the configure simple_switch's via CLI and now I am trying to move all the calls to p4runtime GRPC interface. My problem is that I could not find a way to create and attach LAG in the Packet Replication Engine like what those CLI commands do : mc_set_lag_membership and mc_node_create ports | lags .
Replica class defined in the p4runtime.pb.h has only rid and egress_port as attributes, there is no LAG. I saw that pi library exposes easy to use APIs that include multicast LAG nodes but from what I understood it connects to bmv2 with nanomsg only (No grpc). Here is a piece of code that I use to create multicast group:

    p4v1::MulticastGroupEntry group;
    group.set_multicast_group_id(grp_id);
    for (int port: ports) {
        auto r = group.add_replicas();
        r->set_egress_port(port);
        r->set_instance(rid);
    }
    int dev_id = 0;
    p4v1::WriteRequest request;
    request.set_device_id(dev_id);
    auto *update = request.add_updates();
    update->set_type(p4v1::Update::MODIFY);
    auto *entity = update->mutable_entity();
    auto *pre_entry = entity->mutable_packet_replication_engine_entry();
    pre_entry->CopyFrom(group);
    p4v1::WriteResponse response;
    ClientContext context;::p4::v1::Replica
    Status status = pi_stub->Write(&context, request, &response);

Is there any method to create LAG multicast node via P4Runtime GRPC ? or a way to use pi APIs via GRPC

simoelazzab avatar Jul 03 '20 17:07 simoelazzab

I do not know the details of the behavioral-model implementation well enough to answer your full question, but I do know that in the latest version of the P4Runtime API specification, it only documents messages that can add and remove switch ports to/from a multicast group. There is no part of the latest P4Runtime API spec that deals with LAGs. It could be extended to do that, of course, but that would be in a later version of that spec.

jafingerhut avatar Jul 06 '20 14:07 jafingerhut

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment, or this will be closed in 180 days

github-actions[bot] avatar Sep 01 '22 00:09 github-actions[bot]