The main functions of network layer is to provide end-to-end addressing, routing and to provide a connectionless datagram delivery of packets. One of the main use of this connectionless service is to serve the transport layer above it. There had also been suggestions that network layer provides connection-oriented service. But it's been pretty much decided that connectionless service is what network layer provides. It is therefore, how the layer is defined in OSI and in TCP/IP.
By connectionless we mean that no prior connection setup is required in order to send the packets and different packets may follow entirely different routes through the network. Because of this, different data units, which are called datagrams in the network layer terminology, may arrive at the destination out of order. Some of which may even be lost. It is not the function of network layer to reorder the datagrams or to recover the lost packets.
On the other hands, connection-oriented applications require the call being set up before the actual connections. In this case, the service provided will guarantee the orderly deliver of packets, lost packets will have to be retransmitted.
It is possible to use connectionless service provided by the network layer, such as IP, to implement connection-oriented services such as TCP, and to use connection-oriented service provided by data link layer, such as ATM, to implement connectionless service, such as IP. This has become an especially important issue given the adoption of ATM standards and the popularity of existing TCP/IP. As we will see later that the distinction between connection-oriented and connectionless can be quite confusing depending on which layer we are dealing with.