[P4-dev] Query Regarding Range Table
debobrotodasrobin at gmail.com
Fri May 22 23:15:38 EDT 2020
Sorry for my poor explanation.
What I am trying to do is following, a switch (s1) have 10 ports, through
all the 10 ports we can reach destination "2001:1:1::0". Now using INT, I
have calculated what are the average delay to reach destination
"2001:1:1::0" from s1. Currently, to select a path from multiple possible
path we can use selector (with combination of P4 action group). But in case
of selector, we can not use specific criteria to select which path we
should choose. So, I was planning to build a table where we will, populate
a table where we can keep 2 piece of information 1) port number 2)
corresponding delay to reach "2001:1:1::0" from S1. Instead of keeping the
delay in exact value, I want to keep them in few predefined values. for
example, if the maximum delay is 100 ms . we can keep a range of 0 to 8
(12.5 ms gap ) .
So when we want to select a port through wich we can reach to
destination "2001:1:1::0", within delay 50 ms, we will match the delay
field as 50/12.5 = 4. Which means any port that have delay 4, that should
be a valid match for my use case. Obviously in tcam, multiple match can
happen. on that case I assume that, either the lowest or highest index ed
entry among multiple matched entries will be returned.
(As far as my understanding, the V1model.p4 only returns a single matched
entry. I am working based on this assumption)
On Fri, May 22, 2020 at 10:27 PM Ganesh C S <ch.sa.ganesh at gmail.com> wrote:
> 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
> On Fri, May 22, 2020 at 3:44 PM Debobroto Das <debobrotodasrobin at gmail.com>
>> 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
>>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev