You type a website name and a page appears in a second. Behind that second, several rule books are at work: one finds the address, one carries the page, one makes sure nothing is lost. This note names each rule book and explains the addresses they use.
Chapter 1 of the PECTAA Computer Science 12 book is Computer Networks. Section 1.7 covers network protocols and services, and section 1.8 covers IP addressing and subnetting. This note is for FSc Part 2 (2nd year, Class 12) students in Lahore, Faisalabad, Sargodha, Rawalpindi, Multan, Gujranwala and the other Punjab boards. Gujrat district comes under the Gujranwala board. PECTAA writes the books. Your own board sets your paper.
What to know
Protocol. A set of rules for communication between devices. It fixes how data is formatted and transmitted, how errors are handled and how data is delivered. Every device on a network must follow the same protocol, which keeps the exchange smooth. The book compares protocols to languages that computers use to talk.
The protocols in the book.
- TCP/IP (Transmission Control Protocol and Internet Protocol). The main protocol of the Internet, used in almost all networks. TCP makes delivery reliable. IP handles addressing and routing.
- HTTP (Hypertext Transfer Protocol). Transfers web pages between a web browser and a web server. HTTP does not encrypt data.
- HTTPS. The secure version of HTTP. It encrypts data between browser and server using SSL/TLS, so passwords and personal details are hard to intercept.
- FTP (File Transfer Protocol). Uploads and downloads files and allows file sharing between computers. Web developers use it often. It can move large files, and secure versions exist.
- DNS (Domain Name System). Converts website names into IP addresses, so users do not need to remember numbers. DNS servers do this translation every time a site is opened. The book's figure shows a sample website name being turned into a numeric address.
IP address (section 1.8). A unique number given to a device on a network. It identifies the device and lets data find its destination. Every network device needs one; without it, communication is not possible.
IPv4. The older version, with 32-bit addresses. It is written as four numbers, each from 0 to 255, separated by dots, for example 192.168.1.10. Each number is one byte (8 bits), so 4 × 8 = 32 bits. The book splits the example into a network part (192.168.1), which names the local network, and a host part (10), which names your device on it. The total number of IPv4 addresses is about 4.29 billion, which is why IPv4 is limited.
IPv6. The newer version, with 128-bit addresses and far more address space. It is written as eight groups of four hexadecimal digits separated by colons. Each group is 16 bits, so 8 × 16 = 128 bits. The book divides its example into a global routing prefix, a subnet ID and an interface ID.
Subnetting. Dividing one network into smaller parts called subnets. It reduces traffic, improves performance, increases security and helps manage large networks. The book's figure splits 192.168.1.0/24 into two subnets, 192.168.1.0/25 and 192.168.1.128/25.
NAT (Network Address Translation). Lets many devices share one public IP address. Routers perform it. It hides private IP addresses, which improves security, and it is widely used.
Key points
- Protocol = rules. Address = location. Protocols say how to talk; IP addresses say where to send.
- TCP for reliability, IP for routing. Learn the pair together.
- Bit counts: IPv4 is 4 numbers × 8 bits = 32 bits; IPv6 is 8 groups × 16 bits = 128 bits.
Worked examples
Example 1. Is 192.168.1.300 a valid IPv4 address? No. Each of the four numbers must be between 0 and 255, and 300 is too large.
Example 2. Why is 2³² linked to IPv4? IPv4 has 32 bits, so it allows 2³² = 4,294,967,296 addresses, about 4.29 billion, matching the book's figure.
Example 3. Which protocol should a site use for a login page, and why? HTTPS, because it encrypts data between browser and server with SSL/TLS. HTTP sends data without encryption.
Example 4. How many addresses does each /25 subnet in the book's example hold? A /25 leaves 32 − 25 = 7 bits for hosts, so 2⁷ = 128 addresses. The two /25 subnets together make the 256 addresses of the /24.
Common mistakes in the exam
- Saying DNS stores web pages. DNS only turns names into IP addresses.
- Mixing up TCP and IP. TCP is about reliable delivery; IP is about addressing and routing.
- Writing IPv6 as 64 bits. It is 128 bits.
- Calling HTTP secure. HTTP does not encrypt; HTTPS does.
- Saying NAT gives each device a public address. NAT lets many devices share one public address.
Exam technique
- For "define and give an example", pair each protocol with its job in one line.
- In IPv4 versus IPv6 questions, compare bit length, format and address space in a small table.
- Show the bit arithmetic (4 × 8 and 8 × 16) to earn method marks.
- Check your board's notice for the topics in your paper.
Practice questions
- Expand FTP and state its use. Answer: File Transfer Protocol; uploading, downloading and sharing files.
- How many bits are in one IPv6 group? Answer: 16 bits.
- In 192.168.1.10, which part is the host part in the book's example? Answer: 10.
- Name the security layer used by HTTPS. Answer: SSL/TLS.
- Give two benefits of subnetting. Answer: Any two of: less network traffic, better performance, more security, easier management of large networks.
Ready to practise this? Continue in 2nd Year Computer Science.