NPR: Hamnet over 70cm

Some days ago, Guillaume F4HDK emailed me to introduce me his latest project, NPR (New Packet Radio). This is an open-source modem designed to carry IP traffic over the 70cm Amateur radio band, with data rates of up to 500kbps. The goal of this modem is to be used for the Hamnet Amateur radio IP network, to give access to end users where coverage on the 2.3GHz and 5GHz bands is poor due to the terrain.

Guillaume knew that I had worked on IP over 70cm with my CC1101 and Beaglebone black project, so he wanted to know what I though about NPR. After reading all the available documentation, I found NPR very interesting. Indeed, Guillaume has come up with clever ways of solving some of the difficulties I foresaw when planning out my experiments with the CC1101.

The most important aspect about NPR is that it is already a finished product that people can build as a kit and start using. My experiments with the CC1101 were a mixture of proof of concept and play around, and never progressed from that stage due to lack of interest in my local Amateur community. However, Guillaume has put a lot of time, thought and effort in developing NPR. Of course the project can evolve further, but it is usable in its present stage. In what follows, I do a detailed analysis of the technical aspects of NPR.

Hardware

The main idea of NPR is to use an FSK transceiver chip intended for the ISM bands. This is a very inexpensive way to get a complete transceiver for FSK data in the 70cm band. NPR uses the SI4463, which in many aspects is similar to the CC1101 I used. In fact, there are several different chips from Silicon Labs and Texas Instruments which have similar characteristics.

The hardware design of NPR is modular. There is a custom PCB which acts as a carrier board where different modules are soldered. For the SI4463, the RF4463 module is used, which has an amplifier that gives 500mW or 1W. Similarly, in my experiments, I used some Chinese boards containing the CC1101 and a small PA of 1 or 2W.

The SI4463 in NPR is controlled with an STM32 microcontroller. The Mbed Nucleo L432KC board is used to provide the microcontroller. This is an important difference from my experiments, in which I used the Beaglebone black, which is a full system running Linux.

My first experiments with the CC1101 started with an Arduino Uno connected to a host computer using USB, but soon I found out that I needed a more powerful system to drive the CC1101 at high speeds. In particular, the Atmega328P had very little RAM. Thus, I went with the Beaglebone black, because I already had the hardware and I was used to the platform.

I imagined that programming in Linux would be easier than using a microcontroller, and the complete Linux system offered a lot of flexibility. I could use the Linux IP stack to make my project act as a complete router, and the system could be used for other tasks in parallel. However, it turned out that it was impossible to drive the CC1101 in real-time from userspace, so I ended up programming the Beaglebone black PRU in assembler to drive the CC1101.

The end result was interesting, in that real-time performance was guaranteed by using the PRU, but still a good portion of the code was a Linux userspace C program. However, the PRU assembler code is not easy to maintain. Another disadvantage of using the Beaglebone black is that it drives up the price for a complete solution. Now I reckon that the best solution is to use an ARM microcontroller, as Guillaume has done with his NPR.

Since the Nucleo board doesn’t have Ethernet, Guillaume is using a ETH WIZ click, which does Ethernet over SPI. Of course, using Ethernet over SPI is not as fast as having an Ethernet controller built into the microcontroller, but for the data rates of 500kbps that NPR uses, Ethernet over SPI is perfectly fine. Probably it is less expensive to get an ARM microcontroller without Ethernet and an Ethernet over SPI chip than using a microcontroller with Ethernet built-in.

That is all the hardware in an NPR modem, as the figure below (taken from the NPR introductory slides) shows. Guillaume says that the modem can be built for $70 to $80, including the enclosure. Probably the cost could be driven down a little by making a custom PCB with all the chips and assembling a build of several tens of units. However, the idea of building the project using modules is nice and it helps people to start building their own NPR modem right away, instead of having to wait for a batch build.

NPR hardware

One of my main concerns while experimenting with the CC1101 was power. With 2W and 2FSK at 128kbaud I observed that I would need much more power to get a reliable link without line of sight. I thought about using one of the Mitsubishi RA UHF amplifier modules, such as this kit from Minikits. However, T/R switching was a big question. Relay switching was probably too slow for these experiments, and I didn’t know of any inexpensive and easy to use T/R switching kit using PIN diodes that could handle several tens of watts.

Guillaume has found a clever and good solution to this problem. He uses an amplifier intended for DMR, such as the VR-P25D, which gives 25-30W and costs 120€. Since DMR uses TDMA, T/R switching of these amplifiers is very fast, and done with diodes. In hindsight, this solution is so obvious that I’m left wondering why it didn’t occur to me. I don’t have much interest in DMR, so I don’t have a good knowledge of the products that are on the market. But still, I talked with other Amateur operators about the challenge of T/R switching, and we couldn’t find a good solution. Maybe these amplifiers didn’t exist or were not very popular back in 2016, since the popularity of DMR has grown a lot in the last few years.

