<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: syntaxbender</title>
    <description>The latest articles on DEV Community by syntaxbender (@syntaxbender).</description>
    <link>https://dev.to/syntaxbender</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4110084%2F129a50cc-8363-4910-8a8d-56add1b83dd1.png</url>
      <title>DEV Community: syntaxbender</title>
      <link>https://dev.to/syntaxbender</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/syntaxbender"/>
    <language>en</language>
    <item>
      <title>Cudy TR1200 Review: An Affordable, Feature-Packed Travel Router</title>
      <dc:creator>syntaxbender</dc:creator>
      <pubDate>Sun, 04 Oct 2026 23:36:53 +0000</pubDate>
      <link>https://dev.to/syntaxbender/cudy-tr1200-review-an-affordable-feature-packed-travel-router-3em5</link>
      <guid>https://dev.to/syntaxbender/cudy-tr1200-review-an-affordable-feature-packed-travel-router-3em5</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;I was looking for a travel router that I could use while working away from home to securely connect to my work network, route devices such as my phone and laptop through a secure network tunnel, reduce my footprint on the local network, and keep my devices isolated from other clients on that network. After considering features such as OpenWrt and VPN support, I decided to go with the Cudy TR1200.&lt;/p&gt;

&lt;p&gt;The Cudy TR1200 stands out with its affordable price while offering all of the operating modes I would expect from a travel router, including Router/AP, WISP/Extender, and Client modes. It also supports features such as Cudy Mesh with multiple Cudy routers, captive portal, native router-level VPN support, DNS over TLS, Samba/SMB file sharing over USB 2.0, the ability to reconfigure the WAN port as a LAN port when needed, and a physical VPN switch. Overall, it covers not only the basic requirements of a travel router but also many features I would normally expect from more advanced models.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fokf2qhc4tmv5zcw4dzx2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fokf2qhc4tmv5zcw4dzx2.png" alt=" " width="800" height="982"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware and Technical Specifications
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Model Version&lt;/td&gt;
&lt;td&gt;TR1200 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hardware&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CPU&lt;/td&gt;
&lt;td&gt;580 MHz Single-Core, MIPS24KEC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Flash / ROM&lt;/td&gt;
&lt;td&gt;16 MB (128 Mbit) NOR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;DDR / RAM&lt;/td&gt;
&lt;td&gt;128 MB (1 Gbit) DDR3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wireless&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;5 GHz Wi-Fi Speed&lt;/td&gt;
&lt;td&gt;867 Mbps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2.4 GHz Wi-Fi Speed&lt;/td&gt;
&lt;td&gt;300 Mbps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Interfaces&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ethernet Ports&lt;/td&gt;
&lt;td&gt;2× 10/100 Mbps RJ45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Ethernet Layout&lt;/td&gt;
&lt;td&gt;1× WAN, 1× LAN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;USB&lt;/td&gt;
&lt;td&gt;1× USB-A 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;LED&lt;/td&gt;
&lt;td&gt;System&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Physical Controls&lt;/td&gt;
&lt;td&gt;Reset Button, Configurable DIP Switch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VPN Throughput&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WireGuard Client&lt;/td&gt;
&lt;td&gt;49 Mbps Upload / 43 Mbps Download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;WireGuard Server&lt;/td&gt;
&lt;td&gt;43.6 Mbps Upload / 48 Mbps Download&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Power&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Power Input&lt;/td&gt;
&lt;td&gt;USB-C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Power Options&lt;/td&gt;
&lt;td&gt;USB-C, PD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Input Rating&lt;/td&gt;
&lt;td&gt;5V ⎓ 2A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Maximum Power Consumption&lt;/td&gt;
&lt;td&gt;8 W&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Idle Power Consumption&lt;/td&gt;
&lt;td&gt;3 W&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Design and Physical Layout
&lt;/h2&gt;

&lt;p&gt;One of the main reasons I chose the TR1200 was that I wanted a small and lightweight NAT/VPN router that I could simply throw into my bag alongside my Mac and forget that it was there. At approximately 100 grams and 4.65 × 3.15 × 1.08 inches, the TR1200 strikes a good balance between portability and functionality.&lt;/p&gt;

&lt;p&gt;There are two foldable external antennas, one on each side of the device. On the rear, there is one USB-A 2.0 port, one 10/100 Mbps LAN port, one 10/100 Mbps WAN port, and a USB-C power input. Storage devices connected to the USB port can be shared over the network using Samba/SMB. In supported operating modes, the WAN port can also be reconfigured and used as an additional LAN port.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7yrjc0mtpfdfe20nkw0y.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7yrjc0mtpfdfe20nkw0y.jpeg" alt=" " width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp1j557qya5ll6ma2q76u.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp1j557qya5ll6ma2q76u.jpeg" alt=" " width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cudy rates the maximum power consumption at 8 W under load, including the USB port, while idle consumption is listed at approximately 3 W. The router can be powered using 5V/2A or USB Power Delivery. Since it uses USB-C for power, I can run it from a compatible laptop or phone charger, or even a power bank, without carrying a dedicated power adapter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frjuwdzo4awtlbqi4yuk2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frjuwdzo4awtlbqi4yuk2.jpeg" alt=" " width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The device also includes a reset button and a configurable physical switch. Using the stock firmware, I can configure this switch to enable or disable the VPN. Since integrated VPN functionality has effectively become a standard feature in travel routers, being able to control it with a physical switch is a nice addition at this price point.&lt;/p&gt;

&lt;p&gt;On the front of the router, a single System LED indicates different operating states. Instead of using several separate activity LEDs, Cudy uses a single indicator for the overall router status, which I also find to be a nice design choice.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System LED&lt;/th&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔴 Red&lt;/td&gt;
&lt;td&gt;Blinking&lt;/td&gt;
&lt;td&gt;System is booting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔴 Red&lt;/td&gt;
&lt;td&gt;Solid&lt;/td&gt;
&lt;td&gt;System is running but there is no internet connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚪ White&lt;/td&gt;
&lt;td&gt;Blinking&lt;/td&gt;
&lt;td&gt;Internet/upstream connection is being established&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚪ White&lt;/td&gt;
&lt;td&gt;Solid&lt;/td&gt;
&lt;td&gt;Internet connection established&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Off&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Device is powered off&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Management and Initial Setup
&lt;/h2&gt;

&lt;p&gt;The router can be managed either through the cloud-based Cudy App or through the web interface available on the router's local network. I did not want to install another Android application just to configure the router, so I continued with the web interface.&lt;/p&gt;

&lt;p&gt;For the initial setup, I connected an Ethernet cable from my upstream internet router to the WAN port on the TR1200. I then connected the TR1200's LAN port to my laptop using another Ethernet cable.&lt;/p&gt;

&lt;p&gt;By default, the TR1200 uses the &lt;code&gt;192.168.10.0/24&lt;/code&gt; subnet with &lt;code&gt;192.168.10.1&lt;/code&gt; as its gateway address. The web interface is also available at &lt;code&gt;192.168.10.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After connecting the cables and opening this address in my browser, I was first prompted to create an administrator password. Once that was done, the router redirected me to the Quick Setup wizard. There are five different setup options available. Since I wanted to create a separate LAN behind NAT, I continued with Wireless Router mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxz6cc0r96z19heg2097b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxz6cc0r96z19heg2097b.png" alt=" " width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following screens allowed me to configure the timezone and WAN settings. The WAN configuration page provides options such as PPPoE, Static, and Dynamic (DHCP). Since DHCP was already enabled on my upstream router and it could automatically assign an IP address to the TR1200 over Ethernet, I selected Dynamic (DHCP).&lt;/p&gt;

