1. Home
  2. Explore
  3. Computer Science
  4. How the Internet Works

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

How the Internet Works

How the Internet Works

The internet is a worldwide network of networks that allows computers, phones, servers, and other devices to exchange digital information. Although users experience the internet through websites, applications, and wireless connections, the underlying system depends on physical networking hardware, addressing systems, protocols, and routers.


1. Connecting a Home or Office to the Internet

A typical home network contains one or more devices that connect local equipment to an Internet Service Provider (ISP). An ISP is a company or organization that provides internet access, such as a cable, DSL, fiber-optic, or wireless provider.

Modems and ISP Devices

A home may receive internet service through a device known as:

  • Cable modem: Connects to an ISP using a coaxial cable network.

  • DSL modem: Uses telephone-line infrastructure for internet access.

  • Fiber-optic or FiOS device: Uses fiber-optic cables, which transmit data using light.

  • Combined gateway device: May include a modem, router, switch, Wi-Fi access point, firewall, DHCP server, and other functions in one unit.

The modem or ISP-provided device connects the home to the larger internet. The internet is often represented as a cloud because it includes an enormous number of interconnected networks, devices, and communication paths.

Home Routers

A home may require a separate router connected to the modem. The router distributes the internet connection among multiple local devices, including:

  • Smartphones

  • Laptops and desktop computers

  • Game consoles

  • Digital video recorders

  • Smart-home and Internet of Things devices

  • Printers and other networked equipment

A home router may provide:

  • Wi-Fi connectivity through internal or external antennas

  • Ethernet ports for wired devices

  • DHCP services for assigning local IP addresses

  • Routing between the home network and the wider internet

  • Firewall protection

  • Switching among local wired devices

Many modern ISP devices combine the modem and router into one unit, so a separate home router may not be necessary.


2. IP Addresses

Every device that communicates over the internet uses an Internet Protocol (IP) address. An IP address identifies the source and destination of network communications.

An IP address functions like a digital postal address: it identifies where data comes from and where it should be delivered.

IPv4 Addresses

The traditional format is IPv4, which contains four numerical sections separated by periods:

a.b.c.d\text{a.b.c.d}a.b.c.d

Each section can range from 000 through 255255255. Since each section contains 256256256 possible values, an IPv4 address contains:

8+8+8+8=32 bits8 + 8 + 8 + 8 = 32 \text{ bits}8+8+8+8=32 bits

This creates approximately:

232≈4.3 billion2^{32} \approx 4.3 \text{ billion}232≈4.3 billion

possible addresses.

Examples of IPv4-style addresses include:

  • 1.2.3.4

  • 5.6.7.8

  • 10.0.1.34

The examples are illustrative; actual addresses depend on the network and device.

Assigning IP Addresses with DHCP

Most devices do not require users to manually enter an IP address. Instead, they use DHCP, or Dynamic Host Configuration Protocol.

When a device connects to a network, it can send a request such as:

“I need an IP address.”

A DHCP server responds by providing network configuration information, commonly including:

  • An IP address

  • The subnet mask

  • The default router or gateway

  • DNS server addresses

  • Other configuration details needed for communication

An ISP may use DHCP to assign an address to the customer’s home network. The home router may then run its own DHCP service to assign addresses to devices inside the home.

Public and Private IP Addresses

A home network commonly receives one public-facing address from its ISP. The home router then assigns private addresses to individual devices within the home.

Common private IPv4 ranges include addresses beginning with:

  • 10.

  • 192.168.

  • 172.16. through 172.31.

For example, a laptop might receive the private address 10.0.1.34, while the router might use 10.0.1.1.

Private addresses are intended for use within a local network. Devices using them are generally not directly reachable from the public internet without special configuration. This is appropriate because most personal devices act as clients that initiate connections rather than public servers waiting for direct connections.

A home router commonly uses additional techniques, such as address translation, to allow many private devices to share one public internet connection.


