The network layer
The main function of the Network Layer is to transport segments from sending to receiving host:
- On sending side encapsulates segments into datagrams
- On receiving side, delivers segments to transport layer
- Network layer protocols are in every host and router
- Router examines header fields in all IP datagrams passing through it

Figure 4 The Data Flow in the Internet Protocol Stack
Operation of the Internet Protocol suite between two Internet hosts connected via two routers ... by Kbrose from Wikipedia CC BY-SA 3.0