Live data from Hacker News

FPGA NTP Server

research.wand.net.nz

1–10 of 70 posts

Re: FPGA NTP Server

#4
post #2

Doesn't jitter depend more on the network latency, rather than the real-timeliness of the process?

Jitter is the variation in latency of all sources.

The latency of the A) delay in the original packet being sent + B) the latency of the network itself + C) latency of the ntp server receiving the packet + D) latency of the process answering the packet + E) latency of the kernel sending the response + F) the latency of the network itself for the return pack + G) the latency of the client receiving the return packet and giving it an accurate local time mark.

On a uncongested LAN, B & F can be very low in absolute terms and low in variation. This server constrains C, D, & E to basically nothing. So only A & G-- the limitations of the client itself -- remain. How long does it take to receive the frame, get it to system RAM, dispatch an interrupt (which may be coalesced), service the interrupt, and context switch to/wake up the right client process? Alternatively, the network driver can capture a timestamp at the moment the packet is received, eliminating a lot of this variation.

NTP clients assume half of the delay is client->server and half is server->client, for the purpose of computing offset. That is, they subtract half the roundtrip delay off the received time. So reducing delay in C, D, & E further reduces the amount that this guess can be wrong by.

Re: FPGA NTP Server

#7
post #6

how much would it cost to buy the underlying hardware?

Less than $200.

The board there is overkill -- if you really want something with a Zynq including an Arm Cortex A9 that can run Linux, the Arty Z7 from Digilent is another Zynq board that's essentially a one-stop shop for this: https://store.digilentinc.com/arty-z7-zynq-7000-soc-developm...

However, for something as simple as an NTP server you could easily get away with an Arty A7: https://store.digilentinc.com/arty-a7-artix-7-fpga-developme...

From there you can instantiate either Xilinx's Microblaze MCU _or_ you could stick to Arm and use one of Arm's DesignStart cores (Cortex-M1 or Cortex-M3): https://developer.arm.com/ip-products/designstart/fpga/fpga-...

Glancing around Digilent's catalog, they've got an even cheaper Zynq board: https://store.digilentinc.com/cora-z7-zynq-7000-single-core-...

Re: FPGA NTP Server

#9
post #7
post #6

how much would it cost to buy the underlying hardware?

Less than $200. The board there is overkill -- if you really want something with a Zynq including an Arm Cortex A9 that can run Linux, the Arty Z7 from Digilent is another Zynq board that's essentially a one-stop shop for this: https://store.digilentinc.com/arty-z7-zynq-7000-soc-developm... However, for something as simple as an NTP server you could easily get away with an Arty A7: https://store.digilentinc.com/arty-…

thank you for providing all this info!

as someone who doesn't know much about fgpa boards, what does it mean when you write "From there you can instantiate either Xilinx's Microblaze MCU"?

Also, one thing that is confusing to me is that the source code that is linked on this page is a .h and .c file, is the fgpa on these zynq boards programmable with C code?

Re: FPGA NTP Server

#10
post #8

Why not PTP too?

PTP seems like a telco/enterprise thing; hackers don't care about it.

I personally enjoyed the challenge of setting up PTP at home. Why would a hacker scoff at nanosecond-level timekeeping —- isn’t the entire internet a “telco/enterprise” thing?
Post reply on HN