Ask HN: What's with the DIY state of the art long-range Wi-Fi?

319 points by tucnak ↗ HN
Hey,

I lead the technical efforts at one of the charities in Ukraine; we're now trying to rebuild connectivity for people in some of the areas where much of the civilian infrastructure was destroyed and Starlink® is not a viable option, or perhaps "not-to-be easily scaled option."

The world of long-range Wi-Fi is a wild one!

We are now trying to evaluate the cost of a point-to-point mesh network using commodity hardware, and so far have only experimented with Raspberry hardware to work the antenna, and some Atheros AR9331-based SoC's. The idea is to make a single device that can act as both a relay station, as well as an actual hotspot, it then can be placed in line-of-sight configuration to potentially cover huge areas (the accepted performance would be anywhere from 0.1-1 Mbit/s point-to-point over anywhere from 5-20km. We are aiming to bring the cost of such configuration down to $100 per unit at least. Hopefully, we also wouldn't need to do so and somebody else could do the whole thing for us at a similar price... Where would you start, i.e. with the vendors, as well as the commodity hardware, firmware that should work best for a setup like this? Bonus points; if it can be somewhat be aware of the current happenstance. In terms of bleed from Electronic warfare deployed by the enemy in Ukraine; it has to work hopefully in adversarial environment!

Best regards, Ilya The Stone Cross Foundation

66 comments

[ 3.9 ms ] story [ 132 ms ] thread
Reach out to various existing infrastructure projects that build and maintain large community-owned P2P WiFi deployments, the two largest ones are Freifunk and Guifi. They would surely be able to and wanting to help you, if you reach out to them. Try https://freifunk.net/en/contact/ and https://matrix.guifi.net/

Most of them are using commodity hardware from Mikrotik, Teltonika and Ubiquiti. Basic setup for a personal node is just an antenna + router. Then they usually have the concept of "supernodes" who are responsible for hooking up multiple personal nodes, and have uni-directional antennas + multiple ones + bigger routers to facilitate the routing.

I'm not sure you'll be able to put together a supernode with decent range for under $100 though, think the cost would be more than that, but I would be happy to be proven wrong.

In terms of firmware, I've almost exclusively seen OpenWRT being used (and the rest running default Mikrotik/Ubiquiti firmware), with various self-made patches done to it before installing it on the hardware.

This is the right answer. The Freifunk people have a lot of experience and knowledge.

Anecdote: A while back I was moving houses ~1km with trees obstructing line-of-sight and without connectivity at the new house for the first couple of months. I had to move but could keep the old place connected. I jerry-rigged Ubiqity PtPs that I had inherited from a friend at each end. Packets started dropping on rainy days but it was working surprisingly well.

Not necessarily a fan of Ubiquity and their closed ecosystem per se, and it might not be the best pick for a project like OPs if there are options.

(Throwaway because these hotspots were brought from abroad..)

A curiousity about Ubiquiti firmware. It seems like the AP firmware is based on openwrt
And IIRC a lot can be flashed with openwrt too!
their NICs will not work with regular kernel drivers. you will lose the only edge their hardware have which is dealing with a stupid large number of clients.

everything else (speed, uptime, ram/cpu power, beanforming magic, etc) you are better off with linksys devices when using open source drivers.

>speed, uptime, ram/cpu power, beanforming magic

I literally have none of these problems and I run ubiquiti everywhere

I also have a small compact car and it is fine for me to drive it every day to work, market, etc. Doesn't mean an expensive sports car is not much, much faster.

The irony is that here the compact car is more expensive :D maybe the correct analogy is a minivan, since it can hold more clients. but still, more expensive than the TP-Link sports car.

Oh, that would be handy. I have a couple, and they work just fine as regular APs. However, the odd time I do need to make changes, it's going through the whole bloated UI and management app (with MongoDB etc. installed). Really, I'd be quite happy to just run independent OpenWRT on them, since I don't need to integrate with larger infrastructure.
it is but in the worse way possible.

They take and contribute nothing back. just a base to get up and running quick in their startup days.

Also most of their own pieces is just a awful api/shell that tries very hard to simulate the worse of cisco ios shell.

Have you looked into the Ubiquiti AirMax kit?
Ubiquiti is amazing. really attractive price point, pretty solid kit and performance and really easy to setup and use.
Compared to Mikrotik, Ubiquiti only has better UI and more bells and whistles (pretty graphs and so on), while Mikrotik tends to be cheaper and have the same performance and being able to control/configure every aspect of the hardware. If you're trying to build a cheaper kit, I'll probably go for Mikrotik, in this scenario at least (ie not "WiFi in my house/property" but cross-country mesh network).
Agreed. I've got a bunch of their switch gear and have setup WiFi too with no issues. Got a 4G LHG dish setup in a roof for 2 years too which works great (there's pretty much no cell service there with a phone, the dish reaches max bw of the (admittedly slow) closest tower.
Here is a write-up of the NYC mesh network

