[P4-dev] Query Regarding Range Table

Ganesh C S ch.sa.ganesh at gmail.com
Fri May 22 22:27:15 EDT 2020


Hi Debobroto,

You should be able to use tcam match kind to achieve this. If the delay
values are nicely aligned on bit boundary like 4,8 then it is easy.
Otherwise will need multiple entries in tcam.

For 0-5 you can split it into two ranges: 0-3 (bit equivalent 00**) and 4-5
(bit equivalent 010*).  You must order more specific entries before the
less specific ones.

For example, I created the below entries to consider the first two delay
ranges 0-5->1 and 6-10->2 with 6 bits.

For 4-5 entry  00010* -> 1
For 6-7 entry 00011* -> 2
For 8-9  entry 0010*0 -> 2
For 8-10 entry 0010*0 -> 2
For 0-3 entry 0000** -> 1

regs
Ganesh

On Fri, May 22, 2020 at 3:44 PM Debobroto Das <debobrotodasrobin at gmail.com>
wrote:

> Hello Everyone,
>
> I want to implement a multipath routing in data plane.
> For example, assume in a device I have 4 ports. Each ports have a metrics
> which should be in range format. For example: this metrics is a delay value
> through this port. So, if  these 4 ports have following delay values
>
> port   | delay
> ==========
> 1       |    5
> ==========
> 2       |   50
> ==========
> 3        |  25
> ===========
> 4        |  10
> =============
>
> So if I want to select the port to forward a packet depending on the
> "delay" value, what type of match_kind  I should use here.
> An example query is, select a port that have delay value within rage
> 15-30. so clearly here the port 3 should be selected.
> how to achieve this kind of behavior in P4?
>
> On Fri, May 22, 2020 at 6:39 PM Debobroto Das <debobrotodasrobin at gmail.com>
> wrote:
>
>> Hello Everyone,
>>
>> I want to implement a multipath routing in data plane.
>> For example, assume in a device I have 4 ports. Each ports have a metrics
>> which should be in range format. For example: this metrics is a delay value
>> through this port. So, if  these 4 ports have following delay values
>>
>> port   | delay
>> ==========
>> 1       |    5
>> ==========
>> 2       |   50
>> ==========
>> 3        |  25
>> ===========
>> 4        |  10
>> =============
>>
>> So if I want to select the port to forward a packet depending on the
>> "delay" value, what type of match_kind  I should use here.
>>
>>
>> _______________________________________________
> 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/20200522/cba5e3db/attachment-0001.html>


More information about the P4-dev mailing list