Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views36 pages

Cnis 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 36

What is Computer Networking?


Computer networking is like having a group of friends who all have phones and can
call or text each other. In computer networking, instead of phones, we have computers
and instead of phone lines, we use cables, Wi-Fi, or other methods to connect them.
When computers are connected to a network, they can share information and
resources, like files, printers, and internet connections. This allows them to
communicate with each other quickly and easily, just like friends talking on their
phones.
A computer network consists of various kinds of nodes. Servers, networking
hardware, personal computers, and other specialized or general-purpose hosts can all
be nodes in a computer network. Hostnames and network addresses are used to
identify them. In this article, we are going to discuss computer networking in detail.

What is a Computer Network?


A computer network is a system that connects many independent computers to share
information (data) and resources. The integration of computers and other different
devices allows users to communicate more easily. A computer network is a collection
of two or more computer systems that are linked together. A network connection can
be established using either cable or wireless media. Hardware and software are used to
connect computers and tools in any network.
What Do Computer Networks Do?
Computer Networks are one of the important aspects of Computer Science. In the
early days, it is used for data transmission on telephone lines and had a very limited
use, but nowadays, it is used in a variety of places.
Computer Networks help in providing better connectivity that helps nowadays.
Modern computer networks have the following functionality:
 Computer Networks help in operating virtually
 Computer Networks integrate on a large scale
 Computer Networks respond very quickly in case of conditions change
 Computer Networks help in providing data security

Key Components of a Computer Network


In simple terms, a computer network is made up of two main parts: devices (called
nodes) and connections (called links). The links connect the devices to each other.
The rules for how these connections send information are called communication
protocols. The starting and ending points of these communications are often called
ports.
Key Components of Computer Network

1. Network Devices
Basic hardware interconnecting network nodes, such as Network Interface Cards
(NICs), Bridges, Hubs, Switches, and Routers, are used in all networks. In addition, a
mechanism for connecting these building parts is necessary, which is usually galvanic
cable and optical cable are less popular (“optical fiber”)The following are the network
devices :
 NIC (Network Interface Card): A network card, often known as a network
adapter or NIC (network interface card), is computer hardware that enables
computers to communicate via a network. It offers physical access to networking
media and, in many cases, MAC addresses serve as a low-level addressing scheme.
Each network interface card has a distinct identifier. This is stored on a chip that is
attached to the card.
 Repeater: A repeater is an electrical device that receives a signal, cleans it of
unwanted noise, regenerates it, and retransmits it at a higher power level or to the
opposite side of an obstruction, allowing the signal to travel greater distances
without degradation. In the majority of twisted pair Ethernet networks, Repeaters
are necessary for cable lengths longer than 100 meters in some systems. Repeaters
are based on physics.
 Hub: A hub is a device that joins together many twisted pairs or fiber optic
Ethernet devices to give the illusion of a formation of a single network segment.
The device can be visualized as a multiport repeater. A network hub is a relatively
simple broadcast device. Any packet entering any port is regenerated
and broadcast out on all other ports, and hubs do not control any of the traffic that
passes through them. Packet collisions occur as a result of every packet being sent
out through all other ports, substantially impeding the smooth flow of
communication.
 Bridges: Bridges broadcast data to all the ports but not to the one that received the
transmission. Bridges, on the other hand, learn which MAC addresses are
reachable through specific ports rather than copying messages to all ports as hubs
do. Once a port and an address are associated, the bridge will only transport traffic
from that address to that port.
 Switches: A switch differs from a hub in that it only forwards frames to the ports
that are participating in the communication, rather than all of the ports that are
connected. The collision domain is broken by a switch, yet the switch depicts itself
as a broadcast domain. Frame-forwarding decisions are made by switches based on
MAC addresses.
 Routers: Routers are networking devices that use headers and forwarding tables to
find the optimal way to forward data packets between networks. A router is a
computer networking device that links two or more computer networks and
selectively exchanges data packets between them. A router can use address
information in each data packet to determine if the source and destination are on
the same network or if the data packet has to be transported between networks.
When numerous routers are deployed in a wide collection of interconnected
networks, the routers share target system addresses so that each router can develop
a table displaying the preferred pathways between any two systems on the
associated networks.
 Gateways: To provide system compatibility, a gateway may contain devices such
as protocol translators, impedance-matching devices, rate converters, fault
isolators, or signal translators. It also necessitates the development of
administrative procedures that are acceptable to both networks. By completing the
necessary protocol conversions, a protocol translation/mapping gateway joins
networks that use distinct network protocol technologies.

Types of Computer Networks



Pre-Requisite: Computer Networking
A computer network is a cluster of computers over a shared communication path that
works to share resources from one computer to another, provided by or located on the
network nodes.

Uses of Computer Networks


 Communicating using email, video, instant messaging, etc.
 Sharing devices such as printers, scanners, etc.
 Sharing files.
 Sharing software and operating programs on remote systems.
 Allowing network users to easily access and maintain information.
Types of Computer Networks
There are mainly five types of Computer Networks
1. Personal Area Network (PAN)
2. Local Area Network (LAN)
3. Campus Area Network (CAN)
4. Metropolitan Area Network (MAN)
5. Wide Area Network (WAN)

Types of Computer Networks

These are explained below.


1. Personal Area Network (PAN)
PAN is the most basic type of computer network. This network is restrained to a
single person, that is, communication between the computer devices is centered only
on an individual‟s workspace. PAN offers a network range of 1 to 100 meters from
person to device providing communication. Its transmission speed is very high with
very easy maintenance and very low cost.
This uses Bluetooth, IrDA, and Zigbee as technology.
Examples of PAN are USB, computer, phone, tablet, printer, PDA, etc.

Personal Area Network (PAN)

2. Local Area Network (LAN)


LAN is the most frequently used network. A LAN is a computer network that
connects computers through a common communication path, contained within a
limited area, that is, locally. A LAN encompasses two or more computers connected
over a server. The two important technologies involved in this network
are Ethernet and Wi-fi. It ranges up to 2km & transmission speed is very high with
easy maintenance and low cost.
Examples of LAN are networking in a home, school, library, laboratory, college,
office, etc.

Local Area Network (LAN)

3. Campus Area Network (CAN)


CAN is bigger than a LAN but smaller than a MAN. This is a type of computer
network that is usually used in places like a school or colleges. This network covers a
limited geographical area that is, it spreads across several buildings within the
campus. CAN mainly use Ethernet technology with a range from 1km to 5km.
Its transmission speed is very high with a moderate maintenance cost and moderate
cost.
Examples of CAN are networks that cover schools, colleges, buildings, etc.
Campus Area Network (CAN)

4. Metropolitan Area Network (MAN)


A MAN is larger than a LAN but smaller than a WAN. This is the type of computer
network that connects computers over a geographical distance through a shared
communication path over a city, town, or metropolitan area. This network mainly uses
FDDI, CDDI, and ATM as the technology with a range from 5km to 50km. Its
transmission speed is average. It is difficult to maintain and it comes with a high cost.
Examples of MAN are networking in towns, cities, a single large city, a large area
within multiple buildings, etc.

Metropolitan Area Network (MAN)

5. Wide Area Network (WAN)


WAN is a type of computer network that connects computers over a large
geographical distance through a shared communication path. It is not restrained to a
single location but extends over many locations. WAN can also be defined as a group
of local area networks that communicate with each other with a range above 50km.
Here we use Leased-Line & Dial-up technology. Its transmission speed is very low
and it comes with very high maintenance and very high cost.
The most common example of WAN is the Internet.

Wide Area Network (WAN)

Comparison between Different Computer Networks


Parameters PAN LAN CAN MAN WAN

Local Campus Wide


Personal Area Metropolitan
Full Name Area Area Area
Network Area Network
Network Network Network

Leased
Bluetooth, Ethernet FDDI, CDDi.
Technology Ethernet Line,
IrDA,Zigbee & Wifi ATM
Dial-Up

Above 50
Range 1-100 m Upto 2km 1 – 5 km 5-50 km
km

Transmission Very
Very High High Average Low
Speed High
Parameters PAN LAN CAN MAN WAN

Private or Private or
Ownership Private Private Private
Public Public

Very
Maintenance Very Easy Easy Moderate Difficult
Difficult

Very
Cost Very Low Low Moderate High
High

Other Types of Computer Networks


1. Wireless Local Area Network (WLAN)
2. Storage Area Network (SAN)
3. System-Area Network (SAN)
4. Passive Optical Local Area Network (POLAN)
5. Enterprise Private Network (EPN)
6. Virtual Private Network (VPN)
7. Home Area Network (HAN)
1. Wireless Local Area Network (WLAN)
WLAN is a type of computer network that acts as a local area network but makes use
of wireless network technology like Wi-Fi. This network doesn‟t allow devices to
communicate over physical cables like in LAN but allows devices to communicate
wirelessly.
The most common example of WLAN is Wi-Fi.

Wireless Local Area Network (WLAN)


There are several computer networks available; more information is provided below.
2. Storage Area Network (SAN)
SAN is a type of computer network that is high-speed and connects groups of storage
devices to several servers. This network does not depend on LAN or WAN. Instead, a
SAN moves the storage resources from the network to its high-powered network. A
SAN provides access to block-level data storage.
Examples of SAN are a network of disks accessed by a network of servers.

Storage Area Network (SAN)

3. System Area Network (SAN)


A SAN is a type of computer network that connects a cluster of high-performance
computers. It is a connection-oriented and high-bandwidth network. A SAN is a type
of LAN that handles high amounts of information in large requests. This network is
useful for processing applications that require high network performance.
Microsoft SQL Server 2005 uses SAN through a virtual interface adapter.
System Area Network (SAN)

4. Passive Optical Local Area Network (POLAN)


A POLAN is a type of computer network that is an alternative to a LAN. POLAN
uses optical splitters to split an optical signal from a single strand of single-mode
optical fiber to multiple signals to distribute users and devices. In short, POLAN is a
point to multipoint LAN architecture.

Passive Optical Local Area Network (POLAN)

5. Enterprise Private Network (EPN)


EPN is a type of computer network mostly used by businesses that want a secure
connection over various locations to share computer resources.

Enterprise Private Network (EPN)

6. Virtual Private Network (VPN)


A VPN is a type of computer network that extends a private network across the
internet and lets the user send and receive data as if they were connected to a private
network even though they are not. Through a virtual point-to-point connection users
can access a private network remotely. VPN protects you from malicious sources by
operating as a medium that gives you a protected network connection.
Virtual Private Network (VPN)

7. Home Area Network (HAN)


Many of the houses might have more than a computer. To interconnect those
computers and with other peripheral devices, a network should be established similar
to the local area network (LAN) within that home. Such a type of network that allows
a user to interconnect multiple computers and other digital devices within the home is
referred to as Home Area Network (HAN). HAN encourages sharing of resources,
files, and programs within the network. It supports both wired and wireless
communication.

Home Area Network (HAN)

Advantages of Computer Network


Some of the main advantages of Computer Networks are:
 Central Storage of Data: Files are stored on a central storage database which
helps to easily access and available to everyone.
 Connectivity: A single connection can be routed to connect multiple computing
devices.
 Sharing of Files: Files and data can be easily shared among multiple devices
which helps in easily communicating among the organization.
 Security through Authorization: Computer Networking provides additional
security and protection of information in the system.
Disadvantages of Computer Network
Some of the main disadvantages of Computer Networks are:
 Virus and Malware: A virus is a program that can infect other programs by
modifying them. Viruses and Malware can corrupt the whole network.
 High Cost of Setup: The initial setup of Computer Networking is expensive
because it consists of a lot of wires and cables along with the device.
 loss of Information: In case of a System Failure, might lead to some loss of data.
 Management of Network: Management of a Network is somehow complex for a
person, it requires training for its proper use.

What is OSI Model? – Layers of OSI Model


Last Updated : 06 May, 2024


OSI stands for Open Systems Interconnection, where open stands to say non-
proprietary. 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 person
to another across the globe. The OSI reference model was developed by ISO –
‘International Organization for Standardization„, in the year 1984.
The OSI model provides a theoretical foundation for understanding network
communication. However, it is usually not directly implemented in its entirety in
real-world networking hardware or software. Instead, specific
protocols and technologies are often designed based on the principles outlined in
the OSI model to facilitate efficient data transmission and networking operations.

What is OSI Model?


The OSI model, created in 1984 by ISO, is a reference framework that explains the
process of transmitting data between computers. It is divided into seven layers that
work together to carry out specialised network functions, allowing for a more
systematic approach to networking.
What are the 7 layers of the OSI Model?
The OSI model consists of seven abstraction layers arranged in a top-down order:
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
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.

Functions of the Physical Layer


 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 the 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 how the different, devices/nodes are
arranged in a network i.e. bus, star, or mesh topology.
 Transmission mode: Physical layer also defines how the data flows between the
two connected devices. The various transmission modes possible are Simplex,
half-duplex and full-duplex.
Note:
1. Hub, Repeater, Modem, and Cables are Physical Layer devices.
2. Network Layer, Data Link Layer, and Physical Layer are also known as Lower
Layers or Hardware Layers.
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 the DLL to transmit it to the Host using its MAC address.
The Data Link Layer is divided into two sublayers:
1. Logical Link Control (LLC)
2. Media Access Control (MAC)
The packet received from the Network layer is further divided into frames depending
on the frame size of the NIC(Network Interface Card). DLL also encapsulates Sender
and Receiver‟s MAC address in the header.
The Receiver‟s MAC address is obtained by placing an ARP(Address Resolution
Protocol) request onto the wire asking “Who has that IP address?” and the destination
host will reply with its MAC address.
Functions of the Data Link Layer
 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. This can be
accomplished by attaching special bit patterns to the beginning and end of the
frame.
 Physical addressing: After creating frames, the Data link layer adds physical
addresses (MAC addresses) of the sender and/or receiver in the header of each
frame.
 Error control: The 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 an acknowledgment.
 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:
1. Packet in the Data Link layer is referred to as Frame.
2. Data Link layer is handled by the NIC (Network Interface Card) and device
drivers of host machines.
3. 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 sender
& receiver‟s IP addresses are placed in the header by the network layer.
Functions of the Network Layer
 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: To identify each device inter-network uniquely, the network
layer defines an addressing scheme. The sender & receiver‟s IP addresses are
placed in the header by the network layer. Such an address distinguishes each
device uniquely and universally.
Note:
1. Segment in the Network layer is referred to as Packet.
2. Network layer is implemented by networking devices such as routers and
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 acknowledgment of the successful data transmission and re-
transmits the data if an error is found.
At the sender’s side: The transport layer receives the formatted data from the upper
layers, performs Segmentation, and also implements Flow and 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.
Note: The sender needs to know the port number associated with the receiver’s
application.
Generally, this destination port number is configured, either by default or manually.
For example, when a web application requests a web server, it typically uses port
number 80, because this is the default port assigned to web applications. Many
applications have default ports assigned.
At the 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.
Functions of the Transport Layer
 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: 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.
Services Provided by Transport Layer
1. Connection-Oriented Service
2. Connectionless Service
1. 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 acknowledgment, back to
the source after a packet or group of packets is received. This type of transmission is
reliable and secure.
2. Connectionless service: It is a one-phase process and includes Data Transfer. 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:
1. Data in the Transport Layer is called Segments.
2. Transport layer is operated by the Operating System. It is a part of the OS and
communicates with the Application Layer by making system calls.
3. The transport layer is called as Heart of the OSI model.
4. Device or Protocol Use : TCP, UDP NetBIOS, PPTP
Session Layer – Layer 5
This layer is responsible for the establishment of connection, maintenance of sessions,
and authentication, and also ensures security.
Functions of the Session Layer
 Session establishment, maintenance, and termination: The layer allows the two
processes to establish, use, and terminate a connection.
 Synchronization: This layer allows a process to add checkpoints that are
considered synchronization points in the data. These synchronization points help to
identify the error so that the data is re-synchronized properly, and ends of the
messages are not cut prematurely and data loss is avoided.
 Dialog Controller: The session layer allows two systems to start communication
with each other in half-duplex or full-duplex.
Note:
1. All the below 3 layers(including Session Layer) are integrated as a single layer in
the TCP/IP model as the “Application Layer”.
2. Implementation of these 3 layers is done by the network application itself. These
are also known as Upper Layers or Software Layers.
3. Device or Protocol Use : NetBIOS, PPTP.
For example:-
Let us consider a scenario where a user wants to send a message through some
Messenger application running in their browser. The “Messenger” here acts as the
application layer which provides the user with an interface to create the data. This
message or so-called Data is compressed, optionally encrypted (if the data is
sensitive), and converted into bits (0‟s and 1‟s) so that it can be transmitted.

Communication in Session Layer

Presentation Layer – Layer 6


The presentation layer is also called the Translation layer. The data from the
application layer is extracted here and manipulated as per the required format to
transmit over the network.
Functions of the Presentation Layer
 Translation: For example, ASCII to EBCDIC.
 Encryption/ Decryption: Data encryption translates the data into another form or
code. The encrypted data is known as the ciphertext and the decrypted data is
known as plain text. A key value is used for encrypting as well as decrypting data.
 Compression: Reduces the number of bits that need to be transmitted on the
network.
Note: Device or Protocol Use: JPEG, MPEG, GIF
Application Layer – Layer 7
At the very top of the OSI Reference Model stack of layers, we find the Application
layer which is implemented by the network applications. These applications produce
the data to be transferred over the network. This layer also serves as a window for the
application services to access the network and for displaying the received information
to the user.
Example: Application – Browsers, Skype Messenger, etc.
Note: 1. The application Layer is also called Desktop Layer.
2. Device or Protocol Use : SMTP
Functions of the Application Layer
The main functions of the application layer are given below.
 Network Virtual Terminal(NVT): It allows a user to log on to a remote host.
 File transfer access and management(FTAM): This application allows a user to
access files in a remote host, retrieve files in a remote host, and manage or
control files from a remote computer.
 Mail Services: Provide email service.
 Directory Services: This application provides distributed database sources
and access for global information about various objects and services.
Note: The OSI model acts as a reference model and is not implemented on the
Internet because of its late invention. The current model being used is the TCP/IP
model.
What is the Flow of Data in OSI Model?
When we transfer information from one device to another, it travels through 7 layers
of OSI model. First data travels down through 7 layers from the sender‟s end and then
climbs back 7 layers on the receiver‟s end.
Let‟s look at it with an Example:
Luffy sends an e-mail to his friend Zoro.
Step 1: Luffy interacts with e-mail application like Gmail, outlook, etc. Writes his
email to send. (This happens in Layer 7: Application layer)
Step 2: Mail application prepares for data transmission like encrypting data and
formatting it for transmission. (This happens in Layer 6: Presentation Layer)
Step 3: There is a connection established between the sender and receiver on the
internet. (This happens in Layer 5: Session Layer)
Step 4: Email data is broken into smaller segments. It adds sequence number and
error-checking information to maintain the reliability of the information. (This
happens in Layer 4: Transport Layer)
Step 5: Addressing of packets is done in order to find the best route for transfer. (This
happens in Layer 3: Network Layer)
Step 6: Data packets are encapsulated into frames, then MAC address is added for
local devices and then it checks for error using error detection. (This happens
in Layer 2: Data Link Layer)
Step 7: Lastly Frames are transmitted in the form of electrical/ optical signals over a
physical network medium like ethernet cable or WiFi.
After the email reaches the receiver i.e. Zoro, the process will reverse and decrypt the
e-mail content. At last, the email will be shown on Zoro‟s email client.
Advantages of OSI Model
The OSI Model defines the communication of a computing system into 7 different
layers. Its advantages include:
 It divides network communication into 7 layers which makes it easier to
understand and troubleshoot.
 It standardizes network communications, as each layer has fixed functions and
protocols.
 Diagnosing network problems is easier with the OSI model.
 It is easier to improve with advancements as each layer can get updates separately.
OSI Model – Layer architecture
Information
Form (Data
Layer No Layer Name Responsibility Unit) Device or Protocol
Information
Form (Data
Layer No Layer Name Responsibility Unit) Device or Protocol

Helps in
identifying the
Application
client and Message SMTP
Layer
synchronizing
7 communication.

Data from the


application layer
is extracted and
Presentation
manipulated in Message JPEG, MPEG, GIF
Layer
the required
format for
6 transmission.

Establishes
Connection,
Maintenance, Message (or
Session Layer Ensures encrypted Gateway
Authentication message)
and Ensures
5 security.

Take Service
from Network
Transport Layer and
Segment Firewall
Layer provide it to the
Application
4 Layer.

Transmission of
data from one
Network Layer host to another, Packet Router
located in
3
different
Information
Form (Data
Layer No Layer Name Responsibility Unit) Device or Protocol

networks.

Node to Node
Data Link
Delivery of Frame Switch, Bridge
Layer
2 Message.

Establishing
Physical
Hub, Repeater, Modem,
Physical Layer Connections Bits
Cables
between
1 Devices.

OSI vs TCP/IP Model


Some key differences between the OSI model and the TCP/IP Model are:
1. TCP/IP model consists of 4 layers but OSI model has 7 layers. Layers 5,6,7 of the
OSI model are combined into the Application Layer of TCP/IP model and OSI
layers 1 and 2 are combined into Network Access Layers of TCP/IP protocol.
2. The TCP/IP model is older than the OSI model, hence it is a foundational protocol
that defines how should data be transferred online.
3. Compared to the OSI model, the TCP/IP model has less strict layer boundaries.
4. All layers of the TCP/IP model are needed for data transmission but in the OSI
model, some applications can skip certain layers. Only layers 1,2 and 3 of the OSI
model are necessary for data transmission.

Difference between Circuit Switching and


Packet switching?
This article will learn the differences between circuit switching and packet switching.
Both are types of switching techniques. Initially, we will learn some basics of switching
network technologies. After that, we will see differences between both of them.

Circuit switching Network:


A circuit-switched network is one of the simplest data communication methods in which
a dedicated path is established between the sending and receiving device. In this
physical links connect via a set of switches.

Following figure displays the working of circuit switched network.


In the above figure it shows a circuit switched network in which computer connect via 4
switches with a point to point connections.

Packet switching Network:


In the Packet switching Network, the message is divide into packets. Each packet
contains a header which includes the source address, destination address, and control
information.

Following figure displays the working of packet switched network.

In the above figure, it shows how a data gram approach is used to deliver four packets
from station A to station D.

Following are the differences between circuit switching and


packet switching networks.
What is Circuit Switching?

Circuit switching is a communication method where a dedicated


communication path, or circuit, is established between two devices before
data transmission begins. The circuit remains dedicated to the
communication for the duration of the session, and no other devices can use
it while the session is in progress. Circuit switching is commonly used in
voice communication and some types of data communication.
Advantages of Circuit Switching:
 Guaranteed bandwidth: Circuit switching provides a dedicated path for
communication, ensuring that bandwidth is guaranteed for the duration of
the call.
 Low latency: Circuit switching provides low latency because the path is
predetermined, and there is no need to establish a connection for each
packet.
 Predictable performance: Circuit switching provides predictable
performance because the bandwidth is reserved, and there is no
competition for resources.
 Suitable for real-time communication: Circuit switching is suitable for real-
time communication, such as voice and video, because it provides low
latency and predictable performance.
Disadvantages of Circuit Switching:
 Inefficient use of bandwidth: Circuit switching is inefficient because the
bandwidth is reserved for the entire duration of the call, even when no
data is being transmitted.
 Limited scalability: Circuit switching is limited in its scalability because the
number of circuits that can be established is finite, which can limit the
number of simultaneous calls that can be made.
 High cost: Circuit switching is expensive because it requires dedicated
resources, such as hardware and bandwidth, for the duration of the call.

What is Packet Switching?

Packet switching is a communication method where data is divided into


smaller units called packets and transmitted over the network. Each packet
contains the source and destination addresses, as well as other information
needed for routing. The packets may take different paths to reach their
destination, and they may be transmitted out of order or delayed due to
network congestion.
Advantages of Packet Switching:
 Efficient use of bandwidth: Packet switching is efficient because
bandwidth is shared among multiple users, and resources are allocated
only when data needs to be transmitted.
 Flexible: Packet switching is flexible and can handle a wide range of data
rates and packet sizes.
 Scalable: Packet switching is highly scalable and can handle large
amounts of traffic on a network.
 Lower cost: Packet switching is less expensive than circuit switching
because resources are shared among multiple users.
Disadvantages of Packet Switching:
 Higher latency: Packet switching has higher latency than circuit switching
because packets must be routed through multiple nodes, which can cause
delay.
 Limited QoS: Packet switching provides limited QoS guarantees, meaning
that different types of traffic may be treated equally.
 Packet loss: Packet switching can result in packet loss due to congestion
on the network or errors in transmission.
 Unsuitable for real-time communication: Packet switching is not suitable
for real-time communication, such as voice and video, because of the
potential for latency and packet loss.

Similarities:

 Both methods involve the transmission of data over a network.


 Both methods use a physical layer of the OSI model for transmission of
data.
 Both methods can be used to transmit voice, video, and data.
 Both methods can be used in the same network infrastructure.
 Both methods can be used for both wired and wireless networks.

Difference between Circuit Switching and Packet Switching:

Circuit Switching Packet Switching

In-circuit switching has there are 3 phases:


i) Connection Establishment. In Packet switching directly data
ii) Data Transfer. transfer takes place.
iii) Connection Released.

In Packet switching, each data unit


In-circuit switching, each data unit knows the entire just knows the final destination
path address which is provided by the source. address intermediate path is decided
by the routers.
Circuit Switching Packet Switching

In Packet switching, data is


In-Circuit switching, data is processed at the source
processed at all intermediate nodes
system only
including the source system.

The delay between data units in circuit switching is The delay between data units in
uniform. packet switching is not uniform.

Resource reservation is the feature of circuit There is no resource reservation


switching because the path is fixed for data because bandwidth is shared among
transmission. users.

Circuit switching is more reliable. Packet switching is less reliable.

Less wastage of resources as


Wastage of resources is more in Circuit Switching
compared to Circuit Switching

It is not a store and forward technique. It is a store and forward technique.

Transmission of the data is done not


Transmission of the data is done by the source. only by the source but also by the
intermediate routers.

Congestion can occur during the connection Congestion can occur during the data
establishment phase because there might be a case transfer phase, a large number of
where a request is being made for a channel but the packets comes in no time.
channel is already occupied.

Circuit switching is not convenient for handling Packet switching is suitable for
bilateral traffic. handling bilateral traffic.

In Packet switching, the charge is


In-Circuit switching, the charge depends on time
based on the number of bytes and
and distance, not on traffic in the network.
connection time.

Recording of packets is never possible in circuit Recording of packets is possible in


switching. packet switching.

In Packet Switching there is no


In-Circuit Switching there is a physical path
physical path between the source and
between the source and the destination
the destination

Circuit Switching does not support store and Packet Switching supports store and
forward transmission forward transmission
Circuit Switching Packet Switching

No call setup is required in packet


Call setup is required in circuit switching.
switching.

In-circuit switching each packet follows the same In packet switching packets can
route. follow any route.

The circuit switching network is implemented at the Packet switching is implemented at


physical layer. the datalink layer and network layer

Circuit switching requires simple protocols for Packet switching requires complex
delivery. protocols for delivery.

Error Detection in Computer Networks


Error is a condition when the receiver‟s information does not match the sender‟s
information. During transmission, digital signals suffer from noise that can introduce
errors in the binary bits traveling from sender to receiver. That means a 0 bit may
change to 1 or a 1 bit may change to 0.
Data (Implemented either at the Data link layer or Transport Layer of the OSI Model)
may get scrambled by noise or get corrupted whenever a message is transmitted. To
prevent such errors, error-detection codes are added as extra data to digital messages.
This helps in detecting any errors that may have occurred during message
transmission.

Types of Errors
Single-Bit Error

A single-bit error refers to a type of data transmission error that occurs when one bit
(i.e., a single binary digit) of a transmitted data unit is altered during transmission,
resulting in an incorrect or corrupted data unit.
Single-Bit Error

Multiple-Bit Error

A multiple-bit error is an error type that arises when more than one bit in a data
transmission is affected. Although multiple-bit errors are relatively rare when
compared to single-bit errors, they can still occur, particularly in high-noise or high-
interference digital environments.

Multiple-Bit Error

Burst Error

When several consecutive bits are flipped mistakenly in digital transmission, it creates
a burst error. This error causes a sequence of consecutive incorrect values.
Burst Error

To detect errors, a common technique is to introduce redundancy bits that provide


additional information. Various techniques for error detection include::
1. Simple Parity Check
2. Two-dimensional Parity Check
3. Checksum
4. Cyclic Redundancy Check (CRC)

Error Detection Methods


Simple Parity Check

Simple-bit parity is a simple error detection method that involves adding an


extra bit to a data transmission. It works as:
 1 is added to the block if it contains an odd number of 1‟s, and
 0 is added if it contains an even number of 1‟s
This scheme makes the total number of 1‟s even, that is why it is called even parity
checking.
Disadvantages
 Single Parity check is not able to detect even no. of bit error.
 For example, the Data to be transmitted is 101010. Codeword transmitted to the
receiver is 1010101 (we have used even parity).
Let‟s assume that during transmission, two of the bits of code word flipped to
1111101.
On receiving the code word, the receiver finds the no. of ones to be even and
hence no error, which is a wrong assumption.

Two-dimensional Parity Check

Two-dimensional Parity check bits are calculated for each row, which is equivalent
to a simple parity check bit. Parity check bits are also calculated for all columns, then
both are sent along with the data. At the receiving end, these are compared with the
parity bits calculated on the received data.

Checksum

Checksum error detection is a method used to identify errors in transmitted data. The
process involves dividing the data into equally sized segments and using a 1‟s
complement to calculate the sum of these segments. The calculated sum is then sent
along with the data to the receiver. At the receiver‟s end, the same process is repeated
and if all zeroes are obtained in the sum, it means that the data is correct.
Checksum – Operation at Sender’s Side
 Firstly, the data is divided into k segments each of m bits.
 On the sender‟s end, the segments are added using 1‟s complement arithmetic to
get the sum. The sum is complemented to get the checksum.
 The checksum segment is sent along with the data segments.
Checksum – Operation at Receiver’s Side
 At the receiver‟s end, all received segments are added using 1‟s complement
arithmetic to get the sum. The sum is complemented.
 If the result is zero, the received data is accepted; otherwise discarded.

Disadvantages
 If one or more bits of a segment are damaged and the corresponding bit or bits of
opposite value in a second segment are also damaged.

Cyclic Redundancy Check (CRC)

 Unlike the checksum scheme, which is based on addition, CRC is based on binary
division.
 In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of the data unit so that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
 At the destination, the incoming data unit is divided by the same number. If at this
step there is no remainder, the data unit is assumed to be correct and is therefore
accepted.
 A remainder indicates that the data unit has been damaged in transit and therefore
must be rejected.
Hamming Code in Computer Network

Hamming code is a set of error-correction codes that can be used to detect and correct
the errors that can occur when the data is moved or stored from the sender to the
receiver. It is a technique developed by R.W. Hamming for error correction.
What is Redundant Bits?
Redundant bits are extra binary bits that are generated and added to the information-
carrying bits of data transfer to ensure that no bits were lost during the data transfer.
The number of redundant bits can be calculated using the following formula:
2^r ≥ m + r + 1
Suppose the number of data bits is 7, then the number of redundant bits can be
calculated using: = 2^4 ≥ 7 + 4 + 1 .Thus, the number of redundant bits= 4
Types of Parity bits
A parity bit is a bit appended to a data of binary bits to ensure that the total number of
1‟s in the data is even or odd. Parity bits are used for error detection. There are two
types of parity bits:
1. Even parity bit: In the case of even parity, for a given set of bits, the number of
1‟s are counted. If that count is odd, the parity bit value is set to 1, making the total
count of occurrences of 1‟s an even number. If the total number of 1‟s in a given
set of bits is already even, the parity bit‟s value is 0.
2. Odd Parity bit: In the case of odd parity, for a given set of bits, the number of 1‟s
are counted. If that count is even, the parity bit value is set to 1, making the total
count of occurrences of 1‟s an odd number. If the total number of 1‟s in a given set
of bits is already odd, the parity bit‟s value is 0.
Algorithm of Hamming Code
Hamming Code is simply the use of extra parity bits to allow the identification of an
error.
 Write the bit positions starting from 1 in binary form (1, 10, 11, 100, etc).
 All the bit positions that are a power of 2 are marked as parity bits (1, 2, 4, 8, etc).
 All the other bit positions are marked as data bits.
 Each data bit is included in a unique set of parity bits, as determined its bit position
in binary form. a. Parity bit 1 covers all the bits positions whose binary
representation includes a 1 in the least significant position (1, 3, 5, 7, 9, 11,
etc). b. Parity bit 2 covers all the bits positions whose binary representation
includes a 1 in the second position from the least significant bit (2, 3, 6, 7, 10, 11,
etc). c. Parity bit 4 covers all the bits positions whose binary representation
includes a 1 in the third position from the least significant bit (4–7, 12–15, 20–23,
etc). d. Parity bit 8 covers all the bits positions whose binary representation
includes a 1 in the fourth position from the least significant bit bits (8–15, 24–31,
40–47, etc). e. In general, each parity bit covers all bits where the bitwise AND of
the parity position and the bit position is non-zero.
 Since we check for even parity set a parity bit to 1 if the total number of ones in
the positions it checks is odd.
 Set a parity bit to 0 if the total number of ones in the positions it checks is even.
Determining the Position of Redundant Bits
A redundancy bits are placed at positions that correspond to the power of 2. As in the
above example:
 The number of data bits = 7
 The number of redundant bits = 4
 The total number of bits = 7+4=>11
 The redundant bits are placed at positions corresponding to power of 2- 1, 2, 4, and
8

 Suppose the data to be transmitted is 1011001 from sender to receiver, the bits will
be placed as follows:
Determining the Parity bits According to Even Parity
 R1 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the least significant position. R1: bits 1, 3, 5, 7, 9,
11

 To find the redundant bit R1, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R1 is a odd number the value of R1
(parity bit‟s value) = 1
 R2 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the second position from the least significant bit. R2:
bits 2,3,6,7,10,11

 To find the redundant bit R2, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R2 is odd the value of R2(parity bit‟s
value)=1
 R4 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the third position from the least significant bit. R4:
bits 4, 5, 6, 7
1. To find the redundant bit R4, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R4 is an even the value of R4(parity
bit‟s value) = 0
2. R8 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the fourth position from the least significant bit. R8:
bit 8,9,10,11

 To find the redundant bit R8, we check for even parity. Since the total number of
1‟s in all the bit positions corresponding to R8 is an even number the value of
R8(parity bit‟s value)=0. Thus, the data transferred is:

Error Detection and Correction


Suppose in the above example the 6th bit is changed from 0 to 1 during data
transmission, then it gives new parity values in the binary number:

For all the parity bits we will check the number of 1‟s in their respective bit positions.
 For R1: bits 1, 3, 5, 7, 9, 11. We can see that the number of 1‟s in these bit
positions are 4 and that‟s even so we get a 0 for this.
 For R2: bits 2,3,6,7,10,11 . We can see that the number of 1‟s in these bit positions
are 5 and that‟s odd so we get a 1 for this.
 For R4: bits 4, 5, 6, 7 . We can see that the number of 1‟s in these bit positions are
3 and that‟s odd so we get a 1 for this.
 For R8: bit 8,9,10,11 . We can see that the number of 1‟s in these bit positions are
2 and that‟s even so we get a 0 for this.
 The bits give the binary number 0110 whose decimal representation is 6. Thus, bit
6 contains an error. To correct the error the 6th bit is changed from 1 to 0.
Features of Hamming Code
Error Detection and Correction: Hamming code is designed to detect and correct
single-bit errors that may occur during the transmission of data. This ensures that the
recipient receives the same data that was transmitted by the sender.
Redundancy: Hamming code uses redundant bits to add additional information to the
data being transmitted. This redundancy allows the recipient to detect and correct
errors that may have occurred during transmission.
Efficiency: Hamming code is a relatively simple and efficient error-correction
technique that does not require a lot of computational resources. This makes it ideal
for use in low-power and low-bandwidth communication networks.
Widely Used: Hamming code is a widely used error-correction technique and is used
in a variety of applications, including telecommunications, computer networks, and
data storage systems.
Single Error Correction: Hamming code is capable of correcting a single-bit error,
which makes it ideal for use in applications where errors are likely to occur due to
external factors such as electromagnetic interference.
Limited Multiple Error Correction: Hamming code can only correct a limited
number of multiple errors. In applications where multiple errors are likely to occur,
more advanced error-correction techniques may be required.

What is Forward Error Correction?


Forward Error Correction (FEC) is a way of getting error control in data
transmission in which the source (transmitter) provides redundant data and the
destination (receiver) recognizes only the portion of the data that is error-free.
FEC can broadcast data to several destinations simultaneously from a single
source because it does not require handshaking between the source and the
destination.

 Each character is conveyed twice in the simplest form of FEC.


 The receiver verifies that both instances of each character follow the protocol in use.
 If both conformance cases occur, the character is accepted.
 If one instance of conformance occurs but not the other, the character that follows protocol is
accepted.
 If there is no conformance, in either case, the character is rejected and replaced with a blank
space or an underscore.
Simple FEC is one of two self-correcting digital modes called AMTOR utilised by
radio amateurs (an abbreviation for Amateur Teleprinting Over Radio). It's also
known as Mode B. Another AMTOR mode that combines handshaking is Automatic
Repeat Request (ARQ), used with communications systems like the Global System
for Mobile Communications (GSM).

Advantages and Disadvantages of FEC


 FEC can be used to broadcast data to several destinations simultaneously from a single
source because it does not require handshaking between the source and the destination.
 Another benefit is that FEC reduces the amount of bandwidth required for retransmission. As
a result, it is employed in real-time systems.
 Its primary drawback is that if there are too many faults, the frames must be resent.

Types of FEC
Block codes and convolutional codes are two structurally different types of
codes that are often used nowadays.

Block codes

A block code encoder divides the information sequence "u" into message blocks
of "k" information bits (symbols) and converts each message "u" into an n-bit
code (symbols). The coding rate is defined as "R = k/n". The redundant bits
(symbols), n-k, give the code the ability to deal with channel noise.

The minimum distance, dmin, between two closest codewords, which specifies the
minimum amount of data changes required to turn one valid codeword into
another, is an essential parameter of a block code. This parameter determines a
code's ability to detect and rectify errors.

Usually, an FEC code can detect and correct up to (dmin - 1)/2 mistakes per
codeword.

Convolutional codes

A convolutional code encoder accepts k-bit blocks of the information sequence


"u" and generates an encoded sequence "v" of n-symbol blocks. However, each
encoded block is dependent on "m" prior message blocks and the matching k-bit
message block at the same time unit.

To provide reliable transmission across a noisy channel and redundant bits, n-k,
further redundancy is added by raising the memory order "m" of the code.

You might also like