Comer suggests that there are really two different ways to think about network layering.  The first is the more common and pervasive  ISO Model (The Reference Model of Open System Interconnection); the second is the more "real world" Internet conceptual model, as presented by Comer.
 
 
What is the OSI reference model? 
 
A good international standard should be flexible and extensible. In order to achieve this goal, it seems to be a good idea to separate a complex structure like a computer protocol in several modules. Each module should be of manageable size and, if different techniques are available for a certain aspect of a protocol, then the separation into modules makes it quite easy to change this part of the whole system (e.g. the cable specification or the encoding of data) without touching the rest of the specification.
 
The OSI Reference Model (RM) defined in ISO 7498 divides the communication process between two application programs into 7 intermediate layers. Each layer provides a certain kind of service to the next higher layer. This service is provided by communicating with the peer entity in same layer of the remote host using the service provided by the next lower layer. Some of the layer entities may be implemented in physical devices, some may be part of the operating system and some may be included in application programs. Most layers provide their service by forwarding protocol data units to the next layer together with an added or removed header or by performing other functions and state changes.
 
The OSI Reference Model only defines the abstract notion of layers and does not specify whether the boundaries between the layers have to be visible and documented in implementations. There are other standards that define application program interfaces (APIs) between the operating system and the application and these APIs often correspond to a layer boundary in the OSI Reference Model.
 
The classic standard diagram that is normally used to describe the OSI RM looks like this:
 
 
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
 
(GOGAN NOTE:  TO MANY FOLKS, IT'S MORE OFTEN A NINE-LAYER MODEL AS SHOWN HERE!)
 
 The PHYSICAL LAYER provides the service of transferring bits from one end of the physical medium to the other. This includes the specification of the medium (wire, coax cable, fiber optics, radio signals, laser signals, microwave signals, seismic waves, ... :-) as well as the connectors, the modulation techniques, environmental limits etc.
 
The DATA LINK LAYER uses the bit-transfer ability of the physical layer to provide a secured link between two hosts. This includes functions like error detection and correction, separating data blocks, controlling media access, etc.
In a network, not every computer has to be connected to each other directly. Hosts should be able to forward data packets according to an address field that has been attached to the packet. 
 
The NETWORK LAYER provides the service of routing and delivering a packet to any host in the network. In intermediate systems, where there's no application program involved in the communication, the packets are only processed by the lower three layers.
 
Each layer (especially 2 and 3) can operate in two different modes. In the CONNECTION-ORIENTED (CO) mode, the communication goes through several stages similar to a telephone call: (1) dial, (2) wait until the connection has been established, (3) communicate, (4) close the connection, (5) wait until close of the connection has been confirmed. The connection-oriented mode guarantees that no packets are lost and that all packets arrive in the same order in which they have been sent. In contrast, in the CONNECTIONLESS (CL) mode only a datagram service is provided, similar to the postal letter service. No one guarantees that the letters arrive in the same order in which they have been sent, and every intermediate system is allowed to discard a packet if there are insufficient resources available to deal with it (e.g. buffers are full). In CL-mode systems, higher layers have to deal with resequencing, retransmission of lost packets, etc. where a reliable data stream is required.
 
There is endless debate about whether the CONS (connection-oriented network service) or the CLNS should be provided by the network layer and now both alternatives have been defined in OSI standard protocols. As most applications want to exchange several packets in sequence, they need a CO-mode service. The TRANSPORT LAYER has been introduced in order to hide the differences between several network concepts (CO vs. CL and other things like maximum packet size and quality of service) from the connection-oriented transport service (COTS) user. In the case of a CO network, the COTS is quite simple to provide, but over a CL network, complete error correction and flow control has to be provided in the transport layer.
 
The main advantage of the CLNS is higher efficiency because fewer CPU  cycles for complex flow control algorithms are needed in intermediate systems (routers). If no connection-oriented transport service is needed, then the response time may be significantly shorter over a CLNS. CONS, on the other hand, makes accounting easier for network providers, as only correctly delivered packets are counted. The headers of the connection-oriented network protocol packets may be much shorter, as the full address is not required in each packet, which might be relevant on slow lines. In addition, many existing nets are CO, e.g. X.25 nets, the telephone net and ISDN.
 
The SESSION LAYER offers a mechanism to include synchronization points in the stream of exchanged packets and to go back to one of the previous sync points. This might be useful if large files are transferred and it is possible to recover after a breakdown without having to retransfer the whole file. The session layer only provides the means to negotiate a recovery. The recovery has to be done by the application and not by the software that implements the session layer. This is the reason why many experts consider the session layer as one of the darker corners of the OSI model, especially as this part of the standard is quite complex and difficult to understand. Perhaps it would have been a better choice to include the session layer functionality somewhere in the application layer. Don't worry if you don't understand the exact ideas behind the design of the session layer, you are not alone. There are even obscure relations with CCITT T.62, although only very few people seem to understand why compatibility with an old Teletex protocol was necessary in the session layer design ...
 
The PRESENTATION LAYER provides for negotiation of the form of representation (syntax) of the data that will be transferred. This makes sense if several optional ASN.1 encodings or other syntaxes  (e.g. the X Window System protocol) are possible.
 
Finally, the APPLICATION LAYER provides an application-specific service. This is not the application itself, but the application layer is directly used by an application program. For instance, an electronic mail user interface program might use the X.400 application layer in order to send a message to another host. Here the application layer will deal with things like address resolution, routing decisions, transferring and converting (even very huge) messages, etc. Other application layer standards offer services like accessing remote file systems, controlling video terminals and transaction systems, etc. 
 
 
On the other hand, Comer (Chap. 15) suggests that the Internet protocols (and I venture to say others as well) are really broadly organized into four conceptual layers, built on a hardware layer, as follows:
 
 
Conceptual Layers and Objects Passed Between Layers
Application
Messages or Streams
Transport
Transport Protocol Packets
Internet
IP Datagrams
Network Interface
Network Specific Frames
Hardware
 
 
Comer also suggests that at the Application Layer, the software is not typically part of the operating system; for the Transport Layer, the software is (or should be) part of the operating system.  Also, at the Internet layer, IP (or network specific) addresses are used; for the Network Interface layer, physical hardware addresses are used.