mod 5
mod 5
In a switched network, switches are used to forward data from one device to another across
the network. A switch is like a traffic officer, ensuring data goes to the correct destination.
Switched networks work by moving data through different paths in a network. These paths can
vary depending on the type of switching.
1. Circuit-Switched Networks
2. Packet-Switched Networks
3. Message-Switched Networks
Each type uses a different way of transmitting data. Let’s explain these in detail.
1. Circuit-Switched Networks
How It Works:
● A dedicated path (or circuit) is created between two devices before communication
begins.
● The path stays reserved for the entire duration of communication.
Example:
Disadvantages:
● Inefficient because the line is reserved even when no data is being sent (e.g., moments
of silence during a call).
● Expensive because it requires resources to keep the path open.
2. Packet-Switched Networks
How It Works:
Example:
1. Datagram Networks:
○ Each packet is treated independently and may take different routes.
○ Example: The Internet.
2. Virtual-Circuit Networks:
○ A logical path is established for packets before transmission, but the path is not
physically reserved.
○ Example: Voice over IP (VoIP) services.
Advantages:
● Efficient because resources are used only when data is being sent.
● Flexible since packets can find alternate routes if one path is busy.
Disadvantages:
● Can have delays if packets arrive out of order.
● May experience packet loss in poor network conditions.
3. Message-Switched Networks
How It Works:
● The entire message (not divided into packets) is stored temporarily at intermediate
nodes (storage) before being forwarded to the next node.
● Also called store-and-forward switching.
Example:
● Sending an email:
○ The email is stored on a mail server before being delivered to the recipient.
○ If the recipient’s device is offline, the email stays in storage until it can be
delivered.
Advantages:
Disadvantages:
Use Case Landline calls. Internet browsing, video calls. Email, SMS.
Reliability Very reliable. May have delays or packet loss. Reliable due to storage.
Speed Fast once Fast overall but may have Slower due to
connection is set. delays. intermediate storage.
Summary
The OSI model is like a blueprint or guide for how data moves between devices in a network. It
divides the communication process into 7 layers, with each layer handling a specific task. By
splitting the process into layers, it becomes easier to understand, troubleshoot, and design
communication systems.
Here’s a simple breakdown of each layer, explained step by step, starting from the basics.
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
These layers work together to ensure that data sent from one device (e.g., your computer)
reaches another device (e.g., a server) successfully.
A common mnemonic to remember the 7 layers of the OSI model in order is:
This sentence helps you recall the layers from bottom to top.
1. Physical Layer
What It Does:
● This is the lowest layer, responsible for the actual physical connection between devices.
● It handles the transmission of raw data (like electrical signals, light pulses, or radio
waves) over cables, fiber optics, or wireless signals.
Key Functions:
● Defines hardware like cables, switches, hubs, and network interface cards (NICs).
● Converts data into signals that can be transmitted physically.
● Deals with bit-by-bit transmission.
Example:
● The Ethernet cable or Wi-Fi that connects your laptop to the internet.
What It Does:
● The data link layer ensures that data moves error-free between two directly connected
devices.
● It organizes data into small chunks called frames and handles error detection and
correction.
Key Functions:
● Adds physical (MAC) addresses to the data, ensuring it reaches the correct device on
the local network.
● Handles error detection, like checking if data got corrupted during transmission.
Sub-Layers:
1. MAC (Media Access Control): Controls access to the physical medium (e.g., who gets
to send data).
2. LLC (Logical Link Control): Ensures error-free communication between devices.
Example:
● Your router uses MAC addresses to send data to your laptop instead of your
smartphone.
3. Network Layer
What It Does:
● This layer is responsible for moving data between different networks and finding the best
path for data to travel.
Key Functions:
● Adds logical addresses (IP addresses) to the data to identify devices in different
networks.
● Finds the most efficient route for data to travel from the sender to the receiver (called
routing).
Protocols Used:
Example:
● When you type a website name, the network layer ensures the data packet is routed
from your device to the web server hosting that website.
4. Transport Layer
What It Does:
● Ensures that the data arrives reliably and in the correct order.
Key Functions:
● Divides the data into smaller segments and ensures all segments are delivered without
errors.
● Adds port numbers to the data to distinguish between different applications (e.g., a web
browser vs. a video call).
● Can use two methods for delivery:
1. TCP (Transmission Control Protocol): Reliable, ensures all data is delivered
and in order.
2. UDP (User Datagram Protocol): Faster but less reliable; used for real-time
applications like video streaming.
Example:
● If you download a file, the transport layer ensures the entire file is delivered without
missing pieces.
5. Session Layer
What It Does:
● Manages and controls the session (or connection) between two devices.
● It establishes, maintains, and terminates connections.
Key Functions:
● Coordinates communication between devices (e.g., decides when to start and stop
sending data).
● Handles sessions that require ongoing communication (e.g., video calls, online gaming).
Example:
● When you join a Zoom call, the session layer ensures your connection remains active
and synchronized with others.
6. Presentation Layer
What It Does:
● Translates data into a format that the application layer can understand.
● Ensures data encryption, decryption, and compression.
Key Functions:
Example:
● When you watch a YouTube video, the presentation layer ensures the video format is
understandable by your browser.
● Encrypts your data while shopping online for secure transactions.
7. Application Layer
What It Does:
● This is the topmost layer that interacts directly with the user.
● It provides network services to applications like browsers, email clients, and file-sharing
programs.
Key Functions:
Example:
● When you open a browser and type a URL, the application layer communicates with the
server to fetch the website data.
1. Application Layer (7): You type a message and press send. WhatsApp handles this
request and uses a protocol like HTTP to send it.
2. Presentation Layer (6): The message is converted into a standard format and
encrypted for security.
3. Session Layer (5): A connection is established between your device and the receiver's
device.
4. Transport Layer (4): The message is broken into segments, and TCP ensures it will be
delivered reliably.
5. Network Layer (3): Adds IP addresses (yours and the receiver’s) and decides the best
route for the message.
6. Data Link Layer (2): Adds MAC addresses and converts the data into frames.
7. Physical Layer (1): Sends the message as electrical signals (via Wi-Fi or cables).
At the receiver’s side, the process happens in reverse, layer by layer, until the message is
displayed in their WhatsApp app.
● Modular Design: Each layer has a specific task, making it easier to understand and
troubleshoot.
● Interoperability: Different technologies and systems can work together because they
follow the same layered structure.
● Flexibility: New protocols can be added without affecting other layers.
Simple Analogy
Think of the OSI model like sending a letter via postal mail:
Summary Table
Layer Purpose Example
3. Network Finds the best path for data between networks. Routers, IP address
The TCP/IP model is a simplified version of the OSI model, used primarily for networking and
internet communications. Unlike the OSI model, which has 7 layers, the TCP/IP model has 4
layers. However, when some people refer to the TCP/IP model with 5 layers, they often break
the Application layer into two parts: the Application and Presentation layers. Here's a
breakdown of the 5-layer TCP/IP model:
Here’s a simple and easy-to-remember mnemonic for the 5 layers of the TCP/IP model:
Breaking it down:
1. A - Application
2. P - Presentation (often combined with Application in the TCP/IP model, but can be
considered separately in other models)
3. S - Session
4. T - Transport
5. D - Data Link
6. P - Physical
This phrase helps you remember the layers from top to bottom.
● This is the highest layer of the TCP/IP model and is closest to the end user.
● It directly interacts with software applications like web browsers, email programs, file
transfer tools, etc.
● It includes protocols that applications use to communicate over the network.
Key Functions:
Example:
When you open your browser and type a URL, the Application layer (via HTTP) sends the
request to retrieve the website.
2. Transport Layer
● This layer is responsible for end-to-end communication and ensures that data is
delivered correctly between devices on a network.
● It takes the data from the Application layer and breaks it down into segments for
transmission.
● The Transport layer ensures reliable delivery, error detection, and flow control.
Key Functions:
● Segments data into smaller chunks and reassembles them on the receiver's side.
● Handles flow control (ensuring the sender doesn't overwhelm the receiver).
● Ensures reliability (with error checking and retransmission) using protocols like TCP
and UDP.
Protocols:
Example:
If you're streaming a video, the Transport layer makes sure the data (video packets) arrive in the
correct order without errors.
● The Internet layer handles routing and addressing of data to ensure it reaches the
correct destination across multiple networks.
● This layer is responsible for delivering packets from the sender to the receiver, possibly
passing through several intermediary devices (like routers).
Key Functions:
Protocols:
Example:
When you visit a website, the Internet layer ensures that your device sends the data request to
the correct server using its IP address.
● The Data Link layer is responsible for the direct transfer of data between two devices
on the same network.
● It frames data and ensures error-free transmission at the local network level.
● It is concerned with physical addressing, like the MAC address.
Key Functions:
Example:
In a home Wi-Fi network, the Data Link layer is responsible for sending data packets from your
laptop (identified by its MAC address) to your router.
● The Physical layer is the lowest layer and deals with the actual transmission of raw bits
over a physical medium (cables, wireless signals, etc.).
● It converts the data into electrical signals, light pulses, or radio waves for transmission.
Key Functions:
Example:
When you send a file over Wi-Fi, the Physical layer ensures that the data is transmitted via radio
waves to the nearest wireless access point.
4. Data Link Transfers data between devices on the same Ethernet, Wi-Fi
network.
5. Physical Sends raw bits over physical media. Ethernet cables, Wi-Fi,
Fiber
1. Application Layer (e.g., your web browser) sends a request (like opening a webpage).
2. Transport Layer breaks the data into packets and ensures reliability (via TCP).
3. Internet Layer assigns an IP address to the data and routes it across the internet.
4. Data Link Layer ensures the data reaches the correct device on your local network
using MAC addresses.
5. Physical Layer sends the actual bits (data) over the network using electrical signals,
light, or radio waves.
When the data reaches the recipient, the layers work in reverse order to reassemble the data
and deliver it to the user.
In Summary:
The 5-layer TCP/IP model helps us understand how data travels over the internet and local
networks, from the moment it’s created by an application to when it reaches its destination. It
simplifies networking by breaking it down into logical steps:
By understanding these layers, you can better understand how the internet works, how devices
communicate, and how data travels around the world.