Computer Networks

A phone on Wi-Fi, a school's computer lab and the Internet itself are all computer networks — devices connected so that they can share data and resources. This chapter traces how networks grew from a handful of linked university computers, classifies them by the area they cover, explains what each network device does, compares the ways devices can be wired together, and shows how every device is identified — by a fixed physical address and a logical one — and how a name such as a website address is turned into the number the network actually uses. Device-function and topology questions are the most frequent here, so learn each device by the job it does.

What a Network Is, and How Networks Evolved

A computer network is an interconnection of two or more computing devices — called nodes or hosts — so that they can exchange data and share resources such as a printer, files or an Internet connection. A network can be wired, wireless or both, and the devices on it range from computers and phones to printers and sensors.

Milestones in the growth of networks
  1. 1969
    ARPANET, funded by the US Department of Defense's ARPA, links computers at universities and research centres — the forerunner of the Internet
  2. 1971
    Ray Tomlinson sends the first e-mail between computers on a network
  3. 1983
    ARPANET switches to TCP/IP, the protocol suite the Internet still runs on
  4. 1986
    NSFNET, the US National Science Foundation's network, links research networks into a wider backbone
  5. 1989–91
    Tim Berners-Lee at CERN develops the World Wide Web — HTML, URLs and HTTP
  6. 1997
    The first Wi-Fi standard, IEEE 802.11, is published

Types of Networks: PAN, LAN, MAN, WAN

Networks by the area they cover
TypeCoversExample
PAN — Personal Area Networkthe devices around one person, within about 10 metresa phone linked to wireless earphones by Bluetooth, or to a laptop by USB
LAN — Local Area Networka room, a building or a campus, up to about a kilometre; high speed, owned by one organisationa school computer lab using Ethernet cables or Wi-Fi
MAN — Metropolitan Area Networka city or a few tens of kilometres — in effect an extended LANa cable TV network across a city
WAN — Wide Area Networka country, a continent or the world, often joining many LANs and MANsthe Internet, the largest WAN; a bank's network linking its branches

Network Devices

  • Modem (MOdulator–DEModulator): converts a computer's digital signal into an analog signal for transmission over a telephone or cable line, and the analog signal back into digital at the other end.
  • Ethernet card (NIC, network interface card): the hardware that connects a computer to a wired network; each card carries a unique physical address, its MAC address, and usually has an RJ45 socket.
  • RJ45 (Registered Jack-45): the eight-pin connector at the ends of the twisted-pair Ethernet cables used in LANs.
  • Repeater: a signal weakens as it travels along a cable (beyond about 100 metres on an Ethernet cable); a repeater regenerates it so that it can travel further.
  • Hub: connects several devices of a LAN; data arriving on one port is sent out on every other port, so all devices share the bandwidth and simultaneous transmissions can collide.
  • Switch: also connects devices of a LAN, but reads the destination (MAC) address of each frame and sends it only to the port of the intended device, which cuts unnecessary traffic and collisions.
  • Router: connects different networks — for example a LAN to the Internet — and forwards each data packet towards its destination using IP addresses, choosing a route.
  • Gateway: the entry and exit point of a network, joining networks that may use different protocols and translating between them; it is often combined with a router and a firewall.
⚠️ Hub broadcasts, switch delivers
Both connect the devices of one LAN, which is why they are paired as distractors. The hub copies everything to everyone; the switch uses the MAC address to deliver to one port. A router is the one that works between networks, by IP address.

Network Topologies

How devices can be arranged and connected
TopologyArrangementStrengthWeakness
Meshevery device linked directly to every other; n devices need n(n − 1)/2 linksvery reliable — a broken link has alternativesexpensive and complex to cable
Ringeach device linked to exactly two neighbours, forming a closed loop; data usually flows one waysimple, orderly transmissionone failed node or link can break the ring
Busall devices attached to one shared backbone cable, with terminators at its endslittle cable, cheap and easy to set upa fault in the backbone stops the whole network
Stareach device connected by its own cable to a central hub or switchone device's failure does not affect the others; easy to add devices and find faultsif the central device fails, the whole network stops
Tree (hybrid)a hierarchy of star networks joined to a common backbonescales to large organisationsdepends on the backbone and the upper levels
🧠 Counting mesh links
Each of n devices links to the other n − 1, and every link is shared by two devices, so the count is n(n − 1)/2. Six devices need 6 × 5 / 2 = 15 links, not 30 and not 36.

Identifying Nodes: MAC and IP Addresses

The MAC (Media Access Control) address is the physical address burnt into a network interface card by its manufacturer. It is 48 bits (6 bytes) long and written as 12 hexadecimal digits in pairs, such as FC:F8:AE:CE:7B:16. The first three bytes identify the manufacturer (the organisationally unique identifier) and the last three are assigned by the manufacturer to that card. A MAC address is fixed for the card and does not change when the device moves to another network.

The IP (Internet Protocol) address is a logical address given to a device on a network, and it can change when the device joins a different network. An IPv4 address is 32 bits, written as four decimal numbers from 0 to 255 separated by dots — 192.168.0.178. Because 32 bits allow only about 4.3 billion addresses, IPv6 was introduced with 128-bit addresses, written as eight groups of four hexadecimal digits separated by colons, such as 2001:0DB8:0000:0000:0000:0000:0000:0001. A useful contrast: the MAC address says who a device is, the IP address where it currently is on the network.

The Internet, the Web, and Domain Names

The Internet is the worldwide network of networks — the cables, routers and protocols that carry data between computers. The World Wide Web (WWW) is one service that runs on it: a system of interlinked web pages written in HTML, each identified by a URL (uniform resource locator) and fetched with HTTP. E-mail, file transfer and video calls also use the Internet without being part of the Web.

Computers on the Internet locate each other by IP address, but people remember names. A domain name such as ncert.nic.in is a readable name for a server; its rightmost part is the top-level domain — generic ones like .com, .org, .edu, .gov and .net, or country codes like .in. The Domain Name System (DNS) is the Internet's directory: when a browser is given a domain name, a DNS server looks it up and returns the matching IP address, a process called domain name resolution. Only then can the browser contact the web server.

Key takeaways

  • A network links nodes to share data and resources; ARPANET (1969) was the forerunner of the Internet, and Tim Berners-Lee created the Web.
  • PAN is around one person, LAN a building or campus, MAN a city, WAN a country or the world — the Internet is the largest WAN.
  • Modem converts digital ↔ analog; repeater regenerates; hub sends to all ports, switch to one by MAC; router joins networks by IP; gateway joins different protocols.
  • Mesh needs n(n − 1)/2 links; bus fails with its backbone, star with its centre, and a star survives the loss of one node.
  • MAC: 48-bit physical address, first 3 bytes the manufacturer; IPv4: 32-bit dotted decimal; IPv6: 128-bit hexadecimal with colons.
  • The Web is a service on the Internet; DNS resolves a domain name into the IP address of the server.

Practice questions (8)

Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.

  1. A cable TV operator connects homes and offices across an entire city. Which type of network is this?

    1. PAN
    2. LAN
    3. WAN
    4. MAN
    Show answer

    Answer: D — MAN

    A network spread over a city is a metropolitan area network, and a city-wide cable TV network is the book's own example of one. A LAN stops at a building or campus and a PAN at the devices around one person. A WAN spans countries or continents; calling a single city's network a WAN overshoots the scale.
  2. Which device converts a computer's digital signals into analog signals for a telephone line, and back again at the receiving end?

    1. Repeater
    2. Modem
    3. Switch
    4. RJ45 connector
    Show answer

    Answer: B — Modem

    Modem stands for modulator–demodulator: modulation turns digital data into an analog signal for the line and demodulation reverses it. A repeater regenerates a weakened signal without changing its kind, a switch forwards frames within a LAN, and an RJ45 connector is a passive plug at the end of an Ethernet cable.
  3. Which statement correctly distinguishes a hub from a switch?

    1. A hub forwards data using IP addresses, while a switch uses domain names
    2. A hub sends incoming data to all its ports; a switch sends it only to the intended device
    3. A hub connects different networks, while a switch connects devices of a single LAN
    4. A hub regenerates weak signals, while a switch converts them from digital to analog
    Show answer

    Answer: B — A hub sends incoming data to all its ports; a switch sends it only to the intended device

    Both join the devices of one LAN; the difference is delivery. A hub copies every frame to every port, so all devices share the bandwidth, while a switch reads the destination MAC address and sends the frame to one port. Forwarding by IP address between networks is a router's job, regeneration is a repeater's, and digital-to-analog conversion is a modem's.
  4. Six computers are to be connected in a full mesh topology. How many dedicated links are required?

    1. 30
    2. 36
    3. 15
    4. 6
    Show answer

    Answer: C — 15

    Each computer connects to the other five, but every link joins two computers and would otherwise be counted twice, so the total is 6 × 5 / 2 = 15. Thirty counts each link from both ends, and 36 multiplies 6 by 6 as if a computer linked to itself. Six links would be enough only for a ring.
  5. Which statement about a MAC address is correct?

    1. It is 32 bits long and changes whenever the device joins a new network
    2. It is 128 bits long and written as eight groups of hexadecimal digits
    3. It is 48 bits long, and its first three bytes identify the manufacturer
    4. It is assigned to a device by the DNS server each time it goes online
    Show answer

    Answer: C — It is 48 bits long, and its first three bytes identify the manufacturer

    A MAC address is the 48-bit physical address fixed in the network card, with the first three bytes naming the manufacturer and the last three set by it for that card. The 32-bit address that changes from network to network is an IPv4 address, and 128 bits in eight hexadecimal groups is IPv6. DNS servers translate names into IP addresses and assign nothing.
  6. Which of the following is a valid IPv4 address?

    1. 192.168.10.255
    2. 256.100.20.1
    3. 192.168.1
    4. 10.0.0.0.1
    Show answer

    Answer: A — 192.168.10.255

    An IPv4 address is 32 bits written as exactly four numbers, each from 0 to 255 because each is one byte; 192.168.10.255 meets both rules. 256 is too large for a single byte. 192.168.1 has only three parts, giving 24 bits, and 10.0.0.0.1 has five parts, more than 32 bits allow.
  7. Assertion (A): IPv6 addresses are written as groups of hexadecimal digits separated by colons. Reason (R): IPv6 was introduced because the 32-bit address space of IPv4 was running out.

    1. Both A and R are true, and R is the correct explanation of A
    2. Both A and R are true, but R is not the correct explanation of A
    3. A is true, but R is false
    4. A is false, but R is true
    Show answer

    Answer: B — Both A and R are true, but R is not the correct explanation of A

    Both statements are facts: IPv6 addresses are written in eight colon-separated hexadecimal groups, and IPv6 was created because 32 bits could not supply enough addresses. But R explains why IPv6 exists and why its addresses are longer (128 bits), not why they are written in hexadecimal with colons — that is a notation chosen to keep 128 bits readable. So R does not explain A.
  8. When a user types a website's domain name into a browser, what does the Domain Name System (DNS) do?

    1. It encrypts the page so that it cannot be read on the way
    2. It assigns a new MAC address to the user's computer
    3. It stores a copy of every web page on the Internet
    4. It translates the domain name into the IP address of the web server
    Show answer

    Answer: D — It translates the domain name into the IP address of the web server

    Computers locate a server by its IP address, so the name must first be looked up; a DNS server returns the matching IP address and only then can the browser connect. Encryption is the job of HTTPS, a MAC address is fixed in the network card and never assigned by DNS, and DNS keeps name-to-address records, not copies of pages.