3. IPv6 and the Growth of the Internet

The number of available IPv4 addresses is limited. The growth of:

  • Personal computers

  • Smartphones

  • Servers

  • Game consoles

  • Internet of Things devices

  • Other connected equipment

has caused the world to run short of IPv4 addresses.

IPv6 Addresses

The newer system is IPv6, which uses addresses containing 128128128 bits rather than 323232 bits.

The number of possible IPv6 addresses is:

21282^{128}2128

This is vastly larger than 2322^{32}232 and provides enough address space for the continued expansion of internet-connected devices.

IPv4 and IPv6 continue to coexist while networks gradually adopt IPv6.


4. Domain Names and DNS

IP addresses are useful to computers but difficult for humans to remember. People usually access websites through names such as:

  • facebook.com

  • google.com

  • gmail.com

  • mit.edu

These human-readable names are called domain names.

Domain Name System

The Domain Name System (DNS) translates domain names into IP addresses.

For example:

  1. A user enters a domain name into a browser.

  2. The computer asks a DNS server for the corresponding IP address.

  3. The DNS server returns an address.

  4. The computer uses that IP address to contact the destination server.

DNS is similar to a telephone directory: it associates a memorable name with a numerical address.

DNS Resolution

DNS resolution can involve several levels of servers:

  1. The device asks a configured DNS server, often supplied by the ISP or local network.

  2. If that server does not already know the answer, it asks another DNS server.

  3. Queries may move through a hierarchy of servers.

  4. Root servers can direct the query toward servers responsible for a particular top-level domain.

  5. A server responsible for the relevant domain eventually provides the destination IP address.

  6. The result is returned to the original device and may be temporarily remembered through caching.

Top-level domains include:

  • .com

  • .edu

  • .org

  • Country-code domains such as .jp

DNS allows users to work with names while the network still relies on numerical IP addresses.


5. Packets: Digital Envelopes for Network Data

Computers communicate by sending packets. A packet is a unit of digital data containing both information and control details.

Packets can be compared to physical envelopes:

  • The payload is the message or file being delivered.

  • The source address identifies the sender.

  • The destination address identifies the recipient.

  • Additional information helps networks deliver and reconstruct the data.

All information is ultimately represented as bits, or zeros and ones.

Example: Requesting an Image

Suppose a user wants a file called cat.jpeg. The request might conceptually contain:

  • A request such as “get cat.jpeg”

  • The sender’s IP address

  • The destination server’s IP address

  • A port number identifying the intended service

  • Protocol information describing how the message should be interpreted

The request is placed into one or more packets and sent through the network to the server.

Responses and Fragmentation

A response may be too large to fit conveniently into one packet. For example, a large image could be divided into several smaller pieces called fragments.

Each fragment contains enough information to help the receiving computer reconstruct the original data. It may indicate:

  • The source and destination

  • Its position in the overall response

  • The total number of pieces

  • Sequence or identification information

For example, four packets could be labeled:

  • Packet 111 of 444

  • Packet 222 of 444

  • Packet 333 of 444

  • Packet 444 of 444

The packets may arrive out of order. Once all pieces arrive, the receiving computer reassembles them into the original image.


6. IP and TCP

The term TCP/IP refers to the common combination of two important protocols:

  • IP: Internet Protocol

  • TCP: Transmission Control Protocol

A protocol is an agreed set of rules and conventions that allows communicating systems to understand one another and respond predictably.

Human interactions also follow protocols. For example, a handshake follows a recognizable sequence: one person extends a hand, the other responds, and both complete the interaction. Computer protocols perform the same general function in digital communication.

Functions of IP

IP is responsible for important tasks such as:

  • Addressing devices

  • Identifying packet sources and destinations

  • Supporting packet forwarding

  • Supporting fragmentation and reassembly information

  • Defining conventions that networked devices follow

IP alone does not guarantee that every packet will arrive.

