You are on page 1of 33

7 Layers Of The OSI Model

Lesson 2
Preston Walela
Networking and Web-design
Introduction
• OSI Reference Model stands for Open system
interconnection reference model which is
used for communication in various networks.
• The ISO (International organization for
standardization) has developed this reference
model for communication to be followed
worldwide on a given set of a platform
Outline
• What Is OSI Model?
– Architecture Of The OSI Reference Model
– Relationship Between Each Layer
– Roles & Protocols Used At Each Layer
– Features Of The OSI Model
• 7 Layers Of The OSI Model
– Layer 1 – Physical layer
– Layer 2 – Data-link Layer
– Layer 3 – Network Layer
– Layer 4 – Transport Layer
– Layer 5 – Session Layer
– Layer 6 – Presentation Layer
– Top Layer – Application Layer
• Conclusion
What Is OSI Model?

• Open system • Architecture of the OSI Ref


Model
interconnection (OSI)
reference model consists
of seven layers or seven
steps which concludes
the overall
communication system.
• We will take an in-depth
look at the functionality
of each layer.
Relationship Between Each Layer
• Let’s see how each layer in the OSI reference model communicates
with one another with the help of the below diagram.

Enlisted below is the expansion of each


Protocol unit exchanged between the
layers:
APDU– Application protocol data unit.
PPDU– Presentation protocol data unit.
SPDU– Session protocol data unit.
TPDU– Transport protocol data unit
(Segment).
Packet– Network layer host-router
protocol.
Frame– Data-link layer host-router
protocol.
Bits– Physical layer host-router protocol.
Roles & Protocols Used At Each Layer
Features Of The OSI Model

• The various features of the OSI Model are enlisted below:


• It is easy to understand the communication over wide networks
through the OSI Reference Model architecture.
• Helps to know the details, so that we can get a better
understanding of the software and hardware working together.
• Troubleshooting of faults is easier as the network is distributed
in seven layers. Each layer has its own functionality, hence the
diagnosis of the issue is easy and less time is taken.
• Understanding new technologies generation by generation
becomes easier and adaptable with the help of the OSI Model.
7 Layers Of The OSI Model

• Try to remember it as A- PSTN- DP.


• Here are the 7 Layers of the OSI Model:
1. The Physical layer
Layer 1 – Physical layer

• The physical layer is the first and bottom-most layer of the OSI Reference Model. It mainly
provides the bitstream transmission.
• It also characterizes the media type, connector type and signal type to be used for
communication.
• Basically, the raw data in the form of bits i.e. 0’s & 1’s are converted into signals and exchanged
over this layer.
• Data encapsulation is done at this layer.
• Synchronization and the transmission rate in the form of bits per second is decided at this layer.
• It provides a transmission interface between the devices and the transmission media and the
type of topology to be used for networking along with the type of transmission mode required
for transmission is defined at this level.
• Usually, star, bus or ring topologies are used for networking and the modes used are half-
duplex, full-duplex or simplex.
• Examples of layer 1 devices include hubs, repeaters & Ethernet cable connectors. These are the
basic devices that are used at the physical layer to transmit data through a given physical
medium which is suitable as per the network need.
Layer 2 – Data-link Layer

