When we type a web address, a chain of programs, protocols and servers works together to bring the page to our screen.

The Internet and the WWW

The Internet is the global network of networks that connects computers. The World Wide Web (WWW) is a service that runs on the internet: a system of linked documents and resources, identified by URLs and transferred by HTTP. It was invented by Tim Berners-Lee at CERN in 1989–1991. Other internet services, such as email and file transfer, are separate from the web. The web follows the client-server model: a client (the browser) requests a resource, and a server sends it.

Definition: DNS. The Domain Name System, the internet's directory service that translates human-readable domain names such as www.example.com into the numeric IP addresses of servers.

Protocols of the Web

A protocol is a set of rules for communication. HTTP (HyperText Transfer Protocol) transfers web pages; a request has a method such as GET or POST, and a response has a status code such as 200 (OK), 404 (Not Found) or 500 (Server Error). HTTPS is HTTP secured with TLS encryption, shown by the padlock in the browser. TCP/IP carries data across the internet: IP addresses and routes packets, and TCP makes delivery reliable. FTP and SFTP transfer files, often to upload a website. SMTP, POP3 and IMAP handle email. DNS translates names to addresses.

URLs and DNS

A URL (Uniform Resource Locator), such as https://www.dpg.edu.in/courses/bca.html, has a protocol (https), a domain name (www.dpg.edu.in), an optional port, a path (/courses/bca.html), and optional query (?id=5) and fragment (#fees). Computers find each other by IP address, so the browser asks a DNS resolver, which queries the root, top-level-domain and authoritative name servers in turn and returns the IP address. The result is cached to speed later visits.

Web Browsers

A web browser is the client program that requests, interprets and displays web pages, such as Chrome, Firefox, Edge and Safari. Its rendering engine (Blink, Gecko or WebKit) turns HTML and CSS into the page, and its JavaScript engine (such as V8) runs scripts.

Development Tools and Programs

Web developers use text editors and IDEs such as VS Code, Sublime Text and Notepad++, the developer tools built into browsers (F12) to inspect elements, test CSS, see the console and monitor network requests, version control with Git and GitHub, local servers such as XAMPP and Live Server, and image and design tools such as Figma.

Table 2.5: Web protocols

Protocol Purpose Example
HTTP / HTTPS Transfer web pages https://site.com
TCP/IP Deliver data packets Every connection
DNS Translate names to IP addresses site.com → 203.0.113.7
FTP / SFTP Transfer files Uploading a website
SMTP, IMAP Send and receive email Mail clients

Example 2.5: Following a page request

Problem: Describe what happens when a user types https://www.example.com/index.html and presses Enter.

Solution:

  1. The browser asks DNS for the IP address of www.example.com.
  2. It opens a TCP connection to that address on port 443 and sets up TLS encryption.
  3. It sends an HTTP GET request for /index.html.
  4. The server replies with status 200 and the HTML file.
  5. The browser renders the page, and requests the CSS, images and scripts it refers to.

Result: The page appears after DNS, TCP, TLS and HTTP have each done their part.

const url = new URL(
  "https://www.dpg.edu.in:443/courses/bca.html?year=2#fees");
console.log("protocol:", url.protocol);
console.log("host    :", url.hostname);
console.log("port    :", url.port || "(default)");
console.log("path    :", url.pathname);
console.log("query   :", url.search, " fragment:", url.hash);

Output

protocol: https:
host    : www.dpg.edu.in
port    : (default)
path    : /courses/bca.html
query   : ?year=2  fragment: #fees

Common mistakes

  • Treating the internet and the web as the same thing.
  • Thinking that HTTPS hides which site is visited. It encrypts the content.
  • Forgetting that DNS results are cached, so changes may take time to appear.

Key takeaways

  • The web is a service on the internet, using URLs and HTTP.
  • HTTPS adds TLS encryption to HTTP.
  • DNS turns domain names into IP addresses.
  • Browsers render pages; developer tools help to build them.

Practice questions

  1. Distinguish the Internet and the WWW.
  2. What is the role of DNS?
  3. What does HTTP status 404 mean?

Answers to the practice questions

  1. The Internet is the global network; the WWW is a service of linked documents running on it.
  2. To translate domain names into IP addresses.
  3. The requested resource was not found.

Sources

  • Official BCA syllabus Web Technologies, course code 25BCA402SEC02, Unit II