Computer Networking: Complete Notes for Students and Competitive Exams
Computer Networking explains how computers, mobile devices, servers, and other systems communicate, exchange data, and share resources over local and global networks.
These notes cover network types, topologies, transmission media, OSI and TCP/IP models, addressing, subnetting, protocols, devices, error control, and common troubleshooting commands.
1. Introduction to Computer Networking
A computer network is a collection of interconnected devices that can exchange data and share resources such as files, printers, software, and internet access.
Important networking history
- ARPANET: An early packet-switching network funded by the United States Department of Defense. Its first connection was made in 1969.
- First network email: Ray Tomlinson sent the first network email over ARPANET in 1971.
- TCP/IP pioneers: Vint Cerf and Bob Kahn made major contributions to the development of TCP/IP.
- Internet milestone: ARPANET adopted TCP/IP on January 1, 1983, a major event in the development of the modern Internet.
- Internet in India: VSNL launched public Internet service in India on August 15, 1995.
Networking models provide a structured way to understand how data is transmitted and received. The two main reference models are the OSI model and the TCP/IP model.
2. Types of Networks
Networks can be classified by geographical area, ownership, purpose, and access method.
| Network Type | Meaning | Typical Coverage and Example |
|---|---|---|
| LAN | Local Area Network | Small area such as a home, office, school, or laboratory. |
| WLAN | Wireless Local Area Network | A LAN that uses Wi-Fi instead of network cables. |
| MAN | Metropolitan Area Network | Covers a city or large urban area. |
| WAN | Wide Area Network | Covers large geographical areas such as countries or continents. The Internet is the largest example. |
| PAN | Personal Area Network | Short-range communication between personal devices, such as Bluetooth headphones and a phone. |
| CAN | Campus Area Network | Connects multiple LANs in a university campus, company campus, or large organisation. |
| SAN | Storage Area Network | A dedicated high-speed network that connects servers to shared storage devices. |
| VPN | Virtual Private Network | An encrypted connection over a public network, often used for secure remote access. |
Networks by access
- Internet: A public global network of interconnected networks.
- Intranet: A private network available only to authorised members of an organisation.
- Extranet: A controlled private network that gives selected external users, such as suppliers or partners, access to specific resources.
3. Network Topologies
A network topology is the physical or logical arrangement of devices and communication links in a network.
Bus Topology
In a bus topology, devices share a common communication cable. Older shared Ethernet networks used this arrangement. A fault in the main cable can affect the whole network.
Star Topology
In a star topology, every device connects to a central device, usually a switch. It is the most common topology in modern Ethernet LANs.
Ring Topology
In a ring topology, devices are connected in a circular arrangement. Traditional Token Ring networks used token passing to control access to the network.
Tree Topology
A tree topology uses a hierarchical structure. It is often formed by connecting multiple star networks through switches or other networking devices.
Mesh Topology
In a full mesh topology, each device has a direct link to every other device. It provides high redundancy but requires many connections and does not scale efficiently.
For n devices in a full mesh network, the number of links required is: n(n - 1) / 2.
Hybrid Topology
A hybrid topology is a combination of two or more different network topologies.
4. Transmission Media
Transmission media are the paths over which data travels from one device to another. They can be guided, meaning wired, or unguided, meaning wireless.
Guided Media
- Twisted Pair Cable: Commonly used in Ethernet LANs. UTP means Unshielded Twisted Pair, while STP means Shielded Twisted Pair. Ethernet cables commonly use 8P8C modular connectors, often called RJ45 connectors.
- Coaxial Cable: Used in cable television systems and some older networking systems. A common connector type is BNC, meaning Bayonet Neill-Concelman.
- Optical Fibre Cable: Uses light to transmit data. It supports high bandwidth, long distances, and resistance to electromagnetic interference.
Unguided Media
- Radio Waves: Used in Wi-Fi, Bluetooth, mobile communication, and broadcasting.
- Microwaves: Used in point-to-point links, radar, satellite communication, and cellular networks.
- Infrared: Used for short-range line-of-sight communication, such as television remote controls.
- Satellite Communication: Used to provide connectivity over very large geographical areas.
5. Communication Modes
Communication mode describes the direction in which data can flow between two devices.
- Simplex: Data travels in only one direction. Example: television broadcasting or a keyboard sending input to a computer.
- Half Duplex: Data can travel in both directions, but not at the same time. Example: a walkie-talkie.
- Full Duplex: Data can travel in both directions simultaneously. Example: a telephone call or a modern switched Ethernet connection.
6. OSI Model and TCP/IP Model
OSI Model
The OSI model, or Open Systems Interconnection model, is a seven-layer reference model published by ISO. It helps students and professionals understand network communication.
TCP/IP Model
The TCP/IP model is the practical protocol suite used by the Internet. It is commonly described using four layers: Application, Transport, Internet, and Link. Some textbooks use a five-layer view by separating the Link layer into Data Link and Physical layers.
| OSI Layer | TCP/IP Layer | PDU | Main Function |
|---|---|---|---|
| 7. Application | Application | Data | Provides network services to applications, such as web access, email, file transfer, and name resolution. |
| 6. Presentation | Application | Data | Handles data formatting, translation, compression, encryption, and decryption. |
| 5. Session | Application | Data | Manages sessions, dialog control, and synchronisation between applications. |
| 4. Transport | Transport | Segment for TCP; Datagram for UDP | Provides process-to-process communication, reliability, flow control, and port addressing. |
| 3. Network | Internet | Packet | Provides logical addressing and routing between networks. |
| 2. Data Link | Link | Frame | Provides local delivery, framing, MAC addressing, and error detection. |
| 1. Physical | Link | Bits | Transmits raw bits through cables, radio signals, connectors, and other physical media. |
7. Network Addressing
Different types of addresses identify networks, devices, interfaces, and applications.
IPv4 Address
IPv4 is a 32-bit logical address, usually written in dotted-decimal notation, such as 192.168.1.10.
Older textbooks classify IPv4 addresses as Class A, B, C, D, and E. Modern networking uses CIDR notation, such as /24, rather than relying on address classes.
Private IPv4 Ranges
- 10.0.0.0/8: 10.0.0.0 to 10.255.255.255
- 172.16.0.0/12: 172.16.0.0 to 172.31.255.255
- 192.168.0.0/16: 192.168.0.0 to 192.168.255.255
The range 100.64.0.0/10 is reserved for carrier-grade NAT and is not a normal private-address range.
Special IPv4 Addresses
- 127.0.0.1: Loopback address used to test the local system.
- 127.0.0.0/8: Entire IPv4 loopback range.
- 255.255.255.255: Limited broadcast address used only on the local network.
IPv6 Address
IPv6 is a 128-bit address written in hexadecimal notation. It was designed to provide a much larger address space than IPv4 and support modern Internet growth.
MAC Address
A MAC address identifies a network interface on a local network. A common MAC address is 48 bits long and written as six hexadecimal pairs, for example: 00:1A:2B:3C:4D:5E.
MAC addresses are often assigned by manufacturers, but many operating systems and devices can use software-configured or randomised MAC addresses. Therefore, a MAC address is not always permanent.
Port Number
A port is a 16-bit number from 0 to 65535. Ports identify a specific application or service running on a host.
| Protocol or Service | Common Port |
|---|---|
| FTP control | 21 |
| SSH / SFTP | 22 |
| Telnet | 23 |
| SMTP | 25 |
| DNS | 53 |
| DHCP | 67 server / 68 client |
| HTTP | 80 |
| POP3 | 110 |
| IMAP | 143 |
| HTTPS | 443 |
8. Subnetting
Subnetting is the process of dividing a larger IP network into smaller, logical networks called subnets.
Why subnetting is used
- Reduces the size of broadcast domains.
- Improves network organisation and management.
- Helps isolate departments, systems, or security zones.
- Allows more efficient use of IPv4 address space.
- Supports better routing design.
Example: 192.168.10.0/30
- Prefix length: /30 means 30 bits belong to the network portion.
- Subnet mask: 255.255.255.252
- Total addresses: 22 = 4 addresses
- Usable host addresses: 22 - 2 = 2 usable addresses
- Network address: 192.168.10.0
- Usable host addresses: 192.168.10.1 and 192.168.10.2
- Broadcast address: 192.168.10.3
9. Important Networking Protocols
- TCP: Connection-oriented protocol that provides reliable, ordered delivery of a stream of bytes between applications.
- UDP: Connectionless protocol with lower overhead. It is often used for streaming, online gaming, DNS queries, and real-time communication.
- HTTP: Protocol used for web communication.
- HTTPS: HTTP protected by TLS encryption.
- FTP: Protocol used for file transfer. Traditional FTP is not encrypted.
- SFTP: SSH File Transfer Protocol, which transfers files securely through SSH.
- SMTP: Used to send email between mail clients and mail servers or between mail servers.
- POP3: Used to retrieve email, often by downloading messages to a client.
- IMAP: Allows email to remain synchronised with the mail server across multiple devices.
- DNS: Resolves domain names, such as example.com, to IP addresses.
- DHCP: Automatically provides IP addresses and other network settings to devices.
- ARP: Resolves an IPv4 address to a MAC address on a local network.
- ICMP: Carries network-control and error-reporting messages. It is used by tools such as ping.
- RTP: Real-time Transport Protocol, commonly used with UDP for audio and video streams.
- TLS: Provides encrypted communication. SSL is obsolete; TLS is its modern successor.
10. Network Devices
| Device | Typical Role |
|---|---|
| Hub | A Layer 1 device that repeats incoming signals to all connected ports. It is largely obsolete in modern LANs. |
| Repeater | Regenerates or retransmits a signal to extend communication distance. |
| Bridge | Connects LAN segments and forwards frames based on MAC addresses. |
| Switch | Usually operates at Layer 2 and forwards frames based on MAC addresses. Some multilayer switches can also perform Layer 3 routing. |
| Router | Connects separate IP networks and forwards packets based on IP addresses and routing tables. |
| Gateway | Connects systems that use different protocols or data formats. Its role depends on the application and it can operate at multiple layers. |
| Modem | Modulates and demodulates signals for a specific access technology, such as cable, DSL, or cellular service. |
| Firewall | Applies security rules to allow, block, inspect, or monitor network traffic. Modern firewalls may inspect traffic at several layers. |
Common IEEE 802 Standards
- IEEE 802.3: Ethernet
- IEEE 802.11: Wireless LAN or Wi-Fi
- IEEE 802.15: Wireless Personal Area Networks
- IEEE 802.15.4: Low-rate wireless personal area networks, used by technologies such as Zigbee
- IEEE 802.16: Broadband wireless access, commonly associated with WiMAX
11. Error Detection, Error Correction and Flow Control
Error Types
- Single-bit error: One bit changes from 0 to 1 or from 1 to 0.
- Multiple-bit error: More than one bit is affected.
- Burst error: A group of bits within a data unit is affected.
Error Detection
- Parity Check: Adds one parity bit to make the total number of 1s even or odd. It detects many simple errors but cannot detect every possible error pattern.
- Checksum: Computes a value from data units and allows the receiver to check whether data changed during transmission.
- CRC: Cyclic Redundancy Check uses polynomial-based binary division. It is widely used and is strong at detecting accidental transmission errors.
Error Correction
- Backward Error Correction: The receiver requests retransmission when it detects an error.
- Forward Error Correction: Redundant information allows the receiver to correct certain errors without retransmission. Hamming code is a common example.
Flow Control
- Stop-and-Wait: The sender sends one frame and waits for an acknowledgement before sending the next.
- Sliding Window: The sender can transmit multiple frames before receiving acknowledgements, improving efficiency.
Automatic Repeat Request (ARQ)
- Stop-and-Wait ARQ: Uses acknowledgements, timeouts, error detection, and retransmission.
- Go-Back-N ARQ: If a frame is lost or damaged, the sender retransmits that frame and later unacknowledged frames.
- Selective Repeat ARQ: Retransmits only the specific missing or damaged frames and allows correctly received frames to be buffered.
12. Useful Network Commands
The following commands are commonly used to diagnose network problems. Some commands differ between Windows, Linux, and macOS.
| Command | Purpose |
|---|---|
ping | Tests reachability and measures round-trip time using ICMP echo messages. |
ipconfig | Shows IP configuration on Windows. |
ip addr | Shows network-interface configuration on Linux. |
ifconfig | Older Unix/Linux command used to view network-interface settings. |
tracert | Shows the route packets take to a destination on Windows. |
traceroute | Shows the route packets take to a destination on Linux and macOS. |
nslookup | Queries DNS to find information about a domain name or IP address. |
arp | Displays or manages the local ARP table. |
netstat | Displays network connections, listening ports, and protocol statistics. |
hostname | Displays the current computer or host name. |
13. Miscellaneous Networking Concepts
- Jitter: Variation in packet-arrival time. High jitter can affect voice and video calls.
- Latency: The time taken for data to travel from source to destination.
- Bandwidth: The maximum capacity of a communication link, usually measured in bits per second.
- Throughput: The amount of useful data actually transferred in a given time.
- Fade Margin: The difference between received signal strength and the minimum signal level required for acceptable communication.
- TDM: Time Division Multiplexing divides a communication channel into time slots for multiple signals.
- Spoofing: A technique in which an attacker falsifies an identity or address, such as an IP address, DNS record, email address, or website identity.
- Maximum IPv4 Datagram Size: 65,535 bytes, including the IPv4 header and payload.
14. Quick Revision Points
- A network connects devices so they can communicate and share resources.
- LAN covers a small area, MAN covers a city, and WAN covers a large geographical area.
- Star topology is common in modern Ethernet LANs.
- OSI has seven layers; TCP/IP is commonly described using four or five layers.
- IP addresses identify network interfaces logically, while MAC addresses identify interfaces on the local network.
- TCP is reliable and connection-oriented; UDP is connectionless and has lower overhead.
- DNS translates domain names into IP addresses.
- DHCP automatically assigns IP configuration to devices.
- Switches forward frames using MAC addresses; routers forward packets using IP addresses.
- CRC is a widely used method for detecting transmission errors.
- Subnetting divides a large network into smaller logical networks.
15. Practice Questions
- What is a computer network?
- Differentiate between LAN, MAN, and WAN.
- What is the difference between Internet, Intranet, and Extranet?
- Explain star, bus, ring, mesh, and hybrid topologies.
- What is the difference between guided and unguided transmission media?
- Explain simplex, half-duplex, and full-duplex communication.
- List the seven layers of the OSI model.
- Differentiate between TCP and UDP.
- What is the difference between an IP address, MAC address, and port number?
- What is subnetting and why is it used?
- Differentiate between a hub, switch, bridge, router, and gateway.
- What is the difference between CRC, checksum, and parity checking?
- Explain Stop-and-Wait ARQ, Go-Back-N ARQ, and Selective Repeat ARQ.
- Which commands would you use to test connectivity and diagnose DNS problems?