1.1 What Is the Internet?

When discussing the Internet, we can think about it in two ways: first, the hardware and software that construct it (the nuts and bolts), and second, the infrastructure it provides for applications to communicate. We will start by looking at the components.

1.1.1 A Nuts-and-Bolts Description

The Internet is a vast computer network connecting billions of computing devices globally. While this used to mean mostly traditional computers and servers, it now heavily includes smartphones and tablets. Even beyond those, many non-traditional devices, like cars, home appliances, and traffic systems, are now connecting. In networking terms, all these devices are called hosts or end systems.

End systems are linked together through a network of communication links and packet switches:

  • A packet switch (like a router or a link-layer switch) takes a packet arriving on one link and forwards it out on another link toward its destination (they basically forward packets). Link-layer switches are often found in access networks, while routers are central to the network core. The entire sequence of links and switches that a packet travels from sender to receiver is known as a route or path. Packet switches make a network actually a network.

  • Communication links use different physical media, such as copper wire, optical fiber, and radio spectrum, and their data transmission rate is measured in bits/second. When a host sends data, it first breaks the data into smaller pieces and adds extra information (header bytes). These resulting packages are called packets. Finally, all these elements are assembled into networks, each of which is owned and operated by some entity (for example home network, mobile network, etc). It’s the existence of these multiple networks that gives rise to the saying that “Internet is a network of networks”.

You can understand this better by comparing it to a transportation network. In this comparison:

  • Packets are like trucks carrying cargo.
  • Communication links are like highways and roads.
  • Packet switches are like intersections managing the flow.
  • End systems are like the buildings (factory/warehouse) at the start and end.

End systems connect to the Internet through Internet Service Providers (ISPs), which include companies that offer residential service (cable/telephone), corporate, university, or mobile access. An ISP is itself a network of switches and links.

To make sure everyone can reach each other, the smaller, lower-tier ISPs are connected through larger, upper-tier ISPs (national and international), which consist of high-speed routers and fiber-optic links. Each ISP runs independently but uses the same protocols and naming conventions.

The Rules of the Internet

All parts of the Internet—end systems, switches, and others—must run protocols to control how information is sent and received. The two most important are the Transmission Control Protocol (TCP) and the Internet Protocol (IP) (which specifies the packet format). Together, they are known as TCP/IP.

To ensure that different devices and systems can work together (interoperate), the protocols must be standardized. Internet standards are developed by the Internet Engineering Task Force (IETF). The IETF’s documents are called Requests for Comments (RFCs), which are very technical and define core protocols like TCP, IP, HTTP, and SMTP. Other groups, like the IEEE 802 LAN Standards Committee, create standards for link technology, such as Ethernet and wireless WiFi.

1.1.2 A Services Description

We can also describe the Internet not by its pieces, but as an infrastructure that provides services to applications.

The range of Internet applications is huge. Besides traditional ones like email and Web surfing, they include modern mobile apps for things like streaming music and video, real-time mapping, video conferencing, and online social media. These are called distributed applications because they involve multiple end systems exchanging data with each other.

A key point is that these applications run only on end systems, not within the packet switches (routers and link-layer switches) in the network core. While the switches help move the data, they don’t care about the application that created or ptions like email and Web surfing, they also include modern mobile apps for activities such as the data.

If you were to create a new distributed application, you would write programs (in Java, C, Python, etc.) to run on the end systems. Since these programs need to communicate, you must know how one program on one host tells the Internet to deliver data to a specific program on another host. This is where the socket interface comes in. End systems connected to the Internet offer this interface, which is a set of rules that a sending program must follow to instruct the Internet infrastructure to deliver data to the correct destination program. We can compare this to the postal service interface: If Alice wants to send a letter (data) to Bob, she can’t just drop it. She must follow the postal rules: put it in an envelope, write the full address, add a stamp, and put it in a mailbox. The Internet’s socket interface is a similar set of rules for data delivery. Just as the postal service provides multiple options (express, ordinary mail, etc.), the Internet also offers multiple services to its applications. When you develop an application, you must choose one of these services.

