NETWORKING
OSI Model
Layers one through three are
known as the media layers.
They define hardware
orientation such as routing,
switching and cable
specifications.
Layers four through seven are
known as the host layers. They
define software that
implements network services.
OSI stands for Open System Interconnection is a reference model that
describes how information from a software application in one computer moves
through a physical medium to the software application in another computer.
The OSI model was developed by the International Organisation for
Standardisation (ISO) in 1984, and it is now considered as an architectural
model for inter-computer communications.
OSI consists of seven layers, and each layer performs a particular network
function→
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1.Physical Layer:-
● Physical Layer is the bottom-most layer in the Open System
Interconnection (OSI) Model which is a physical and electrical
representation of the system. It consists of various network components
such as power plugs, connectors, receivers, cable types, etc.
Physical Layer sends data bits from one device(s) (like a computer) to
another device(s). Physical Layer defines the types of encoding (that is
how the 0’s and 1’s are encoded in a signal).
Functions of a Physical layer:
● Line Configuration: It defines the way how two or more devices can be
connected physically.
● Data Transmission: It defines the transmission mode whether it is
simplex, half-duplex or full-duplex mode between the two devices on the
network.
● Topology: It defines the way how network devices are arranged.
● Signals: It determines the type of the signal used for transmitting the
information.
2.Data-Link Layer:-
● The Data-link layer is the second layer from the bottom in the OSI (Open
System Interconnection) network architecture model. It is responsible for
the node-to-node delivery of data. Its major role is to ensure error-free
transmission of information and it defines the format of the data on the
network.
This is considered the most complex layer of the OSI model as it
hides all the underlying complexities of the hardware from the other
above layers.
● It shows Hop to Hop delivery.
● It contains two sub-layers:
Logical Link Control Layer
● It is responsible for transferring the packets to the Network layer of
the receiver that is receiving.
● It identifies the address of the network layer protocol from the
header
● It also provides flow control.
Media Access Control Layer
● A Media access control layer is a link between the Logical Link
Control layer and the network's physical layer.
● It is used for transferring the packets over the network.
Functions of the Data-link layer
● Framing: The data link layer translates the physical's raw bit stream into
packets known as Frames. The Data link layer adds the header and trailer
to the frame. The header which is added to the frame contains the
hardware destination and source address.
● Physical Addressing: The Data link layer adds a header to the frame that
contains a destination address. The frame is transmitted to the destination
address mentioned in the header.
● Flow Control: Flow control is the main functionality of the Data-link
layer. It is the technique through which the constant data rate is
maintained on both sides so that no data get corrupted. It ensures that the
transmitting station such as a server with higher processing speed does
not exceed the receiving station, with lower processing speed.
● Error Control: Error control is achieved by adding a calculated value
CRC (Cyclic Redundancy Check) that is placed to the Data link layer's
trailer which is added to the message frame before it is sent to the
physical layer. If any error seems to occur, then the receiver sends the
acknowledgement for the retransmission of the corrupted frames.
● Access Control: When two or more devices are connected to the same
communication channel, then the data link layer protocols are used to
determine which device has control over the link at a given time.
3.Network Layer:-
● Network layer is the third layer in the OSI model of computer networks.
It’s main function is to transfer network packets from the source to the
destination. It is involved both at the source host and the destination host.
At the source, it accepts a packet from the transport layer, encapsulates it
in a datagram and then deliver the packet to the data link layer so that it
can further be sent to the receiver. At the destination, the datagram is
decapsulated, the packet is extracted and delivered to the corresponding
transport layer.
Functions of Network Layer:
● Internetworking: An internetworking is the main responsibility of the
network layer. It provides a logical connection between different devices.
● Addressing: A Network layer adds the source and destination address to
the header of the frame. Addressing is used to identify the device on the
internet.
● Routing: Routing is the major component of the network layer, and it
determines the best optimal path out of the multiple paths from source to
the destination.
● Packetizing:The process of encapsulating the data received from upper
layers of the network(also called as payload) in a network layer packet at
the source and decapsulating the payload from the network layer packet
at the destination is known as packetizing.
4.Transport Layer:-
● The Transport layer is a Layer 4 ensures that messages are transmitted in
the order in which they are sent and there is no duplication of data.
● The main responsibility of the transport layer is to transfer the data
completely.
● It receives the data from the upper layer and converts them into smaller
units known as segments.
● This layer can be termed as an end-to-end layer as it provides a point-to-
point connection between source and destination to deliver the data
reliably.
The two protocols used in this layer are:
● Transmission Control Protocol
○ It is a standard protocol that allows the systems to communicate
over the internet.
○ It establishes and maintains a connection between hosts.
○ When data is sent over the TCP connection, then the TCP protocol
divides the data into smaller units known as segments. Each
segment travels over the internet using multiple routes, and they
arrive in different orders at the destination. The transmission
control protocol reorders the packets in the correct order at the
receiving end.
● User Datagram Protocol
○ User Datagram Protocol is a transport layer protocol.
○ It is an unreliable transport protocol as in this case the receiver
does not send any acknowledgment when the packet is received,
the sender does not wait for any acknowledgment. Therefore, this
makes a protocol unreliable.
Functions of Transport Layer:
● Service Point Addressing: Transport Layer header includes service point
address which is port address. This layer gets the message to the correct
process on the computer unlike Network Layer, which gets each packet to
the correct computer.
● Segmentation and Reassembling: A message is divided into segments;
each segment contains sequence number, which enables this layer in
reassembling the message. Message is reassembled correctly upon arrival
at the destination and replaces packets which were lost in transmission.
● Connection Control: It includes 2 types:
○ Connectionless Transport Layer : Each segment is considered as
an independent packet and delivered to the transport layer at the
destination machine.
○ Connection Oriented Transport Layer : Before delivering
packets, connection is made with the transport layer at the
destination machine.
● Flow Control: In this layer, flow control is performed end to end.
● Error Control: Error Control is performed end to end in this layer to
ensure that the complete message arrives at the receiving transport layer
without any error. Error Correction is done through retransmission.
5.Session Layer:-
● The Session Layer is the 5th layer in the Open System Interconnection
(OSI) model. This layer allows users on different machines to establish
active communications sessions between them.
It is responsible for establishing, maintaining, synchronizing,
terminating sessions between end-user applications.
Functions of Session layer:
● Dialog control: Session layer acts as a dialog controller that creates a
dialog between two processes or we can say that it allows the
communication between two processes which can be either half-duplex or
full-duplex.
● Synchronisation: Session layer adds some checkpoints when
transmitting the data in a sequence. If some error occurs in the middle of
the transmission of data, then the transmission will take place again from
the checkpoint. This process is known as Synchronisation and recovery.
6.Presentation Layer:
● Presentation Layer is the 6th layer in the Open System Interconnection
(OSI) model. This layer is also known as Translation layer, as this layer
serves as a data translator for the network.
The data which this layer receives from the Application Layer is
extracted and manipulated here as per the required format to transmit
over the network.
The main responsibility of this layer is to provide or define
the data format and encryption.
The presentation layer is also called as Syntax layer since it is
responsible for maintaining the proper syntax of the data which it either
receives or transmits to other layer(s).
Functions of Presentation layer:
● Translation: The processes in two systems exchange the information in
the form of character strings, numbers and so on. Different computers use
different encoding methods, the presentation layer handles the
interoperability between the different encoding methods. It converts the
data from sender-dependent format into a common format and changes
the common format into receiver-dependent format at the receiving end.
● Encryption: Encryption is needed to maintain privacy. Encryption is a
process of converting the sender-transmitted information into another
form and sends the resulting message over the network.
● Compression: Data compression is a process of compressing the data,
i.e., it reduces the number of bits to be transmitted. Data compression is
very important in multimedia such as text, audio, video.
7.Application Layer:-
● The Application Layer is topmost layer in the Open System
Interconnection (OSI) model. An application layer serves as a window for
users and application processes to access network service.
This layer provides several ways for manipulating the
data (information) which actually enables any type of user to access
network with ease. This layer also makes a request to its bottom layer,
which is presentation layer for receiving various types of information
from it.
Functions of Application layer:
● File transfer, access, and management (FTAM): An application layer
allows a user to access the files in a remote computer, to retrieve the files
from a computer and to manage the files in a remote computer.
● Mail services: An application layer provides the facility for email
forwarding and storage.
● Directory services: An application provides the distributed database
sources and is used to provide that global information about various
objects.
#The advantages of the OSI model are
● It is a generic model and acts as a guidance tool to develop any network
model.
● It is a layered model. Changes are one layer do not affect other layers,
provided that the interfaces between the layers do not change drastically.
● It supports both connection-oriented services and connectionless services.
#The disadvantages of the OSI model are
● It is purely a theoretical model that does not consider the availability of
appropriate technology. This restricts its practical implementation.
● The launching timing of this model was inappropriate. When OSI
appeared, the TCP/IP protocols were already implemented
● There is a duplication of services in various layers. Services like
addressing, flow control and error control are offered by multiple layers.
# Why OSI model is needed
It’s a model for how applications communicate over the internet. In order to
facilitate interoperability between diverse devices and applications, the OSI model
describes computing functions into a universal set of rules and standards.
The OSI model can be thought of as a universal computer networking language. It is
built on the divide-and-conquer concept, and it divides the communication system
into seven abstract layers, each of which is layered on top of the previous layer.
The OSI is made up of seven levels, each of which performs a different network
function. The OSI model breaks down the process into seven smaller, more
achievable steps.
# What is the Mac address?
MAC address is a unique identifier that is assigned to a NIC (Network Interface
Controller/ Card).
It consists of a 48 bit or 64-bit address, which is associated with the network
adapter. MAC address can be in hexadecimal format. The full form of MAC address is
Media Access Control address. A MAC address is generally in six sets of two-
digits/characters that are separated by colons.
#What is the IP address?
An IP address is an address that helps you to identify a network connection. It is
termed as the ‘Logical Address,’ which is provided to a connection in a network.
IP address helps you to control how devices on the Internet communicate and
defines the behavior of internet routers.
#What Does Port Number Mean?
A port number is the logical address of each application or process that uses a network
or the Internet to communicate. A port number uniquely identifies a network-based
application on a computer. Each application/program is allocated a 16-bit integer port
number. This number is assigned automatically by the OS, manually by the user or is
set as a default for some popular applications.
TCP/IP MODEL
The OSI Model we just looked at is just a reference/logical model. It was
designed to describe the functions of the communication system by dividing
the communication procedure into smaller and simpler components. But when
we talk about the TCP/IP model, it was designed and developed by
Department of Defense (DoD) in 1960s and is based on standard protocols. It
stands for Transmission Control Protocol/Internet Protocol. The TCP/IP
model is a concise
ise version of the OSI model. It contains four layers, unlike
seven layers in the OSI model. The layers are:
1. Process/Application Layer
2. Host-to-Host/Transport
Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
[Some book refers 5 layers of TCP/IP model:
Process/Application Layer
Host-to-Host/Transport
Host/Transport Layer
Internet Layer
Data Link Layer In general these two layers are combined together and forms Network Access
Physical Layer Layer
]
The first layer is the Process layer on the behalf of the sender and Network
Access layer on the behalf of the receiver. We will be talking on the behalf of
the receiver.
1. Network Access Layer
This is the bottom-most layer of the TCP/IP model architecture
It is a combination of the Data Link and Physical Layer of the OSI model
The physical transmission of data takes place at this layer
Once the frames are transmitted by a network, encapsulating the IP
datagram into these frames is done in this layer
Also, the mapping of IP address into physical address is done here
Mainly, the function of this layer is to transmit the data between two
devices, connected in a network
2. Internet Layer
It is the second layer of the TCP/IP model and this layer is parallel to the
Network Layer of the OSI Model, in terms of the structure
Sending the data packets to their destination network is the main function
of the Internet layer
The logical transmission of data takes place at this level
There are three different protocols used in this layer. These include:
IP: One of the most important protocols as it detects the IP address
of a device which is later used for internetwork connections. It is
using this protocol that the path with which the data shall be
transmitted is decided. There are two common IP versions which
are used, IPv4 and IPv6. IPv4 is the one that most of the websites
are using currently. But IPv6 is growing as the number of IPv4
addresses are limited in number when compared to the number of
users.
ARP: It stands for Address Resolution Protocol. The physical
address from the IP address can be determined using ARP.
ICMP: It stands for Internet Control Message Protocol and
notification regarding datagram problems can be sent back to the
user using this. Any issue with the network is immediately notified
to the user by ICMP. It can only inform the user about the errors
and cannot rectify the problem
3. Host-To-Host Layer
This layer is parallel to the transport layer of the OSI Model
The error-free delivery of data is the main function of this layer
There are two main protocols present in this layer:
TCP: Another integral part, the Transmission Control Protocol is a
reliable communication protocol. It manager the flow of data, i.e.
the sequence and segmentation of the data
UDP: It is a connection-free protocol which makes it cost-effective
but less reliable.
4. Application Layer
The topic three layers of the OSI Model: Application, Presentation and
Sessions, when combined together, they perform similar functions as the
Application Layer of the TCP/IP model
node-to-node communication based on the user-interface occurs here
Multiple protocols are present in this layer, a few common ones have
been mentioned below in brief:
HTTP: Hypertext Transfer Protocol is used to manage the
communication between the server and web browsers
NTP: Network Time Protocol can set one standard time source in
our computer, which enables sync between the server and the user
TELNET: Telecommunication Network is used to have access to
files present of the Telnet network and manage them on internet
FTP: File Transfer Protocol, as the name suggests allows easy
transferring of files
Other protocols of Application layer include Network File System (NFS),
Secure Shell (SSH), Simple Mail Transfer Protocol (SMTP), Trivial File
Transfer Protocol (TFTP), etc.
OSI VS TCP/IP
TCP/IP OSI
TCP refers to Transmission OSI refers to Open Systems
Control Protocol. Interconnection.
TCP/IP has 4 layers. OSI has 7 layers.
TCP/IP is more reliable OSI is less reliable
TCP/IP follow a horizontal OSI follows a vertical approach.
approach.
TCP/IP uses both session OSI uses different session and
and presentation layer in presentation layers.
the application layer itself.
TCP/IP developed protocols OSI developed model then
then model. protocol.
Transport layer in TCP/IP In OSI model, transport layer
does not provide assurance provides assurance delivery of
delivery of packets. packets.
TCP/IP model network layer Connection less and connection
only provides connection oriented both services are provided
less services. by network layer in OSI model.
Protocols cannot be While in OSI model, Protocols are
replaced easily in TCP/IP better covered and is easy to
model. replace with the change in
technology.
Similarities between TCP/IP model and OSI model :
Similarities TCP/IP and OSI Model
1. Model Both TCP/IP are logical models.
2. Structure Both are arranged as layered wise which is also called
an architectural model. These models have a stack of
protocols it means the protocol is arranged in every
layer. Both the models have some set of protocols.
3. Networking Both TCP/IP define standards for networking.
4. Framework Both TCP/IP provide a framework for creating and
implementing networking standards and devices.
5. Communicat Both TCP/IP divide the network communication
ion process process into making their layers.
6. Similar In Both TCP/IP models manufacturer allows making
components sets devices and network components that can co-exist
and work with the devices and components that are
made by the other manufacturers.
7. functionality In both TCP/IP models, a single layer defines a
particular functionality and set standards for that
functionality only.