OSI Model
OSI Model
During communication of data the sender appends the header and passes it to the lower
layer while the receiver removes header and passes it to upper layer. Headers are added at
layer 6,5,4,3 & 2 while Trailer is added at layer 2.
In the OSI model, headers and trailers are metadata added to data at different layers for
control, addressing, and error detection, a process called encapsulation. At the Data Link
layer (Layer 2), an Ethernet header contains source/destination MAC addresses and a trailer
contains an error-checking code like Frame Check Sequence (FCS). At the Network layer
(Layer 3), an header adds IP addresses for routing, and at the Transport layer (Layer 4), an
header adds port numbers for application-to-application communication.
• Flow control: Like the data link layer, the transport layer is responsible for flow control.
However, flow control at this layer is performed end to end rather than across a single
link.
• Error control: Like the data link layer, the transport layer is responsible for error control.
However, error control at this layer is performed process-to process rather than across a
single link. The sending transport layer makes sure that the entire message arrives at the
receiving transport layer without error (damage, loss, or duplication). Error correction is
usually achieved through retransmission
5.Session Layer
• Session management: Dividing a session into sub sessions by the introduction of
checkpoints and separating long messages into shorter units called dialog units appropriate
for transmission.
• Synchronization: Deciding in what order to pass the dialog units to the transport layer and
where in the transmission to require confirmation from the receiver. • Dialog control:
Deciding who sends, and when.
• Graceful close: Ensuring that the exchange has been completed appropriately before the
session closes.
• Dialog control. The session layer allows two systems to enter into a dialog. It allows
the communication between two processes to take place in either half duplex (one
way at a time) or full-duplex (two ways at a time) mode.
6.Presentation layer:
• Translation: Changing the format of a message from that used by the sender into one
mutually acceptable for transmission. Then, at the destination, changing that format into the
one understood by the receiver.
• Encryption: Encryption and decryption of data for security purposes.
• Compression: Compressing and decompressing data to make transmission more efficient.
• Security: Validating passwords and log-in codes.
7. Application Layer
• Web Services: Allows accessing web content in the form of text, images and multimedia
using the HTTP protocol
• File access, transfer, and management: Allows a user at a remote computer to access files
in another host (to make changes or read data); to retrieve files from remote computer for
use in the local computer; and to manage or control files in remote computer at that
computer.
• Mail services: Provides the basis for electronic mail forwarding and storage.
• Directory services: Provides distributed database sources and access for global information
about various objects.
Addressing
Four levels of addresses are used in an internet employing the TCP/IP protocols: physical
(link) addresses, logical (IP) addresses, port addresses.
Physical Addresses: The physical address, also known as the link address or mac address, it is
the address used in local network it has a 6-byte (48-bit) physical address that is imprinted on
the network interface card (NIC) example 07:01:02:01:2C:4B A 6- byte (12 hexadecimal digits)
physical address
Win R CMD getmac
INTERNETWORKING –
An internetworking is the process or technique of connecting different types of
networks or network segments for making large global network by using routing
technology. Internetwork is used in data communication between networks which is
owned and operated by different entities using a common data communication and
the Internet Routing Protocol.
wo or more networks or network segments connect using devices that operate at layer
3 (Network Layer) of the OSI Basic Reference Model such as a router. Any
interconnection among or between commercial, public, private, and industrial or
governmental networks may also be defined as an internetwork. It allows people and
their computers to communicate across different kinds of networks.
Interconnected networks use the Internet Protocol. There are three variants of
internetworks such as Intranet, Extranet and Internet.
1. Intranet – An intranet is a set of networks, using the Internet Protocol and IP-based
tools such as web browsers and file transfer applications which are under control of a
single administrative entity. The administrative entity closes or contact to all but
specific authorized users. In other words, an intranet is the internal network of an
organization. A large intranet network will have one web server to provide users with
organizational information.
2. Extranet – An extranet is a controlled private network which allows access to vendors,
partners, and suppliers or an authorized set of customers. It is a part of intranet in
which selected people outside the company can use.
3. Internet – Internet is the largest network in the world. It consists of a worldwide
interconnection of academic, governmental, private and public networks which is
based upon the networking technologies of the Internet Protocol Suite.
Advantages
● Simple to set up and cost-effective.
● Well-suited for small networks with few devices.
Disadvantages
● Limited scalability; adding more devices can degrade performance.
● A single cable break can disrupt the entire network.
Uses
● Used in simple setups where a few computers are connected to share files or
printers.
● Used in older Ethernet networks using coaxial cables.
● Used in manufacturing environments where sensors and controllers are connected
along a single communication line.
3. Star Topology
In a star topology, each device is connected directly to a central hub or switch. All
communication between devices must go through this central point. It's like a hub-
and-spoke model, with the hub being the focal point for data transmission.
Advantages
● Easy to install, manage, and troubleshoot.
● Isolates issues to individual connections; a failure in one device doesn't affect
others.
Disadvantages
● Dependence on the central hub; if it fails, the entire network goes down.
● More cabling is required, making it costlier than a bus topology.
Uses
● Common in corporate environments where each computer connects to a central
switch or hub.
● ATMs and branch systems connect to a central server for secure and reliable
transactions.
4. Ring Topology
In a ring topology, each device is connected to exactly two other devices, forming a
closed loop or ring. Data circulates the ring in one direction. When a device receives
data, it processes it and passes it along to the next device until it reaches its
destination.
Advantages
● Even data distribution, as each device has an equal opportunity to transmit.
● Simple and predictable data path.
Disadvantages
● A break in the ring can disrupt the entire network.
● Adding or removing devices can be complex.
Uses
● Used in city-wide networks to connect multiple buildings or institutions in a loop
for efficient data routing.
● IBM’s Token Ring LANs used ring topology to manage access and avoid collisions.
5. Mesh Topology
Mesh topology is like a web of connections, where each device is connected to every
other device. This creates redundancy and multiple paths for data to travel. Mesh
networks can be either full mesh (every device is connected to every other) or partial
mesh (some devices have fewer connections).
Advantages
● High redundancy; network remains operational even if some connections fail.
● Scalable and adaptable; can handle a large number of devices.
Disadvantages
● Expensive due to the numerous cables and ports required.
● Complex to set up and maintain.
Uses
● Used in battlefield networks for high reliability and redundancy.
● Used in large campuses, cities, or rural areas to provide widespread Wi-Fi
coverage.
6. Tree Topology
A tree topology combines characteristics of star and bus topologies, arranging nodes
in a hierarchical structure that resembles a tree. In this layout, multiple star
networks are connected to a central bus, allowing for a scalable and organized
network design.
Think of a family tree, where each branch represents different family members
connected to a common ancestor. Similarly, in a tree topology, the central node acts
as the trunk, with branches extending to various sub-nodes.
Advantages:
● Scalable and easy to expand by adding new nodes without disrupting the entire
network.
● Facilitates better management and organization of devices.
Disadvantages:
● If the central trunk fails, it can disrupt the entire network.
● More complex to configure and maintain compared to simpler topologies.
Uses
● Schools and universities use tree topology to connect labs, libraries, and
administrative offices in a structured hierarchy.
● ISPs use tree topology to manage regional and local networks branching from a
central hub.
7. Hybrid Topology
A hybrid topology combines two or more different topologies into a single network.
This is often done to harness the strengths of one topology while mitigating its
weaknesses. For example, a network might use a star topology for its core
infrastructure and a bus topology for a smaller, isolated segment.
Advantages
● Flexibility to tailor the network to specific needs.
● Enhanced fault tolerance by combining different topologies.
Disadvantages
● Complexity increases with the number of topologies integrated.
● requires careful planning to ensure smooth operation.
Uses
● Hybrid topology helps manage thousands of servers with a combination of mesh
(for redundancy) and star (for control) structures.
● Critical systems like patient records and diagnostics use star topology for control,
while monitoring devices may use mesh for continuous data flow.
What is the Best Type of Network Topology?
The best type of topology depends on the factors you care about the most. Here are
some factors, and the best type of network topology for them.
1. For low costs: Bus and Star
2. For high reliability: Mesh and Hybrid
3. For high scalability: Tree and Mesh
4. For high performance: Mesh and Star
Types of Network Architectures
Network architecture is the overall design and structure of a network, including its
hardware, software, protocols, and layers. It is different from the network topology,
as a topology only defines the layout and connections of devices, whereas network
architecture defines the broader design and structure of the network.
Some common network architectures include 3-tier (core, distribution, access), 2-tier
(collapsed core), spine-leaf, SOHO, and cloud architectures.
1. Two-tier Network Topology
A two-tier network topology is a flat or collapsed core design. It consists of two
layers i.e., the access layer and the core layer. In organizations where the network is
smaller, scalability and complexity are not much concern generally adopt this type of
architecture. Here is the topology of the two-tier network topology for your
reference.
Scenario: In a data center, a spine-leaf topology may consist of leaf switches in the
access layer connecting servers or storage devices. These leaf switches are then
connected to spine switches in the spine layer, which provide connectivity between
leaf switches and facilitate east-west traffic. This design ensures that any device in
the network can reach any other device with minimal latency.
4. WAN Network Topology
WAN (Wide Area Network) topology refers to the network architecture used to
interconnect geographically dispersed locations or branch offices. Here is the WAN
topology in which branch offices, regional offices, remote offices, and data centers
are connected. There can be thousands of branches which are connected to the
WAN infrastructure.
Scenario: In a multi-site organization, a WAN topology may involve multiple branch
offices connected to a central headquarters. Each branch office typically has its own
local area network (LAN) connected to a router, which establishes a connection to
the WAN.
The WAN network can be implemented using technologies such as leased lines,
MPLS (Multi-Protocol Label Switching), VPN (Virtual Private Network), or SD-WAN
(Software-Defined Wide Area Network).
5. Small Office/Home Office (SOHO) Network Topology
SOHO network topology is generally used in a small office or a home office. Here is
the typical SOHO network topology for your reference.
Scenario: In a home office setup, a SOHO topology may involve a single router or
gateway device that connects to the internet service provider (ISP). The end-user
devices, such as laptops, phones, etc. can be connected to the router via wireless or
wired connections, and servers can also be connected to the router through wired
connections.
6. On-premises and Cloud Network Topology
When network architectural designs use both On-premises and cloud networks for
deploying network resources. On-premises means deploying network devices
infrastructure locally and integrated with cloud services to fulfill all the needs of an
organization.
Scenario: In a hybrid cloud environment, on-premises network resources such as
servers, storage, and switches are interconnected with cloud resources through
dedicated connections or secure VPN tunnels. The on-premises network is just like
an extension of the cloud network which utilizes the data exchange between the two
environments.
Types of Cables
There are three types of cables in computer networks: coaxial, twisted pair, and
Fiber optic cables, each with unique characteristics and uses. Let's understand each
of them in detail.
1. Coaxial Cable
A coaxial cable is a networking cable used for transmitting data, video, and voice
signals. It transmits data in the form of electrical signals.
Coaxial cable is built with four main components:
1. Inner Conductor: A central wire, typically made of copper, which carries the
electrical signal.
2. Dielectric Insulator: Surrounds the inner conductor, ensuring signal integrity and
preventing interference.
3. Outer Conductor (Shield): Made of braided copper or metal foil, it protects the
signal from external electromagnetic interference (EMI).
4. Outer Jacket: Provides physical protection and insulation for the cable.
Coaxial cables are mostly used in applications that require high-frequency signal
transmission, like cable television, broadband internet, and radio.
The first coaxial cable was patented by Oliver Heavisine in 1880. They come in two
primary impedance types: 50 Ohm for moderate power environments and 75
Ohm for residential installations and antenna connections.
2. Twisted Pair Cable
A twisted pair cable is a type of network cable made of pairs of insulated copper
wires twisted together. The twisting helps reduce electromagnetic interference from
external sources and crosstalk between adjacent pairs.
These cables are widely used in Ethernet networks and come in various categories
(e.g., Cat5e, Cat6) that determine their speed and performance.
The structure of a twisted pair cable typically includes two main components:
1. Insulated Copper Wires: These are twisted together to minimize interference.
2. Shielding (Optional): Some cables include additional shielding to protect against
electromagnetic interference.
Here is an image of twisted pair cable:
Twisted pair cables were invented by Alexander Graham Bell in 1881 and are mostly
used in telephones, local area networks (LANs), and Ethernet connections.
There are two types of twisted pair cables:
● Unshielded Twisted Pair (UTP): UTP cables consist of multiple twisted pairs of
copper wires, typically up to four pairs, each enclosed in a protective plastic jacket.
The twisting helps reduce electromagnetic interference (EMI) and crosstalk between
pairs
● Shielded Twisted Pair (STP): STP cables include an additional layer of shielding,
such as aluminum foil or copper braid, which provides better protection against
electromagnetic interference, making them suitable for high-speed networks and
environments with significant EMI.
3. Fiber Optic Cables
A fiber optic cable is the fastest data transmission cable as it uses light signals
instead of electrical signals to transfer data. Fiber optic cables were first developed
in the 1970s. They transmit data as light signals through thin glass or plastic fibers,
offering high-speed data transmission over long distances with minimal signal
degradation.
The structure of a fiber optic cable typically includes three main components:
1. Core: The central part of the fiber where light travels, made from glass or plastic.
2. Cladding: Surrounds the core, reflecting light into the core to maintain signal
integrity.
3. Outer Jacket: Provides physical protection to the fiber.
Fiber optic cables are mostly used in high-speed internet connections,
telecommunications, and data centers due to their ability to support high
bandwidths and long-distance transmissions.
Categories of Cables
Network cables are categorized based on their function and speed. We have from
Cat1 to Cat8 cables right now. Each category has a different purpose in networking,
and the table below describes the specifications and uses of different categories of
network cables.
Category Bandwidth Data Rate Description & Use
Cat1 750 kHz Voice only Used for old telephone lines.
No internet support.
2. Multimode Fiber
Multimode fiber has a larger core size (commonly 50/125 or 62.5/125 microns) and
uses either LED or laser light sources. It allows multiple light paths to propagate
simultaneously. Cladding reflects the light into the core as it travels through the
core.
Multimode fiber cables are typically color-coded orange. They are suitable for short
to medium distances and provide lower-cost solutions compared to single-mode
fiber.
Multimode fiber is commonly used in LAN environments, data centers, and campus
networks where high-speed connectivity within a limited distance is required. Here is
the picture of a multi-mode fiber wherein one end is LC, and the other end is SC.
3. Copper
Copper interfaces use electrical signals transmitted through copper wires or twisted-
pair cables. Copper cabling includes various types such as Category 5e (Cat5e),
Category 6 (Cat6), Category 6a (Cat6a), etc.
These cables consist of twisted pairs of copper wires enclosed in a protective jacket.
Copper cabling is commonly used for Ethernet connections within shorter distances,
typically up to 100 meters.
It is widely deployed in office networks, home networks, and other LAN
environments. Here are the pictures of RJ-45 connectors and RJ-45 ports on a Cisco
3560CX switch.
Circuit switching:
At physical layer
continuous flow
No Headers
Efficiency is low
Delay is less
Total Time=Setup Time+ Transmission Time + Propagation Delay + Tear down Time
Transmission Time=Message/BW
Propagation Delay =Distance /Speed
1. Datagram: It is also called connectionless packet switching. Each packet gets routed
independently. The routing table stored in the router (MAC table in case of the switch)
helps to determine the outgoing link to reach the destination. Since a packet gets
delivered using a different path, it may reach the destination in a different order, and
hence packets are provided with sequence numbers, which helps them assemble at
the destination. It is the most commonly used switching technique.
Works at Network Layer
2. Virtual Circuit: It is also called connection-oriented packet switching. It combines the
feature of both circuit switching and message switching. Before initiating data
transmission, it establishes a logical path called a virtual circuit. All the packet follows
this same virtual circuit established between the sender and the receiver. To identify
the path, the packet contains a virtual circuit identifier bit. This bit is shorter than the
source and destination address header used in the datagram technique. After
establishing the virtual circuit, data gets transmitted in the form of packets.
Works at Data Link
Message5 Switching:
Message switching is a communication technique in which data gets transmitted in
the form of divided messages and packets. In this case, each message is treated as an
individual entity and transmitted individually from one point to another, which means
each message/packet may or may not pass through the same path. They can travel
with different paths to reach their destination. In the case of message switching, a
dedicated connection between sender and receiver is not required.
NOTE: Message switching is also known as the store and forward method.
Each node in a communications channel stores the packet, receives, reads the header,
and then forwards. If the next hop node is occupied with a packet of a different device
and is unable to receive the existing packet, the previous node stores the packet until
the next hop node is unoccupied. Generally, messages get transmitted on a first come
first serve basis. If the message has the priority header, it is given priority over another
message. Hence each node requires some storage capacity.
The complete message is transferred from one end to another through nodes. There
is no physical connection or link between sender and receiver.
The message contains the destination address. Each node stores the message and
then forward it to the next node as shown in the below diagram.
In telegraphy, the text message is encoded using the morse code into a sequence of
dots and dashes. Each dot or dash is communicated by transmitting a short and long
pulse of electrical current. The following diagram shows the concept of message
switching in computer networks.
Hop by Hop Delivery
Unicast, broadcast, and multicast are network communication methods that differ
in how data is delivered: Unicast sends data from one source to one specific
destination, Broadcast sends data from one source to all devices on a network, and
Multicast sends data from one source to a specific group of interested devices.
Unicast
• One-to-One: A single device sends data to another single, specific device.
• Addressing: Uses a unique destination address for the single recipient.
• Use Cases: Email, file transfers, and private communication between two endpoints.
• Characteristics: Efficient for targeted data, generates less network traffic than
broadcasting, and provides secure, private communication.
Broadcast
• One-to-All: A single device sends data to every other device within a network
segment.
• Addressing: Uses a special broadcast address that all devices in the network segment
are programmed to receive.
• Use Cases: DHCP requests (to find a server) or ARP requests (to resolve an IP address
to a MAC address).
• Characteristics: Simple for reaching all devices, but generates the most network
traffic.
Multicast
• One-to-Many (Group):
A single source sends data to a selected group of multiple recipients that have
expressed interest in receiving the data.
• Addressing:
Uses a special multicast address, and routers and switches can use features
like IGMP snooping to efficiently deliver the traffic only to interested subscribers.
• Use Cases:
Video streaming, live broadcasts, and online gaming where multiple people need to
receive the same information.
• Characteristics:
Efficient for delivering data to multiple users without the high traffic overhead of
unicast.
1. The sender sends the frames 0 and 1 from the first window (because the window
size is 2).
2. The receiver after receiving the sent frames, sends an acknowledgment for
frame 2 (as frame 2 is the next expected frame).
3. The sender then sends frames 2 and 3. Since frame 2 is lost on the way, the receiver
sends back a “NAK” signal (a non-acknowledgment) to inform the sender that
frame 2 has been lost. So, the sender retransmits frame 2.
What is Error Control in the Data Link Layer?
Error Control is a combination of both error detection and error correction. It
ensures that the data received at the receiver end is the same as the one sent by the
sender.
Error detection is the process by which the receiver informs the sender about any
erroneous frame (damaged or lost) sent during transmission.
Error correction refers to the retransmission of those frames by the sender.
Examples of Flow
Control techniques are : Examples of Error Control techniques are :
1. Stop and Wait for 1. Stop and Wait for ARQ,
Protocol, 2. Sliding Window ARQ.
2. Sliding Window
Protocol.
Framing:
• Framing
Grouping of Bits
Frames are the units of digital transmission, notably in Framing in Computer
networks
Frame
• Header: It consists of the frame’s source and destination address. A frame header
holds the destination address, the supply address, and 3 management fields kind, seq,
and ack helping the subsequent purposes:
• kind: This field expresses whether the frame could be an information frame, or it’s
used for management functions like error and flow management or link management,
etc.
• Seq: This holds the sequence variation of the frame for transcription of out–of–
sequence frames and causing acknowledgments by the receiver.
• Ack: This contains the acknowledgment variety of some frames, significantly once
piggybacking is employed.
• Payload: It contains the message to be delivered. It contains the particular message
or data that the sender desires to transmit to the destination machine. It contains the
particular message or data that the sender desires to transmit to the destination
machine
• Trailer: It contains the error detection and correction bits.
• Flag: It contains the points to the starting and the ending of the frame.
IP Addressing
Class A
IP addresses belonging to class A are assigned to the networks that contain a large
number of hosts.
• The network ID is 8 bits long.
8-1 =7 Bits net id available 2 ^7=128 networks
0 n/w and 127 loopback
• The host ID is 24 bits long.
The higher-order bit of the first octet in class A is always set to 0. The remaining 7
bits in the first octet are used to determine network ID. The 24 bits of host ID are
used to determine the host in any network. The default subnet mask for Class A is
255.x.x.x. Therefore, class A has a total of:
• 224 - 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 0.0.0.0 - 127.255.255.255.
Class B
IP address belonging to class B is assigned to networks that range from medium-
sized to large-sized networks.
• The network ID is 16 bits long.
• The host ID is 16 bits long.
The higher-order bits of the first octet of IP addresses of class B are always set to 10.
The remaining 14 bits are used to determine the network ID. The 16 bits of host ID
are used to determine the host in any network. The default subnet mask for class B
is 255.255.x.x. Class B has a total of:
• 214 = 16384 network address
• 216 - 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.0.0 – 191.255.255.255.
Class C
IP addresses belonging to class C are assigned to small-sized networks.
• The network ID is 24 bits long.
• The host ID is 8 bits long.
The higher-order bits of the first octet of IP addresses of class C is always set to 110.
The remaining 21 bits are used to determine the network ID. The 8 bits of host ID
are used to determine the host in any network. The default subnet mask for class C
is 255.255.255.x. Class C has a total of:
• 221 = 2097152 network address
• 28 – 2 = 254 host address
IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
Class D
IP address belonging to class D is reserved for multi-casting. The higher-order bits of
the first octet of IP addresses belonging to class D is always set to 1110. The
remaining bits are for the address that interested hosts recognize.
Class D does not possess any subnet mask. IP addresses belonging to class D range
from 224.0.0.0 – 239.255.255.255.
Class E
IP addresses belonging to class E are reserved for experimental and research
purposes. IP addresses of class E range from 240.0.0.0 – 255.255.255.255. This class
doesn’t have any subnet mask. The higher-order bits of the first octet of class E are
always set to 1111.