The IP datagram is constructed by the Network Layer (Layer 3) of the OSI model.
This layer is responsible for routing data packets between different networks and ensuring that they reach their intended destination successfully. It adds source and destination addresses to each packet and constructs the headers needed for proper identification, as well as dividing data into smaller packets if needed.
Additionally, the Network Layer can also be used to prioritize certain packets over others and detect errors in transmission. All of these functions help ensure that data is transferred reliably and efficiently across networks. The IP datagram is a crucial part of this process, allowing information to be transmitted between computers all over the world.
Once an IP datagram is constructed, it is sent down to the Data Link Layer (Layer 2) for delivery. The Data Link Layer takes the datagram and sends it to the receiving host. This layer adds additional information, such as error control and flow control data, before transmitting it to its destination. After this, the IP datagram is delivered to its intended recipient.