This section completes the two main descriptions of the Internet: one based on its physical components (nuts and bolts) and one based on its purpose (providing services to distributed applications).

1.1.3 What Is a Protocol?

The concept of a protocol is central to computer networking. It governs how two or more things communicate.

It’s easiest to understand a network protocol by looking at human protocols, which we use all the time.

  • Example 1: Asking for the Time. To start, you usually say “Hi” (greeting message). If the other person replies “Hi,” that signals you can continue and ask for the time. If the person doesn’t reply or gives a rude response, the protocol stops, and you don’t ask the time. This shows a protocol that involves specific messages and specific actions taken based on the replies or events (like no reply). If two people run different protocols, they cannot communicate effectively. In networking, it also takes two (or more) communicating parts running the same protocol to get a task done.
  • Example 2: Asking a Question in Class. When a teacher asks, “Are there any questions?” (a message), you raise your hand (implicit message). The teacher smiles and says, “Yes…” (a message telling you to proceed), and you then ask your question (your message). The teacher then answers (transmits a reply). Again, the core is the transmission and receipt of messages and a conventional set of actions that follow.

A network protocol is very similar, but the communicating entities are hardware or software components of devices (like a computer, smartphone, or router). All activity in the Internet involving two or more remote entities is controlled by a protocol. Protocols are running everywhere:

  • They control the flow of bits on the cable between two network interface cards.
  • They control the rate at which packets are sent between a sender and receiver (congestion-control protocols).
  • They decide a packet’s path through the routers.

Web Protocol Example. Consider what happens when you type a website URL into your browser (using the HTTP protocol).

  1. Your computer sends a connection request message to the Web server.
  2. The server sends back a connection reply message.
  3. Your computer then sends a GET message with the name of the webpage it wants.
  4. Finally, the server sends the requested webpage (file) back to your computer.

This leads to the formal definition of a protocol:

A protocol defines the format and the order of messages exchanged between two or more communicating entities, as well as the actions taken on the transmission and/or receipt of a message or other event.

Computer networks rely heavily on different protocols for different communication jobs. Understanding the what, why, and how of these networking protocols is key to mastering the field.

1.2. The Network Edge

We are now looking more closely at the parts of the Internet, starting with the network edge—the components that we use every day. The computers, smartphones, and other devices connected to the Internet are called end systems because they sit right at the edge of the overall network. These devices are also known as hosts because they “host”, or run, the application programs we use (like a web browser or an email program). So, remember that host and end system mean the same thing. Hosts are commonly split into two groups:

  1. Clients: These request and receive a service. They are usually the devices we use, like desktops, laptops, and smartphones.
  2. Servers: These provide a service. They are typically more powerful machines whose job is to store and distribute data—things like web pages, videos, and email. Today, most of these servers are located together in huge buildings called data centers (like those run by companies such as Google).

1.2.1 Access Networks (Not read yet)

Now we’re moving from the end devices to the access network, which is the network that physically links an end system (like your computer) to the very first router (called the “edge router”) on its path to the rest of the Internet.

Home Access: DSL, Cable, FTTH, and 5G Fixed Wireless

Most homes today use broadband Internet access, and there are several main ways this happens.

1. Digital Subscriber Line (DSL)

DSL uses the existing telephone line infrastructure. You get DSL from your local phone company (telco), which also acts as your Internet Service Provider (ISP).

  • Inside your home, a DSL modem uses the phone line to exchange data with a DSLAM (multiplexer) located at the telco’s Central Office (CO).
  • The phone line carries three types of signals at different frequencies simultaneously: the phone call, a high-speed downstream channel (data coming to you), and a medium-speed upstream channel (data going out).
  • Because the downstream and upstream speeds are different, DSL access is asymmetric. The maximum speeds are limited by factors like your distance from the CO; generally, DSL only works well if you are within 5 to 10 miles of the Central Office.

2. Cable Internet Access

