Networking 101
(With thanks to frederic)
Networking 101
Overview
DirkNirkle asked me to write something about networks—kind of a "Networking 101" class. This article covers the basics of computer networking, subnetting, IP addressing, and why separating your holiday lighting network from your primary home network can improve both performance and security.
Analogy
Picture all of us standing in Dirk's living room with drinks in hand, talking about Christmas lights, football, politics, or our kids. Dirk notices that Jon Chuchla's cup is almost empty, cups his hands, and calls across the room, "Hey Jon, want a refill?" Jon hears him and replies, "Yeah, that would be great!"
- The living room is the Local Area Network (LAN).
- Everyone in the room is a network node.
- Dirk directs his voice toward Jon rather than shouting randomly, much like a network switch directs data only to the intended destination.
- Dirk uses Jon's name, just as a data packet uses an IP address.
- Jon replies, acknowledging receipt of the message.
That's the basic concept behind networking.
Computer networks are generally grouped by size and scope. For most home users, there are only two that matter:
- LAN (Local Area Network) – Your home or holiday lighting network.
- WAN (Wide Area Network) – The network that connects your home to the Internet through your Internet Service Provider (ISP).
Addressing & Subnetting
Every device on a network requires a unique IPv4 address.
An IPv4 address consists of four numbers (called octets), each ranging from 0 to 255. The reason each octet ranges from 0-255 is because it contains eight binary bits.
IP networks are scalable through the use of a subnet mask or CIDR notation (such as "/24"). The number following the slash indicates how many bits define the network portion of the address.
Example:
Network: 192.168.1.0/24
Convert the address to binary:
The "/24" indicates the first 24 bits define the network while the remaining 8 bits identify individual devices.
Converted back to decimal:
Network: 192.168.1.x
This allows addresses from .0 through .255, with .0 reserved as the network address and .255 reserved as the broadcast address, leaving 254 possible addresses and 253 usable devices.
Not every network is a "/24". Smaller networks are common.
Example:
192.168.240.240/28
Convert to binary:
Converting back to decimal shows that this subnet contains only sixteen addresses, fourteen of which are usable.
Here is a quick reference chart for common subnet sizes:
Static vs DHCP Addresses
Devices may receive their IP addresses automatically using DHCP (Dynamic Host Configuration Protocol) or be configured with static addresses.
Static addresses are commonly recommended for holiday lighting controllers because they always remain at the same address, making controller configuration much easier.
Typical Home Network
Click image for larger version.
The addresses shown are examples. Your network may use different values.
A typical 192.168.1.0/24 home network supports up to 253 usable devices. Many hobbyists simply assign several of those addresses to lighting controllers and refer to that portion as their "Christmas network."
The green lines represent the private local network while the red line represents the Internet connection.
Why Isolate Your Christmas Network?
Separating your lighting network from your primary home network provides two important advantages:
Bandwidth
Think of network bandwidth as a highway. When traffic is light, everyone moves quickly. As more traffic is added, congestion increases.
Streaming video, online gaming, file transfers, firmware updates, and thousands of lighting packets all compete for the same bandwidth. Using a dedicated lighting network reduces unnecessary traffic and can improve reliability.
Security
A home firewall protects your private network from the Internet, but holiday lighting equipment often requires Ethernet or Wi-Fi access outside your home.
Keeping your lighting controllers on a separate network reduces the possibility of exposing personal computers, file shares, and other household devices.
One experience convinced me of this. A neighbor once unplugged one of my pixel controllers and plugged his laptop into the Ethernet cable on the front of my house after his Internet service failed. I had never considered that someone would simply help themselves to my network.
Separating the lighting network prevents situations like this from exposing your private home network.
Click image for larger version.
The additional router creates a dedicated Christmas network while still allowing Internet access for firmware updates if desired.
Most consumer routers allow traffic from the LAN toward the WAN by default. Additional firewall rules can further restrict access so that the Christmas network cannot communicate with devices on the private home network while still allowing Internet connectivity.
For even greater security, many routers also support MAC address filtering, allowing only approved devices to connect.
Summary
A basic understanding of networking makes configuring lighting controllers much easier. Understanding IP addressing, subnetting, switches, routers, and network isolation will help you build a more reliable, secure, and easier-to-maintain holiday lighting display.