Resilient Disasters

Driving motivation with the resilient messaging protocol is to have a system that works in disasters.

One scenario is the Internet has gone down but low bandwidth link is available. Ham radio HF band can go long distances but has small bandwidth (300 bps). The plan is that would have sign out front of house, public Wifi network, and a gateway that sends messages over the radio. It would be slow and the queue might be long, but texts can get out. It also works with higher bandwidth links, like satellite phone or with part of Starlink connection.

The other scenario is communication over short distances between members of disaster response teams. It should work over Bluetooth, Wifi, Lora, and ham radio. It would also be nice if messages could be relayed to command center over ham radio links. I have idea for disaster management system that manages people assigned to incidents by messaging them over normal and reliable systems.

Resilient Connectivity

It will be useful to go through the different types of connections and how the protocol will work.

First, is connected to the Internet. I think it is important that the protocol be useful on the Internet. I think it is important that the applications always work and not only when poor connection. Or that resilient messaging protocol is useful for more than applications I thought about. I have dream that protocol could replace SMTP for email.

Second, is fully disconnected. The best example is being on airplane or out in the wilderness. Applications can still send messages but they get queued on the device. They are all sent when reconnect to the Internet. This allows work to get done when offline and to have a standard way to queue up messages.

Third, is disconnected local network or radio. This will allow passing messages between visible nodes without the Internet. Ad-hoc local network on Bluetooth or Wifi Direct applications already exists. Ham radio could really use a messaging solution. The important part is the broadcast discovery mechanism to find local nodes.

Fourth, is non-Internet or non-routable network with one node connected to the Internet. This allows sending messages when one node relay does. I think it needs to be optional if regular nodes relay through Internet connection especially when people pay for mobile. But it means that can relay messages through phone when the modem goes down. I think gateways, permanent relays, are going to be important since should be cheap to setup with Raspbery Pi. Also, this means that can connect far-flung radio areas with the Internet.

Fifth, is local network or device connected to Internet over slow link. This could be dialup or slow satellite. Or could be connecting a large network, like disconnected city, over relatively small pipe, like Starlink. This makes use of priority queueing where important and short messages are transmitted ahead of routine ones. This means that messages pile up in the queue and will get delivered when reconnected to Internet.

Sixth, is delayed connection. The best example is talking to the Moon with its one second delay. The queue allows filling the connection and priority means the important stuff is sent first.

Resilient Internet

I had idea recently that synchronous Internet can degrade into asynchronous messaging. This is the store-and-forward messaging from the early Internet, the UUCP, FidoNet, and SMTP protocols.

Messaging queue works best for high latency, and low bandwidth. High latency means don’t get a response and TCP breaks down. The only solution is to send a stream of messages and hope the receiver can handle them. Current software assumes good internet and can’t deal with slow connection. The solution is to queue the messages and send the important ones. Finally, there is disconnected. The solution for that is to queue messages for sending when reconnect. This is working offline.

Unfortunately, this won’t work with normal applications. The standard API calls don’t work since the response time can be too long. Applications will need to be rewritten to work with slow messages and lots will never work. Video calls will never work. Video messages could work but need higher bandwidth.

The first applications would be the messaging based ones: email and SMS. I think it should be possible to integrate with them on the server. Or later for the system applications to be modified to deal with the queue. For dual-mode applications, they would need to detect the degraded internet and switch to degraded mode.

I was thinking about starting with a simple messenger that could send messages over ham radio, Bluetooth, Wifi Direct, or local network. It probably makes sense to have internet messaging, but use the same message queue. I think this would be especially useful for ham radio which could use a modern message application.

I wish I organized this idea in the past, since I have had it for a while. The Internet, with mobile phones and satellites, has improved its speed and reliability. It used to be that had to deal with being disconnected while away from computer, or while hiking, or in a plane. Even though Starlink might make it less important now, I think idea will be important for interplanetary networks.

IPv6: Devices