This method uses the existing cable television infrastructure. You get service from the cable TV company.

  • This system often uses a mix of technologies, called hybrid fiber coax (HFC), where fiber optics connect the central “head end” to neighborhood areas, and then coaxial cable runs from there to individual homes. A neighborhood connection typically serves 500 to 5,000 homes.
  • Similar to DSL, homes use a cable modem to connect to a CMTS (Cable Modem Termination System) at the cable “head end.”
  • A key difference: Cable access is a shared broadcast medium. All packets sent downstream travel to every home in the neighborhood, and all packets sent upstream from homes travel to the head end. This means if many neighbors are using the Internet heavily at the exact same time, everyone’s speed can slow down because the bandwidth is shared. Like DSL, it is typically asymmetric.

3. Fiber to the Home (FTTH)

This technology provides much higher potential speeds (in the gigabits per second range) by running an optical fiber path directly from the CO to the home.

  • There are different ways to run the fiber. The most common shared method is the Passive Optical Network (PON) architecture.
  • In PON, a fiber leaves the CO and is split in the neighborhood to serve multiple homes. Each home has an ONT (Optical Network Terminator) connected to a splitter, which then connects to an OLT (Optical Line Terminator) in the CO. The OLT connects to the Internet.

4. 5G Fixed Wireless

This is a newer option that avoids the need to install costly physical cables by using wireless connections (specifically 5G cellular technology). Data is transmitted wirelessly from the provider’s base station to a modem inside the home.

Access in the Enterprise (and the Home): Ethernet and WiFi

In places like corporate offices, universities, and increasingly in homes, a Local Area Network (LAN) is used to connect an end system to the edge router.

Ethernet and WiFi

  • Ethernet is the most common LAN technology. Users connect their devices using twisted-pair copper wire to an Ethernet switch. This switch (or a network of switches) then connects to the wider Internet. Access speeds are fast, ranging from 100 Mbps to tens of Gbps for users.
  • Wireless LANs (WiFi) are used when people access the Internet wirelessly using laptops, phones, and tablets. In this setting, devices send and receive packets to a wireless access point. This access point is typically connected to the enterprise’s wired network (often using Ethernet). WiFi, based on the IEEE 802.11 standard, is everywhere and provides shared transmission rates of over 100 Mbps. A user needs to be within just a few tens of meters of the access point to connect.
  • Home Networks now often combine these technologies. For example, a home might use DSL or Cable for its main broadband residential access, and then use an inexpensive wireless router (which acts as a wireless access point and a router) to connect both wired devices (like a PC) and wireless devices (like a laptop or smartphone) to the Internet.

Wide-Area Wireless Access: 3G, 4G (LTE), and 5G

When mobile devices like smartphones are used on the move, they don’t use the local WiFi/LAN setup; instead, they use the same wireless infrastructure as cellular telephony.

  • These devices send and receive packets through a base station run by the cellular provider. A key difference from WiFi is that a user can be up to tens of kilometers away from the base station (much farther than the tens of meters required for WiFi).
  • Today, we commonly use 4G (LTE) networks, which offer download speeds up to about 60 Mbps.
  • Even faster networks, known as 5G, are now being deployed, representing the fifth generation of wide-area wireless access technology.

Chapter 1.2 still continues, but I am not interested to it now, so I gonna move to chapter 1.3.

1.3 The Network Core

Now that we’ve looked at the edge, let’s explore the network core, which is the central mesh of packet switches and links that connect all the Internet’s end systems together. The following figure highlights the network core with thick, shaded lines:

1.3.1. Packet Switching

The I nternet core’s operation is based on a principle known as Packet Switching. End systems exchange messages (which could be an email, an image, etc.). To send a message, the source system breaks long messages into smaller pieces called packets. These packets travel across the core’s links and through the packet switches (routers and link-layer switches). A packet is transmitted across any link at the full speed, or transmission rate ( bits/sec), of that link. For a packet of length bits, the time it takes to transmit is seconds.

Store-and-Forward Transmission

Packet switches typically use store-and-forward transmission. This means the router must receive the entire packet into its memory (store) before it can start sending the first bit out onto the next link (forward).

