[P4-dev] l2_switch x simple_switch (bmv2)

Antonin Bas antonin at barefootnetworks.com
Mon May 15 15:00:35 EDT 2017


Hi,

The l2_switch.p4 was written specifically for the l2_switch architecture so
it is probably not a great idea to try running it on simple_switch. For
example, the intrinsic metadata field name for the multicast group id is
different between l2_switch and simple_switch.

As a rule you should be writing P4 programs for simple_switch and running
them on simple_switch. The other "targets" are here to show how the bmv2
library can be used to implement different architectures.
The differences between the targets are as follows:
- simple_router is a very simple P4 target with a single pipeline
- l2_switch is a slightly more advanced target which supports learning and
multicast
- simple_switch implements the P4 abstract switch model described in the
P4_14 spec (2 pipelines...). This is the recommended "default" target and
this is the one used for tutorials and used by NOS providers for testing
(e.g. Openswitch).

Antonin

On Sat, May 13, 2017 at 4:26 PM, Regis Martins <regisftm at gmail.com> wrote:

> BUMP
>
>
> On Tue, May 9, 2017 at 9:15 PM, Regis Martins <regisftm at gmail.com> wrote:
>
>> Hi all!
>>
>> I was trying to run the l2_switch.p4 in the simple_switch (switch) target
>> and it seems that it get stacked in tha mac_learn action...
>>
>> type: PACKET_IN, switch_id: 0, cxt_id: 0, sig: 12187842339622128657, id:
>> 21, copy_id: 0, port_in: 1
>> type: PARSER_START, switch_id: 0, cxt_id: 0, sig: 12187842339622128657,
>> id: 21, copy_id: 0, parser_id: 0 (parser)
>> type: PARSER_EXTRACT, switch_id: 0, cxt_id: 0, sig: 12187842339622128657,
>> id: 21, copy_id: 0, header_id: 1 (ethernet)
>> type: PARSER_DONE, switch_id: 0, cxt_id: 0, sig: 12187842339622128657,
>> id: 21, copy_id: 0, parser_id: 0 (parser)
>> type: PIPELINE_START, switch_id: 0, cxt_id: 0, sig: 12187842339622128657,
>> id: 21, copy_id: 0, pipeline_id: 0 (ingress)
>> type: TABLE_MISS, switch_id: 0, cxt_id: 0, sig: 12187842339622128657, id:
>> 21, copy_id: 0, table_id: 0 (smac)
>> type: ACTION_EXECUTE, switch_id: 0, cxt_id: 0, sig: 12187842339622128657,
>> id: 21, copy_id: 0, action_id: 2 (mac_learn)
>> *>>> it stops here <<<*
>>
>>
>> In the other hand, I tried to run some counters in the l2_switch
>> target... and it could not start.
>>
>> /home/ubuntu/bmv2/targets/l2_switch/l2_switch -i 1 at s1-eth1 -i 2 at s1-eth2
>> --pcap --thrift-port 22222 --nanolog ipc:///tmp/bm-0-log.ipc --device-id 0
>> task4.json
>> *P4 switch s1 did not start correctly.*
>>
>>
>> Does anyone know what are the differences among bmv2 targets
>> (simple_router, simple_switch, l2_switch, etc...)?
>>
>> It seems that simple_switch is the more "complete" as switch.p4 runs on
>> it... (I guess)
>>
>> Any information helps.
>>
>> Thank you in advanced.
>>
>> Regards,
>>
>>
>> *Regis Martins*
>>
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>



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


More information about the P4-dev mailing list