After enabling IPv6 on my router, I tried using it on all of my devices. For testing, I used []( and [test-ipv6](

* Mac OS X just worked. It got IPv6 address through stateless autoconfiguration from the router.

* [Fedora Linux]( also just worked.

* Windows 7 supports IPv6. It didn’t work at first but that seemed to be interference from VirtualBox virtual device. Removing VirtualBox fixed the problem.

* Android on Nook Color does not work. Android is supposed to support IPv6, at least on Wifi, but the Nook Color doesn’t seem to.

* webOS on Palm Pre does not support IPv6.

* Xbox 360 does not support IPv6.

* Tivo does not support IPv6. The new Tivo Premiere uses 2.6 kernel and should be easy to upgrade in the future.

IPv6: Linksys, DD-WRT, Comcast 6to4

I got IPv6 working with my home router, DD-WRT, and Comcast’s 6to4 service.
[6to4]( works by setting up a tunnel for IPv6 over IPv4. It uses the anycast address as the tunnel endpoint. The IPv6 address is constructed from the host’s IPv4 address with 2002: prefix. 6to4 only works for hosts with public IP address which is why it has to be run on the router. [Comcast has 6to4 proxies]( [Comcast was testing 6RD]( which is similar but the prefix and proxy address are configured.

First, I had to flash [DD-WRT to my WRT400N]( Second, I had to [enable IPv6]( The [6to4 config for 2.6 kernels]( requires a radvd config and startup script to be entered. Also, the scripts had to be changed for the WRT400N since they don’t have vlan2 device but eth1 worked.

radvd config:

interface br0 {
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvLinkMTU 1480;
AdvSendAdvert on;
prefix 0:0:0:1::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvValidLifetime 86400;
AdvPreferredLifetime 86400;
Base6to4Interface eth1;

Startup script:

insmod /lib/modules/`uname -r`/kernel/net/ipv6/sit.ko
sleep 5
radvd -C /tmp/radvd.conf start
sleep 5
WANIP=$(ip -4 addr show dev eth1 | grep ‘inet ‘ | awk ‘{print $2}’ | cut -d/ -f1)
if [ -n “$WANIP” ]
V6PREFIX=$(printf ‘2002:%02x%02x:%02x%02x’ $(echo $WANIP | tr . ‘ ‘))
ip tunnel add tun6to4 mode sit ttl 255 remote any local $WANIP
ip link set tun6to4 mtu 1480
ip link set tun6to4 up
ip addr add $V6PREFIX:0::1/16 dev tun6to4
ip addr add $V6PREFIX:1::1/64 dev br0
ip -6 route add 2000::/3 via :: dev tun6to4
kill -HUP $(cat /var/run/
sleep 10
radvd -C /tmp/radvd.conf start

Palm Pre

I got a Palm Pre yesterday and really like it so far. Compared to my Treo, it is small and lovely. It looks like a black stone with smooth rounded shape that fits naturally in the hand. The webOS UI is much prettier than PalmOS. The touch interface is well done. Running multiple apps and switching between them with gestures is brilliant. The slider works well and the keyboard is cramped but usable.

One reason I got the Pre was the Classic app which runs PalmOS apps in an emulator. I can use my old apps until webOS equivalents are released. I can even browse the old PIM state from my Treo. Unfortunately, the app catalog is quite limited since the webOS SDK has not been released. It sounds like there is enough interest that once it is released that plenty of developers will release apps.

There are a few hardware annoyances. The microUSB port on the side is covered by an annoying, useless, fragile door. The top already rotates slightly side-to-side. The button on the front really should be a trackball.

MacBook Pro and SATA

On Saturday, I got one of the new 13″ MacBook Pro. I switched the 320 GB hard drive from my old MacBook with the 120 GB drive it came with. It took a trip to Fry’s and some frustration since the guts are not as accessible on the old MacBook. Everything worked great once it was finished and OS X reinstalled with new drivers.

Then yesterday, Apple released a [firmware update]( that added SATA 3 Gbps support from the crippled SATA 1.5 Gbps it shipped with. After updating, my new Mac has been randomly freezing when reading from the hard drive. My guess is the problem is an incompatibility with the SATA 3 Gbps between the drive and controller. Some stories mentioned that the SATA 3 Gbps support was originally disabled because of intermittent data errors.

I [posted in the Apple forums]( and it sounds like quite a few people who have upgraded the hard drive are having this problem. Unfortunately, there is no way to revert the firmware update. It might be possible to use the [WD Data Lifeguard]( tools to disable SATA 3 Gbps support on the drive. Unfortunately, the tools only work on Windows or DOS CD or floppy. The other option is to switch back to the original drive.

Robotic Vacuum

I got a Roomba robotic vacuum recently. Somebody at work mentioned it and I realized that it would be the perfect solution for my tendency to not vacuum my apartment. Costco has a good deal on their Roomba 550 model which has 2 virtual walls, base station, and latest 5-series vacuum.

After two weeks of using it, I really like it. It does require picking up clutter and staging the room. It will eat cables or small items if they aren’t removed. There are a couple of spots like under the futon where it gets stuck. It gets confused by my complicated living room so I divide it half and do each part separately. I have been doing a schedule of one room per day. It doesn’t get everywhere and everything each time but it does a good job of keeping things clean.

Destroyer of Motherboards

A week ago, I got two more hard drives for my home server. The plan is to make a RAID 5 array with 1.5 TB of total space. The problem is that the [Jetway J7F4]( board I have only has two SATA ports. Luckily, I had a 2-port SATA PCI card and got the PCI riser card for my case. Putting a PCI card in the [Chenbro case]( requires taking off the bracket and delicate routing of the cables around the card. Unfortunately, when I put the card in, the system wouldn’t turn on. Then, when I removed the card, the system also wouldn’t turn on. I assumed that I had touched the motherboard and damaged it.

I bought a new motherboard, the [Intel D945GCLF2]( board. It has the dual-core Atom 330 processor and Gigabit Ethernet but is still as cheap as original Little Falls Atom board. I got it installed in the case and it booted. The Realtek RTL8111/8168B Ethernet chip wouldn’t work with Linux. I had to get the new [r8168 driver]( It is still flaky and will only do 100Mb/s.

When I put in the SATA card, it wouldn’t start. Then I noticed that the PCI card was backwards. The card was keyed for both 5V and 3.3V slots and would fit backwards in the 5V slot. Which is easy to do when the bracket is removed from the card. I am pretty sure that this destroyed the old motherboard and probably the card since it did not work when put in the right way. I am going to have to get a new SATA card.

Converting to RAID 1

I was at Fry’s recently and saw a good deal on a 500 GB hard drive. I decided to get it to expand my [home server]( from a single 500 GB drive to two drives in RAID 1. With Linux, it is possible to do the conversion without any downtime (but lots of time spent copying files). The secret is to create the RAID 1 volume in a degraded state with the new drive, copy the files to the RAID 1 voume, and then add the old drive to the volume. With LVM2, the extents can be moved with `pvmove`.

1. Partition the new drive

fdisk /dev/sdb

2. Create the RAID 1 volume

mdadm –create /dev/md0 –level=1 –raid-devices=2 missing /dev/sdb1

3. Create the Physical Volume

pvcreate /dev/md0

4. Add PV to Volume Group

vgextend vg0 /dev/md0

5. Move all the extents to new volume (takes a long time)

pvmove /dev/sda1 /dev/md0

6. Remove old disk from volume group

vgreduce vg0 /dev/sda1

6. Add the old disk to RAID volume (takes a long time)

mdadm /dev/md0 –add /dev/sda1