[P4-dev] dual-homing support with P4

Javier Blazquez jblazquez at riotgames.com
Mon Jun 20 19:48:25 EDT 2016

It feels like this kind of logic belongs to a layer above the P4 data
plane. There's no way to write "event handlers" in P4 that can react to
those kinds of events.

Consider the simple_router[1] program. Line 34 sets the egress_spec
metadata field to the desired output port based on which port the next hop
is connected to. But this is just the _intended_ egress port, as per the
spec. The abstract queueing mechanism[2] that processes packets in between
the ingress and egress pipelines is responsible for deciding which actual
port to use and setting the read-only egress_port metadata field

Maybe your queueing implementation could have the necessary logic to
understand link down and lossy link events and avoid using those links when
assigning packets to output ports. Another option is for your control plane
to react to those events by rewriting entries in the ipv4_lpm table that
reference the bad ports to use the secondary ports instead so your queueing
mechanism doesn't have to do anything special, but this could be pretty
slow if you have a lot of entries on that table.


[2] see page 6 of the v1.1 spec:

On Mon, Jun 20, 2016 at 3:29 PM, He, Peng <phe at ciena.com> wrote:

> I see nice examples under p4lang/tutorials, e.g., ECMP, Copy_to_cpu, etc.;
> it would be nice if a dual-homing example with P4 can be provided, i.e.,
> illustrating how P4 supports this kind-of device/network behavior; and how
> P4 mechanism detects and re-act to network/device behaviors like link down,
> link transmission quality drop down (packet corruption for an example). By
> dual-homing, I mean a device has two uplinks, one active, one backup. Once
> a failure is detected on the active link, the device will switch over the
> traffic to the backup link immediately. Thanks a lot.
> Regards,
> Peng
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160620/56a43c2e/attachment-0002.html>

More information about the P4-dev mailing list