CH 7 · APPLICATIONS & PROTOCOLS
Unit 2 · Computer Networks

Chapter 7
Applications
and Protocols

Chapter 6 laid the cables. This chapter is the set of rules that turns a cable into a conversation.

1.1 Where we have got to

Chapter 6

Nodes, media, devices and topologies. Two machines are now physically able to send each other electricity, light or radio waves.

Which is not the same as talking

A wire between two computers is like a telephone line between two people who share no language. Signal, yes. Meaning, no.

What is missing

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.

Definition

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.

Why there is more than one

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.

1.2 How this chapter runs

Five stops

  1. The client–server model — who asks, who answers
  2. Addressing — IP addresses, domain names, DNS, URL
  3. The web — HTTP and HTTPS
  4. Moving files and mail — FTP, SMTP, POP3
  5. TCP/IP, PPP and VoIP — the foundation and the live voice

Every protocol, on one screen

ProtocolFull formJob
HTTPHyperText Transfer Protocolfetch web pages
HTTPSHTTP Securefetch them, encrypted
FTPFile Transfer Protocolupload and download files
SMTPSimple Mail Transfer Protocolsend email
POP3Post Office Protocol v3retrieve email
TCP/IPTransmission Control Protocol / Internet Protocolthe foundation of the Internet
PPPPoint to Point Protocola direct link between two nodes
VoIPVoice over Internet Protocolcarry voice calls over the Internet
Full forms are marks

"Write the full form of SMTP and state its use" is a routine one-mark question. Learn the table above verbatim.

2.1 Who asks, who answers

CLIENT your browser SERVER holds the pages ① request — GET /index.html ③ response — the HTML, plus a status code ② finds or builds the page ④ renders it on screen The client always speaks first. The server never calls you.
Request → process → response → render. Every protocol in this chapter follows this shape.
Definition

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.

Client and server are roles, not machines

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.

3.1 The IP address

Definition

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.

192 168 1 10 . . . 4 octets, each 8 bits = 32 bits in total each part must be between 0 and 255 so about 4.3 billion addresses exist — and they ran out
Worked example

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

Check each octet. 🤔
Answer

(a) Valid.
(b) Invalid256 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.

IPv4 and IPv6

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.

IP address vs MAC address — the guaranteed question

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.

3.2 Domain names, and why they exist

Definition

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.

www . ncert . nic . in sub- domain second-level domain generic TLD country TLD read RIGHT to LEFT — the most general part is on the right
TLDMeaning
.comcommercial
.orgorganisation, usually non-profit
.edueducational institution
.govgovernment
.netnetwork infrastructure
.nicnetwork information centre
.in .uk .aucountry codes
The point of a domain name

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.

3.3 DNS — turning the name into a number

BROWSER ncert.nic.in DNS SERVER the phone book WEB SERVER 164.100.60.11 ① what is the IP of ncert.nic.in? ② it is 164.100.60.11 ③ HTTP GET to 164.100.60.11 ④ the page comes back Steps ① and ② happen before a single byte of the page is requested.
The DNS lookup happens first and is invisible to the user.
Definition

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.

The analogy that earns the mark

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.

3.4 The URL, dissected

https:// www.ncert.nic.in / textbook / pdf / lecs109.pdf protocol how to fetch it domain name which server path which folder file name which document Together they identify exactly one resource, anywhere in the world.
Four parts. A question asking you to "identify the domain name in the given URL" is asking for the second one.
Definition

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.

Question 1

For http://school.edu.in/library/books/list.html, name the protocol, the domain name, the path and the file.

Are you ready for the answer? 🤔
Answer

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.

4.1 HTTP and HTTPS

Definition

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.

Definition

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.

When HTTPS is compulsory

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.

 HTTPHTTPS
Data isplain textencrypted
Default port80443
Certificate neededNoYes
Browser shows"Not secure"a padlock
Speedmarginally fasterslight encryption cost
Hypertext — the idea underneath

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.

Web page, website, web server, browser

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.

5.1 FTP — moving whole files

Definition

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.

FTP vs HTTP — why both exist

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.

Typical uses

  • Uploading a website to a hosting server
  • Downloading large software or datasets
  • Sharing files inside an organisation
  • Transferring backups between machines
Anonymous FTP

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.

5.2 Email — SMTP out, POP3 in

SENDER mail client sender's mail server recipient's mail server RECIPIENT mail client SMTP SMTP POP3 PUSH — the mail is sent onward PULL — the client fetches it SMTP moves mail towards the recipient; POP3 collects it from the mailbox.
Notice the arrow direction: SMTP arrows point right, the POP3 arrow points left.
Definition

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.

