0% found this document useful (0 votes)
39 views

CSNotes (2024)

Uploaded by

abhipaswan1711
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

CSNotes (2024)

Uploaded by

abhipaswan1711
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 165

Computer Networks

Unit 1 - Introduction:
Introduction to data communications and networking,
use of Computer Networks, classification of networks,
OSI model, function of the layers, TCP/IP Protocol
suite.

Unit 2 - Network Topologies:


Bus, star, ring, mesh, tree, hybrid topologies with their
features, advantages and disadvantages of each type.
Transmission Modes: simplex, half duplex and full
duplex.

Unit 3 - Transmission Media:Guided Media (Wired)


(Twisted pair, Coaxial Cable, Fiber Optics). Unguided
Media (Radio Waves, Infrared, Micro-wave,
Satellite)

Unit 4 - Data Communication and Switching


Techniques: Framing, flow control, error control,
circuit switching, message switching, packet
switching, routing.
Unit 5 - Switching Devices: Repeaters, hubs, switches,
bridges, routers, gateways. Multiplexing: (FDM,
WDM, TDM)

Unit 6 - Internet:
Internet Service Providers (ISP), internet addressing
system: IP address with their classification and
notation, application layer protocols: (DNS, URL,
WWW, FTP, SMTP, HTTP, TELNET), web pages,
introduction to HTML.

Unit 1
Computer Networking is the practice of
connecting computers together to enable
communication and data exchange between
them. In general, Computer Network is a
collection of two or more computers. It
helps users to communicate more easily
• Nodes: Nodes are devices that are connected to a network. These can
include computers, Servers, Printers, Routers, Switches, and other
devices.
• Protocol: A protocol is a set of rules and standards
that govern how data is transmitted over a network.
Examples of protocols include TCP/IP, HTTP, and FTP.

How Does a Computer Network Work?

Basics building blocks of a Computer network are Nodes and Links. A


Network Node can be illustrated as Equipment for Data Communication
like a Modem, Router, etc., or Equipment of a Data Terminal like
connecting two computers or more. Link in Computer Networks can be
defined as wires or cables or free space of wireless networks.

The working of Computer Networks can be simply defined as rules or


protocols which help in sending and receiving data via the links which
allow Computer networks to communicate. Each device has an IP
Address, that helps in identifying a device.

Applications of Computer Networking

Some of the applications of Computer Networking are discussed below:

• Resource Sharing: Resource Sharing is one of the important


applications of Computer Networking. You can share a single
software among Multiple users. We can also share Hardware
Devices via this technique.
• Communication: Communication Medium means various ways
through which we can communicate like Email Calls, broadcasts,
etc.

• Remote Working: Networking technologies have enabled remote


working, allowing employees to work from home or other locations
outside of the office. This has become especially important during the
COVID-19 pandemic.
• E-commerce: Computer Networking has facilitated the growth of e-
commerce by allowing businesses to sell their products and services
online and reach a global market.
• Telemedicine: Networking technologies have also enabled
telemedicine, allowing doctors and healthcare providers to provide
remote medical consultations and diagnosis to patients in remote
locations.
• Real-time Collaboration: Networking technologies enable real-time
collaboration, allowing people to work together on projects and share
information in real-time, no matter where they are located
• Social Media: Social Media is one of the recent and widely used
applications of Computer Networking. It helps people in getting news,
feed, current trending topics of all types, etc.
• Online Education: Computer Networking has revolutionized
education by providing online learning platforms, distance education,
and virtual classrooms.
• Cloud Computing: Computer Networking has facilitated the
development of cloud computing, which allows users to store and access
data and applications from remote servers via the internet.

Advantages of Computer Networking

Some of the main advantages of Computer Networking are discussed


below:

• Central Storage of Data: Files can be stored on a central node (the


file server) that can be shared and made available to every user in an
organization.
• Connectivity: There is a negligible range of abilities required to
connect to a modern computer network. The effortlessness of
joining makes it workable for even youthful kids to start exploring
the data.
• Faster Problem-solving: Since an extensive procedure is
disintegrated into a few littler procedures and each is taken care of
by all the associated gadgets, an explicit issue can be settled in lesser
time.
• Reliability: Reliability implies backing up information. Due to
some reason equipment crashes, and so on, the information gets
undermined or inaccessible on one PC, and another duplicate of
similar information is accessible on another workstation for future
use, which prompts smooth working and further handling without
interruption.
• Flexible: This innovation is known to be truly adaptable, as it offers
clients the chance to investigate everything about fundamental
things, for example, programming without influencing their
usefulness.
• Security through Authorization: Security and protection of
information are additionally settled through the system. As just the
system clients are approved to get to specific records or applications,
no other individual can crack the protection or security of
information.
• Storage capacity: Since you will share data, records, and assets
with other individuals, you need to guarantee all information and
substance are legitimately put away in the framework. With this
systems administration innovation, you can do most of this with no
issue, while having all the space you require for capacity.

Disadvantages of Computer Networking

Some of the main disadvantages of Computer Networking are discussed


below:
• Expensive: Execution of the network can be expensive in the case
of an initial setup, as the wires and the cost of the cable are high and
sometimes equipment is also costly.
• Virus and Malware: Computer Networking can lead to the
spreading of viruses to another computer through the network.
• Management of the network: Management of the Network is quite
difficult as it requires skilled persons to handle that large network.
It requires training of people who are employed in this work.
• Loss of Information: In case of a crash of the Computer Network,
it can lead to the loss of information or not being able to access
information for some time.
• The system can be Hacked: In the case of Wide Area
Networks(WAN), there is a threat of Hacking of the System. Some
security features should be added to prevent such things.

Types of area networks – LAN, MAN and WAN

The Network allows computers to connect and communicate with


different computers via any medium. LAN, MAN, and WAN are the three
major types of networks designed to operate over the area they cover.
There are some similarities and dissimilarities between them. One of the
major differences is the geographical area they cover, i.e. LAN covers the
smallest area, MAN covers an area larger than LAN and WAN comprises
the largest of all.
There are other types of Computer Networks also, like :

• PAN (Personal Area Network)


• SAN (Storage Area Network)
• EPN (Enterprise Private Network)
• VPN (Virtual Private Network)
Personal Area Network (PAN)-

PAN is a personal area network having an interconnection of personal


technology devices to communicate over a short distance. It covers only
less than 10 meters or 33 feet of area. PAN has fewer users as compared
to other networks such as LAN, WAN, etc. PAN typically uses some form
of wireless technology. PAN involves the transmission of data between
information devices such as smartphones, personal computers, tablet
computers, etc.

Advantages:

• Allows for easy communication between personal devices in close


proximity.
• Can be set up easily and quickly.
• Uses wireless technology, which eliminates the need for wires and
cables.
• PANs are designed to be energy efficient, which means that devices
can communicate with each other without draining their batteries
quickly.
• PANs are typically secured using encryption and authentication
protocols, which helps to prevent unauthorized access to data and
resources.

Disadvantages:

• Limited coverage area.


• May not be suitable for large-scale data transfer or
communication.PANs typically have limited bandwidth, which
means that they may not be able to handle large amounts of data
or high-speed communication.
• May experience interference from other wireless devices.
Local Area Network (LAN) –

LAN or Local Area Network connects network devices in such a way that
personal computers and workstations can share data, tools, and programs.
The group of computers and devices are connected together by a switch,
or stack of switches, using a private addressing scheme as defined by the
TCP/IP protocol. Private addresses are unique in relation to other
computers on the local network. Routers are found at the boundary of a
LAN, connecting them to the larger WAN.

Data transmits at a very fast rate as the number of computers linked is


limited. By definition, the connections must be high-speed and relatively
inexpensive hardware (Such as hubs, network adapters, and Ethernet
cables). LANs cover a smaller geographical area (Size is limited to a few
kilometres) and are privately owned. One can use it for an office building,
home, hospital, school, etc. LAN is easy to design and maintain. A
Communication medium used for LAN has twisted-pair cables and
coaxial cables. It covers a short distance, and so the error and noise are
minimized.

Early LANs had data rates in the 4 to 16 Mbps range. Today, speeds are
normally 100 or 1000 Mbps. Propagation delay is very short in a LAN.
The smallest LAN may only use two computers, while larger LANs can
accommodate thousands of computers. LAN has a range up to 2km. A
LAN typically relies mostly on wired connections for increased speed and
security, but wireless connections can also be part of a LAN. The fault
tolerance of a LAN is more and there is less congestion in this network.
For example A bunch of students playing Counter-Strike in the same room
(without internet).

Advantages:

• Provides fast data transfer rates and high-speed communication.


• Easy to set up and manage.
• Can be used to share peripheral devices such as printers and
scanners.
• Provides increased security and fault tolerance compared to WANs.

Disadvantages:

• Limited geographical coverage.


• Limited scalability and may require significant infrastructure
upgrades to accommodate growth.
• May experience congestion and network performance issues with
increased usage.

Metropolitan Area Network (MAN) –

MAN or Metropolitan area Network covers a larger area than that covered
by a LAN and a smaller area as compared to WAN. MAN has a range of
5-50km. It connects two or more computers that are apart but reside in the
same or different cities. It covers a large geographical area and may serve
as an ISP (Internet Service Provider). MAN is designed for customers
who need high-speed connectivity. Speeds of MAN range in terms of
Mbps. It’s hard to design and maintain a Metropolitan Area Network.

The fault tolerance of a MAN is less and also there is more congestion in
the network. It is costly and may or may not be owned by a single
organization. The data transfer rate and the propagation delay of MAN are
moderate. Devices used for transmission of data through MAN are
Modem and Wire/Cable. Examples of a MAN are part of the telephone
company network that can provide a high-speed DSL line to the customer
or the cable TV network in a city.

Advantages:

• Provides high-speed connectivity over a larger geographical area


than LAN.
• Can be used as an ISP for multiple customers.
• Offers higher data transfer rates than WAN in some cases.

Disadvantages:

• Can be expensive to set up and maintain.


• May experience congestion and network performance issues with
increased usage.
• May have limited fault tolerance and security compared to LANs.

Wide Area Network (WAN) –

WAN or Wide Area Network is a computer network that extends over a


large geographical area, although it might be confined within the bounds
of a state or country. WAN has a range of above 50 km. A WAN could be
a connection of LAN connecting to other LANs via telephone lines and
radio waves and may be limited to an enterprise (a corporation or an
organization) or accessible to the public. The technology is high-speed
and relatively expensive.

There are two types of WAN: Switched WAN and Point-to-Point WAN.
WAN is difficult to design and maintain. Similar to a MAN, the fault
tolerance of a WAN is less and there is more congestion in the network.
A Communication medium used for WAN is PSTN or Satellite Link. Due
to long-distance transmission, the noise and error tend to be more in
WAN.

WAN’s data rate is slow about a 10th LAN’s speed since it involves
increased distance and increased number of servers and terminals etc. The
speed of WAN ranges from a few kilobits per second (Kbps) to megabits
per second (Mbps). Propagation delay is one of the biggest problems faced
here. Devices used for the transmission of data through WAN are Optic
wires, Microwaves, and Satellites. An example of a Switched WAN is the
asynchronous transfer mode (ATM) network and Point-to-Point WAN is
a dial-up line that connects a home computer to the Internet.

Advantages:

• Covers large geographical areas and can connect remote locations.


• Provides connectivity to the internet.
• Offers remote access to resources and applications.
• Can be used to support multiple users and applications
simultaneously.

Disadvantages:

• Can be expensive to set up and maintain.


• Offers slower data transfer rates than LAN or MAN.
• May experience higher latency and longer propagation delays due
to longer distances and multiple network hops.
• May have lower fault tolerance and security compared to LANs.

Conclusion –

There are many advantages of LAN over MAN and WAN, such as LAN
provide excellent reliability, a high data transmission rate, and can easily
be managed and shares peripheral devices too. Local Area Network
cannot cover cities or towns and for that Metropolitan Area Network is
needed, which can connect a city or a group of cities together. Further, for
connecting a Country or a group of Countries one requires a Wide Area
Network
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 in a Nutshell


Information Device or
Layer No Layer Name Responsibility
Form (Data Unit) Protocol
The OSI Model we just looked at is just a reference/logical model. It was designed to describe the
functions of the communication system by dividing the communication procedure into smaller and
simpler components.

TCP/IP was designed and developed by the Department of Defense (DoD) in the 1960s and is
based on standard protocols. It stands for Transmission Control Protocol/Internet Protocol. The
TCP/IP model is a concise version of the OSI model. It contains four layers, unlike the seven layers
in the OSI model.

The number of layers is sometimes referred to as five or four. Here In this article, we’ll study five
layers. The Physical Layer and Data Link Layer are referred to as one single layer as the ‘Physical
Layer’ or ‘Network Interface Layer’ in the 4-layer reference.

What Does TCP/IP Do?


The main work of TCP/IP is to transfer the data of a computer from one device to another. The
main condition of this process is to make data reliable and accurate so that the receiver will receive
the same information which is sent by the sender. To ensure that, each message reaches its final
destination accurately, the TCP/IP model divides its data into packets and combines them at the
other end, which helps in maintaining the accuracy of the data while transferring from one end to
another end.

What is the Difference between TCP and IP?


TCP and IP are different protocols of Computer Networks. The basic difference between TCP
(Transmission Control Protocol) and IP (Internet Protocol) is in the transmission of data. In simple
words, IP finds the destination of the mail and TCP has the work to send and receive the mail.
UDP is another protocol, which does not require IP to communicate with another computer. IP is
required by only TCP. This is the basic difference between TCP and IP.

How Does the TCP/IP Model Work?


Whenever we want to send something over the internet using the TCP/IP Model, the TCP/IP Model
divides the data into packets at the sender’s end and the same packets have to be recombined at
the receiver’s end to form the same data, and this thing happens to maintain the accuracy of the
data. TCP/IP model divides the data into a 4-layer procedure, where the data first go into this layer
in one order and again in reverse order to get organized in the same way at the receiver’s end.

For more, you can refer to TCP/IP in Computer Networking.

Layers of TCP/IP Model


1. Application Layer
2. Transport Layer(TCP/UDP)

3. Network/Internet Layer(IP)

4. Data Link Layer (MAC)

5. Physical Layer

The diagrammatic comparison of the TCP/IP and OSI model is as follows:

1. Physical Layer

It is a group of applications requiring network communications. This layer is responsible for


generating the data and requesting connections. It acts on behalf of the sender and the Network
Access layer on the behalf of the receiver. During this article, we will be talking on the behalf of
the receiver.

2. Data Link Layer

The packet’s network protocol type, in this case, TCP/IP, is identified by the data-link layer. Error
prevention and “framing” are also provided by the data-link layer. Point-to-Point Protocol (PPP)
framing and Ethernet IEEE 802.2 framing are two examples of data-link layer protocols.
3. Internet Layer

This layer parallels the functions of OSI’s Network layer. It defines the protocols which are
responsible for the logical transmission of data over the entire network. The main protocols
residing at this layer are as follows:

• IP: IP stands for Internet Protocol and it is responsible for delivering packets from the source
host to the destination host by looking at the IP addresses in the packet headers. IP has 2
versions: IPv4 and IPv6. IPv4 is the one that most websites are using currently. But IPv6 is
growing as the number of IPv4 addresses is limited in number when compared to the number of
users.

• ICMP: ICMP stands for Internet Control Message Protocol. It is encapsulated within IP datagrams
and is responsible for providing hosts with information about network problems.

• ARP: ARP stands for Address Resolution Protocol. Its job is to find the hardware address of a host
from a known IP address. ARP has several types: Reverse ARP, Proxy ARP, Gratuitous ARP, and
Inverse ARP.

The Internet Layer is a layer in the Internet Protocol (IP) suite, which is the set of protocols that
define the Internet. The Internet Layer is responsible for routing packets of data from one device
to another across a network. It does this by assigning each device a unique IP address, which is
used to identify the device and determine the route that packets should take to reach it.

Example: Imagine that you are using a computer to send an email to a friend. When you click
“send,” the email is broken down into smaller packets of data, which are then sent to the Internet
Layer for routing. The Internet Layer assigns an IP address to each packet and uses routing tables
to determine the best route for the packet to take to reach its destination. The packet is then
forwarded to the next hop on its route until it reaches its destination. When all of the packets have
been delivered, your friend’s computer can reassemble them into the original email message.