Functions of TCP

TCP adds reliability and organization to communication. It can:

  • Number data segments

  • Track which packets have arrived

  • Detect missing packets

  • Request retransmission of missing data

  • Reassemble data in the correct order

  • Confirm successful receipt through acknowledgments

If a computer receives packets 222, 333, and 444 of a four-packet response but not packet 111, TCP can determine that packet 111 is missing and request that it be sent again.

TCP therefore provides reliable, ordered delivery, assuming the connection remains usable and the communicating endpoints can continue exchanging information.


7. Ports and Network Services

An IP address identifies a computer, but a single computer may provide many different services. For example, one organization may operate:

  • Web servers

  • Email servers

  • Chat servers

  • Video-conferencing servers

  • File-transfer servers

A packet therefore needs more than an IP address. It also needs a port number, which identifies the particular service or application intended to receive the data.

A port can be thought of as a virtual doorway into a computer.

Common Ports

Some commonly associated ports include:

  • Port 80: HTTP, the standard protocol for ordinary web traffic

  • Port 443: HTTPS, encrypted web traffic using secure connections

  • Port 25: Traditionally associated with email transmission through SMTP

  • Other ports: Used by FTP, chat systems, games, databases, and many other services

A destination may therefore be represented conceptually as:

IP address:port\text{IP address:port}IP address:port

For example, a web request might be directed to port 808080 or port 443443443 on a server.

HTTP and HTTPS

HTTP, or Hypertext Transfer Protocol, is the language used by web clients and web servers to communicate.

A browser sends an HTTP request, such as a request for a particular image or webpage. The web server interprets the request and returns an HTTP response.

HTTPS provides a secure version of web communication. Modern browsers commonly use HTTPS and port 443443443 by default, even though users generally do not type the port number manually.


8. TCP Versus UDP

Not every application needs TCP’s reliability mechanisms. Another transport protocol is UDP, or User Datagram Protocol.

TCP

TCP is appropriate when every part of the data matters. It:

  • Ensures delivery through acknowledgments and retransmissions

  • Preserves ordering

  • Detects missing packets

  • Can introduce delays when lost data must be resent

Typical uses include:

  • Web pages

  • File transfers

  • Email

  • Important application data

  • Downloads where missing information would corrupt the result

UDP

UDP does not guarantee delivery. It sends data without requiring the same acknowledgment and retransmission process used by TCP.

UDP can be useful when:

  • Low delay is more important than perfect accuracy

  • Data arrives continuously

  • A lost packet is less harmful than waiting for a retransmission

  • The application can tolerate or compensate for missing information

Typical situations include:

  • Live video conferencing

  • Voice communication

  • Live sporting events

  • Real-time games

  • Other time-sensitive streams

Why Lost Packets Can Be Acceptable

In a live conversation, waiting for every missing packet could cause long pauses and make the interaction feel unnatural. If a small portion of a video or audio stream is lost, the application may:

  • Infer the missing information

  • Briefly distort the image or sound

  • Ask the speaker to repeat something

  • Continue displaying newer data rather than waiting

By contrast, a movie streamed for later viewing can buffer in advance. It is usually better for a movie player to pause temporarily than to permanently lose an important scene. Thus, the choice between TCP and UDP depends on whether an application values reliability or immediacy more strongly.


9. Routers and Routing

Packets usually do not travel directly from a personal device to the destination server. They pass through many intermediate devices called routers.

A router examines packet information and forwards each packet toward its destination.

Routing Tables

Routers maintain routing tables. Conceptually, a routing table contains:

  • An IP address or address prefix

  • The next destination or interface through which traffic should be sent

For example, a router might determine that:

  • Addresses beginning with one prefix should leave through one connection.

  • Addresses beginning with another prefix should leave through a different connection.

The router does not necessarily know the complete route from the source to the final destination. It generally chooses a next hop, which is another router. That router then makes its own forwarding decision.

Hops

Each movement from one router to another is called a hop. A packet may travel through several routers before reaching its destination.

In many ordinary situations, a destination can be reached in roughly a few dozen hops or fewer, although the actual number depends on:

  • Physical distance

  • Network configuration

  • Routing policies

  • Congestion

  • Failures

  • The location of the destination servers

Dynamic Routing

Internet routes can change dynamically. Routers may select different paths when:

  • A link fails

  • A router becomes overloaded

  • A shorter or faster path becomes available

  • Network operators change routing policies

This flexibility allows the internet to continue operating even when individual components experience problems.


10. The Internet as a Network of Networks

The internet is not one single network owned and operated by one organization. It is a collection of interconnected networks operated by:

  • ISPs

  • Universities

  • Businesses

  • Governments

  • Data centers

  • Cloud providers

  • Research organizations

These organizations connect their routers and networks to one another. The result is a network of networks.

Connections may use:

  • Copper cables

  • Fiber-optic cables

  • Radio waves

  • Microwave links

  • Satellite communication

  • Large undersea cables

Redundancy and Resilience

There are often multiple possible paths between two locations. This redundancy is important because it allows traffic to be rerouted if one path becomes unavailable.

The internet’s design emphasizes resilience. If a router, city, cable, or other network component fails, packets may be sent along another route.

Different packets belonging to the same response may take different paths. For example, four fragments of an image could travel through separate sequences of routers and still arrive at the same destination. TCP can help the receiving computer reorder and verify them.

Congestion and Packet Loss

Routers have limited capacity. When too much traffic arrives, they may become congested. A congested router can:

  • Delay packets

  • Select a different route

  • Store packets temporarily in a queue

  • Drop packets when its buffers are full

Packet loss is not always visible to users. If TCP is being used, missing packets can be retransmitted. If UDP is being used, the application may continue without them.


11. Measuring Routes with Traceroute

Traceroute is a network diagnostic tool that reveals information about the path between a local computer and a destination.

It can report:

  • The sequence of intermediate routers

  • Router IP addresses

  • Router names, when available

  • The approximate time required to reach each step

  • The number of hops to the destination or to the last responding router

Interpreting Traceroute Output

Traceroute output is typically organized into numbered rows. Each row corresponds to a hop.

The measured time at a row generally represents the time from the original computer to that router, not simply the additional time from the previous row. The times may vary because routers and network links experience different loads.

Asterisks may appear when a router does not respond to traceroute probes. This does not necessarily mean that the route is broken. Some routers are configured to ignore or deprioritize diagnostic requests while continuing to forward ordinary traffic.

Geographic and Organizational Clues

Router names can sometimes reveal:

  • The organization operating the router

  • A university or ISP network

  • A city or region

  • An airport code

  • A core or border gateway

  • A peering point where networks interconnect

However, these names are clues rather than guarantees. A router’s name may be outdated, abbreviated, or unrelated to its exact physical location.

Latency

Network latency is the time required for data to travel between points. Nearby routers may respond within a few milliseconds, while long-distance links may take much longer.

A traceroute across a continent may still complete in a small fraction of a second. A route crossing an ocean often shows a noticeable increase in latency because the signal must travel through a long physical link, such as:

  • A transoceanic fiber-optic cable

  • A satellite connection

  • A microwave system

  • Another long-distance communication system

The internet can therefore connect locations thousands of miles apart with delays measured in milliseconds.


12. Content Delivery Networks and Server Location

The organization associated with a website’s domain name does not necessarily operate the physical server that answers every request.

A website may use a Content Delivery Network (CDN). A CDN hosts copies or components of websites at multiple locations so that users can be served from a nearby or efficient server.

Consequences include:

  • A website’s server may be located in a different city or country from the organization.

  • A domain name may resolve to different IP addresses at different times or for different users.

  • A website may be hosted by a third-party infrastructure company.

  • The fastest route to a website may not lead directly to the organization’s headquarters or campus.

