Thursday, November 12, 2015

Mesh Networking for Ham Radio

Welcome Ham friends de KD6VZQ

If you have not already done so I would suggest reading previous posts I've created on this subject. It would help with understanding some of the geeky information I'm about to provide.

Posts are ( Here ) and ( Here )

For Hams, I'll be showing BroadBand-Hamnet. This is the firmware that is more focused for ham radio operations. I will not be demonstrating DD-WRT. For those of us who prefer a more advanced system, I would suggest DD-WRT.

The information I'm providing here is all information on a larger puzzle. If after you get your routing system working, and in need of additional information for trouble shooting. My hope is that the information provided here will help you.

If you are just wanting to install the firmware, you can skip to the installation process from here. Now for the fun stuff.

Some brief definitions:

NODE - Any system or device connected to a network is called a node.

GATEWAY - A gateway is a network point that acts as an entrance to another network. In this case your mesh router connected to internet.

WDS - Wireless Distribution System and is a feature supported by an increasing number of 802.11 access points. (AP) Simply put, it enables single-radio APs to be wirelessly connected instead of using a wired Ethernet connection. Think of this as wireless repeater mode. In this mode the router can communicate wirelessly with another router that supports WDS.

MAC address - A MAC address is a hardware identification number that uniquely identifies each device on a network. The MAC address is manufactured into every network card, such as an Ethernet card, Wi-Fi card, or Router, and therefore cannot be changed.

FIRMWARE - software that is embedded in hardware, allowing for hardware to do its function.

Example: you do not need a computer to be hooked up to a router, in order for the router to work. The Router will function on its own with instruction from its own firmware.

Some general information:

Pay close attention to Router hardware Make, Model, and Version numbers that you get. Reason being is that the Wi-Fi CPU ( Main Wi-Fi chip on circuit board ) needs to match the other mesh router Wi-Fi CPU. If it's the same chip Manufacture ( Broadcom, Atheros, Marvell, Ralink ) but a different version of the same chip. You have about a 50% chance of the two routers communicating. If the two chips were of same manufacture and version number. Then you would have 100% chance of communication between routers. If you were to have two routers from different manufactures, there is still a chance it will work. but it is a small chance. A big part of this is comes from Manufactures not wanting for there chips to speak with another manufactures chip. It would be like Intel and AMD collaborating to build the best computer in the world by sharing their technologies with each other. It simply just isn't going to happen anytime soon.

You won't be able to know what chip a router has unless you were to take a look at the circuit board directly. Most of us most likely wouldn't want to do that. So I suggest that if you are not comfortable taking apart your router to look at the chip; you get multiple routers of the same manufacture and same version number. It might help reduce any trouble shooting you might need to do in the future.

Difference between a Hub and a Router:

The functions of the two devices — the hub, and router — are quite different from one another, even if at times they are integrated into a single device. Which one do you use when? Let's take a look...

Hub

A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.

Router

A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISPs network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

Mesh routing systems act more like hubs. They repeat everything on the network. It goes in one port on a router somewhere in the mesh and gets repeated to all other routers and ports on the mesh. You can also use the mesh router as a gateway connection. providing access to another network or internet.

Wireless mesh networks can self form and self heal

Unlike nodes in a star topology, (star topology is your standard home network) which require a router to deliver Internet service, network nodes can "talk" directly to each other without requiring the assistance of an Internet connection. A big advantage of this decentralized topology is that there cannot be a single point of failure (SPoF). If one node can no longer operate, all the rest can still communicate with each other, directly or through one or more intermediate nodes.

Mesh networks can use a full mesh topology or a partial mesh topology. In a full mesh topology, each network node is connected to all the other nodes in the network. In a partial mesh topology, at least one node connects directly to every other node while others may only connect to those nodes they exchange data with on a frequent basis.

Maximum Transmit Power

As always, Hams must operate under FCC Part 97 rules and regulations:  
no music, no profanity, no business activity, etc.

Maximum Transmitter Power Output (TPO) is 100 watts (or 50dBm), although we will probably never encounter more than a couple watts.

