Press m or Esc to close
Chapter 6 laid the cables. This chapter is the set of rules that turns a cable into a conversation.
Nodes, media, devices and topologies. Two machines are now physically able to send each other electricity, light or radio waves.
A wire between two computers is like a telephone line between two people who share no language. Signal, yes. Meaning, no.
An agreement: who speaks first, how the message is packaged, how the other end confirms it arrived, and what to do when it does not. That agreement is a protocol.
Protocol — a set of rules that governs how data is formatted, transmitted, received and acknowledged between devices on a network. Both ends must follow the same protocol to communicate.
Different jobs need different rules. Fetching a web page, sending mail, moving a large file and carrying a live voice call have completely different requirements — so each has its own protocol, all running over the same cables.
| Protocol | Full form | Job |
|---|---|---|
| HTTP | HyperText Transfer Protocol | fetch web pages |
| HTTPS | HTTP Secure | fetch them, encrypted |
| FTP | File Transfer Protocol | upload and download files |
| SMTP | Simple Mail Transfer Protocol | send email |
| POP3 | Post Office Protocol v3 | retrieve email |
| TCP/IP | Transmission Control Protocol / Internet Protocol | the foundation of the Internet |
| PPP | Point to Point Protocol | a direct link between two nodes |
| VoIP | Voice over Internet Protocol | carry voice calls over the Internet |
"Write the full form of SMTP and state its use" is a routine one-mark question. Learn the table above verbatim.
Client — a computer or program that requests a
service or resource.
Server — a computer or program that provides
that service, waiting for requests and responding to them.
The same computer can be a server for one conversation and a client in another — a web server is a client when it fetches data from a database server. Say "the machine acting as the client" and you are always right.
IP address — a unique numeric address assigned to every device on a network, which identifies where the device is and allows data to be routed to it.
Which of these are valid IPv4 addresses?
(a) 192.168.0.1
(b) 256.100.4.9
(c) 10.0.0
(d) 172.16.254.255
(a) Valid.
(b) Invalid — 256 exceeds 255. An octet is 8 bits, so the
largest value is 28 − 1 = 255.
(c) Invalid — only three parts; IPv4 needs exactly four.
(d) Valid — 255 is allowed as a value.
The 32-bit form above is IPv4. Because 4.3 billion was not enough,
IPv6 uses 128 bits, written as eight hexadecimal groups —
2001:0db8:85a3::8a2e:0370:7334.
A MAC address is permanent, assigned by the manufacturer, identifies the
device itself, and is used by a switch inside a LAN.
An IP address is assigned by the network, changes when the device
moves to another network, identifies its location, and is used by a
router between networks.
Domain name — a human-readable name given to an IP address, so that a site can be reached by a memorable name instead of a number.
| TLD | Meaning |
|---|---|
.com | commercial |
.org | organisation, usually non-profit |
.edu | educational institution |
.gov | government |
.net | network infrastructure |
.nic | network information centre |
.in .uk .au | country codes |
Nobody can remember 164.100.60.11, and the site's IP address may
change when it moves to a new server. The name stays the same and simply
points somewhere new — so users and links never break.
DNS — Domain Name System — a distributed naming service that translates domain names into IP addresses, so that users can use memorable names while the network routes using numbers.
DNS is the telephone directory of the Internet. You know the person's name; the directory gives you the number; you dial the number. You never dial the name.
URL — Uniform Resource Locator — the complete address of a resource on the Internet, specifying the protocol, the domain name of the server, and the path and file name of the resource.
For http://school.edu.in/library/books/list.html, name the
protocol, the domain name, the path and the file.
Protocol: http
Domain name: school.edu.in
Path: /library/books/
File name: list.html
The domain name stops at the first single slash after the
//. Everything after it is on the server, not part of its name.
HTTP — HyperText Transfer Protocol — the protocol used by the World Wide Web to transfer web pages between a web server and a browser. It is a request–response protocol.
HTTPS — HTTP Secure — HTTP with all data encrypted, so that anyone intercepting it cannot read it. It also proves the server is who it claims to be, using a digital certificate.
Any page that carries a password, a payment or personal data. Over plain HTTP, every device between you and the server — including the café Wi-Fi router — can read the whole exchange in plain text.
| HTTP | HTTPS | |
|---|---|---|
| Data is | plain text | encrypted |
| Default port | 80 | 443 |
| Certificate needed | No | Yes |
| Browser shows | "Not secure" | a padlock |
| Speed | marginally faster | slight encryption cost |
Hypertext is text containing links to other text. Follow a link and you jump to another document, possibly on another continent. That single idea is what makes the Web a web rather than a library of separate files.
A web page is a single document. A website is a collection of related pages. A web server is the machine that stores and serves them. A web browser is the client program that requests and displays them.
FTP — File Transfer Protocol — a standard protocol for transferring files between a client and a server over a network, supporting both upload and download, and usually requiring a username and password.
HTTP is built to fetch a document and display it. FTP is built to transfer a file and store it — in either direction, in bulk, with directory listings and resumable transfers.
Uploading your school website to its host is FTP. Viewing that website afterwards is HTTP.
Some public servers allow login with the username anonymous and any
email address as password, for openly downloadable files. Plain FTP sends the
password unencrypted, which is why secure variants (SFTP, FTPS) have
replaced it for anything private.
SMTP — Simple Mail Transfer Protocol — the protocol used to send email from a client to a mail server, and between mail servers. It pushes mail towards its destination.
POP3 — Post Office Protocol version 3 — the protocol used to retrieve email from a mail server to a client. It pulls mail down, and by default removes it from the server once downloaded.
SMTP sends, POP3 receives. If a question describes mail "leaving the outbox", the answer is SMTP; "arriving in the inbox", POP3. Remembering SMTP = Send is worth the mark.
Splits the message into numbered packets, ensures every packet arrives, requests re-transmission of any that are lost, and reassembles them in the correct order at the destination.
Gives every packet a source and destination IP address and handles routing — getting each packet across the network, one hop at a time.
IP delivers; TCP guarantees. IP is the postal service that carries each envelope. TCP is the numbering on the envelopes plus the checking that all of them arrived and were put back in order.
PPP — Point to Point Protocol — a protocol used to establish a direct link between exactly two nodes, for example between a user's computer and an Internet Service Provider over a dial-up or DSL line. It provides authentication, error detection and compression.
PPP is how a single machine joins the Internet over a serial link; TCP/IP is what it speaks once it is there. PPP is the on-ramp, not the motorway.
VoIP — Voice over Internet Protocol — technology that converts analog voice into digital packets and carries them over the Internet instead of the traditional telephone network.
A late web page is merely annoying; a late voice packet is useless — the conversation has moved on. So VoIP prefers to drop a packet rather than wait for it to be re-sent, which is the opposite of what TCP does for a file.
| Chat / instant messaging | VoIP | ||
|---|---|---|---|
| Timing | asynchronous — reply later | near real time | real time |
| Both parties online? | No | Usually yes | Yes |
| Stored on a server | Yes, until fetched | usually | No |
| Protocols | SMTP, POP3 | application-specific | VoIP over IP |
| Best for | formal, long, with attachments | quick exchanges | conversation |
Email — the exchange of digital messages, stored on a mail
server until the recipient retrieves them. Because it is asynchronous, the
recipient need not be online when it is sent.
Chat — real-time textual communication between two or more
users who are online at the same time.
Whether the message is stored. Email is stored, so the recipient can be absent. A voice call is not stored, so both must be present. Chat sits in between — which is why it feels like both.
“A protocol is a set of rules governing how data is formatted, transmitted and
received between devices.”
“DNS translates a domain name into its corresponding IP address.”
“SMTP is used to send email; POP3 is used to retrieve it.”
Name the protocol used in each situation.
ncert.nic.in.| # | Protocol | Keyword that gives it away |
|---|---|---|
| 1 | FTP | "uploads … files to a server" |
| 2 | HTTP | "browser fetches a page" |
| 3 | HTTPS | "card details" — must be encrypted |
| 4 | POP3 | "downloads … into her inbox" |
| 5 | SMTP | "leaves the outbox" |
| 6 | VoIP | "speak … using laptops" |
Answers 4 and 5 are the pair examiners set together to see whether you really know which direction each one goes.
www.ncert.nic.in into a browser.HTTP transfers web pages in plain text, so the data can be read by anyone who intercepts it. It uses port 80.
HTTPS is HTTP with the data encrypted, and it requires the server to hold a valid digital certificate proving its identity. It uses port 443 and is essential for passwords and payments.
A MAC address is a permanent 48-bit hardware address assigned by the manufacturer to the NIC. It identifies the device itself, never changes, and is used by a switch within a LAN.
An IP address is a 32-bit (IPv4) logical address assigned by the network. It identifies the device's location on the network, changes when the device joins a different network, and is used by a router to move packets between networks.
DNS (Domain Name System) is the service that translates human-readable domain names into the numeric IP addresses the network actually routes with.
When the user types www.ncert.nic.in:
164.100.60.11.Steps 1 and 2 finish before the page is requested at all — the mark is for showing that the lookup comes first.
Consider the URL
https://www.cbse.gov.in/results/class12/marks.html
203.94.243.71 a valid IPv4 address? Is
203.94.300.71?1. Protocol: https · Domain name:
www.cbse.gov.in · Path: /results/class12/ ·
File name: marks.html
2. DNS uses the domain name, www.cbse.gov.in, and returns
the IP address of the server hosting the site. The path and file name are
meaningful only to that server, once it has been reached.
3. 203.94.243.71 is valid — all four octets lie between 0
and 255. 203.94.300.71 is invalid, because 300
exceeds the maximum value of 255 an 8-bit octet can hold.
Riya, in Delhi, emails a 4 MB photograph to Sam in London, who reads it the next morning. List, in order, every protocol and mechanism involved from the moment she presses Send.
The mark for insight: because email is asynchronous and the message is stored on Sam's mail server, he need not have been online at all when Riya pressed Send. That is the property that makes the whole sequence possible.
Unit 2 is complete: you know how machines are connected and how they agree to talk. Unit 3 is what they are usually talking about — data held in a relational database, and the language used to ask it questions.
① A database server is a server in exactly the sense of §2.1 — your
Python program will be the client.
② Chapter 10 connects to MySQL over the network using a host and
port, which is the addressing you just learned.
③ A database table is a list of records — the same shape as the CSV
file in Chapter 4.