The main function of this layer is to delivery packets from the source to the destination across multiple networks(links). If two systems are connected on the same link, there is no need for a network layer. The relationship of the network layer to the data link and the transport layer is shown below:
The network layer is responsible for carrying the packet from the source all the way to the destination. In short it is responsible for host-to-host delivery. The network layer has a higher responsibility then the data link layer, because the data link layer is only supposed to move the frames from one end of the wire to the other end.
This network layer is the lowest layer that deals with the end to end transmission.