Layered Architecture and OSI Model
Layered Architecture and OSI Model
Layer Architecture
Layers, Service & Protocols
Why Layering ?
Protocols
OSI LAYERS
OSI Model
OSI Model Layers
Application Layer
• The Application Layer is the topmost layer (Layer 7) in the OSI model. It is closest to the end user and
directly interacts with software applications to provide services that allow communication over a network.
• This layer acts as a bridge between the user and the lower layers, providing services such as email, file
transfers, and web browsing.
Application Layer
• Purpose of the Application Layer
User Interface: The Application Layer serves as an interface for the end users, providing network services
that allow users to interact with applications over a network.
Communication Services: It supports application-specific protocols that allow for file transfers, emails, and
other data communications.
• Network Resource Access: Through this layer, applications gain access to network resources such as file
systems and databases.
Application Layer
• Key Functions of the Application Layer
Email Communication:
o The Application Layer enables the transmission and reception of emails using protocols such as SMTP (Simple Mail Transfer
Protocol).
o It ensures that emails are properly delivered to recipients, supporting the growing need for electronic messaging.
Web Browsing:
o HTTP (Hypertext Transfer Protocol) and HTTPS (HTTP Secure) protocols allow users to access websites and web-based
applications.
o The Application Layer ensures the smooth exchange of web data between browsers and servers.
Directory Services:
o Directory services protocols like LDAP (Lightweight Directory Access Protocol) allow applications to query and update directory
databases used for managing information about network users, devices, and resources.
Network Authentication:
o Protocols at the Application Layer facilitate user authentication and authorization when accessing network services or
applications.
o Example: Kerberos, which handles secure user logins.
Application Layer
Application Layer Protocols
POP3 (Post Office Protocol) and IMAP (Internet Message Access Protocol):
o POP3 allows users to download emails from a mail server to their device and read them offline.
o IMAP is more flexible, enabling users to read emails without downloading them and synchronize emails across multiple devices.
DNS (Domain Name System):
o DNS is responsible for translating human-readable domain names (e.g., www.example.com) into IP addresses (e.g., 192.168.1.1)
that machines use to identify each other on a network.
DHCP (Dynamic Host Configuration Protocol):
o DHCP assigns IP addresses to devices on a network, allowing them to communicate with other devices without manual
configuration.
Telnet and SSH (Secure Shell):
o Telnet provides remote access to servers or devices via a command-line interface, but it lacks security.
o SSH is the secure version, encrypting the communication between the user and the remote server.
Application Layer
• Communication Methods
Client-Server Model:
o The Application Layer often operates in a client-server model, where a client requests services, and the server provides
them. This is commonly seen in web browsing, email services, and database access .
o Example: A web browser (client) requests a webpage from a web server.
Peer-to-Peer (P2P):
o In a peer-to-peer model, each device on the network can act as both a client and a server, sharing files or resources directly
with other peers.
o Example: P2P file-sharing systems like BitTorrent.
Application Layer
•User Interaction and Application Layer
Application Software Interaction:
o Application Layer protocols are used by various applications (e.g., web browsers, email clients, FTP clients) to
communicate with each other over a network.
o Example: A user sends an email through an email client, which uses SMTP at the Application Layer to send the
email.
Interface with Lower Layers:
o While the Application Layer interacts directly with user-facing software, it relies on the lower layers of the OSI
model to ensure data is transmitted and received accurately across the network.
Application Layer
• Email and Messaging Services
SMTP is responsible for sending emails, while POP3 and IMAP handle retrieving and managing emails.
These protocols ensure that users can exchange messages reliably, even over long distances.
Instant Messaging:
o Instant messaging services also rely on Application Layer protocols to exchange messages in real-time between users.
o Example: XMPP (Extensible Messaging and Presence Protocol).
Application Layer
• Directory and Database Services
Different applications and systems may use different protocols or data formats, and ensuring that they can
communicate effectively requires consistent protocol implementation and standardization
Application Layer
Data Encryption and Decryption: This layer handles data encryption to protect sensitive information
during transmission and decryption when it reaches the destination.
Data Compression and Decompression: It manages data compression to reduce the size of the data for
faster transmission and decompression at the destination to restore the data to its original form.
Presentation Layer
Data Translation:
o Different systems may use different formats to represent data. The Presentation Layer ensures that data
from one system is translated into a format that can be understood by another.
o For example, it may convert EBCDIC (Extended Binary Coded Decimal Interchange Code) used on
mainframe systems into ASCII (American Standard Code for Information Interchange) used on
modern computers.
Character Encoding:
o The Presentation Layer manages the encoding of characters in different formats, such as Unicode,
ASCII, and UTF-8.
o This ensures that text data is correctly represented and understood between different systems.
Presentation Layer
•Data Translation
Data Format Compatibility:
o Different devices and operating systems may use different data formats and encoding standards. The
Presentation Layer ensures that data sent by one system can be understood by another system, even if
they use different formats.
o For example, if a device uses Big Endian to store data and another device uses Little Endian, the
Presentation Layer handles the conversion between the two formats.
Multimedia Data:
o When transmitting multimedia data such as images, audio, and video, the Presentation Layer ensures
that the data formats (e.g., JPEG, MP3, MPEG) are compatible across different devices.
Presentation Layer
• These protocols are used to secure communication between web browsers and servers (e.g., for HTTPS websites).
Presentation Layer
•. Data Compression
Purpose of Compression:
o Data compression is used to reduce the size of data before transmission. This leads to faster transmission speeds and reduces the
amount of bandwidth required.
o Compression is especially important in multimedia applications where large files (such as images, videos, and audio) are
transmitted.
Lossless vs. Lossy Compression:
o Lossless Compression: No data is lost during compression. This is important for applications where data integrity is critical,
such as in text files or executable programs. Examples of lossless compression formats include ZIP and PNG.
o Lossy Compression: Some data is discarded during compression to achieve a smaller file size, but this may lead to a slight
reduction in quality. This is often used for images, audio, and video files where perfect accuracy is not essential. Examples of
lossy formats include JPEG for images and MP3 for audio.
Decompression:
o Once the data reaches its destination, the Presentation Layer decompresses the data to restore it to its original size and format.
o This ensures that the receiving application layer gets the data in the correct form for processing.
Presentation Layer
•The Session Layer is the responsible for establishing, managing, and terminating communication sessions
between applications on different devices. The primary role of this layer is to ensure that the data exchange
between systems or applications occurs in an organized and synchronized manner.
Session Layer
Session Termination:
o When communication is complete, the Session Layer is responsible for gracefully terminating the
session, ensuring that all data has been properly transmitted and no resources are left unnecessarily
allocated.
Dialog Control:
o The Session Layer provides mechanisms to control the dialog between two systems. For example:
Simplex: Data flows in only one direction (sender to receiver).
Half-duplex: Data flows in both directions but not simultaneously (i.e., one device sends while the
other waits).
Full-duplex: Data can flow in both directions at the same time (simultaneous sending and
receiving).
Session Layer
Synchronization:
o This layer provides synchronization points in the data stream, called checkpoints. These checkpoints
allow communication to resume from a known point in case of an interruption.
o If a failure occurs, such as a network disruption, the session can be resumed from the last
synchronization point without needing to restart the entire data transfer.
Session Recovery:
• If there is a disruption in the communication (such as a network failure), the Session Layer is responsible for
recovering the session, either by restarting it or resuming it from the last known checkpoint
Session Layer
.
2 Session Establishment and Termination
Session Establishment:
o A session is set up between two devices when an application on one device requests data from
another application (e.g., a client-server interaction).
o The Session Layer negotiates parameters, such as the type of session, synchronization points, and
how data will be exchanged.
o Once the session is established, the data exchange can begin.
Session Termination:
o After the data exchange is complete, the Session Layer ensures that the session is properly closed.
o This process ensures that no further data will be sent or received and that system resources are freed
up for other tasks.
Session Layer
• Example: Telephone conversations where both parties can talk and listen at the same time.
Session Layer
• It ensures that the video and audio streams are synchronized and that the communication session remains active throughout
the meeting.
Session Layer
• The Session Layer is essential for distributed computing environments where multiple sessions may need to
be managed across different network devices
Session Layer
Examples:
Data Flow from Presentation Layer
Transport Layer
Transport Layer
• The Transport Layer is the fourth layer in the OSI model. It is responsible for
ensuring reliable data transfer between devices, controlling the flow of data, and
providing error detection and recovery. The primary goal of the transport layer
is to deliver complete, error-free data from the source to the destination.
Transport Layer
End-to-End Communication: The Transport Layer ensures that data is delivered from the source to the
destination across multiple networks, maintaining the end-to-end connection between devices.
Segmentation and Reassembly: It breaks down large chunks of data into smaller, manageable pieces called
segments. Once the data reaches its destination, it is reassembled into its original form.
• Error Handling and Reliability: It provides mechanisms for detecting and correcting errors in transmitted
•. Key Functions
Segmentation and Reassembly:
o The Transport Layer divides large data streams from higher layers (such as the application layer) into smaller
segments, suitable for transmission.
o At the destination, it reassembles the segments back into the original data.
Flow Control:
o The Transport Layer manages data flow between the sender and receiver to prevent the sender from
overwhelming the receiver with too much data at once.
o Windowing protocols like Sliding Window Protocol are used to control the amount of data that can be sent
before requiring an acknowledgment.
Error Detection and Recovery:
o Errors can occur during transmission (due to lost, duplicated, or corrupted segments). The Transport Layer
uses techniques like checksums and retransmission to detect and correct these errors.
Transport Layer
Connection Management:
o For connection-oriented protocols like TCP, the Transport Layer establishes, maintains, and terminates a
connection between two devices before data can be transferred.
o It also ensures that data is sent and received in the correct sequence and without loss.
Multiplexing:
o The Transport Layer can handle multiple applications on a single device by using port numbers. Each
application is assigned a unique port number, allowing the transport layer to direct the data to the
correct process.
Transport Layer
•Key Protocols at the Transport Layer
TCP (Transmission Control Protocol):
o Connection-Oriented: TCP establishes a reliable connection between the sender and receiver before transmitting
data. This ensures that data arrives in the correct order, without errors, and without loss.
o Reliability: TCP provides mechanisms for error checking, acknowledgment, and retransmission if data is lost or
corrupted.
o Three-Way Handshake: TCP uses a process called the three-way handshake to establish a connection:
1. SYN: The sender sends a synchronization request.
2. SYN-ACK: The receiver acknowledges the request.
3. ACK: The sender confirms the acknowledgment, and the connection is established.
o Error Control: TCP ensures reliable delivery by using sequence numbers and ACKs. If a segment is lost, TCP
retransmits it.
o Flow Control: TCP uses windowing to manage the rate of data transmission and avoid overwhelming the receiver.
o Use Cases: TCP is used in applications requiring high reliability, such as web browsing, email, and file transfers
(e.g., HTTP, FTP, SMTP).
Transport Layer
Segmentation: Large messages (e.g., files, multimedia) are broken into smaller segments for
transmission.
Reassembly: Once the segments arrive at the destination, the Transport Layer reassembles them
into the original message.
Each segment includes sequence numbers, ensuring that they can be properly reordered if they
arrive out of sequence.
Segmentation
Transport Layer
•Flow Control
Flow control ensures that the sender does not overwhelm the receiver with too much data at once.
Sliding Window Protocol: A common flow control mechanism where the sender and receiver agree on a
"window" size—how much data can be sent before receiving an acknowledgment.
o The receiver sends acknowledgments after processing the data. The sender can adjust the transmission
rate based on the acknowledgment feedback.
Checksums: Both TCP and UDP use checksums to detect errors in transmitted data. A checksum is a value
calculated from the data. If the checksum of the received data doesn't match, an error is detected.
Retransmission: In TCP, if an error is detected, the corrupted segment is discarded, and the sender
retransmits it.
Acknowledgment (ACK) and Retransmission: TCP uses acknowledgments to confirm the successful
receipt of data. If an ACK is not received, the sender assumes the segment was lost and retransmits it.
Transport Layer
• Security: While the transport layer itself does not handle encryption, protocols like SSL/TLS (which operate
between the transport and application layers) provide secure communication.
Transport Layer
• Identifying Service
• Multiplexing & De-multiplexing
• Segmentation
• Sequencing & Reassembling
• Error Correction
• Flow Control
Transport Layer
Identifying Service
TCP UDP
• The Network Layer is the third layer in the OSI model. It plays a crucial role in routing data across networks
and determining the best path for data packets to travel from the source to the destination. This layer is
responsible for logical addressing, packet forwarding, routing, and fragmentation
Network Layer
•Purpose of the Network Layer
End-to-End Packet Delivery: The Network Layer is responsible for the delivery of packets from
the source host to the destination host across multiple networks, often called internetworking.
• It makes decisions about the path that data will take to reach its destination, based on network
conditions, performance, and the logical address of the destination
Network Layer
• . Key Functions
Logical Addressing:
o The Network Layer assigns a logical address to devices, called an IP address (Internet Protocol
address), which uniquely identifies each device on a network.
o IP addresses ensure that data is delivered to the correct device on different networks.
Routing:
o One of the main responsibilities of the network layer is determining the best path for packets to take
across a network or multiple networks (internetwork).
o Routers, which operate at the network layer, use routing protocols to determine the optimal route for
forwarding packets, based on factors like distance, network traffic, and speed.
o Routing protocols: Examples include OSPF (Open Shortest Path First), RIP (Routing Information
Protocol), and BGP (Border Gateway Protocol).
.
Network Layer
Routing:
o One of the main responsibilities of the network layer is determining the best path for packets to take across a network or
multiple networks (internetwork).
o Routers, which operate at the network layer, use routing protocols to determine the optimal route for forwarding packets,
based on factors like distance, network traffic, and speed.
o Routing protocols: Examples include OSPF (Open Shortest Path First), RIP (Routing Information Protocol), and BGP
(Border Gateway Protocol).
Packet Forwarding:
o After determining the route, the network layer forwards packets across network devices such as routers, following the selected
path toward the destination.
o This process is also known as packet switching.
Fragmentation and Reassembly:
o The Network Layer is responsible for dividing data into smaller units, called fragments, to fit the maximum transmission unit
(MTU) of the underlying physical network.
o If a packet is too large for a given network, the network layer fragments it, and the receiving system reassembles it.
Error Handling and Diagnostics:
• Protocols at this layer also include error reporting and network diagnostics. For example, ICMP (Internet Control Message
Network Layer
• Different networks may use different protocols and addressing schemes, making it important for the network layer to enable
communication across diverse networks
Network Layer
•Examples of Network Layer Protocols in Action
Internet: The most common use of the network layer is the internet itself, where routers forward packets
based on IP addresses across various interconnected networks.
VPN (Virtual Private Networks):
o VPNs create a secure tunnel for data across public networks using encryption and tunneling protocols.
Network layer protocols like IPsec work at this layer to provide security.
Routed Protocols
Network Layer
Network Layer is responsible for providing best path for data to reach the destination.
Logical Addressing works on this layer.
Router is a Network Layer device
• The Data Link Layer is the second layer in the OSI model. It plays a crucial role in ensuring reliable data
transmission between adjacent nodes on the same network. This layer is responsible for establishing and
controlling communication between directly connected devices, detecting and correcting errors that may
occur at the physical layer, and ensuring smooth data flow
Data Link Layer
•Purpose of the Data Link Layer
Node-to-Node Data Transfer: The data link layer is responsible for reliable communication between two
directly connected devices on the same network. It deals with how data is formatted, transmitted, and
received between these devices.
• Frame Creation: This layer converts raw bits from the physical layer into data packets called frames. A
frame is the smallest unit of data handled at this layer.
Data Link Layer
•Key Functions
Error Detection and Correction:
o The data link layer detects and corrects any errors that may have occurred during the transmission of
data from the physical layer.
o Techniques like Cyclic Redundancy Check (CRC) are used to detect errors in frames, ensuring that
corrupted data doesn’t propagate through the network.
Flow Control:
o This function ensures that the sender does not overwhelm the receiver with too much data at once,
preventing data loss or congestion.
o Protocols like Stop-and-Wait and Sliding Window are commonly used to control the flow of data.
Frame Synchronization:
o Frames must be synchronized so that the receiving device can distinguish where one frame ends, and
the next begins.
• Bit stuffing or special control bits are used to mark the start and end of each frame
Data Link Layer
•Sub-Layers of the Data Link Layer
•The Data Link Layer is divided into two sub-layers:
1. Logical Link Control (LLC):
o Handles communication between the network layer and the data link layer.
o Manages flow control and error checking, and provides an interface for the network layer above.
o Identifies which network protocol is being used, such as IP for internet communication.
2. Media Access Control (MAC):
o Responsible for controlling how devices access the physical medium (cable or wireless).
o Assigns MAC addresses (a unique identifier) to network devices.
o Determines when a device can send data, ensuring that multiple devices can share the same physical
medium without collisions (e.g., in Ethernet or Wi-Fi networks).
• Uses techniques like Carrier Sense Multiple Access with Collision Detection (CSMA/CD) for wired
networks (Ethernet) and Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) for wireless
networks (Wi-Fi)
Data Link Layer
•Frame Structure
•A frame typically contains:
Preamble: Used to synchronize communication between devices.
Source and Destination MAC Addresses: Identifies the devices sending and receiving the data.
Payload: The actual data being transmitted.
• Error Check (CRC): Ensures that the data is not corrupted during transmission
Data Link Layer
•. Network Devices Operating at the Data Link Layer
Switches:
o Operate at the data link layer and are responsible for forwarding frames between devices within the
same network.
o Use MAC addresses to determine the destination of frames and to route them appropriately.
o Switches help in reducing traffic by creating separate collision domains for each device.
Network Interface Cards (NICs):
o Each NIC has a unique MAC address that identifies it on the network.
o The NIC is responsible for assembling and disassembling frames, managing error detection, and
controlling data flow.
Data Link Layer
•Error Detection and Correction Mechanisms
Cyclic Redundancy Check (CRC):
o A mathematical technique that allows the receiver to detect errors in the received frames by calculating
a checksum.
Acknowledgment and Retransmission:
o The sender waits for an acknowledgment from the receiver, confirming that the frame was received
correctly. If no acknowledgment is received, the frame is retransmitted.
Data Link Layer
• The Physical Layer is the first and lowest layer in the OSI model, dealing with the actual physical
connection between devices. Here's a detailed breakdown of its function and components
Physical Layer
• Bit-Level Communication: It deals with the electrical, mechanical, and procedural interfaces used to
send bits (0s and 1s) between network devices. It does not concern itself with understanding or managing the
content of the data, but only with how it is physically transmitted
Physical Layer
•Key Functions
Data Encoding: Converts data into signals that can be transmitted, using techniques such as:
o Electrical signals over copper cables (e.g., Ethernet).
o Light signals in fiber optics.
o Radio waves for wireless communication.
Transmission Media: Manages the physical media through which data is sent, including:
o Cables: Twisted pair, coaxial, fiber-optic cables.
o Wireless media: Wi-Fi, radio signals, infrared.
Synchronization: Ensures that sending and receiving devices are synchronized (using clocks) to correctly
interpret the bits being transmitted.
Bit Rate Control: Manages how fast data is transmitted, measured in bits per second (bps).
Physical Topology: Determines the physical layout of devices on a network (e.g., star, bus, ring).
Modulation: Converts digital signals into analog signals (and vice versa) when transmitting data over analog
mediums.
Physical Layer
•Transmission Techniques
Simplex: One-way communication (e.g., television broadcasts).
Half-Duplex: Two-way communication, but not simultaneously (e.g., walkie-talkies).
• Full-Duplex: Two-way communication occurring simultaneously (e.g., telephone calls, modern Ethernet)
Physical Layer
• Signal Jitter: Variations in signal timing that can lead to transmission errors
Physical Layer
•Real-World Examples
Ethernet Cables (Twisted Pair): Commonly used to connect devices to a local network.
Fiber Optic Cables: Used for high-speed internet and data transmission over long distances.
Wi-Fi Signals: Wireless transmission of data over short distances.
Physical Layer Example
Physical Layer
Device working at Physical Layer are Hubs, Repeaters, Cables ,Modems etc
Data flow from Physical Layer
Data Encapsulation & De-capsulation
Simulation Scenario
Port addresses
IP addresses
Comparing OSI with TCP/IP Layers