OSI MODEL
• OSI stands for Open Systems Interconnection. The OSI model,
created in 1984 by ISO(International Organization for
Standardization), is a reference framework that explains the process
of transmitting data between computers. It is divided into seven
layers that work together to carry out specialized network functions,
allowing for a more systematic approach to networking.
Figure: Layers of OSI model
1. Physical Layer
• The main functionality of the physical layer is to transmit the individual bits from one node to another node.
• It is the lowest layer of the OSI model.
• It establishes, maintains and deactivates the physical connection.
• Functions of the Physical Layer
• Bit synchronization: The physical layer provides the synchronization of the bits by providing a clock. This
clock controls both sender and receiver thus providing synchronization at the bit level.
• Bit rate control: The Physical layer also defines the transmission rate i.e. the number of bits sent per second.
• Physical topologies: Physical layer specifies how the different, devices/nodes are arranged in a network i.e.
bus, star, or mesh topology.
• Transmission mode: Physical layer also defines how the data flows between the two connected devices. The
various transmission modes possible are Simplex, half-duplex and full-duplex.
2.Data Link Layer (DLL) – Layer 2
• The data link layer is responsible for the node-to-node delivery of the message. The Data Link Layer is responsible for
delivering data across a single link between two directly connected nodes, rather than routing data across an entire
network.. The main function of this layer is to make sure data transfer is error-free from one node to another, over
the physical layer. When a packet arrives in a network, it is the responsibility of the DLL to transmit it to the Host using
its MAC address.
• The Data Link Layer is divided into two sublayers:
• Logical Link Control (LLC): Manages flow control and error control
• Media Access Control (MAC):Manages physical addressing and framing
• Framing is the process of encapsulating data from the network layer into smaller, manageable units called frames.
Functions of the Data Link Layer
• Framing: Framing is a function of the data link layer. It provides a way for a sender to transmit a set of bits that are
meaningful to the receiver. This can be accomplished by attaching special bit patterns to the beginning and end of the
frame.
• Physical addressing: After creating frames, the Data link layer adds physical addresses (MAC addresses) of the sender
and/or receiver in the header of each frame.
• Error control: The data link layer provides the mechanism of error control in which it detects and retransmits
damaged or lost frames.
• Flow Control: The data rate must be constant on both sides else the data may get corrupted thus, flow control
coordinates the amount of data that can be sent before receiving an acknowledgment.
• Access control: When a single communication channel is shared by multiple devices, the MAC sub-layer of the data
link layer helps to determine which device has control over the channel at a given time.
Here are the components of a frame:
• Frame Header − It includes the frame’s source and destination addresses.
• Payload field − It includes the message that needs to be spread.
• Trailer − The bits for error detection and repair are present
Physical Address:
In the data link layer, physical addressing identifies devices on a network using unique MAC addresses. These
addresses are added to the frame header to specify the sender and receiver. MAC addresses are assigned by
the network interface card (NIC) manufacturer and are unique to each device.
A Network Interface Card (NIC)
A network interface card (NIC) is a hardware component, typically a circuit board or chip, installed on a
computer so it can connect to a network. Modern NICs provide functionality to computers, such as support
for input/output interrupt, direct-memory access interfaces, data transmission, network traffic engineering and
partitioning.
3. Network layer-layer 3
• The network layer works for the transmission of data from one host to the
other located in different networks. It also takes care of packet routing i.e.
selection of the shortest path to transmit the packet, from the number of
routes available. The sender & receiver’s IP addresses are placed in the
header by the network layer.
Functions of the Network Layer
• Routing: The network layer protocols determine which route is suitable
from source to destination. This function of the network layer is known as
routing.
• Logical Addressing: To identify each device on Internetwork uniquely, the
network layer defines an addressing scheme. The sender & receiver’s IP
addresses are placed in the header by the network layer. Such an address
distinguishes each device uniquely and universally.
How the network layer works
1.The network layer receives data segments from the transport layer
2.It encapsulates the data segments into IP packets
3.It forwards the packets to the data link layer for transmission
4.The data link layer breaks the packets into frames
5.The network layer reassembles the packets at the destination
• Packet Vs Frames
In networking, a packet is the unit of data at the network layer (Layer 3
of the OSI model), while a frame is the unit of data at the data link layer
(Layer 2 of the OSI model). Packets are used for communication across
different networks, using IP addresses, while frames are used for
communication within a single network segment, using MAC
addresses.
4. Transport Layer – Layer 4
• The data in the transport layer is referred to as Segments. It is responsible for the end-to-end(process to
process) delivery of the complete message. The transport layer also provides the acknowledgment of
the successful data transmission and re-transmits the data if an error is found.
• Segmentation and Reassembly: This layer accepts the message from the (session) layer, and breaks the
message into smaller units. Each of the segments produced has a header associated with it. The
transport layer at the destination station reassembles the message.
• Service Point Addressing: To deliver the message to the correct process, the transport layer header
includes a type of address called service point address or port address. Thus by specifying this address,
the transport layer makes sure that the message is delivered to the correct process.
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. The TCP protocol is connection-based, so it creates and
maintains a connection between the receiver and the sender while the data is being passed between them. Therefore,
any information that travels through the internet is guaranteed to arrive unaltered.
• 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 connection less protocol.
• It is an unreliable transport protocol as in this case 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. It is used for
broadcasting in real time applications. Example: Game, video streaming etc.
Segmentation:
• Segmentation is a process where the transport layer protocol (like TCP)
divides the data received from the upper layers (like the application layer)
into smaller, more manageable chunks called segments.
• A port number is a way to identify a specific process to which an internet
or other network message is to be forwarded when it arrives at a server.
Example:
Port 80. HTTP is the protocol that enables the World Wide Web.
Port 25. Simple Mail Transfer Protocol (SMTP) is commonly used for email
Port 443. HTTPS is like HTTP, but enhanced with security features.
5.Session Layer – Layer 5
• This layer is responsible for the establishment of connection, maintenance
of sessions, and authentication, and also ensures security.
• Functions of the Session Layer
• Session establishment, maintenance, and termination: The layer allows
the two processes to establish, use, and terminate a connection.
• Synchronization: This layer allows a process to add checkpoints that are
considered synchronization points in the data. These synchronization
points help to identify the error so that the data is re-synchronized
properly, and ends of the messages are not cut prematurely and data loss is
avoided.
• Dialog Controller: The session layer allows two systems to start
communication with each other in half-duplex or full-duplex.
6. Presentation Layer – Layer 6
• The presentation layer is also called the Translation layer. The data from the
application layer is extracted here and manipulated as per the required format to
transmit over the network.
• Functions of the Presentation Layer
• Translation: For example, ASCII to EBCDIC.
• Encryption/ Decryption: Data encryption translates the data into another form or
code. The encrypted data is known as the cipher text and the decrypted data is
known as plain text. A key value is used for encrypting as well as decrypting data.
For iexample, "Hi, how are you?" might become "8363, 5017, 11884, 9546" after
encryption and then back to "Hi, how are you?" after decryption using the same
key.
• Compression: Reduces the number of bits that need to be transmitted on the
network.
7. Application Layer – Layer 7
• At the very top of the OSI Reference Model stack of layers, we find the
Application layer which is implemented by the network applications. These
applications produce the data, which has to be transferred over the network. This
layer also serves as a window for the application services to access the network
and for displaying the received information to the user.
• Example: Application – Browsers, Skype Messenger, etc.
1. The application Layer is also called Desktop Layer.
2. Device or Protocol Use : SMTP(Simple Mail transfer Protocol)
HTTP/HTTPS(Hypertext Transfer Protocol/Hypertext
transfer Protocol secure)
POP(Post Office Protocol)
FTP(File Transfer Protocol)
• HTTP (Hypertext Transfer Protocol): The foundation of web browsing,
used for sending and receiving web content.
• SMTP (Simple Mail Transfer Protocol): Used for sending emails from
a client to a server or between servers.
• FTP (File Transfer Protocol): A standard protocol for transferring files
between a server and a client.
• POP enables email clients to connect to a mail server and download
email messages to a local devic.e
TCP/IP model
• The TCP/IP model, also known as the Internet Protocol Suite, is a set of
communication protocols used for the Internet and similar networks. It has 4
layers, each serving specific functions to allow communication across networks.
Network Access Layer (also known as Link Layer)
• This layer deals with the physical transmission of data on the network.
• It defines how data is physically sent (electrical signals, light, radio waves)
• It handles framing, MAC addressing, and error detection at the link level
• It communicates with network hardware like switches and network cards.
• Examples:
• Ethernet
• Wi-Fi (IEEE 802.11)
• PPP (Point-to-Point Protocol):
Internet Layer
It handles logical addressing and routing of data packets.
• Functions:
• Assigns and uses IP addresses for devices
• Breaks data into packets and routes them to the destination
• Determines the best path across networks
• Main protocol:
• IP (Internet Protocol): Core of the internet
• Supports both IPv4 and IPv6
• Other protocols:
• ICMP(Internet Control Message Protocol): used for diagnostics like ping(Sends ICMP
echo requests to test if a host is reachable. If the host is online, it replies with an
echo reply.)
• ARP(Address Resolution Protocol) :resolves IP to MAC addresses.
Transport Layer
• In the TCP/IP model, the transport layer is responsible for providing
reliable data delivery between applications, ensuring that data packets
arrive in sequence and without errors.
It carries out the following functions:
•Process-to-Process Delivery
•Reliable Data Transmission (TCP)
•Unreliable Data Transmission (UDP)
•Flow Control:
•Error Detection and Correction:
Application Layer
• The Application Layer in the TCP/IP model is the topmost layer,
serving as the interface between user applications and the network. It
provides protocols and services that enable applications to exchange
data and interact with each other across a network. Examples of
protocols used in this layer include HTTP for web browsing, FTP for
file transfer, and SMTP for email.