J
Joe Gwinn
Guest
On Mon, 17 Apr 2023 19:26:22 -0700, John Larkin
<jlarkin@highlandSNIPMEtechnology.com> wrote:
Probably RHEL.
Ten years ago, 20 microseconds first-bit-in to last-bit-out latency
was typical, because the switch ingested the entire incoming packet
before even thinking about transmitting it on. It would wait until
the entire packet was in a buffer before trying to decode it.
Now days, cut-through handling is common, and transmission begins when
the header part has been received and can be parsed, so first-bit-in
to first-bit-out is more like a microsecond, maybe far less in the
bigger faster switches. These switches are designed to do wirespeed
in and out, so the buffering delay is proportional to a short bit of
the wire in question. There is less blockage due to big packets ahead
in line. It all depends.
But when compared with RHEL churn, at least 200 microseconds, the
switch is not important.
The modern equivalent of a \"hub\" is an \"unmanaged switch\". They are
just that, but are internally buffered. If one chooses a
gigabit-capable unit, the latency will be quite small. For instance,
consider a NETGEAR 5-Port Multi-Gigabit (2.5G) Ethernet Unmanaged
Switch:
..<https://www.downloads.netgear.com/files/GDC/MS105/MS105_DS.pdf>
The datasheet specifies the latency for 64-byte packets as less than
2.5 microseconds. Again, this ought to suffice. Web price from
Netgear is $150. Slower units are cheaper, with increased buffering
latency.
The unspoken assumption in the above is that the ethernet network is
lightly loaded, with few big packets getting underfoot.
Also unmentioned is that non-blocking switches are not required to
preserve packet reception order. If the key packets are spaced far
enough apart, this won\'t cause reordering.
The wider world is going to PTPv2.1, which provides tens of
nanoseconds (random jitter) and maybe 50-100 nanoseconds average
offset error (can be plus or minus, depending on details of the cable
plant et al). But all this is quite complex and expensive. But in
five or ten years, it\'ll be common and dirt cheap.
Joe Gwinn
<jlarkin@highlandSNIPMEtechnology.com> wrote:
On Mon, 17 Apr 2023 21:38:52 -0400, Joe Gwinn <joegwinn@comcast.net
wrote:
On Mon, 17 Apr 2023 17:49:33 -0700, John Larkin
jlarkin@highlandSNIPMEtechnology.com> wrote:
On Tue, 18 Apr 2023 01:39:18 +0200, Klaus Vestergaard Kragelund
klauskvik@hotmail.com> wrote:
On 18-04-2023 01:38, Klaus Vestergaard Kragelund wrote:
On 17-04-2023 21:18, John Larkin wrote:
Suppose one were to send a broadcast packet from a PC to multiple
boxes over regular 100 Mbit ethernet, without any fancy time protocols
like PTP or anything. Each box would accept the packet as a trigger.
Assume a pretty small private network and a reasonable number of
switches to fan out to many boxes.
Any guess as to how much the effective time trigger to various boxes
would skew? I\'ve seen one esimate of 125 usec, for cameras, with
details unclear.
If you are connected to the Phy directly with high priority ISR, I think
you can do typical less than 1us.
problem is loading on the bus, or retransmissions, then it could be way
longer
If you need precise timing, you can use real time ethernet
https://www.cisco.com/c/dam/en/us/solutions/collateral/industry-solutions/white-paper-c11-738950.pdf
I was wondering what sort of time skew I might get with an ordinary PC
shooting out commands and fairly ordinary receivers and some switches.
The PC could send a message to each of the boxes in the field, like
\"set your voltage to 17 when I say GO\" and things like that to various
boxes. Then it could broadcast a UDP message to all the boxes GO .
With Windows <anything>, it\'s going to be pretty bad, especially when
something like Java is running. There will be startling gaps, into
the tens of milliseconds, sometimes longer.
All I want to know is the destination time skews after the PC sends
the GO packet. Windows doesn\'t matter.
My customers mostly use some realtime Linux, but that doesn\'t matter
either.
Probably RHEL.
Which is not a criticism - Windows is intended for desktop
applications, not embedded realtime. So, wrong tool.
With RHEL (Red Hat Enterprise Linux) with a few fancy extensions, it\'s
going to be on order of hundreds of microseconds, so long as you run
the relevant applications are a sufficiently urgent realtime priority
and scheduling policy.
To do better, one goes to partly hardware (with firmware) solutions.
The boxes would have to be able to accept the usual TCP commands at
unique IP addresses, and a UDP packet with some common IP address, and
process the GO command rapidly, but I was wondering what the inherent
time uncertainty might be with the ethernet itself.
How good that stack is depends on what the host computer is optimized
for.
I guess some switches are better than others, so if I found some good
ones I could recommend them. I\'d have to understand how a switch can
handle a broadcast packet too. I think the GO packet is just sent to
some broadcast address.
Modern network switches are typically far faster than RHEL.
I want numbers!
Ten years ago, 20 microseconds first-bit-in to last-bit-out latency
was typical, because the switch ingested the entire incoming packet
before even thinking about transmitting it on. It would wait until
the entire packet was in a buffer before trying to decode it.
Now days, cut-through handling is common, and transmission begins when
the header part has been received and can be parsed, so first-bit-in
to first-bit-out is more like a microsecond, maybe far less in the
bigger faster switches. These switches are designed to do wirespeed
in and out, so the buffering delay is proportional to a short bit of
the wire in question. There is less blockage due to big packets ahead
in line. It all depends.
But when compared with RHEL churn, at least 200 microseconds, the
switch is not important.
The modern equivalent of a \"hub\" is an \"unmanaged switch\". They are
just that, but are internally buffered. If one chooses a
gigabit-capable unit, the latency will be quite small. For instance,
consider a NETGEAR 5-Port Multi-Gigabit (2.5G) Ethernet Unmanaged
Switch:
..<https://www.downloads.netgear.com/files/GDC/MS105/MS105_DS.pdf>
The datasheet specifies the latency for 64-byte packets as less than
2.5 microseconds. Again, this ought to suffice. Web price from
Netgear is $150. Slower units are cheaper, with increased buffering
latency.
The unspoken assumption in the above is that the ethernet network is
lightly loaded, with few big packets getting underfoot.
Also unmentioned is that non-blocking switches are not required to
preserve packet reception order. If the key packets are spaced far
enough apart, this won\'t cause reordering.
The fancy time protocols, ethercat and PTP and TSN (and others!) are
complex on both ends. I might invent a new one, but that\'s another
story.
It\'s been done, many times. Guilty. But PTP over ethernet is
sweeping all that stuff away.
The wider world is going to PTPv2.1, which provides tens of
nanoseconds (random jitter) and maybe 50-100 nanoseconds average
offset error (can be plus or minus, depending on details of the cable
plant et al). But all this is quite complex and expensive. But in
five or ten years, it\'ll be common and dirt cheap.
Joe Gwinn