The Network Layer
The Network Layer
❖ The network layer ensures the complete delivery of data packets from the source to the
destination, even if the transmission involves multiple intermediate routers. This end-to-end
responsibility distinguishes it from the data link layer, which is limited to transferring frames
between directly connected devices.
❖ Unlike the data link layer's focus on local connections, the network layer handles data
transmission across complex and multi-hop networks. It coordinates the entire journey of packets
over several nodes and communication links, making it the foundation for wide-area
communication.
❖ To function efficiently, the network layer must be aware of the network's topology, including the
structure and connections of routers and links. This knowledge helps it select optimal routes for
data delivery while also avoiding congestion by distributing traffic evenly across the network.
❖ Additional challenges arise when data travels between different networks, such as dealing with
varying protocols and addressing schemes. The network layer addresses these issues, and its
principles are clearly demonstrated through the Internet's architecture, particularly via its core
protocol, IP (Internet Protocol).
❖
❖
❖
❖
❖ Individual Packet Handling:In connectionless service, packets (datagrams) are injected into the
network independently. Each packet is routed separately without advance setup, and no dedicated
path is established beforehand.
❖ Routing Tables:Routers use internal tables to determine the outgoing line for each packet based
on its destination. These tables map destinations to directly connected lines (e.g., Router A
forwards packets to B or C).
❖ Dynamic Routing Decisions:Routing tables can be updated dynamically (e.g., due to traffic
congestion). For example, Router A may switch from sending packets via C to B for load
balancing or fault avoidance.
❖ Fragmentation & Forwarding:Large messages are split into smaller packets (e.g., Packet 1, 2,
3, 4). Each packet is verified, encapsulated in frames, and forwarded hop-by-hop (e.g.,
A→C→E→F→H2).
❖ IP as a Connectionless Protocol:The Internet Protocol (IP) is a dominant example, where each
packet carries a destination address (32-bit IPv4 or 128-bit IPv6). Routers use this address to
make independent forwarding decisions.
1. Network Layer Service Goals:The network layer must provide services that are independent
of router technology, shield the transport layer from router details (number, type, topology), and
use a uniform addressing scheme across LANs and WANs. This ensures flexibility, scalability,
and interoperability in diverse network environments.
4. How Datagram Routing WorksHost splits messages into packets (e.g., PPP
fragmentation).Each router checks packets and forwards them via routing tables (e.g., Router A
sends packets to C or B).Packets may take different paths (e.g., Packet 4 routed via B due to
congestion).
5. Dynamic Routing & AdaptabilityRouting tables update in real-time (e.g., due to congestion).
Algorithms determine optimal paths, allowing load balancing and fault tolerance. Example:
Router A switches from path C to B for Packet 4.
6. IP: Dominant Connectionless ProtocolIPv4 (32-bit) and IPv6 (128-bit) use connectionless
routing.Each packet includes a destination address; routers forward them independently.Despite
its simplicity, IP’s scalability made it the Internet standard.
1. Virtual Circuit Establishment:A predetermined route is selected during connection setup and
stored in router tables. This path remains fixed for all packets in the session, similar to telephone
circuits.
2. Connection Identifiers:Each packet carries a virtual circuit identifier instead of full destination
addresses. Routers use these IDs to forward packets along the pre-established path.
3. Routing Table Structure:Tables contain incoming/outgoing interface mappings with
connection IDs. For example, Router A's table shows connection 1 from H1 should go to Router
C with the same ID.
4. Identifier Translation:Routers may modify connection IDs to avoid conflicts. In the example,
Router A changes the ID for H3's traffic to distinguish it from H1's connection.
5. Path Consistency:All packets in a virtual circuit follow the same physical path (e.g.,
H1→A→C→E→F→H2), unlike connectionless networks where paths may vary.
6. Connection Termination:The virtual circuit and all related routing table entries are cleared
when the session ends, freeing network resources.
7. MPLS Implementation:MPLS uses 20-bit labels as connection identifiers, enabling
connection-oriented routing within ISP networks while maintaining IP compatibility.
8. Quality of Service Benefits:This approach guarantees consistent performance for traffic
streams, making it ideal for voice/video applications and traffic engineering.