&lt;p&gt;When configuring the WAN side, it is important to make sure that the upstream and downstream router subnets use different IP ranges. Overlapping WAN and LAN subnets can introduce routing ambiguity and cause connectivity problems.&lt;/p&gt;

&lt;p&gt;After completing the WAN configuration, I moved on to the wireless settings. Here, I configured separate SSIDs, passwords, and wireless encryption settings for the 2.4 GHz and 5 GHz bands.&lt;/p&gt;

&lt;p&gt;Once the setup was complete, the router rebooted. The System LED turned solid white, and I also confirmed through the web interface that the upstream connection had been successfully established.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgd924c61bfzq7et83ph6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgd924c61bfzq7et83ph6.png" alt=" " width="800" height="657"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Tests and Limitations
&lt;/h2&gt;

&lt;p&gt;There were two major limitations I was already aware of when purchasing the TR1200.&lt;/p&gt;

&lt;p&gt;First, both the WAN and LAN ports are rated at 100 Mbps in the official product documentation, and real-world throughput remains somewhat below that value. I also observed occasional fluctuations in wired performance.&lt;/p&gt;

&lt;p&gt;The second limitation is WireGuard performance. According to Cudy's published figures, WireGuard throughput falls into roughly the 43–49 Mbps range.&lt;/p&gt;

&lt;p&gt;Despite these limitations, considering the router's price and intended use case, I still find the performance sufficient for everyday use and think the TR1200 fits well into the price-to-performance segment.&lt;/p&gt;

&lt;p&gt;I spent a weekend exploring the limits of the device and ran four different test scenarios across two router modes. For the tests, I used two separate PCs and an older OpenWrt router with Gigabit Ethernet and 2.4 GHz Wi-Fi as the upstream WAN network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test Methodology
&lt;/h3&gt;

&lt;p&gt;For each test case, I ran two different iperf3 tests between a server and a client.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I generated a 50 Mbit/s UDP load between the server and client for 60 seconds and monitored packet loss and jitter.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;iperf3 -c xxx.xxx.xxx.xxx -u -b 50M -t 60 -i 2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;I opened four parallel TCP streams between the server and client and generated traffic for 60 seconds. I used the individual throughput values of the four streams together with their aggregate throughput to observe the total TCP throughput achievable across the tested path.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;iperf3 -c xxx.xxx.xxx.xxx -P 4 -t 60 -i 2&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Test Environment
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Upstream OpenWrt WAN Router
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Wi-Fi 4 (802.11n), 2x2:2 MIMO, 40 MHz, 64-QAM, 300 Mbps PHY&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;10/100/1000 Mbps Gigabit Ethernet&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;upstream WAN network internal LAN Gigabit tests - link&lt;/p&gt;

&lt;h4&gt;
  
  
  PC1
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Wi-Fi 6 (802.11ax), 2x2:2 MIMO, MU-MIMO, OFDMA, HE80, 1024-QAM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;10/100/1000 Mbps Gigabit Ethernet&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  PC2
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Wi-Fi 6 (802.11ax), 2x2:2 MIMO, MU-MIMO, OFDMA, HE160, 1024-QAM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;10/100/1000 Mbps Gigabit Ethernet&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test Results
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Case 1 — Wireless Router Mode: Ethernet LAN Client → Ethernet WAN Server
&lt;/h4&gt;

&lt;p&gt;For the first test, I connected the TR1200 to the upstream WAN network through its WAN Ethernet port. I connected PC1 to the TR1200's LAN port and PC2 to an Ethernet LAN port on the upstream network. I then started the iperf3 server on PC2.&lt;/p&gt;

&lt;p&gt;This setup allowed me to test the Ethernet throughput and stability of the LAN-to-WAN path through the Cudy TR1200.&lt;/p&gt;

&lt;p&gt;The LAN-to-WAN Ethernet tests made the practical bandwidth limits of the connection fairly clear. While pushing throughput toward the 90 Mbit/s range, I also observed intermittent packet loss during the UDP test.&lt;/p&gt;

&lt;p&gt;Out of all four scenarios, this produced by far the worst results. I originally expected the wireless connection to exhibit more packet loss or throughput fluctuations, but instead I encountered significantly higher packet loss and much more noticeable throughput variation in this wired scenario.&lt;/p&gt;

&lt;p&gt;To rule out problems with the lab environment, I repeated the test using several combinations of routers, PCs, and Ethernet cables, but none of these changes had a meaningful impact on the results.&lt;/p&gt;

&lt;p&gt;Once I install OpenWrt on the TR1200, I plan to repeat this scenario. If I continue to see the same behavior, I will cover the possible causes and, if possible, solutions in a separate blog post.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TCP Throughput Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Retr

[  5]   0.00-60.00  sec   147 MBytes  20.5 Mbits/sec  206             sender
[  5]   0.00-60.02  sec   147 MBytes  20.5 Mbits/sec                  receiver
[  7]   0.00-60.00  sec   150 MBytes  21.0 Mbits/sec  179             sender
[  7]   0.00-60.02  sec   150 MBytes  21.0 Mbits/sec                  receiver
[  9]   0.00-60.00  sec   150 MBytes  21.0 Mbits/sec  190             sender
[  9]   0.00-60.02  sec   150 MBytes  21.0 Mbits/sec                  receiver
[ 11]   0.00-60.00  sec   153 MBytes  21.4 Mbits/sec  212             sender
[ 11]   0.00-60.02  sec   153 MBytes  21.3 Mbits/sec                  receiver
[SUM]   0.00-60.00  sec   601 MBytes  84.0 Mbits/sec  787             sender
[SUM]   0.00-60.02  sec   599 MBytes  83.8 Mbits/sec                  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Packet Loss Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams

