First the receiver for latency-sensitive traffic needs to be started on Host 2. This process waits for connections from the sender
and then transmits its statistics to it.
ip addr add 192.168.1.2/24 dev eth0
isochron rcv --interface eth0 --quiet
The sender is started on Host 1 as follows:
ip addr add 192.168.1.1/24 dev eth0
isochron send --interface eth0 --dmac 00:04:9f:05:de:06 --priority 6 --vid 0 \
--base-time 0 --cycle-time 400000 --shift-time 50000 --advance-time 90000 \
--num-frames 10000 --frame-size 64 --client 192.168.1.2 --quiet
The log should look as follows:
Base time 0.000040000 is in the past, winding it into the future
Now: 1586282691.751150218
Base time: 1586282691.751160000
Cycle time: 0.000400000
Collecting receiver stats
Summary:
Path delay: min 4329 max 4444 mean 4387.987 stddev 24.508
HW TX deadline delta: min -65238 max -18938 mean -59707.395 stddev 1371.995
SW TX deadline delta: min -33528 max 25058 mean -28221.001 stddev 1844.235
HW RX deadline delta: min -60874 max -14529 mean -55319.408 stddev 1372.222
SW RX deadline delta: min -43398 max 130659 mean -38212.966 stddev 2514.592
HW TX deadline misses: 0 (0.000%)
SW TX deadline misses: 1 (0.010%)
The following clarifications are necessary:
• The destination MAC is that of Host 2's interface eth0
• The sent packets have a VLAN tag with VID 0 and PCP 6. Because they are priority-tagged (802.1p) the sja1105 switch
ports will accept these packets without any "bridge vlan add vid 0 dev swp3" command.
• The isochron program sends a number of 10000 frames, at an interval of 400 us. The base-time is the same as on the sja1105
egress port swp2, but it is shifted with 50 us to the right, in order to align with the beginning of traffic class 6's window (which
is the second timeslot in the schedule). The packet transmission deadlines are therefore at (base-time + shift-time + N *
cycle-time).
• Packets must in fact be transmitted earlier than the TX deadline, in order to compensate for scheduling latencies in the Linux
kernel and the actual propagation delay of the packet. So the isochron program sleeps until 90 us in advance of the next
deadline.
• By "winding the base time into the future", one understands the process by which the original base time (0) is incremented
by the smallest number N of cycles such that it becomes greated than the current PTP time (1586282691.751150218). In
this case, the new base-time is 1586282691.751160000.
• For each packet, the sender collects 2 TX timestamps: one hardware and one software. The receiver also collects two
timestamps. These timestamps are not printed to the console because the --quiet option was specified.
• Correlation between timestamps at the sender and at the receiver is done through a secondary socket. The receiver waits
for connections on TCP port 5000, and transmits its log to the sender, which correlates with its own log by using a key formed
out of {sequence number, scheduled TX time (deadline)}. Both these values are embedded into the packet payload. If the --
client option is omitted, the statistics correlation is not performed. This TCP socket is the only reason for which IP
communication is necessary in this network.
• The path delay is calculated as the delta between the RX hardware timestamp at the receiver and the TX hardware timestamp
at the sender.
NXP Semiconductors
TSN
Open Industrial User Guide, Rev. 1.8, 05/2020
User's Guide
137 / 199