In this example, the Internet Layer plays a crucial role in delivering the email from your computer
to your friend’s computer. It uses IP addresses and routing tables to determine the best route for
the packets to take, and it ensures that the packets are delivered to the correct destination. Without
the Internet Layer, it would not be possible to send data across the Internet.

4. Transport Layer

The TCP/IP transport layer protocols exchange data receipt acknowledgments and retransmit
missing packets to ensure that packets arrive in order and without error. End-to-end
communication is referred to as such. Transmission Control Protocol (TCP) and User Datagram
Protocol are transport layer protocols at this level (UDP).

• TCP: Applications can interact with one another using TCP as though they were physically
connected by a circuit. TCP transmits data in a way that resembles character-by-character
transmission rather than separate packets. A starting point that establishes the connection, the
whole transmission in byte order, and an ending point that closes the connection make up this
transmission.

• UDP: The datagram delivery service is provided by UDP, the other transport layer protocol.
Connections between receiving and sending hosts are not verified by UDP. Applications that
transport little amounts of data use UDP rather than TCP because it eliminates the processes of
establishing and validating connections.

5. Application Layer

This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-end
communication and error-free delivery of data. It shields the upper-layer applications from the
complexities of data. The three main protocols present in this layer are:

• HTTP and HTTPS: HTTP stands for Hypertext transfer protocol. It is used by the World Wide Web
to manage communications between web browsers and servers. HTTPS stands for HTTP-Secure.
It is a combination of HTTP with SSL(Secure Socket Layer). It is efficient in cases where the
browser needs to fill out forms, sign in, authenticate, and carry out bank transactions.

• SSH: SSH stands for Secure Shell. It is a terminal emulations software similar to Telnet. The
reason SSH is preferred is because of its ability to maintain the encrypted connection. It sets up a
secure session over a TCP/IP connection.

• NTP: NTP stands for Network Time Protocol. It is used to synchronize the clocks on our computer
to one standard time source. It is very useful in situations like bank transactions. Assume the
following situation without the presence of NTP. Suppose you carry out a transaction, where
your computer reads the time at 2:30 PM while the server records it at 2:28 PM. The server can
crash very badly if it’s out of sync.

The host-to-host layer is a layer in the OSI (Open Systems Interconnection) model that is
responsible for providing communication between hosts (computers or other devices) on a
network. It is also known as the transport layer.

Some common use cases for the host-to-host layer include:

1. Reliable Data Transfer: The host-to-host layer ensures that data is transferred reliably between
hosts by using techniques like error correction and flow control. For example, if a packet of data
is lost during transmission, the host-to-host layer can request that the packet be retransmitted to
ensure that all data is received correctly.

2. Segmentation and Reassembly: The host-to-host layer is responsible for breaking up large blocks
of data into smaller segments that can be transmitted over the network, and then reassembling
the data at the destination. This allows data to be transmitted more efficiently and helps to avoid
overloading the network.

3. Multiplexing and Demultiplexing: The host-to-host layer is responsible for multiplexing data
from multiple sources onto a single network connection, and then demultiplexing the data at the
destination. This allows multiple devices to share the same network connection and helps to
improve the utilization of the network.

4. End-to-End Communication: The host-to-host layer provides a connection-oriented service that


allows hosts to communicate with each other end-to-end, without the need for intermediate
devices to be involved in the communication.

Example: Consider a network with two hosts, A and B. Host A wants to send a file to host B. The
host-to-host layer in host A will break the file into smaller segments, add error correction and flow
control information, and then transmit the segments over the network to host B. The host-to-host
layer in host B will receive the segments, check for errors, and reassemble the file. Once the file
has been transferred successfully, the host-to-host layer in host B will acknowledge receipt of the
file to host A.

In this example, the host-to-host layer is responsible for providing a reliable connection between
host A and host B, breaking the file into smaller segments, and reassembling the segments at the
destination. It is also responsible for multiplexing and demultiplexing the data and providing end-
to-end communication between the two hosts.

Other Common Internet Protocols


TCP/IP Model covers many Internet Protocols. The main rule of these Internet Protocols is how
the data is validated and sent over the Internet. Some Common Internet Protocols include:

• HTTP (Hypertext Transfer Protocol): HTTP takes care of Web Browsers and Websites.

• FTP (File Transfer Protocol): FTP takes care of how the file is to be sent over the Internet.

• SMTP (Simple Mail Transfer Protocol): SMTP is used to send and receive data
Unit-2
Types of Network Topology
In Computer Network ,there are various ways through which different components are connected
to one another. Network Topology is the way that defines the structure, and how these components
are connected to each other.

Types of Network Topology


The arrangement of a network that comprises nodes and connecting lines via sender and receiver
is referred to as Network Topology. The various network topologies are:

• Point to Point Topology


• Mesh Topology
• Star Topology
• Bus Topology
• Ring Topology
• Tree Topology
• Hybrid Topology

Point to Point Topology

Point-to-Point Topology is a type of topology that works on the functionality of the sender and
receiver. It is the simplest communication between two nodes, in which one is the sender and the
other one is the receiver. Point-to-Point provides high bandwidth.

Point to Point Topology

Mesh Topology

In a mesh topology, every device is connected to another device via a particular channel. In Mesh
Topology, the protocols used are AHCP (Ad Hoc Configuration Protocols), DHCP (Dynamic Host
Configuration Protocol), etc.

Mesh Topology

Figure 1: Every device is connected to another via dedicated channels. These channels are known
as links.
• Suppose, the N number of devices are connected with each other in a mesh topology, the total
number of ports that are required by each device is N-1. In Figure 1, there are 5 devices connected
to each other, hence the total number of ports required by each device is 4. The total number of
ports required = N * (N-1).
• Suppose, N number of devices are connected with each other in a mesh topology, then the total
number of dedicated links required to connect them is NC2 i.e. N(N-1)/2. In Figure 1, there are 5
devices connected to each other, hence the total number of links required is 5*4/2 = 10.

Advantages of Mesh Topology

• Communication is very fast between the nodes.


• Mesh Topology is robust.
• The fault is diagnosed easily. Data is reliable because data is transferred among the devices
through dedicated channels or links.
• Provides security and privacy.

Drawbacks of Mesh Topology

• Installation and configuration are difficult.


• The cost of cables is high as bulk wiring is required, hence suitable for less number of devices.
• The cost of maintenance is high.

A common example of mesh topology is the internet backbone, where various internet service
providers are connected to each other via dedicated channels. This topology is also used in military
communication systems and aircraft navigation systems.

For more, refer to the Advantages and Disadvantages of Mesh Topology.

Star Topology

In Star Topology, all the devices are connected to a single hub through a cable. This hub is the
central node and all other nodes are connected to the central node. The hub can be passive in nature
i.e., not an intelligent hub such as broadcasting devices, at the same time the hub can be intelligent
known as an active hub. Active hubs have repeaters in them. Coaxial cables or RJ-45 cables are
used to connect the computers. In Star Topology, many popular Ethernet LAN protocols are used
as CD(Collision Detection), CSMA (Carrier Sense Multiple Access), etc.
Star Topology

Figure 2: A star topology having four systems connected to a single point of connection i.e. hub.

Advantages of Star Topology

• If N devices are connected to each other in a star topology, then the number of cables required to
connect them is N. So, it is easy to set up.
• Each device requires only 1 port i.e. to connect to the hub, therefore the total number of ports
required is N.
• It is Robust. If one link fails only that link will affect and not other than that.
• Easy to fault identification and fault isolation.
• Star topology is cost-effective as it uses inexpensive coaxial cable.

Drawbacks of Star Topology

• If the concentrator (hub) on which the whole topology relies fails, the whole system will crash
down.
• The cost of installation is high.
• Performance is based on the single concentrator i.e. hub.

A common example of star topology is a local area network (LAN) in an office where all
computers are connected to a central hub. This topology is also used in wireless networks where
all devices are connected to a wireless access point.

For more, refer to the Advantages and Disadvantages of Star Topology.

Bus Topology

Bus Topology is a network type in which every computer and network device is connected to a
single cable. It is bi-directional. It is a multi-point connection and a non-robust topology because
if the backbone fails the topology crashes. In Bus Topology, various MAC (Media Access Control)
protocols are followed by LAN ethernet connections like TDMA, Pure Aloha, CDMA, Slotted
Aloha, etc.

Bus Topology

Figure 3: A bus topology with shared backbone cable. The nodes are connected to the channel via
drop lines.

Advantages of Bus Topology

• If N devices are connected to each other in a bus topology, then the number of cables required to
connect them is 1, known as backbone cable, and N drop lines are required.
• Coaxial or twisted pair cables are mainly used in bus-based networks that support up to 10 Mbps.
• The cost of the cable is less compared to other topologies, but it is used to build small networks.
• Bus topology is familiar technology as installation and troubleshooting techniques are well known.
• CSMA is the most common method for this type of topology.

Drawbacks of Bus Topology

• A bus topology is quite simpler, but still, it requires a lot of cabling.


• If the common cable fails, then the whole system will crash down.
• If the network traffic is heavy, it increases collisions in the network. To avoid this, various protocols
are used in the MAC layer known as Pure Aloha, Slotted Aloha, CSMA/CD, etc.
• Adding new devices to the network would slow down networks.
• Security is very low.

A common example of bus topology is the Ethernet LAN, where all devices are connected to a
single coaxial cable or twisted pair cable. This topology is also used in cable television networks.
For more, refer to the Advantages and Disadvantages of Bus Topology.

Ring Topology

In a Ring Topology, it forms a ring connecting devices with exactly two neighboring devices. A
number of repeaters are used for Ring topology with a large number of nodes, because if someone
wants to send some data to the last node in the ring topology with 100 nodes, then the data will
have to pass through 99 nodes to reach the 100th node. Hence to prevent data loss repeaters are
used in the network.

The data flows in one direction, i.e. it is unidirectional, but it can be made bidirectional by having
2 connections between each Network Node, it is called Dual Ring Topology. In-Ring Topology,
the Token Ring Passing protocol is used by the workstations to transmit the data.

Ring Topology

Figure 4: A ring topology comprises 4 stations connected with each forming a ring.

The most common access method of ring topology is token passing.

• Token passing: It is a network access method in which a token is passed from one node to another
node.
• Token: It is a frame that circulates around the network.

Operations of Ring Topology

1. One station is known as a monitor station which takes all the responsibility for performing the
operations.
2. To transmit the data, the station has to hold the token. After the transmission is done, the token
is to be released for other stations to use.
3. When no station is transmitting the data, then the token will circulate in the ring.
4. There are two types of token release techniques: Early token release releases the token just after
transmitting the data and Delayed token release releases the token after the acknowledgment is
received from the receiver.
Advantages of Ring Topology

• The data transmission is high-speed.


• The possibility of collision is minimum in this type of topology.
• Cheap to install and expand.
• It is less costly than a star topology.

Drawbacks of Ring Topology

• The failure of a single node in the network can cause the entire network to fail.
• Troubleshooting is difficult in this topology.
• The addition of stations in between or the removal of stations can disturb the whole topology.
• Less secure.

For more, refer to the Advantages and Disadvantages of Ring Topology.

Tree Topology

This topology is the variation of the Star topology. This topology has a hierarchical flow of data. In
Tree Topology, protocols like DHCP and SAC (Standard Automatic Configuration ) are used.

Tree Topology

Figure 5: In this, the various secondary hubs are connected to the central hub which contains the
repeater. This data flow from top to bottom i.e. from the central hub to the secondary and then to
the devices or from bottom to top i.e. devices to the secondary hub and then to the central hub. It
is a multi-point connection and a non-robust topology because if the backbone fails the topology
crashes.

Advantages of Tree Topology


• It allows more devices to be attached to a single central hub thus it decreases the distance that is
traveled by the signal to come to the devices.
• It allows the network to get isolated and also prioritize from different computers.
• We can add new devices to the existing network.
• Error detection and error correction are very easy in a tree topology.

Drawbacks of Tree Topology

• If the central hub gets fails the entire system fails.


• The cost is high because of the cabling.
• If new devices are added, it becomes difficult to reconfigure.

A common example of a tree topology is the hierarchy in a large organization. At the top of the
tree is the CEO, who is connected to the different departments or divisions (child nodes) of the
company. Each department has its own hierarchy, with managers overseeing different teams
(grandchild nodes). The team members (leaf nodes) are at the bottom of the hierarchy, connected
to their respective managers and departments.

For more, refer to the Advantages and Disadvantages of Tree Topology.

Hybrid Topology

This topological technology is the combination of all the various types of topologies we have
studied above. Hybrid Topology is used when the nodes are free to take any form. It means these
can be individuals such as Ring or Star topology or can be a combination of various types of
topologies seen above. Each individual topology uses the protocol that has been discussed earlier.

Hybrid Topology
Figure 6: The above figure shows the structure of the Hybrid topology. As seen it contains a
combination of all different types of networks.

Advantages of Hybrid Topology

• This topology is very flexible.


• The size of the network can be easily expanded by adding new devices.

Drawbacks of Hybrid Topology

• It is challenging to design the architecture of the Hybrid Network.


• Hubs used in this topology are very expensive.
• The infrastructure cost is very high as a hybrid network requires a lot of cabling and network
devices.

A common example of a hybrid topology is a university campus network. The network may have
a backbone of a star topology, with each building connected to the backbone through a switch or
router. Within each building, there may be a bus or ring topology connecting the different rooms
and offices. The wireless access points also create a mesh topology for wireless devices. This
hybrid topology allows for efficient communication between different buildings while providing
flexibility and redundancy within each building

Transmission Modes in Computer Networks (Simplex, Half-Duplex and


Full-Duplex)
Transmission mode means transferring data between two devices. It is also known as a
communication mode. Buses and networks are designed to allow communication to occur
between individual devices that are interconnected.

There are three types of transmission mode:-

These are explained as following below.


1. Simplex Mode –
In Simplex mode, the communication is unidirectional, as on a one-way street. Only one of the
two devices on a link can transmit, the other can only receive. The simplex mode can use the
entire capacity of the channel to send data in one direction.
Example: Keyboard and traditional monitors. The keyboard can only introduce input, the
monitor can only give the output.

Advantages:

• Simplex mode is the easiest and most reliable mode of communication.


• It is the most cost-effective mode, as it only requires one communication channel.
• There is no need for coordination between the transmitting and receiving devices, which
simplifies the communication process.
• Simplex mode is particularly useful in situations where feedback or response is not required,
such as broadcasting or surveillance.

Disadvantages:

• Only one-way communication is possible.


• There is no way to verify if the transmitted data has been received correctly.
• Simplex mode is not suitable for applications that require bidirectional communication.

2. Half-Duplex Mode –
In half-duplex mode, each station can both transmit and receive, but not at the same time. When
one device is sending, the other can only receive, and vice versa. The half-duplex mode is used
in cases where there is no need for communication in both directions at the same time. The entire
capacity of the channel can be utilized for each direction.
Example: Walkie-talkie in which message is sent one at a time and messages are sent in both
directions.

Channel capacity=Bandwidth * Propagation Delay


Advantages:

• Half-duplex mode allows for bidirectional communication, which is useful in situations where
devices need to send and receive data.
• It is a more efficient mode of communication than simplex mode, as the channel can be used for
both transmission and reception.
• Half-duplex mode is less expensive than full-duplex mode, as it only requires one communication
channel.

Disadvantages:

• Half-duplex mode is less reliable than Full-Duplex mode, as both devices cannot transmit at the
same time.
• There is a delay between transmission and reception, which can cause problems in some
applications.
• There is a need for coordination between the transmitting and receiving devices, which can
complicate the communication process.

3. Full-Duplex Mode –
In full-duplex mode, both stations can transmit and receive simultaneously. In full_duplex mode,
signals going in one direction share the capacity of the link with signals going in another
direction, this sharing can occur in two ways:

• Either the link must contain two physically separate transmission paths, one for sending and the
other for receiving.
• Or the capacity is divided between signals traveling in both directions.
Full-duplex mode is used when communication in both directions is required all the time. The
capacity of the channel, however, must be divided between the two directions.
Example: Telephone Network in which there is communication between two persons by a
telephone line, through which both can talk and listen at the same time.

Channel Capacity=2* Bandwidth*propagation Delay

Advantages:

• Full-duplex mode allows for simultaneous bidirectional communication, which is ideal for real-
time applications such as video conferencing or online gaming.
• It is the most efficient mode of communication, as both devices can transmit and receive data
simultaneously.
• Full-duplex mode provides a high level of reliability and accuracy, as there is no need for error
correction mechanisms.

Disadvantages:

• Full-duplex mode is the most expensive mode, as it requires two communication channels.
• It is more complex than simplex and half-duplex modes, as it requires two physically separate
transmission paths or a division of channel capacity.
• Full-duplex mode may not be suitable for all applications, as it requires a high level of bandwidth
and may not be necessary for some types of communication

Unit -3
Types of Transmission Media
In data communication terminology, a transmission medium is a physical path between the
transmitter and the receiver i.e. it is the channel through which data is sent from one place to
another. Transmission Media is broadly classified into the following types:
1. Guided Media: It is also referred to as Wired or Bounded transmission media. Signals being
transmitted are directed and confined in a narrow pathway by using physical links.
Features:

• High Speed
• Secure
• Used for comparatively shorter distances

There are 3 major types of Guided Media:

(i) Twisted Pair Cable –


It consists of 2 separately insulated conductor wires wound about each other. Generally, several
such pairs are bundled together in a protective sheath. They are the most widely used
Transmission Media. Twisted Pair is of two types:

• Unshielded Twisted Pair (UTP):


UTP consists of two insulated copper wires twisted around one another. This type of cable has
the ability to block interference and does not depend on a physical shield for this purpose. It is
used for telephonic applications.

Advantages:

⇢ Least expensive

⇢ Easy to install

⇢ High-speed capacity
Disadvantages:

⇢ Susceptible to external interference

⇢ Lower capacity and performance in comparison to STP

⇢ Short distance transmission due to attenuation

Applications:

Used in telephone connections and LAN networks

• Shielded Twisted Pair (STP):


This type of cable consists of a special jacket (a copper braid covering or a foil shield) to block
external interference. It is used in fast-data-rate Ethernet and in voice and data channels of
telephone lines.

Advantages:

⇢ Better performance at a higher data rate in comparison to UTP

⇢ Eliminates crosstalk

⇢ Comparatively faster

Disadvantages:

⇢ Comparatively difficult to install and manufacture

⇢ More expensive

⇢ Bulky

Applications:

The shielded twisted pair type of cable is most frequently used in extremely cold climates, where
the additional layer of outer covering makes it perfect for withstanding such temperatures or for
shielding the interior components.
(ii) Coaxial Cable –
It has an outer plastic covering containing an insulation layer made of PVC or Teflon and 2
parallel conductors each having a separate insulated protection cover. The coaxial cable
transmits information in two modes: Baseband mode(dedicated cable bandwidth) and Broadband
mode(cable bandwidth is split into separate ranges). Cable TVs and analog television networks
widely use Coaxial cables.

Advantages:

• High Bandwidth
• Better noise Immunity
• Easy to install and expand
• Inexpensive

Disadvantages:

• Single cable failure can disrupt the entire network

Applications:

Radio frequency signals are sent over coaxial wire. It can be used for cable television signal
distribution, digital audio (S/PDIF), computer network connections (like Ethernet), and feedlines
that connect radio transmitters and receivers to their antennas.

(iii) Optical Fiber Cable –


It uses the concept of refraction of light through a core made up of glass or plastic. The core is
surrounded by a less dense glass or plastic covering called the cladding. It is used for the
transmission of large volumes of data.

The cable can be unidirectional or bidirectional. The WDM (Wavelength Division Multiplexer)
supports two modes, namely unidirectional and bidirectional mode.
Advantages:

• Increased capacity and bandwidth


• Lightweight
• Less signal attenuation
• Immunity to electromagnetic interference
• Resistance to corrosive materials

Disadvantages:

• Difficult to install and maintain


• High cost
• Fragile

Applications:

• Medical Purpose: Used in several types of medical instruments.


• Defence Purpose: Used in transmission of data in aerospace.
• For Communication: This is largely used in formation of internet cables.
• Industrial Purpose: Used for lighting purposes and safety measures in designing the interior and
exterior of automobiles.

(iv) Stripline

Stripline is a transverse electromagnetic (TEM) transmission line medium invented by Robert M.


Barrett of the Air Force Cambridge Research Centre in the 1950s. Stripline is the earliest form of
the planar transmission line. It uses a conducting material to transmit high-frequency waves it is
also called a waveguide. This conducting material is sandwiched between two layers of the
ground plane which are usually shorted to provide EMI immunity.

(v) Microstripline

In this, the conducting material is separated from the ground plane by a layer of dielectric.
2. Unguided Media:
It is also referred to as Wireless or Unbounded transmission media. No physical medium is
required for the transmission of electromagnetic signals.

Features:

• The signal is broadcasted through air


• Less Secure
• Used for larger distances

There are 3 types of Signals transmitted through unguided media:

(i) Radio waves –


These are easy to generate and can penetrate through buildings. The sending and receiving
antennas need not be aligned. Frequency Range:3KHz – 1GHz. AM and FM radios and cordless
phones use Radio waves for transmission.

Further Categorized as (i) Terrestrial and (ii) Satellite.

(ii) Microwaves –
It is a line of sight transmission i.e. the sending and receiving antennas need to be properly
aligned with each other. The distance covered by the signal is directly proportional to the height
of the antenna. Frequency Range:1GHz – 300GHz. These are majorly used for mobile phone
communication and television distribution.

Microwave Transmission
(iii) Infrared –
Infrared waves are used for very short distance communication. They cannot penetrate through
obstacles. This prevents interference between systems. Frequency Range:300GHz – 400THz. It
is used in TV remotes, wireless mouse, keyboard, printer, etc.

Unit-4
Framing in Data Link Layer

Frames are the units of digital transmission, particularly in computer


networks and telecommunications. Frames are comparable to the packets
of energy called photons in the case of light energy. Frame is continuously
used in Time Division Multiplexing process.

Framing is a point-to-point connection between two computers or devices


consisting of a wire in which data is transmitted as a stream of bits.
However, these bits must be framed into discernible blocks of
information. 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.
Ethernet, token ring, frame relay, and other data link layer technologies
have their own frame structures. Frames have headers that contain
information such as error-checking codes.

At the data link layer, it extracts the message from the sender and
provides it to the receiver by providing the sender’s and receiver’s
addresses. The advantage of using frames is that data is broken up into
recoverable chunks that can easily be checked for corruption.

The process of dividing the data into frames and reassembling it is


transparent to the user and is handled by the data link layer.

Framing is an important aspect of data link layer protocol design


because it allows the transmission of data to be organized and
controlled, ensuring that the data is delivered accurately and efficiently.

Problems in Framing

• Detecting start of the frame: When a frame is transmitted, every


station must be able to detect it. Station detects frames by looking
out for a special sequence of bits that marks the beginning of the
frame i.e. SFD (Starting Frame Delimiter).
• How does the station detect a frame: Every station listens to link
for SFD pattern through a sequential circuit. If SFD is detected,
sequential circuit alerts station. Station checks destination address
to accept or reject frame.
• Detecting end of frame: When to stop reading the frame.
• Handling errors: Framing errors may occur due to noise or other
transmission errors, which can cause a station to misinterpret the
frame. Therefore, error detection and correction mechanisms,
such as cyclic redundancy check (CRC), are used to ensure the
integrity of the frame.
• Framing overhead: Every frame has a header and a trailer that
contains control information such as source and destination
address, error detection code, and other protocol-related
information. This overhead reduces the available bandwidth for
data transmission, especially for small-sized frames.
• Framing incompatibility: Different networking devices and
protocols may use different framing methods, which can lead to
framing incompatibility issues. For example, if a device using one
framing method sends data to a device using a different framing
method, the receiving device may not be able to correctly
interpret the frame.
• Framing synchronization: Stations must be synchronized with
each other to avoid collisions and ensure reliable communication.
Synchronization requires that all stations agree on the frame
boundaries and timing, which can be challenging in complex
networks with many devices and varying traffic loads.
• Framing efficiency: Framing should be designed to minimize the
amount of data overhead while maximizing the available
bandwidth for data transmission. Inefficient framing methods can
lead to lower network performance and higher latency.

Types of framing

There are two types of framing:


1. Fixed-size: The frame is of fixed size and there is no need to provide
boundaries to the frame, the length of the frame itself acts as a
delimiter.

• Drawback: It suffers from internal fragmentation if the data size is


less than the frame size
• Solution: Padding

2. Variable size: In this, there is a need to define the end of the frame as
well as the beginning of the next frame to distinguish. This can be done
in two ways:

1. Length field – We can introduce a length field in the frame to


indicate the length of the frame. Used in Ethernet(802.3). The
problem with this is that sometimes the length field might get
corrupted.
2. End Delimiter (ED) – We can introduce an ED(pattern) to indicate
the end of the frame. Used in Token Ring. The problem with this is
that ED can occur in the data. This can be solved by:

1. Character/Byte Stuffing: Used when frames consist of


characters. If data contains ED then, a byte is stuffed into data to
differentiate it from ED.

Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped


using ‘\O’ character.
–> if data contains ‘\O$’ then, use ‘\O\O\O$'($ is escaped using \O
and \O is escaped using \O).
Disadvantage – It is very costly and obsolete method.

2. Bit Stuffing: Let ED = 01111 and if data = 01111


–> Sender stuffs a bit to break the pattern i.e. here appends a 0 in data =
011101.
–> Receiver receives the frame.
–> If data contains 011101, receiver removes the 0 and reads the data.
Examples:

• If Data –> 011100011110 and ED –> 0111 then, find data after bit
stuffing.
--> 011010001101100

• If Data –> 110001001 and ED –> 1000 then, find data after bit
stuffing?
--> 11001010011
framing in the Data Link Layer also presents some challenges, which
include:

Variable frame length: The length of frames can vary depending on the
data being transmitted, which can lead to inefficiencies in transmission.
To address this issue, protocols such as HDLC and PPP use a flag
sequence to mark the start and end of each frame.
Bit stuffing: Bit stuffing is a technique used to prevent data from being
interpreted as control characters by inserting extra bits into the data
stream. However, bit stuffing can lead to issues with synchronization
and increase the overhead of the transmission.

Synchronization: Synchronization is critical for ensuring that data


frames are transmitted and received correctly. However, synchronization
can be challenging, particularly in high-speed networks where frames
are transmitted rapidly.

Error detection: Data Link Layer protocols use various techniques to


detect errors in the transmitted data, such as checksums and CRCs.
However, these techniques are not foolproof and can miss some types of
errors.

Efficiency: Efficient use of available bandwidth is critical for ensuring


that data is transmitted quickly and reliably. However, the overhead
associated with framing and error detection can reduce the overall
efficiency of the transmission.

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

Stop and Wait ARQ


Characteristics

• Used in Connection-oriented communication.


• It offers error and flows control
• It is used in Data Link and Transport Layers
• Stop and Wait for ARQ mainly implements the Sliding
Window Protocol concept with Window Size 1
Useful Terms:

• Propagation Delay: Amount of time taken by a packet to


make a physical journey from one router to another router.
Propagation Delay = (Distance between routers) / (Velocity of
propagation)
• RoundTripTime (RTT) = Amount of time taken by a packet
to reach the receiver + Time taken by the
Acknowledgement to reach the sender
• TimeOut (TO) = 2* RTT
• Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 255
seconds)

Simple Stop and Wait


Sender:

Rule 1) Send one data packet at a time.


Rule 2) Send the next packet only after receiving
acknowledgement for the previous.

Receiver:

Rule 1) Send acknowledgement after receiving and consuming a


data packet.
Rule 2) After consuming packet acknowledgement need to be
sent (Flow Control)
Problems :
1. Lost Data
2. Lost Acknowledgement:
3. Delayed Acknowledgement/Data: After a timeout on the
sender side, a long-delayed acknowledgement might be wrongly
considered as acknowledgement of some other recent packet.

Stop and Wait for ARQ (Automatic Repeat Request)

The above 3 problems are resolved by Stop and Wait for ARQ
(Automatic Repeat Request) that does both error control and
flow control.
1. Time Out:
2. Sequence Number (Data)

3. Delayed Acknowledgement:
This is resolved by introducing sequence numbers for
acknowledgement also.

Working of Stop and Wait for ARQ:

1) Sender A sends a data frame or packet with sequence number


0.
2) Receiver B, after receiving the data frame, sends an
acknowledgement with sequence number 1 (the sequence
number of the next expected data frame or packet)
There is only a one-bit sequence number that implies that both
sender and receiver have a buffer for one frame or packet only.
Characteristics of Stop and Wait ARQ:

• It uses a link between sender and receiver as a half-duplex


link
• Throughput = 1 Data packet/frame per RTT
• If the Bandwidth*Delay product is very high, then they
stop and wait for protocol if it is not so useful. The sender
has to keep waiting for acknowledgements before sending
the processed next packet.
• It is an example of “Closed Loop OR connection-oriented “
protocols
• It is a special category of SWP where its window size is 1
• Irrespective of the number of packets sender is having stop
and wait for protocol requires only 2 sequence numbers 0
and 1
Constraints:
Stop and Wait ARQ has very less efficiency , it can be improved
by increasing the window size. Also , for better efficiency , Go
back N and Selective Repeat Protocols are used.
The Stop and Wait ARQ solves the main three problems but
may cause big performance issues as the sender always waits for
acknowledgement even if it has the next packet ready to send.
Consider a situation where you have a high bandwidth
connection and propagation delay is also high (you are
connected to some server in some other country through a high-
speed connection). To solve this problem, we can send more
than one packet at a time with a larger sequence number. We
will be discussing these protocols in the next articles.
So Stop and Wait ARQ may work fine where propagation delay
is very less for example LAN connections but performs badly
for distant connections like satellite connections.
Advantages of Stop and Wait ARQ :
• Simple Implementation: Stop and Wait ARQ is a simple
protocol that is easy to implement in both hardware and
software. It does not require complex algorithms or
hardware components, making it an inexpensive and
efficient option.
• Error Detection: Stop and Wait ARQ detects errors in the
transmitted data by using checksums or cyclic redundancy
checks (CRC). If an error is detected, the receiver sends a
negative acknowledgment (NAK) to the sender, indicating
that the data needs to be retransmitted.
• Reliable: Stop and Wait ARQ ensures that the data is
transmitted reliably and in order. The receiver cannot
move on to the next data packet until it receives the
current one. This ensures that the data is received in the
correct order and eliminates the possibility of data
corruption.
• Flow Control: Stop and Wait ARQ can be used for flow
control, where the receiver can control the rate at which
the sender transmits data. This is useful in situations
where the receiver has limited buffer space or processing
power.
• Backward Compatibility: Stop and Wait ARQ is compatible
with many existing systems and protocols, making it a
popular choice for communication over unreliable
channels.
Disadvantages of Stop and Wait ARQ :
• Low Efficiency: Stop and Wait ARQ has low efficiency as it
requires the sender to wait for an acknowledgment from
the receiver before sending the next data packet. This
results in a low data transmission rate, especially for large
data sets.
• High Latency: Stop and Wait ARQ introduces additional
latency in the transmission of data, as the sender must
wait for an acknowledgment before sending the next
packet. This can be a problem for real-time applications
such as video streaming or online gaming.
• Limited Bandwidth Utilization: Stop and Wait ARQ does
not utilize the available bandwidth efficiently, as the
sender can transmit only one data packet at a time. This
results in underutilization of the channel, which can be a
problem in situations where the available bandwidth is
limited.
• Limited Error Recovery: Stop and Wait ARQ has limited
error recovery capabilities. If a data packet is lost or
corrupted, the sender must retransmit the entire packet,
which can be time-consuming and can result in further
delays.
• Vulnerable to Channel Noise: Stop and Wait ARQ is
vulnerable to channel noise, which can cause errors in the
transmitted data. This can result in frequent
retransmissions and can impact the overall efficiency of
the protocol.
Sliding Window Protocol | Set 1 (Sender Side)

