Home / Computer Science / Class XII / Computer Networks
Computer Networks — CUET Computer Science hero
Class XII 💻 Computer Science Ch 10 of 20

Computer Networks

CUET unit: Computer Networks

📌 Snapshot

  • How computers talk to each other: network types, devices, topologies, addresses and the web, compared in tables.
  • Hub versus switch, router versus gateway, MAC versus IP, and the Internet versus the Web, each in one comparison.
  • Worked examples: cables needed in mesh, star and bus, checking IP addresses, reading a URL and following a DNS lookup.
  • The five topologies with their strengths, weaknesses and what happens when a device fails.

📖 Detailed Notes

Written and reviewed by Rohit Singh, Computer Science & Commerce faculty at UniDrill (MCA, Osmania University · 6 years teaching). Based on NCERT Computer Science Class XII, Chapter 10.

What happens in the half second between typing a web address and seeing the page?

Your phone has no idea where the website lives. It asks a name server for the number behind the name, sends small chunks of data through a router, past an ISP, across regional and national networks, and the answer comes back the same way. Every step is a device or an address that this chapter names: a node, a modem, a switch, a router, a MAC address, an IP address, a DNS server. Learn what each one does and how it differs from its look-alike, because the exam asks exactly those differences.

What is a network?

A computer network is an interconnection of two or more computers or computing devices, so that they can share data and resources such as a printer or storage. The devices on it are called hosts or nodes: servers, desktops, laptops, mobile phones and also networking devices like switches and routers. A node is any device on the network that can receive, create, store or send data along network routes, for example a modem, hub, bridge, switch, router, printer, computer or server.

Data in a network is broken into smaller chunks called packets, which are carried over the network. Devices may be joined by wired media (cables) or wireless media (air). A hotspot made from a smartphone, with a few devices connected, is a small personal network.

How networking grew

Time Milestone
1960s A research project of the US Department of Defence (ARPANET) is started to connect academic and research institutions for scientific collaboration
1969 ARPANET becomes functional, connecting UCLA and Stanford Research Institute (SRI); the first message is sent between them
1971 E-mail is developed (the @ symbol comes to mean "at")
1974 The term "Internet" is coined; first commercial use of ARPANET starts as Telenet
Early 1980s TCP/IP becomes the standard protocol on ARPANET; the Domain Name System is introduced
1986 The National Science Foundation brings connectivity to more people through NSFNET
1990 Tim Berners-Lee at CERN develops HTML and URL, giving birth to the World Wide Web
1997 The first version of the Wi-Fi (802.11) standard is introduced

Types of networks

Networks are classified by the area they cover and their data transfer rate.

Feature PAN LAN MAN WAN
Full form Personal Area Network Local Area Network Metropolitan Area Network Wide Area Network
Area covered About 10 metres around a person A room, floor, office, school, campus; up to about 1 km A city or town; up to about 30 to 40 km Different cities, countries or continents
Speed Short range links High: 10 Mbps (Ethernet) to 1000 Mbps (Gigabit Ethernet) Mbps, but considerably lower than LAN Usually lower than a LAN
Medium Wired (USB) or wireless (Bluetooth, giving a WPAN) Cables, Ethernet, fibre optic, Wi-Fi Cables and others Wired or wireless links between LANs and MANs
Examples Phone to laptop by USB; two smartphones by Bluetooth School computer lab, office network Cable TV network, cable based broadband Banks linking branches worldwide; the Internet

A LAN is comparatively secure, since only authentic users can reach the shared resources, and it gives fast short range transfer. Many LANs joined together can form a MAN. A LAN joined to other LANs forms a WAN, and the Internet is the largest WAN, connecting billions of computers, smartphones and millions of LANs.

Worked example: why megabits matter. Speeds are given in Mbps, which is megabits per second, not megabytes. 1 byte is 8 bits. How long does a 50 MB file take on a 100 Mbps LAN (ignoring overheads)?

Step Working Result
Convert size to bits $50 \times 8$ 400 megabits
Divide by speed $400 / 100$ 4 seconds

The wrong step is dividing 50 by 100 and getting half a second.

Network devices

