Data Communications and Networking 5th edition
Chapter 18: Introduction to Network Layer in Data Communications and Networking (5th edition) by Behrouz A. Forouzan:
18.1 NETWORK-LAYER SERVICES
The network layer plays a critical role in delivering data between devices over interconnected networks. It provides the following key services:
18.1.1 Packetizing
- Definition: Packetizing is the process of dividing large chunks of data into smaller units called packets, which are easier to manage, transmit, and process.
- Structure: Each packet contains:
- Payload: The actual data being transmitted.
- Header: Contains metadata such as the source and destination addresses, sequence numbers, and error-checking information.
- Purpose:
- Facilitates efficient use of the network.
- Allows for error detection and recovery by retransmitting only the affected packets instead of the entire data.
18.1.2 Routing and Forwarding
- Routing:
- Involves determining the optimal path for packets to travel from the source to the destination.
- Algorithms like Dijkstra’s and Bellman-Ford are commonly used.
- Factors considered: network topology, link costs, and policy constraints.
- Forwarding:
- The act of moving a packet to its next destination (next-hop router or the final recipient).
- Based on information in the routing table, the router decides the best outgoing link.
18.1.3 Other Services
- Error Handling:
- Detects and sometimes corrects errors in transmitted packets.
- Error detection methods like checksums are used.
- Quality of Service (QoS):
- Ensures performance requirements such as bandwidth, delay, and jitter are met.
- Differentiates traffic types (e.g., voice, video, or text) to prioritize critical data.
18.2 PACKET SWITCHING
Packet switching is a fundamental method for data transfer in modern networks, enabling flexibility and efficiency. It involves breaking data into smaller packets that are sent independently.
18.2.1 Datagram Approach: Connectionless Service
- Characteristics:
- Each packet is treated as an independent entity.
- Packets may take different paths through the network to reach the destination.
- Each packet includes full routing information (source and destination addresses).
- Advantages:
- Highly scalable and robust.
- No need for establishing or maintaining a connection.
- Example: The Internet Protocol (IP) operates using this approach.
18.2.2 Virtual-Circuit Approach: Connection-Oriented Service
- Characteristics:
- A logical connection is established between the source and destination before data transfer.
- All packets follow the same pre-established path, ensuring order.
- Advantages:
- Reliable communication with guaranteed sequencing and error detection.
- Simplified processing at intermediate routers.
- Example: Asynchronous Transfer Mode (ATM) and Multi-Protocol Label Switching (MPLS).
18.3 NETWORK-LAYER PERFORMANCE
The efficiency and reliability of the network layer are measured using the following metrics:
18.3.1 Delay
- Types of Delay:
- Propagation Delay:
- Time for a signal to travel from source to destination through the physical medium.
- Formula: ( \text{Propagation Delay} = \frac{\text{Distance}}{\text{Propagation Speed}} )
- Transmission Delay:
- Time required to push all bits of a packet onto the transmission medium.
- Formula: ( \text{Transmission Delay} = \frac{\text{Packet Size}}{\text{Bandwidth}} )
- Queuing Delay:
- Time a packet spends waiting in a router’s queue before being processed or transmitted.
- Varies depending on network congestion.
- Processing Delay:
- Time taken by a router to examine and forward a packet.
- Includes route lookup, header parsing, and error checking.
- Propagation Delay:
18.3.2 Throughput
- Definition: The rate at which data is successfully transmitted and received over the network.
- Factors Affecting Throughput:
- Bandwidth: The maximum data transfer rate of the medium.
- Network Congestion: Overloaded links or routers reduce throughput.
- Protocol Overhead: Header and control data can consume significant portions of bandwidth.
18.3.3 Packet Loss
- Definition: The percentage of packets that fail to reach their destination due to errors, congestion, or buffer overflow at routers.
- Effects:
- Degrades the quality of real-time applications like VoIP or video streaming.
- Increases retransmissions, causing further delays and congestion.
- Mitigation Techniques:
- Implementing retransmission protocols (e.g., TCP).
- Using redundant packet encoding to recover lost data.
18.3.4 Congestion Control
- Definition: Strategies to prevent and manage excessive packet buildup in the network.
- Techniques:
- Traffic Shaping:
- Regulates the flow of data entering the network to prevent sudden bursts of traffic.
- Example: Token Bucket and Leaky Bucket algorithms.
- Packet Scheduling:
- Prioritizes certain packets based on their importance or type.
- Example: First-Come-First-Serve (FCFS) and Priority Scheduling.
- Retransmission Strategies:
- Automatically resends lost or corrupted packets.
- Includes mechanisms like Automatic Repeat Request (ARQ).
- Traffic Shaping:
18.4 IPv4 ADDRESSES
IPv4 addresses are a fundamental aspect of the network layer, ensuring that devices can be uniquely identified for communication.
18.4.1 Address Space
- 32-Bit Addressing: IPv4 uses a 32-bit structure, allowing for (2^{32}) unique addresses, approximately 4.3 billion.
- Depletion: Due to the rapid growth of devices, the IPv4 address space is nearly exhausted, leading to the adoption of solutions like NAT and IPv6.
18.4.2 Classful Addressing
- IPv4 originally divided its address space into five classes, identified by the first few bits of the address:
- Class A:
- Range: (0.0.0.0) to (127.255.255.255).
- Large networks with up to (2^{24}) hosts.
- Class B:
- Range: (128.0.0.0) to (191.255.255.255).
- Medium-sized networks with up to (2^{16}) hosts.
- Class C:
- Range: (192.0.0.0) to (223.255.255.255).
- Small networks with up to (2^{8}) hosts.
- Class D:
- Range: (224.0.0.0) to (239.255.255.255).
- Reserved for multicast communication.
- Class E:
- Range: (240.0.0.0) to (255.255.255.255).
- Reserved for experimental use.
- Class A:
18.4.3 Classless Addressing
- CIDR (Classless Inter-Domain Routing):
- Eliminates rigid address classes, allowing for flexible allocation of IP addresses.
- Uses prefix notation (e.g., (192.168.1.0/24)), where the “/24” indicates the number of bits in the network prefix.
- Variable-Length Subnet Masking (VLSM):
- Divides an IP address into subnets of different sizes.
- Helps optimize address utilization and reduce wastage.
18.4.4 Dynamic Host Configuration Protocol (DHCP)
- Purpose:
- Automates the assignment of IP addresses, subnet masks, gateways, and DNS settings.
- Advantages:
- Reduces manual configuration errors.
- Allows for reusing IP addresses when devices leave the network.
- Process:
- A device sends a DHCP Discovery request.
- The server responds with a DHCP Offer containing configuration details.
- The device accepts via a DHCP Request, and the server confirms with a DHCP Acknowledgment.
18.4.5 Network Address Translation (NAT)
- Purpose:
- Allows multiple devices on a private network to share a single public IP address.
- Conserves the limited IPv4 address space.
- Types:
- Static NAT: Maps one private IP to one public IP.
- Dynamic NAT: Maps private IPs to available public IPs from a pool.
- Port Address Translation (PAT): Maps multiple private IPs to a single public IP using unique port numbers.
- Advantages:
- Enhances security by hiding internal network structure.
- Reduces the demand for public IP addresses.
18.5 FORWARDING OF IP PACKETS
Forwarding is the mechanism by which routers move packets from their source to the correct destination.
18.5.1 Forwarding Based on Destination Address
- Process:
- The router examines the destination IP address in the packet header.
- It consults its routing table to determine the next hop.
- The packet is forwarded to the next router or the final destination.
- Routing Table Entries:
- Destination Network: Identifies the target subnet.
- Next Hop: The IP address of the next router.
- Metric: A value representing the cost or distance to the destination.
18.5.2 Forwarding Based on Label
- Label-Based Forwarding:
- Utilized in Multiprotocol Label Switching (MPLS).
- Packets are assigned a label at the ingress router.
- Intermediate routers use labels, not IP addresses, for forwarding decisions.
- Advantages:
- Faster forwarding as label lookups are simpler than IP-based routing.
- Supports traffic engineering, allowing for efficient use of network resources.
18.5.3 Routers as Packet Switches
- Functionality:
- Routers act as intelligent devices in packet-switched networks.
- They handle:
- Receiving packets from the input interface.
- Analyzing headers to determine the next hop.
- Forwarding packets via the appropriate output interface.
- Key Roles:
- Packet Inspection: Examines headers for routing and QoS decisions.
- Routing Table Maintenance: Updates routes dynamically using protocols like OSPF or BGP.
Summary of Key Concepts
- Packet Switching: Core mechanism for efficient data transfer.
- Routing and Forwarding: Ensure packets traverse networks to reach their destination.
- IP Addressing: Vital for device identification and communication, with techniques like CIDR, DHCP, and NAT enhancing efficiency.
- Performance Metrics: Delay, throughput, and congestion control are essential for optimizing communication.
- DHCP and NAT: Critical protocols for managing IP address allocation and conservation.