• Data-link layer is the second layer from the bottom of the OSI Reference
Model.
• The main function of the data-link layer is to perform error detection and
combine the data bits into frames.
• It combines the raw data into bytes and bytes to frames and transmits the
data packet to the network layer of the desired destination host.
• At the destination end, the data-link layer receives the signal, decodes it
into frames and delivers it to the hardware.
Layer 2 – Data-link Layer…
• MAC Address: Data-link layer supervises the physical addressing system called the MAC
address for the networks and handles the access of the assorted network components
to the physical medium.
• A media access control address is a unique device address and each device or
component in a network has a MAC address on the basis of which we can uniquely
identify a device of the network. It is a 12 digit unique address.
• Example of MAC address is 3C-95-09-9C-21-G1 (having 6 octets, where the first 3
represent the OUI,(Organizational Unique Identifier, the part of the MAC address that
identifies the vendor of the network adapter) the next three represent the NIC). (A
network adapter, also called a Network Interface Card or NIC, is equipped with a unique
identifier known as the Media Access Control (MAC) address. This address can be used
by routers and switches to control access to a network.) It can also be known as the
physical address. The structure of a MAC address is decided by the IEEE organization as
it is globally accepted by all firms.
• The structure of MAC address representing the various fields and bit length can be seen below.
Layer 2 – Data-link Layer…
• Error Detection: Only error detection is done at this layer, not error correction.
Error correction is done at the Transport layer.
• Sometimes data signals encounter some unwanted signals known as error bits .
• In order to overcome errors, this layer performs error detection.
• Cyclic Redundancy check (CRC) and checksum are few efficient methods of error
checking.
• Flow control & Multiple Access: Data which is sent in the form of a frame
between the sender and a receiver over a transmission media at this layer,
should transmit and receive at the same pace.
• When a frame is sent over a medium at a faster speed than the receiver’s
working speed, then the data to be received at receiving node will be lost due to
a mismatch in speed.
• In order to overcome these type of issues, the layer performs flow control
mechanism.
Layer 2 – Data-link Layer…
• There are two types of flow control process:
• Stop and Wait for flow control: In this mechanism, it pushes the sender
after the data is transmitted to stop and wait from the receiver’s end to
get the acknowledgment of the frame received at the receiver end.
• The second data frame is sent over the medium, only after the first
acknowledgment is received, and the process will go on.
• Sliding window: In this process, both the sender and the receiver will
decide the number of frames after which the acknowledgment should be
exchanged.
• This process is time-saving as fewer resources are used in the flow control
process.
• This layer also provides access to multiple devices to transmit through
the same media without collision by using CSMA/CD (carrier sense
multiple access/collision detection) protocols.
Layer 2 – Data-link Layer…
• Synchronization: Both the devices between which data sharing is taking place should be
in synchronization with each other at both the ends so that data transfer can take place
smoothly.
• Layer-2 Switches: Layer-2 switches are the devices which forward the data to the next
layer on the basis of the physical address (MAC address) of the machine.
• Firstly it gathers the MAC address of the device on the port on which the frame is to be
received and later learns the destination of the MAC address from the address table and
forwards the frame to the destination of the next layer.
• If the destination host address is not specified then it simply broadcasts the data frame to
all the ports except the one from which it learned the address of the source.
• Bridges: Bridge is the two port device which works on the data link layer and is used to
connect two LAN networks.
• In addition to this, it behaves like a repeater with an additional function of filtering the
unwanted data by learning the MAC address and forwards it further to the destination
node.
• It is used for the connectivity of networks working on the same protocol.
Layer 3 – Network Layer

• The network layer is the third layer from the bottom.


• It has the accountability to accomplish the routing of data packets from the
source to destination host between the inter and intra networks operating on
the same or different protocols.
• Apart from the technicalities, what does it really do?
• It finds out the easy, shortest, and time-efficient way out between the sender
and the receiver to exchange data using routing protocols, switching, error
detection and addressing techniques.
• It performs the above task by using a logical network addressing and
subnetting designs of the network.
• Irrespective of the two different networks working on the same or different
protocol or different topologies the function of this layer is to route the
packets from the source to destination by using the logical IP addressing and
routers for communication.
Layer 3 – Network Layer
Layer 3 – Network Layer…
• IP Addressing: The IP address is a logical network address and is
a 32-bit number which is globally unique for each network host.
• It principally consists of two parts i.e. network address & host
address.
• It is generally denoted in a dotted-decimal format with four
numbers split by dots. 
• For Example, the dotted-decimal representation of the IP
address is 192.168.1.1 which in binary will be
11000000.10101000.00000001.00000001, and is very hard to
remember.
• Thus usually the first one is used.
• These eight bits sector are known as octets.
Layer 3 – Network Layer…
• Routers work at this layer and are used for communication
for inter and intra network-wide area networks (WAN’s).
• Routers which transmit the data packets between the
networks do not know the exact destination address of the
destination host for which the packet is routed, rather they
only know the location of the network to which they belong
to and use the information that is stored in the routing table
to establish the path along which the packet is to be delivered
to the destination.
• After the packet is delivered to the destination network, it
then is delivered to the desired host of that particular
network.
Layer 3 – Network Layer…
• For the above series of procedure to be done the IP address has
two parts.
• The first part of IP address is network address and the last part is
the host address.
– Example: For the IP address 192.168.1.1. ,the network address will be
192.168.1.0 and the host address will be 0.0.0.1.
• Subnet Mask: The network address and the host address defined
in the IP address is not solely efficient to determine that the
destination host is of the same sub-network or remote network.
• The subnet mask is a 32-bit logical address that is used along with
the IP address by the routers to determine the location of the
destination host to route the packet data.
Layer 3 – Network Layer…
Example for combined usage of IP address & subnet mask is shown below:

• For the above Example, by using a subnet mask 255.255.255.0, we get to know that the network ID is
192.168.1.0 and the host address is 0.0.0.64.
• When a packet arrives from 192.168.1.0 subnet and has a destination address as 192.168.1.64, then
the PC will receive it from the network and process it further to the next level.
• Thus by using subnetting, the layer-3 will provide an inter-networking between the two different
subnets as well.
• The IP addressing is a connectionless service, thus the layer -3 provides a connectionless service.
• The data packets are sent over the medium without waiting for the recipient to send the
acknowledgment.
• If the data packets which are big in size are received from the lower level to transmit, then it splits it
into small packets and forwards it.
• At the receiving end, it again reassembles them to the original size, thus becoming space efficient as a
medium less load.
Layer 4 – Transport Layer
• The fourth layer from the bottom is called the transport layer of the OSI Reference model.
• (i) This layer guarantees an end to end error-free connection between the two different hosts or
devices of networks.
• This is the first one which takes the data from the upper layer i.e. the application layer, and then
splits it into smaller packets called the segments and dispenses it to the network layer for further
delivery to the destination host.
• It ensures that the data received at host end will be in the same order in which it was transmitted.
• provides an end to end supply of the data segments of both inter and intra sub-networks.
• For an end to end communication over the networks, all devices are equipped with a Transport
service access point (TSAP) and are also branded as port numbers.
• A host will recognize its peer host at the remote network by its port number.
Layer 4 – Transport Layer…
• (ii) The two transport layer protocols include:
• Transmission control protocol (TCP)
• User Datagram Protocol (UDP)
• TCP is a connection-oriented and reliable protocol.
• In this protocol, firstly the connection is established between the two hosts of the
remote end, only then the data is sent over the network for communication.
• The receiver always sends an acknowledgment of the data received or not
received by the sender once the first data packet is transmitted.
• After receiving the acknowledgment from the receiver, the second data packet is
sent over the medium.
• It also checks the order in which the data is to be received otherwise data is re-
transmitted.
• This layer provides an error correction mechanism and flow control.
• It also supports client/server model for communication.
Layer 4 – Transport Layer…
• UDP is a connectionless and unreliable protocol.
• Once data is transmitted between two hosts, the receiver host doesn’t
send any acknowledgment of receiving the data packets.
• Thus the sender will keep on sending data without waiting for an
acknowledgment.
• This makes it very easy to process any network requirement as no time is
wasted in waiting for acknowledgment.
• The end host will be any machine like a computer, phone or tablet.
• This type of protocol is widely used in video streaming, online games,
video calls, voice over IP where when some data packets of video are lost
then it doesn’t have much significance, and can be ignored as it doesn’t
make much impact on the information it carries and doesn’t have much
relevance.
Layer 4 – Transport Layer…
• (iii) Error Detection & Control: Error checking is provided in
this layer because of the following two reasons:
• Even if no errors are introduced when a segment is moving
over a link, it can be possible for errors to be introduced when
a segment is stored in the router’s memory (for queuing).
• The data link layer is not able to detect an error in this
scenario.
• There is no assurance that all the links between the source and
destination will provide error scrutiny.
• One of the links may be using a link layer protocol which
doesn’t offer the desired outcomes.
Layer 4 – Transport Layer…
• The methods used for error check and control are CRC (cyclic redundancy check)
and checksum.
• CRC: The concept of CRC (Cyclic Redundancy Check) grounds on the binary
division of the data component, as the remainder of which (CRC) is appended to
the data component and sent to the receiver. The recipient divides data
component by an identical divisor.
• If the remainder comes up to zero then the data component is allowed to pass to
forward the protocol, else, it is assumed that the data unit has been distorted in
transmission and the packet is discarded.
• Checksum Generator & checker:  In this method, the sender uses the checksum
generator mechanism in which initially the data component is split into equal
segments of n bits. Then, all the segments are added together by employing 1’s
complement.
• Later, it complements once again, and now it turns into checksum and then is
sent along with the data component.
Layer 4 – Transport Layer…
• Example: If 16 bits is to be sent to the receiver and bits
are 10000010 00101011, then the checksum that will be
transmitted to the receiver will be 10000010 00101011
01010000.
• Upon receiving the data unit, the receiver divides it into n equal
size segments.
• All the segments are added using 1’s complement.
• The result is complemented once more and If the result is zero,
the data is accepted, else discarded.
• This error detection & control method permits a receiver to
rebuild the original data whenever it is found corrupted in transit.
Layer 5 – Session Layer