For example, if you send a packet over a path with one router (two links total), the total delay (excluding the time it takes for the signal to physically travel) is . The router must wait seconds to receive the whole packet before it can start its own second transmission. For links in a row, the total delay is .

Queuing Delays and Packet Loss

Every packet switch has an output buffer (or output queue) for each attached link. This buffer stores packets that are waiting their turn to be transmitted onto the link.

  • Queuing Delay: If an arriving packet finds the link busy transmitting another packet, it must wait in the output buffer, causing a queuing delay. This delay can change a lot depending on how busy the network is (congestion).
  • Packet Loss: Since the buffers have a finite (limited) size, if a buffer is completely full when a new packet arrives, the router has to drop (lose) the arriving packet (or sometimes one that is already waiting). This is called packet loss.

Congestion happens when the rate of arriving packets temporarily exceeds the link’s transmission rate. The situation is like waiting in a line for a tollbooth or a bank teller.

Forwarding Tables and Routing Protocols

A router’s job is to look at an arriving packet and decide which outgoing link to send it on.

  1. IP Address: Every end system has a unique hierarchical address called an IP address. The source includes the destination’s IP address in the packet’s header.
  2. Forwarding Table: Each router has a forwarding table. This table acts like a map, matching a destination IP address (or part of it) to a specific outbound link on the router.
  3. Forwarding: When a packet arrives, the router looks at the destination address, checks its forwarding table, and directs the packet onto the correct outbound link.

The author compares this to a driver who asks for directions at every stop: the gas station attendants/people are the routers that read a portion of the address and tell you the next hop (link) on your journey.

Routing Protocols are special programs that run automatically in the Internet to dynamically set up and update these forwarding tables. For example, a routing protocol can calculate the shortest path from the router to every possible destination and then configure the forwarding table based on those results.

1.5 Protocol Layers and Their Service Models

The Internet is a hugely complicated system with many different parts: applications, protocols, devices, switches, and various physical media. To organize this complexity—both in the real world and in our discussion—we use a layered architecture.

1.5.1 Layered Architecture

To understand this, the author uses a great human analogy: the airline system. When you fly, you go through a series of steps:

  1. Ticketing: You buy your ticket.
  2. Baggage Check: You check your bags.
  3. Gate: You board the plane.
  4. Takeoff/Landing & Routing: The plane flies to the destination.
  5. Deplaning & Baggage Claim: You get off and collect your bags.

By looking at these steps, we can divide the airline functionality into layers. Each layer, along with the layers below it, provides a specific service:

  • For instance, the Baggage Layer provides the service of transferring you and your bags from one check-in counter to the claim area. It can only do this for someone who has already used the Ticketing Layer below it.
  • Each layer performs its job by:
    1. Performing actions within its own layer (e.g., the Gate Layer handles loading and unloading the aircraft).
    2. Using the services of the layer directly below it (e.g., the Gate Layer relies on the Takeoff/Landing Layer to provide the runway-to-runway passenger transfer service).

This layered approach offers major advantages:

  1. Modularity and Simplification: It helps us discuss a well-defined, specific part of a large system without having to think about everything else at once.
  2. Easier Implementation Changes: It allows engineers to change the implementation of a service within one layer (like changing how people board at the gate). As long as that layer provides the exact same service to the layer above it, and uses the same services from the layer below it, the rest of the system remains unchanged. This is essential for complex systems that are always being updated.

Protocol Layering

To properly structure the design of network protocols, engineers organize them—along with the hardware and software that use them—into layers.

Core Layering Principles:

  • Service Model: Each layer offers a specific service model to the layer directly above it. This is how the system provides complex functionality step-by-step.
  • Layer Functionality: Every layer provides its service by:
    1. Performing certain actions within its own layer.
    2. Using the services provided by the layer directly below it (e.g., Layer might take an unreliable service from Layer and add its own actions, like detecting and retransmitting lost messages, to create a reliable service for Layer ).