NPR TDMA protocol

So far I have described the NPR hardware. This gives you a rather flexible platform capable of doing 2 and 4-FSK at up to 1Mbps with 20 or 30W of power and fast T/R switching by somewhat less than 200€, which I think is rather affordable. However, probably the most interesting thing about NPR is the software, since Guillaume has designed a complete managed TDMA system to handle several concurrent clients connected to a base station.

In my experiments with the CC1101 I just used some kind of CSMA system, trying both 1-persistent and non-persistent schemes. This was easy to implement, but I knew it was far from optimal for a real world system. Guillaume has put a lot more thought in designing NPR and he has decided to go with a managed TDMA system, in which a base station allocates time slots to the clients. I think that this is a very good approach, especially for the intended application of user access to Hamnet.

The details of the NPR protocol can be read in the NPR protocol specification (This is another strong point of NPR. The documentation is quite good and complete.) The figure below, which is taken from the specification, shows the structure of the TDMA protocol implemented in NPR.

NPR TDMA structure

In each TDMA frame, the master starts transmitting. The master timeslot is composed of a reduced micro slot where the TDMA slot allocation is transmitted, plus zero or more micro slots which contain radio frames with useful downlink data.

After this, we have a TX/RX margin and TA (timing advance) margin of silence. The TA margin is 2ms, which equals the maximum allowed round-trip-time of 300km. Thus, the TX/RX + TA margin allows the first transmitting client (Client 2 in pink, in the figure) to switch into TX after it has heard the end of the master’s timeslot, and for his transmission to arrive to the master after up to 1ms of propagation.

Each client’s timeslot is composed of several micro slots, which have the maximum duration of a radio frame. The client can send radio frames shorter than the maximum size, so only the first radio frame sent by each client needs to be aligned to a micro slot boundary, as depicted in the figure above.

In each TDMA frame there are 17 micro slots to be allocated among the master and connected clients in fast mode (those requiring large bandwidth). The last of these 17 microslots is always allocated to the so called 8x multi frame time slot. The NPR protocol supports up to 7 connected clients, plus the concept of “discovery”, where unconnected clients may transmit to start a connection. In each TDMA frame, the multi frame slot is dedicated to one of these 7 clients or to discovery. Thus, each client has a chance to transmit every 8 TDMA frames. This is used for clients in slow mode (those not requiring large bandwidth) and for maintaining the connectivity between the master and clients.

This is an overview of the managed TDMA protocol used by NPR, which I think is the most novel and interesting thing regarding the NPR software. I refer the reader to the protocol specification for more details.

There are a couple of things about the NPR protocol that I don’t like so much and that I think could be improved. One of them is rather simple: the protocol only allows encapsulating IPv4. Probably you know that I am a huge proponent of using IPv6 in Amateur radio, and I think that there is some value in allowing to encapsulate other protocols as well.

For my CC1101 experiments, I sent Ethernet frames over the CC1101. From the point of view of the Linux running on the Beaglebone black, the CC1101 appeared as a TAP device. I am not sure whether sending Ethernet frames over one of these 70cm links is a good idea. On the one hand, the Ethernet addressing is unnecessary, since there are other ways of addressing more suitable to the link in question (in the case of NPR, each of the clients is assigned a number between 0 and 6, which is used in the slot assignation). On the other hand, IPv4 and IPv6 have discovery mechanisms (ARP and NDP, respectively) for translating between Ethernet and IP addresses. If we route Ethernet frames, we can use these existing protocols. If not, some alternative protocol needs to be designed and implemented. In the case of NPR, there are some built-in functions in the protocol to assign IPv4 addresses to clients.

I don’t think it would be very difficult to allow IPv6 or other protocols to run over NPR, but I’m not sure about the best way to proceed regarding address discovery. The way that IPv4 is integrated into NPR seems too specific, so perhaps it pays off to spend some time thinking about an addressing mechanism for an Amateur radio link layer. The HAM-64 addresses described in this proposal could be used as MAC addresses, and then ARP and NDP could be adapted to work with this addressing scheme. HAM-64 addresses have the advantage that they encode an Amateur radio callsign, so they can be used to satisfy the regulatory requirement of identifying the transmissions of an Amateur station.

The other thing that I don’t like about the NPR is FEC. The FEC scheme used is very naïve. Guillaume tells me that the reason for this is that he doesn’t know a lot about FEC, but that he is already learning and thinking about an improved FEC for the next version of the protocol.

