Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

10 January 2025

Junkbin GPS Stratum 1 NTP Clock Source (A Work in Progress)

I don't know where most of these parts came from, but when I opened my electronics junk drawer the other day I found an Orange Pi Zero+ and a serial GPS of dubious quality that also featured a PPS out.  With these two parts in hand and a suitable project box, my weekend free time is suddenly consumed with a pending project: build a stratum 1 NTP server using only parts on hand.


OK, but what even is that word salad of a title?


Network Time Protocol (NTP) is a method of synchronizing clocks over the internet.  Wikipedia has much better information than I could ever hope to provide here, but the gist is NTP servers are organized hierarchically based on their distance from known stable clock sources.  This distance is referred to as the 'stratum' of the server.  Stratum 0 is a master clock itself, such as a GPS, atomic clock, WWV signal, or other authoritative time source.  Stratum 1 is any NTP server directly attached to a stratum 0 clock.  Since my junk drawer project welds a microcomputer and GPS receiver together, it will (eventually) qualify as stratum 1 (with caveats).


Pulse Per Second (PPS) is a signal put out by time sources to define the precise beginning of a second.  A GPS connected via serial port can vaguely define the time in its NMEA sentences, but PPS provides a stable 'tick-tock' to the time sentences.

10 August 2024

AREDN Mesh Access via PFSense Firewall

After several months of wrestling with integrating an AREDN node into my home network, I finally arrived on an iteration that I think I am content with.  It isn't perfect, and I will detail the limitations below, but to sum it up, I am treating the AREDN node as a second WAN, with a bit of tomfoolry to get DNS working properly.

This guide will only allow for access to resources on the mesh.  It will not allow access to the wider internet via the mesh.


Most of the configuration followed the PFSense dual-WAN guide word for word (which can be found here).  As seen in the screenshot above, the connection is set up as DHCP.  One area where I deviated from the guide is unchecking both boxes under the 'Reserved Networks' header, as AREDN utilizes the 10.0.0.0/8 private address space.  On a side note, your home network better not be using the same address space or you're probably going to have a bad day.

The most important key to making all this work is DNS.  If you try and enter your AREDN node's IP address as a DNS resolver for the AREDN connection gateway, PFSense will puke out an error.  This leads to my workaround utilizing PFSense's internal DNS resolver, Unbound.


In PFSense 'services' menu, select 'DNS Resolver' and scroll all the way to the bottom where you will see the header 'Domain Overrides'. Add an override for the domain "local.mesh" pointing at the IP address of your local AREDN node.  This allows unbound to redirect all DNS queries ending in local.mesh to the mesh node.

And that's it! Point your browser at your node and browse around the mesh to make sure everything works as expected.  Note that this is not a perfect solution.  For example, if you host a service behind PFSense that you also wish to expose to the mesh, you will have to add a second set of rules to expose that device and specific port.  In that scenario, it would also be beneficial to add a static IP in your mesh node as well.  However, for simple access to the larger mesh, this solution is hard to beat.


~ moose

30 August 2023

Milestones

 Fiber is pulled all the way through the conduit, into the garage and house.  Confirmed as good end to end with equipment connected on both ends.  Next step is to get radios and hamputer relocated, everything on a UPS, vlans set up, etc etc.  The important takeaway though is I now have a working layer 1 between house and garage!


~shotgun moose





20 August 2023

Shotgun Moose goes off half-cocked

 Somewhat expensive lesson to learn, but learn it I did. Always pull cables by their jacket, not their termination.



Internet out to garageshack will (eventually) be provided by a fiber run.  I had purchased a pre-terminated length of fiber with LC connectors on each end.  Off I go, eager to get operational, and I make the mistake of tying pull line to just the LC connector, and not the cable jacket too.

Half way though, the pull line gets really light, and all that comes out the other end is the LC housing, sans any fiber.

Don't be like me! Learn from my mistake!


~shotgun moose