Simple Linux IP Repeaters to Extend HomePlug Range
Power line communication (PLC) technology allows you to transmit data by way of the electric grid's low- and medium-voltage power lines. Any device in a building thus may access a LAN to share resources. Figure 1 shows the Ovislink HomePlug Ethernet Bridges we currently are using.
PLC offers obvious advantages, the main one being that it is unnecessary to lay cables as the network infrastructure already is deployed—the electrical grid. Yet, PLC also has strong limitations, such as:
High attenuation, so it is efficient only across short distances.
Impedance changes with power cycles, due to the presence of nonlinear devices such as diodes and transformers.
Occasional impedance changes due to devices switching on and off.
Reflections due to the home electrical grid topology.
Power lines often lacking a ground connection.
To avoid these problems, HomePlug uses a robust orthogonal frequency division multiplexing (OFDM) scheme with 1,280 orthogonal quadrature amplitude modulation (QAM) carriers. Consequently, HomePlug's maximum point-to-point range is approximately 200 meters.
To extend the range further, we have developed a simple Linux IP repeater. We have implemented it on both desktops and an embedded microcontroller-based development card. The latter yields a small, low-consumption, low-cost device that could be installed easily in any building location.
We divide the network into class C subnets (Figure 2), such that any two devices within the same subnet see each other. The devices in a subnet can communicate without a repeater, so we need it only when connecting devices in different subnets. A subset of the devices in any of the two subnets can see a subset of the devices in the other.
Let us assume the repeater initially is installed in parent subnet 192.168.0.X, with address 192.168.0.1 (it could be any address). For any new subnet 192.168.X.X, we reserve IP address 192.168.X.1 for the repeater gateway. When the destination IP address of a packet does not belong to the sender subnet, the repeater routes it. Actually, the repeater does no routing, as the same transmission line supports both packet ingress and egress. Thus, it needs no routing table, and it simply relays packets by using the same medium.
For the repeater to belong to different subnets, it must have several IP addresses. In other words, it is necessary to assign several network interfaces to its Ethernet card. In the example shown in Figure 2, the repeater card has two network interfaces, with respective IP addresses of 192.168.0.1 and 192.168.120.1. In Linux, this is done as follows:
# ifconfig eth0:0 192.168.0.1 # ifconfig eth0:1 192.168.120.1
The number of subnets is unknown beforehand, thus the repeater must autoconfigure itself. In our trials, we set its IP address to 192.168.0.1, as in typical commercial built-in DHCP servers.
We have implemented repeater self-configuration using a program called hprmanager, now available by e-mail from firstname.lastname@example.org. This program sets the Ethernet card to promiscuous mode and looks for new subnets in order to register them.
The repeater discovers the subnets it interconnects by capturing every packet circulating in the network. In permanent state, even though the Ethernet card is in promiscuous mode, it does not receive all packets due to the PLC modem placed between the network card and the power line (Figure 2). This PLC modem blocks all packets except those whose destination address is a broadcast one, a multicast one or the repeater address itself. However, the repeater necessarily receives broadcast and multicast packets from unknown subnets. In any case, it also is possible to set network interfaces manually.
Each computer must select the gateway in its own subnet. Assuming we are configuring a computer in subnet 192.168.0.X, it must set 192.168.0.1 as the default gateway:
# route add default gw 192.168.0.1
To configure the repeater on a desktop Linux machine, it is necessary to do several things:
Activate the packet forwarding module by adding, for example, the following line to /etc/sysctl.conf:
net.ipv4.ip_forward = 1
Assign the default IP address; as previously stated, the repeater has the address 192.168.0.1.
Start the repeater manager. Assuming it resides in /bin/, simply add this line to /etc/rc.d/rc.local:
This procedure works for most Linux distributions. For those without the /etc/sysctl.conf file—such as Debian—it first is necessary to create a shell script file (beginning with #! /bin/sh) called /etc/init.d/local, which includes the line /bin/hprmanager &. Finally, one should add the script to the desired run levels, as in:
update-rc.d local start 80 2 3 4 5
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Google's Abacus Project: It's All about Trust
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Seeing Red and Getting Sleep
- Back to Backups
- Secure Desktops with Qubes: Introduction
- Fancy Tricks for Changing Numeric Base
- Working with Command Arguments
- Secure Desktops with Qubes: Installation
- Linux Mint 18
- CentOS 6.8 Released
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide