Radio E-mail in West Africa: The Complete Version
Each of the radio e-mail servers in the field run headless, controlled from a simple command-line interface via Telnet session from the operator's desktop PC. The basic interface consists of four commands, usually run in the following sequence:
ppp.start mail.get mail.send ppp.stop
Simple shell scripts perform their respective tasks, each providing the operator with a modest amount of feedback about what is happening at the time. The functions could be further collected into a single command, such as mail.run, but we want to enable the operator to maintain some discretion over radio access, depending on the demands for voice communication. For example, if getting the mail takes more than 15 minutes or so, the operator may stop the session, reestablish voice communications for a security check, then start a separate session a few minutes later to send outbound mail.
The command interface shows that we don't try to get and send mail simultaneously. Rather, first we do one, then the other. This is another accommodation for the anemic, half-duplex bandwidth of the HF radio link. As far as network traffic goes, this link is like a one-lane backroad. More than a little traffic creates a long skinny parking lot.
It should be pretty easy to figure out that the mail.send script is a simple wrapper around the maildirqmtp command described in the second example. What may be less obvious is how we get the mail. That is, how do operators in the field run the maildirqmtp command on the radiohub server in Conakry?
As with most things UNIX, TMTOWTDI. You may choose, for example, to set up ssh for remote execution of the maildirqmtp command shown in the example. Alternatively, you could just go ahead and set up a POP3 server on the radiohub and use fetchmail over the link (with the—qvirtual option to strip the prefix added to each envelope's address), though you would then lose the benefits of QMTP.
For the Radio E-mail project, we decided to take advantage of Dan Bernstein's daemontools and ucspi-tcpi packages, already installed as part of our standard Life with qmail installation. The tools in these packages make it ridiculously easy to set up special purpose servers. Ours is called qturn and is modeled on Bernstein's AutoTURN comments described in the documentation with his serialmail package. With qturn we keep the significant efficiencies of QMTP, while avoiding the time-consuming overhead involved in establishing and authenticating an ssh connection.
The components of the qturn server running on the radiohub are provided in Listings 9 - 11. The principle is simple. The qturn run script (Listing 9) is set up as a daemontools service listening on a specific port of your choosing (here we use 55210). Anytime a connection to the port is made, the qturnd.sh script (Listing 11) is executed. This script reads the $TCPREMOTE environmental variable passed to it by the tcpserver invocation and gets the static IP address we have assigned to the incoming connection. The script then matches this IP address to the Maildir directory used for that field office. The maildirqmtp command is then run, sending the collected mail in the Maildir to the QMTP server on the remote host, while directing status output to filehandles that can be read by the client process.
Now the mail.get script on the client is simple, as is shown in Listing 12. It calls tcpclient to connect to the qturn server created with tcpserver on the radiohub and redirects the stream returned from that process to standard output. That's it! Client/server programming just doesn't get any easier.
As we may have mentioned, the HF radio link is a tad on the slow side. Yet we do manage to move a decent amount of mail with it nonetheless. On an average day, over 300 messages travel the airwaves between Conakry and field offices, over two to three brief connections per office. And as is typical with all internet technologies, every taste stimulates even greater appetite.
Given the limitations inherent in radio e-mail, we try to maintain a usage policy that is as open as possible. For example, staff are free to use radio e-mail for personal correspondence with friends and family anywhere in the world, and there is no limit to the number of messages any user may send. Our only explicit policy restriction is the request that users not subscribe to mailing lists.
To prevent the radio links from getting choked-up for hours on huge attachments, such as large documents and graphic files, all qmail servers connected to radios (that is, the radiohub in Conakry and each of the field office servers) are run with a message size limit of 8,000 characters. This is sufficient for three to four pages of text and is configured with qmail's databytes control file. We advise users of this message size limitation, suggest they stick to plain text for their correspondence and configure their mail client software accordingly. But whatever can be squeezed into the 8,000 byte limit by way of attachment and file compression is free to go. (Users in Conakry, which has a full-time, broadband gateway to the internet, are not quite as restricted. Here the databytes control file is set to one megabyte.)
As one would expect with our software selection, the system has proven extremely reliable. Despite the intermittent power outages typical in Conakry, we do try to keep the mailhub server coyah running at all times through the use of generator and battery back-up. So far these measures have kept this machine serving flawlessly since it was first installed, with a continuous uptime at this writing of over three months, no reboots.
Yet this reliability would mean nothing if the system were not sustainable over the long term. Two months before we installed the first radio server in the field, we formed a Network Users/UNIX Group among interested and capable IRC staff. This group meets regularly and enthusiastically to learn Linux/UNIX and to develop network administration skills. UNIX is a linguistically rich operating environment, and I think it finds a natural affinity among Africans whose language abilities seem inherently prodigious. In any case, the group now has a number of functional production systems on which to work and play, using mostly recycled hardware. While this article has focused on qmail and serial communications, the Linux servers installed for this project also host a typical range of other servers and services, including DHCP, DNS, natd, Apache, FTP, Samba and PostgreSQL. The IRC-NU/UG provides a human network that will continue to sustain and grow the technical network over the years to come.
The successes of this project are readily duplicated anywhere in the world. Schools, government ministries and other NGOs can easily build remote networking solutions over HF radio where access is otherwise not available, and at minimal cost. Once installed, these systems are almost trivial to administer and may be quickly adapted to alternative TCP/IP carriers. Maintenance of the e-mail system itself involves only the routine adding/deleting of user accounts, while keeping the /etc/aliases files up to date.
The current result of our own Radio E-mail project is that we are now serving mail to over 50 desktops and 150 staff in four offices throughout Guinea. The entire wide area network is serviced behind a single public IP address, at a total ISP cost of $150(USD) per month. Based mostly on existing hardware, the Radio E-mail project has leaped boundaries and opened dialogs for its users that were previously not possible.
Best of all, the system has deployed standard network and internet technologies throughout the organization and throughout Guinea utilizing the freely available, best of breed, borderless open-source technologies that underlie all global connectivity. Not only does this plant grass-roots networking infrastructure where there is yet no Internet, it helps build the core competencies and capabilities essential for Africa's connected future.
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- RSS Feeds
- A Topic for Discussion - Open Source Feature-Richness?
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Readers' Choice Awards
- The Secret Password Is...
- All the articles you talked
1 hour 12 min ago
- All the articles you talked
1 hour 15 min ago
- All the articles you talked
1 hour 17 min ago
5 hours 41 min ago
- Keeping track of IP address
7 hours 32 min ago
- Roll your own dynamic dns
12 hours 46 min ago
- Please correct the URL for Salt Stack's web site
15 hours 57 min ago
- Android is Linux -- why no better inter-operation
18 hours 13 min ago
- Connecting Android device to desktop Linux via USB
18 hours 41 min ago
- Find new cell phone and tablet pc
19 hours 39 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?