Chapter 2 LAYERs in The OSI Model
Chapter 2 LAYERs in The OSI Model
Network Models
LAYERED TASKS
On the Way:
The animation given explains how data exchange between two devices using OSI model
http://www.mhhe.com/engcs/compsci/forouzan/dcn/graphics/animations/03_03.swf
Layered Architecture
Figure shows the layers
involved when a message
is sent from device A to
device B.
As the message travels
from A to B, it may pass
through many
intermediate nodes. These
intermediate nodes usually
involve only the first three
layers of the OSI model.
Layered Architecture
Within a single machine, each layer calls
upon the services of the layer just below
it.
Layer 3, for example, uses the services
provided by layer 2 and provides services
for layer 4.
Between machines, layer x on one
machine communicates with layer x on
another machine.
The processes on each machine that
communicate at a given layer are called
peer-to-peer processes.
Communication between machines is
therefore a peer-to-peer process using
the protocols appropriate to a given layer.
Peer-to-Peer Processes
At the physical layer, communication is direct: device A sends a stream of
bits to device B.
At the higher layers, however, communication must move down through the
layers on sending device; and then back up through the layers on receiving
device.
Each layer in the sending device adds its own information to the message it
receives from the layer just above it and passes the whole package to the
layer just below it.
At the receiving device, the message is unwrapped layer by layer, with each
process receiving and removing the data meant for it.
http://scisweb.ulster.ac.uk/~kevin/com320/labs/Simulations/osipeer.swf
Interfaces Between Layers
https://www.youtube.com/watch?v=-6Uoku-M6oY
http://scisweb.ulster.ac.uk/~kevin/com320/labs/Simulations/osidesc.swf
7. Application layer
This is the closest layer to the end user. It provides the interface between the
applications we use and the underlying layers.
But notice that the programs you are using (like a web browser – IE, Firefox
or Opera…) do not belong to Application layer. Telnet, FTP, email client
(SMTP), HyperText Transfer Protocol (HTTP) are examples of Application
layer.
6. Presentation layer
This layer ensures the presentation of data, that the communications passing
through are in the appropriate form for the recipient.
In general, it acts as a translator of the network. For example, you want to send an
email and the Presentation will format your data into email format. Or you want to
send photos to your friend, the Presentation layer will format your data into GIF,
JPG or PNG… format.
This layer is also responsible for data encoding, compression, and encryption.
5. Session layer
The Session layer establishes, maintains, and manages the
communication session with the receiving device.
The session layer is also responsible for dialog control and
synchronization.
5. Session layer
Dialog control. The session layer allows two systems to
enter into a dialog. It allows the communication between
two processes to take place in either half-duplex (one way at
a time) or full-duplex (two ways at a time) mode.
Synchronization. The session layer allows a process to add
checkpoints, or synchronization points, to a stream of data.
For example, if a system is sending a file of 2000 pages, it is
advisable to insert checkpoints after every 100 pages to ensure
that each 100-page unit is received and acknowledged
independently. In this case, if a crash happens during the
transmission of page 523, the transfer can be resumed after
system recovery from pages 501 to onwards.
4. Transport layer
This layer maintains flow control of data and provides for error
checking and recovery of data between the devices. The most
common example of Transport layer is Transmission Control
Protocol (TCP) and User Datagram Protocol (UDP).
The functions defined in this layer provide for the reliable
transmission of data segments, as well as the disassembly and
assembly of the data before and after transmission.
3. Network layer
This layer provides logical addresses which routers will use to
determine the path to the destination. In most cases, the logic
addresses here means the IP addresses (including source &
destination IP addresses).
The network layer is responsible for the delivery of individual
packets from the source host to the destination host.
http://www.mhhe.com/engcs/compsci/forouzan/dcn/graphics/animations/03_08.swf
3. Network layer
Hop-to-hop delivery (intermediate hopes)
Source-to-destination delivery
http://www.mhhe.com/engcs/compsci/forouzan/dcn/graphics/animations/03_08.swf
2. Data link layer
The Data Link layer formats the message into a data frame, and adds a
header containing the hardware destination and source address to it. This
header is responsible for finding the next destination device on a local
network.
Notice that layer 3 is responsible for finding the path to the last destination
(network) but it doesn’t care about who will be the next receiver. It is the
Layer 2 that helps data to reach the next destination.
This layer is subdivide into 2 sub-layers: logical link control (LLC) and media
access control (MAC).
The LLC functions include:
+ Managing frames to upper and lower layers
+ Error Control
+ Flow control
The MAC sublayer carries the physical address of each device on the
network. This address is more commonly called a device’s MAC address.
MAC address is a 48 bits address which is burned into the NIC card on the
device by its manufacturer.
http://www.mhhe.com/engcs/compsci/forouzan/dcn/graphics/animations/03_08.swf
2. Data link layer
Note
Physical layer
Summery of layers
http://scisweb.ulster.ac.uk/~kevin/com320/labs/Simulations/osidesc.swf
Encapsulation (Packaging)
For application data to travel uncorrupted from one host to another,
header (or control data), which contains control and addressing
information, is added to the data as it moves down the layers.
The process of adding control information as it passes through the
layered model is called encapsulation. Decapsulation is the process
of removing the extra information and sending only the original
application data up to the destination application layer.
• The first identifier, the host physical address, is contained in the header of the
Layer 2 PDU, called a frame. Layer 2 is concerned with the delivery of messages
on a single local network. The Layer 2 address is unique on the local network and
represents the address of the end device on the physical media.
• When two end devices communicate on the local Ethernet network, the frames
that are exchanged between them contain the destination and source MAC
addresses.
• After a frame is successfully received by the destination host, the Layer 2 address
information is removed as the data is decapsulated and moved up the protocol
stack to Layer 3.
Addresses in TCP/IP (Getting Data Through the Internetwork):
• Layer 3 protocols are primarily designed to move data from one local network to
another local network within an internetwork.
• Every IP host address contains information about the network where the host is
located.
• When the path is determined, the router encapsulates the packet in a new frame
and sends it on its way toward the destination end device.
• When the frame reaches its final destination, the frame and packet headers are
• removed and the data moved up to Layer 4.
Addresses in TCP/IP (Getting Data to the Right Application):
• The transport layer adds port numbers to its segment header information to
ensure that the destination host knows which application process is to receive the
packet.
• The end host assigns a port number to each type of traffic going in and out.
• The segment contains both source and destination ports in case the receiver needs
to contact the sender.
Example 2.1 (Physical addresses)
07:01:02:01:2C:4B