The Node Name (included with every transmission) must include your call sign. Common practice is to append a few additional identifying characters (e.g., KD6VZQ-M2), since your call sign may be associated with several nodes.

Only licensed amateur radio operators should be able to access Part 97 hardware (in this case, modified Part 15 devices). So, take steps to prevent unauthorized users.

EIRP and Antenna Gain

The following formula can be used to calculate the EIRP limit related RF power based on selected antennas (antenna gain) and feeder (Coaxial Cable loss):


EIRP = Tx RF Power (dBm)+GA (dB) - FL (dB)

The following table describes this formula:
Formula ElementDescription
EIRPLimit specified by Part 97 (100 Watts) maximum power
Tx RF PowerRF power measured at RF connector of the Mesh Router
GAGain of the Antenna you intend to use
FLCoaxial cable line loss / Feed Line loss

Calculating Line Loss

There are a lot of types of coax cables I'll list a few of the common ones in regards to Wi-Fi use.

Cable Sizes Commonly Used for 2.4 GHz
Cable Diameter Line Loss at 2.4 GHz (per 100 feet)
LMR-100 1/10" -38.9 dB
LMR-240 3/16" -12.7 dB
LMR-400 3/8" -6.6 dB
LMR-600 1/2" -4.4 dB

Wi-Fi radio transceiver effectiveness is described as a measurement of power output and receive sensitivity. Generally, these two measurements are expressed as power in milliwatts (expressed as mW, meaning 1/1000 of a watt) or as “dBm” (decibels related to 1 mW).

Decibel measurement can be confusing. But there are two key concepts to make this easy to understand:

1: Decibels are relationship-oriented

2: Decibels double by threes

Relationship-oriented means that there is no set value for a dB. The trailing letter in a dB measurement defines the relationship. For example, dBm means decibels related to 1 mW of power. 1 dBm equals 1 mW. When you know the value of the relationship, decibels are easy to calculate.

Doubling by threes is due to the logarithmic nature of RF energy.When comparing a signal of 1 dBm (1 mW) to a signal of 3 dBm (2 mW) you see that it’s double the power. This doubling nature of power measurement or line loss makes it easy to see how a cable can quickly reduce the RF signal to almost nothing.

dBm = TxP - FL (FL in decibels / dB)

Description
TxP Transmit power out from router
FL Coaxial Cable / Feed Line loss
dBm Milliwatts measured in Decibels

Continuing the last example (LMR-100 versus LMR-400), let’s start with a signal of 100 mW ( 20 dBm) and send it out along the 100 foot–cable. Start with the transmit power, 20 dBm or 100 mW, subtract the negative dB of line loss, and the result is the power at the other end of the cable:

1. LMR-100 (38.9 dB loss): 20 dBm 38.9 dB 18.9 dBm (about 0.001 mW)

2. LMR-400 (6.6 dB loss): 20 dBm 6.6 dB 13.4 dBm (about 20 mW)

In each case, it’s a large drop. But look at the difference! LMR-100 drops power to a tiny fraction of the original signal. LMR-400, on the other hand, while inefficient, still has a usable signal.

In general the fatter and shorter the cable the better. No cable is even better; as there will be no loss to measure from a cable. Keeping loss in mind. If you're going to place your router 30 feet in the air. Plan on having a way to make it easily reachable in case there is a need for trouble shooting. You could get an amplifier, but they're still a bit pricey and hard to come by for the time being.

INSTALLATION of Mesh Firmware

By special request from various hams who know me personally. I'll be providing step by step instructions with screen shots. Instead of helping each Ham individually. I'll be helping a broad base of Hams all at once with these set of directions.

If you have not read my previous post on Getting Started with Mesh Networking. I would highly suggest you read it ( HERE ). I'll be assuming that you have at the very least read that helpful information before moving forward. Also as this post is geared towards Hams getting started with understanding mesh networking. I'll be using the firmware provided by Broadband-Hamnet.

