A boundary clock is a network device with its own clock that is a PTP slave on one port and a master on its others: it ends one exchange and starts new ones, so that no PTP message crosses it. A transparent clock forwards PTP messages and adds to a correction field in each the time the message spent inside the device (its residence time), which the endpoints subtract from their timestamps.
fig_clock.py on firm.clocksync (seeded).fig_clock.py.