Networking - Network Models - OSI - Network Layer
The Network Layer establishes and manages logical connections between hosts on different networks. It provides logical addressing and routing capabilities to ensure that data packets are correctly delivered from the source to the destination across interconnected networks.
- Logical Addressing: The Network Layer assigns unique logical addresses, such as IP (Internet Protocol) addresses, to devices on the network. These addresses are used for identification and routing purposes.
- Routing: The Network Layer determines the optimal path for data packets to travel from the source to the destination across multiple networks. It uses routing protocols and algorithms to select the best routes based on factors like network conditions, traffic load, and cost.
- Logical Addressing: The Network Layer maps logical addresses to physical addresses (MAC addresses) to establish end-to-end communication between hosts. It encapsulates higher-layer data into packets and assigns source and destination addresses to them.
- Routing and Forwarding: The Network Layer selects the most appropriate path for packet transmission across interconnected networks. It examines the destination address in the packet's header and uses routing tables and protocols to determine the next hop or intermediary device for forwarding the packet.
- Fragmentation and Reassembly: If a data packet is too large to be transmitted across the network, the Network Layer can fragment it into smaller units. At the destination, the receiving Network Layer reassembles the fragments into the original packet.
The Network Layer is used in various network technologies, including the Internet Protocol (IP) used in the internet. It enables communication between hosts on different networks, facilitating global connectivity and internetworking.
- Routers: Routers are network devices that operate at the Network Layer. They receive data packets from one network, examine the destination IP address, and forward the packets to the appropriate network based on routing information. Routers connect networks together and play a crucial role in interconnecting different network segments.
- Gateways: Gateways are devices that connect networks with different protocols or architectures. They perform protocol conversion and facilitate communication between networks that use different network layer protocols.
- IP Addresses: IP addresses are unique identifiers assigned to devices connected to a network. They are used by the Network Layer for logical addressing and routing. IPv4 and IPv6 are the two main versions of IP addresses used in the Network Layer.
- Routing Protocols: Routing protocols, such as OSPF (Open Shortest Path First) and BGP (Border Gateway Protocol), are used in the Network Layer to exchange routing information between routers and determine the best paths for packet forwarding.