Skip to content

Clarify router and switch roles in internet guide#44442

Open
KirtiRamchandani wants to merge 2 commits into
mdn:mainfrom
KirtiRamchandani:docs/clarify-router-switch-roles
Open

Clarify router and switch roles in internet guide#44442
KirtiRamchandani wants to merge 2 commits into
mdn:mainfrom
KirtiRamchandani:docs/clarify-router-switch-roles

Conversation

@KirtiRamchandani

Copy link
Copy Markdown
Contributor

Summary

Clarifies that switches and routers serve different roles when building large networks. Switches forward within local networks using link-layer addresses, while routers connect separate networks using IP addresses.

Testing

  • prettier --check files/en-us/learn_web_development/howto/web_mechanics/how_does_the_internet_work/index.md
  • markdownlint-cli2 files/en-us/learn_web_development/howto/web_mechanics/how_does_the_internet_work/index.md
  • git diff --check

Fixes #44413

Explain that switches forward within local networks while routers
connect separate networks using different addressing layers.
@KirtiRamchandani KirtiRamchandani requested a review from a team as a code owner June 13, 2026 16:45
@KirtiRamchandani KirtiRamchandani requested review from chrisdavidmills and removed request for a team June 13, 2026 16:45
@github-actions github-actions Bot added Content:Learn Learning area docs size/xs [PR only] 0-5 LoC changed labels Jun 13, 2026
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

(comment last updated: 2026-06-15 10:37:52)

@KirtiRamchandani

Copy link
Copy Markdown
Contributor Author

Thanks — preview URLs look good; no rendering issues spotted on my side.

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KirtiRamchandani just one comment on this one; thanks.


In reality, this leads to many engineering problems. The more switches a packet has to go through, the longer it takes to reach its destination. And you can't have just a tree of switches, because then a single switch failure may disconnect a large portion of devices. To solve this problem, we keep each local network as small as possible, and we connect these local networks using a separate device called a _router_. A router is a computer that knows how to forward messages between networks. The router is like a post office: when a packet arrives, it reads the recipient address and forwards the packet to the right recipient directly, without going through layers of relays.

Switches and routers do different jobs rather than one replacing the other. On a local network, a switch forwards frames to the correct device using link-layer addresses (MAC addresses). A router connects separate networks and forwards packets between them using network-layer addresses (IP addresses). That is why large internetworks use routers to link many smaller switched local networks instead of trying to scale a single flat switched network indefinitely.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text sounds reasonable, but it still doesn't explain why the IP address and packet system is needed rather than just scaling flat switched networks. It just states what data transmission system the two different device types use.

Also, I wouldn't use the term "internetworks"; from searching, I can see that it is a real term, but I've never heard it before, in 25 years of documenting web technologies. I'd expand it to "interconnected networks" instead.

@KirtiRamchandani

Copy link
Copy Markdown
Contributor Author

Thanks @chrisdavidmills, that makes sense.

My paragraph said switches use MAC addresses and routers use IP addresses, but it did not explain why that helps when you stop scaling one big flat switched network. I will rewrite it to spell out why many small local networks joined by routers works better, and I will swap "internetworks" for "interconnected networks."

I might also add a short nod to the IP section below so it does not feel like jargon dropped in early. Pushing an update soon.

Rewrite the switch versus router paragraph to explain why many small
local networks joined by routers works better than one growing flat
switched network, use interconnected networks wording, and link forward
to the IP address section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Learn Learning area docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing content and definitions in "How does the internet work?"

3 participants