• This layer permits the users of different platforms to set up an active communication session
between themselves.
• The main function of this layer is to provide sync in the dialogue between the two distinctive
applications.
• The synchronization is necessary for efficient delivery of data without any loss at the receiver
end.
• Let’s understand this with the help of an Example.
• Assume that a sender is sending a big data file of more than 2000 pages.
• This layer will add some checkpoints while sending the big data file.
• After sending a small sequence of 40 pages, it ensures the sequence & successful
acknowledgment of data.
• If verification is OK, it will keep repeating it further till the end otherwise it will re-synchronize
and re-transmit.
• This will help in keeping the data safe and the whole data host will never completely get lost if
some crash happens.
• Also, token management, will not allow two networks of heavy data and of the same type to
transmit at the same time.
Layer 5 – Session Layer…
Layer 6 – Presentation Layer

• As suggested by the name itself, the presentation layer will present


the data to its end users in the form in which it can easily be
understood.
• Hence, this layer takes care of the syntax, as the mode of
communication used by the sender and receiver may be different.
• It plays the role of a translator so that the two systems come on the
same platform for communication and will easily understand each
other.
• The data which is in the form of characters and numbers are split
into bits before transmission by the layer.
• It translates the data for networks in the form in which they require
it and for devices like phones, PC, etc in the format they require it.
Layer 6 – Presentation Layer…
• The layer also performs data encryption at the
sender’s end and data decryption at the receiver’s
end.
• It also performs data compression for multimedia
data before transmitting, as the length of
multimedia data is very big and much bandwidth
will be required to transmit it over media, this data
is compressed into small packets and at the
receiver’s end, it will be decompressed to get the
original length of data in its own format.
Top Layer – Application Layer

• This is the topmost and seventh layer of the OSI reference model.
• This layer will communicate with the end users & user
applications.
• This layer grants a direct interface and access to the users with
the network.
• The users can directly access the network at this layer.
Few Examples of services provided by this layer include e-mail,
sharing data files, FTP GUI based software like Netnumen, Filezilla
(used for file sharing), telnet network devices etc.
• There is vagueness in this layer as is not all user-based
information and the software can be planted into this layer.
Top Layer – Application Layer…
• For Example, any designing software can’t be put directly at this
layer while on the other hand when we access any application
through a web browser, it can be planted at this layer as a web
browser is using HTTP (hypertext transfer protocol) which is an
application layer protocol.
• Therefore irrespective of the software used, it is the protocol used
by the software that is considered at this layer.
• Software testing programs will work on this layer as the application
layer provides an interface to its end users to test the services and
their uses. The HTTP protocol is mostly used for testing at this layer
but FTP, DNS, TELNET can also be used as per the requirement of
the system and network in which they are operating.
Conclusion

• We have learned about the functionalities,


roles, inter-connection, and relationship
between each layer of the OSI reference
model.
• The bottom four layers (from physical to
transport) are used for data transmission
between the networks and the top three layers
(session, presentation & application) are for
data transmission between hosts.

You might also like