Device What it does The fact the exam asks
Modem MOdulator DEModulator: converts digital data to analog signals at the sender and back to digital at the receiver A modem sits at both ends of the link
Ethernet card (NIC) Network adapter, a circuit board on the motherboard that sets up a wired network Supports 10 Mbps to 1 Gbps; each NIC has a unique MAC address
RJ45 Eight pin connector at the end of Ethernet cables Plugs into the RJ45 jack of the Ethernet card
Repeater Regenerates weakened signals and puts them back on the cable An analog device; signals fade after about 100 m
Hub Connects devices by wires; data arriving on one line goes out on all the others Collisions happen if two devices send at once
Switch Reads the destination address of a packet and looks it up in a table, so it sends only to the selected device Can forward many packets at once; drops noisy or corrupted signals and asks for a resend
Router Receives data, analyses it and passes it to other networks; connects a LAN to the Internet Can repackage packets (smaller sizes) for a different type of network; may be wired or wireless
Gateway The entry and exit point between a network and the outside world All traffic in or out passes through it; firewall is usually integrated

Hub versus switch, the favourite comparison. Suppose computers A, B, C and D are connected, and A sends a packet meant for B.

Hub Switch
Who receives the packet B, C and D (all other ports) Only B
Can A and C send at the same time? No, their data collide Yes, multiple packets are forwarded at once
Handles faulty signals Passes them on Drops them and asks the sender to resend
How it decides It doesn't; it broadcasts Looks up the destination address in a table

Pause and predict: Four computers are connected to a hub. A sends a packet to B. How many computers other than A receive the packet at their port, and how many would receive it if a switch were used?

Check your answer: Three (B, C, D) with a hub, because it sends the packet out on all other lines. One (B) with a switch, which looks up the destination address and forwards only there.

A home Wi-Fi box is often a modem, router and switch (and wireless access point) in one: it connects to the incoming broadband line from the ISP and turns the signal into digital data your devices can use. A router is generally configured to act as the gateway, though a gateway can be software, hardware or a combination. The router moves packets between networks; the gateway is the doorway a network uses to reach others.

Beyond the textbook. For the exam: a hub broadcasts and a switch forwards to a selected device. In reality: hubs have largely disappeared from homes and offices because switches do the same job without collisions. Today's "star" networks are almost always built around a switch.

Network topologies

The arrangement of computers and other devices in a network is its topology. Five are common.

Topology How devices are joined Strengths Weaknesses
Mesh Every device is connected to every other device Many nodes can send at once; reliable because one failed node does not break the others; more secure since each cable carries different data Complex wiring, high cost, many redundant connections
Ring Each node connects to two others, one on each side, forming a ring; the link is unidirectional (data goes one way only) Each node has just two neighbours Less secure and less reliable
Bus All devices share one backbone wire (the bus); data goes both ways along the bus and any node can receive it Cheap, easy to maintain Less secure and less reliable
Star Every device is connected to a central device such as a hub or switch Effective, efficient and fast; trouble in one device does not affect the rest If the central device fails, the whole network fails
Tree or hybrid Hierarchical: branches, each of which can be a star, ring or bus; common in WANs linking LANs Scales to many nodes; data from the source reaches the central device and then each branch More complex to set up

The central node of a star can be a broadcasting device (a hub, which sends to all) or a unicast device (a switch, which identifies the destination and sends only to it).

Worked example: how many cables? A computer lab has 5 computers. A fully connected mesh needs $\dfrac{n(n-1)}{2}$ cables for $n$ nodes.

Topology Calculation Cables
Mesh $\dfrac{5 \times 4}{2}$ 10
Star One cable from each computer to the switch 5
Bus One backbone, plus one connection from each computer 1 backbone and 5 connections

Doubling to 10 computers makes the mesh need $\dfrac{10 \times 9}{2} = 45$ cables, while a star needs only 10. That growth is why mesh is costly and star is popular.

Pause and predict: In a simple bus network and in a simple ring network, one ordinary computer stops working. Which network is more likely to be disrupted?

Check your answer: The ring. Data in a ring moves one way and passes through the nodes, so a dead node or a broken link can stop the circulation. In a bus, the failed computer simply stops talking, while the shared backbone still connects the rest (a break in the backbone itself would cut the network).

