Updated on 28 Feb, 202616 mins read 21 views

The Problem with Early Networks

Let's go back to our earlier network.

You had multiple computers connected using a hub.

      C
      |
A --- HUB --- B
      |
      D

The hub behaved very simply:

Anything received on one port -> sent to ALL ports.

This created serious problems.

Problem 1: Everyone Receives Everything

If A sends data to B:

  • C receives it
  • D receives it
  • Everyone wastes processing power

Like announcing every message on a loudspeaker.

Problem 2: Collision Everywhere

Only one device could talk at a time.

If two tansmitted:

  • collision
  • corrupted data
  • retransmission

As networks grew, performance collapsed.

Problem 3: Shared Bandwidth

If hub speed = 100 Mbps and 10 devices exist:

Each device effectively shares that bandwidth.

Network becomes slow.

Engineers needed something smarter.

Not just signal repetition.

But decision-making.

The Birth of the Network Switch

The solution was the switch.

A switch works at:

Data Link Layer (Layer 2)

Unlike a hub, a switch understands:

  • frames
  • MAC addresses
  • destinations

The Core Idea

A switch asks one question:

“Who exactly should receive this frame?”

Instead of broadcasting blindly.

Modern Network

      PC A
        |
PC B — SWITCH — PC C
        |
      Server

Each device has its own dedicated connection.

How a Switch Learns (The Magic Part)

Switches are intelligent because they learn automatically.

They maintain something called: MAC Address Tabe

Step-by-Step Story

Step 1: First Transmission

Computer A sends a frame to B.

Frame contains.

Source MAC: A
Destination MAC: B

Switch receives it.

Step 2: Learning the Source

Switch records:

MAC A → Port 1

This is called MAC learning.

Step 3: Unknown Destination

Switch doesn't know where B is yet.

So it temporarily broadcasts.

Step 4: B Replies

Now switch sees:

MAC B → Port 3

Tables becomes:

MAC AddressPort
A1
B3

Step 5: Future Communication

Now when A sends to B:

Switch sends frame ONLY to Port 3.

No broadcasting.

Network becomes efficient automatically.

Collisions Domains – The Big Improvement

With hubs:

  • Entire network = one collision domain

With switches:

Each port becomes its own collision domain

Meaning:

Devices can transmit simultaneously.

Example:

  • A <-> B communication
  • C <-> Server communication

Both happen at same time.

No collisions.

Full Duplex Communication

Switches allow:

Full Duplex Mode

Devices can:

  • send AND receive simultaneously.

Benefits:

  • collisions eliminated
  • double effective bandwidth
  • smoother communication

CSMA/CD becomes unnecessary.

Switching Methods

Switches can forward frames using different strategies.

1 Store-and-Forward (Most Common)

Process:

  1. Receive entire frame
  2. Check for errors (CRC)
  3. Forward if vaild

Advantages:

  • reliable
  • error-free forwarding

2 Cut-Through Switching

Switch forward frame immediately after reading destination MAC.

Advantages:

  • very low latency

Disadvantages:

  • may forward corrupted frames

Used in high-speed environments.

Broadcast, Unicast, and Multicast

Switches handle different traffic types.

Unicast

One sender -> one receiver.

Most traffic.

Broadcast

One sender -> everyone.

Example:

  • ARP requests.

Switch forwards to all ports.

Multicast

One sender -> selected group

Used in streaming or conferencing.

VLANs – Virtual Networks Inside One Switch

Large networks need separation.

Example:

  • HR department
  • Engineering
  • Guests

Event on same switch.

Solution:

VLAN (Virtual LAN)

Without VLAN

Everyone in same network

Security risk

With VLAN

Switch logically separates networks:

VLAN 10 → HR
VLAN 20 → Engineering
VLAN 30 → Guests

Devices behave as if on separate physical networks.

Benefits:

  • security
  • traffic isolation
  • easier management

Spanning Tree Protocol (STP)

Large networks often have redundant links.

Example:

Switch A ---- Switch B
     \        /
       Switch C

Problem:

Frames may loop forever.

This causes:

  • broadcast storms
  • network collapse

Solution: STP

Switches cooperate to:

  • detect loops
  • disable redundant paths temporarily
  • maintain backup links

Network remains stable.

Switch vs Hub

FeatureHubSwitch
LayerPhysicalData Link
IntelligenceNoneLearns MACs
TrafficBroadcastTargeted
CollisionsFrequentEliminated
BandwidthSharedDedicated
DuplexHalfFull

Switches completely replaced hubs.

Big Picture So Far

Your networking stack now looks like:

Layer 2: Switching, Frames, MAC addressing
Layer 1: Signals and transmission

Local communication is solved.

But a bigger problem remains:

How does data travel between different networks?

Your home network -> ISP -> another country.

Switches cannot solve this.

That requires:

Layer 3 – Routing and IP addressing.

Buy Me A Coffee

Leave a comment

Your email address will not be published. Required fields are marked *