[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.000 ms  0/278186 (0%)  sender
[  5]   0.00-60.00  sec   356 MBytes  49.7 Mbits/sec  0.257 ms  1443/278186 (0.52%)  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Detailed test results - link&lt;/p&gt;

&lt;h4&gt;
  
  
  Case 2 — Wireless Router Mode: Wireless LAN Client → Ethernet WAN Server
&lt;/h4&gt;

&lt;p&gt;For this test, I changed the previous setup by connecting to the TR1200's LAN over Wi-Fi instead of Ethernet and then repeated the same tests.&lt;/p&gt;

&lt;p&gt;Compared with the previous scenario, UDP packet loss on the wireless LAN connection dropped significantly, although I also observed a reduction in throughput.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TCP Throughput Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Retr

[  5]   0.00-60.00  sec   121 MBytes  16.9 Mbits/sec   63             sender
[  5]   0.00-60.01  sec   120 MBytes  16.8 Mbits/sec                  receiver
[  7]   0.00-60.00  sec   121 MBytes  17.0 Mbits/sec   63             sender
[  7]   0.00-60.01  sec   121 MBytes  16.9 Mbits/sec                  receiver
[  9]   0.00-60.00  sec   121 MBytes  16.9 Mbits/sec   65             sender
[  9]   0.00-60.01  sec   121 MBytes  16.9 Mbits/sec                  receiver
[ 11]   0.00-60.00  sec   123 MBytes  17.2 Mbits/sec   64             sender
[ 11]   0.00-60.01  sec   123 MBytes  17.1 Mbits/sec                  receiver
[SUM]   0.00-60.00  sec   486 MBytes  67.9 Mbits/sec  255             sender
[SUM]   0.00-60.01  sec   485 MBytes  67.8 Mbits/sec                  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Packet Loss Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams

[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.000 ms  0/278186 (0%)  sender
[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.168 ms  27/278186 (0.0097%)  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Case 3 — WISP Mode: Ethernet LAN Server ↔ Ethernet LAN Client
&lt;/h4&gt;

&lt;p&gt;For this scenario, I switched the TR1200 to WISP mode and connected it wirelessly to the upstream WAN network instead of using a wired WAN connection.&lt;/p&gt;

&lt;p&gt;Since the physical WAN port was no longer needed for the uplink, I reconfigured it as a LAN port through the TR1200's interface. This allowed me to connect two Ethernet clients directly to the router's two physical Ethernet ports.&lt;/p&gt;

&lt;p&gt;Rather than testing traffic across the WAN, I ran the tests entirely within the local Ethernet LAN to measure the TR1200's internal LAN forwarding capacity.&lt;/p&gt;

&lt;p&gt;The UDP test completed with zero packet loss, while the TCP test reached an average throughput of approximately 94 Mbit/s. These results are very close to the values expected from the Ethernet interfaces and represent an ideal result for this setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Packet Loss Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams

[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.000 ms  0/258975 (0%)  sender
[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.242 ms  0/258972 (0%)  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;TCP Throughput Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Retr

[  5]   0.00-60.00  sec   169 MBytes  23.6 Mbits/sec    0             sender
[  5]   0.00-60.01  sec   168 MBytes  23.5 Mbits/sec                  receiver
[  7]   0.00-60.00  sec   169 MBytes  23.6 Mbits/sec    4             sender
[  7]   0.00-60.01  sec   168 MBytes  23.5 Mbits/sec                  receiver
[  9]   0.00-60.00  sec   169 MBytes  23.6 Mbits/sec    3             sender
[  9]   0.00-60.01  sec   168 MBytes  23.5 Mbits/sec                  receiver
[ 11]   0.00-60.00  sec   168 MBytes  23.5 Mbits/sec    1             sender
[ 11]   0.00-60.01  sec   168 MBytes  23.5 Mbits/sec                  receiver
[SUM]   0.00-60.00  sec   674 MBytes  94.3 Mbits/sec    8             sender
[SUM]   0.00-60.01  sec   673 MBytes  94.1 Mbits/sec                  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Case 4 — WISP Mode: Wireless LAN Server ↔ Wireless LAN Client
&lt;/h4&gt;

&lt;p&gt;Finally, I tested the bandwidth limits of the wireless LAN while the TR1200 was operating in WISP mode.&lt;/p&gt;

&lt;p&gt;During the 50 Mbit/s UDP test, I observed no packet loss. In the 5 GHz wireless LAN TCP test, throughput reached approximately 151 Mbit/s. This scenario produced the best overall results of the four tests.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Packet Loss Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams

[  5]   0.00-60.00  sec   358 MBytes  50.0 Mbits/sec  0.000 ms  0/258975 (0%)  sender
[  5]   0.00-60.05  sec   358 MBytes  50.0 Mbits/sec  0.258 ms  0/258975 (0%)  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;TCP Throughput Test:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ID] Interval           Transfer     Bitrate         Retr

[  5]   0.00-60.00  sec   256 MBytes  35.8 Mbits/sec   49             sender
[  5]   0.00-60.05  sec   254 MBytes  35.4 Mbits/sec                  receiver
[  7]   0.00-60.00  sec   275 MBytes  38.5 Mbits/sec   51             sender
[  7]   0.00-60.05  sec   273 MBytes  38.2 Mbits/sec                  receiver
[  9]   0.00-60.00  sec   278 MBytes  38.8 Mbits/sec   94             sender
[  9]   0.00-60.05  sec   274 MBytes  38.3 Mbits/sec                  receiver
[ 11]   0.00-60.00  sec   283 MBytes  39.6 Mbits/sec   93             sender
[ 11]   0.00-60.05  sec   280 MBytes  39.2 Mbits/sec                  receiver
[SUM]   0.00-60.00  sec  1.07 GBytes   153 Mbits/sec  287             sender
[SUM]   0.00-60.05  sec  1.06 GBytes   151 Mbits/sec                  receiver

iperf Done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Overall Assessment
&lt;/h3&gt;

&lt;p&gt;On the TR1200, I observed acceptable jitter levels alongside occasional periods of packet loss and throughput fluctuation, with the problems sometimes becoming more noticeable at roughly 30-second intervals.&lt;/p&gt;

&lt;p&gt;I suspect this behavior may be related to the stability of the stock firmware and the router's single-core processor. During testing, I tried different PCs and Ethernet cables in an attempt to isolate the source of the packet loss, but these changes had no meaningful effect on the results.&lt;/p&gt;

&lt;p&gt;For workloads such as online meetings or long-lived socket-based connections, I would expect these intermittent issues to occasionally result in noticeable interruptions.&lt;/p&gt;

&lt;p&gt;That said, considering the price of the device and the fact that it is designed as a compact travel router, I still believe these limitations remain within an acceptable range.&lt;/p&gt;

&lt;p&gt;I also plan to install OpenWrt on the TR1200 soon, and I am interested to see whether these issues improve with a different firmware stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small and lightweight for a travel router&lt;/li&gt;
&lt;li&gt;Built-in VPN support in the stock Cudy firmware&lt;/li&gt;
&lt;li&gt;Ability to distribute a WAN connection over wired or wireless interfaces using NAT or bridge modes&lt;/li&gt;
&lt;li&gt;5 GHz wireless performance is sufficient for everyday office workloads&lt;/li&gt;
&lt;li&gt;Very low power consumption, averaging around 1–2 W in my setup while operating in WISP mode with an upstream WAN connection and Wi-Fi enabled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Periodic packet loss observed on both Ethernet and wireless connections&lt;/li&gt;
&lt;li&gt;In my LAN-to-WAN tests, the wired scenario showed higher packet loss than the wireless scenario&lt;/li&gt;
&lt;li&gt;According to Cudy's published figures, WireGuard client throughput is limited to approximately 43–49 Mbps&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hardware</category>
      <category>networking</category>
      <category>reviews</category>
    </item>
    <item>
      <title>Subnet Calculation and Network Design: From Fundamentals to Practice</title>
      <dc:creator>syntaxbender</dc:creator>
      <pubDate>Thu, 10 Sep 2026 00:03:46 +0000</pubDate>
      <link>https://dev.to/syntaxbender/subnet-calculation-and-network-design-from-fundamentals-to-practice-1l16</link>
      <guid>https://dev.to/syntaxbender/subnet-calculation-and-network-design-from-fundamentals-to-practice-1l16</guid>
      <description>&lt;p&gt;Subnetting can look like little more than IP address math at first glance. In practice, though, the goal is not simply to calculate how many addresses exist inside a CIDR block.&lt;/p&gt;

&lt;p&gt;The real purpose is to divide an available address space into logical network segments based on actual requirements.&lt;/p&gt;

&lt;p&gt;Suppose we start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0/16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we want to separate employees, management devices, printers, and IoT devices into different network segments, subnetting gives us a structured way to do that.&lt;/p&gt;

&lt;p&gt;This article explains why subnetting is used, how IPv4 and CIDR calculations work, and how to design subnets based on real network requirements.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What Is Subnetting Used for in Network Design?
&lt;/h2&gt;

&lt;p&gt;The main purpose of subnetting is to divide devices into logical network segments.&lt;/p&gt;

&lt;p&gt;A company network might contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Employee workstations&lt;/li&gt;
&lt;li&gt;Management devices&lt;/li&gt;
&lt;li&gt;Printers&lt;/li&gt;
&lt;li&gt;IoT devices&lt;/li&gt;
&lt;li&gt;Servers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technically, all of these devices could exist inside one large IP network.&lt;/p&gt;

&lt;p&gt;That does not necessarily mean they should.&lt;/p&gt;

&lt;p&gt;As the network grows, placing everything inside the same network can make routing, security, troubleshooting, and access control harder to manage.&lt;/p&gt;

&lt;p&gt;Subnetting allows us to create a structure such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees     → 192.168.0.0/22
IoT           → 192.168.4.0/23
Management    → 192.168.6.0/25
Printers      → 192.168.6.128/26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A router or firewall can then determine how traffic is allowed to move between these networks.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees  → Printers      ALLOW
Employees  → Management    DENY
IoT        → Management    DENY
Management → All           ALLOW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why subnetting is not only about dividing IP addresses. It also helps create security and routing boundaries inside a network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Subnets and VLANs Are Not the Same Thing
&lt;/h3&gt;

&lt;p&gt;A subnet describes an IP network at Layer 3.&lt;/p&gt;

&lt;p&gt;A VLAN separates devices at Layer 2.&lt;/p&gt;

&lt;p&gt;In real environments, they are often used together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VLAN 10 → Employees  → 192.168.0.0/22
VLAN 20 → IoT        → 192.168.4.0/23
VLAN 30 → Management → 192.168.6.0/25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The VLAN defines the Layer 2 broadcast domain, while the subnet defines the corresponding Layer 3 IP address space.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Makes a Subnet Public or Private?
&lt;/h3&gt;

&lt;p&gt;A subnet does not become public or private simply because it uses &lt;code&gt;/24&lt;/code&gt;, &lt;code&gt;/22&lt;/code&gt;, or any other prefix length.&lt;/p&gt;

&lt;p&gt;In cloud environments, the distinction is usually determined by routing.&lt;/p&gt;

&lt;p&gt;A public subnet might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Public Subnet
      ↓
Internet Gateway
      ↓
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A private subnet may instead use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Private Subnet
      ↓
NAT Gateway
      ↓
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the public/private distinction is primarily a routing design decision, not a CIDR calculation.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. The Foundation of Subnetting: IPv4 and CIDR
&lt;/h2&gt;

&lt;p&gt;Before subnet calculations make sense, it helps to understand how an IPv4 address is structured.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Is IPv4 32 Bits?
&lt;/h3&gt;

&lt;p&gt;An IPv4 address contains four octets.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each octet contains 8 bits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8 + 8 + 8 + 8 = 32 bits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is why an IPv4 address is 32 bits long.&lt;/p&gt;

&lt;p&gt;For example, the decimal value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is represented in binary as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bit positions inside one octet have the following values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;128  64  32  16  8  4  2  1
2⁷   2⁶  2⁵  2⁴  2³ 2² 2¹ 2⁰
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If all bits are set to &lt;code&gt;1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11111111
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;their values add up to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
= 255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why each IPv4 octet can contain a value between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 - 255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What Does CIDR Mean?
&lt;/h3&gt;

&lt;p&gt;In CIDR notation, the number after the slash tells us how many bits belong to the network portion of the address.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;24 bits → network
8 bits  → host
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 24 = 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;host bits remain.&lt;/p&gt;

&lt;p&gt;The subnet mask in binary is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11111111.11111111.11111111.00000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its decimal form is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.255.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How Do We Calculate the Number of IP Addresses?
&lt;/h3&gt;

&lt;p&gt;Once we know the number of host bits, the total number of addresses can be calculated with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^(number of host bits)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a &lt;code&gt;/24&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 24 = 8 host bits

2^8 = 256 addresses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a traditional IPv4 subnet, the first address is reserved as the network address and the last as the broadcast address.&lt;/p&gt;

&lt;p&gt;That leaves:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;256 - 2 = 254
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;usable host addresses.&lt;/p&gt;

&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/24
Total addresses = 256
Usable hosts    = 254
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: /22
&lt;/h3&gt;

&lt;p&gt;For a &lt;code&gt;/22&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 22 = 10 host bits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^10 = 1024
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;total addresses exist.&lt;/p&gt;

&lt;p&gt;In a traditional host subnet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1024 - 2 = 1022
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;usable host addresses remain.&lt;/p&gt;

&lt;p&gt;The binary subnet mask is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11111111.11111111.11111100.00000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The decimal equivalent is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.252.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/22 = 255.255.252.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Designing Subnets Around Real Requirements
&lt;/h2&gt;

&lt;p&gt;Now suppose we have the following address space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0/16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And our network requires:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Required Hosts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Employees&lt;/td&gt;
&lt;td&gt;700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IoT&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Management&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Printers&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Instead of assigning an arbitrary &lt;code&gt;/24&lt;/code&gt; to every group, we can choose the smallest suitable subnet for each requirement.&lt;/p&gt;

&lt;p&gt;This approach is known as &lt;strong&gt;VLSM — Variable Length Subnet Masking&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  700 Employees
&lt;/h3&gt;

&lt;p&gt;We need at least 700 usable addresses.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;/23&lt;/code&gt; provides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 23 = 9

2^9 = 512
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;512 addresses are not enough.&lt;/p&gt;

&lt;p&gt;The next option is &lt;code&gt;/22&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 22 = 10

2^10 = 1024
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditionally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1024 - 2 = 1022 usable addresses
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees → /22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  300 IoT Devices
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;/24&lt;/code&gt; provides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^8 = 256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is not enough.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;/23&lt;/code&gt; provides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^9 = 512
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is sufficient.&lt;/p&gt;

&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IoT → /23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  120 Management Devices
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;/25&lt;/code&gt; gives us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 25 = 7

2^7 = 128
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditionally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;128 - 2 = 126
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;usable host addresses.&lt;/p&gt;

&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Management → /25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  50 Printers
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;/26&lt;/code&gt; gives us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - 26 = 6

2^6 = 64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditionally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;64 - 2 = 62
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;usable addresses.&lt;/p&gt;

&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Printers → /26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, our requirements are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees     /22
IoT           /23
Management    /25
Printers      /26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Placing the Subnets Inside the Parent CIDR Block
&lt;/h2&gt;

&lt;p&gt;Now we can place these networks inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0/16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A common approach is to allocate the largest subnet first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding the Boundary of a /22
&lt;/h3&gt;

&lt;p&gt;The subnet mask for &lt;code&gt;/22&lt;/code&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.252.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The changing octet is the third octet.&lt;/p&gt;

&lt;p&gt;We can calculate the block size with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;256 - subnet mask value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;256 - 252 = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means &lt;code&gt;/22&lt;/code&gt; networks increment by 4 in the third octet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0/22
192.168.4.0/22
192.168.8.0/22
192.168.12.0/22
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the first &lt;code&gt;/22&lt;/code&gt; is assigned to employees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Employees
192.168.0.0/22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the address range is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0
-
192.168.3.255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next available address is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Placing the /23
&lt;/h3&gt;

&lt;p&gt;The subnet mask for &lt;code&gt;/23&lt;/code&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.254.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Block size:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;256 - 254 = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So &lt;code&gt;/23&lt;/code&gt; networks advance by 2 in the third octet.&lt;/p&gt;

&lt;p&gt;We can assign:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0/23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to the IoT network.&lt;/p&gt;

&lt;p&gt;Its range is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0
-
192.168.5.255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next available address becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Placing the /25
&lt;/h3&gt;

&lt;p&gt;For management:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.0/25
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its range is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.0
-
192.168.6.127
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next available address is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.128
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Placing the /26
&lt;/h3&gt;

&lt;p&gt;For printers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.128/26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its range is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.6.128
-
192.168.6.191
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our final design becomes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Subnet&lt;/th&gt;
&lt;th&gt;Total Addresses&lt;/th&gt;
&lt;th&gt;Usable Hosts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Employees&lt;/td&gt;
&lt;td&gt;&lt;code&gt;192.168.0.0/22&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1024&lt;/td&gt;
&lt;td&gt;1022&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IoT&lt;/td&gt;
&lt;td&gt;&lt;code&gt;192.168.4.0/23&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;512&lt;/td&gt;
&lt;td&gt;510&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Management&lt;/td&gt;
&lt;td&gt;&lt;code&gt;192.168.6.0/25&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;128&lt;/td&gt;
&lt;td&gt;126&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Printers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;192.168.6.128/26&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;62&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  5. Determining Which Subnet an IP Belongs To
&lt;/h2&gt;

&lt;p&gt;Suppose we have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.5.100/23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and want to determine its network address.&lt;/p&gt;

&lt;p&gt;The subnet mask for &lt;code&gt;/23&lt;/code&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.254.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In binary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11111111.11111111.11111110.00000000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The third octet of the IP address is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;00000101
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The third octet of the subnet mask is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;254
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11111110
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now perform a &lt;strong&gt;bitwise AND&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;00000101
11111110
--------
00000100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;00000100&lt;/code&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in decimal.&lt;/p&gt;

&lt;p&gt;So the network address is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the subnet is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0/23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Therefore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.5.100/23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;belongs to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.4.0/23
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Calculate Instead of Memorizing
&lt;/h2&gt;

&lt;p&gt;There is no need to memorize every subnet table.&lt;/p&gt;

&lt;p&gt;A few simple relationships are enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Number of Host Bits
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;32 - CIDR prefix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/22

32 - 22 = 10 host bits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Total Number of Addresses
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^(number of host bits)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^10 = 1024
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Traditional Usable Host Count
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2^(number of host bits) - 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1024 - 2 = 1022
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep in mind that the &lt;code&gt;-2&lt;/code&gt; rule does not apply in the same way to special cases such as &lt;code&gt;/31&lt;/code&gt; and &lt;code&gt;/32&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Block Size
&lt;/h3&gt;

&lt;p&gt;To find subnet boundaries, use the changing octet of the subnet mask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;256 - subnet mask value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a &lt;code&gt;/22&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.252.0

256 - 252 = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the subnet boundaries are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
4
8
12
16
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a &lt;code&gt;/23&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.254.0

256 - 254 = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The subnet boundaries are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
2
4
6
8
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this relationship becomes familiar, there is little reason to memorize &lt;code&gt;/22&lt;/code&gt;, &lt;code&gt;/23&lt;/code&gt;, or &lt;code&gt;/24&lt;/code&gt; subnet tables.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. The Bigger Picture
&lt;/h2&gt;

&lt;p&gt;Subnetting becomes unnecessarily abstract when it is taught only as binary arithmetic.&lt;/p&gt;

&lt;p&gt;In practice, the reasoning process is much simpler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;How many devices do I have?
        ↓
How many IP addresses do I need?
        ↓
How many host bits are required?
        ↓
Which CIDR prefix provides enough addresses?
        ↓
Where are the subnet boundaries?
        ↓
Where should this subnet be placed inside the parent CIDR?
        ↓
Which networks should be allowed to communicate?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;700 hosts
↓
At least 700 addresses are required
↓
2^9 = 512  → not enough
2^10 = 1024 → enough
↓
10 host bits
↓
32 - 10 = /22
↓
255.255.252.0
↓
block size = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.0.0/22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The real goal of subnetting is not to memorize values such as &lt;code&gt;/22&lt;/code&gt; or &lt;code&gt;/24&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is to understand how to move from a real network requirement to the correct CIDR prefix, identify the correct network boundaries, and allocate address space without overlaps or unnecessary waste.&lt;/p&gt;

&lt;p&gt;Once that logic becomes familiar, topics such as VPC design, Kubernetes networking, VLAN architecture, firewall rules, and cloud network design become much easier to reason about.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>infrastructure</category>
      <category>networking</category>
    </item>
    <item>
      <title>How Does a Home Network Actually Work? From LAN/WAN to WISP, VLAN, and VPN</title>
      <dc:creator>syntaxbender</dc:creator>
      <pubDate>Fri, 04 Sep 2026 22:35:50 +0000</pubDate>
      <link>https://dev.to/syntaxbender/how-does-a-home-network-actually-work-from-lanwan-to-wisp-vlan-and-vpn-3l9n</link>
      <guid>https://dev.to/syntaxbender/how-does-a-home-network-actually-work-from-lanwan-to-wisp-vlan-and-vpn-3l9n</guid>
      <description>&lt;h1&gt;
  
  
  How Does a Home Network Actually Work? From LAN/WAN to WISP, VLAN, and VPN
&lt;/h1&gt;

&lt;p&gt;A home network can be pictured in its simplest form like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                         Internet
                            │
                         ISP Network
                            │
                       Home Router
                            │
              ┌─────────────┼─────────────┐
              │             │             │
           Laptop         Phone          NAS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The home router connects two different worlds: the external network reached through the ISP, and the local network where devices such as laptops, phones, TVs, and NAS systems live.&lt;/p&gt;

&lt;p&gt;Behind this seemingly simple topology, concepts such as LAN, WAN, subnets, DHCP, routing, NAT, firewalls, bridging, and VLANs all work together.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Home Network, the ISP, and the Internet Side
&lt;/h2&gt;

&lt;h3&gt;
  
  
  LAN and WAN
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;LAN — Local Area Network&lt;/strong&gt; refers to the local side of a router. Devices such as laptops, phones, smart TVs, printers, and NAS systems usually live on this side.&lt;/p&gt;

&lt;p&gt;Suppose the router's LAN address is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.1/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Devices on the network might have addresses such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop   192.168.1.20
Phone    192.168.1.30
NAS      192.168.1.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All of them belong to the same local IP network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In practical terms, the LAN is the side of the router where the local devices managed by that router reside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WAN — Wide Area Network&lt;/strong&gt;, on the other hand, refers to the side where the router connects to an upstream network outside its own LAN.&lt;/p&gt;

&lt;p&gt;In a typical home network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet / ISP
      │
     WAN
      │
   Router
      │
     LAN
      │
Home Devices
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LAN and WAN do not describe different types of Ethernet cables or fundamentally different physical connections.&lt;/p&gt;

&lt;p&gt;The same ordinary Ethernet connection can serve as a LAN connection in one topology and a WAN connection in another.&lt;/p&gt;

&lt;p&gt;Consider two routers connected together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
   │
Upstream Router
LAN: 192.168.1.1
   │
   │ Ethernet
   ▼
Downstream Router
WAN: 192.168.1.50
LAN: 192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;192.168.1.0/24&lt;/code&gt; network is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;strong&gt;LAN&lt;/strong&gt; of the upstream router,&lt;/li&gt;
&lt;li&gt;but the &lt;strong&gt;WAN-side network&lt;/strong&gt; of the downstream router.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So LAN and WAN are relative concepts. Their meaning depends on the router from whose perspective the topology is being viewed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Upstream and Downstream
&lt;/h3&gt;

&lt;p&gt;In networking, the direction toward the Internet or a higher-level network is generally called &lt;strong&gt;upstream&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The direction toward end-user devices is generally called &lt;strong&gt;downstream&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
   │
Upstream Router
   │
Downstream Router
   │
Laptop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router closer to the Internet is upstream relative to the router behind it.&lt;/p&gt;

&lt;p&gt;This terminology becomes particularly useful when several routers are connected in sequence.&lt;/p&gt;




&lt;h3&gt;
  
  
  What Does the ISP Do?
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;ISP — Internet Service Provider&lt;/strong&gt; connects the home network to the wider Internet.&lt;/p&gt;

&lt;p&gt;At a very high level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Home Devices
     │
Home Router
     │
ISP Network
     │
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ISP provides connectivity between the subscriber's network and its own infrastructure, and from there to other networks on the Internet.&lt;/p&gt;

&lt;p&gt;Depending on the connection type and ISP architecture, the router or modem/router receives an IP configuration on its ISP-facing side.&lt;/p&gt;

&lt;p&gt;If the router receives an address such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;203.x.x.x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and that address is globally routable, it can be a &lt;strong&gt;public IP address&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The topology may then look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
   │
Public IP
   │
Home Router
   │
Private LAN
192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But a WAN address is not necessarily a public address.&lt;/p&gt;




&lt;h3&gt;
  
  
  Public IPs, Private IPs, and CGNAT
&lt;/h3&gt;

&lt;p&gt;IPv4 defines several address ranges for private networks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is a private subnet.&lt;/p&gt;

&lt;p&gt;A laptop using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;does not appear on the global Internet as &lt;code&gt;192.168.1.20&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That address only has meaning inside the relevant private network.&lt;/p&gt;

&lt;p&gt;A common home setup looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
192.168.1.20
      │
   Home Router
      │
Public IP
203.x.x.x
      │
   Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router translates traffic from private local addresses to its Internet-facing address.&lt;/p&gt;

&lt;p&gt;However, many ISPs use &lt;strong&gt;CGNAT — Carrier-Grade NAT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In that case, even the home router may not receive its own public IPv4 address.&lt;/p&gt;

&lt;p&gt;A simplified topology might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Home LAN
192.168.1.0/24
      │
Home Router
WAN: 100.64.x.x
      │
ISP CGNAT
      │
ISP Public IP
      │
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Address translation may therefore happen at two different levels:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.20
      │
Home Router NAT
      ▼
100.64.x.x
      │
ISP CGNAT
      ▼
Public IP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The public address is owned or managed by the ISP's CGNAT infrastructure and may be shared by multiple subscribers.&lt;/p&gt;

&lt;p&gt;This leads to an important distinction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A WAN address and a public IP address are not the same thing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;WAN describes the role of an interface: it is the router's upstream-facing side.&lt;/p&gt;

&lt;p&gt;Whether the IP assigned to that interface is public, private, or shared depends on the surrounding network architecture.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. How Is a Local IP Network Defined?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Subnets
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;subnet&lt;/strong&gt; defines the boundary of a Layer 3 IP network.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is a subnet.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;/24&lt;/code&gt; prefix means that the first 24 bits represent the network portion of the IPv4 address.&lt;/p&gt;

&lt;p&gt;Its subnet mask is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;255.255.255.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Network address:   192.168.1.0
Host addresses:    192.168.1.1 - 192.168.1.254
Broadcast address: 192.168.1.255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Devices such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop   192.168.1.20/24
NAS      192.168.1.50/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;belong to the same subnet.&lt;/p&gt;

&lt;p&gt;But:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.20/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;belongs to a different subnet.&lt;/p&gt;

&lt;p&gt;Two hosts on the same subnet can normally communicate without sending the traffic through a router.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop: 192.168.1.20
NAS:    192.168.1.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;are part of the same Layer 3 network.&lt;/p&gt;

&lt;p&gt;But:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop: 192.168.1.20
Server: 192.168.10.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;are on different subnets, so communication between them requires routing.&lt;/p&gt;




&lt;h3&gt;
  
  
  Default Gateway
&lt;/h3&gt;

&lt;p&gt;When a host wants to reach an IP address outside its own subnet, it normally sends the packet to its &lt;strong&gt;default gateway&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Suppose a laptop has:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP:      192.168.10.20
Gateway: 192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it wants to communicate with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the destination is inside the same subnet, so the laptop can reach it directly.&lt;/p&gt;

&lt;p&gt;But if the destination is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the laptop determines that &lt;code&gt;8.8.8.8&lt;/code&gt; is not part of &lt;code&gt;192.168.10.0/24&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It therefore sends the packet to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which is the router interface serving as its default gateway.&lt;/p&gt;

&lt;p&gt;A useful definition is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A default gateway is the next-hop router a host uses when the destination is outside its own subnet.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  DHCP Server and DHCP Client
&lt;/h3&gt;

&lt;p&gt;Devices do not normally need to have all of their network settings entered manually.&lt;/p&gt;

&lt;p&gt;Home networks usually use &lt;strong&gt;DHCP — Dynamic Host Configuration Protocol&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A DHCP server can provide a laptop with information such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP address:      192.168.10.20
Subnet mask:     255.255.255.0
Default gateway: 192.168.10.1
DNS server:      192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router is acting as the &lt;strong&gt;DHCP Server&lt;/strong&gt;, while the laptop is acting as a &lt;strong&gt;DHCP Client&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A router can even act as both a DHCP client and a DHCP server at the same time, on different interfaces.&lt;/p&gt;

&lt;p&gt;Consider this topology:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Router
DHCP Server
      │
      ▼
Downstream Router
WAN = DHCP Client
      │
      ▼
LAN = DHCP Server
      │
      ▼
Laptop = DHCP Client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The upstream router might assign the downstream router:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP:      192.168.1.50
Gateway: 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on its WAN interface.&lt;/p&gt;

&lt;p&gt;The downstream router might then assign the laptop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP:      192.168.10.20
Gateway: 192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on its LAN.&lt;/p&gt;

&lt;p&gt;This creates two independently configured IP networks.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. How Does Traffic Move Between Different Networks?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Routers and Routing
&lt;/h3&gt;

&lt;p&gt;The fundamental job of a &lt;strong&gt;router&lt;/strong&gt; is to forward packets between different Layer 3 networks.&lt;/p&gt;

&lt;p&gt;Suppose a downstream router has these interfaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WAN: 192.168.1.50/24
LAN: 192.168.10.1/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is connected to two different subnets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
       │
Downstream Router
       │
192.168.10.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router examines the destination IP address of a packet and consults its &lt;strong&gt;routing table&lt;/strong&gt; to determine where that packet should go.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
192.168.10.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;wants to send a packet to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the destination is outside the laptop's subnet, the laptop sends the packet to its gateway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The downstream router may have a default route such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0.0.0.0/0 via 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It therefore forwards the packet to the upstream router.&lt;/p&gt;

&lt;p&gt;The path becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
192.168.10.20
     │
     ▼
Downstream Router
     │
     ▼
Upstream Router
     │
     ▼
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That process is &lt;strong&gt;routing&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  NAT and Double NAT
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;NAT — Network Address Translation&lt;/strong&gt; modifies IP addressing information as packets pass through a device.&lt;/p&gt;

&lt;p&gt;Consumer routers commonly use source NAT together with port translation.&lt;/p&gt;

&lt;p&gt;Suppose a laptop creates a connection from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.20:53000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the packet leaves the downstream router's WAN interface, it might become:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.50:61000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.10.20
      │
      │ NAT
      ▼
192.168.1.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Routing and NAT are related, but they solve different problems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Routing → Which path should the packet take?
NAT     → Should the packet's address or port be rewritten?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NAT does not create the distinction between two subnets.&lt;/p&gt;

&lt;p&gt;These:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
192.168.10.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;are already two different Layer 3 networks.&lt;/p&gt;

&lt;p&gt;The router performs routing between them.&lt;/p&gt;

&lt;p&gt;NAT may additionally rewrite addresses as traffic crosses between those networks.&lt;/p&gt;

&lt;p&gt;If both the downstream router and the upstream router perform NAT, the topology contains &lt;strong&gt;double NAT&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
192.168.10.20
      │
      │ NAT #1
      ▼
Downstream Router
192.168.1.50
      │
      │ NAT #2
      ▼
Upstream Router
203.x.x.x
      │
      ▼
Internet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Normal outbound traffic such as web browsing, video streaming, and downloads usually works without issue through double NAT.&lt;/p&gt;

&lt;p&gt;However, inbound connections, port forwarding, peer-to-peer applications, and some gaming scenarios can become more complicated.&lt;/p&gt;




&lt;h3&gt;
  
  
  Firewalls and Port Forwarding
&lt;/h3&gt;

&lt;p&gt;Routing determines where traffic can go, but knowing a route does not automatically mean traffic is allowed to cross it.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;firewall&lt;/strong&gt; determines which traffic may pass between interfaces or networks.&lt;/p&gt;

&lt;p&gt;A simple policy might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LAN → Internet       ALLOW
Internet → LAN       DENY
Guest → NAS          DENY
Personal → NAS       ALLOW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives us another useful distinction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Routing determines the path.&lt;br&gt;
The firewall determines whether traffic is allowed to use that path.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sometimes a service inside the private network needs to accept incoming connections from the WAN side.&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;port forwarding&lt;/strong&gt; is commonly used.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Router WAN
192.168.1.50:443
       │
       │ Port Forward / DNAT
       ▼
NAS
192.168.10.50:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router takes connections addressed to a particular WAN port and forwards them to a specific internal host and port.&lt;/p&gt;

&lt;p&gt;This is commonly implemented using &lt;strong&gt;Destination NAT — DNAT&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Communication Inside the Local Network
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Switches, MAC Addresses, and ARP
&lt;/h3&gt;

&lt;p&gt;Routers operate between Layer 3 networks.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;switch&lt;/strong&gt;, by contrast, connects devices inside the same Layer 2 network.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             Router
               │
             Switch
        ┌──────┼──────┐
        │      │      │
     Laptop   NAS     TV
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A switch forwards Ethernet frames primarily according to &lt;strong&gt;MAC addresses&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;An IP address is a Layer 3 address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A MAC address is a Layer 2 address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aa:bb:cc:dd:ee:ff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In IPv4 networks, &lt;strong&gt;ARP — Address Resolution Protocol&lt;/strong&gt; is used to discover which MAC address corresponds to a local IPv4 address.&lt;/p&gt;

&lt;p&gt;For example, the laptop may effectively ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which device owns &lt;code&gt;192.168.1.50&lt;/code&gt;?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The NAS may respond:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.50
→ aa:bb:cc:dd:ee:ff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The basic relationship is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP     → Layer 3 address
MAC    → Layer 2 address
ARP    → Resolves a local IPv4 address to a MAC address
Switch → Forwards frames using MAC addresses
Router → Routes packets between IP networks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Bridging
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;bridge&lt;/strong&gt; connects multiple Layer 2 interfaces so that they behave as parts of the same Layer 2 network.&lt;/p&gt;

&lt;p&gt;A typical wireless access point provides a good example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ethernet
   │
   ├── Bridge
   │
Wi-Fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A laptop connected through Ethernet might have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;while a phone connected through Wi-Fi might have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both may still belong to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No new routed subnet needs to exist between Ethernet and Wi-Fi.&lt;/p&gt;

&lt;p&gt;A useful distinction is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A router connects different Layer 3 networks.&lt;br&gt;
A bridge extends the same Layer 2 network across multiple interfaces.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  5. Common Router Operating Modes
&lt;/h2&gt;

&lt;p&gt;Once the difference between routing and bridging is clear, common router operating modes become much easier to understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wireless Router Mode vs. Access Point Mode
&lt;/h3&gt;

&lt;p&gt;In &lt;strong&gt;Wireless Router Mode&lt;/strong&gt;, a device typically receives its upstream connection over Ethernet and creates a separate downstream LAN.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Router
LAN: 192.168.1.1
      │
      │ Ethernet
      ▼
Downstream Router
WAN: 192.168.1.50
      │
 Routing / NAT
      │
LAN: 192.168.10.1
      │
Downstream Clients
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two separate Layer 3 networks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream subnet:   192.168.1.0/24
Downstream subnet: 192.168.10.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The downstream device is truly acting as a router.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Access Point Mode&lt;/strong&gt;, the goal is different.&lt;/p&gt;

&lt;p&gt;The device takes an existing Ethernet LAN and makes it available over Wi-Fi without creating another routed subnet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Router
192.168.1.1
      │
   Ethernet
      │
Access Point
      )))
      │
Phone
192.168.1.30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The phone may receive its IP directly from the upstream router's DHCP server and remain part of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The logical structure is approximately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ethernet ↔ Bridge ↔ Wi-Fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  WISP, Wireless Extender, and Client Mode
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;WISP mode&lt;/strong&gt; turns another Wi-Fi network into the router's upstream or WAN connection.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Wi-Fi
192.168.1.0/24
       )))
       ▼
Downstream Router
WAN: 192.168.1.50
       │
 Routing / NAT
       │
LAN: 192.168.10.1
       )))
Downstream Wi-Fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fundamental difference between Wireless Router mode and WISP mode is the medium used for the upstream connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Wireless Router → Upstream/WAN over Ethernet
WISP            → Upstream/WAN over Wi-Fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both can create a separate routed network on the downstream side.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Wireless Extender&lt;/strong&gt; or &lt;strong&gt;Repeater&lt;/strong&gt; focuses on extending the coverage of an existing Wi-Fi network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Access Point
        )))
      Extender
        )))
       Client
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its main goal is generally to make the existing wireless network reachable over a larger area rather than to create a separate routed private network.&lt;/p&gt;

&lt;p&gt;The exact Layer 2 and Layer 3 behavior depends on the implementation used by the vendor.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Client Mode&lt;/strong&gt;, the device itself acts as a Wi-Fi client and can provide connectivity to an Ethernet-only device.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Upstream Wi-Fi
      )))
      ▼
Client Bridge
      │
   Ethernet
      │
      TV
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can give a device with Ethernet but no Wi-Fi interface access to a wireless network.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Splitting One Physical Infrastructure into Multiple Logical Networks
&lt;/h2&gt;

&lt;h3&gt;
  
  
  VLANs and Their Relationship to Subnets
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;VLAN — Virtual LAN&lt;/strong&gt; allows a single physical Ethernet and switching infrastructure to contain multiple logically separate Layer 2 networks.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VLAN 10 → Personal
VLAN 20 → IoT
VLAN 30 → Guest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each VLAN is commonly mapped to a different Layer 3 subnet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VLAN 10 → 192.168.10.0/24
VLAN 20 → 192.168.20.0/24
VLAN 30 → 192.168.30.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The concepts operate at different layers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A VLAN provides Layer 2 segmentation.&lt;br&gt;
A subnet defines a Layer 3 IP network.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This means personal devices and IoT devices can use the same physical switching infrastructure while still being placed into separate logical networks.&lt;/p&gt;




&lt;h3&gt;
  
  
  802.1Q Tagging and Trunks
&lt;/h3&gt;

&lt;p&gt;To carry several VLANs across the same physical Ethernet link, Ethernet frames can be marked with &lt;strong&gt;IEEE 802.1Q VLAN tags&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Router
   │
   │ VLAN 10
   │ VLAN 20
   │ VLAN 30
   │
   ▼
Managed Switch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One physical Ethernet cable can therefore transport traffic belonging to several different logical Layer 2 networks.&lt;/p&gt;

&lt;p&gt;A link carrying multiple VLANs in this way is commonly called a &lt;strong&gt;trunk&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Inter-VLAN Routing
&lt;/h3&gt;

&lt;p&gt;Different VLANs are separated at Layer 2.&lt;/p&gt;

&lt;p&gt;If hosts in different VLANs need to communicate, a router or Layer 3 switch must route traffic between their corresponding subnets.&lt;/p&gt;

&lt;p&gt;Suppose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
VLAN 10
192.168.10.20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TV
VLAN 20
192.168.20.30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;need to communicate.&lt;/p&gt;

&lt;p&gt;The traffic must pass through a Layer 3 device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VLAN 10
   │
 Router
   │
VLAN 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is called &lt;strong&gt;inter-VLAN routing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A firewall can then control which kinds of inter-VLAN communication are allowed.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Personal VLAN → IoT VLAN   ALLOW
Guest VLAN    → Personal   DENY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So VLANs, subnets, routing, and firewalls can be combined to create meaningful security boundaries inside a home or office network.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Network Services and Traffic Types
&lt;/h2&gt;

&lt;h3&gt;
  
  
  DNS
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;DNS — Domain Name System&lt;/strong&gt; translates human-readable names into IP addresses.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com
     │
     │ DNS
     ▼
93.x.x.x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the IP address has been resolved, the routing system determines how packets should reach that address.&lt;/p&gt;

&lt;p&gt;A useful distinction is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DNS answers, “What IP address belongs to this name?”&lt;br&gt;
Routing answers, “Which path should I use to reach that IP address?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Unicast, Broadcast, and Multicast
&lt;/h3&gt;

&lt;p&gt;Network traffic can be delivered in several different ways.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unicast&lt;/strong&gt; traffic is sent from one source to one specific destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop → Web Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Broadcast&lt;/strong&gt; traffic is sent to every host in the same Layer 2 broadcast domain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop → Everyone on the local network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ARP requests are a classic IPv4 example.&lt;/p&gt;

&lt;p&gt;Routers normally do not forward Layer 2 broadcasts into other subnets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multicast&lt;/strong&gt; traffic is sent to a specific group of interested receivers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IPTV Stream
     │
     ├── TV 1
     ├── TV 2
     └── TV 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of sending an entirely separate copy of the stream for each receiver, multicast allows receivers to join a common multicast group.&lt;/p&gt;




&lt;h3&gt;
  
  
  IGMP and IGMP Snooping
&lt;/h3&gt;

&lt;p&gt;In IPv4 networks, &lt;strong&gt;IGMP — Internet Group Management Protocol&lt;/strong&gt; manages host membership in multicast groups.&lt;/p&gt;

&lt;p&gt;An IPTV client might request membership in a group such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;239.1.1.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;IGMP does not carry the video stream itself.&lt;/p&gt;

&lt;p&gt;It communicates information about which hosts want to join or leave multicast groups.&lt;/p&gt;

&lt;p&gt;A switch can use &lt;strong&gt;IGMP Snooping&lt;/strong&gt; to observe these membership messages.&lt;/p&gt;

&lt;p&gt;Instead of flooding multicast traffic to every switch port, it can forward the stream only toward ports where interested receivers exist.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Multicast Stream
       │
     Switch
   ┌────┼────┐
   │    │    │
  TV   NAS  Laptop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If only the TV has joined the multicast group, the switch can avoid sending that stream unnecessarily toward the NAS and laptop.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Features Built on Top of Routing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  VPN
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;VPN — Virtual Private Network&lt;/strong&gt; can create a virtual network interface or tunnel on a router or host.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop
   │
 Router
   │
VPN Tunnel
   │
Remote VPN Gateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router's routing table can determine whether traffic should leave through the ordinary WAN interface or through the VPN tunnel.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Normal Internet Traffic → WAN
Corporate Subnet        → VPN Tunnel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A VPN therefore involves more than encryption alone.&lt;/p&gt;

&lt;p&gt;It is also closely tied to routing because the system must decide which destinations should use the tunnel.&lt;/p&gt;

&lt;p&gt;A router may operate as a &lt;strong&gt;VPN client&lt;/strong&gt;, establishing a tunnel to another VPN endpoint and routing selected LAN traffic through it.&lt;/p&gt;

&lt;p&gt;It may also operate as a &lt;strong&gt;VPN server&lt;/strong&gt;, allowing remote clients to establish tunnels back into the local network.&lt;/p&gt;




&lt;h3&gt;
  
  
  QoS
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;QoS — Quality of Service&lt;/strong&gt; controls how traffic is queued and prioritized when the available network capacity becomes constrained.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Video Call   → High Priority
Web Browsing → Normal Priority
Download     → Low Priority
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;QoS does not change IP addresses or subnet boundaries.&lt;/p&gt;

&lt;p&gt;It affects how packets compete for limited bandwidth and which traffic should receive preferential treatment during congestion.&lt;/p&gt;




&lt;h1&gt;
  
  
  Putting the Entire Topology Together
&lt;/h1&gt;

&lt;p&gt;The concepts can now be combined into one larger example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                              INTERNET
                                  │
                              ISP Network
                                  │
                        Public IP or CGNAT
                                  │
                           UPSTREAM ROUTER
                        LAN: 192.168.1.1/24
                                  │
                         192.168.1.0/24
                                  │
                           DHCP Server
                                  │
                                  ▼
                         DOWNSTREAM ROUTER
                       WAN: 192.168.1.50/24
                       GW:  192.168.1.1
                                  │
                      Routing / NAT / Firewall
                                  │
                       LAN: 192.168.10.1/24
                                  │
                         192.168.10.0/24
                                  │
                           DHCP Server
                                  │
                 ┌────────────────┼────────────────┐
                 │                │                │
              Laptop           Phone             NAS
          192.168.10.20    192.168.10.30    192.168.10.50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The relationships between the core concepts can be summarized like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The ISP connects the home network to the Internet. LAN and WAN describe the downstream and upstream roles of router interfaces. A subnet defines a Layer 3 IP network boundary. DHCP provides hosts with IP configuration such as an address, subnet mask, gateway, and DNS server. A host uses its gateway when the destination is outside its own subnet. Routers perform routing between different subnets. NAT can rewrite addresses as traffic crosses those boundaries. Firewalls control which routed traffic is allowed to pass. Switches and bridges connect devices within Layer 2 networks, while VLANs allow the same physical infrastructure to be divided into multiple logical Layer 2 networks.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once this model is clear, features such as Wireless Router mode, Access Point mode, WISP, VLANs, VPNs, multicast handling, and firewall rules stop looking like unrelated router options. They become different applications of the same underlying network architecture.&lt;/p&gt;

&lt;p&gt;Written by ChatGPT, steered by a human, fueled by caffeine.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>infrastructure</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