In the current protocol, most of the contents of a radio frame are protected by FEC. The FEC encoding is organised as a single block per radio frame. The block is split into three pieces of equal size. Then the XOR of all the bytes in each piece is appended to each piece. Finally, a fourth piece of FEC bytes is formed in the following manner: the n-th byte is the XOR of the n-th bytes of each of the three pieces.

The idea is that the three pieces are read and the XOR byte is used to detect if they have errors or not. If, out of the four pieces, only one has errors, then it can be recovered from the three other pieces by using XOR.

There are two problems with this idea. First, the XOR is not a very good way of detecting whether a long string of bytes has errors or not. It is much better to use a real CRC algorithm. Second, this FEC scheme is very ineffective. It uses a coding rate of 3/4, but typically it will not be able to correct many errors, since it is quite likely that they fall on different pieces.

It would be much better to use a completely different kind of FEC. For instance, one could start thinking about using a simple Reed-Solomon (255, 223) code, though this has the problem that the code size doesn’t fit well with the NPR radio frame sizes. However, the Reed-Solomon code can be used by blocks as a (128, 96) code, or as a (64,48) code, achieving a coding rate of 3/4 and correcting many more errors than the current FEC of NPR. Another option worth exploring is LDPC codes.

In my CC1101 experiments, FEC was handled by the Linux userspace code, so it was easy to drop in new FEC decoders and experiment (although I didn’t play much with this). In NPR, we have a limited microcontroller to do FEC decoding, but I think that still many FEC decoders should run without problems.

Data rate and bandwidth

Even though the SI4463 is very flexible regarding data rate, since NPR uses a TDMA protocol, only a few different data rates are supported, because the length of all the TDMA elements has to be chosen in terms of the data rate. The figure below shows the possible options. Both 2GFSK and 4GFSK modems can be used, with raw data rates between 300kbps and 1Mbps, and an RF bandwidth between 270kHz and 750kHz.

NPR supported data rates

This is slightly different from what I intended with my CC1101 for Hamnet ideas. There, even though I had flexibility in the data rate, since I wasn’t using TDMA, I settled on a 128kpbs MSK modem to do my tests. I chose this data rate because I figured out that 128kbps could still be moderately useful, while not spending too much RF bandwidth and supporting poorer links.

Regarding RF bandwidth, a good question is what is an appropriate bandwidth for this kind of ideas in the 70cm band. At the level of IARU R1 bandplanning, the VHF hanbook only has allocations for modes with up to 20kHz of bandwidth. There are two exceptions to this rule. First, the frequency of 434MHz is used as centre of activity for wideband digital experiments. Second, ATV is allowed between 434 and 438MHz, but care has to be taken not to cause interference to the Amateur satellite service, to use the lowest necessary bandwidth (for instance, up to 2MHz for DATV) and to keep transmissions short (also, no repeater outputs).

It is quite clear that for experiments or sporadic use one can use up to a few MHz, mimicking ATV usage. However, if one pretends to deploy something more “production-like”, such as a user access to Hamnet, then the IARU R1 bandplan doesn’t really have a good allocation for wideband data of a few hundreds of kHz.

Since part of the 70cm bandplanning is left to National Societies, there are countries in which the bandplans specifically allow for this kind of wideband data stations. For instance, the German 70cm bandplan has two slots of 200kHz for wideband digital automatic stations: 434.800-435 and 439.600-439.800. They are designed to be used with a 4.8MHz shift for duplex if necessary. However, I don’t know of any other countries with such allocations in their national bandplans. At least, nothing like this exists in Spain or the UK.

The NPR RF bandwidth is too large to fit in the German 200kHz slots, but I think that the main problem is that people designing these systems don’t have a good indication about what maximum bandwidth would be appropriate for this kind of stations, since there are no suitable allocations in the bandplans.

Don’t get me wrong. I think that it is most important to start experimenting with this kind of wideband data signals in 70cm, and for this the 434MHz experimental allocation and the NPR bandwidths are ideal. However, if this is ever going to be deployed in a permanently running base station, one should have bandplanning in mind. Thus, I think that IARU R1 needs to expect that more ideas such as NPR will be appearing in the future and that they need an appropriate allocation in the bandplans. I feel that there is enough space for them in the 70cm band (as the German bandplan indicates): 430.4-431, 433.6-435, and 439.5-440 are not used very often.

Some daydreaming

