Computer Networking Fundamentals: Models, Protocols, Topologies
Computer Network Definition & OSI Model Openness
A computer network is a group of two or more interconnected computers that can communicate and share resources such as files, printers, applications, or internet access. The main goal of a network is to enable data sharing and communication between devices.
The OSI (Open Systems Interconnection) model is called “open” because it was developed as a universal, standardized framework that is not tied to any specific vendor, product, or technology. It allows different computer systems from different manufacturers to communicate with each other. The OSI model is an open standard, meaning its design and documentation are freely available to all, promoting interoperability and communication between systems globally.
Network Types: LAN, MAN, WAN Differences
Here are the key differences between LAN, MAN, and WAN:
- LAN (Local Area Network):
- Covers a small area.
- Ownership is typically private.
- Easy to design and maintain.
- Low setup cost.
- High data transfer rate.
- More secure.
- MAN (Metropolitan Area Network):
- Covers a large area.
- Ownership can be private or public.
- Difficult to design and maintain.
- Moderate setup cost.
- Medium data transfer rate.
- Less secure.
- WAN (Wide Area Network):
- Covers a very large area.
- Ownership can be private or public.
- Difficult to design and maintain.
- High setup cost.
- Low data transfer rate.
- Less secure.
Network Topology & Types Explained
Network topology refers to the physical or logical arrangement of computers, cables, and other devices in a computer network. It shows how different nodes (computers or devices) are connected and how data flows between them.
Types of Network Topologies:
- Bus Topology: All devices are connected to a single central cable. Data travels in both directions. Easy to install.
- Star Topology: All devices are connected to a central hub or switch. Data passes through the hub. Easy to manage and expand.
- Ring Topology: Devices are connected in a circular manner. Data travels in one direction (or both in dual ring). Data flows in an orderly way.
- Mesh Topology: Every device is connected to every other device. Very reliable, no single point of failure.
- Tree Topology: Combination of star and bus topologies. Devices are arranged in a hierarchical manner. Scalable and easy to manage.
- Hybrid Topology: Combination of two or more topologies. Flexible and scalable.
OSI Reference Model: Layers & Functions
The OSI (Open Systems Interconnection) reference model is a conceptual framework developed by ISO (International Organization for Standardization). It describes how data travels from one computer to another over a network using seven layers, where each layer has a specific function.
Layers of the OSI Model:
- Application Layer (Layer 7): Closest to the user. Provides services like email, file transfer, web browsing. Examples: HTTP, FTP, SMTP.
- Presentation Layer (Layer 6): Translates data between application and network. Handles data encryption, compression, and formatting. Example: JPEG, SSL.
- Session Layer (Layer 5): Manages sessions (connections) between devices. Controls login, logout, and session maintenance.
- Transport Layer (Layer 4): Ensures complete data transfer with error checking. Responsible for segmentation and reassembly. Protocols: TCP, UDP.
- Network Layer (Layer 3): Handles data routing and addressing. Finds the best path for data. Protocols: IP, ICMP.
- Data Link Layer (Layer 2): Manages node-to-node data transfer. Detects and corrects errors in the physical layer. Example: MAC address, Ethernet.
- Physical Layer (Layer 1): Deals with the physical connection (cables, switches, signals). Transmits raw bits over the medium.
TCP/IP Reference Model: Layers & Protocols
The TCP/IP (Transmission Control Protocol/Internet Protocol) reference model is a practical framework used to design and implement computer networks, especially the Internet. It was developed by the U.S. Department of Defense and is the foundation of modern networking.
Layers of the TCP/IP Model:
- Application Layer: Provides services to the user (e.g., email, file transfer, web browsing). Combines the Application, Presentation, and Session layers of OSI. Protocols: HTTP, FTP, SMTP, DNS.
- Transport Layer: Ensures reliable or fast delivery of data between devices. Responsible for error checking, flow control, and data segmentation. Protocols: TCP (reliable) and UDP (faster, no guarantee).
- Internet Layer: Handles logical addressing and routing of data packets. It ensures data reaches the correct destination. Protocols: IP, ICMP, ARP.
- Network Access Layer (or Link Layer): Manages the physical transmission of data over a medium. Includes both the Data Link and Physical layers of OSI. Deals with MAC addresses, Ethernet, Wi-Fi, etc.
OSI vs. TCP/IP Model: Key Differences
Here’s a comparison between the OSI and TCP/IP reference models:
OSI Model:
- Stands for Open Systems Interconnection.
- Has 7 layers.
- Developed by ISO (International Organization for Standardization).
- Has separate Presentation and Session layers.
- Model was defined before implementation took place (theoretical).
- Based on three concepts: service, interface, and protocol.
TCP/IP Model:
- Stands for Transmission Control Protocol / Internet Protocol.
- Has 4 layers.
- Developed by the U.S. Department of Defense.
- Does not have separate Presentation and Session layers (they are combined into the Application layer).
- Model was defined after protocols were implemented (practical).
- Does not strictly distinguish between services, interface, and protocol.
Network Transmission Media Types
Transmission media are the physical paths or channels through which data is transmitted from one device to another in a network.
- Guided Media (Wired Media): Data travels through physical cables.
- Twisted Pair Cable: Two insulated copper wires twisted together. Used in telephone lines and LANs. Types: UTP (Unshielded), STP (Shielded). Cheap but limited range.
- Coaxial Cable: Copper core with insulation and shielding. Used in cable TV and older LANs. Better shielding than twisted pair.
- Optical Fiber Cable: Uses light signals through glass fibers. Very high speed and long-distance transmission. Expensive but highly secure and fast.
- Unguided Media (Wireless Media): Data travels through air using electromagnetic waves.
- Radio Waves: Used in AM/FM radios, mobile phones. Can travel long distances. Low frequency, omnidirectional.
- Microwaves: Used in satellite and long-distance communication. Needs line-of-sight. Higher frequency than radio waves.
- Infrared: Used in TV remotes, short-distance wireless devices. Cannot pass through walls. Short range and high frequency.
Network Switching Techniques Explained
Switching is a method used in computer networks to forward data from source to destination through various network devices. There are three main types of switching techniques:
- Circuit Switching: A dedicated physical path is established between sender and receiver before communication starts. The path remains reserved for the entire duration of the call. Example: Traditional telephone network. Reliable connection. Constant data rate.
- Packet Switching: Data is divided into small packets. Each packet is sent independently and may take different paths. No fixed path is reserved. Example: Internet communication. Efficient use of bandwidth. More flexible and robust.
- Message Switching: The entire message is sent and stored at each intermediate device before forwarding. No need for a dedicated path. No need for dedicated circuits. Can handle large messages.
Circuit vs. Packet Switching Comparison
Here’s a comparison between Circuit Switching and Packet Switching:
Circuit Switching:
- A physical path is established between source and destination.
- All packets use the same path.
- Reserves the entire bandwidth in advance.
- Can lead to bandwidth wastage.
- No store-and-forward transmission.
Packet Switching:
- No physical path is established.
- Packets travel independently and may take different paths.
- Does not reserve bandwidth in advance.
- No bandwidth wastage (more efficient).
- Supports store-and-forward transmission.
Virtual Circuit Switching Definition
Virtual Circuit Switching is a network communication method where a predefined logical path (called a virtual circuit) is established between the sender and receiver before data transfer begins. It combines features of both circuit switching and packet switching. The virtual circuit remains active for the duration of the communication session. Each packet carries a virtual circuit identifier instead of the full destination address. Used in networks like Frame Relay and ATM.
Data Link Layer Functions
The Data Link Layer is the second layer of the OSI model. It provides reliable communication between two directly connected nodes by performing the following key functions:
- Framing: Divides raw bits from the Physical Layer into frames (structured packets) for easier handling.
- Physical Addressing: Adds MAC (Media Access Control) addresses to frames to identify the source and destination devices on the same network.
- Error Detection and Correction: Detects errors in transmitted frames using techniques like CRC (Cyclic Redundancy Check) and may request retransmission if errors occur.
- Flow Control: Manages the rate of data transmission between sender and receiver to prevent overwhelming slower devices.
- Access Control: Controls which device can use the physical medium at a given time, especially in shared media (e.g., Ethernet).
Slotted Aloha Protocol & Efficiency
Slotted Aloha is a random access protocol used in network communication to control how multiple users share a communication channel and avoid collisions. Time is divided into discrete intervals called time slots, each equal to the time required to send one frame. Users are allowed to start transmitting only at the beginning of a time slot. If two or more users transmit in the same time slot, a collision occurs and all transmissions fail. If only one user transmits in a time slot, the transmission is successful.
Maximum Efficiency Calculation:
Let G = average number of transmission attempts per time slot (including retransmissions). For successful transmission in a slot, exactly one frame should be sent, and others should remain silent.
The probability that exactly one frame is transmitted in a slot (throughput S) is given by:
S = G × e–G
To find the maximum efficiency, differentiate S with respect to G and set it to zero. The maximum efficiency for Slotted Aloha occurs when G = 1, and the maximum throughput is Smax = 1 × e-1 = 1/e ≈ 0.368 or 36.8%.
IPv4 Addressing & Format
IPv4 is the fourth version of the Internet Protocol and is widely used to identify devices on a network through an addressing system. It is a 32-bit address scheme used to uniquely identify a device (host) on an IP network. IPv4 addresses are written in dotted decimal notation, divided into 4 octets (8 bits each), separated by dots.
IPv4 Address Format:
An IPv4 address is composed of 32 bits, grouped into 4 octets:
Octet 1 | Octet 2 | Octet 3 | Octet 4 |
---|---|---|---|
8 bits | 8 bits | 8 bits | 8 bits |
Distance Vector Routing Explained
Distance Vector Routing is a routing protocol used by routers to determine the best path to reach a destination in a network. Each router maintains a routing table that stores the best known distance (cost) to each destination and the next hop (neighbor) to reach that destination. The “distance” is usually the number of hops or a cost metric.
- Periodically, each router shares its routing table with its directly connected neighbors.
- Each router knows the distance to its immediate neighbors.
- Routers exchange their routing tables with neighbors at regular intervals.
- Using the Bellman-Ford algorithm, routers update their tables by selecting the path with the minimum distance.
- Over time, all routers agree on the shortest paths.
RIP & OSPF Routing Protocols
Routing Information Protocol (RIP):
- A Distance Vector Routing Protocol.
- Uses hop count as the routing metric.
- Maximum allowed hops are 15; 16 means the destination is unreachable.
- Routers send their entire routing table to neighbors every 30 seconds.
- Uses the Bellman-Ford algorithm to calculate the best path.
- Simple and easy to configure.
- Suitable for small to medium-sized networks.
- Slow convergence and prone to routing loops.
- Limited scalability due to hop count limit.
Open Shortest Path First (OSPF):
- A Link-State Routing Protocol.
- Uses cost based on link bandwidth (higher bandwidth = lower cost).
- Routers exchange link-state advertisements (LSAs) to share topology info.
- Each router builds a complete map of the network.
- Uses Dijkstra’s algorithm to compute the shortest path.
- Faster convergence than RIP.
- Supports large and complex networks.
- Supports hierarchical design using areas.
- More complex to configure but more efficient and scalable.
IPv6 Addressing & Format
IPv6 is the latest version of the Internet Protocol designed to replace IPv4 due to the exhaustion of IPv4 addresses. It uses a 128-bit address scheme, allowing for a vastly larger number of unique IP addresses. IPv6 supports improved routing, better security, and efficient packet processing.
IPv6 Address Format:
The IPv6 address is 128 bits long and written in eight groups of four hexadecimal digits, separated by colons (:). Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Key Networking Concepts: Short Notes
- Shortest Path Algorithm: It is an algorithm used in networking to find the minimum cost path between nodes. The most common algorithm is Dijkstra’s algorithm. It calculates the shortest path from a source node to all other nodes in the network.
- Flooding: Flooding is a simple routing technique where every incoming packet is sent out on all outgoing links except the one it arrived on. Ensures the packet reaches all parts of the network. Useful in broadcasting and multicasting.
- ICMP (Internet Control Message Protocol): ICMP is a network layer protocol used for error reporting and diagnostics. It sends messages like Destination Unreachable, Echo Request (ping), and Time Exceeded. Helps manage and control the behavior of IP networks.
- BGP (Border Gateway Protocol): BGP is the standard inter-domain routing protocol used to exchange routing information between different autonomous systems (AS) on the Internet. It is a path vector protocol.
- Link State Routing: Link State Routing protocols maintain a complete map of the network topology. Each router independently calculates the best path using algorithms like Dijkstra’s algorithm.