LAN:
A local area network (LAN) is a private network that connects hosts within a single location, such as
an office or campus, and can range from a small setup to a large network with various devices.
Each host in a LAN has a unique address, and when data is sent between hosts, packets contain both
the source and destination addresses.
In the past, LANs used a shared cable, broadcasting data to all hosts, but modern LANs use smart
switches to efficiently direct data to the intended recipient, reducing network traffic and allowing
multiple pairs of hosts to communicate simultaneously.
WAN:
WANs are larger than LANs and owned by communication companies, while LANs are smaller and
privately owned.
WANs include point-to-point and switched networks.
LANs and WANs are interconnected to form internetworks, enabling communication between
different locations.
Routers route data between networks, while switches manage data within a single network.
Complex network configurations combine LANs, WANs, switches, and routers for widespread
communication.
Switching:
Part 1: Circuit-Switched Network
In circuit-switched networks, dedicated connections (circuits) are established between end systems
The switch can only activate or deactivate circuits as needed.
A simple example involves connecting four telephones at each end to a switch.
High-capacity communication lines connect switches and can handle multiple voice communications
simultaneously.
Circuit-switched networks are most efficient when operating at full capacity; otherwise, they can be
inefficient.
Capacity is often oversubscribed to avoid communication failures.
Part 2: Packet-Switched Network
Packet-switched networks use data packets for communication.
Data packets are exchanged between computers, allowing switches to store and forward them.
Routers in a packet-switched network have queues to store and forward packets.
Packet-switched networks are generally more efficient than circuit-switched networks, although
packets may encounter some delays.
Circuit-Switched Network Example:
Imagine a traditional telephone call, where you pick up the phone and establish a dedicated
connection (circuit) between your phone and the recipient's phone. During the call, the circuit
remains dedicated to your conversation, and it can't be used by anyone else. This is similar to how
older landline phone systems worked.
Packet-Switched Network Example:
Think of a video call using a service like Skype or Zoom. In this case, your audio and video data are
broken into packets and sent over the internet. These packets can take different routes to reach their
destination, and they may not arrive in the same order they were sent. However, the system reorders
and reassembles the packets at the receiving end to provide real-time communication. This is how
most modern internet-based communication works.
TCP/IP Protocol Layer:
Physical Layer: Imagine you want to send an email from your computer to a friend's computer over
the internet. At the physical layer, your computer takes the email message (which is composed of
text and attachments) and converts it into a stream of individual bits (0s and 1s). These bits need to
be physically transmitted over a medium, such as an Ethernet cable or wireless signal.
Data-link Layer: Your computer sends the stream of bits to your router, which is connected to your
internet service provider (ISP). The data-link layer is responsible for taking these bits and organizing
them into packets (frames). These frames have a specific format that includes source and destination
addresses. Your router encapsulates the bits into frames and sends them to your ISP's equipment
using a link-layer protocol, like Ethernet.
Network Layer: At the network layer, your ISP's equipment recognizes that the email packets need to
be sent to your friend's ISP. It checks the destination address and routes the email packets through
the internet using routers and switches. Routers at the network layer make decisions about the best
path to reach your friend's ISP. The Internet Protocol (IP) is used to address and route the packets.
Transport Layer: The email packets eventually reach your friend's ISP, which then sends them to your
friend's computer. At this point, the transport layer becomes crucial. If you're using a reliable email
service, it's like a courier service that guarantees the email will be delivered and reassembled
correctly on your friend's computer. The Transmission Control Protocol (TCP) is an example of a
protocol that ensures data reliability. It establishes a connection, divides the email into smaller
segments, numbers them, and ensures they arrive in the correct order.
Application Layer: Finally, your friend's computer receives the TCP segments and reassembles them
into the complete email message at the application layer. The email client software on your friend's
computer (e.g., Outlook, Gmail) displays the email message, including any attachments. This is where
the user interacts with the email message.
Physical Layer: Converts data to 0s and 1s for transmission over a physical medium (cable or
wireless).
Data-link Layer: Organizes data into packets (frames) with addresses and sends them to the ISP
using a link-layer protocol.
Network Layer: Routes packets through the internet using IP and makes decisions about the best
path.
Transport Layer: Ensures reliable delivery of data, segments it, and maintains order using protocols
like TCP.
Application Layer: Manages user interactions and email content in email clients, preparing data for
lower layers.
The OSI (Open Systems Interconnection)
model is a conceptual framework that standardizes how different networking protocols and
technologies should interact. It divides the networking process into seven distinct layers, each
responsible for specific functions:
Physical Layer: Deals with the physical connection between devices, such as cables and electrical
signals. It's all about raw bits and how they are transmitted over the medium.
Data Link Layer: Manages data frames' flow and error detection on the local network. It ensures data
integrity within the local network segment.
Network Layer: Handles addressing, routing, and packet forwarding. It's responsible for getting data
packets from the source to the destination, potentially across multiple networks.
Transport Layer: Ensures reliable data transfer between devices. It manages flow control, error
correction, and data segmentation.
Session Layer: Manages the communication sessions between devices. It establishes, maintains, and
terminates connections.
Presentation Layer: Deals with data translation, encryption, and compression. It makes sure that
data is in a format that the application layer can use.
Application Layer: This is the top layer and is the one closest to the user. It handles the user interface
and provides network services directly to applications.
In simple terms, think of the OSI model like building a sandwich. Each layer performs a specific task:
Physical Layer: The bread, it's the most basic part of the sandwich.
Data Link Layer: Ensures the integrity of the bread and acts as a barrier between different layers.
Network Layer: Decides how to get the sandwich to its destination.
Transport Layer: Manages the assembly and disassembly of the sandwich for consumption.
Session Layer: Maintains the conversation and ensures the order of bites.
Presentation Layer: Transforms the sandwich into a more digestible form if needed, like cutting it
into bite-sized pieces.
Application Layer: It's the layer where you interact directly with the sandwich.