p4-discuss@lists.p4.org

discussion of p4 language ideas, tools, questions, etc. -- not related to direct code development

View all threads

Huge fluctuations in calculated link latency information

BS
Bibek Shrestha
Fri, Oct 30, 2020 9:26 PM

Hi,

I am trying to calculate the link latency between the switches. Below
is my bare minimal topology.

(h1)------(s1)------(s2)-----(h2)

Link latency is calculated in p4 as,
link_latency = s2.standard_metadata.ingress_timestamp -
s1.standard_metadata.egress_timestamp

I am using the bmv2 switch and made a change in the code to sync the
time with the system time as suggested. My setup is all done in the
mininet.

My expectation was that the latency would mostly be stable around some
values with some jitter. But what I am seeing is huge fluctuations in
the link latency whenever there is a change in queue occupancy in the
switches. If the switches are congested then the link latencies would
go up by a very high number.

Is my expectation of having relatively stable link latency with some
jitter correct in terms of how real networks work? If so, why am I
seeing such behavior with the bmv2 switch? Or is my way of calculating
the link latency is flawed? In that case, how should I calculate the
link latency?

Thank you

Hi, I am trying to calculate the link latency between the switches. Below is my bare minimal topology. (h1)------(s1)------(s2)-----(h2) Link latency is calculated in p4 as, link_latency = s2.standard_metadata.ingress_timestamp - s1.standard_metadata.egress_timestamp I am using the bmv2 switch and made a change in the code to sync the time with the system time as suggested. My setup is all done in the mininet. My expectation was that the latency would mostly be stable around some values with some jitter. But what I am seeing is huge fluctuations in the link latency whenever there is a change in queue occupancy in the switches. If the switches are congested then the link latencies would go up by a very high number. Is my expectation of having relatively stable link latency with some jitter correct in terms of how real networks work? If so, why am I seeing such behavior with the bmv2 switch? Or is my way of calculating the link latency is flawed? In that case, how should I calculate the link latency? Thank you
JG
John Grant
Sat, Oct 31, 2020 12:19 PM

ingress_timestamp is defined as "Time that packet began processing in
IngressParser" which I guess would include time waiting for previous
packets to be parsed; anyway it definitely wouldn't be the time the PHY
received the packet. What you're seeing suggests the parser isn't able
to work at line speed.

--
John Grant
Nine Tiles, Cambridge, England
+44 1223 862599 and +44 1223 511455
http://www.ninetiles.com

On 30/10/2020 21:26, Bibek Shrestha wrote:

Hi,

I am trying to calculate the link latency between the switches. Below
is my bare minimal topology.

(h1)------(s1)------(s2)-----(h2)

Link latency is calculated in p4 as,
link_latency = s2.standard_metadata.ingress_timestamp -
s1.standard_metadata.egress_timestamp

I am using the bmv2 switch and made a change in the code to sync the
time with the system time as suggested. My setup is all done in the
mininet.

My expectation was that the latency would mostly be stable around some
values with some jitter. But what I am seeing is huge fluctuations in
the link latency whenever there is a change in queue occupancy in the
switches. If the switches are congested then the link latencies would
go up by a very high number.

Is my expectation of having relatively stable link latency with some
jitter correct in terms of how real networks work? If so, why am I
seeing such behavior with the bmv2 switch? Or is my way of calculating
the link latency is flawed? In that case, how should I calculate the
link latency?

Thank you


P4-discuss mailing list
P4-discuss@lists.p4.org
http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org

ingress_timestamp is defined as "Time that packet began processing in IngressParser" which I guess would include time waiting for previous packets to be parsed; anyway it definitely wouldn't be the time the PHY received the packet. What you're seeing suggests the parser isn't able to work at line speed. -- John Grant Nine Tiles, Cambridge, England +44 1223 862599 and +44 1223 511455 http://www.ninetiles.com On 30/10/2020 21:26, Bibek Shrestha wrote: > Hi, > > I am trying to calculate the link latency between the switches. Below > is my bare minimal topology. > > (h1)------(s1)------(s2)-----(h2) > > Link latency is calculated in p4 as, > link_latency = s2.standard_metadata.ingress_timestamp - > s1.standard_metadata.egress_timestamp > > I am using the bmv2 switch and made a change in the code to sync the > time with the system time as suggested. My setup is all done in the > mininet. > > My expectation was that the latency would mostly be stable around some > values with some jitter. But what I am seeing is huge fluctuations in > the link latency whenever there is a change in queue occupancy in the > switches. If the switches are congested then the link latencies would > go up by a very high number. > > Is my expectation of having relatively stable link latency with some > jitter correct in terms of how real networks work? If so, why am I > seeing such behavior with the bmv2 switch? Or is my way of calculating > the link latency is flawed? In that case, how should I calculate the > link latency? > > Thank you > > _______________________________________________ > P4-discuss mailing list > P4-discuss@lists.p4.org > http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org