«

»

Apr 07

Swarming Raspberry Pi: Of Network Bondage

Apologies to W. Somerset Maugham for the title.

For my Cloud in a Box, I want the Data hosts, at the least to have
“more” network I/O capability, whether it be for a Docker Registry or other data. (As an aside, I am playing with doing substructure matching of chemical compounds and/or other Cheminformatics with the Pi. Compressed, the base data from the NIH is 50GB. News to follow shortly)

One way to do this is via Link Aggregation. This post explores this topic.

My test is rather artificial; I am reading 100Mb from /dev/zero and sending it across the wire.

In the first case, I used ssh for the transport. Afterwards, I used netcat with similar results.

Additionally, there are different modes of balancing and/or HA posible; UbuntuBonding provides a good description of the types of bonding as well as configuration.

In the test, the following types of bonding are tested:

  • No Bonding; this is a baseline for comparison.
  • balance-rr – Balanced Round Robin — this uses all the Nics to send packets round robin.
  • balance_alb
  • balance_tlb

The Hosts used in testing were both plugged into a gigabit switch which was otherwise empty. Only one Pi at a time was plugged into the switch.

The second Nic is a USB 2.0 device 10/100 Mb/s. I didn’t grab a picture, but the Pi with both Nics in use was drawing about 2 watts (or, if you will, less than 500mA). Without the 2nd Nic, both the B+ and 2B were drawing ~1.25 watts. So my compute section of the cloud will be drawing < 20 Watts. Likely < 15.

Setup

My current switch does not support 802.3ad Link Bundling, so I am doing without in this test.

There is a driver which needs to be loaded:

Then add the following line to /etc/modules:

Once you’ve done so, you can lsmod to verify it’s loaded. If it’s not, then do a modprobe bonding. You should not need to do so again; the module should be loaded on the next book.

/etc/network/interfaces

Pi B+

unbonded

balance_alb

balance_rr

balance_tlb

Pi 2B

Unbonded

balanced_rr

balance-alb

balance-tlb

Results and Observations

I believe that /dev/zero is implemented “oddly” or at least differently oon the B+ than the Pi 2. It seems to require more work by the sytem.

I also noticed that there appears to be an issue with cron on the Pi B+. It is eating the CPU approximatly 1/2 the time. This will be investigated in another blog post.

  • I didn’t notice any difference between the bonded and unbounded test on the Pi B+.

  • The bonding is working on the Pi 2; this is evidenced by the time spend transferring the files, approximately 1/2 the time for the un-bonded host.

All in all, it was a useful little experiment to see how well bonding works on the Pi.

Leave a Reply

%d bloggers like this: