<?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>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>
