The OSI model consists of seven layers, as follows (working from the bottom up):
Physical layer: This is the layer where the network hardware operates. Rules for this layer govern the
types of connectors used, what types of signaling techniques carry data across the network, and the
types of cable or other networking media that the physical, tangible part of the network uses. In some
sense, this is the only part of the OSI model that you can see and touch.
Data Link layer: This layer handles communication with the network hardware. For outbound
messages, the Data Link layer enables the conversion of the bits that computers use to represent data
into equivalent signals needed to move data across the network. For inbound messages, it reverses
the process by enabling the conversion of signals into their equivalent bits. The Data Link layer is also
where low-level hardware addresses for individual network interface cards (NICs) and other devices
are handled.
Network layer: This layer routes messages between senders and receivers, which means that it also
handles translation between human-readable network addresses and computer-readable network
addresses (which are not the same as the hardware addresses that the Data Link layer handles).
Each message that passes through this layer includes the sender's and the receiver's addresses to
identify the parties involved. The Network layer moves data from sender to receiver when they aren't
both attached to the same cable segment.
Transport layer: This layer chops up large messages into so-called Protocol Data Units (PDUs), or
packets, and sends them across a network. It also puts PDUs back together to reconstitute messages
upon receipt. The Transport layer can also include data integrity checks by adding a bit pattern to each
message based on a mathematical calculation before sending. This same calculation is repeated by
the sender, and the result is compared to the value calculated beforehand. If both values agree, the
Transport layer assumes that the transmission was accurate and correct; if they don't agree, the
Transport layer requests that the PDU be resent. This integrity function is optional; therefore, some
Transport layer protocols include an integrity check and others don't.
Session layer: This layer sets up ongoing network conversations (called sessions) between sender
and receiver. This kind of ongoing connection makes it easier for computers to exchange large
amounts of data, or to maintain a connection when data moves regularly between both parties to a
session. Therefore, the Session layer handles session setup (which is like dialing a phone), session
maintenance (which is like having a phone conversation), and session termination, or teardown (which
is like ending a phone conversation and then hanging up the phone).
Presentation layer: This layer converts data for network delivery. The assumption that drives this
activity is that the sender and the receiver may not share a common set of data types, formats, or
representations. Therefore, the Presentation layer converts data from formats created by the sender
into a generic format for network transit, and then converts that generic form into a format specific to
the receiver upon delivery. This conversion process allows programmers on both sides of the network
connection to assume generic formats for network data, and to handle the details necessary to deliver
that data to a specific client more easily.
Application layer: This layer's name is something of a misnomer. It doesn't refer to the application or
service that seeks to send or receive data across a network. Rather, it refers to an interface between
the protocol stack and applications or system services. The Application layer defines the methods by
which applications or system services can request network access and by which they can obtain
access to incoming data from the network.