4. Designing the Internet¶
This note is about how to break down the construction of the Internet into modules, and see how one might go about desining the Internet through these pieces.
Recall¶
The Internet's layered architecture: 1. Applications, which are built on 2. (Un)reliable data delivery, which are built on 3. Best-effort global packet delivery, which is built on 4. Best-effort local packet delivery, which is built on 5. Physical transfer of bits
Local vs. Global Delivery¶
Ethernet networks only know how to cross ethernet networks. Optical networks only know how to cross optical networks. This is the local delivery. We need some way to deliver packets across ethernet, optical, then ethernet. This is the global end-to-end delivery.
Protocols¶

Different protocols at the same layer simply means that there are other ways to accomplish the same goal. We get to make the choice of how to transfer to the next layer. Notice there is just one network-layer protocol.
Peers Understand the Same Things¶
Communication between peer layers on different systems is defined by protocols. Applications use application protocols to communicate, etc.
A protocol is a specificatio nof how parties ocmmunicate. It defines the syntax of communication:
- Each protocol defines the format of its packet headers (e.g. first 32 bits carry destination address, etc.)
And semantics:
-
First a hello, then a request
-
Essentially a state machine
Protocols exist at many levels, defined by a variety of standard bodies (IETF, IEEE, ITU)
Three Important Properties¶
- Each layer: depends on the layer below, supports layer above. Independent of others
- Multiple versions in a layer: the interfaces differ somewhat, and components at one layer pick which lower-level protocol to use
- But only one IP layer: Unifying protocol
Why Layering Important?¶
-
Innovation can proceed largely in parallel!
-
Pursued by very different communities: App devs (L7) vs chip designers (L1/L2)
-
Leading to innovation at most levels: applications (lots), transport (some), network (few), physical (lots)
Distributing Layers Across Network¶
Layers are simple if only on a single machine. Just a stack of modules interacting with those above/below
But we need to implement layers across: 1. Hosts 2. Routers (switches)
What Gets Implemented at the End Host?¶
Bits arrive on wire (must implement L1). Also make it up to app (must implement L7). Therefore all layers must exist at host.
What Gets Implemented in the Network¶
- Bits arrive on wire (Physical Layer L1)
- Packets must be delivered across links and local networks (Datalink layer L2)
- Packets must be delivered between networks for global delivery (Network layer L3)
The network does not support reliable delivery (Transport layer and above not supported)
High level of our design:

Closer Look: End Host¶

Addressing within the end host: recal the packet contains the destination host's address. Now the packet is at the endhost. When the packet is at the OS, how does the OS know which app to send the packet to.
- Port number identifies attachment point between application and OS.
Network Ports: Two Types¶
- Switches/routers have physical ports. Places where links connect to switches
- OS supports logical ports: Place where app conntects to OS network stack
Sockets and Ports¶
Socket: an OS mechanism that connects app processes to the networking stack
When an app wants to access to the network, it opens a socket, whic his associated with a port. This is not a physical port, just a logical one
THe port number is used bythe OS to direct incoming packets to its associated socket
Implications for Packet Header¶
Packet header must include: 1. Destination host address (used by the network to reach host) 2. Destination port (used by host OS to reach application)
When a packet arrives at the destination end-host, it is delivered to the socket (process) associated with the packet's destination port
OS Network Stack Is an Intermediary¶
Application has a very clear task with respect to network. It thinks about data.
NIC/driver has very dclear task. It thinks about packets
Network stack in the intermediary between them. It translates between their abstractions.
Recap: Layers at the end host¶
-
Application layer: part of the app: browser, mail client, etc. (L7)
-
Transport and Network Layer: typically part of the OS (L3, L4)
-
Datalink and Physical layer: hardware/firmware/drivers (L1, L2)
Closer Look: Network¶
-
Bits on a wire (L1)
-
Local delivery of packets (L2)
-
Global delivery of packets (L3)
Recall: Logical Communication¶
Layers interact with peer's corresponding layer. The lower three layers implemented everywhere, and the top two layers implemented only at hosts.
Protocl Diagram¶
First Physical Communication:
-
Communication goes down to physical network
-
Then up to relevant layer

So, for an HTTP message at the application layer, it would travel like this.

Where dashed lines are logical communication, but solid lines are physical communication.
Layer Encapsulation¶

See how going down, we package the information on top of it. As communication goes down to the physical network, it will package more, and as it goes up, it will unpack.

Packets contain multiple headers!
Review¶

Architectural Wisdom¶
David Clark: Chief protocol architect for the Internet in the 80s. Gave he language of it, not its implementation
"End-to-End Arguments in System Design" (1981)
"The Design Philosophy of the DARPA Internet Protocols" (1988)
Articulates the rationale underlying the Internet's architecture
End-to-End Principles¶
Guides the debate about what functionality the network does or doesn't implement. Today: should we implement reliability in the network? What does it mean for the network to implement reliability?

Let's see what happens:
Application reads file from disk, sends it to OS, sends it to host B. OS B will read and send it to application, then the application on host B will send it to its disk. We want to achieve reliability.
- Solution: implement reliability at each step (network implments reliability); some check sum at each step
- Solution: end-to-end check and retry (does not assume network is reliable); a check sum overall
It seems like there is a problem: what if the checksum check at any of the solution fails? 1. Solution 1 cannot be made perfectly reliable: what happens if a component fails between two steps? What happens if a component has a bug (i.e. check sum passes because of bug)? Guaranteeing correctness: that means receive has to do the end-to-end check anyway (solution 2). If not, the endpoints mihght be left in an incorrect state 2. Solution 2 can also fail but will never leave the endpoints in an incorrect state. Host B will neveer accept a corrupted file.
Impact of Network Failure¶
- Solution 1: Network failures/bugs impact endpoint semantics. Requires endpoints trust other elements! That is bad
- Solution 2: Endpoint semantics decoupled from network failure> Endpoint only relies on what it can control!
End-to-End Argument: Intuition¶
Some application requirements can only be correctly implemented end-to-end
- Reliability, security, etc.
End-systems
-
Must do so, for correctness
-
Can satisfy the requirement without network's help
Thesis: Implementing these functions in the network is unnecessary and adds complexity to the network.
Therefore...¶
Should you ever implement reliability in network? I.e., in addition to doing so in the hosts
Performance:
-
If each link drps packets 10% of the time, and we have 10 links, then E2E failure rate is 65%.
-
What if the link implemented two retransactions? Per-link drop rate reduced to 0.1%, E2E failure rate is ~1%
Perhaps, as a performance optimization, but not for correctness. Need for it must be evaluated on a case-by-case basis
Recap: End-to-End¶
Implementing this function (reliability) in the network: 1. Doesn't reduce host implementation complexity 2. Does increase network complixity 3. Imposes overhead on all applications 4. However, implementing in network can enhance performance in some cases (e.g., very lossy link)
In Clark's Works:
"The function in question can completely and correctly be implemented only with the knowledge and help of the application at the end points. Therefore, providing that function as a feature of the communication system itself is not possible. (Sometimes an incomplete version of the function provided by the communication system may be useful as a performance enhancement)"
The "how" 1. How to decompose system into modules? Layering 2. Where are the layers implemented? End hosts (L1-L7) and Networks (L1-L3) 3. One unifying protocol at the network layer? IP
The "why" 1. Layering provided a clean separation of concerns and hence enabled innovation! 2. End-to-End Principle kept unnecessary state and functionality out of the network and hence allowed the Internet to scale!