The Stop and Wait ARQ offers error and flow control but may cause big
performance issues as the sender always waits for acknowledgment even
if it has the next packet ready to send. Consider a situation where you have
a high bandwidth connection and propagation delay is also high (you are
connected to some server in some other country through a high-speed
connection), you can’t use this full speed due to limitations of stop and
wait.

Sliding Window protocol handles this efficiency issue by sending more


than one packet at a time with a larger sequence number. The idea is the
same as pipelining in architecture.

Terminologies Related to Sliding Window Protocol

Transmission Delay (Tt) – Time to transmit the packet from the host to
the outgoing link. If B is the Bandwidth of the link and D is the Data Size
to transmit
Tt = D/B

Propagation Delay (Tp) – It is the time taken by the first bit transferred
by the host onto the outgoing link to reach the destination. It depends on
the distance d and the wave propagation speed s (depends on the
characteristics of the medium).
Tp = d/s

Efficiency – It is defined as the ratio of total useful time to the total cycle
time of a packet. For stop and wait protocol,
Total time(TT) = Tt(data) + Tp(data) +
Tt(acknowledgement) +
Tp(acknowledgement)
= Tt(data) + Tp(data) +
Tp(acknowledgement)
= Tt + 2*Tp

Since acknowledgements are very less in size, their transmission delay


can be neglected.
Efficiency = Useful Time / Total Cycle Time
= Tt/(Tt + 2*Tp) (For Stop and Wait)
= 1/(1+2a) [ Using a = Tp/Tt ]

Effective Bandwidth(EB) or Throughput – Number of bits sent per


second.
EB = Data Size(D) / Total Cycle time(Tt + 2*Tp)
Multiplying and dividing by Bandwidth (B),
= (1/(1+2a)) * B [ Using a = Tp/Tt ]
= Efficiency * Bandwidth

Capacity of link – If a channel is Full Duplex, then bits can be transferred


in both the directions and without any collisions. Number of bits a
channel/Link can hold at maximum is its capacity.
Capacity = Bandwidth(B) * Propagation(Tp)

For Full Duplex channels,


Capacity = 2*Bandwidth(B) * Propagation(Tp)

Concept of Pipelining

In Stop and Wait protocol, only 1 packet is transmitted onto the link and
then sender waits for acknowledgement from the receiver. The problem
in this setup is that efficiency is very less as we are not filling the channel
with more packets after 1st packet has been put onto the link. Within the
total cycle time of Tt + 2*Tp units, we will now calculate the maximum
number of packets that sender can transmit on the link before getting an
acknowledgement.
In Tt units ----> 1 packet is Transmitted.
In 1 units ----> 1/Tt packet can be
Transmitted.
In Tt + 2*Tp units -----> (Tt + 2*Tp)/Tt
packets can be
Transmitted
------> 1 + 2a [Using a =
Tp/Tt]

Maximum packets That can be Transmitted in total cycle time = 1+2*a


Let me explain now with the help of an example. Consider Tt = 1ms, Tp
= 1.5ms. In the picture given below, after sender has transmitted packet
0, it will immediately transmit packets 1, 2, 3. Acknowledgement for 0
will arrive after 2*1.5 = 3ms. In Stop and Wait, in time 1 + 2*1.5 = 4ms,
we were transferring one packet only. Here we keep a window of packets
that we have transmitted but not yet acknowledged.
After we have received the Ack for packet 0, window slides and the next
packet can be assigned sequence number 0. We reuse the sequence
numbers which we have acknowledged so that header size can be kept
minimum as shown in the diagram given below.

Minimum Number of Bits For Sender Window (Very Important For


GATE)

As we have seen above,


Maximum window size = 1 + 2*a where a =
Tp/Tt

Minimum sequence numbers required = 1 + 2*a.

All the packets in the current window will be given a sequence number.
Number of bits required to represent the sender window =
ceil(log2(1+2*a)). But sometimes number of bits in the protocol headers
is pre-defined. Size of sequence number field in header will also
determine the maximum number of packets that we can send in total cycle
time. If N is the size of sequence number field in the header in bits, then
we can have 2N sequence numbers. Window Size ws = min(1+2*a, 2N) If
you want to calculate minimum bits required to represent sequence
numbers/sender window, it will be ceil(log2(ws)). In this article, we have
discussed sending window only. For receiving window, there are 2
protocols namely Go Back N and Selective Repeat which are used to
implement pipelining practically. We will be discussing receiving
window in set 2.

Types of Sliding Window Protocol

There are two types of Sliding Window Protocol which include Go-Back-
N ARQ and Selective Repeat ARQ:

Go-Back-N ARQ

Go-Back-N ARQ allows sending more than one frame before getting the
first frame’s acknowledgment. It is also known as sliding window
protocol since it makes use of the sliding window notion. There is a limit
to the amount of frames that can be sent, and they are numbered
consecutively. All frames beginning with that frame are retransmitted if
the acknowledgment is not received in a timely manner. For more detail
visit the page Go-Back-N ARQ.

Selective Repeat ARQ

Additionally, this protocol allows additional frames to be sent before the


first frame’s acknowledgment is received. But in this case, the excellent
frames are received and buffered, and only the incorrect or lost frames are
retransmitted. Check the detailed explanation of Selective Repeat ARQ.

Advantages of Sliding Window Protocol

• Efficiency: The sliding window protocol is an efficient method of


transmitting data across a network because it allows multiple
packets to be transmitted at the same time. This increases the
overall throughput of the network.
• Reliable: The protocol ensures reliable delivery of data, by
requiring the receiver to acknowledge receipt of each packet
before the next packet can be transmitted. This helps to avoid
data loss or corruption during transmission.

• Flexibility: The sliding window protocol is a flexible technique that


can be used with different types of network protocols and
topologies, including wireless networks, Ethernet, and IP
networks.

• Congestion Control: The sliding window protocol can also help


control network congestion by adjusting the size of the window
based on the network conditions, thereby preventing the network
from becoming overwhelmed with too much traffic.

Disadvantages of Sliding Window Protocol

• Complexity: The sliding window protocol can be complex to


implement and can require a lot of memory and processing power
to operate efficiently.

• Delay: The protocol can introduce a delay in the transmission of


data, as each packet must be acknowledged before the next
packet can be transmitted. This delay can increase the overall
latency of the network.

• Limited Bandwidth Utilization: The sliding window protocol may


not be able to utilize the full available bandwidth of the network,
particularly in high-speed networks, due to the overhead of the
protocol.

• Window Size Limitations: The maximum size of the sliding


window can be limited by the size of the receiver’s buffer or the
available network resources, which can affect the overall
performance of the protocol.
Sliding Window Protocol | Set 2 (Receiver Side)

Please refer this as a prerequisite article: Sliding Window Protocol


(sender side)| set 1 Sliding Window Protocol is actually a theoretical
concept in which we have only talked about what should be the sender
window size (1+2a) in order to increase the efficiency of stop and wait
arq. Now we will talk about the practical implementations in which we
take care of what should be the size of receiver window. Practically it is
implemented in two protocols namely :

1. Go Back N (GBN)

2. Selective Repeat (SR)

In this article, we will explain you about the first protocol which is GBN
in terms of three main characteristic features and in the next part we will
be discussing SR as well as comparison of both these protocols

Go Back N (GBN) Protocol

The three main characteristic features of GBN are:

1. Sender Window Size (WS) It is N itself. If we say the protocol is


GB10, then Ws = 10. N should be always greater than 1 in order to
implement pipelining. For N = 1, it reduces to Stop and Wait
protocol.
Efficiency Of GBN = N/(1+2a)
where a = Tp/Tt
Tp=Propogation Delay
Tt=Transmission Delay of sender

What will be the efficiency if processing delay, queuing delay and


transmission delay of acknowledgement is not zero.

Efficiency=N*(Useful time)/(Total Time)


where:

useful time=Tt

Total time=Tt+2*Tp+Pr+Pq+Tt(ack)

where Tt=Transmission delay of sender side

Tp=Propogation Delay

Pr=Processing Delay

Pq=Queuing Delay

Tt(ack)=Transmission Delay of Acknowledgement

1. If B is the bandwidth of the channel, then


Effective Bandwidth or Throughput
= Efficiency * Bandwidth
= (N/(1+2a)) * B

1. Receiver Window Size (WR)


WR is always 1 in GBN.

1. Now what exactly happens in GBN, we will explain with a help of


example. Consider the diagram given below. We have sender
window size of 4. Assume that we have lots of sequence numbers
just for the sake of explanation. Now the sender has sent the
packets 0, 1, 2 and 3. After acknowledging the packets 0 and 1,
receiver is now expecting packet 2 and sender window has also
slided to further transmit the packets 4 and 5. Now suppose the
packet 2 is lost in the network, Receiver will discard all the packets
which sender has transmitted after packet 2 as it is expecting
sequence number of 2. On the sender side for every packet send
there is a time out timer which will expire for packet number 2.
Now from the last transmitted packet 5 sender will go back to the
packet number 2 in the current window and transmit all the
packets till packet number 5. That’s why it is called Go Back N. Go
back means sender has to go back N places from the last
transmitted packet in the unacknowledged window and not from
the point where the packet is lost.

2. Acknowledgements There are 2 kinds of acknowledgements


namely:
o Cumulative Ack: One acknowledgement is used for many
packets. The main advantage is traffic is less. A disadvantage
is less reliability as if one ack is the loss that would mean
that all the packets sent are lost.
o Independent Ack: If every packet is going to get
acknowledgement independently then the reliability is high
here but a disadvantage is that traffic is also high since for
every packet we are receiving independent ack.
Relationship Between Window Sizes and Sequence Numbers We
already know that sequence numbers required should always be equal to
the size of window in any sliding window protocol.
Minimum sequence numbers required in GBN = N + 1
Bits Required in GBN = ceil(log2 (N + 1))

The extra 1 is required in order to


avoid the problem of duplicate packets
as described below.

Example: Consider an example of GB4.

• Sender window size is 4 therefore we require a minimum of 4


sequence numbers to label each packet in the window.

• Now suppose receiver has received all the packets(0, 1, 2 and 3


sent by sender) and hence is now waiting for packet number 0
again (We can not use 4 here as we have only 4 sequence
numbers available since N = 4).

• Now suppose the cumulative ack for the above 4 packets is lost in
the network.

• On sender side, there will be timeout for packet 0 and hence all
the 4 packets will be transmitted again.

• Problem now is receiver is waiting for new set of packets which


should have started from 0 but now it will receive the duplicate
copies of the previously accepted packets.

• In order to avoid this, we need one extra sequence number.

• Now the receiver could easily reject all the duplicate packets
which were starting from 0 because now it will be waiting for
packet number 4 (We have added an extra sequence number
now).

This is explained with the help of the illustrations below. Trying with
Sequence numbers 4.

Now Trying with one extra Sequence Number.


Now it is clear as to why we need an extra 1 bit in the GBN protocol. In
the next article, we will explain Selective repeat and comparison
between the 2 proto

Sliding Window Protocol | Set 3 (Selective Repeat)

Prerequisite : Sliding Window Protocol – Set 1 (Sender Side), Set 2


(Receiver Side) Why Selective Repeat Protocol? The go-back-n
protocol works well if errors are less, but if the line is poor it wastes a lot
of bandwidth on retransmitted frames. An alternative strategy, the
selective repeat protocol, is to allow the receiver to accept and buffer the
frames following a damaged or lost one. Selective Repeat attempts to
retransmit only those packets that are actually lost (due to errors) :

• Receiver must be able to accept packets out of order.


• Since receiver must release packets to higher layer in order, the
receiver must be able to buffer some packets.

Retransmission requests :

• Implicit – The receiver acknowledges every good packet, packets


that are not ACKed before a time-out are assumed lost or in
error.Notice that this approach must be used to be sure that every
packet is eventually received.

• Explicit – An explicit NAK (selective reject) can request


retransmission of just one packet. This approach can expedite the
retransmission but is not strictly needed.

• One or both approaches are used in practice.

Selective Repeat Protocol (SRP) : This protocol(SRP) is mostly


identical to GBN protocol, except that buffers are used and the receiver,
and the sender, each maintains a window of size. SRP works better when
the link is very unreliable. Because in this case, retransmission tends to
happen more frequently, selectively retransmitting frames is more
efficient than retransmitting all of them. SRP also requires full-duplex
link. backward acknowledgements are also in progress.

• Sender’s Windows ( Ws) = Receiver’s Windows ( Wr).

• Window size should be less than or equal to half the sequence


number in SR protocol. This is to avoid packets being recognized
incorrectly. If the size of the window is greater than half the
sequence number space, then if an ACK is lost, the sender may
send new packets that the receiver believes are retransmissions.

• Sender can transmit new packets as long as their number is with


W of all unACKed packets.
• Sender retransmit un-ACKed packets after a timeout – Or upon a
NAK if NAK is employed.

• Receiver ACKs all correct packets.

• Receiver stores correct packets until they can be delivered in order


to the higher layer.

• In Selective Repeat ARQ, the size of the sender and receiver


window must be at most one-half of 2^m.
Figure – the sender only retransmits frames, for which a NAK is
receivedEfficiency of Selective Repeat Protocol (SRP) is same as GO-
Back-N’s efficiency :
Efficiency = N/(1+2a)
Where a = Propagation delay / Transmission delay
Buffers = N + N
Sequence number = N(sender side) + N (
Receiver Side)

if Tt(ack) :Transmission delay for acknowledgment , Tq: Queuing delay


and Tpro: Processing delay is mention

We know that the Efficiency (?),

=Useful time / Total cycle time

=Tt(data) /Tt(data) + 2*Tp + Tq + Tpro + Tt(ack)


Tt(data) : Transmission delay for Data packet
Tp : propagation delay for Data packet
Tq: Queuing delay
Tpro: Processing delay
Tt(ack): Transmission delay for acknowledgment

Above formula is applicable for any condition, if any of the things are
not given we assume it to be 0
Sliding Window protocols Summary With Questions

Prerequisites – Stop & Wait, Go Back N, Selective Repeat


Summary of all the protocols –

Before starting with the questions a quick recap for all the
protocols. Stop and wait –
1. Sender window size (Ws) = 1
2. Receiver window size (Wr) = 1
3. Sequence Number ≥ 1 + 1
4. Uses independent acknowledgement
5. Discards out of order packets
6. Packet Loss ? Retransmit packet after time out
7. Acknowledgement loss ? Resends packet after time out
8. Efficiency = 1/(1+2a) where a = Tp / Tt
Go Back N –
1. Sender window size Ws = N
2. Receiver window size Wr = 1
3. Sequence number ≥ N + 1
4. Can use both cumulative or independent
acknowledgement depends on acknowledge timer
5. Discards out of order packets
6. Packet Loss ? Track back N size from the last packet within
the window limit to the lost packet and retransmit them
7. Acknowledgement loss ? If not received before timeout
the entire window N size is resend
8. Efficiency = N/(1+2a) where a = Tp / Tt
Selective Repeat –
1. Sender window size Ws = N
2. Receiver window size Wr = N
3. Sequence Number ≥ N + N
4. Uses only independent acknowledgement
5. Can Accept out of order packets
6. Packet Loss ? Resend only the lost packet after timeout
7. Acknowledgement loss ? Resend if not receive before
timeout
8. Efficiency = N/(1+2a) where a = Tp / Tt

Practice Questions –

• Example-1. In Stop and wait protocol every 4th packet is


lost and we need to send total 10 packets so how many
transmission it took to send all the packets?
• Explanation –
1 2 3 4 5 6 7 8 9 10 (Initially)
^
1 2 3 4 4 5 6 7 8 9 10 (Packet no. 4
retransmitted)
^
1 2 3 4 4 5 6 7 7 8 9 10 (Packet no. 10
retransmitted)
^
1 2 3 4 4 5 6 7 7 8 9 10 10 (Result)

• So, we retransmitted packet number 4, 7, 10 Total count =


13
• Example-2. In S&W protocol if Error probability is p and
no. of packets to send is ‘n’. How many packets we have to
send ?
• Explanation – Total retransmissions = n*p0+ n*p1+ n*p2 +
n*p3 + n*p4 + … = n(1 + p + p2 + p3 + p4 + …) = n*(1 / (1-p))
using infinite GP sum formula
• Example-3. In GBN sender Window size = 10 and Tp =
49.5ms & Tt = 1ms. What is the Efficiency of the protocol
and Throughput given Bandwidth = 1000 bps?
• Explanation – Efficiency = N/(1+2a), N = 10 (given), a =
Tp/Tt = 49.5 Efficiency = 10/(1 + 2 * 49.5) = 10/100 = 0.1 or
10% Throughput = Efficiency * Bandwidth = 0.1 * 1000 =
100
• Example-4. In GB3 if every 5th packet is lost & we need to
send 10 packets so how many retransmissions are required
?
• Explanation –
1 2 3 4 5 6 7 | 8 9 10
^ $ (packet no. 5
lost)
1 2 3 4 5 6 7 5 6 7 8 9 | 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10 9 10
(count starts from * till ^)
(from ^ to $ retransmission is done)
• Note – From the Last packet is window size to lost pocket
we resend the entire window. Total no. of transmissions =
18
• Example-5. In SR Ws = 5 and we are sending 10 packets
where every 5th packet is lost find number of
retransmissions?
• Explanation –
1 2 3 4 5 6 7 8 9 10
^
1 2 3 4 5 5 6 7 8 9 10
^
1 2 3 4 5 5 6 7 8 9 9 10

• We see here there is no role of Window size in SR only the


