Layer 3 is the Network or Internet layer.
When transmitting data, this layer adds a header containing the source and destination IP addresses to the to the data received from the Transport layer. The packet it creates will then be forwarded to the MAC or Data Link layer.
When receiving data, this layer is used to determine if the packet received by the host contains the host’s IP address. If it does, the data is forwarded up to the Transport layer.
Routers are referred to as “layer 3” devices because they route packets based on their IP addresses.
TCP/IP IPv4 Packet Header
The Network layer header includes more than just the source and destination IP addresses.