Situation Suitable topology Reason
A small office where speed and easy fault finding matter Star Each device has its own link; one failure leaves the rest running
A very small network on a tight budget Bus Single shared wire is cheapest
A system where continuous operation is critical and cost is secondary Mesh Redundant paths keep traffic flowing
A company joining several LANs of different kinds Tree or hybrid Branches can each use star, ring or bus

Identifying nodes: MAC and IP addresses

Each node needs a unique identity so that devices can tell who sent data and who should get it.

Feature MAC address IP address
Full form Media Access Control address Internet Protocol address
Also called Physical or hardware address Logical address on a network using the Internet Protocol
Tied to The network adapter (NIC) The node's current network
Set when Engraved on the NIC at manufacture Assigned when the node joins a network
Changes? Permanent Can change if the node moves to another network
Size 12 hexadecimal digits, 48 bits: first 6 digits (24 bits) are the manufacturer ID (OUI), last 6 digits (24 bits) are the card's serial number IPv4: 32 bits; IPv6: 128 bits

The IPv4 address is four numbers separated by periods, each the decimal value of an 8 bit binary number, so each is between 0 and 255. A sample is 192.168.0.178. Since 32 bits give $2^{32} = 4{,}294{,}967{,}296$ addresses, just under 4.3 billion, the supply ran short as more devices came online, and IPv6 was proposed. An IPv6 address is eight groups of hexadecimal numbers separated by colons, for example 2001:CDBA:0000:0000:0000:0000:3257:9652. Eight groups of four hexadecimal digits are 32 digits, and at 4 bits each that is 128 bits.

Worked example: is it a valid IPv4 address?

Address Valid? Reason
192.168.0.178 Yes Four numbers, each between 0 and 255
256.10.1.1 No 256 is greater than 255, which an 8 bit number cannot hold
192.168.1 No Only three numbers; IPv4 needs four
10.0.0.255 Yes 255 is the largest allowed value

Beyond the textbook. For the exam: a MAC address is permanent and cannot be changed. In reality: the number burned into a network card is permanent, but software can present a different one, and many modern phones deliberately use changing "random" addresses on Wi-Fi to make tracking harder. For the exam, the answer is still that the MAC address is permanent. The MAC is the identity of the card, and the IP address is the identity of the node on a particular network.

Beyond the textbook. For the exam: IPv6 is written as eight groups of hexadecimal digits. In reality: long IPv6 addresses are usually shortened by dropping leading zeros and replacing one run of all zero groups by a double colon, so the example above is written 2001:CDBA::3257:9652. The shortening is for people, and the address is still 128 bits.

The Internet, the Web and IoT

The Internet is the global network of computing devices: desktops, laptops, servers, tablets, phones, printers, scanners, routers, switches, gateways, and also smart TVs, ACs, lights, drones, vehicles, door locks and security cameras (the Internet of Things). A computer connects through a modem, wired or wireless, to a local ISP (Internet service provider). ISPs connect to form regional networks, regional networks join into national networks, and national networks together form the Internet backbone.

The World Wide Web (WWW) is a vast collection of interlinked web pages and web resources, accessed through the Internet. It was invented in 1990 by Sir Tim Berners-Lee, who defined three technologies.

Technology Full form Job
HTML HyperText Markup Language Designs standardised web pages so they can be read on any computer
URI (URL) Uniform Resource Identifier (Uniform Resource Locator) Unique address of each web resource
HTTP HyperText Transfer Protocol Rules for retrieving linked web pages; HTTPS is the more secure version
Feature Internet Web
What it is The global network of connected computers The collection of web pages stored on some of those computers
Needs Cables, wireless links, devices The Internet, HTTP, HTML and URLs
Without the other Can exist without any web page Cannot be reached without the Internet
Examples Email and video calls use it Browsing a website

Worked example: reading a URL. Take http://www.ncert.nic.in/textbook/textbook.htm.

Part Value Meaning
Protocol http The rules used to fetch the page (HTTPS if secure)
Domain name www.ncert.nic.in The name of the server hosting the site
Path /textbook/textbook.htm The particular resource on that server

A URL is not just the domain name. It carries the extra information that completes the web address.

Domain Name System (DNS)

Every server has an IP address, but numbers are hard to remember, so each server is also given a domain name (or hostname) such as wikipedia.org. The DNS works like a phone book: it matches names to numbers. Converting a domain name into its IP address is called domain name resolution, and it is done by a DNS server.

Worked example: following a request.

Step What happens
1 You type www.ncert.nic.in in the browser
2 HTTP asks a DNS server for the IP address that goes with that name
3 The DNS server replies with the address (for example 164.100.60.233)
4 HTTP uses that address to fetch the page, which loads in the browser

DNS servers are arranged in a hierarchy. At the top are 13 root servers, with other DNS servers below them. A DNS server either holds the IP address for a domain or holds the address of another DNS server where the entry can be found.

Exam traps

The trap Why it's tempting The truth
"The Internet and the Web are the same." People use them interchangeably The Internet is the network; the Web is the pages accessible over it
"A repeater is a digital device." Modern networks are digital A repeater is an analog device that regenerates signals
"A hub sends data only to the destination." It connects computers like a switch A hub sends to all other ports; a switch sends to the selected device
"The IP address of a node never changes." MAC address is permanent, so IP seems so too IP can change when the node joins another network
"A fully connected mesh of n nodes needs n cables." Each node seems to need one It needs $n(n-1)/2$ cables
"In a star network, the failure of any device stops the whole network." One failure sounds fatal Only the failure of the central device does that
"Mbps means megabytes per second." Files are measured in MB Mbps is megabits per second
"MAN is the biggest network." It sounds large The order is PAN, LAN, MAN, WAN; the Internet is the largest WAN

60-second revision

Topic Lock this in
Network 2 or more devices sharing data and resources; packets; nodes
Types PAN (about 10 m), LAN (up to about 1 km, 10 to 1000 Mbps), MAN (up to about 30 to 40 km, cable TV), WAN (Internet)
Modem Modulator-demodulator: digital to analog and back
NIC Wired adapter with a MAC address; 10 Mbps to 1 Gbps
Repeater / hub / switch Regenerates signal (about 100 m) / broadcasts to all / forwards to the destination only
Router / gateway Connects LAN to Internet, repackages packets / entry and exit point
Topologies Mesh, ring, bus, star, tree (hybrid)
Mesh cables $n(n-1)/2$
MAC 48 bits, 12 hex digits, first 24 bits OUI, permanent
IPv4 / IPv6 32 bits, four numbers 0 to 255 / 128 bits, eight hex groups
Web technologies HTML, URI (URL), HTTP (HTTPS) by Tim Berners-Lee in 1990
DNS Domain name to IP address; 13 root servers at the top

Where this chapter connects

🎯 Practice MCQs

First 3 questions free · create a free account to unlock the rest — answers & explanations included, no payment needed

Q1. A network that connects computers in a school campus, up to a distance of about 1 km, with data rates from 10 Mbps to 1000 Mbps, is a

▸ Show answer & explanation

Answer: B

A LAN covers a limited area such as a room, building or campus at high speed. A PAN covers only about 10 metres, a MAN covers a city, and a WAN spreads across cities or countries.

Q2. Cable TV networks and cable based broadband services are examples of

▸ Show answer & explanation

Answer: C

A MAN extends over a city or a town, and cable TV networks are the standard example. The Internet, which links LANs across continents, is the largest WAN.

Q3. The device that converts digital data to analog signals at the sender and analog signals back to digital at the receiver is a

▸ Show answer & explanation

Answer: C

Modem stands for modulator demodulator. A repeater only regenerates signals, a hub forwards data to all ports, and a gateway is the entry and exit point of a network.

🔒 12 more practice MCQs

Create a free account to unlock every MCQ in this chapter — answers and explanations included. No payment needed.

Already registered? Just log in and they'll all appear here.

📊 Previous-Year Questions

Practise with real CUET Computer Science previous-year papers — every question solved, with the correct answer and a step-by-step explanation.

View solved CUET PYQ papers →

Ready to drill Computer Science?

Unlock all MCQs, chapter tests, mocks & PYQs for ₹199/year.

Get UniDrill Pro