Definition

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.

The distinction that is examined every year

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.

6.1 TCP/IP — the two halves

message at sender 1 2 3 4 different routes, arriving out of order 1 2 3 4 message reassembled in order TCP splits it TCP reorders and checks
Packets may take different routes and arrive out of order. TCP puts them back together.
TCP — Transmission Control Protocol

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.

IP — Internet Protocol

Gives every packet a source and destination IP address and handles routing — getting each packet across the network, one hop at a time.

The division of labour, in one line

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.

6.2 PPP and VoIP

Definition

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.

Where PPP fits

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.

Definition

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.

Advantages

  • Far cheaper, especially internationally
  • Voice, video and data on one network
  • Portable — the number travels with you

Disadvantages

  • Needs a reliable Internet connection
  • Quality drops on a congested link
  • No power, no phone
Why voice is a hard case for a 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.

6.3 Email and chat, compared

 EmailChat / instant messagingVoIP
Timingasynchronous — reply laternear real timereal time
Both parties online?NoUsually yesYes
Stored on a serverYes, until fetchedusuallyNo
ProtocolsSMTP, POP3application-specificVoIP over IP
Best forformal, long, with attachmentsquick exchangesconversation
Definitions

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.

The one property that explains the whole table

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.

7.1 Everything on one screen

The model

client requests, server responds protocol = agreed rules client and server are roles

Addressing

IP address — 4 octets, 0–255 IPv6 — 128 bits MAC = device · IP = location DNS = name → IP URL = protocol + domain + path + file

Protocols

HTTP — web pages, port 80 HTTPS — encrypted, port 443 FTP — file transfer SMTP — SEND mail POP3 — RECEIVE mail TCP — packets, order, reliability IP — addressing and routing PPP — two nodes, direct link VoIP — voice as packets
The three sentences worth the most marks

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.

7.2 Exam question 1 — name the protocol

4 marks

Name the protocol used in each situation.

  1. Ravi uploads his school project website to the hosting server.
  2. Meera's browser fetches a page from ncert.nic.in.
  3. Aarav enters his card details on a shopping site.
  4. Riya's mail client downloads new messages into her inbox.
  5. A message leaves Riya's outbox towards its destination.
  6. Two colleagues in different countries speak using their laptops.
Are you ready for the answer? 🤔
Answer
#ProtocolKeyword that gives it away
1FTP"uploads … files to a server"
2HTTP"browser fetches a page"
3HTTPS"card details" — must be encrypted
4POP3"downloads … into her inbox"
5SMTP"leaves the outbox"
6VoIP"speak … using laptops"

Answers 4 and 5 are the pair examiners set together to see whether you really know which direction each one goes.

7.3 Exam question 2 — the differences

2 + 2 + 2 marks
  1. Differentiate between HTTP and HTTPS.
  2. Differentiate between an IP address and a MAC address.
  3. What is DNS? Explain with an example what happens when a user types www.ncert.nic.in into a browser.
Are you ready for the answer? 🤔
Answer 1

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.

Answer 2

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.

Answer 3

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:

  1. The browser sends the name to a DNS server, asking for its IP address.
  2. The DNS server looks it up and replies with the address, e.g. 164.100.60.11.
  3. The browser sends an HTTP request to that IP address.
  4. The web server returns the page, and the browser renders it.

Steps 1 and 2 finish before the page is requested at all — the mark is for showing that the lookup comes first.

7.4 Exam question 3 — URL and addresses

3 marks

Consider the URL https://www.cbse.gov.in/results/class12/marks.html

  1. Identify the protocol, domain name and file name.
  2. Which part is used by DNS, and what does it return?
  3. Is 203.94.243.71 a valid IPv4 address? Is 203.94.300.71?
Are you ready for the answer? 🤔
Answer

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.

7.5 One last challenge

Challenge

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.

At least five things. 🤔
Answer
  1. DNS — Riya's mail client resolves her mail server's name to an IP address.
  2. SMTP — the message and attachment are pushed from her client to her mail server.
  3. TCP — the 4 MB is split into numbered packets, and every packet is acknowledged or re-sent.
  4. IP — each packet is addressed and routed hop by hop, through routers, across the WAN to London.
  5. SMTP again — Riya's mail server transfers the message to Sam's mail server, where it is stored.
  6. POP3 — the next morning, Sam's client pulls the message down into his inbox.

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.

End of Unit 2

Next: Databases

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.

Carry these three forward

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.