Difference between revisions of "Networking 101"

From diychristmas.org wiki
Jump to navigation Jump to search
(Modernized the Networking 101 article with updated networking terminology, improved organization and readability, while preserving the original educational content and examples by frederic.)
 
Line 1: Line 1:
'''(With thanks to frederic)'''
+
(With thanks to frederic)
  
== '''Overview''' ==
+
= Networking 101 =
  
DirkNirkle asked me write something about networks, kind of a 101 class in a sense. I’ll cover the basics of networking, subnetting and IP addressing, and share my opinion as to why separating your Christmas lighting network from your main network might be a good idea.
+
== Overview ==
  
== '''Analogy''' ==
+
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.
  
Picture all of us standing in Dirk’s living room with drinks in hand talking about Christmas lights or football or politics or our kids. Dirk, being an observant host, noticed Jchuchla’s cup is almost empty so from across the room Dirk cups his hands around his mouth and faces Jchuchla, yells “Hey Jon, want a refill?” Jon turns his head towards Dirk and yells back, “Yeah, that would be great!”
+
== Analogy ==
  
The living room is the “network” (local area network)
+
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!"
All of us in the living room are “nodes”.
 
Dirk cupped his hands and faced Jchuchla, which means he directed his “data” in the direction of a specific node (switched versus hub)
 
Dirk used Jchuchla’s name in his “data packet” was addressed to a specific node (IP address)
 
Jchuchla acknowledged the “data packet” by replying to Dirk.
 
  
 +
* 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 is the premise of networking. Let’s go through it with more detail.
+
That's the basic concept behind networking.
  
Computer networks are categorized by size and region and I’ll keep this simple and only describe the two we use most in our homes: WAN and LAN.
+
Computer networks are generally grouped by size and scope. For most home users, there are only two that matter:
  
A local area network (LAN) is the network within our house, and a wide area network (WAN) is the network our personal network within our house connects to in order to access the rest of the world.
+
* '''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''' ==
+
== Addressing & Subnetting ==
  
Everything on a network must have an address, and we mostly use an addressing scheme called IP4, which means each address is comprised of four numbers, each with a range of 0-255. They’re called octets because they only go from 0-255. Why? 8 bits. If you convert 0 to 8-bit binary it’s 00000000 and if you convert 255 to binary it’s 11111111. This binary conversion is important.
+
Every device on a network requires a unique '''IPv4''' address.
  
IP4 networks are also scalable and that’s what the network mask does. You might notice IP addresses are often shown with a “/” followed by a number. That number is the quantity of bits representing the network in the four-octet IP address. Since there are four octets, 8 bits a piece, the number following the slash cannot be greater than 32. 4 octets x 8 bits = 32 bits total.
+
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.
  
Network: 192.168.1.0/24
+
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.
  
Convert the IP to binary:
+
Example:
Code:
 
::[[File:Nw1.png |350px]]
 
  
The “/24” means the first 24 bits of the octet represents the size of the network, and the remaining 8 bits represent the number of nodes. Now convert that back to decimal:
+
Network: 192.168.1.0/24
  
Network: 192.168.1.x, where the x represents nodes 0-255. I can have 255 nodes on this particular network.
+
Convert the address to binary:
  
Since each octet has 8 bits associated with it, and “/24” is divisible by 8 to get 3, it might be obvious that the first three octets would be the network and the last octet would be associated with the nodes. That worked out in this example, but not all networks are “/24” and can be other ranges which is why the conversion to and from binary is so important to do every time. Here is my pay-to-use wifi network:
+
::[[File:Nw1.png|350px]]
  
192.168.240.240/28
 
  
Convert to binary:
+
The "/24" indicates the first 24 bits define the network while the remaining 8 bits identify individual devices.
Code:
+
 
::[[File:Nw2.png |350px]]
+
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.
  
So, converting back to decimal the network is 192.168.240.240 and the nodes can be .240 through .255 giving us only room for 16 nodes.
+
Example:
  
Now, let’s talk about the number of nodes. On every network, we lose two nodes to the network operation: the first one, and the last one. So my pay-to-use wifi network only has room for 14 nodes. The first one is reserved out of habit, and the last one is required to be reserved because it’s the broadcast address.  
+
192.168.240.240/28
  
The networks get even smaller once we take into consideration the network addresses assigned to the various network components:
+
Convert to binary:
  
192.168.240.240 – reserved
+
::[[File:Nw2.png|350px]]
192.168.240.241 – router/firewall
 
192.168.240.242 – east-facing access point
 
192.168.240.243 – west-facing access point
 
192.168.240.243-254 – addresses available to connected devices that want to pay for wifi access
 
192.168.240.255 – reserved broadcast address
 
  
The result is 11 nodes (.243-.254) are available for wifi devices.
 
  
Here’s a shorthand chart that may be useful to you:
+
Converting back to decimal shows that this subnet contains only sixteen addresses, fourteen of which are usable.
Code:
 
  
::[[File:Nw3.png |350px]]
+
Here is a quick reference chart for common subnet sizes:
  
 +
::[[File:Nw3.png|350px]]
  
A note about static and dhcp-assigned IP addresses. Static means the IP address is hard-coded into the network node and always the same. That means your printer will always be 192.168.1.40 and your computers can find it easily – it’s always in the same spot. The same for Christmas controllers. Hard-coding static addresses makes configuring those controllers in your show computer that much easier. They’re always in the same spot.
+
=== Static vs DHCP Addresses ===
  
Now that we have a basic foundation of networking, let’s look at our home network more specifically:
+
Devices may receive their IP addresses automatically using '''DHCP (Dynamic Host Configuration Protocol)''' or be configured with '''static''' addresses.
Click image for larger version.  
 
  
[[File:Nw4.png |center|600px]]
+
Static addresses are commonly recommended for holiday lighting controllers because they always remain at the same address, making controller configuration much easier.
  
The IP addresses in the diagram are typical and yours might be different.
+
== Typical Home Network ==
  
With a 192.168.1.0/24 network, losing two (.0 and .255) for reserved address, our home network can support up to 253 nodes. There is nothing wrong with assigning one or more of them of them to your Ethernet-based pixel controllers and bridges, and calling that a “Christmas network”. Many of us do it that way. You can see an E1.31 pixel bridge in the above diagram at the bottom.
+
Click image for larger version.
  
The green lines represent your local area network (private) and the red line represents the public connection you have to your ISP.
+
[[File:Nw4.png|center|600px]]
  
== '''Isolation of Christmas Network ''' ==
+
The addresses shown are examples. Your network may use different values.
  
There are two potential problems with doing the above as described however: the potential of bandwidth limitations (data clogs) and security.
+
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."
  
'''Bandwidth'''
+
The green lines represent the private local network while the red line represents the Internet connection.
  
Think of bandwidth as a road or highway. In the middle of the night when there’s no traffic, one can drive very fast without any interruptions. During rush-hour, that highway is a lot like a parking lot. Networks are the same way. The bandwidth (highway) is only so big, and if you plug in too many nodes (cars) the network gets congested (parking lot).
+
== Why Isolate Your Christmas Network? ==
  
'''Security'''
+
Separating your lighting network from your primary home network provides two important advantages:
  
Yeah, we all have a firewall/router appliance connecting our private network to our ISP to get internet which helps protect our privacy. Windows also has a firewall built-in that provides another layer of protection. One people often don’t think about is physical security.
+
=== Bandwidth ===
  
In order to connect to our local area network, we have to plug in and that is severely hampered by the structure of our home. We lock our doors and windows, we have walls, etc. We thwart physical security by running a cat5 out the window to our pixel controller. It might not seem like a big deal but remember back when you installed Windows and it asked you, “Enable File Sharing and Network Discovery?” and you enthusiastically clicked “Yes!” ? Well, anyone plugging into your network that’s on your front lawn can do the same and they will see all of your computers and potentially, all the data that’s on them.
+
Think of network bandwidth as a highway. When traffic is light, everyone moves quickly. As more traffic is added, congestion increases.
  
