source

01 Fundamentals And Architecture

Fundamentals and Architecture

Prerequisites: None (start here) Learning Goals: After reading this, you will understand the Internet’s layered architecture, the end-to-end principle, why IPv4/TCP are hard to replace, and how Layer 2 switching works.

Introduction

The Internet connects billions of hosts running diverse applications across different types of networks. To manage this complexity, network designers use a layered architecture that divides functionality into distinct layers, each offering specific services. This file covers the foundational concepts that underpin all computer networking.


History of the Internet

Early Developments (1960s-1970s)

1960s: The Vision

1970s: Protocol Development

Growth and Standardization (1980s-1990s)

Key Milestones:

Result: From 4 nodes in 1969 to billions of connected devices today


Layered Architecture

Goal and Advantages

Primary Goal: Enable communication between hosts running the same applications but located in different types of networks

Why Layering?

  1. Scalability: Can add new protocols and technologies without redesigning everything
  2. Modularity: Each layer solves a specific problem independently
  3. Flexibility: Layers can be updated or replaced without affecting others

Analogy: Airline System

Ticket Purchase    →  Application decides what you want
Baggage Check      →  Prepare items for transport
Gate Assignment    →  Organize departure logistics
Runway Takeoff     →  Physical movement

Each layer serves the one above it, hiding implementation details.

The OSI Model vs Internet Model

OSI Model (7 Layers) - International Organization for Standardization:

7. Application Layer
6. Presentation Layer
5. Session Layer
4. Transport Layer
3. Network Layer
2. Data Link Layer
1. Physical Layer

Internet Model (5 Layers) - Practical implementation:

5. Application Layer      (Combines OSI Layers 5-7)
4. Transport Layer
3. Network Layer
2. Data Link Layer
1. Physical Layer

The Internet model consolidates the top three OSI layers into a single Application Layer for simplicity.


Layer-by-Layer Breakdown

Understanding Each Layer

Every layer can be explained using three concepts:

  1. Service: What the layer provides to the layer above
  2. Interface: How the layer above accesses this service
  3. Protocol: The rules peers follow to implement the service


Layer 7-5: Application Layer

Role: Provides network services directly to end-user applications

Key Protocols:

Data Unit: Message

Example:


Layer 6: Presentation Layer (OSI)

Role: Formats and translates information between the application and network

Functions:

Note: In the Internet model, these functions are handled within the Application Layer.


Layer 5: Session Layer (OSI)

Role: Manages sessions between end-user applications

Functions:

Note: In the Internet model, session management is application-specific.


Layer 4: Transport Layer

Role: Provides end-to-end communication between applications (not just hosts)

Key Protocols:

TCP (Transmission Control Protocol):

UDP (User Datagram Protocol):

Data Unit: Segment

Key Distinction:


Layer 3: Network Layer

Role: Routes datagrams from source host to destination host across the Internet

How It Works:

  1. Source host’s transport layer passes a segment to the network layer
  2. Network layer wraps the segment in a datagram with destination IP
  3. Datagram travels through intermediate routers
  4. Destination host’s network layer receives datagram and passes segment up to transport layer

Key Protocols:

IP (Internet Protocol):

Routing Protocols:

Data Unit: Datagram (or Packet)


Role: Transfers frames from one node to the next node on the same link

Key Distinction:

How It Works (Example: Host A → Router 1 → Router 2 → Host B):

  1. Host A’s network layer creates a datagram
  2. Host A’s data link layer wraps it in a frame with MAC addresses
  3. Router 1 receives frame, extracts datagram, determines next hop
  4. Router 1’s data link layer creates a new frame for the next link
  5. Process repeats until datagram reaches Host B

Services:

Data Unit: Frame

Key Protocols: Ethernet, Wi-Fi (802.11), PPP


Layer 1: Physical Layer

Role: Transfers individual bits within a frame between two nodes connected by a physical link

Functions:

Data Unit: Bits

Note: Protocols vary by transmission medium (copper wire, fiber optic, wireless)


Encapsulation and De-encapsulation

How Layers Communicate

Layers communicate through encapsulation (at sender) and de-encapsulation (at receiver).

Encapsulation (Sender’s side):

Example: Sending “Hello” via a web browser

  1. Application Layer: Creates message = "Hello"
  2. Transport Layer: Adds header Ht (port numbers, checksum, sequence) → Segment
  3. Network Layer: Adds header Hn (source/dest IP, TTL) → Datagram
  4. Link Layer: Adds header Hl (source/dest MAC, CRC) → Frame
  5. Physical Layer: Converts to bits and transmits
[Physical Bits] ← [Hl | Hn | Ht | "Hello"] Frame

De-encapsulation (Receiver’s side):

Continuing the example:

  1. Link Layer: Removes MAC header (Hl), passes packet up
  2. Network Layer: Removes IP header (Hn), passes segment up
  3. Transport Layer: Removes TCP/UDP header (Ht), passes message up
  4. Application Layer: Sees "Hello" and delivers to browser

Intermediate Devices

Routers (Layers 1-3):

Switches (Layers 1-2):

Key Insight: Intermediate devices don’t go all the way up to the application layer.


The End-to-End Principle

Core Concept

Definition: Application-level functions should not be built into the lower levels of the network core. Intelligence should reside at the end systems (hosts), not in the network itself.

Philosophy:

Why This Principle?

Original Design Goals:

  1. Flexibility: Moving functions to end systems increases autonomy for application designers
  2. Innovation: Easier to deploy new applications without changing network infrastructure
  3. Reliability: Functions like encryption and error correction work better when handled end-to-end

Example: File Transfer

Violations of E2E

Despite the principle, some functions have moved into the network core:

1. Firewalls

2. NAT (Network Address Translation) Boxes

How NAT Works:

Why NAT Violates E2E:

Trade-off: NAT solves IPv4 address exhaustion but complicates peer-to-peer applications.


The Hourglass Shape of Internet Architecture

Observation

The Internet protocol stack has an hourglass shape:

Question: Why has IP become such a dominant “waist”? Why is it so hard to replace IPv4 with IPv6 or introduce new transport protocols?


The EvoArch Model

EvoArch (Evolutionary Architecture) is a model that explains this hourglass shape.

Key Components:

1. Layers (L):

2. Nodes:

3. Edges (Dependencies):

4. Substrates and Products:

5. Layer Generality s(l):

6. Evolutionary Value v(u):

7. Competition:

Death Mechanism:


EvoArch Iteration Process

Each round has three phases:

1. Birth:

2. Update (Top to Bottom):

3. Competition and Death:

Result: After many rounds, the stack exhibits an hourglass shape:

Visualization:


Why IPv4/TCP/UDP Are Hard to Replace

High Evolutionary Value:

Evolutionary Shield:

Network Effects:

Ramifications:

  1. Many technologies adapted to work over IP (Radio over IP, Voice over IP)
  2. IPv6 transition has been extremely slow despite address exhaustion

Clean-Slate Internet Architecture Redesign

Motivation

Current Internet Challenges:

Clean-Slate Approach:

Potential Outcomes

  1. Incremental improvements: New services adopted in today’s Internet
  2. Revolutionary change: Entirely new architecture
  3. Validation: Proof that current Internet is already optimal

Example: Accountable Internet Protocol (AIP)

Goal: Improve accountability at the network layer

Address Format: AD:EID

Key Features:

1. Source Accountability:

2. Control-Plane Accountability:

Trade-off: More accountability vs. privacy concerns


Interconnecting Hosts and Networks

Layer 1: Repeaters and Hubs

Function: Receive and forward digital signals to connect different Ethernet segments

Advantages:

Disadvantages:

Use Case: Legacy networks (mostly replaced by switches)


Layer 2: Bridges and Switches

Function: Enable communication between hosts that are not directly connected

Key Difference from Hubs:

Advantages:

Disadvantages:


Learning Bridges

Goal: Maintain a forwarding table to intelligently forward frames

How Learning Works:

Setup:

Bridge Behavior:

  1. When a frame arrives, bridge looks at source MAC and records:
    • Source MAC → Port it arrived on
  2. Bridge looks up destination MAC in forwarding table:
    • If known: Forward only to that port
    • If source and destination on same port: Drop (don’t waste bandwidth)
    • If unknown: Flood to all ports except incoming port

Example:

Frame from Host A (MAC: AA:AA) arrives on Port 1
  → Bridge learns: AA:AA is on Port 1

Frame destined for Host B (MAC: BB:BB) arrives on Port 1
  → If BB:BB is in table on Port 2 → Forward to Port 2
  → If BB:BB is in table on Port 1 → Drop (same segment)
  → If BB:BB unknown → Flood to Port 2

Benefits:


The Spanning Tree Protocol (STP)

Problem: Network topologies with loops cause infinite frame forwarding

Example:

Bridge A ← → Bridge B
    ↓           ↓
    └─ Bridge C ─┘

A frame could loop: A → B → C → A → …

Solution: Spanning Tree Algorithm

Goal: Create a loop-free logical topology by disabling certain links

How It Works:

1. Root Bridge Election:

2. Root Port Selection:

3. Designated Bridge per LAN:

4. Disable Other Ports:

Result: A tree structure with the root at the top, no loops

Example:

Initial: All bridges claim to be root
Round 1: Bridge 1 (ID=1) sends <1, 0, 1>
         Bridge 2 (ID=2) sends <2, 0, 2>
         Bridge 3 (ID=3) sends <3, 0, 3>

Round 2: All bridges receive messages
         All adopt Bridge 1 as root (lowest ID)
         Bridge 2 sends <1, 1, 2> (1 hop from root)
         Bridge 3 sends <1, 1, 3>

Round 3: Converges
         Root: Bridge 1
         Bridge 2's root port: toward Bridge 1
         Bridge 3's root port: toward Bridge 1
         Some ports disabled to prevent loops

Advantages:

Disadvantages:


Layer 3: Routers and Layer 3 Switches

Function: Forward packets based on IP addresses using routing protocols

Key Difference from Layer 2:

Covered in detail in: 02-Network-Layer-and-Routing


Summary

Key Takeaways

  1. Layered Architecture: The Internet uses a 5-layer stack (Application, Transport, Network, Data Link, Physical) for modularity and scalability

  2. End-to-End Principle: Intelligence belongs at end systems, not in the network core; violations include NAT and firewalls

  3. Encapsulation: Each layer adds headers; intermediate devices do partial de-encapsulation based on their function

  4. Hourglass Shape: The protocol stack narrows at IP due to evolutionary forces; high-value protocols with many dependents are hard to replace

  5. IPv4/TCP/UDP Stability: These protocols dominate due to network effects and evolutionary value, making clean-slate redesign difficult

  6. Layer 2 Switching: Bridges learn MAC addresses and use Spanning Tree to prevent loops

Common Patterns

Protocol Design:

Evolution:

Tradeoffs:


See Also

Next: 02-Network-Layer-and-Routing