I have heard some people arguing that using FSK transceiver chips for this kind of projects is not a good idea. Of course, an OFDM waveform would be much better suited to combat multipath. No doubt, it is the waveform of choice for high rate digital terrestrial systems such as LTE or DVB-T. However, it is much more expensive and difficult to build an OFDM transceiver. FSK transceiver chips literally cost 2 or 3€, and OFDM also has its own disadvantages regarding amplifier linearity.

While it would be really interesting to have an OFDM data modem for terrestrial 70cm traffic, an FSK modem based on a transceiver chip is something that you can actually build today, and it will not be so expensive, so people can buy it and use it. Thus, I say that thinking about OFDM is “daydreaming” and using an FSK chip is “actually building real things”.

I think that one should do an adequate mixture of daydreaming and building real things. Daydreaming is a really good way to come up with long term goals. So this is my small amount of daydreaming regarding terrestrial Amateur data traffic.

Surely an OFDM waveform is the way to go. When thinking about the hardware, I realise that we have two different kinds of platforms at hand. One of them is hardware modems, such as the SI4436, which are inexpensive but rather limited. The other is SDRs, which are more expensive but very flexible. I think that the future is using SDRs for everything, since their flexibility can make up for their cost. At one moment you can use your SDR for data traffic on 70cm, while the next instant you could be using it for working narrow band modes, or watching the spectrum, or for DATV, or who knows. Thus you only need one (or a few) good SDRs instead of many different radios. Using SDRs, new modems and waveforms can be deployed and tested with no hardware costs.

I am also interested in the lower VHF bands: 50MHz and 70MHz, mostly because they are really underused. The disadvantage of these bands is the size of antennas, especially if they are directive. However, they might be more effective with non-line-of-sight than the 70cm band. The 23cm band seems also very interesting for this kind of data experiments, due to it being underused. Unfortunately, it behaves more as a microwave band, so it is not very tolerant of non-line-of-sight.

Also, it is interesting to think outside the box of using a simplex frequency and the same modem for uplink and downlink. One could think about going full-duplex by using two different bands. Then the master station could transmit continuously, trunking the traffic for all the clients. The clients could use some sort of FDMA. This kind of idea lends itself well to having a complex master and simple clients. For instance, the master may transmit an OFDM trunk, while the clients use FSK transceiver chips with FDMA (or TDMA or a combination of both). Then only an expensive SDR transmitter and linear amplifier needs to be installed in the master station. The clients can use a cheap receive-only SDR to receive the OFDM downlink.

Conclusions

Overall, I think that NPR is a great project. In its present state it is already a useful kit that anyone can build. It is also a very nice platform to study and experiment with TDMA, and its protocol can be modified and improved further. It is also completely open-source, which I find essential for this kind of Amateur projects. Hopefully it will catch popularity and help increase the amount of data traffic in the 70cm band.

Still, there is much to experiment, much to learn and much to improve, but the only way forward is to interest people in this project, building it, using it, testing it, coming up with new ideas, and testing them in practice.

4 comments

  1. Hi Daniel, I’m following NPR since the beginning, but I didn’t find any useful detailed study about that before your nice article.
    I practiced packet radio for many years, I’ve built several S53MV wide-band radios, experimented TCP-IP over ax25 and I regret that period!
    Now I’m very excited about NPR. I’m trying to involve other local OMs in order to build a small experimental network.
    Thinking in a “daydreaming way”, IMO one limitation in the protocol could be the maximum number of clients (7).
    What appens to the 8th client which send a connection request? Just receive a reject like the AX25 “BUSY”? Then the user should periodically retry until one of the clients disconnects from the master?
    Best 73’s
    Alfredo IZ7BOJ

    1. Hi Alfredo,
      I’m not sure about what would happen in this case, but I guess that the master will deny or ignore connection requests from additional clients.

      My impression is that the limitation to 7 clients is deliberate (to save bits when addressing the clients) and reasonable. Think that it is intended as a user access for a relatively small (or sparsely populated) area. I don’t envision so many clients trying to connect to the same master. Also, since the data rate from the master is limited (up to 500kbps), sharing this between many clients doesn’t make much sense.

  2. Hi Daniel,
    thanks for your answer, that is very reasonable.
    My observation comes from the memories of the “golden age” of packet radio, when I remeber more than 7 users connected on 1200baud ports!
    Anyway, I wrote to Guillaume also, and I report his answer:
    “if a 8th client tries to connect, then it receives a “NACK” (reject from the Master), and the client modem tries periodically (every 15 sec) to send new connection request, and therefore it will automatically connect as soon as a “client slot” is free. ”
    Guillaume also says that he could increase the maximum number of clients in the next release of SW.
    But at the moment it is better to start to build modems and start experiments!
    73′
    Alfredo

Leave a Reply to Alfredo IZ7BOJ Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.