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

Speaker 1Speaker 2

How the Internet Works

12:54
0:00-12:54
  1. Anna

    We use the internet constantly, but what actually happens when a phone, laptop, Xbox, or desktop gets online? Let's start at home. Usually, your home has some kind of connection device supplied by an internet service provider, or ISP—perhaps a cable modem, DSL modem, or FiOS device.

  2. Hope

    And that device connects your home to the internet. Sometimes it also includes the home router, Wi-Fi, and other networking features, so one box does everything. In other setups, the modem connects to a separate home router, which provides wireless access and may also have physical ports for wired devices.

  3. Anna

    Those wired devices might include a DVR, Xbox, or desktop computer. The router can have antennas for Wi-Fi, while its Ethernet ports let devices connect with cables. So the basic arrangement is either one combined modem-router or a modem connected to a separate router.

  4. Hope

    But how does data know which computer or phone it should reach? The key idea is an IP address, short for Internet Protocol address. In the familiar IPv4 format, it looks like four numbers separated by dots, with each number ranging from 0 through 255.

  5. Anna

    That makes an IP address like a postal address for a device. A laptop, desktop, phone, Xbox, or server connected to the internet has an address that lets other computers communicate with it. The numbers identify the destination in much the same way that a street address identifies a particular building.

  6. Hope

    Most people do not manually type an IP address into every device. Instead, a service called DHCP—Dynamic Host Configuration Protocol—automatically provides one. When a device turns on, it effectively asks for an address, and a DHCP server responds with an address that has been allocated for it.

  7. Anna

    Your ISP can provide an IP address for your home connection. Then the home router often runs its own DHCP service for the devices inside the home. So your laptop and phone can each receive an address from the router, even if the ISP has provided only one address for the household's connection.

  8. Hope

    That explains how several family members can be online simultaneously. The router gives the devices local network information and also tells them how to communicate with the outside world. It may provide DNS information too, which brings us to the difference between names and numbers.

  9. Anna

    People prefer names such as Facebook.com, Gmail.com, or Google.com, rather than arbitrary numbers. DNS stands for Domain Name System, and DNS servers convert those domain names into the corresponding IP addresses that computers use.

  10. Hope

    DHCP can provide a device with access to DNS servers, often operated by the ISP. If one DNS server does not know an answer, the request can be passed to another. The system is recursive and tiered, and root servers can help direct queries toward the servers responsible for particular top-level domains such as dot-com or dot-edu.

  11. Anna

    Once a computer knows the destination IP address, it sends data in packets. A packet is like a digital envelope: it contains data along with addressing information. For example, a request for a cat image could contain a message such as, 'Get me cat dot jpeg.'

  12. Hope

    The request would include the sender's IP address and the server's destination IP address. If the computer starts at 1.2.3.4 and the server is at 5.6.7.8, the packet identifies that it is going from the first address to the second. The actual data, though, is represented as bits—zeros and ones.

  13. Anna

    The response can be divided into multiple packets. A large cat image might not fit conveniently into one packet, and splitting it also avoids letting one customer's large file block other data. The server can divide the image into fragments and place those fragments into separate envelopes.

  14. Hope

    Each response packet carries the same source and destination addresses, but it also needs information about its place in the whole response. Labels such as one of four, two of four, three of four, and four of four let the receiving computer determine which pieces it has and which one is missing.

  15. Anna

    IP is more than a system of addresses. It is a protocol—a set of conventions that computers agree to follow. IP handles addressing and supports fragmentation, but IP alone does not guarantee that every packet arrives or explain what to do when one is missing.

  16. Hope

    That is where TCP comes in. TCP means Transmission Control Protocol, and TCP and IP are often discussed together as TCP/IP. TCP uses sequence numbers and acknowledgments to help ensure that data arrives, arrives in the right order, and can be reassembled.

  17. Anna

    So if the receiver gets packets two, three, and four but not packet one, TCP can identify the missing data and request a retransmission. Once all the pieces arrive, the computer can stitch the bits back together so the user sees the complete image rather than noticing that it traveled in separate pieces.

  18. Hope

    TCP also helps identify the particular service that should receive a packet. An IP address tells the network which computer to reach, but a computer such as Google may provide web pages, email, chat, and video services. The packet needs another identifier for the intended service.

  19. Anna

    That identifier is a port number. TCP port 80 is traditionally associated with HTTP, the Hypertext Transfer Protocol used by web servers. Modern secure web connections use HTTPS, commonly associated with port 443, while email and file transfer use other standardized port numbers.

  20. Hope

    So a packet can be thought of as carrying a destination IP address, a source IP address, a port number, and the message itself. The IP address gets the packet to the right machine, and the port helps the machine deliver it to the right application or service.

  21. Anna

    HTTP is another protocol, meaning another set of rules. A web browser sends an HTTP request, and a web server that understands HTTP knows how to interpret the request and return an HTTP response. It is similar to a human protocol such as shaking hands: both sides follow agreed conventions so the exchange makes sense.

  22. Hope

    TCP is not the only transport protocol. UDP, or User Datagram Protocol, can also be used with IP, but it does not guarantee delivery in the way TCP does. UDP does not automatically retransmit missing packets.

  23. Anna

    That apparent weakness can be useful. In live video conferencing, a delayed retransmission may be worse than a brief missing piece of audio or video. If every lost packet caused the conversation to pause and buffer, real-time communication would become frustrating.

  24. Hope

    For a movie or a streaming program, buffering can be acceptable because viewers would rather wait than miss part of the story. For a live conversation or sporting event, applications may prefer to keep the data flowing, tolerate a few missing packets, and continue in real time.

  25. Anna

    Now, packets do not travel directly from your laptop to a distant server in one giant leap. They pass through routers. A router has multiple connections and a routing table—conceptually a list that matches an IP address or address prefix with the direction or next router where the packet should go.

  26. Hope

    Your computer may know the address of its local router, sometimes called its gateway, but it does not need to know the entire path to Google. It sends the packet to the gateway, and each router forwards it to the next hop. After enough hops, the packet reaches its destination.

  27. Anna

    The internet is therefore a network of networks. Universities, ISPs, companies, and other organizations operate networks containing routers, and those networks connect to one another through cables, radio, satellite links, and other technologies.

  28. Hope

    There are often multiple possible paths between two locations. That redundancy makes the internet more resilient: if a router or connection fails, data can potentially be routed around it. Different packets in the same response might even take different paths and still arrive at the same destination.

  29. Anna

    Traffic can also make routers busy. A router may send packets along another route, or in extreme cases drop packets when overwhelmed. With TCP, missing packets can be retransmitted, so the loss may be hidden from the user, although it can contribute to delay.

  30. Hope

    A tool called traceroute shows this process. It sends messages toward a destination and reports the routers along the route, along with timing information. A route to a nearby destination might involve only a handful of hops, while a route across the United States can involve many more.

  31. Anna

    The timing can be remarkably small. In the examples, a path from Cambridge, Massachusetts, to Berkeley, California, took about 80 milliseconds, while a nearby MIT destination took only a few milliseconds. The measurements can vary because routers and connections are busier at some times than others.

  32. Hope

    Traceroute can also reveal that a website's servers are not necessarily located where you imagine. A request for MIT's website, for example, could reach servers operated by Akamai, a content delivery network, even though MIT itself is nearby. DNS and routing allow your computer to reach the actual servers wherever they are.

  33. Anna

    A route to a destination in Japan illustrated a much larger delay after the path reached the west coast of the United States. That kind of jump can reflect the distance across the Pacific Ocean. Internet traffic crosses oceans through transoceanic cables, and sometimes through satellite, microwave, or other links.

  34. Hope

    Let's return to IP address capacity. The familiar IPv4 address has four groups of eight bits, for 32 bits total. That allows two to the 32 possible addresses—roughly four billion—but the huge number of phones, servers, laptops, and Internet of Things devices has made that supply insufficient.

  35. Anna

    The longer format is IPv6, or IP Version 6. It uses 128-bit addresses, creating an enormously larger address space. The world is gradually moving toward IPv6 as IPv4 addresses become scarce.

  36. Hope

    Not every address you see is publicly reachable. Addresses beginning with 10, with 192.168, or within 172.16 are private addresses commonly used inside homes, businesses, and schools. Devices on those networks generally initiate connections outward rather than acting as servers that strangers contact directly.

  37. Anna

    Network settings can show these details. A computer may display its IPv4 address, the fact that it received the address through DHCP, a subnet mask, DNS servers, and a router or gateway. The subnet mask helps determine whether another computer is on the same local network.

  38. Hope

    For example, a computer might have the private address 10.0.1.34 and a router at 10.0.1.1. The router connects local devices to one another and forwards traffic intended for the outside world.

  39. Anna

    The physical equipment makes all of this possible too. A cable modem may connect to the wall with a coaxial cable, the type traditionally used for television and cable connections. It can also have RJ11 phone jacks and wider RJ45 Ethernet jacks.

  40. Hope

    RJ11 connectors are used for telephone connections, while RJ45 jacks are used with Ethernet network cables. Ethernet cables contain multiple wires, and the arrangement of those wires lets devices transmit and receive electrical signals while helping reduce interference.

  41. Anna

    Some modems include Wi-Fi, DHCP, DNS support, switching, and routing, so one device can provide nearly everything a home needs. Other setups use a small modem connected to a separate router, and a switch can add more wired Ethernet ports.

  42. Hope

    A switch is relatively simple: it moves traffic among its ports based on which devices are communicating. A home router is more capable, often combining switching, Wi-Fi, routing, and firewall features, with one connection toward the modem and several connections for local devices.

  43. Anna

    There are also fiber-optic connections, in which light travels through strands rather than electrical signals through copper wires. Whether the connection uses coaxial cable, Ethernet, fiber, wireless radio, or another technology, the physical layer carries the bits while layers of protocols organize what those bits mean.

  44. Hope

    So the full journey looks like this: DHCP gives a device network information, DNS translates a human-friendly domain name into an IP address, TCP or UDP carries application data over IP, routers forward packets across interconnected networks, and the receiving device uses the protocol information to deliver and reconstruct the data.

  45. Anna

    And that is why a simple action like requesting a cat image can involve a home router, DNS servers, multiple routers across the world, packet fragmentation, port numbers, and perhaps TCP retransmission—yet all you experience is a picture appearing on your screen.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent