Skip to content

Design Principles

Internet Design Principles

Narraw Waist Model

This diagram shows the different components of a network architecture, notice there’s only one protocol at Layer 3. This is the “narrow waist” that enables Internet connectivity.

Demultiplexing

Think about that when a router receive a packet, how dose it know which protocol to use to process the packet?

The answer can be found in the related header of the packet, which we have discussed in Multiple Headers section.

Demultiplexing in L4
Demultiplexing in L4

This process is called demultiplexing (解复用).

Demultiplexing can not only use for choosing the protocol to process the packet (works on L4 - Transport Layer, we discussed above), but also for choosing the port to running some service, which works in L7 - Application Layer.

Demultiplexing in L7
Demultiplexing in L7

Logical Port vs Physical Port

  • Logical Port: A number identifying an application. Exists in software.

  • Physical port: The hole you plug a cable into. Exists in hardware.

socket1

The term socket (套接字) refers to an OS mechanism for connecting an application to the networking stack in the OS. When an application opens a socket, that socket is associated with a logical port number. When the OS receives a packet, it uses the port number to direct that packet to the associated socket.

In general, demultiplexing helps the operating system pass packets to the correct application, based on the Layers Abstraction we've discussed previously.

End-to-End Principle

In previous discussion, we konw that routers implement L1-L3 only, and end hosts implement Layer 4 (reliability).

Why do we choose this design? The end-to-end principle (端到端原则) will help us answer these questions.

The end-to-end principle guides the debate about what functionality the network does and doesn’t implement.

Think about the two designs in the textbook:

End-to-End Principle - Network Architecture | CS168 Textbook

  • Solution 1: The end host (Bob) had to trust the network for correctness.

    If the reliability code in the network is buggy, there's nothing Bob can do.

  • Solution 2: Bob only had to rely on himself for correctness.

    If the reliability code is buggy, Bob has the power to fix it.

The end-to-end principle is not an unbreakable rule:

  • Could implement reliability in the network as a performance optimization.

  • Must be done in addition to end-to-end checks, for correctness.

  • Need for this must be evaluated on a case-by-case basis.

When links are very lossy

  • Links sending duplicate packets can improve performance for end hosts.

  • Sending duplicate packets is purely for performance, not correctness.

Designing Resource Sharing

Statistical Multiplexing

Sharing Resources: Statistical Multiplexing - Designing Resource Sharing | CS168 Textbook

Circuit Switching vs. Packet Switching

数据交换类型 - 计算机网络概述

Sharing Resources: Circuit Switching vs. Packet Switching - Designing Resource Sharing | CS168 Textbook

Tip

In the modern Internet, packet switching is the default approach.

Tradeoffs between the two approaches

There are four dimensions we can use to compare the two approaches:

  1. Is this a good abstraction (or API) for the network to offer to an application developer?

  2. Is the approach efficient at scale? Does the approach use all the available bandwidth on the network, or is some bandwidth wasted?

  3. How well does each approach handle failure at scale?

  4. How complex is it to implement each approach at scale?