Implementation and Distribution:

  • A protocol layer can be built using software, hardware, or both.
  • Application and Transport layer protocols (like HTTP and TCP) are mostly implemented in software on the end systems (hosts).
  • The Physical and Link layers, which deal with communication over a specific link (like Ethernet or Wi-Fi), are usually built into network interface cards (NICs), which are hardware.
  • The Network layer is typically a mix of software and hardware.
  • Crucially, a protocol for Layer is distributed across the entire network. This means a piece of that Layer protocol exists in the end systems, the packet switches (routers/switches), and other network components.

Protocol layering has conceptual benefits: it provides a structured way to discuss components, and the modularity makes it easier to update individual parts of the system. However, layering is not perfect. Critics point out two drawbacks:

  • Duplication of Effort: One layer might perform a function (like error recovery) that is already done by a lower layer, wasting resources.
  • Information Hiding: A layer might need crucial information that only exists in another layer, which breaks the goal of having layers that are completely separate from each other.

When you put all the protocols from the different layers together, it’s called the protocol stack. The Internet protocol stack uses five layers:

  1. Application Layer
  2. Transport Layer
  3. Network Layer
  4. Link Layer
  5. Physical Layer

Application Layer

This is the top layer where network applications and their specific protocols live. At this layer, the information packet is called a message.

  • Job: To provide services that applications use to exchange information between two end systems.
  • Examples of Protocols:
    • HTTP: Used for transferring web documents (the Web).
    • SMTP: Used for transferring email messages.
    • FTP: Used for transferring files.
    • DNS (Domain Name System): A special application-layer protocol that translates human-friendly names (like www.ietf.org) into the numerical network addresses needed by the system.
  • Key Concept: An application-layer protocol is distributed across both end systems (e.g., your browser and the web server). It is easy to create new protocols at this level.

Transport Layer

The Transport Layer sits right under the Application Layer and is responsible for moving the application’s messages between the two application endpoints. At this layer, the information packet is called a segment. The Internet uses two main transport protocols:

  • TCP (Transmission Control Protocol): Provides a connection-oriented service that is robust.
    • Guarantees: It ensures guaranteed delivery of messages to the destination.
    • Control: It includes flow control (matching sender speed to receiver speed) and congestion control (slowing down the transmission rate when the network is overwhelmed).
    • Segmentation: It breaks long messages into shorter segments.
  • UDP (User Datagram Protocol): Provides a connectionless service that is simple and fast.
    • No-Frills: It offers no reliability, no flow control, and no congestion control.

Network Layer

The Network Layer’s main job is to move its packets, called datagrams, from the source host to the destination host.

  • Input: The transport layer (TCP or UDP) gives the Network Layer a segment and the destination address.
  • Service: The Network Layer then handles the end-to-end delivery of that segment to the transport layer in the destination host.
  • Protocols:
    • IP (Internet Protocol): This is the single, required protocol for all Internet components (hosts and routers). It defines the datagram’s format and how all components must act on it. It is the “glue that binds the Internet together,” which is why this layer is often called the IP layer.
    • Routing Protocols: These are used to automatically determine the route or path that the datagrams will take between the source and destination.

The Network Layer handles the overall route, but the Link Layer handles the movement of the packet from one node (host or router) to the next adjacent node in the path. At this layer, the information packet is called a frame.

  • Process: At each step along the route, the Network Layer passes the datagram down to the Link Layer, which transmits it over that single link to the next node.
  • Dependence: The services provided by the Link Layer depend on the specific link-layer protocol being used over that particular link.
  • Examples: Common protocols include Ethernet (for wired connections), WiFi (for wireless), and DOCSIS (for cable access).
  • Crucial Note: A datagram usually travels through many different types of links (e.g., Ethernet, then PPP), and the Link Layer service may be different over each link. Some protocols offer reliable delivery over a single link, which is different from TCP’s end-to-end reliability.

Physical Layer

The Physical Layer is the most basic layer.

  • Job: While the Link Layer moves the whole frame from one node to the next, the Physical Layer moves the individual bits within the frame from one node to the next.
  • Dependence: The protocols here depend entirely on the actual transmission medium being used (e.g., twisted-pair copper wire, fiber optics). Ethernet, for example, has multiple Physical Layer protocols depending on the cable type.