DNS and routing work together to direct a user to an appropriate server, wherever that server is physically located.


13. Physical Networking Hardware

Although internet communication involves sophisticated software and protocols, it ultimately depends on physical devices and transmission media.

Coaxial Connectors

A cable modem may connect to the wall through a coaxial cable. Coaxial cables commonly have:

  • A cylindrical connector

  • A central conducting pin

  • Shielding around the signal-carrying conductor

  • A threaded connection in many designs

Cable television and cable internet services commonly use coaxial infrastructure.

RJ11 Connectors

RJ11 connectors are the smaller connectors traditionally used for telephone service. They are narrower than Ethernet connectors and may be found on:

  • Landline telephones

  • Telephone wall outlets

  • Some ISP gateway devices that provide voice service

RJ45 Connectors and Ethernet

RJ45 connectors are wider connectors generally used with Ethernet network cables. They connect wired devices such as:

  • Desktop computers

  • Game consoles

  • Network switches

  • Routers

  • Cable modems

  • Network printers

Ethernet cables contain multiple wires. Different wires can be used for:

  • Transmitting data

  • Receiving data

  • Reducing interference

  • Electrical balancing

  • Signal isolation

The wiring arrangement must be compatible at both ends of the cable for the connected devices to communicate correctly.

Fiber-Optic Cables

Fiber-optic cables carry information through strands that transmit light. Compared with copper cables, fiber can support:

  • Very high data rates

  • Long-distance communication

  • Low signal loss

  • Resistance to electromagnetic interference

Fiber is widely used in major internet links and increasingly in connections to homes and businesses.


14. Modems, Switches, and Routers

Different networking devices perform different functions, although modern consumer equipment often combines several roles.

Modem

A modem connects a local network to the infrastructure of an ISP. Depending on the service, it may connect through:

  • Coaxial cable

  • Telephone wiring

  • Fiber optics

  • Another access technology

A basic modem may provide only one Ethernet port and depend on a separate router for local networking.

Switch

A switch connects multiple wired devices within a local network. It generally has several RJ45 Ethernet ports.

A switch:

  • Receives Ethernet traffic

  • Determines which connected port should receive it

  • Connects multiple wired devices

  • Expands the number of available network connections

Unlike a router, a basic switch does not normally determine how traffic should travel across the wider internet.

Home Router

A home router connects the local network to the ISP and commonly includes:

  • Routing

  • Wi-Fi

  • Ethernet switching

  • DHCP

  • Firewall functions

  • Sometimes modem functionality

A router may have:

  • One port for connection to the modem or ISP

  • Several Ethernet ports for local wired devices

  • Antennas or internal radios for Wi-Fi

The exact combination of equipment required depends on the ISP, the home layout, the number of devices, and whether wired or wireless connections are needed.


15. Network Protocols as Layers of Abstraction

The internet works through layers of interacting technologies.

At the physical level:

  • Copper wires carry electrical signals.

  • Fiber carries light.

  • Wireless systems carry radio waves.

Above the physical layer:

  • Ethernet and Wi-Fi organize local communication.

  • IP supplies addressing and packet-delivery conventions.

  • TCP or UDP provides transport behavior.

  • DNS translates names into addresses.

  • HTTP or HTTPS defines web communication.

  • Applications interpret the data for users.

Each layer provides services to the layer above it. This layering hides complexity. A user requesting an image does not need to know which cables, routers, protocols, or data centers carry the request. The software and hardware cooperate to transform an application request into bits, transport those bits, and reconstruct the result at the destination.

The apparent simplicity of using a website depends on many layers of hardware, software, addresses, protocols, and routing decisions working together.

The internet ultimately carries data through physical media, but protocols make those raw signals useful by defining how devices identify one another, divide data into packets, forward information, recover from loss, select services, and reassemble complete messages.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent