Computer Networks

Foundations Of Networking

Network Types and Topologies

from carriers; latency is tens to hundreds

JrCodex·7 min read

Jr Codex Computer Networks Notes

Level: Beginner Prerequisites: Chapter 3: Encapsulation Time to complete: ~15 minutes


Table of Contents

  1. Networks by Scale
  2. Topologies
  3. Circuit vs Packet Switching
  4. Client-Server and Peer-to-Peer
  5. The Internet Is a Network of Networks
  6. Summary & Next Steps

1. Networks by Scale

The Categories
─────────────────────────────────────────
  PAN   Personal Area Network
        metres. Bluetooth, USB, a phone and its
        earbuds.

  LAN   Local Area Network
        a building or campus. Ethernet and wifi.
        You own the equipment; latency is
        sub-millisecond.

  MAN   Metropolitan Area Network
        a city. A university's campuses, a cable
        operator's coverage.

  WAN   Wide Area Network
        countries and continents. You lease it
        from carriers; latency is tens to hundreds
        of milliseconds.
─────────────────────────────────────────
The Distinction That Actually Matters
─────────────────────────────────────────
  Not the size. Whether YOU CONTROL IT.

  ON YOUR LAN
    predictable latency, negligible loss, known
    equipment, and you can change it.

  ACROSS A WAN
    variable latency, real packet loss, equipment
    owned by others, routes that change without
    notice.

  Almost every design decision in this curriculum
  is different on one side of that line than the
  other — and the classic distributed-systems
  mistake is treating a WAN like a LAN.
─────────────────────────────────────────

2. Topologies

The Shapes
─────────────────────────────────────────
  BUS      all devices on one shared cable
             A──B──C──D
           + cheap
           - one break kills everything; only one
             device may transmit at a time
           Obsolete, but its COLLISION problem
           shaped Ethernet (Module 2, Chapter 3)

  RING     each device connects to two neighbours
           + predictable, no collisions
           - one break splits the ring
           Survives in some fibre backbones

  STAR     everything connects to a central switch
             B   C
              \ /
           A───S───D
           + one failure affects one device;
             easy to add devices
           - the switch is a single point of
             failure
           ── what essentially every LAN is today

  MESH     many devices interconnected
           + highly resilient; multiple paths
           - expensive; n(n-1)/2 links for full
             mesh
           ── the shape of the internet's core

  TREE     hierarchical stars
           ── how campus and datacentre networks
              scale
─────────────────────────────────────────
Physical vs Logical
─────────────────────────────────────────
  These can differ, and often do.

  Wifi is PHYSICALLY a star — every device talks to
  the access point.
  It is LOGICALLY a bus — everyone shares one radio
  medium, so only one may transmit at a time, and
  collisions are possible.

  That mismatch is exactly why wifi needs a
  different access method than switched Ethernet
  (Module 2, Chapter 3).
─────────────────────────────────────────

3. Circuit vs Packet Switching

CIRCUIT SWITCHING
─────────────────────────────────────────
  Reserve a dedicated path for the whole
  conversation before any data flows.
  The traditional telephone network.

  + guaranteed bandwidth and constant latency
  + no per-message addressing overhead
  - the path is reserved even while SILENT — a
    phone call with nobody talking still holds the
    full circuit
  - setup delay before anything can be sent
  - a failed link kills the call
PACKET SWITCHING
─────────────────────────────────────────
  Split data into packets. Each is addressed and
  routed independently. Links are shared.
  The internet.

  + STATISTICAL MULTIPLEXING — an idle
    conversation consumes nothing, so far more
    users fit on the same capacity
  + resilient — packets route around failures
  + no setup delay
  - variable latency (JITTER), and queues
  - packets may be lost, duplicated or reordered
  - per-packet header overhead (Chapter 3)
─────────────────────────────────────────
Why Packet Switching Won
─────────────────────────────────────────
  Data traffic is BURSTY. You load a page, then
  read it for thirty seconds, then load another.

  Circuit switching would hold the full capacity
  through all that reading. Packet switching lets
  a thousand people share a link that could carry
  only ten simultaneous circuits.

  The cost — variable latency and possible loss —
  is exactly what the transport layer was invented
  to hide (Module 4).
─────────────────────────────────────────

4. Client-Server and Peer-to-Peer

CLIENT-SERVER
─────────────────────────────────────────
  Clients request; a server responds. Asymmetric.

  + central control, easy to secure and update
  + one authoritative copy of the data
  - the server is a bottleneck and a single point
    of failure
  - capacity must be provisioned for peak

  The web, email, databases, APIs.
PEER-TO-PEER
─────────────────────────────────────────
  Every node is both client and server.

  + capacity GROWS with the number of users — more
    peers means more upload bandwidth
  + no single point of failure
  - hard to secure, hard to find who has what
  - unpredictable availability; peers leave

  BitTorrent, blockchains, some video calling.
The Property Worth Understanding
─────────────────────────────────────────
  In client-server, demand scales with users and
  supply does not. A thousand users downloading a
  file need a thousand times the server bandwidth.

  In peer-to-peer, each new user brings their own
  upload capacity. Demand and supply grow together.

  This is why P2P distribution of large files is
  fundamentally cheaper — and why CDNs (Module 7,
  Chapter 2) exist to give client-server systems
  some of the same property.
─────────────────────────────────────────
The Common Hybrid
─────────────────────────────────────────
  Most real systems are both:
    - a central server for DISCOVERY,
      authentication and coordination
    - direct peer connections for the BULK DATA

  Video calling works this way: a server matches
  the participants, then media flows peer-to-peer
  where possible.
─────────────────────────────────────────

5. The Internet Is a Network of Networks

The Structure
─────────────────────────────────────────
  The internet is not one network. It is ~75,000
  independently operated networks that agree to
  carry each other's traffic.

  AUTONOMOUS SYSTEM (AS)
    One network under one administrative control,
    with its own routing policy. Your ISP is an AS.
    So is a large university, and so is Google.
    Each has an AS number.

  TIER 1    global backbones that reach everywhere
            without paying anyone. They PEER with
            each other.
  TIER 2    regional; peer where they can, pay
            Tier 1 for the rest
  TIER 3    local ISPs; mostly buy transit
─────────────────────────────────────────
PEERING vs TRANSIT
─────────────────────────────────────────
  TRANSIT   you PAY a provider to carry your
            traffic to the whole internet.

  PEERING   two networks exchange traffic
            DIRECTLY, usually settlement-free,
            because it benefits both.

  This is why the internet's routing is shaped by
  COMMERCIAL relationships as much as by geography
  — and why the shortest physical path is often
  not the path your packets take (Module 3,
  Chapter 4).
─────────────────────────────────────────
Why It Matters to You
─────────────────────────────────────────
  It explains things that otherwise look like bugs:

  - a packet from London to Paris routing via
    Amsterdam, because that is where the two
    networks peer
  - latency to a nearby server being worse than to
    a distant one
  - an outage at a network you have never heard of
    breaking your service

  No single organisation controls the path. Module
  3 covers how routing decisions are actually made
  across these boundaries.
─────────────────────────────────────────

6. Summary & Next Steps

Key Takeaways

  • The meaningful distinction is not size but control: LAN latency is predictable and loss is negligible, while across a WAN neither is true.
  • Physical and logical topology can differ — wifi is a physical star and a logical bus, which is why it needs a different medium access method.
  • Packet switching won because data is bursty, and statistical multiplexing lets far more users share a link; the price is variable latency and loss.
  • The internet is roughly 75,000 independently run networks whose routing is shaped by commercial peering and transit relationships, not by geography.

Concept Check

  1. Why is "do you control it" a more useful distinction than LAN versus WAN by size?
  2. Explain why peer-to-peer distribution of a large file scales differently from client-server.
  3. Why might packets from London to Paris travel via Amsterdam?

Next Chapter

Chapter 5: Measuring a Network


Jr Codex — 1-on-1 Personalized Coaching | Back to Module Index | Back to Computer Networks Index