https://docs.nycmesh.net/intro/

NYC Mesh is a great initiative, and probably the one with the most "modern" setup as it's the newest one. But take into consideration that it might also not be as reliable or work at the same scale as Freifunk or Guifi.

Number of online nodes per network as of today:

- NYC Mesh: 1281 (https://www.nycmesh.net/map)

- Freifunk: 42,524 (https://www.freifunk-karte.de/)

- Guifi: 37,721 (https://guifi.net/en/node/3671/view/nodes)

Not sure if these numbers are the best to go by. Freifunk surely has the most setups. I might be completely wrong on this but I think most Freifunk installations are isolated, i.e. single-node with e.g. the local DSL as upstream. I wonder which of these have nodes with no cable-bound upstream or at least actually used interconnects with other nodes.
Wireless Belgium has been building DIY wifi networks on a very large scale since 2003. They have a lot of experience and maybe even spare hardware to start with your project. To get in touch: https://www.wirelessbelgie.be/contact/
Freifunk should work fairly easily; take 2-3 2X2 MIMO routers (like 20 bucks each), adjust the firmware for them, get the P2P directional link to either use existing satellite dishes (not sure what the easy orthomode splitter is, here, as you need same-source-spot signals for both horizontal/vertical or left/right polarization), or simple DIY'd axial helix antennas (made on plastic/cardboard tube of appropriate diameter, by winding an even spiral at the right "thread pitch", then fixing it in place with glue/tape, and weatherproofing the assembly) (one wound like a normal screw thread, the other like a reverse thread, and put side-by-side with a gap of like 5-10 tube diameters to not interfere with each other).

Use the router's switch ports to connect them with each other, and use one local router with stock antennas pointing straight up to serve local clients and mesh with possible nearby mesh nodes.

The electronic warfare resilience is going to involve hacking the collision avoidance techniques to be sufficiently less aggressive, and likely to get Freifunk to use encryption for the mesh links. If necessary, just set up P2P links with per-link encryption. Routing-table-affecting nodes in a mesh sadly need some inherent trust to be performant in the non-adversarial case, or at least, no one seems to have tackled that possible issue yet (to the point where you could just compile existing software for the router at hand and get something working by the end of next week).

Seconded, Freifunk is easy to use and pretty resilient, there is also a pretty large community of people with knowledge about it and the hardware requirements are as low as they will go.

Beware of some of the possible downsides: the default is for Freifunk nodes to be placed on a map and I'm not sure if this is a requirement or not but it might provide easy targeting information for the Russians. This will have to be taken into account, and if possible to be done without.

Also, Freifunk nodes are open enough that behind-the-lines enemy could use it to phone home without a trace, so likely you'll need some extra FOF kind of authentication mechanism.

People more versed at this than I am will most likely have a whole bunch of other concerns about setting up a system like this.

Finally, long haul is all about antenna tech, I would suggest to enlist the help of as many local HAMs as you can find.

While being placed on a map is clearly bad, commodity WiFi is not great for anything that shouldn't be located, as it is obviously radiating in RF and will be detectable some distance further than the signal can actually be decoded.

Tactical radios are specially designed for the problem. Eg using spread spectrum approaches, and plain not transmitting most of the time and only by the choice of the operator.

It's possible that open source SDR could be applied, but I guess that the Ukrainian side have been supplied with military radios by their allies.

I'm not very familiar with Freifunk, but if it interfaces like a normal WLAN to the user, then simply not advertising SSID and a basic password will go pretty far. This is obviously not secure against any sort of special operative, but eliminates it as a very easy convenient tool for e.g. a mobik with a cell phone, if this finds its way anywhere near a frontline.

An upside of highly directive, P2P links is that they can provide some protection against EW, simply by nature of having a constrained field of view. Also I'll note most consumer devices (laptops, cell phones) have pretty bad antennas, they're assuming you have a router right nearby. You might get much better coverage if you're also able to provide the user with a simple USB dongle that can attach to an external antenna (e.g. a 10dBi yagi-uda)

If there is need for any input on the antennas side, I'm more than happy to help (EM PhD, design antennas for a living). 2.4GHz is relatively forgiving, you can literally hand make antennas, with some attention to detail. If you have access to shipping (I really don't know the situation) they can be mass produced on PCB.

While not sure if it will help/matter for the OP, I'd like to confirm the idea/thought of using (ground-plane-having-for-back-lobe-suppressing) axial-firing helix antennas, in pairs, to do circular polarization MIMO on the point-to-point long-distance links. So one clockwise and one counter-clockwise helix, connected to the two antenna ports on a cheap 2.4 GHz router.

Gain seems to max out around 15 dBd, in that case, for a 90cm long antenna of ~5cm diameter. The beauty of circular polarization there is the independence of mounting angles/matching rotations, but I guess a small forest of H/V dual-polarization Yagi's (or, for routers with 3X3 MIMO, 3 equally-spaced polarization directions, assuming that works without breaking the workings of the Yagi) might be easier due to the potential for a solid metal center pillar to hold the elements.

A forest instead of a lone Yagi would be to increase gain more efficiently than by merely elongating a single Yagi, as the latter would quickly cause mechanical issues in wind.

I'm imagining access to an improvised spot welder to attach lengths of copper wire to a steel support pillar, then finished with some paint as an anti-corrosion coating. Or some more low-tech attachment process, like a styrofoam pillar with the wires pierced through in the right spots, mounted either indoors or in a drain pipe or such for weather protection.

Can you confirm that these approaches are appropriate for the situation/call some out that are not appropriate?

What do you think of Yggdrasil to handle mesh routing? I know it has "flapping" issues (connecting and disconnecting the root node rapidly), though that was somewhat mitigated, and need to control the root (compute/"mine" a suitable key) first.

Ideally, we'd have Wi-Fi NAN (Wi-Fi Aware/Neighbour Awareness Network) on all devices (including routers, smartphones), discovering devices close by and allowing Yggdrasil to work on top. That's very recent though. I blame Apple keeping AWDL proprietary.

Some of that can probably be approached by connecting handsets to multiple networks at once (the chips usually support it, but I don't know about the OS).

In the end, in this case it's probably better to ask a local ISP for cooperation (ask for a part of their spectrum, and put 4G antennaes and local 4G to Wi-Fi APs). It can still be meshed together.

I think in terms of cheap PtP and PtMP equipment that has fairly long ranges you can’t beat ubiquiti’s product line. They are fairly easy to use for technical people with less networking experience. Try out their cool network planning tools at

https://ispdesign.ui.com/

(I have no affiliation with UBNT, I just use their stuff at home)

We started using their stuff "as an experiment" in my civil protection service unit and have had great experiences so far — a breeze to set up and manage, really good performance, and surprisingly affordable even at retail prices. I think it's a bit above your budget constraint except for the CPE side, but maybe you can reach out and set something up given it's for humanitarian purposes or someone on here has a connection.
The Pi is lousy for that unless you get something with an external antenna connector. Back in the 2000s, we set up inter-building links with Cisco Aironet PCMCIA cards (which did not have the EIRP power limits currently enforced for consumer products) at blistering 11Mbps speeds (well, it was fast for the time) and a few years later we did it again at 54Mbps in the 2.4GHz band with OpenWRT devices like the WRT54g, doing 10Km with external directional antennae.

I also built my own 3G range extender with an almost identical off-the-shelf $50 Yagi antenna at a country cottage (2.2 and 2.4GHz are close enough for an antenna to carry both), so I've spent a while pondering those kinds of scenarios.

But addressing your points directly, I would look for OpenWRT-compatible devices with external antenna ports and the ability to do both 2.4 and 5GHz - and most likely try to use 2.4 for long-distance point-to-point links with Yagi antennas.

Hitting the bitrates you mention seems perfectly doable, although I must point out that the antennas are conspicuous (about the length of two Pringles cans). The challenge I found is having router hardware that can pin SSIDs to separate radios, because most of the modern stuff aims for diversity and prioritizes throughput.

There is HamWAN (https://hamwan.org/) that works over amateur radio frequencies. Seems like a very DIY, volunteer, and helpful community
Take a look at AREDN, the Amateur Radio Emergency Digital Network -- https://www.arednmesh.org. They use commercial WiFi gear (see https://www.arednmesh.org/content/supported-platform-matrix) with custom firmware, running on the adjacent ham radio bands (which have less noise on them, allowing for greater distance, although I wouldn't be surprised if the WiFi bands and radio bands have different allocations in Europe.) Surprisingly (to me, anyway) they say that 'N' speed WiFi works better at long ranges than newer protocols.

Honestly, as you are in Europe, you should look into the European Hamnet. See https://hamnet.eu/site/community.html and https://www.tapr.org/pdf/DCC2014-TheEuropeanHAMNET-DG8NGN.pd.... They aren't using WiFi, but the goal is the same.

Both of these require licensed amateur radio operators to use normally. (Maybe wartime is a different matter). I do believe I heard that Russia took radio transceivers away from operators in the Ukraine, but don't know much about it.

Just as a note: you can easily configure AREDN to not use non-ISM channels.

Regarding custom firmware: yeah, but it's really openwrt with some CGI scripts. If you're not trying to specifically join their preexisting networks, you can accomplish everything it does off of vanilla openwrt with not much effort. I think understanding what's actually going on under the hood in networking terms is valuable enough to skip the preconfiguration, though I guess that depends on the exact deployment case. If this isn't intended to be used militarily in any way and is just putting up infra in rear areas, maybe that doesn't matter.

This post ended up a bit more negative than I intended, so I should say that I have successfully used AREDN (or similarly configured openwrt) on Ubiquiti APs with yagis to do more or less what the OP is asking for, and it works pretty well. This is overall a good suggestion.

The state of the art for any non-ionospheric relatively high frequency radio transmission is how high the antenna pair are above their local terrain. Power input, modulation, antenna type, these hardly matter in the face of a hill or a valley.

The only thing that matters for 2.4/5 GHz wifi long range is height above surrounding terrain to get line of sight. The highest technology is literally the technology to get the antennas highest; ie poles, towers, tops of tall buildings, actively lifted (and powered) drone platforms for antennas, sides of mountains, etc.

Can't antenna gain help a lot as well? Parabolic dishes, etc.
I can't talk to long-range Wi-Fi or necessarily the state of the art, but perhaps a couple of these resources may be helpful:

The Internet Society have some resources on community networks here: https://www.internetsociety.org/action-plan/2022/community-n...

And then there's the Things Network, which operates over the LoRaWAN (Long Range Wide Area Network) protocol: https://www.thethingsnetwork.org/

Lastly (and potentially not super relevant), there was a talk at LibrePlanet 2021 about efforts to set up community networks in Turkey (although more from the perspective of ensuring user freedom): https://media.libreplanet.org/u/libreplanet/m/freeing-networ...

Why not just use off-the-shelf equipment with modified external antennas? Use OpenWRT on cheap equipment that will accept an external antenna.
Heyo. I run a small rural ISP using off-the-shelf Mikrotik P2P hardware. Cost per AP is about 80 dollars a unit for 100mb bi-directional link that hits out on average 16km, depending on your LOS.
>> point-to-point over anywhere from 5-20km

I think 20km point to point is not to be sniffed at if my back of a napkin calculations are correct (would love someone more knowledgeable to correct!)

Firstly on LOS - that’s like 15m+ masts at each end of the link (assuming perfect LOS path with no clutter like trees or buildings).

Then on free space path loss you’d be looking to overcome around 100db+ of path loss i think assuming 2.4ghz ISM band and perfect atmospheric conditions.

10dbi / 12 dbd log periodics for 2.4ghz are available off the shelf and are very reasonable to use (not too big, not too much wind loading at 15m elevation, weatherproof etc.)

Recieve sensitivity should be around -110dbm maybe? Assuming fairly rural conditions so that you’re not also dealing with a man made noise floor (and also benefitting from a very directional antenna to miss most noise too).

You’d need a 1 watt power amplifier minimum, again that’s more or less off the shelf but there’s restrictions globally on use and that may make sourcing harder.

The loss is only one facet of the problem - the round trip time becomes a significant problem, requiring large windows and timeouts and general weirdness - time travelling ARPs, for one - as does the ability of consumer equipment to send a signal your AP can receive. The Wi-Fi antenna in a phone or laptop is not generally very powerful.

The limiting factor isn’t the AP, in short.

Now, running LTE microcells - that’s a viable option in a desperate environment, and one that can be done with SDR. Only problem is then getting consumer equipment to authenticate with it. This is possible, either with eSims or with cooperation from local regulatory authorities - but not altogether trivial.

This is borne off the back of experience - I tried to do long range Wi-Fi, but for a usable experience from consumer gear (a phone), 2.5km was about as far as I could get with a 1 watt amp on a dipole.

Got much further with a yagi, but funkiness emerges beyond about 4km on 802.12g. You’d get further on b but your rates will be pants.

I would do LTE for this application. My solution where I am is a mast that receives LTE atop a hill and has four yagis doing 802.11g to receiver nodes, which each comprise a repeater with a yagi pointed at the mast, and a dipole omni to get a solid 500m radius around each repeater. I’ve covered 15ha of tortured terrain with Wi-Fi with this - and come to think of it, the highly directional signals could provide hardness against interference and would greatly mitigate interception issues.

Oh, and I’d you’re doing yagis, you need real ones, not the fake crap you’ll usually find for sale. The real deal is about 70cm long for 2.4ghz and will have tapered vanes to the point. Commercial models come in a plastic can.

Just to clarify for people reading this comment:

This:

>10dbi / 12 dbd log periodics for 2.4ghz are available off the shelf [I assume this is actually talking about 12dBi and 10dBd which are equivalent]

combined with this:

>You’d need a 1 watt power amplifier minimum

Is very illegal in the US and probably most other places in the world. There is a hard 1W transmit power limit and a 6dBi antenna gain limit. Fixed point to point links can use higher gain antennas in combination with lower transmit power, but there is no situation in which 1W transmit power + 12dBi gain is legal.

They're at war and being constantly bombed; I think being legal or not is the least of their concerns.
For emergency communications (probably lower than 0.1/1mbps at 5/20km though), you might be able to get away with a LoRA.. Probably would be a lot cheaper to build and lighter to carry around (all with a smaller antenna).
LoRa would indeed allow cheaper and more lightweight installations, but the bandwidth comparison between WiFi and LoRa makes LoRa basically not a comparison, unless you want to build something text-only over it. Forget being able to browse the web for example (besides HN probably).

Edit: I see now you mention the bandwidth difference and saying to use LoRa just for emergency broadcasts, that'd make sense.

A project I worked on did 802.11(b)? over about 30+ kilometers. The wireless stack was custom written though. The closer devices had planar directional antennas. The further devices had parabolic antennas. There was 3 different towers servicing ~180 detectors. Planar antennas near other towers had to have a shield added. This was 2007.

I don’t recall bitrates. The area was well over 500 km^2

project is here: telescopearray.org

It's not state of the art (and it's showing it's age) but I've always loved the Wireless Networks in the Developing World book [0]. It covers the basics about propagation, antennas, infrastructure and such, but software has changed a bit since last edition.

Also, keep an eye on different editions, as I believe last one is a little less tech focused and more into how to run a community project, both sets of knowledge are highly important but second edition might be outdated in regards to software availability in OpenWRT and Linux in general.

https://wndw.net/book.html

Mikrotik makes wifi radio-links where the radio is integrated into the dish, connected by cat5 for example. The right solution to avoid lossy antenna cables/connectors where power is limited to begin with.

For long distances, you will probably need to "scavenge" bigger dishes (1m diameter) from other sources to be within budget. IIRC, any microwave dish will be useable, including satellite tv dishes, if you use a suitable transceiver-antenna "head" (DIY-able) and align it. In addition, tv dishes on buildings look inconspicuous.

Ideally, the wifi radio should be placed in the focal point of the dish and directed such that the reflected signal points to the horizon. But most TV dishes are not symmetric to allow them to be mounted vertically (and avoid collecting snow) while pointing into the sky.

You might need to read up and figure all this out.

Wi-Fi is not good solution, because too prone to noise. Better if find something frequency-hopping.

BTW I'm in Kiev, first time hear about The Stone Cross Foundation. Could You tell more about it?

Hey, we've ultimately decided to separate the local hotspot (Wi-Fi) and the actual long-distance antenna, as well as a HSM using a dedicated controller. Unfortunately, there's still too many moving pieces and customisability presents a huge challenge. (For one: we need to introduce Diffie–Hellman key derivation, basically to figure out the hopping pattern in the frequency domain.) However, in some cases it may be beneficial to have the Wi-Fi endpoint cover a bigger area, then it's race to the bottom to allow for the receiver hardware. The Stone Cross Foundation is the first Ukrainian charity built completely around zero trust and data analysis, we specialise primarily in humanitarian logistics, warehousing, Diia integration, and superforecasting. Our biggest contribution is a back-office solution for volunteer network management which includes Matrix-CRDT and other Double Ratchet tricks. We have struggled to go retail, and at some point gave up for the time being in favour of concrete priority engineering projects at hand.

Happy to get in touch and tell all! https://keys.openpgp.org/search?q=ilya%40hrest.org

Seems pointless, to me long range wifi is 4g or 5g.

I'd rather have a way to do long range data directly between two phones.

One tool you could use to design the network, check line of sight, potential bandwidth, etc. is this nice Ubiquiti tool: https://ispdesign.ui.com