The network layer is the third layer of the seven-layer OSI model and is responsible for packet forwarding, including routing through intermediate nodes, and for delivery of packets to the upper layers at the destination node. The network layer provides connectivity between hosts by encapsulating data into datagrams (packets) and decapsulating datagrams at the destination host.

In addition to providing logical connectivity, the network layer also provides a mechanism for multiplexing upper-layer applications, Quality of Service (QoS), flow control, error control/reliability, congestion control (including active queue management), security functions (e.g., IPsec), and other functions. The actual mechanisms used to provide these services vary depending on which protocol stack is in use but may include virtual circuits or hop-by-hop flow labeling schemes such as Multiprotocol Label Switching (MPLS).