lost packet is resent. Total transmissions = 12
• Example-6. If there is K bits sequence no. define require
sender window size and receiver window size for S&W,
GBN & SR? Explanation – Given, K bits, For S&W Ws = 1
and Wr = 1 For GBN, Ws = 2K-1 and Wr = 1 For SR, Ws = 2K-1
and Wr = 2(K-1
Difference between Stop and Wait, GoBackN and Selective Repeat

Reliable data transfers are one of the primary concerns in computer


networking. This service department lies in the hands of TCP. Their
major flow control protocols – Stop and Wait, Go Back N, and Selective
Repeat.

1. Stop and Wait ARQ –


The sender sends the packet and waits for the acknowledgement
of the packet. Once the acknowledgement reaches the sender, it
transmits the next packet in a row. If the acknowledgement does
not reach the sender before the specified time, known as the
timeout, the sender sends the same packet again.

2. Go Back N ARQ –
The sender sends N packets which are equal to the window size.
Once the entire window is sent, the sender then waits for a
cumulative acknowledgement to send more packets. On the
receiver end, it receives only in-order packets and discards out-of-
order packets. As in case of packet loss, the entire window would
be re-transmitted.

3. Selective Repeat ARQ–


The sender sends packets of window size N and the receiver
acknowledges all packets whether they were received in order or
not. In this case, the receiver maintains a buffer to contain out-of-
order packets and sorts them. The sender selectively re-transmits
the lost packet and moves the window forward.
Where,

• a = Ratio of Propagation delay and Transmission delay,


• At N=1, Go Back N is effectively reduced to Stop and Wait,

• As Go Back N acknowledges the packed cumulatively, it rejects


out-of-order packets,
• As Selective Repeat supports receiving out-of-order packets (it
sorts the window after receiving the packets), it uses Independent
Acknowledgement to acknowledge the packets.

Error control:
The data link layer provides the mechanism of error control in
which it detects and retransmits damaged or lost frames.

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.
Example: Previous year GATE questions based on error detection:
GATE CS 2009 Question 48 GATE CS 2007 Question 68. This article
has been contributed by Vikash Kumar.

Advantages:

Increased Data Reliability: Error detection ensures that the data


transmitted over the network is reliable, accurate, and free from errors.
This ensures that the recipient receives the same data that was
transmitted by the sender.
Improved Network Performance: Error detection mechanisms can
help to identify and isolate network issues that are causing errors. This
can help to improve the overall performance of the network and reduce
downtime.

Enhanced Data Security: Error detection can also help to ensure that
the data transmitted over the network is secure and has not been
tampered with.

Disadvantages:

Overhead: Error detection requires additional resources and processing


power, which can lead to increased overhead on the network. This can
result in slower network performance and increased latency.

False Positives: Error detection mechanisms can sometimes generate


false positives, which can result in unnecessary retransmission of data.
This can further increase the overhead on the network.

Limited Error Correction: Error detection can only identify errors but
cannot correct them. This means that the recipient must rely on the
sender to retransmit the data, which can lead to further delays and
increased network overhead.

Error Correction in Computer Networks

Once the errors are detected in the network, the deviated bits sequence
needs to be replaced with the right bit sequence so that the receiver can
accept the data and process it. This method is called Error Correction. We
can correct the errors in the Network in two different ways which are
listed below:

• Forward Error Correction: In this Error Correction Scenario, the


receiving end is responsible for correcting the network error.
There is no need for retransmission of the data from the sender’s
side.
• Backward Error Correction: Backward Error Correction means that
the receiver needs to correct the error either by transmitting the
corrupted message or retransmitting the entire message to the
destination.

However, there is one of the most widely used Error Correction methods
which is called ‘Hamming Code’ which was designed by R.W.Hamming.
Let us have a quick look at it.

Hamming Code Error Correction

In this method, extra parity bits are appended to the message which are
used by the receiver to correct the single bit error and multiple bit error.
Consider the below example to understand this method in a better way.

Suppose the sender wants to transmit the message whose bit


representation is ‘1011001.’ In this message:

• Total number of bits(d) = 7

• Total of redundant bits(r) = 4 (This is because the message has


four 1’s in it)

• Thus, total bits(d+r) = 7 + 4 = 11

Also, by convention, the redundant bits are always placed in the places
which are powers of 2. Now, this message will take the format as shown
below:
Therefore, we have R1, R2, R3, and R4 as redundant bits which will be
calculated according to the following rules:

• R1 includes all the positions whose binary representation has 1 in


their least significant bit. Thus, R1 covers positions 1, 3, 5, 7, 9, 11.

• R2 includes all the positions whose binary representation has 1 in


the second position from the least significant bit. Thus, R2 covers
positions 2,3,6,7,10,11.

• R3 includes all the positions whose binary representation has 1 in


the third position from the least significant bit. Hence, R3 covers
positions 4, 5, 6, 7.

• R4 includes all the positions whose binary representation has 1 in


the fourth position from the least significant bit due to which R4
covers positions 8,9,10,11.

These rules are illustrated below:


Now, we calculate the value of R1, R2, R3 and R4 as follows:

• Since the total number of 1s in all the bit positions corresponding


to R1 is an even number. R1 = 0.

• Since the total number of 1s in all the bit positions corresponding


to R2 is an odd number, R2= 1.

• Since the total number of 1s in all the bit positions corresponding


to R3 is an odd number, R3= 1.

• Since the total number of 1s in all the bit positions corresponding


to R4 is even, R4 = 0.

Therefore, the message to be transmitted becomes:


This message is transmitted at the receiver’s end. Suppose, bit 6 becomes
corrupted and changes to 0. Then, the message becomes ‘10101101110.’
So, at the receiver’s end, the number of 1’s in the respective bit positions
of R1, R2, R3, and R4 is rechecked to correct the corrupted bit. This is
done in the following steps: For all the parity bits we will check the

• For R1: bits 1, 3, 5, 7, 9, and 11 are checked. We can see that the
number of 1’s in these bit positions is 4(even) so R1 = 0.

• For R2: bits 2,3,6,7,10,11 are checked. You can observe that the
number of 1’s in these bit positions is 5(odd) so we get a R2 = 1.

• For R3: bits 4, 5, 6, and 7 are checked. We see that the number of
1’s in these bit positions is 3(odd). Hence, R3 = 1.

• For R8: bits 8,9,10,11 are observed. Here, the number of 1’s in
these bit positions is 2 and that’s even so we get R4 = 0.

If we observe the Redundant bits, they 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 to correct the error.

Conclusion
Errors are encountered where there is a difference between the sequence
of bits of the source message and the received message while data is
transferred over the Network. The Errors create a lot of problems in the
information transfer by corrupting the data. Thus, the receiver becomes
unable to further process the data, due to which the request-response cycle
slows down over the network.

After learning about the different methods to correct these errors, we can
easily make sure the data transfer doesn’t face any discrepancy or
inconsistency. You have received enough information about the Error
Correction methods in networking.

Message switching techniques

Switching is the technique by which nodes control or switch data to


transmit it between specific points on a network. In message switching the
entire message is transmitted without any break from one node to another.
There is no direct link present between the sender and the receiver in
message switching.

What is Message Switching?

Message switching is a switching mechanism in which a message is sent


as a single unit and routed to intermediary nodes where it is stored and
forwarded. The message-switching approach does not provide a dedicated
path between the sender and receiver. In message switching, end-users
communicate by sending and receiving messages that include the entire
data to be shared. Messages are the smallest individual unit. Also, the
sender and receiver are not directly connected. Several intermediate nodes
transfer data and ensure that the message reaches its destination. Message-
switched data networks are hence called hop-by-hop systems.
Message Switching

• Store and forward – The intermediate nodes have the


responsibility of transferring the entire message to the next node.
Hence, each node must have storage capacity. A message will only
be delivered if the next hop and the link connecting it are both
available, otherwise, it’ll be stored indefinitely. A store-and-
forward switch forwards a message only if sufficient resources are
available and the next hop is accepting data. This is called the
store-and-forward property.

• Message delivery – This implies wrapping the entire information


in a single message and transferring it from the source to the
destination node. Each message must have a header that contains
the message routing information, including the source and
destination.
Message switching network consists of transmission links (channels),
store-and-forward switch nodes, and end stations as shown in the
following picture:

Advantages of Message Switching

• As message switching is able to store the message for which


communication channel is not available, it helps in reducing the
traffic congestion in the network.

• In message switching, the data channels are shared by the


network devices.

• It makes traffic management efficient by assigning priorities to the


messages.

• Because the messages are delivered via a store and forward


method, it is possible to include priority in them.
• It allows for infinite message lengths.

• Unlike circuit switching, it does not necessitate the actual


connection of source and destination devices.

Disadvantages of Message Switching

• Message switching cannot be used for real-time applications as


storing messages causes delay.

• In message switching, the message has to be stored for which


every intermediate device in the network requires a large storing
capacity.

• Because the system is so intricate, people are frequently unaware


of whether or not messages are correctly conveyed. This could
cause problems in social relationships.

• The type of message switching does not create a dedicated path


between the devices. It is not dependable communication
because there is no direct relationship between sender and
receiver.

Applications of Message Switching

The store-and-forward method was implemented in telegraph message


switching centres. Today, although many major networks and systems are
packet-switched or circuit-switched networks, their delivery processes
can be based on message switching. For example, in most electronic mail
systems the delivery process is based on message switching, while the
network is in fact either circuit-switched or packet-switched.

Circuit Switching in Computer Network

In circuit switching network resources (bandwidth) are divided into


pieces and bit delay is constant during a connection. The dedicated
path/circuit established between sender and receiver provides a
guaranteed data rate. Data can be transmitted without any delays once
the circuit is established.

Telephone system network is one of the example of Circuit switching.


TDM (Time Division Multiplexing) and FDM (Frequency Division
Multiplexing) are two methods of multiplexing multiple signals into a
single carrier.

• Frequency Division Multiplexing : Divides into multiple bands


Frequency Division Multiplexing or FDM is used when multiple
data signals are combined for simultaneous transmission via a
shared communication medium.It is a technique by which the
total bandwidth is divided into a series of non-overlapping
frequency sub-bands,where each sub-band carry different signal.
Practical use in radio spectrum & optical fibre to share multiple
independent signals.

• Time Division Multiplexing : Divides into frames


Time-division multiplexing (TDM) is a method of transmitting and
receiving independent signals over a common signal path by
means of synchronized switches at each end of the transmission
line. TDM is used for long-distance communication links and bears
heavy data traffic loads from end user.
Time division multiplexing (TDM) is also known as a digital circuit
switched.

drawbacks:

Inefficient use of resources: Circuit switching requires the


establishment of a dedicated communication path between two nodes,
which means that the resources along that path, such as bandwidth and
switch ports, are reserved for the duration of the communication. This
can result in inefficient use of resources, as the resources may remain
unused during periods of low or no communication.

Limited scalability: Circuit switching is not well-suited for large-scale


networks with many nodes, as it requires a dedicated communication
path between each pair of nodes. This can result in a high degree of
complexity and difficulty in managing the network.

Vulnerability to failures: Circuit switching relies on a dedicated


communication path, which can make the network vulnerable to failures,
such as cable cuts or switch failures. In the event of a failure, the
communication path must be re-established, which can result in delays
or loss of data.

Delay and latency: Circuit switching requires the establishment of a


dedicated communication path, which can result in delay and latency in
establishing the path and transmitting data. This can impact the real-time
performance of applications, such as voice and video.

High cost: Circuit switching requires the reservation of resources, which


can result in a high cost, particularly in large-scale networks. This can
make circuit switching less practical for some applications.

Lack of flexibility: Circuit switching is not flexible as it only allows


one type of communication at a time, such as voice or data. This can
limit the ability of users to perform multiple tasks simultaneously.

Limited mobility: Circuit switching is not well-suited for mobile


devices or nodes that move frequently, as it requires the establishment of
a dedicated communication path. This can result in communication
disruptions or dropped calls.

Limited capacity: Circuit switching can have limited capacity as it


requires the establishment of a dedicated communication path between
two nodes. This can limit the number of simultaneous communications
that can occur.
High setup time: Circuit switching requires a significant setup time to
establish the dedicated communication path between two nodes. This
can result in delays in initiating communication.

No prioritization: Circuit switching does not provide any mechanism


for prioritizing certain types of traffic over others. This can result in
delays or poor performance for time-critical applications, such as voice
or video.

Advantages of Circuit Switching:


It has the following advantages :

1. The main advantage of circuit switching is that a committed


transmission channel is established between the computers which
give a guaranteed data rate.
2. In-circuit switching, there is no delay in data flow because of the
dedicated transmission path.
3. Reliability: Circuit switching provides a high level of reliability
since the dedicated communication path is reserved for the entire
duration of the communication. This ensures that the data will be
transmitted without any loss or corruption.
4. Quality of service: Circuit switching provides a guaranteed quality
of service, which means that the network can prioritize certain
types of traffic, such as voice and video, over other types of traffic,
such as email and web browsing.
5. Security: Circuit switching provides a higher level of security
compared to packet switching since the dedicated communication
path is only accessible to the two communicating parties. This can
help prevent unauthorized access and data breaches.
6. Ease of management: Circuit switching is relatively easy to
manage since the communication path is pre-established and
dedicated to a specific communication. This can help simplify
network management and reduce the risk of errors.
7. Compatibility: Circuit switching is compatible with a wide range of
devices and protocols, which means that it can be used with
different types of networks and applications. This makes it a
versatile technology for various industries and use cases.

Disadvantages of Circuit Switching:


It has the following disadvantages :

1. It takes a long time to establish a connection.


2. More bandwidth is required in setting up dedicated channels.
3. It cannot be used to transmit any other data even if the channel is
free as the connection is dedicated to circuit switching.
4. Limited Flexibility: Circuit switching is not flexible as it requires a
dedicated circuit between the communicating devices. The circuit
cannot be used Waste of Resources for any other purpose until
the communication is complete, which limits the flexibility of the
network.
5. Waste of Resources: Circuit switching reserves the bandwidth and
network resources for the duration of the communication, even if
there is no data being transmitted. This results in the wastage of
resources and inefficient use of the network.
6. Expensive: Circuit switching is an expensive technology as it
requires dedicated communication paths, which can be costly to
set up and maintain. This makes it less feasible for small-scale
networks and applications.
7. Susceptible to Failure: Circuit switching is susceptible to failure as
it relies on a dedicated communication path. If the path fails, the
entire communication is disrupted. This makes it less reliable than
other networking technologies, such as packet switching.
8. Not suitable for bursty traffic: Circuit switching is not suitable for
bursty traffic, where data is transmitted intermittently at irregular
intervals. This is because a dedicated circuit needs to be
established for each communication, which can result in delays
and inefficient use of resources.

Formulas in Circuit Switching :

Transmission rate = Link Rate or Bit rate /


no. of slots = R/h bps
Transmission time = size of file /
transmission rate
= x / (R/h) = (x*h)/R second
Total time to send packet to destination =
Transmission time + circuit setup
time

Question on Circuit switching –


These questions will help you understand circuit switching

Example 1 : How long it takes to send a file of ‘x bits’ from host A to


host B over a circuit switched network that uses TDM with ‘h slots’ and
have a bit rate of ‘R Mbps’, circuit establish time is k seconds.Find total
time?

Explanation :
Transmission rate = Link Rate or Bit rate / no. of slots = R/h bps
Transmission time = size of file/ transmission rate = x / (R/h) = (x*h)/R

Total time = transmission time + circuit setup time = (x*h)/R secs + k


secs

Example 2 : If a link transmits F frames/sec and each slot has B bits


then find the transmission rate?

Explanation :
Since it is not mention how many slots in each frame we take one frame
has one slot.
The transmission rate is the amount of data sent in 1 second.
Transmission rate = F * B bits/sec

To know the difference between Circuit Switching and Packet Switching


refer – Difference b/w Circuit switch & packet switch

Packet Switching and Delays in Computer Network

Packet Switching in computer networks is a method of transferring data


to a network in the form of packets. In order to transfer the file fast and
efficiently manner over the network and minimize the transmission
latency, the data is broken into small pieces of variable length, called
Packet. At the destination, all these small parts (packets) have to be
reassembled, belonging to the same file. A packet is composed of a
payload and various control information. No pre-setup or reservation of
resources is needed.

Packet Switching uses the Store and Forward technique while


switching the packets; while forwarding the packet each hop first stores
that packet then forwards. This technique is very beneficial because
packets may get discarded at any hop for some reason. More than one
path is possible between a pair of sources and destinations. Each packet
contains the Source and destination address using which they
independently travel through the network. In other words, packets
belonging to the same file may or may not travel through the same path.
If there is congestion at some path, packets are allowed to choose
different paths possible over an existing network.

Diagram of Packet Switching

In packet switching the data is divided into small packets which allow
faster movement of data. Each packet contains two parts that is Header
and Payload, the header on each packet conation information. Below is
the diagram of how packet switching works.
Packet Switching

Types of Delays in Packet Switching

• Transmission Delay: Time required by the spentstation to transmit


data to the link.

• Propagation Delay: Time of data propagation through the link.

• Queueing Delay: Time spent by the packet at the destination’s


queue.

• Processing Delay: Processing time for data at the destination.

Advantages of Packet Switching over Circuit Switching

• More efficient in terms of bandwidth, since the concept of


reserving a circuit is not there.

• Minimal transmission latency.

• More reliable as a destination can detect the missing packet.


• More fault tolerant because packets may follow a different path in
case any link is down, Unlike Circuit Switching.

• Cost-effective and comparatively cheaper to implement.

Disadvantage of Packet Switching over Circuit Switching

• Packet Switching doesn’t give packets in order, whereas Circuit


Switching provides ordered delivery of packets because all the
packets follow the same path.

• Since the packets are unordered, we need to provide sequence


numbers for each packet.

• Complexity is more at each node because of the facility to follow


multiple paths.

• Transmission delay is more because of rerouting.

• Packet Switching is beneficial only for small messages, but for


bursty data (large messages) Circuit Switching is better.

Types of Packet Switching

1. Connection-oriented Packet Switching (Virtual Circuit)

Before starting the transmission, it establishes a logical path or virtual


connection using a signaling protocol, between sender and receiver and
all packets belongs to this flow will follow this predefined route. Virtual
Circuit ID is provided by switches/routers to uniquely identify this virtual
connection. Data is divided into small units and all these small units are
appended with help of sequence numbers. Packets arrive in order at the
destination. Overall, three phases take place here- The setup, data transfer
and tear-down phases.
Virtual Circuit

All address information is only transferred during the setup phase. Once
the route to a destination is discovered, entry is added to the switching
table of each intermediate node. During data transfer, packet header (local
header) may contain information such as length, timestamp, sequence
number, etc.

Connection-oriented switching is very useful in switched WAN. Some


popular protocols which use the Virtual Circuit Switching approach are
X.25, Frame-Relay, ATM, and MPLS(Multi-Protocol Label Switching).
2. Connectionless Packet Switching (Datagram)

Unlike Connection-oriented packet switching, In Connectionless Packet


Switching each packet contains all necessary addressing information
such as source address, destination address, port numbers, etc. Packets
belonging to one flow may take different routes because routing
decisions are made dynamically, so the packets that arrived at the
destination might be out of order. It has no connection setup and
teardown phase, like Virtual Circuits.
Packet delivery is not guaranteed in connectionless packet switching, so
reliable delivery must be provided by end systems using additional
protocols.

Datagram Packet Switching

A—R1—R2—BA is the sender (start)R1, R2 are two routers that store


and forward dataB is receiver(destination)

To send a packet from A to B there are delays since this is a Store and
Forward network.

Differences Between Virtual Circuits and Datagram Networks

Computer networks that provide connection-oriented services are called


Virtual Circuits while those providing connection-less services are called
Datagram networks. For prior knowledge, the Internet that we use is based
on a Datagram network (connection-less) at the network level as all
packets from a source to a destination do not follow the same path.
Virtual Circuits

• It is connection-oriented, meaning that there is a reservation of


resources like buffers, CPU, bandwidth, etc. for the time in which
the newly set VC is going to be used by a data transfer session.

• The first sent packet reserves resources at each server along the
path. Subsequent packets will follow the same path as the first
sent packet for the connection time.

• Since all the packets are going to follow the same path, a global
header is required. Only the first packet of the connection
requires a global header, the remaining packets generally don’t
require global headers.

• Since all packets follow a specific path, packets are received in


order at the destination.

• Virtual Circuit Switching ensures that all packets successfully reach


the Destination. No packet will be discarded due to the
unavailability of resources.

• From the above points, it can be concluded that Virtual Circuits


are a highly reliable method of data transfer.

• The issue with virtual circuits is that each time a new connection is
set up, resources and extra information have to be reserved at
every router along the path, which becomes problematic if many
clients are trying to reserve a router’s resources simultaneously.

• It is used by the ATM (Asynchronous Transfer Mode) Network,


specifically for Telephone calls.
Types of Virtual Circuit

1. Permanent Virtual Circuits(PVC): The communication management


station, which is the telco’s central office, manually configures the
switches, which offer performance comparable to dedicated lines. The
main use for these always-on circuits is high-speed communication. PVCs
require telco resources (switches) to be allocated to a single
communication circuit whether or not that circuit is in use, making them
an expensive solution for wide-area networks (WANs).

2. Switched Virtual circuits (SVCs): As soon as a communication


session is established, the switches are set up. SVCs are released at the
conclusion of the session and can be used to create new channels of
communication. This is the process of normal phone communication.
SVCs, which are billed on a per-minute basis, are generally utilised in
WANs when backups to dedicated leased lines are required.

Benefits of Virtual Circuit

• The recipient receives the sender’s packets in the same order as


they were sent.

• A secure network link is called a virtual circuit.

• Overhead is not required for any packet.

• A single global packet overhead is used in a virtual circuit.

Drawbacks of Virtual Circuits

• The cost of implementing a virtual circuit is high.

• It provides only services based on connections.

• In order to transmit, a new link needs to be created permanently.

Datagram Networks
• It is a connection-less service. There is no need for reservation of
resources as there is no dedicated path for a connection session.

• All packets are free to use any available path. As a result,


intermediate routers calculate routes on the go due to
dynamically changing routing tables on routers.

• Since every packet is free to choose any path, all packets must be
associated with a header with proper information about the
source and the upper layer data.

• The connection-less property makes data packets reach the


destination in any order, which means that they can potentially be
received out of order at the receiver’s end.

• Datagram networks are not as reliable as Virtual Circuits.

• The major drawback of Datagram Packet switching is that a packet


can only be forwarded if resources such as the buffer, CPU, and
bandwidth are available. Otherwise, the packet will be discarded.

• But it is always easy and cost-efficient to implement datagram


networks as there is no extra headache of reserving resources and
making a dedicated each time an application has to communicate.

• It is generally used by the IP network, which is used for Data


services like the Internet.

Benefits of Datagram Networks

• The flexibility of datagram networks is one of its main benefits.

• They are better at managing network congestion. Datagram


networks are able to adjust to variations in network traffic and
identify several paths for packets to take in order to reach their
intended destination because every packet is handled separately.

• In big and complicated networks in particular, this can lead to


decreased latency and increased network performance.

• In addition, datagram networks scale more easily than other kinds


of networks. Datagram networks are the ideal option for
contemporary communication systems, such as the Internet of
Things (IoT) and real-time data streaming applications, due to
their scalability.

Drawbacks of Datagram Networks

• The lack of assured delivery in datagram networks is one of their


primary disadvantages. There is no assurance that all packets will
arrive at their destination or in the right order because they are
sent separately.

• Datagram networks also have the drawback of being vulnerable to


security breaches. Datagram networks are particularly susceptible
to network assaults including spoofing, eavesdropping, and denial
of service (DoS) attacks since they don’t create a dedicated
connection between the sender and the recipient.

• Moreover, datagram networks may not always support guarantees


of quality of service (QoS). While certain applications may benefit
from QoS capabilities provided by some protocols, like the Real-
time Transport Protocol (RTP), datagram networks as a whole do
not provide a centralised method for allocating priorities and
controlling network traffic.

Difference Between Virtual Circuits and Datagram


Networks
Criteria Virtual Circuit Networks Datagram Networks

Prior to data transmission, a


Connection Establishment connection is established between No connection setup is required.
sender and receiver.

Routing decisions are made once Routing decisions are made


during connection setup and independently for each packet and
Routing
remain fixed throughout the can vary based on network
duration of the connection. conditions.

Uses explicit flow control, where Uses implicit flow control, where
the sender adjusts its rate of the sender assumes a certain level
Flow Control
transmission based on feedback of available bandwidth and sends
from the receiver. packets accordingly.

Uses network-assisted congestion


Uses end-to-end congestion
control, where routers monitor
control, where the sender adjusts
Congestion Control network conditions and may drop
its rate of transmission based on
packets or send congestion signals
feedback from the network.
to the sender.

Provides reliable delivery of


Provides unreliable delivery of
packets by detecting and
Error Control packets and does not guarantee
retransmitting lost or corrupted
delivery or correctness.
packets.

Requires more overhead per


Requires less overhead per packet
packet because each packet
because connection setup and
Overhead contains information about its
state maintenance are done only
destination address and other
once.
routing information.

Example Protocol ATM, Frame Relay IP (Internet Protocol)

Conclusion

• Another term for virtual circuits is connection-oriented switching.


Virtual circuit switching establishes a predetermined path before a
message is sent.

• The path in virtual circuits is called a virtual circuit because it


seems to the user to be a dedicated physical circuit.
• In datagram networks, sometimes referred to as packet-switching
technology, each packet—also known as a datagram—is regarded
as an autonomous entity. The switch uses the destination
information included in each packet to guide the packet to its
intended location.

• Reserving resources is not necessary in Datagram Networks since


there isn’t a specific channel for connection sessions. Packets now
have a header containing all of the data intended for the
destination.

• Datagram networks use first-come, first-serve (FCFS) scheduling to


manage resource distribution.

Types of Routing

Routing is a process that is performed by layer 3 (or network layer)


devices in order to deliver the packet by choosing an optimal path from
one network to another.

Types of Routing

There are 3 types of routing that are described below.

1. Static Routing

Static routing is a process in which we have to manually add routes to


the routing table.

Advantages

• No routing overhead for the router CPU which means a cheaper


router can be used to do routing.

• It adds security because only an only administrator can allow


routing to particular networks only.
• No bandwidth usage between routers.

Disadvantage

• For a large network, it is a hectic task for administrators to


manually add each route for the network in the routing table on
each router.

• The administrator should have good knowledge of the topology. If


a new administrator comes, then he has to manually add each
route so he should have very good knowledge of the routes of the
topology.

Configuration

R1 having IP address 172.16.10.6/30 on s0/0/1, 192.168.20.1/24 on


fa0/0.
R2 having IP address 172.16.10.2/30 on s0/0/0, 192.168.10.1/24 on
fa0/0.
R3 having IP address 172.16.10.5/30 on s0/1, 172.16.10.1/30 on s0/0,
10.10.10.1/24 on fa0/0.

Now because only static routes for router R3:


R3(config)#ip route 192.168.10.0 255.255.255.0
172.16.10.2
R3(config)#ip route 192.168.20.0 255.255.255.0
172.16.10.6

Here, provided the route for the 192.168.10.0 network where


192.168.10.0 is its network I’d and 172.16.10.2 and 172.16.10.6 are the
next-hop address.
Now, configuring for R2:
R2(config)#ip route 192.168.10.0 255.255.255.0
172.16.10.1
R2(config)#ip route 10.10.10.0 255.255.255.0
172.16.10.1
R2(config)#ip route 172.16.10.0 255.255.255.0
172.16.10.1

Similarly for R1:


R1(config)#ip route 192.168.20.0 255.255.255.0
172.16.10.5
R1(config)#ip route 10.10.10.0 255.255.255.0
172.16.10.5
R1(config)#ip route 172.16.10.0 255.255.255.0
172.16.10.5

2. Default Routing

This is the method where the router is configured to send all packets
toward a single router (next hop). It doesn’t matter to which network the
packet belongs, it is forwarded out to the router which is configured for
default routing. It is generally used with stub routers. A stub router is a
router that has only one route to reach all other networks.

Configuration: Using the same topology which we have used for static
routing before.

In this topology, R1 and R2 are stub routers so we can configure default


routing for both these routers.

Configuring default routing for R1:


R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.5

Now configuring default routing for R2:


R2(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.1

3. Dynamic Routing

Dynamic routing makes automatic adjustments of the routes according


to the current state of the route in the routing table. Dynamic routing
uses protocols to discover network destinations and the routes to reach
them. RIP and OSPF are the best examples of dynamic routing
protocols. Automatic adjustments will be made to reach the network
destination if one route goes down.

A dynamic protocol has the following features:

• The routers should have the same dynamic protocol running in


order to exchange routes.

• When a router finds a change in the topology then the router


advertises it to all other routers.

Advantages

• Easy to configure.

• More effective at selecting the best route to a destination remote


network and also for discovering remote networks.

Disadvantage

• Consumes more bandwidth for communicating with other


neighbors.

• Less secure than static routing

Routing Metrics and Protocols

The purpose of routing protocols is to learn about all the available paths
to route data packets, build routing table and take routing decisions based
on some specified metrics. There are two primary types of routing
protocols rest of them ideate from these two only.

1. Distance Vector Routing

In this type of routing protocol, all the nodes that are a part of the network
advertise their routing table to their adjacent nodes (nodes that are directly
connected to each other) at regular intervals. With each router getting
updated at regular intervals, it may take time for all the nodes to have the
same accurate network view.

• Uses fixed length sub-net, not suitable for scaling.

• Algorithm used: Bellman Ford Algorithm to find the shortest path.

2. Link State Routing

Link State Routing is another type of dynamic routing protocol in which


routes advertise their updated routing tables only when some new updates
are added. This results in effective use of bandwidth. All the routers keep
exchanging the information dynamically regarding different links such as
cost and hop count to find the best possible path.

• Uses variable length sub-net mask, which is scalable and uses


addressing more effectively.

• Algorithm used: Djikstra’s Algorithm to find the shortest path.

Let’s look at the metrics used to measure the cost to travel one node to
another :-

1. Hop Count: Hop count refers to the number of nodes a data packet has
to traverse to reach its intended destination. Transmitting from one node
to another node counts as 1 – hop count. The goal is to minimize the hop
count and find the shortest path.
2. Bandwidth Consumption: Bandwidth is the ability of a network to
transmit data typically measured in (Kilobits per second)kbps,
mbps(Megabits per second) or Gbps (Gigabits per second). The
bandwidth depends on a number of factors such as – the volume of data,
traffic on a network, network speed etc. Routing decision is made in a way
to ensure efficient bandwidth consumption.

3. Delay: Delay is the time it takes for a data packet to travel from source
node to its destination node. There are different types of delay such as –
propagation delay, transmission delay, queing delay.

4. Load: Load refers to the network traffic on a certain path in the context
of routing. A data packet will be routed to the path with lesser load so that
it reaches its destination in the specified time.

5. Reliability: Reliability refers to the assured delivery of the data packet


to its intended destination although there are certain other factors, the data
packet is routed in such a way so that it reaches its destination. The
stability and availability of the link in the network is looked over before
routing the data packet from a specific path.

Advantages of Routing

• Overall routing can be done in various ways its important to know


requirements and use the one that fits right for our specific needs,
hence the automated routing is typically preferred as the routing
of packets is done by the algorithms defined and moreover the
manually configurable routing can give us a fine grained control
over the network.

• Routing is a high scalable operation for transmitting data that is, in


a large scale enterprise networks it becomes crucial to manage
information related to all the nodes that may be sharing sensitive
and confidential information regarding the organization.
• Load Balancing is also one of the crucial aspects taken care of by
routing data packets off the routes that are generally busy as
sending data through those routes will only put our data at risk of
getting lost.

Disadvantages of Routing

Every type of routing comes with some pros and cons here are some of
the disadvantages for specific types of routing :

• Static Routing: This type of routing is appropriate only for smaller


network where the network administrator has an accurate view of
the network & good knowledge of topology else it might raise
some security concerns and complex configuration issues.

• Dynamic Routing: Everything is done automatically by the


algorithms, providing less control over the network that may not
be suitable for every kind of network. It is also computationally
expensive and consumes more bandwidth.

• Default Routing: The path on which the packets are to be


transmitted by default is configurable but can be a complex
procedure if not defined clearly.

Conclusion

Routing is a fundamental concept in computer science that allows every


network device across the world to share data with each other across
internet.

• Shortest path is selected by the routing algorithms when routing a


data packet.

• Routing Algorithms select the shortest path based on metrics like


– hop count, delay, bandwidth etc.
• The core network device used in routing is router. Routes are
stored in a logical data structure called – ‘Routing Table‘

Unit -5
Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways and
Brouter)

Network Devices: Network devices, also known as networking


hardware, are physical devices that allow hardware on a computer
network to communicate and interact with one another. For example
Repeater, Hub, Bridge, Switch, Routers, Gateway, Brouter, and NIC,
etc.

1. Repeater – A repeater operates at the physical layer. Its job is to


regenerate the signal over the same network before the signal becomes
too weak or corrupted to extend the length to which the signal can be
transmitted over the same network. An important point to be noted about
repeaters is that they not only amplify the signal but also regenerate it.
When the signal becomes weak, they copy it bit by bit and regenerate it
at its star topology connectors connecting following the original
strength. It is a 2-port device.

2. Hub – A hub is a basically multi-port repeater. A hub connects


multiple wires coming from different branches, for example, the
connector in star topology which connects different stations. Hubs
cannot filter data, so data packets are sent to all connected devices. In
other words, the collision domain of all hosts connected through Hub
remains one. Also, they do not have the intelligence to find out the best
path for data packets which leads to inefficiencies and wastage.

Types of Hub
• Active Hub:- These are the hubs that have their power supply and
can clean, boost, and relay the signal along with the network. It
serves both as a repeater as well as a wiring center. These are
used to extend the maximum distance between nodes.
• Passive Hub:- These are the hubs that collect wiring from nodes
and power supply from the active hub. These hubs relay signals
onto the network without cleaning and boosting them and can’t
be used to extend the distance between nodes.
• Intelligent Hub:- It works like an active hub and includes remote
management capabilities. They also provide flexible data rates to
network devices. It also enables an administrator to monitor the
traffic passing through the hub and to configure each port in the
hub.

3. Bridge – A bridge operates at the data link layer. A bridge is a repeater,


with add on the functionality of filtering content by reading the MAC
addresses of the source and destination. It is also used for interconnecting
two LANs working on the same protocol. It has a single input and single
output port, thus making it a 2 port device.

Types of Bridges

• Transparent Bridges:- These are the bridge in which the stations


are completely unaware of the bridge’s existence i.e. whether or
not a bridge is added or deleted from the network,
reconfiguration of the stations is unnecessary. These bridges make
use of two processes i.e. bridge forwarding and bridge learning.
• Source Routing Bridges:- In these bridges, routing operation is
performed by the source station and the frame specifies which
route to follow. The host can discover the frame by sending a
special frame called the discovery frame, which spreads through
the entire network using all possible paths to the destination.
4. Switch – A switch is a multiport bridge with a buffer and a design
that can boost its efficiency(a large number of ports imply less traffic)
and performance. A switch is a data link layer device. The switch can
perform error checking before forwarding data, which makes it very
efficient as it does not forward packets that have errors and forward
good packets selectively to the correct port only. In other words, the
switch divides the collision domain of hosts, but the broadcast domain
remains the same.

Types of Switch

1. Unmanaged switches: These switches have a simple plug-and-play


design and do not offer advanced configuration options. They are
suitable for small networks or for use as an expansion to a larger
network.
2. Managed switches: These switches offer advanced configuration
options such as VLANs, QoS, and link aggregation. They are
suitable for larger, more complex networks and allow for
centralized management.
3. Smart switches: These switches have features similar to managed
switches but are typically easier to set up and manage. They are
suitable for small- to medium-sized networks.
4. Layer 2 switches: These switches operate at the Data Link layer of
the OSI model and are responsible for forwarding data between
devices on the same network segment.
5. Layer 3 switches: These switches operate at the Network layer of
the OSI model and can route data between different network
segments. They are more advanced than Layer 2 switches and are
often used in larger, more complex networks.
6. PoE switches: These switches have Power over Ethernet
capabilities, which allows them to supply power to network
devices over the same cable that carries data.
7. Gigabit switches: These switches support Gigabit Ethernet speeds,
which are faster than traditional Ethernet speeds.
8. Rack-mounted switches: These switches are designed to be
mounted in a server rack and are suitable for use in data centers
or other large networks.
9. Desktop switches: These switches are designed for use on a
desktop or in a small office environment and are typically smaller
in size than rack-mounted switches.
10. Modular switches: These switches have modular design,
which allows for easy expansion or customization. They are
suitable for large networks and data centers.

5. Routers – A router is a device like a switch that routes data packets


based on their IP addresses. The router is mainly a Network Layer
device. Routers normally connect LANs and WANs and have a
dynamically updating routing table based on which they make decisions
on routing the data packets. The router divides the broadcast domains of
hosts connected through it.
6. Gateway – A gateway, as the name suggests, is a passage to connect
two networks that may work upon different networking models. They
work as messenger agents that take data from one system, interpret it, and
transfer it to another system. Gateways are also called protocol converters
and can operate at any network layer. Gateways are generally more
complex than switches or routers. A gateway is also called a protocol
converter.

7. Brouter – It is also known as the bridging router is a device that


combines features of both bridge and router. It can work either at the
data link layer or a network layer. Working as a router, it is capable of
routing packets across networks and working as the bridge, it is capable
of filtering local area network traffic.

8. NIC – NIC or network interface card is a network adapter that is used


to connect the computer to the network. It is installed in the computer to
establish a LAN. It has a unique id that is written on the chip, and it has
a connector to connect the cable to it. The cable acts as an interface
between the computer and the router or modem. NIC card is a layer 2
device which means that it works on both the physical and data link
layers of the network model.

Multiplexing (Channel Sharing) in Computer Network

Multiplexing means multiple sources but one link. An alternative


approach is a Direct point-to-point connection, but it has several problems
as it requires an I/O port for each device, a need line for each device, and
also a large amount of wiring needed if on different floors. Instead, if we
use a multiplexer approach then all devices are connected to MUX and
one line to the host, the link carries multiple channels of information and
several lines equal to the number of lines out.

Why Multiplexing?

Multiplexing is the sharing of a medium or bandwidth. It is the process in


which multiple signals coming from multiple sources are combined and
transmitted over a single communication/physical line. Multiplexing in
computer networks is done using a device Multiplexer called MUX that
takes ‘n’ input lines to generate a single output line. On the other hand,
there is a device called DEMUX(Demultiplexer) that takes a single input
line and generates ‘n’ output lines.
Multiplexing

The ‘n’ input lines shown above are transmitted via a multiplexer and it
combines the signals to form a composite signal. Now, these signals are
passed through DEMUX and it transfers those signals to their respective
destinations.

Types of Multiplexing in Computer Networks

Multiplexing can be classified as:

• Frequency Division Multiplexing (FDM)

• Time-Division Multiplexing (TDM)

• Wavelength Division Multiplexing (WDM)


Types of Multiplexer

1. Frequency Division Multiplexing (FDM)

The frequency spectrum is divided among the logical channels and each
user has exclusive access to his channel. It sends signals in several distinct
frequency ranges and carries multiple video channels on a single cable.
Each signal is modulated onto a different carrier frequency and carrier
frequencies are separated by guard bands. The bandwidth of the
transmission medium exceeds the required bandwidth of all the signals.
Usually, for frequency division multiplexing analog signaling is used in
order to transmit the signals, i.e. more susceptible to noise. Assignment of
non-overlapping frequency ranges to each user or signal on a medium.
Thus, all signals are transmitted at the same time, each using different
frequencies.
Frequency Division Multiplexing (FDM)

The multiplexer is attached to the high-speed communication line. The


frequency spectrum is divided up among the logical channels where each
user hangs onto a particular frequency. The radio spectrum is an example
of the media and the mechanism for extracting information from the
medium.

Advantages of FDM

• The process is simple and easy to modulate.

• A corresponding multiplexer or de-multiplexer is on the end of the


high-speed line and separates the multiplexed signals.

• For frequency division multiplexing analog signaling is used in


order to transmit the signals.

Disadvantages of FDM

• One problem with FDM is that it cannot utilize the full capacity of
the cable.
• It is important that the frequency bands do not overlap.

• There must be a considerable gap between the frequency bands in


order to ensure that signals from one band do not affect signals in
another band.

2. Time Division Multiplexing (TDM)

Each user periodically gets the entire bandwidth for a small burst of time,
i.e. entire channel is dedicated to one user but only for a short period of
time. It is very extensively used in computer communication and
telecommunication. Sharing of the channel is accomplished by dividing
available transmission time on a medium among users. It exclusively uses
Digital Signaling instead of dividing the cable into frequency bands. TDM
splits cable usage into time slots. The data rate of transmission media
exceeds the data rate of signals. Uses a frame and one slot for each slice
of time and the time slots are transmitted whether the source has data or
not.

Time Division Multiplexing

There are two types of TDMs which are as follows:


1. Synchronous Time Division Multiplexing

2. Statistical Time Division Multiplexing

3. Asynchronous Time Division Multiplexing

4. Interleaving Time Division Multiplexing

Synchronous Time Division Multiplexing: It is synchronous because


the multiplexer and the de-multiplexer have to agree on the time slots. The
original time-division multiplexing. The multiplexer accepts input from
attached devices in a round-robin fashion and transmits the data in a
never-ending pattern. Some common examples of this are T-1 and ISDN
telephone lines. If one device generates data at a faster rate than other
devices, then the multiplexor must either sample the incoming data stream
from that device more often than it samples the other devices or buffers
the faster incoming stream. If a device has nothing to transmit, the
multiplexor must still insert a piece of data from that device into the
multiplexed stream.

Synchronous TDM

Statistical Time Division Multiplexing: It is a time-division but on-


demand rather than fixed, rescheduling links on a per-packet basis and
packets from different sources interleaved on the link. It allows the
connection of more nodes to the circuit than the capacity of the circuit.
Works on the premise that not all the nodes will transmit at full capacity
at all times. It must transmit a terminal identification i.e destination id no.
and may require storage. A statistical multiplexer transmits only the data
from active workstations. If a workstation is not active, no space is wasted
on the multiplexed stream. It accepts the incoming data streams and
creates a frame containing only the data to be transmitted.

Statistical TDM

Asynchronous Time Division Multiplexing: It is a type of multiplexing,


where the rate of sampling is different and also does not require a general
clock, it is called Asynchronous Time Division Multiplexing.
Asynchronous TDMs have generally low bandwidth. In case when there
is nothing to transmit, this type of TDM gives its time slot to other devices.

Interleaving Time Division Multiplexing: Interleaving TDM can be


taken as two switches rotating at high speed, one on the multiplexing and
the other on the demultiplexing surface. These switches can also be
rotated in the reverse direction. At once, when it leaves the surface of
multiplexing and releases at the surface of de-multiplexer, it is called
Interleaving.

3. Wavelength Division Multiplexing(WDM)

It is the same as FDM but applied to fibers, only the difference is that here
the operating frequencies are much higher actually they are in the optical
range. There’s great potential for fibers since the bandwidth is so huge.
Fibers with different energy bands are passed through a diffraction grating
prism. Combined on the long-distance link and then split at the
destination. It has got high reliability and very high capacity.

Wavelength Division Multiplexing(WDM)

It multiplexes multiple data streams onto a single fiber optic line.


Different wavelength lasers(called lambdas) transmit multiple signals.
Each signal carried on the fiber can be transmitted at a different rate from
the other signals.

• Dense wavelength division multiplexing: It combines many (30, 40,


50, or more) channels onto one fiber. DWDM channels have a very
high capacity and it keeps on improving.

• Coarse wavelength division multiplexing: It combines only a few


lambdas. In this, channels are more widely spaced and are a
cheaper version of DWDM.

Some Other Types of Multiplexing


There are some more types of multiplexing that are discussed here.

1. Code Division Multiplexing

It is a type of multiplexing where each code is distributed among different


spectrums so that each one of them can work at the same time
simultaneously. It is also called Code Division Multiple Access (CDMA).
CDMA makes use of spectrum technology along with analog-to-digital
conversion(ADC). It is thus used by various radio communication
technologies. Mainly, it is used for mobile communication.

Advantages of Code Division Multiplexing

• It provides enhanced data communication capabilities.

• It does not compress the bandwidth of other frequencies.

2. Orthogonal Frequency Division Multiplexing

Orthogonal frequency-division multiplexing (OFDM) is a digital


communication technique initially developed for use in cable television
systems. OFDM is similar to the broadcasting technique known as
frequency division multiplexing (also known as FDM), which uses a
multitude of transmitters and receivers to send information on different
frequencies over a single wire, such as an electrical power cable.
OFDM vs FDM

Uses of OFDM

• OFDM is used in Digital radio, Digital Radio Mondiale, digital audio


broadcasting, and satellite radio.

• OFDM is used in Wired data transmission.

3. Space Division Multiplexing

Space Division Multiplexing (SDM) is the combination of Frequency


Division Multiplexing (FDM) and Time Division Multiplexing (TDM). It
basically means that a particular channel is used against a particular
frequency band for some time.
Advantages of Space Division Multiplexing

• It provides a high data transmission rate.

• Some Passive Optical Network (POV) implementations use SDM.

Advantages of Multiplexing

• Multiplexing allows the efficient usage of computer resources.

• Multiplexing is Cost effective

• Frequency Divison Multiplexing allows simultaneous transmission


of multiple signals

• Time Division Multiplexing is used for Fair Resource Allocation that


is each device is allocated a specific time band for their
transmission.

• Code Division Multiplexing is used to increase the security so that


only authorized user can access data.

• Multiplexing also provide scalability.

Disadvantage of Multiplexing

• It increase the complexity of the system

• There is a problem of SPoF(Single Point of Failure) that means if


there is failure in singel point than the entire system become fails.

• This is not fault tolerant.

Unit-6
An internet service provider (ISP) is a company that acts as a
middleman between you and the vast network of the internet. In
simpler terms, it's the company you pay for access to the internet.
ISPs use a variety of technologies to connect you, including cable,
DSL, fiber optics, and even wireless connections.

Introduction of Classful IP Addressing

An IP address is an address having information about how to reach a


specific host, especially outside the LAN. An IP address is a 32-bit unique
address having an address space of 232. Generally, there are two notations
in which the IP address is written, dotted decimal notation and
hexadecimal notation.

Dotted Decimal Notation

Dotted Decimal Notation


Hexadecimal Notation

Some points to be noted about dotted decimal notation:

1. The value of any segment (byte) is between 0 and 255 (both


included).

2. No zeroes are preceding the value in any segment (054 is wrong,


54 is correct).

Classful Addressing

The 32-bit IP address is divided into five sub-classes. These are given
below:

• Class A

• Class B

• Class C

• Class D

• Class E

Each of these classes has a valid range of IP addresses. Classes D and E


are reserved for multicast and experimental purposes respectively. The
order of bits in the first octet determines the classes of the IP address. The
IPv4 address is divided into two parts:
• Network ID

• Host ID

The class of IP address is used to determine the bits used for network ID
and host ID and the number of total networks and hosts possible in that
particular class. Each ISP or network administrator assigns an IP address
to each device that is connected to its network.

Classful Addressing

Note:

1. IP addresses are globally managed by Internet Assigned Numbers


Authority(IANA) and regional Internet registries(RIR).

2. While finding the total number of host IP addresses, 2 IP


addresses are not counted and are therefore, decreased from the
total count because the first IP address of any network is the
network number and whereas the last IP address is reserved for
broadcast IP.
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.

• 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:

• 2^24 – 2 = 16,777,214 host ID

IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255.

Class A

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:

• 2^14 = 16384 network address

• 2^16 – 2 = 65534 host address

IP addresses belonging to class B ranges from 128.0.0.0 –


191.255.255.255.

Class B

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:

• 2^21 = 2097152 network address

• 2^8 – 2 = 254 host address


IP addresses belonging to class C range from 192.0.0.0 –
223.255.255.255.

Class C

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 D

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.254. This class doesn’t have any subnet mask. The higher-
order bits of the first octet of class E are always set to 1111.
Class E

Range of Special IP Addresses


169.254.0.0 – 169.254.0.16 : Link-local
addresses
127.0.0.0 – 127.255.255.255 : Loop-back
addresses
0.0.0.0 – 0.0.0.8: used to communicate within
the current network.

Rules for Assigning Host ID

Host IDs are used to identify a host within a network. The host ID is
assigned based on the following rules:

• Within any network, the host ID must be unique to that network.

• A host ID in which all bits are set to 0 cannot be assigned because


this host ID is used to represent the network ID of the IP address.

• Host ID in which all bits are set to 1 cannot be assigned because


this host ID is reserved as a broadcast address to send packets to
all the hosts present on that particular network.

Rules for Assigning Network ID

Hosts that are located on the same physical network are identified by the
network ID, as all host on the same physical network is assigned the same
network ID. The network ID is assigned based on the following rules:
• The network ID cannot start with 127 because 127 belongs to the
class A address and is reserved for internal loopback functions.

• All bits of network ID set to 1 are reserved for use as an IP


broadcast address and therefore, cannot be used.

• All bits of network ID set to 0 are used to denote a specific host on


the local network and are not routed and therefore, aren’t used.

Summary of Classful Addressing

In the above table No. of networks for class A should be 127. (Network
ID with all 0 s is not considered)

Problems with Classful Addressing

The problem with this classful addressing method is that millions of class
A addresses are wasted, many of the class B addresses are wasted,
whereas, the number of addresses available in class C is so small that it
cannot cater to the needs of organizations. Class D addresses are used for
multicast routing and are therefore available as a single block only. Class
E addresses are reserved.
Since there are these problems, Classful networking was replaced by
Classless Inter-Domain Routing (CIDR) in 1993. We will be discussing
Classless addressing in the next post.

• The network ID is 24 bits long.

• The host ID is 8 bits long.

• 2^21 = 2097152 network address

• 2^8 – 2 = 254 host address

• Within any network, the host ID must be unique to that network.

• Host ID in which all bits are set to 0 cannot be assigned because


this host ID is used to represent the network ID of the IP address.

• Host ID in which all bits are set to 1 cannot be assigned because


this host ID is reserved as a broadcast address to send packets to
all the hosts present on that particular network.

• The network ID cannot start with 127 because 127 belongs to the
class A address and is reserved for internal loopback functions.

• All bits of network ID set to 1 are reserved for use as an IP


broadcast address and therefore, cannot be used.

• All bits of network ID set to 0 are used to denote a specific host on


the local network and are not routed and therefore, aren’t used

What is MAC (Media Access Control) Address?

MAC Addresses are unique 48-bit hardware numbers of a computer that


are embedded into a network card (known as a Network Interface Card)
during manufacturing. The MAC Address is also known as the Physical
Address of a network device. In the IEEE 802 standard, the data link layer
is divided into two sublayers:
1. Logical Link Control (LLC) Sublayer

2. Media Access Control (MAC) Sublayer

The MAC address is used by the Media Access Control (MAC) sublayer
of the Data-Link Layer. MAC Address is worldwide unique since millions
of network devices exist and we need to uniquely identify each.

Format of MAC Address

To understand what is MAC address is, it is very important that first you
understand the format of the MAC Address. So a MAC Address is a 12-
digit hexadecimal number (6-bit binary number), which is mostly
represented by Colon-Hexadecimal notation.

The First 6 digits (say 00:40:96) of the MAC Address identify the
manufacturer, called the OUI (Organizational Unique Identifier). IEEE
Registration Authority Committee assigns these MAC prefixes to its
registered vendors.
Here are some OUI of well-known manufacturers:
CC:46:D6 - Cisco
3C:5A:B4 - Google, Inc.
3C:D9:2B - Hewlett Packard
00:9A:CD - HUAWEI TECHNOLOGIES CO.,LTD

The rightmost six digits represent Network Interface Controller, which


is assigned by the manufacturer.

As discussed above, the MAC address is represented by Colon-


Hexadecimal notation. But this is just a conversion, not mandatory. MAC
address can be represented using any of the following formats:

Note: Colon-Hexadecimal notation is used by Linux OS and Period-


separated Hexadecimal notation is used by Cisco Systems.

Types of MAC Address

1. Unicast: A Unicast-addressed frame is only sent out to the interface


leading to a specific NIC. If the LSB (least significant bit) of the first octet
of an address is set to zero, the frame is meant to reach only one receiving
NIC. The MAC Address of the source machine is always Unicast.
2. Multicast: The multicast address allows the source to send a frame to
a group of devices. In Layer-2 (Ethernet) Multicast address, the LSB (least
significant bit) of the first octet of an address is set to one. IEEE has
allocated the address block 01-80-C2-xx-xx-xx (01-80-C2-00-00-00 to
01-80-C2-FF-FF-FF) for group addresses for use by standard protocols.
3. Broadcast: Similar to Network Layer, Broadcast is also possible on the
underlying layer( Data Link Layer). Ethernet frames with ones in all bits
of the destination address (FF-FF-FF-FF-FF-FF) are referred to as the
broadcast addresses. Frames that are destined with MAC address FF-FF-
FF-FF-FF-FF will reach every computer belonging to that LAN segment.
Reason to Have Both IP and MAC Addresses.

The reason for having both IP and MAC addresses lies in the way the
Internet works, specifically in the structure of the OSI Model. This model
is a conceptual framework that describes how data is sent and received
over a network. It’s divided into seven layers, each performing specific
functions.

• Layer 2 uses MAC addresses and is responsible for packet delivery


from hop to hop.

• Layer 3 uses IP addresses and is responsible for packet delivery


from end to end.

Layer 2 (Data Link Layer) uses a MAC (Media Access Control)


address. These are unique identifiers assigned to network interfaces for
communications at the data link layer. The primary function of MAC
addresses is to manage how data is transported from one network node to
another on a direct, physical basis – this is also referred to as “hop to hop”
delivery.

On the other hand, Layer 3 ( Network Layer ) uses an IP (Internet


Protocol) address. These IP addresses are used to identify devices on a
network and to route traffic between networks. The IP addresses ensure
that the data gets from its original source reaches its final destination and
it is also called “end-to-end” delivery of data.

When a computer sends data, it first wraps it in an IP header, which


includes the source and destination IP addresses. This IP header, along
with the data, is then encapsulated in a MAC header, which includes the
source and destination MAC addresses for the current “hop” in the path.

As the data travels from one router to the next, the MAC address header
is stripped off and a new one is generated for the next hop. However, the
IP header, which was generated by the original computer, remains intact
until it reaches the final destination. This process illustrates how the IP
header manages the “end to end” delivery, while the MAC headers handle
the “hop to hop” delivery.

So, Both IP and MAC addresses are essential for the functioning of the
Internet. While MAC addresses facilitate the direct, physical transfer of
data between network nodes, IP addresses ensure that the data reaches its
final destination.

Why Should the MAC Address Be Unique in the LAN Network?

Consider a LAN (Local Area Network) as a large gathering where


everyone is engaged in conversations. Now, let’s suppose that there are
two individuals at this gathering who coincidentally share the same name.
This scenario would inevitably create confusion, right? If someone calls
out that name, both individuals would respond, making it challenging to
discern the intended recipient of the message.
In a similar manner, within a network, each device possesses a distinct
identifier referred to as a MAC (Media Access Control) address. Think of
it as a unique name assigned to the device. When information is
transmitted across the network, it is directed to a specific MAC address,
much like a letter being addressed to a specific individual.

However, if multiple devices within the same network were to have


identical MAC addresses, it would result in confusion and disrupt the
network’s functioning. The network would struggle to ascertain which
device should receive the transmitted information. To prevent this
confusion and ensure the accurate delivery of information, it is vital for
each device on a network to possess a unique MAC address.

Protocols in Application Layer

The application layer is present at the top of the OSI model. It is the layer
through which users interact. It provides services to the user. Application
layer performs several kinds of functions which are requirement in any
kind of application or communication process.

Application Layer Protocol in Computer Network


1. TELNET

Telnet stands for the TELetype NETwork. It helps in terminal emulation.


It allows Telnet clients to access the resources of the Telnet server. It is
used for managing files on the internet. It is used for the initial setup of
devices like switches. The telnet command is a command that uses the
Telnet protocol to communicate with a remote device or system. Port
number of telnet is 23.

Command
telnet [\\RemoteServer]
\\RemoteServer
: Specifies the name of the server
to which you want to connect
2. FTP

FTP stands for File Transfer Protocol. It is the protocol that actually lets
us transfer files. It can facilitate this between any two machines using it.
But FTP is not just a protocol but it is also a program.FTP promotes
sharing of files via remote computers with reliable and efficient data
transfer. The Port number for FTP is 20 for data and 21 for control.

Command
ftp machinename
3. SMTP

It stands for Simple Mail Transfer Protocol. It is a part of the TCP/IP


protocol. Using a process called “store and forward,” SMTP moves your
email on and across networks. It works closely with something called the
Mail Transfer Agent (MTA) to send your communication to the right
computer and email inbox. The Port number for SMTP is 25.

Command
MAIL FROM:<[email protected]?
4DNS

It stands for Domain Name System. Every time you use a domain name,
therefore, a DNS service must translate the name into the corresponding
IP address. For example, the domain name www.abc.com might translate
to 198.105.232.4.
The Port number for DNS is 53.

Command
ipconfig /flushdns
5. HTTP/HTTPS

HTTP stands for Hypertext Transfer Protocol and HTTPS is the more
secured version of HTTP, that’s why HTTPS stands for Hypertext
Transfer Protocol Secure. This protocol is used to access data from the
World Wide Web. The Hypertext is the well-organized documentation
system that is used to link pages in the text document.

• HTTP is based on the client-server model.


• It uses TCP for establishing connections.
• HTTP is a stateless protocol, which means the server doesn’t
maintain any information about the previous request from the
client.
• HTTP uses port number 80 for establishing the connection.

6. POP

POP stands for Post Office Protocol and the latest version is known as
POP3 (Post Office Protocol version 3). This is a simple protocol used by
User agents for message retrieval from mail servers.

• POP protocol work with Port number 110.


• It uses TCP for establishing connections.

POP works in dual mode- Delete mode, Keep Mode.

In Delete mode, it deletes the message from the mail server once they are
downloaded to the local system.

In Keep mode, it doesn’t delete the message from the mail server and also
facilitates the users to access the mails later from the mail server

. The Internet: In simplest terms, the Internet is a global network


comprised of smaller networks that are interconnected using
standardized communication protocols. The Internet standards
describe a framework known as the Internet protocol suite. This
model divides methods into a layered system of protocols.

The World Wide Web: The Web is the only way to access information
through the Internet. It’s a system of Internet servers that support
specially formatted documents. The documents are formatted in a
markup language called HTML, or “HyperText Markup Language”,
which supports a number of features including links and multimedia.
These documents are interlinked using hypertext links and are accessible
via the Internet.

To link hypertext to the Internet, we need:

1. The markup language, i.e., HTML.


2. The transfer protocol, e.g., HTTP.
3. Uniform Resource Locator (URL), the address of the resource.

URI: URI stands for ‘Uniform Resource Identifier’. A URI can be a


name, locator, or both for an online resource whereas a URL is just the
locator. URLs are a subset of URIs. A URL is a human-readable text
that was designed to replace the numbers (IP addresses) that computers
use to communicate with servers.

A URL consists of a protocol, domain name, and path (which includes


the specific subfolder structure where a page is located) like-

protocol://WebSiteName.topLevelDomain/path

1. Protocol – HTTP or HTTPS.


2. WebSiteName – geeksforgeeks, google etc.
3. topLevelDomain- .com, .edu, .in etc.
4. path- specific folders and/or subfolders that are on a given website.

Html
• An HTML document starts with <!DOCTYPE html> which
declares the document type.
• The main content is wrapped in <html> tags.
• Inside <html> there are two main parts:
o <head>: Contains meta information about the page, like

the title (<title> tag).


o <body>: Contains the visible content of the webpage, like

headings, paragraphs, images, etc.

Elements and Tags:

• HTML uses tags to define different parts of a webpage.


• Tags are written in angle brackets (< and >). They come in pairs,
with an opening tag and a closing tag (e.g., <h1> and </h1>).
• Different tags have different meanings and define how content
should be displayed.

Common Tags:

• Headings: <h1> (largest) to <h6> (smallest) for headings.


• Paragraphs: <p> for paragraphs of text.
• Images: <img> tag with a src attribute specifying the image
source.
• Links: <a> tag with a href attribute defining the link URL and
text content.
• Lists: <ul> for unordered lists and <ol> for ordered lists, with
<li> tags for list items.
• Tables: <table> for tables, with <tr> for table rows and <td>
for table cells.

Attributes:

• Many tags can have attributes that provide additional information.


• For example, the <img> tag can have a width and height
attribute to specify the image size.

Comments:

• Use `` to add comments within the code. Comments are ignored


by the browser but helpful for you or others reading the code.

Learning Resources:

• W3Schools HTML Tutorial: https://www.w3schools.com/html/


• MDN HTML Basics: https://developer.mozilla.org/en-
US/docs/Learn/Getting_started_with_the_web/HTML_basics

Additional Notes:

• HTML is not a programming language, but a markup language.


• HTML works with CSS (Cascading Style Sheets) to define the style
and layout of a webpage.
• There are many more tags and attributes available in HTML.

The main difference between websites and webpages lies in their scope
and structure:

Website:

• A website is like a collection of webpages, similar to a house with


multiple rooms.
• It has a single domain name that identifies the entire site (e.g.,
https://www.amazon.com/).
• Websites can have a variety of purposes, like selling products,
providing information, or creating a community.
• They typically contain several webpages linked together to offer a
comprehensive user experience.
• Building a website often involves more planning and development
compared to a single webpage.

Webpage:

• A webpage is a single document that forms part of a website, like


an individual room in a house.
• It has its own unique URL (Uniform Resource Locator) that
specifies its location within the website (e.g.,
https://www.amazon.com/books).
• A webpage focuses on a specific topic or fulfills a particular
function within the website.
• It can contain text, images, videos, and other elements to deliver
its content.
• Creating a webpage is generally simpler than building an entire
website.

You might also like