Unit 2: Data Communication and Networking (15 Hours)
2.1 Basic Elements of a Communication System
A communication system is a collection of hardware and software components that facilitate the exchange of information between two or more entities. Understanding its basic elements is crucial for comprehending how data travels from a source to a destination.
- Source (Encoder): This is the origin of the data message. It generates the information to be transmitted, which could be text, audio, video, or any other form of data. The source often includes an encoder that converts the raw information into a suitable electrical or optical signal for transmission.
- Transmitter: The transmitter's role is to convert the encoded information into a signal that can be effectively transmitted over the chosen channel. This often involves modulation, where the information signal modifies a carrier wave. It also amplifies the signal to ensure it reaches the destination.
- Channel (Medium): This is the physical or logical path through which the transmitted signal travels from the transmitter to the receiver. Channels can be guided (wired, like cables) or unguided (wireless, like air). The characteristics of the channel significantly impact signal quality and transmission speed.
- Receiver (Decoder): The receiver's function is to capture the incoming signal from the channel and convert it back into the original information format. This involves demodulation (reversing the modulation process) and decoding (reversing the encoding process).
- Destination: This is the intended recipient of the message. Once the receiver has processed the signal, the information is delivered to the destination, which could be a computer, a human user, or another device.
Analog vs. Digital Communication Systems
Communication systems can be broadly categorized into analog and digital based on the nature of the signals they process.
- Analog Communication Systems: In an analog system, the information is transmitted using continuous, time-varying signals. These signals are direct representations of the original information, mirroring its fluctuations. Examples include traditional radio broadcasting, old telephone systems, and analog television.
Example: A microphone converts sound waves (analog) into an electrical analog signal, which is then transmitted and received by a speaker that converts it back into sound.
- Digital Communication Systems: Digital systems convert information into discrete binary values (0s and 1s) before transmission. These discrete signals are less susceptible to noise and can be regenerated more easily, leading to higher fidelity over long distances. Most modern communication, including computer networks, mobile phones, and digital TV, uses digital communication.
Example: A computer converts text into binary data, which is then transmitted as a series of electrical pulses or light signals and reassembled at the destination.
2.2 Concept of Communication System
Several key concepts define the performance and capabilities of any communication system.
- Bandwidth (Hz): Bandwidth refers to the range of frequencies that a channel can transmit. In data communication, it often represents the maximum theoretical data transfer rate of a network path. A wider bandwidth allows for more data to be transmitted simultaneously.
- Data Rate (bps): Data rate, measured in bits per second (bps), indicates how much data can be transmitted over a communication channel in a given amount of time. It's the actual speed at which data is moved. While bandwidth defines the capacity, data rate is the actual speed achieved.
- Signal-to-Noise Ratio (SNR): SNR is a measure used in science and engineering that compares the level of a desired signal to the level of background noise. A higher SNR indicates a clearer signal and better communication quality.
SNR = Ps / PnWhere:Ps= Average signal powerPn= Average noise power
SNR_dB = 10 * log10(Ps / Pn)Example: If a signal has a power of 100mW and the noise has a power of 1mW, the SNR is 100 (or 20 dB), indicating a strong signal relative to noise.
- Throughput: Throughput refers to the actual rate at which data is successfully delivered over a communication channel. Unlike data rate, which is often theoretical, throughput accounts for overhead, retransmissions, and network congestion. It's the "effective" data rate.
- Latency: Latency is the time delay between the cause and effect in a system. In networking, it's the time it takes for a data packet to travel from one point to another. High latency can lead to noticeable delays in real-time applications like video conferencing.
- Propagation Delay: Propagation delay is the time required for a signal to travel across a physical medium from the sender to the receiver. It is determined by the distance and the speed at which the signal travels through the medium.
Propagation Delay = Distance / Speed of SignalExample: A signal traveling 3000 km through fiber optic cable (where light travels at approx. 2 x 10^8 m/s) would have a propagation delay of
(3 x 10^6 meters) / (2 x 10^8 m/s) = 0.015 secondsor 15 milliseconds.
2.3 Block Diagram of Communication System/Model
A generalized block diagram illustrates the fundamental components and their interaction within a communication system.
Information Source → Transmitter → Channel → Receiver → Destination
This basic model can be expanded to include other critical elements:
- Information Source: Originates the message (e.g., a person speaking, a computer sending data).
- Transmitter: Converts the message into a transmittable signal (e.g., microphone, modem).
- Channel: The medium through which the signal travels (e.g., air, cable).
- Noise Source: External interference or unwanted signals that corrupt the transmitted signal, primarily affecting the channel. Noise can introduce errors in the data.
- Receiver: Converts the received signal back into a message (e.g., speaker, modem).
- Destination: The ultimate recipient of the message (e.g., a listener, a computer).
- Feedback Path: In some interactive communication systems, a feedback path allows the destination or receiver to send acknowledgment or control signals back to the source or transmitter. This is essential for error control and flow control in many digital communication protocols.
Diagram Description: Imagine a linear flow from left to right. "Information Source" feeds into "Transmitter". "Transmitter" sends a signal into "Channel". A "Noise Source" arrow points into the "Channel" indicating interference. The "Channel" then leads to "Receiver", which finally feeds into "Destination". An optional "Feedback Path" arrow would go from "Receiver" or "Destination" back towards "Source" or "Transmitter".
2.4 Elements of Data Communication/Transmission
Data communication specifically focuses on the electronic exchange of information. Key elements include:
- Message: The data or information to be communicated. It can be text, numbers, pictures, audio, video, or any combination.
- Sender: The device that sends the data message. This could be a computer, workstation, telephone, video camera, etc.
- Receiver: The device that receives the data message. This could also be a computer, workstation, telephone, etc.
- Transmission Medium: The physical path by which a message travels from sender to receiver. Examples include twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves.
- Protocol: A set of rules that governs data communication. It dictates how data is formatted, transmitted, received, and interpreted. Without protocols, two devices may be connected but cannot communicate effectively.
Data Encoding, Modulation, Multiplexing
- Data Encoding: The process of converting data from one format to another, typically for security, compression, or efficient transmission. In digital communication, this often means converting raw binary data into a specific signal pattern that can be sent over a physical medium (e.g., Non-Return-to-Zero (NRZ), Manchester encoding).
- Modulation: The process of varying one or more properties of a periodic waveform, called the carrier signal, with a modulating signal that typically contains information to be transmitted. Modulation is essential for converting digital signals into analog signals suitable for analog transmission channels (e.g., telephone lines, radio waves) and vice-versa. Common types include Amplitude Modulation (AM), Frequency Modulation (FM), and Phase Modulation (PM).
- Multiplexing: A technique that allows multiple data streams to be combined and transmitted simultaneously over a single shared communication channel. This efficiently utilizes the channel's capacity. Common types are:
- Frequency Division Multiplexing (FDM): Divides the channel into different frequency bands, each carrying a separate signal (e.g., radio stations).
- Time Division Multiplexing (TDM): Divides the channel's time into slots, with each slot assigned to a different signal (e.g., digital telephone networks).
2.5 Simplex, Half Duplex, and Full Duplex
These terms describe the direction of data flow between two devices.
- Simplex:
Communication is unidirectional, meaning data flows in only one direction from sender to receiver. The receiver cannot send data back to the sender.
Diagram Description: A single arrow pointing from Device A to Device B.
Example: A traditional television broadcast where the TV receives signals but cannot send any back to the broadcaster. Another common example is a keyboard sending input to a computer.
- Half Duplex:
Communication is bidirectional, but only one device can transmit at a time. Devices take turns sending and receiving data.
Diagram Description: Two arrows between Device A and Device B, one pointing in each direction, with a note indicating "one at a time."
Example: Walkie-talkies. One person speaks while the other listens; then they release a button to allow the other person to speak. Data cannot flow simultaneously in both directions.
- Full Duplex:
Communication is bidirectional and simultaneous. Both devices can send and receive data at the same time.
Diagram Description: Two arrows between Device A and Device B, one pointing in each direction, with a note indicating "simultaneously."
Example: A standard telephone conversation, where both parties can speak and hear each other at the same time. Modern internet connections (e.g., Ethernet) are typically full-duplex.
2.6 Concept of LAN and WAN
Networks are categorized based on their geographical scope and scale.
- LAN (Local Area Network):
A network that connects devices within a relatively small, confined geographical area, such as a single building, office, or campus. LANs typically offer high data transfer rates.
- Coverage: <10 km (e.g., a university campus, a home network).
- Speed: Generally high (100 Mbps to 10 Gbps or more).
- Cost: Relatively low setup and maintenance costs.
- Ownership: Typically privately owned by an organization or individual.
- WAN (Wide Area Network):
A network that spans a large geographical area, connecting multiple LANs over long distances. WANs can cover cities, countries, or even the entire globe.
- Coverage: >100 km (e.g., the internet, corporate networks connecting branches across cities).
- Speed: Generally lower than LANs due to longer distances and shared infrastructure, but can vary.
- Cost: High setup and maintenance costs due to extensive infrastructure and leased lines.
- Ownership: Often owned by telecommunication companies, with services leased by organizations.
Comparison with MAN and PAN
- MAN (Metropolitan Area Network): Spans a city or a large campus, typically connecting several LANs. Larger than a LAN but smaller than a WAN.
- PAN (Personal Area Network): Connects devices within an individual's personal workspace, usually within a few meters (e.g., Bluetooth devices, USB connections).
Comparison Table: LAN vs. WAN
| Feature | LAN (Local Area Network) | WAN (Wide Area Network) |
|---|---|---|
| Geographical Area | Small (building, campus, <10km) | Large (city, country, global, >100km) |
| Speed | High (100 Mbps - 10 Gbps+) | Lower (relative to LAN, but improving) |
| Cost | Lower | Higher |
| Ownership | Private | Often public/leased (telecoms) |
| Error Rate | Low | Higher |
2.7 Transmission Medium
The transmission medium is the physical path over which data travels. It can be guided (wired) or unguided (wireless).
Guided (Wired) Media
Signals are confined to a physical path.
- Unshielded Twisted Pair (UTP):
Consists of pairs of insulated copper wires twisted together to reduce electromagnetic interference (EMI) and crosstalk. Widely used in Ethernet LANs.
Example: Cat5e, Cat6 cables used for home and office internet.
- Shielded Twisted Pair (STP):
Similar to UTP but includes an additional metallic foil or braid shield around the twisted pairs to provide better protection against external noise and EMI. More expensive and thicker than UTP.
Example: Used in environments with high electrical interference.
- Coaxial Cable:
Consists of a central copper conductor, an insulating layer, a metallic shield, and an outer insulating jacket. Offers better shielding and higher bandwidth than twisted pair. Used in cable TV and older Ethernet networks.
Example: RG-6 cable used for cable television connections.
- Fiber Optic Cable:
Transmits data using pulses of light through thin strands of glass or plastic. Offers extremely high bandwidth, long distances, and immunity to EMI.
- Single-mode fiber: Uses a very thin core, allowing only one path for light, suitable for very long distances and extremely high bandwidth.
- Multi-mode fiber: Uses a wider core, allowing multiple light paths, suitable for shorter distances (e.g., within a building or campus).
Example: Used for high-speed internet backbones, data centers, and modern FTTx (Fiber to the X) deployments.
Unguided (Wireless) Media
Signals travel through the air or space without a physical conductor.
- Radio Waves: Omnidirectional, can penetrate walls. Used for broadcasting, Wi-Fi, and cellular communication.
- Microwave: Unidirectional, line-of-sight transmission. Used for long-distance communication, satellite communication (ground links), and wireless WANs.
- Infrared: Short-range, line-of-sight, cannot penetrate walls. Used for remote controls, short-range wireless links.
- Satellite: Uses satellites in Earth's orbit to relay signals over very long distances, including global coverage.
Comparison Table: Transmission Media Characteristics
| Medium Type | Bandwidth | Distance | Interference | Cost |
|---|---|---|---|---|
| UTP | Moderate to High | Short (100m) | Moderate | Low |
| STP | Moderate to High | Short (100m) | Low | Moderate |
| Coaxial Cable | Moderate | Moderate (500m) | Low | Moderate |
| Fiber Optic | Very High | Very Long (km) | Very Low (immune to EMI) | High |
| Radio Waves | Low to Moderate | Long | High | Low to Moderate |
| Microwave | High | Long (line-of-sight) | Moderate | Moderate to High |
| Infrared | Moderate | Very Short (line-of-sight) | High (light, heat) | Low |
| Satellite | High | Global | Moderate | Very High |
2.8 Transmission Impairments
Signals traveling through a transmission medium are subject to various impairments that can degrade their quality.
- Jitter (Variation in Delay):
Refers to the variation in the delay of received packets. It's the undesirable deviation from true periodicity of an assumed periodic signal. High jitter can lead to choppy audio or video in real-time applications.
Example: In VoIP calls, if packets arrive with inconsistent delays, parts of the conversation might sound distorted or cut out.
- Singing:
An audible oscillation or feedback loop, often heard in telephone systems, caused by impedance mismatches or excessive amplification in a circuit. It's a continuous, high-pitched tone.
- Echo:
A reflection of a signal back to its source, often caused by impedance mismatches in the transmission line. In voice communication, it's hearing your own voice delayed.
- Crosstalk (Signal Interference Between Wires):
The phenomenon where a signal transmitted on one circuit or channel creates an undesired effect on another circuit or channel. It's electrical interference from adjacent wires.
Example: Hearing a faint conversation from another phone line on your own line in older telephone systems. In Ethernet, it can degrade signal quality.
- Distortion (Signal Shape Change):
Occurs when the signal changes its form or shape. This can be due to different frequency components of a signal traveling at different speeds through the medium (delay distortion) or the signal's amplitude being altered disproportionately (amplitude distortion).
- Noise (Unwanted Signal):
Any unwanted energy that interferes with the reception of the desired signal. Noise is always present and can originate from various sources (thermal noise, impulse noise, crosstalk, power lines). It degrades the signal-to-noise ratio and can lead to data errors.
Bandwidth and Impairments
Bandwidth: In the context of impairments, bandwidth represents the maximum data capacity of a channel under ideal conditions. Impairments reduce the effective bandwidth and achievable data rate by making it harder to distinguish the signal from noise, thus requiring more error correction or retransmissions.
2.9 Network Architecture
Network architecture defines the fundamental design and operational structure of a computer network.
- Client-Server:
A centralized network architecture where clients (workstations, devices) request services or resources from a central server. The server manages resources, security, and data storage. It's the dominant model for most enterprise networks and the internet.
- Centralized Server: Stores data and applications, manages access.
- Client Requests: Clients send requests to the server and receive responses.
- Scalable: Easy to add more clients or upgrade server capacity.
- Performance: Can be high if the server is powerful, but can be a bottleneck.
- Security: Centralized control makes security management easier.
Example: Web servers serving web pages to browsers, email servers managing inboxes.
- Peer-to-Peer (P2P):
A decentralized network architecture where all connected nodes (peers) have equal capabilities and responsibilities. Each peer can act as both a client and a server, sharing resources directly with other peers without a central server.
- Equal Nodes: No dedicated server; all devices are equal.
- No Central Server: Resources are distributed among peers.
- Resource Sharing: Easy to share files and printers directly.
- Performance: Can degrade as more peers join, depends on individual peer capabilities.
- Security: More challenging to manage security and backups without centralization.
Example: File-sharing networks (like BitTorrent), some online gaming, small home networks.
Comparison Table: Client-Server vs. Peer-to-Peer
| Feature | Client-Server | Peer-to-Peer |
|---|---|---|
| Centralization | Centralized (server) | Decentralized (no central server) |
| Resource Management | Server manages resources | Each peer manages its own resources |
| Scalability | Highly scalable (by upgrading server) | Less scalable (performance degrades with more peers) |
| Security | Easier to implement and manage | More difficult to manage and enforce |
| Cost | Higher (dedicated server hardware/software) | Lower (no dedicated server) |
| Reliability | Single point of failure (server) | More robust (if one peer fails, others can still operate) |
2.10 Basic Terms and Tools
Understanding these fundamental terms and tools is essential for navigating data networks.
- Protocol: A set of formal rules and procedures that govern how data is exchanged between two or more devices. Protocols ensure that devices can understand each other.
- HTTP (Hypertext Transfer Protocol): Used for transmitting web pages over the internet.
- FTP (File Transfer Protocol): Used for transferring files between computers on a network.
- TCP (Transmission Control Protocol): Provides reliable, ordered, and error-checked delivery of a stream of bytes between applications.
- IP (Internet Protocol): Responsible for addressing and routing packets of data across networks.
- IP Address: A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It identifies the device and its location on the network. (e.g.,
192.168.1.1for IPv4,2001:0db8:85a3:0000:0000:8a2e:0370:7334for IPv6). - MAC Address (Media Access Control Address): A unique physical address assigned to a network interface controller (NIC) for communications within a network segment. It is a hardware address, typically hardcoded into the NIC by the manufacturer. (e.g.,
00:1A:2B:3C:4D:5E). - Port Number: A 16-bit number used by protocols like TCP and UDP to identify specific applications or services running on a network device. It allows multiple applications to share a single IP address. (e.g., HTTP uses port 80, HTTPS uses port 443).
- DNS (Domain Name System): A hierarchical and decentralized naming system for computers, services, or any resource connected to the Internet or a private network. It translates human-readable domain names (e.g.,
google.com) into numerical IP addresses. - DHCP (Dynamic Host Configuration Protocol): A network management protocol used on Internet Protocol (IP) networks for dynamically distributing network configuration parameters, such as IP addresses, to connected devices. It automates the process of assigning IP addresses.
Network Tools
- ping: A command-line utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer.
- traceroute (tracert on Windows): A network diagnostic tool for displaying the path (route) and measuring transit delays of packets across an Internet Protocol (IP) network. It shows all the routers a packet passes through.
- netstat: A command-line network utility that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics.
- nslookup: A network administration command-line tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or for any other specific DNS record.
2.11 Network Tools
Beyond basic command-line tools, specialized software aids in network management and simulation.
- Packet Tracer:
A powerful network simulation tool developed by Cisco Systems. It allows users to create network topologies, configure devices (routers, switches, PCs), and simulate network behavior. It's widely used for teaching and learning networking concepts, designing network layouts, and practicing for Cisco certification exams.
Example: A student can build a virtual LAN with multiple switches and PCs, configure IP addresses, and test connectivity using
pingcommands within the simulator. - Remote Login:
Protocols and tools that allow a user to access and control a computer or server from a remote location over a network.
- SSH (Secure Shell): A cryptographic network protocol for operating network services securely over an unsecured network. It provides a secure channel over an unsecured network by using a client-server architecture, connecting an SSH client application with an SSH server. Used for secure remote command-line access.
- Telnet: An older network protocol used to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. It is unencrypted and thus insecure for sensitive data.
- RDP (Remote Desktop Protocol): A proprietary protocol developed by Microsoft, which provides a user with a graphical interface to connect to another computer over a network connection. Widely used for remote administration and technical support on Windows systems.
- VNC (Virtual Network Computing): A graphical desktop sharing system that uses the RFB (Remote FrameBuffer) protocol to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction. Cross-platform compatible.
2.12 Network Connecting Devices
Various hardware devices are used to connect computers and other network devices, facilitating data flow.
- NIC (Network Interface Card):
A hardware component that connects a computer to a computer network. It provides the physical layer (Layer 1) and data link layer (Layer 2) functionality, allowing the computer to send and receive data over the network medium.
Example: The Ethernet port on your computer or a Wi-Fi adapter.
- Modem (Modulator-Demodulator):
A device that converts digital signals from a computer into analog signals suitable for transmission over analog communication lines (like telephone lines or cable TV lines), and vice versa. It enables data communication over media not designed for digital signals.
Example: A DSL modem converts digital data from your router into analog signals for the phone line, and converts incoming analog signals back to digital.
- Router:
A networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet. They operate at the Network Layer (Layer 3) of the OSI model, using IP addresses to determine the best path for data packets.
Example: Your home Wi-Fi router connects your local network to the internet.
- Switch:
A networking device that connects devices within a Local Area Network (LAN). Unlike a hub, a switch learns the MAC addresses of connected devices and forwards data packets only to the intended recipient, improving network efficiency and performance. Switches operate at the Data Link Layer (Layer 2) of the OSI model.
Example: An Ethernet switch in an office connects multiple computers, printers, and servers to each other.
Hub vs. Switch vs. Router Comparison
| Feature | Hub | Switch | Router |
|---|---|---|---|
| OSI Layer | Physical (Layer 1) | Data Link (Layer 2) | Network (Layer 3) |
| Function | Broadcasts data to all ports | Forwards data to specific port (MAC address) | Routes data between different networks (IP address) |
| Collision Domain | One large collision domain | Each port is a separate collision domain | Each port is a separate broadcast domain |
| Broadcast Domain | One large broadcast domain | One large broadcast domain (default) | Each port is a separate broadcast domain |
| Intelligence | Dumb (repeats signals) | Smart (learns MAC addresses) | Intelligent (finds best path) |
| Cost | Lowest | Moderate | Highest |
2.13 Network Topologies
Network topology refers to the physical or logical arrangement of connected devices in a network.
- Bus Topology:
All devices are connected to a single central cable, called the backbone or bus. Data travels in both directions along the bus, and terminators are used at each end to prevent signal reflection.
Diagram Description: A horizontal line representing the bus cable, with multiple vertical lines connecting devices (computers) to it. Terminators are at each end of the horizontal line.
- Advantages: Easy to install, less cabling.
- Disadvantages: Single point of failure (bus cable), difficult to troubleshoot, collision prone, performance degrades with more devices.
- Example: Older Ethernet networks (10Base2, 10Base5).
- Ring Topology:
Devices are connected in a circular fashion, forming a closed loop. Data travels in one direction around the ring, often using a token-passing mechanism to prevent collisions.
Diagram Description: Devices (computers) arranged in a circle, with lines connecting each device to its immediate neighbors, forming a closed loop. Arrows indicate unidirectional data flow.
- Advantages: Orderly data transfer (token passing), can handle high volumes of traffic.
- Disadvantages: Single point of failure (break in the ring), adding/removing devices disrupts the network.
- Example: Token Ring networks (less common today).
- Star Topology:
All devices are individually connected to a central connecting device, such as a hub or a switch. This is the most common topology in modern LANs.
Diagram Description: A central circle (hub/switch) with lines radiating outwards to multiple devices (computers) arranged around it.
- Advantages: Easy to install and manage, fault isolation (failure of one device doesn't affect others), easy to add/remove devices.
- Disadvantages: Central device is a single point of failure, requires more cabling than bus.
- Example: Most modern Ethernet LANs in homes and offices.
- Mesh Topology (brief):
Every device is connected directly to every other device. Provides high redundancy and fault tolerance but is very expensive and complex to implement for large networks.
Diagram Description: All devices are interconnected with direct lines to every other device.
- Tree Topology (brief):
A hybrid of bus and star topologies, where star networks are connected to a central bus cable. Hierarchical structure.
Diagram Description: A main bus line with multiple star networks branching off it.
2.14 Basic Concept of OSI Reference Model
The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes the functions of a communication system into seven distinct layers. It helps in understanding how different network protocols and technologies interact.
- Physical Layer (Layer 1):
- Function: Deals with the physical transmission of raw bit streams over the physical medium. It defines electrical, mechanical, procedural, and functional specifications for activating, maintaining, and deactivating the physical link.
- PDU (Protocol Data Unit): Bits
- Example: Cables (Ethernet, fiber optic), connectors (RJ45), hubs, repeaters.
- Data Link Layer (Layer 2):
- Function: Provides reliable data transfer across the physical link. It handles error detection and correction, flow control, and defines physical addressing (MAC addresses). It is divided into Logical Link Control (LLC) and Media Access Control (MAC) sublayers.
- PDU: Frames
- Example: Ethernet, Wi-Fi, switches, NICs.
- Network Layer (Layer 3):
- Function: Responsible for logical addressing (IP addresses) and routing data packets across different networks. It determines the best path for data from source to destination.
- PDU: Packets
- Example: IP, routers.
- Transport Layer (Layer 4):
- Function: Provides end-to-end communication between processes (applications) on different hosts. It handles segmentation, reassembly, flow control, and error control.
- PDU: Segments (TCP) or Datagrams (UDP)
- Example: TCP, UDP.
- Session Layer (Layer 5):
- Function: Establishes, manages, and terminates communication sessions between applications. It handles dialog control (who sends, when) and synchronization.
- PDU: Data
- Example: NetBIOS, RPC.
- Presentation Layer (Layer 6):
- Function: Translates data between application and network formats. It handles data encryption, decryption, compression, and formatting (e.g., ASCII, JPEG).
- PDU: Data
- Example: JPEG, MPEG, SSL/TLS encryption.
- Application Layer (Layer 7):
- Function: Provides network services directly to end-user applications. It enables users to interact with network services.
- PDU: Data
- Example: HTTP, FTP, SMTP, DNS.
Encapsulation and Decapsulation Process
Encapsulation: As data travels down the OSI layers from the Application layer to the Physical layer at the sender, each layer adds its own header (and sometimes a footer) to the data received from the layer above. This process of adding control information is called encapsulation. The original data is "encapsulated" within the protocol data unit of each successive layer.
Decapsulation: At the receiver, as the data travels up the OSI layers from the Physical layer to the Application layer, each layer removes its corresponding header and footer, processes the control information, and passes the remaining data up to the next higher layer. This process is called decapsulation, eventually revealing the original data to the receiving application.
Diagram Description: Sender side: "Data (L7)" → "L6 Header + Data (L7)" → "L5 Header + L6 Header + Data (L7)" ... → "L1 Header + L2 Header + ... + Data (L7) + L2 Footer" (Bits on wire). Receiver side: "Bits on wire" → "Remove L1 Header" → "Remove L2 Header/Footer" ... → "Data (L7)".
OSI vs. TCP/IP Model Comparison
The TCP/IP model is another widely used networking model, which evolved from the ARPANET and is the basis for the Internet. It is a more practical, four-layer model.
| OSI Model (7 Layers) | TCP/IP Model (4 Layers) |
|---|---|
| 7. Application Layer | 4. Application Layer (HTTP, FTP, DNS, SMTP) |
| 6. Presentation Layer | |
| 5. Session Layer | |
| 4. Transport Layer (TCP, UDP) | 3. Transport Layer (TCP, UDP) |
| 3. Network Layer (IP) | 2. Internet Layer (IP, ICMP) |
| 2. Data Link Layer | 1. Network Access Layer (Ethernet, Wi-Fi) |
| 1. Physical Layer |
2.15 Internet Protocol Addressing
IP addressing is fundamental to how devices communicate across networks.
- IPv4 (Internet Protocol version 4):
The most widely used version of IP. It uses a 32-bit address scheme, typically represented in dotted decimal notation (e.g.,
192.168.1.1). This allows for approximately 4.3 billion unique addresses.Example:
192.168.1.10is a common IPv4 address for a device on a local network.
Classful Addressing (IPv4)
An older method of IP address allocation, dividing IP addresses into classes (A, B, C, D, E) based on the first few bits of the address, each with a default subnet mask.
- Class A: First bit is 0. Range:
1.0.0.0to126.255.255.255. Default Mask:255.0.0.0(/8). Designed for very large networks. - Class B: First two bits are 10. Range:
128.0.0.0to191.255.255.255. Default Mask:255.255.0.0(/16). Designed for medium-sized networks. - Class C: First three bits are 110. Range:
192.0.0.0to223.255.255.255. Default Mask:255.255.255.0(/24). Designed for small networks. - Class D: (Multicast) First four bits are 1110. Range:
224.0.0.0to239.255.255.255. - Class E: (Experimental) First four bits are 1111. Range:
240.0.0.0to255.255.255.255.
Subnetting Basics, Subnet Mask, CIDR Notation
- Subnetting: The process of dividing a larger network into smaller, more manageable subnetworks (subnets). This improves efficiency, security, and reduces broadcast traffic.
- Subnet Mask: A 32-bit number that distinguishes the network address portion of an IP address from the host address portion. It's used by devices to determine if a destination IP address is on the same local network or a different one.
Example: For an IP
192.168.1.10and subnet mask255.255.255.0, the network portion is192.168.1and the host portion is10. - CIDR (Classless Inter-Domain Routing) Notation: A method for allocating IP addresses and routing IP packets. It replaces the older classful addressing system. CIDR notation adds a slash (
/) and the number of network bits (prefix length) to an IP address.Example:
192.168.1.0/24indicates that the first 24 bits of the IP address represent the network portion. This is equivalent to a255.255.255.0subnet mask.10.0.0.0/8is equivalent to a255.0.0.0subnet mask.
IPv6 (Internet Protocol version 6)
- 128-bit: Uses a 128-bit address scheme, providing an enormous number of unique addresses (approximately 3.4 x 10^38), solving the address depletion issue of IPv4.
- Hexadecimal Notation: Addresses are typically written as eight groups of four hexadecimal digits, separated by colons (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334). Leading zeros within a group can be omitted, and consecutive groups of zeros can be compressed. - Need for IPv6: Primarily driven by the exhaustion of available IPv4 addresses, especially with the proliferation of internet-connected devices (IoT). IPv6 also offers improved security, better routing efficiency, and auto-configuration capabilities.
Public vs. Private IP Addresses, NAT
- Public IP Address: A globally unique IP address assigned to a network device that is directly accessible from the internet. Every device directly connected to the internet must have a public IP address.
- Private IP Address: IP addresses reserved for use within private networks (LANs) and are not routable on the public internet. These addresses can be reused in different private networks.
- IPv4 Private Ranges:
10.0.0.0to10.255.255.255(Class A)172.16.0.0to172.31.255.255(Class B)192.168.0.0to192.168.255.255(Class C)
- IPv4 Private Ranges:
- NAT (Network Address Translation): A method of remapping an IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing device. NAT allows multiple devices on a private network to share a single public IP address when accessing the internet, conserving public IP addresses.