Miroslav Lichvar
2016-03-17 17:20:44 UTC
I'm wondering what changes would ptp4l need in the kernel in order to
support operation with bonded interfaces as a PTP slave. Currently, as
I understand it, it doesn't work at all, at least with the UDP
transports. I'm not very familiar with the kernel code, please tell me
if what I say doesn't make any sense.
I think there are at least two possible approaches. One would be to
add support for timestamping on the master interface and the kernel
would send to sockets bound to the interface timestamps from
interfaces that are currently active. As each slave interface may have
its own clock, ptp4l would need to know from which interface the
timestamp is. When that source changes, ptp4l would need to update its
state and restart the servo. phc2sys would need to know about all
interfaces and select the one which is currently synchronized.
A simpler approach (at least on the ptp4l side) would be to allow
receiving and sending multicast packets on sockets bound to the slave
interfaces. For each slave interface there would be a separate ptp4l
instance running which would synchronize the clock when the interface
is active and is actually receiving/sending packets. For each ptp4l
there would be a phc2sys instance writing measurements to SHM or
phc2sys could be improved to support multiple ptp4l sources.
Would this require more than a new socket option in the kernel?
FWIW, in a test I did with a single bonded interface and the L2 transport
ptp4l was able to bind to the slave interface, send and receive
packets, and synchronize the clock. I didn't have a chance to try it
with multiple interfaces and other bonding modes. Does anyone know if
it would work?
Thoughts?
support operation with bonded interfaces as a PTP slave. Currently, as
I understand it, it doesn't work at all, at least with the UDP
transports. I'm not very familiar with the kernel code, please tell me
if what I say doesn't make any sense.
I think there are at least two possible approaches. One would be to
add support for timestamping on the master interface and the kernel
would send to sockets bound to the interface timestamps from
interfaces that are currently active. As each slave interface may have
its own clock, ptp4l would need to know from which interface the
timestamp is. When that source changes, ptp4l would need to update its
state and restart the servo. phc2sys would need to know about all
interfaces and select the one which is currently synchronized.
A simpler approach (at least on the ptp4l side) would be to allow
receiving and sending multicast packets on sockets bound to the slave
interfaces. For each slave interface there would be a separate ptp4l
instance running which would synchronize the clock when the interface
is active and is actually receiving/sending packets. For each ptp4l
there would be a phc2sys instance writing measurements to SHM or
phc2sys could be improved to support multiple ptp4l sources.
Would this require more than a new socket option in the kernel?
FWIW, in a test I did with a single bonded interface and the L2 transport
ptp4l was able to bind to the slave interface, send and receive
packets, and synchronize the clock. I didn't have a chance to try it
with multiple interfaces and other bonding modes. Does anyone know if
it would work?
Thoughts?
--
Miroslav Lichvar
Miroslav Lichvar