COMPUTER NETWORKS –
PART 3
OSI Model
• OSI stands for Open Systems Interconnection.
• It has been developed by ISO – ‘International Organization for Standardization‘, in
the year 1984.
• It is a 7 layer architecture with each layer having specific functionality to perform.
• All these 7 layers work collaboratively to transmit the data from one device to
another across the globe.
Fig. OSI Model Layers
Physical Layer (Layer 1)
• The lowest layer of the OSI reference model is the physical layer.
• It is responsible for the actual physical connection between the devices.
• The physical layer contains information in the form of bits.
• It is responsible for transmitting individual bits from one node to the next.
• When receiving data, this layer will get the signal received and convert it into 0s
and 1s and send them to the Data Link layer, which will put the frame back
together.
The functions of the physical layer are as follows:
• 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 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 the way in which the different,
devices/nodes are arranged in a network i.e. bus, star, or mesh topology.
• Transmission mode: Physical layer also defines the way in which the data flows
between the two connected devices. The various transmission modes possible
are Simplex, half-duplex and full-duplex.
NOTE: Hub, Repeater, Modem, Cables are Physical Layer devices
Data Link Layer (DLL) (Layer 2)
• The data link layer is responsible for the node-to-node delivery of the message.
• 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 DLL to transmit it to
the Host using its MAC address.
• The packet received from the Network layer is further divided into frames
depending on the frame size of NIC (Network Interface Card).
• DLL also includes Sender and Receiver’s MAC address in the header.
The functions of the Data Link layer are :
• 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. The advantage of using
frames is that data is broken up into recoverable chunks that can easily be checked
for corruption.
• Physical addressing: After creating frames, the Data link layer adds physical addresses
(MAC address) of the sender and/or receiver in the header of each frame.
• Error control: 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 acknowledgement.
• 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.
NOTE: Switch & Bridge are Data Link Layer devices
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 network layer divides the data received from the transport layer in the form
of packets
• The sender & receiver’s IP addresses are placed in the header of each packet by
the network layer.
The functions of the Network layer are :
• 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: In order 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 of the packet by the network layer. Such an
address distinguishes each device uniquely and universally.
NOTE: Network layer is implemented by networking devices such as routers and Layer 3 Switches
Transport Layer (Layer 4)
• The transport layer provides services to the application layer and takes services
from the network layer.
• The data in the transport layer is referred to as Segments.
• It is responsible for the End to End Delivery of the complete message.
• The transport layer also provides the acknowledgement of the successful data
transmission and re-transmits the data if an error is found.
• At sender’s side: Transport layer receives the formatted data from the upper
layers, performs Segmentation, and also implements Flow & Error control to
ensure proper data transmission. It also adds Source and Destination port
numbers in its header and forwards the segmented data to the Network Layer.
• At receiver’s side: Transport Layer reads the port number from its header and
forwards the Data which it has received to the respective application. It also
performs sequencing and reassembling of the segmented data.
• The functions of the transport layer are as follows:
• 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: In order 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 services provided by the transport layer :
• Connection-Oriented Service: It is a three-phase process that includes
• Connection Establishment
• Data Transfer
• Termination / disconnection
• In this type of transmission, the receiving device sends an acknowledgement, back
to the source after a packet or group of packets is received. This type of
transmission is reliable and secure.
• Connectionless service: In this type of transmission, the receiver does not
acknowledge receipt of a packet. This approach allows for much faster
communication between devices. Connection-oriented service is more reliable
than connectionless Service.
NOTE: Devices that work on this layer - Gateways, Firewalls
Session Layer (Layer 5)
• Session Establishment, Maintenance, and Termination: It creates, maintains, and
terminates communication sessions between applications. A session allows for the
exchange of data between devices and ensures that the communication remains
open for the necessary duration.
• Dialogue Control: The Session Layer manages the dialogue between two
communicating devices, ensuring that data is exchanged in a structured way. It can
support two-way communication (full-duplex) or one-way communication (half-
duplex), and it coordinates which device sends and receives data at any given time.
• Synchronization: The Session Layer can insert checkpoints (or synchronization
points) into the data stream. If the communication is interrupted (for example, due
to a network failure), it allows the session to resume from the last checkpoint rather
than starting from the beginning.
• Session Recovery: In case of interruptions or failures, the Session Layer helps
recover the session by resuming from the last known state (e.g., checkpoint).
NOTE: Devices that work on this layer - Gateway
Presentation Layer (Layer 6)
• Its primary role is to ensure that data is presented in a way that can be
understood by the receiving system, regardless of any differences in data formats
or encoding schemes between the sender and the receiver.
• Data Compression: The Presentation Layer can compress data to reduce the
amount of data that needs to be transmitted, improving transmission speed and
bandwidth usage. It ensures that data is decompressed at the receiving end.
• Data Encryption and Decryption: To ensure secure data transmission, the
Presentation Layer may encrypt data before sending it and decrypt it upon
receipt. This helps protect the confidentiality and integrity of the data during
transit.
• Data Translation: It manages the syntax and structure of the data being sent. For
example, it may convert data from a specific format (such as EBCDIC) into another
format (like ASCII), making the data compatible with the receiving system.
NOTE: Devices that work on this layer - Gateways, SSL/TLS Devices
Application Layer (Layer 7)
• End-user Communication: It provides a way for end-users to interact with the network. Applications like web browsers, email clients,
and file transfer programs rely on the Application Layer to send and receive data.
• Application Protocols: The Application Layer supports various protocols that govern communication between software applications.
These protocols define the format and rules for data exchange.
• Data Representation and Formatting: The Application Layer is responsible for ensuring that data is in a format that the application
can understand. This may involve: Data Serialization: Converting data structures into formats suitable for transmission (e.g., JSON,
XML).Data Encoding/Decoding: Converting data into a format that can be transmitted and received by different applications, like
converting character sets (e.g., ASCII, UTF-8).
• Session Management: While session management is technically handled by the Session Layer, the Application Layer provides
mechanisms for users to initiate, manage, and terminate sessions. For example, a user logging into an application establishes a
session that persists for the duration of their interaction.
• Error Handling and Data Integrity: Although the lower layers (Transport Layer) handle reliable transmission, the Application Layer
often deals with application-level error handling and may implement error-checking procedures specific to the application (e.g.,
verifying the integrity of a downloaded file).
• Network Access and Resource Sharing: The Application Layer allows users to access networked resources, such as shared files,
databases, or printers. It manages the access control and permissions necessary for these resources to be shared and used
efficiently.
• User Authentication and Authorization: Many applications use the Application Layer to manage user authentication (confirming
identity) and authorization (granting permissions). For example, when accessing an email system or a secure website, the Application
Layer may prompt for user credentials.
• Communication Services: The Application Layer provides support for a variety of communication services, such as voice, video, and
text-based services. Examples include:VoIP (Voice over IP): Facilitates voice communication over the network.Video conferencing:
Transmits video data over a network for real-time communication.Instant messaging: Enables real-time text communication.
NOTE: Devices that work on this layer – Firewalls, Load Balancer, Proxy Servers
TCP/IP Model
• The TCP/IP model is a fundamental framework for computer networking. It stands
for Transmission Control Protocol/Internet Protocol, which are the core protocols
of the Internet.
• This model defines how data is transmitted over networks, ensuring reliable
communication between devices.
• TCP/IP was developed by the U.S. Department of Defense in 1970s.
• TCP/IP model is structured with four different layers. These four layers are:
• Application layer
• Transport layer
• Internet layer
• Network Access layer
TCP vs IP
• The TCP (Transmission Control Protocol) and IP (Internet Protocol) protocols are
the two main protocols that make up the Internet Protocol Suite. They work
together to ensure that data is properly transmitted over a network.
• IP is responsible for addressing and routing packets of data across the network. It
is responsible for the delivery of packets from the source to the destination. IP
packets contain the source and destination addresses, as well as other
information such as the packet's size.
• TCP, on the other hand, is responsible for ensuring that the data is properly
transmitted and received. It is responsible for breaking down data into packets,
transmitting them over the network, and then reassembling them at the
destination. TCP also ensures that packets are acknowledged and retransmitted if
necessary, to ensure that data is delivered reliably.
• In summary, IP is responsible for addressing and routing packets, while TCP is
responsible for ensuring the reliability of the transmission.
Application Layer
• The application layer is the group of applications that let the user access the network.
• For most of us that means email, messaging apps, and cloud storage programs.
• This is what the end-user sees and interacts with when sending and receiving data.
Some of the protocols used in this layer are:
• HTTP: Hypertext Transfer Protocol (HTTP) is an application-layer protocol for
transmitting hypermedia documents, such as HTML. It was designed for
communication between web browsers and web servers.
• SMTP: The Simple Mail Transfer Protocol (SMTP) is used to deliver e-mail messages
over the Internet. This protocol is used by most e-mail clients to deliver messages to
the server, and is also used by servers to forward messages to other servers.
• FTP: FTP (File Transfer Protocol) is used for transmitting files between computers over
TCP/IP connections
SMTP POP IMAP
Stands for Simple mail transfer Stands for Internet Message
protocol Stands for Post Office Protocol. Access Protocol.
Used for sending mail. Used for retrieving mail. Used for retrieving mail.
it is push protocol. it is pull protocol. it is pull protocol.
It work between sender’s mail
server to receiver’s mail server It work between receiver and It works between receiver and
and sender and sender’s mail receiver’s mail server. receiver’s mail server.
server.
It download all the mail when it
Stores emails on a server and
connected to internet and
It does not store mail on server syncs them across multiple
removes mails from server.
it just send the mail. devices . (multiple devices usage;
(single device usage; offline
requires internet connection)
usage)
Transport Layer
• The transport layer provides a reliable data connection between two
communicating devices.
• The transport layer divides the data in packets and adds a header to each packet
with source and destination port numbers. This layer also ensures that the
recipient acknowledges the packets it receives.
• Some of the protocols used in this layer are:
• TCP: TCP is a connection-oriented protocol. Connection-orientation means that
the communicating devices should establish a connection before transmitting
data and should close the connection after transmitting the data.
• UDP: UDP is a connectionless protocol. There is no overhead for opening a
connection, maintaining a connection, and terminating a connection. UDP is
efficient for broadcast and multicast types of network transmission.
TCP vs
UDP
TCP is reliable as it guarantees the delivery of The delivery of data to the destination cannot
Reliability data to the destination router. be guaranteed in UDP.
Error checking TCP provides extensive error-checking
UDP has only the basic error checking
mechanisms. It is because it provides flow
mechanism control and acknowledgment of data.
mechanism using checksums.
Acknowledgment An acknowledgment segment is present. No acknowledgment segment.
Sequencing of data is a feature of Transmission There is no sequencing of data in UDP. If the
Sequence Control Protocol (TCP). this means that packets order is required, it has to be managed by the
arrive in order at the receiver. application layer.
UDP is faster, simpler, and more efficient than
Speed TCP is comparatively slower than UDP.
TCP.
Retransmission of lost packets is possible in There is no retransmission of lost packets in
Retransmission TCP, but not in UDP. the User Datagram Protocol (UDP).
Header Length TCP has a (20-60) bytes variable length header. UDP has an 8 bytes fixed-length header.
TCP vs
UDP
Handshaking
Uses handshakes such as SYN, ACK, SYN-ACK It’s a connectionless protocol i.e. No handshake
Techniques
Broadcasting TCP doesn’t support Broadcasting. UDP supports Broadcasting.
UDP is used by DNS , DHCP , TFTP, SNMP , RIP ,
Protocols TCP is used by HTTP, HTTPs , FTP , SMTP and Telnet .
and VoIP .
Overhead Low but higher than UDP. Very low.
This protocol is used in situations where quick
This protocol is primarily utilized in situations when a
communication is necessary but where
safe and trustworthy communication procedure is
Applications dependability is not a concern, such as VoIP,
necessary, such as in email, on the web surfing, and
game streaming, video, and music streaming,
in military services.
etc.
Internet Layer
• The internet layer, also known as the network layer, controls the flow and routing
of traffic to ensure data is sent speedily and accurately. This layer is responsible
for breaking packets into smaller units called "IP datagrams" when necessary.
• This layer is also responsible for reassembling the data packet at its destination
• 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 internet access. It is using this protocol that the
path with which the data shall be transmitted is decided.
• 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 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.
Role of MAC Address in Local Communication:
• When a device wants to send data to another device within the same local
network, it uses MAC addresses to identify the correct physical destination. Even
though the device uses an IP address to communicate logically, in a local network,
data frames need to be directed to specific hardware devices. The MAC address is
used by network devices to know where to send the data at the hardware level.
Role of the Router:
• If the source and destination devices are on different networks, the router will
use the IP address to route the data packet to the correct network. Once the
router has determined the correct next hop or destination network, it needs to
deliver the data to the device within that network. This is where the router needs
the MAC address of the destination device in the local network, because routers
cannot communicate directly with IP addresses at the physical (hardware) level.
Network Access Layer
• The network access layer, also known as the data link layer, handles the physical
infrastructure that lets computers communicate with one another over the
internet.
• The network access layer also includes the technical infrastructure — such as the
code that converts digital data into transmittable signals — that makes network
connection possible.
• The Network Access Layer encapsulates the data received from the higher layers
(Transport and Internet layers) into frames. Also, the mapping of IP address into
physical address is done here.
• This layer defines how the data should be sent physically through the network.
This layer is responsible for the transmission of the data between two devices on
the same network.
• FDDI, X.25, Ethernet, Frame Relay, Token Ring are included in the Network Access
Layer.