How likely is that to be a problem? Well, back in 2013 I came home from work and found one of my neighbors sitting on my stoop with his laptop, a cup of coffee, and his cell phone. He was making cold-calls trying to set up appointments for the next day. Why was he doing that on my stoop? A truck got caught on his cable TV wire and ripped it off his house, killing his internet and phone service. He didn’t want to use my pay-per-use wifi, so he decided all on his own to help himself and unplug my Christmas lights and plug his laptop into the Ethernet jack on the front of my house.
+
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.
  
Are you kidding me? I never imagined that scenario could happen, and thus I paid very little mind to the risk of having my private network on my lawn.
+
=== Security ===
  
For those two reasons, security and available bandwidth, my Christmas network is now separate from my private network. You can do the very same thing by purchasing another router/firewall appliance to make the connection between the two, like in this diagram:
+
A home firewall protects your private network from the Internet, but holiday lighting equipment often requires Ethernet or Wi-Fi access outside your home.
Click image for larger version.  
 
  
[[File:Nw5.png |center|600px]]
+
Keeping your lighting controllers on a separate network reduces the possibility of exposing personal computers, file shares, and other household devices.
  
This diagram looks a lot like the first one, with the addition of a router/firewall appliance forming another network. As before, the red line is the public connection to your ISP, the green is your private network. The blue lines represents your “Christmas network”.
+
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.
  
The key to physical security is to keep the green (private) network inside the house, along with the router/firewall that connects the blue (Christmas) network. The only network that passes through the exterior walls of your home should be the blue network. Your show computer inside would plug into the blue network, probably in one of the LAN jacks typically found on the back.
+
Separating the lighting network prevents situations like this from exposing your private home network.
  
Setting up that router isn’t tricky at all. On the WAN side, you’d assign a network address associated with your existing private network. I used 192.168.1.2 in this example. The default gateway would be the router that’s already there and connected to your ISP and in this example that would be 192.168.1.1.
+
Click image for larger version.
  
On the LAN side of the Christmas router, you would set up another network and in this example I used 192.168.200.0/24, with .1 being assigned to the router itself, .0 and .255 being reserved, the netmask being 255.255.255.0, leaving 252 usable IP addresses for pixel controllers, bridges, the show computer, and whatever else you want to plug in on the lawn.
+
[[File:Nw5.png|center|600px]]
  
Out of the box, most router/firewall appliances give full access to devices on the LAN side to the WAN side but not the reverse. That means at this point, we’ve only isolated the network traffic of our private network and our Christmas network. Now Netflix won’t interfere with pixel data and vice versa.
 
  
But it’s not secure. If you were to plug your laptop into your Christmas network and type “ping 192.168.1.53” you will be able to ping the bottom computer in the right of the diagram. That computer won’t be able to ping any of the pixel controllers because the firewall blocks by default traffic originating on the WAN side which is connected to your private network.
+
The additional router creates a dedicated Christmas network while still allowing Internet access for firmware updates if desired.
  
So, you must edit the default firewall rules of the Christmas router/firewall to change that behavior. Since every device you might buy is different, I can’t really give a step-by-step on how to do that for all of them so instead I’ll share the concept:
+
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.
  
You want to create a firewall rule (or set of rules) that prevents the Christmas network from seeing all the nodes on your private network except for 192.168.1.1 which is the default gateway (the other router) to the public internet. Doing so isolates the networks and protects your private network, but also gives the Christmas network internet access for firmware upgrades.
+
For even greater security, many routers also support MAC address filtering, allowing only approved devices to connect.
  
If you want to take security to the next level, you can use MAC address filtering and only put your Christmas controllers (and show computer’s) MAC addresses in the list. That way, anything randomly plugged into your Christmas network will not have access to anything.
+
== Summary ==
  
Hope that helps you out.
+
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.

Latest revision as of 09:08, 23 July 2026

(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:

Nw1.png


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:

Nw2.png


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:

Nw3.png

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.

Nw4.png

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.

Nw5.png


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.