One note about pictures and graphics. This free service from Google Blogspot is free. And I have limited control of the photo / picture size you might see. If you are in need of more larger details of photo. Simply click on the photo / picture and it will take you to the location of the original picture with greater detail.

Now to the fun stuff:

Find a Router you can use. I've already done the research ahead of time as to which routers I will be able to use. Hopefully you will do the same before you head out to purchase a used router.




Be sure to check the bottom of the router for version number.





Gather your tools of the trade. During this install I'm using my trusty Raspberry Pi B+ operating with Ubuntu Linux. I'm in the process of testing a battery with it as well. The Router I'm gong to use for this demonstration. A Cat 5 / Ethernet cable, and power supply for Router.



Boot up the computer you are going to use to reprogram your router.


 Open up your internet browser of choice and go to Broadband-Hamnet.org


 On menu to left side click on Software Download and Select Linksys on following menu


 Find your router in the list of available downloads for various routers.


Download and Save your file to local machine.


Once file is downloaded and save to your local machine, double check it has been saved. Next we disconnect our machine from the internet. Make note of where you saved the file on your machine.


After we've confirmed that we are disconnected from the net. We hook up our computer to the router we are prepping to re-program. Take a Cat 5 cable and hook it to the computer, and the other end to one of the 4 ports on the back of the router. Plug the router power in and wait for about a minute for router booting process to complete.


 After router has completed its booting process, it should have assigned a new IP to your computer. If it has not you can do two things. The first is to manually tell your computer to renew its IP. And the second is simply to reboot your computer. Rebooting your computer forces everything to renew. I don't like to reboot because that takes too long, but when all else fails. . . Reboot.. :)

Now that your computer has got a new IP. You should be able to communicate with the router by opening up your internet browser of choice and in the URL bar type in the following IP address. 192.168.1.1


If you're are lucky. You have a router where the default username ( ADMIN ) and default password ( ADMIN ) has not been changed before your got your hands on it. If your not so luck. well its easy enough to get around that. Just a few extra steps. Though you may need to confirm the process with the manufacture if my suggestion does not work.

1. Un-Plug router from power
2. Hold down the reset button at the back of the router. (might need paper clip)
3. Continue holding the reset button down while your plug the power back in.
4. Still holding the reset button wait for router to complete booting. about one minute.

In most cases this process works and resets the router to factory defaults. If it doesn't work you may need to find manufacture documentation on the process. You can usually find it online.



After a successful login, your should see a similar screen. Click on administration to right. near top of screen. Then click on Firmware upgrade.


 Click on the Browse button to locate the file you had downloaded from Broadband-Hamnet

 Once you have located the file. Click on upgrade to start the re-programming process.


After re-programming has commenced, you will notice that you will not be able to get to the router like before.



This is ok. we just reprogrammed the router and it now has a different set up rules for operation. One of which is a different set of IPs to operate with. You will need to renew your IP address like you just did previously. After getting a New IP from the router. You should be able to login.


So we open our internet browser and type in the following address. localnode:8080 to get to the screen above. Click on the Setup button to login to your newly programmed router.


You should get a login prompt. the default username is root and the default password is hsmm
You should gain entry to the setup screen.



Welcome to the setup screen. You will need to change two things before your router will work. First is to change the node name, preferably something with your callsign in it. As you see in this example I put KD6VZQ-M2-RPI. place something with in reason in your node name. The second is a required password change. Make careful note what your password is. If you loose it, it will not be easy to access the router if password is lost. After making changes click on the Reboot button at top. Reboot will take about 2 minutes maximum. If router doesn't come back up you might need to restart the router and / or your computer.

After a full reboot and getting back to localnode:8080 click on the button that says Mesh Status. it'll provide you with information on local mesh routers that is it connected with. Keep in mind that in order for a Mesh Router to communicate with another, its SSID must be exactly the same character for character. example: Hsmm is different than hsmm. Caps counts.

 If you have more than one working router. They will see each other and you will have started building a Mesh Topology network.

Thanks much for reading this Mesh Networking post for Hams. I hope that the information provided during this post had some value of helpful information for you.

73's de KD6VZQ - Tracy Thibault