Notes of CN
Notes of CN
1
What is a computer network?
A computer network is a group of interconnected nodes or computing devices that exchange data and
resources with each other. A network connection between these devices can be established using
as TCP/IP, Simple Mail Transfer Protocol and Hypertext Transfer Protocol -- are used to exchange
The first example of a computer network was the Advanced Research Projects Agency Network. This
packet-switched network was created in the late 1960s by ARPA, a U.S. Department of Defense
agency.
A computer network can be as small as two laptops connected through an Ethernet cable or as
Devices attached to a computer network use IP addresses that are resolved into
hostnames through a domain name system server to communicate with each other over the
internet and on other computer networks.
Computer Network Architecture is defined as the physical and logical design of the software,
hardware, protocols, and media of the transmission of data. Simply we can say that how computers
are organized and how tasks are allocated to the computer.
o Peer-To-Peer network
o Client/Server network
2
Peer-To-Peer network
o Peer-To-Peer network is a network in which all the computers are linked together with equal
privilege and responsibilities for processing the data.
o Special permissions are assigned to each computer for sharing the resources, but this can lead
to a problem if the computer with the resource is down.
o If one computer stops working but, other computers will not stop working.
o In the case of Peer-To-Peer network, it does not contain the centralized system .
Therefore, it cannot back up the data as the data is different in different locations.
o It has a security issue as the device is managed itself.
Client/Server Network
3
o Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as
Server.
o The central controller is known as a server while all other computers in the network
are called clients.
o A server performs all the major operations such as security and network
management.
o A server is responsible for managing all the resources such as files, directories, printer,
etc.
o All the clients communicate with each other through a server. For example, if client1
wants to send some data to client 2, then it first sends the request to the server for
the permission. The server sends the response to the client 1 to initiate its
communication with the client 2.
4
Disadvantages Of Client/Server network:
o Client/Server network is expensive as it requires the server with large memory.
o A server has a Network Operating System(NOS) to provide the resources to the
clients, but the cost of NOS is very high.
o It requires a dedicated network administrator to manage all the resources.
Computer networks are ideal for the quick exchange of information and the efficient use of resources.
Resource sharing. Enterprises of all sizes can use a computer network to share
resources and critical assets. Resources for sharing can include printers, files, scanners
and photocopy machines. Computer networks are especially beneficial for larger and
globally spread-out organizations, as they can use a single common network to connect
Flexibility. Today's computer networks enable people to use flexible communication and
resource-sharing methods based on their needs and preferences. For example, some
people might use email or instant messaging to communicate, while others might prefer
regardless of their location. For example, video calling and document-sharing apps, such
as Zoom and Google Docs, enable employees to connect and collaborate remotely.
servers. This helps network administrators to better manage and protect their company's
critical data assets. They can perform regular data backups and enforce security
Storage capacity. Most organizations scale over time and have an abundance of data
that needs storage. Computer networks, especially those that employ cloud-based
technologies, can store massive amounts of data and backups on a centralized remote
5
Entertainment. Computer networks, especially the internet, offer various sources of
entertainment, ranging from computer games to streaming music and videos. Multiplayer
games, for example, can only be operated through a local or home-based LAN or a wide
High reliability: high reliability can be achieved by replicating files on two or more
Saving money: network of devices and computers saves a lot of money .example – one
pr inter can be shared with multiple computers, so no need to buy separate printers for
each computer.
A computer network is a group of computers linked to each other that enables the
computer to communicate with another computer and share their resources, data,
and applications.
o Local Area Network is a group of computers connected to each other in a small area
such as building, office.
6
o LAN is used for connecting two or more personal computers through a
communication medium such as twisted pair, coaxial cable, etc.
o It is less costly as it is built with inexpensive hardware such as hubs, network adapters,
and ethernet cables.
o The data is transferred at an extremely faster rate in Local Area Network.
o Local Area Network provides higher security.
7
There are two types of Personal Area Network:
Wired Personal Area Network: Wired Personal Area Network is created by using
the USB.
o Body Area Network: Body Area Network is a network that moves with a person. For
example, a mobile network moves with a person. Suppose a person establishes a
network connection and then creates a connection with another device to share the
information.
o Offline Network: An offline network can be created inside the home, so it is also
known as a home network. A home network is designed to integrate the devices
such as printers, computer, television but they are not connected to the internet.
o Small Home Office: It is used to connect a variety of devices to the internet and to a
corporate network using a VPN
8
o In MAN, various LANs are connected to each other through a telephone exchange
line.
o The most widely used protocols in MAN are RS-232, Frame Relay, ATM, ISDN, OC-3,
ADSL, etc.
o It has a higher range than Local Area Network(LAN).
o A Wide Area Network is a network that extends over a large geographical area such
as states or countries.
o A Wide Area Network is quite bigger network than the LAN.
o A Wide Area Network is not limited to a single location, but it spans over a large
geographical area through a telephone line, fibre optic cable or satellite links.
o The internet is one of the biggest WAN in the world.
o A Wide Area Network is widely used in the field of Business, government, and
education.
9
Examples Of Wide Area Network:
10
o Sharing of software and resources: In WAN network, we can share the software and
other resources like a hard drive, RAM.
o Global business: We can do the business over the internet globally.
o High bandwidth: If we use the leased lines for our company then this gives the high
bandwidth. The high bandwidth increases the data transfer rate which in turn
increases the productivity of our company.
o Security issue: A WAN network has more security issues as compared to LAN and
MAN network as all the technologies are combined together that creates the security
problem.
o Needs Firewall & antivirus software: The data is transferred on the internet which
can be changed or hacked by the hackers, so the firewall needs to be used. Some
people can inject the virus in our system so antivirus is needed to protect from such a
virus.
o High Setup cost: An installation cost of the WAN network is high as it involves the
purchasing of routers, switches.
o Troubleshooting problems: It covers a large area so fixing the problem is difficult.
OSI model
o OSI stands for Open System Interconnection is a reference model that
describes how information from a software application in
one computer moves through a physical medium to the software application
in another computer.
o OSI consists of seven layers, and each layer performs a particular network
function.
o OSI model was developed by the International Organization for
Standardization (ISO) in 1984, and it is now considered as an architectural
model for the inter-computer communications.
o OSI model divides the whole task into seven smaller and manageable tasks.
Each layer is assigned a particular task.
11
o Each layer is self-contained, so that task assigned to each layer can be
performed independently.
o The OSI model is divided into two layers: upper layers and lower layers.
o The upper layer of the OSI model mainly deals with the application related
issues, and they are implemented only in the software. The application layer is
closest to the end user. Both the end user and the application layer interact
with the software applications. An upper layer refers to the layer just above
another layer.
o The lower layer of the OSI model deals with the data transport issues. The
data link layer and the physical layer are implemented in hardware and
software. The physical layer is the lowest layer of the OSI model and is closest
to the physical medium. The physical layer is mainly responsible for placing
the information on the physical medium.
12
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
13
o It defines the transmission of data from one system to another in a computer network
o The main functionality of the physical layer is to transmit the individual bits
from one node to another node.
o It is the lowest layer of the OSI model.
o It consists of various network components such as power plugs, connectors,
receivers, cable types, etc.
o It provides physical medium through which bits are transmitted.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network interface
specifications.
o The physical layer converts the data frame received from the data link layer
into bits
o It provides hardware security.
o Hub, Repeater, Modem, and Cables are Physical Layer devices.
o Network Layer, Data Link Layer, and Physical Layer are also known
as Lower Layers or Hardware Layers.
o
14
o Line Configuration: It defines the way how two or more devices can be
connected physically.( point-to-multipoint, point-to-point, or multipoint line
configurations.)
2) Data-Link Layer
15
o In the OSI model, the data link layer is a 4 th layer from the top and 2 nd layer
from the bottom.
o This is considered the most complex layer of the OSI model as it hides all the underlying
complexities of the hardware from the other above layers
o This layer is responsible for the error-free transfer of data frames.
o It defines the format of the data on the network.
o It provides a reliable and efficient communication between two or more
devices.
o It is mainly responsible for the unique identification of each device that resides
on a local network.
o It contains two sub-layers:
o Logical Link Control Layer
o The main function of the logical link control layer is to act as an interface between
the lower MAC sublayer and the network layer within the OSI model during the data
transfer.
o Logical Link Control (LLC) is a sublayer in the data link layer of the OSI
model. It is responsible for providing a reliable connection between two
devices on a network, ensuring that data is transmitted accurately and without
errors.
o Media Access Control Layer
16
o Media Access Control (MAC) is a protocol in the data link layer of the
OSI model that determines how devices on a network can access the
media (e.g. Ethernet cable) to transmit data
o In a local area network (LAN), each device has a unique MAC address
that is used to identify it on the network. When a device wants to send
data, it checks to see if the media is available to transmit. If the media
is available, the device sends its MAC address and the data to be
transmitted. If the media is not available, the device waits until it
becomes available and then sends the data.
o Framing: The data link layer translates the physical's raw bit stream into
packets known as Frames. The Data link layer adds the header and trailer to
the frame. The header which is added to the frame contains the hardware
destination and source address.
o Reliable delivery: Data Link Layer provides a reliable delivery service, i.e.,
transmits the network layer datagram without any error. A reliable delivery
service is accomplished with transmissions and acknowledgements. A data link
layer mainly provides the reliable delivery service over the links as they have
higher error rates and they can be corrected locally, link at which an error
occurs rather than forcing to retransmit the data.
o Physical Addressing: The Data link layer adds a header to the frame that
contains a destination address. The frame is transmitted to the destination
address mentioned in the header.
o Flow Control: Flow control is the main functionality of the Data-link layer. It is
the technique through which the constant data rate is maintained on both the
sides so that no data get corrupted. It ensures that the transmitting station
such as a server with higher processing speed does not exceed the receiving
station, with lower processing speed.
17
o Error Control: Error control is achieved by adding a calculated value CRC
(Cyclic Redundancy Check) that is placed to the Data link layer's trailer which
is added to the message frame before it is sent to the physical layer. If any
error seems to occurr, then the receiver sends the acknowledgment for the
retransmission of the corrupted frames.
o Access Control: When two or more devices are connected to the same
communication channel, then the data link layer protocols are used to
determine which device has control over the link at a given time.
3) Network Layer
18
o It determines the best path to move data from source to the destination
based on the network conditions, the priority of service, and other factors.
o The Data link layer is responsible for routing and forwarding the packets.
o Routers are the layer 3 devices, they are specified in this layer and used to
provide the routing services within an internetwork.
o The protocols used to route the network traffic are known as Network layer
protocols. Examples of protocols are IP and Ipv6.
4) Transport Layer
19
o The Transport layer is a Layer 4 ensures that messages are transmitted in the
order in which they are sent and there is no duplication of data.
o The main responsibility of the transport layer is to transfer the data
completely.
o It receives the data from the upper layer and converts them into smaller units
known as segments.
o This layer can be termed as an end-to-end layer as it provides a point-to-
point connection between source and destination to deliver the data reliably.
21
3. The transport layer is called as Heart of the OSI model.
4. Device or Protocol Use : TCP, UDP NetBIOS, PPTP
5) Session Layer
o Dialog control: Session layer acts as a dialog controller that creates a dialog
between two processes or we can say that it allows the communication
between two processes which can be either half-duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when transmitting the
data in a sequence. If some error occurs in the middle of the transmission of
data, then the transmission will take place again from the checkpoint. This
process is known as Synchronization and recovery.
6) Presentation Layer
22
o A Presentation layer is mainly concerned with the syntax and semantics of the
information exchanged between the two systems.
o It acts as a data translator for a network.
o This layer is a part of the operating system that converts the data from one
presentation format to another format.
o The Presentation layer is also known as the syntax layer.
7) Application Layer
23
o An application layer serves as a window for users and application processes to
access network service.
o It handles issues such as network transparency, resource allocation, etc.
o An application layer is not an application, but it performs the application layer
functions.
o This layer provides the network services to the end-users.
24
providing end-to-end communication. The TCP/IP model consists of 4 layers,
i.e., the application layer, transport layer, network layer, and data link layer.
Each layer is responsible for a particular task strictly according to the protocols.
As compared to the OSI model, which is a theoretical model, TCP/IP is an
application and practical model.
TCP handles the flow of data and also handles errors in data transmission,
while IP provides a unique address to each device in the network.
25
26
Layers in TCP/IP Model
The TCP/IP model generally consists of four essential layers
1. Application Layer
2. Host-To-Host Layer/Transport Layer
3. Internet Layer/Network Layer
4. Network Access Layer/Link Layer
Since TCP/IP is an implementable model, it can be further classified into a five-layer model
in which the data link layer and the physical layer are separated from the Link layer. It is
done to achieve the client's requirements with efficiency. To understand better, let's have a
look at the diagram given below, which compares four-layer and five-layer TCP/IP Models
with the standard OSI Model.
1. Application Layer
This layer performs the functions of the top three layers of the OSI model, i.e., the
Application, Presentation, and Session Layer. It is responsible for node-to-node
communication and controls user-interface specifications. Its protocols include HTTP, Post
Office Protocol 3, Simple Mail Transfer Protocol, and File Transfer Protocol. At the
application layer, the payload is the actual application data. Some of the protocols of the
application layer are described below.
HTTP:- It stands for Hypertext transfer protocol. This protocol enables us to access data via
the internet. It sends data in plain text, audio, and video formats. It's called a hypertext
transfer protocol because it's efficient enough to use in a hypertext environment where
there are rapid jumps from one document to another.
TELNET:- It establishes a connection between the local and remote computers in such a way
that the local computer seems to be a remote terminal.
SMTP:-The Simple Mail Transfer Protocol (SMTP) is the TCP/IP protocol that handles e-mail.
The data is sent to another e-mail address using this protocol.
FTP:- The FTP (File Transfer Protocol) is a standard internet protocol for transferring data
from one computer to another.
DNS: DNS stands for Domain Name System. An IP address is used to identify the
connection of a host to the internet uniquely. But, people prefer to use the names
instead of addresses. Therefore, the system that maps the name to the address is
known as Domain Name System.
2.Host-to-Host/Transport Layer
This layer is similar to the OSI model's Transport layer. It specifies how much data should be
sent, when, and where at what rate. The message from the application layer is built upon this
layer. This layer ensures that data units are supplied in a timely and error-free manner.
Through error control, flow control, and segmentation or de-segmentation, the transport layer
helps to control the link's reliability. The transport layer also acknowledges the successful
data transmission and sends the next data if no errors occur. The two important protocols
present in this layer are
Transmission Control Protocol (TCP):-It is known for offering error-free and reliable
communication between end systems. It does data segmentation and sequencing. It also
features an acknowledgment feature and uses a flow control method to govern data flow. It
is a very effective protocol, but it has a lot of overhead because of these features. Increased
overhead translates to higher costs. TCP uses three-way handshaking to establish and
acknowledge the connection between the two devices.
User Datagram Protocol (UDP):-On the other side, it doesn't have any of these properties. If
your application does not require dependable transmission, one must use this protocol
because it is relatively cost-effective. UDP is a connectionless protocol, so it does not provide
assurance of data delivery.
28
3.Internet Layer
This layer is also known as the network layer. The Internet layer's primary function is to
send packets from the source or computer to their destination, regardless of their route. The
Internet layer or Network Layer provides a functional and procedural means for sending
variable-length data sequences between nodes across multiple networks. Message delivery at
the Internet layer does not guarantee reliable network layer protocol. The main protocols lie
in the layer are
IP:-The Internet Protocol (IP) is in charge of sending packets from a source host to a
destination host based on the IP addresses in the packet headers. There are two variations of
IP IPv6 and IPv4.
ARP:- Address Resolution Protocol (ARP) is a protocol for resolving conflicts between
computers. Its task is to determine a host's hardware address from an IP address. ARP's
primary function is to convert 32-bit addresses to 48-bit addresses and vice versa. ARP is
necessary because IP addresses in IP version 4 (IPv4) are 32 bits long, but MAC addresses are
48 bits long.
Network access or Link layer specifies the physical transmission of data over the network.
This layer handles data transmission between two adjacent devices on the same network. It
also determines how bits should be optically signaled by hardware devices that interface
directly with a network media such as coaxial, optical, fiber, or twisted-pair cables.The
protocols used by this layer are ethernet, token ring, FDDI, X.25, frame relay.
Highlights:
1. It provides a suite of communication protocols that allows data exchange between two
devices possible or in general we can say that it makes the internet possible.
2. We all are aware of the importance of text communication in today's environment. For text
communication, flow control, and error control are mandatory because the text message's
size is minimal, and it must be delivered with minimal error to the right person. A small
mistake in the text message can change the meaning of the whole message. So TCP/IP model
handles the following operations to ensure the transition between sender and receiver is in
29
order and error-free. Examples of text communication are WhatsApp, Instagram, Google
Chat, and iMessage.
3. Internet banking is possible due to this model because it provides reliability, efficiency, and
security, making it possible for users to use such facilities online.
4. Online gaming and video streaming are also possible because TCP/IP model provides
flexibility in choosing connection-oriented or connectionless transmission. Due to this
flexibility, broadcasting sports and events to a mass audience is possible.
5. TCP/IP provides various functions like DNS, DHCP, Virtual Private Networking, Piggybacking,
Error control, etc. This feature allows end-user to use the internet without fear of losing their
privacy and integrity.
30
NETWORK DEVICES
Network devices are physical devices that allow hardware on a computer network to interact
and communicate with one another. In layman’s terms, we can describe network devices
in computer networks as the devices that connect fax machines, computers, printers,
and other electronic devices to the network.
Advantages of Hub
Disadvantages of Hub
Switch
A switch is a physical circuitry part that controls the flow of signals in
networking (network devices switch). A switch enables you to open or close a
connection. When the switch is opened, a signal or power can pass through the
connection. When the switch is closed, the flow is stopped, and the circuit
connection is broken.
Early computers, such as the Altair, used switches as input. A network switch is
much more advanced than a hub, but it isn’t as advanced as a router and operates
at the Data Link layer (Layer 2) of the OSI model.
31
The top three advantages of the switch network device are:
Increases the available bandwidth of the network.
It helps in reducing the workload on individual host PCs
Increases the performance of the network
The top three disadvantages of the switch network device are:
They are more costly than network bridges.
Broadcast traffic can be problematic.
Network connectivity problems are challenging to track down via the network
switch.
Router
In regards to networking (network devices router), a router is a piece of hardware
that receives, analyses, and forwards incoming packets to another
network. Routers examine incoming packets to determine the correct target IP
address and send the packet to that address.
Routers typically connect LANs and WANs and use a rapidly updating routing table
to make routing decisions for data packets. Edge routers, core routers, virtual
routers, wireless routers, and various other types of routers are available, and
they operate at the Network layer (Layer 3) of the OSI model.
Types of Routers
Wireless Router :
These routers can generate a wireless signal in your home or office, allowing
computers to connect to routers within a specific range and access the internet. When
32
connected indoors, the wireless router's range is approximately 150 feet, when
connected outdoors, the range is up to 300 feet.
Brouter :
A brouter is a hybrid of a bridge and a router. It acts as a bridge, allowing data to be
transferred between networks, and it can also route data within a network to
individual systems, much like a router. As a result, it combines the functions of a
bridge and a router by routing some incoming data to the appropriate systems while
transferring the rest to another network.
Core Router :
A core router is a kind of router that can route data within a network but cannot route
data between networks. It is a computer communication system device that serves as
the backbone of networks by connecting all network devices. It is used by internet
service providers and offers a variety of fast and powerful data communication
interfaces.
Edge Router :
An edge router is a low-capacity device that sits at the network's edge. It enables an
internal network to communicate with external networks. For internet-based
connectivity with distant networks, it uses an external BGP (Border Gateway
Protocol).
Broadband Router :
Broadband routers are primarily used to provide computers with high-speed internet
access. It is required when connecting to the internet via phone and using Voice over
IP technology (VoIP). All broadband routers have three or four Ethernet ports for
connecting laptop and desktop computers.
Bridge
In regards to networking (network devices bridge), a bridge is a device that connects
two LANs or two segments of the same LAN. Networking bridges are also known
as network bridges and bridging. There are two types of bridges: the Transparent
bridge and the Source Routing bridge.
33
Bridges, unlike routers, are protocol independent in that they can forward packets
without analyzing and re-routing messages. Bridging, in a nutshell, connects two
smaller networks to form a more extensive network.
Bridges’ primary function in network architecture is to store and forward frames
between the various segments that the bridge connects. They transfer frames using
hardware Media Access Control (MAC) addresses. Bridges can forward or prevent
data crossing by analyzing the MAC addresses. A bridge operates at the OSI
model’s Data Link layer (Layer 2).
The top three advantages of the bridge network device are:
Reduces collisions
Reduces network traffic with minor segmentation
Connects similar network types with different cabling
The top three disadvantages of the bridge network device are:
Does not filter broadcasts
More expensive compared to repeaters
Slower compare to repeaters due to the filtering process
Gateway
When referring to networking (network devices gateway), a gateway is a networked
device that serves as an entry point into another network. A wireless router, for
example, is frequently used as the default gateway in a home network. In short, a
gateway acts as a messenger agent, taking data from one network, interpreting it,
and transferring it to another. Gateways, also known as protocol converters,
can operate at any OSI model layer.
The top three advantages of the gateway network device are:
Allows to broaden the network
Handles traffic issues effectively
Permits to link two different kinds of networks
The top three disadvantages of the gateway network device are:
Never filter data
Costly and difficult to manage
Protocol conversion is performed, thus resulting in a slower transmission rate.
34
-When a signal is sent, the device converts digital data to an analog audio signal and
sends it over a phone line. Similarly, when an analog signal is received, it is
converted back to a digital signal by the modem. Onboard modems, internal
modems, external modems, and removable modems are all examples of modems. A
modem operates at the OSI model’s physical layer (Layer 1) or Data link layer
(Layer 2), depending on the type.
Simplex − A simplex modem can transfer data in only one direction, from digital
device to network (modulator) or network to digital device (demodulator).
Half duplex − A half-duplex modem has the capacity to transfer data in both the
directions but only one at a time.
Full duplex − A full duplex modem can transmit data in both the directions
simultaneously.
Repeater
With regards to networking (network devices repeater), a repeater is an item that
boosts the strength of a signal so that it can travel longer distances without losing
quality. These devices are commonly used in networks to help data reach further
destinations.
A range extender or wireless repeater, for example, is a repeater that extends the
range and strength of a Wi-Fi signal. A repeater is effective in office buildings,
schools, and factories where a single wireless router cannot reach all areas. A
repeater operates at the OSI model’s physical layer (Layer 1).
The top three advantages of the repeater network device are:
Repeaters are simple to set up and inexpensive.
Repeaters do not necessitate any additional processing.
They can connect signals with various types of cables.
The top three disadvantages of the repeater network device are:
Repeaters are unable to connect disparate networks.
They are unable to distinguish between actual signals and noise.
35
They will not be able to reduce network traffic.
Access Point
In terms of networking, an access point (AP) is a wireless network device that acts
as a portal for devices to connect to a local area network. Access points can extend
an existing network’s wireless coverage and increase the number of users who can
connect. Wireless access points (WAPs) are devices that combine a transmitter and
receiver (transceiver) to form a wireless LAN (WLAN). The access point operates at
the OSI model’s Data Link layer (Layer 2).
The top three advantages of the access point network device are:
Installing is easier and faster.
Allows data transmission even when the user is moving.
It is simple to extend to places where wires and cables are inaccessible.
The top three disadvantages of the access point network device are:
The range of network devices is limited, which causes issues for many users.
Installing this network device is difficult and time-consuming.
Because these network devices are susceptible to interference, fog and radiation
can cause them to malfunction.
36
1. Point to Point
Point to Point is the simplest of all other network topologies. In this topology, two network
nodes (e.g., computers) are directly connected to one another by LAN cables or another type
of data transmission media.
Advantages
Disadvantages
37
The main drawback is that it can only be used in smaller areas where computers are in close
proximity.
Centralized file and folder backups are not possible.
Apart from permissions, there is no security. Users usually do not need to log onto their
workstations.
2. Bus network
All nodes in a bus topology are connected to a central shared cable known as a bus.
Additionally, the bus connects these nodes to the Taps and Drop Lines. Drop Lines are the
connection between the central wire or bus with the nodes. Taps are the 3-way connector that
helps to attach the drop line to the main central cable.
Advantages
Although the cable is less expensive than other topologies, it is only utilized to build small
networks.
It is famous for LAN (Local Area Network) because it is inexpensive and easy to install.
It is frequently used when a network installation is small, simple, or temporary.
Disadvantages
The entire system will crash down if the common cable fails.
Collisions occur in the network when network traffic is high.
The length of cables is always limited.
There could also be security issues because every node in the network can hear what data is
transmitting to the other nodes.
38
3. Star network
In star topology, all the nodes (e.g., computers) are connected to a central hub with point-
to-point communication links. In this case, a point-to-point connection indicates that there is
a cable connecting each node to the main hub. Data transfers between these nodes take place
through the central device. It is most widely used on LAN networks since they are
inexpensive and easy to install.
Advantages
By just checking the specific node that isn't working, it becomes easy to identify the faulty
nodes.
The failure of a single node has no impact on the network as a whole. Therefore, such fault
can be tolerated and addressed later.
Device addition, deletion, and movement are simple under a star topology.
It has fast performance with few nodes and very low network traffic.
Disadvantages
The greatest drawback of star topology is this. The entire network would be down if the
HUB/SWITCH itself experienced a problem.
The number of physical ports offered by HUB/SWITCH limits the nodes linked to the star
topology.
The installation of a star topology is expensive.
39
4. Ring network
There are many nodes in the Ring network, and each node is connected to two of its
neighbor nodes. It is referred to as a ring topology because of its ring-like structure. Every
computer in this topology is connected to every other computer. The last node and the first
node are connected in this topology. This topology uses tokens to pass the information
between the computers. All of the messages in this topology travel in the same direction
through a ring. Advantages
Due to the simplicity of identifying defects in either nodes or cables, it is easier to manage
and install.
In this type of topology, the possibility of collision is minimum.
Only two connections need to be moved to add or remove a device from a ring topology.
Less cabling is required because each node manages the cable to its nearest neighbor.
Disadvantages
5. Mesh network
40
Every node in a mesh topology is connected to as many other nodes as possible. It is done
to prevent network failure in case of any of the one node or cable failure. There are two
different types of mesh topology.
1. Partial Mesh Topology: In a partial mesh topology, all nodes may not be directly
connected to every other node. Still, perhaps most nodes are connected by a point-to-
point connection.
2. Full Mesh Topology: In Full Mesh Topology, every node or device has a direct
point-to-point connection with all the other nodes in the network. Due to the direct
connections between all the other nodes, it almost eliminates the possibility of
41
network failure.
Advantages
There are so many links, so there is minimal or no chance of network failure in the mesh
topology.
Due to each node's separate links, each node can transfer data privately to any other node
within the network.
This topology has no traffic problem because each node has a dedicated link.
Point-to-point connections make the fault identification isolation process easy.
Disadvantages
The cost of cables is high because it requires extra cables compared with other LAN
topologies.
There is a lot of cabling to handle, so mesh topology implementation might be challenging.
More space is required for dedicated links.
42
6. Tree network
In tree topology, all nodes are connected in such a way that they form a structure like a
tree. These node structures are used when a network needs to be divided into a subnetwork.
All nodes in the network tree are forming a tree structure, and Node A is the parent node of
all other nodes in the network, as can be seen by simply looking at the images below. Each
node in a tree topology is connected to the root node to form a hierarchy. Therefore, tree
topology is also referred to as hierarchical topology.
Advantages
Disadvantages
It is possible that all the other nodes will become disconnected if the main central node
experiences a failure.
When more nodes are added, maintaining it becomes difficult.
The topology is highly cabled, which increases the cost.
43
7. Hybrid network
The combination of all the different types of topologies we have seen is known as hybrid
technology. This structure is used in which the nodes can take any form. This means that it
can only be a tree topology, a ring topology, or a star topology. Additionally, it may combine
all the types of network topology we have seen.
Advantages
Disadvantages
44
Logical Network Topology
45
Difference between Connection-Oriented and
Connectionless Service
Both Connection-oriented service and Connection-less service are used for the
connection establishment between two or more two devices. These types of services
are offered by the network layer.
Connection-oriented service is related to the telephone system. It includes
connection establishment and connection termination. In a connection-oriented
service, the Handshake method is used to establish the connection between sender
and receiver.
Connection-less service is related to the postal system. It does not include any
connection establishment and connection termination. Connection-less Service does
not give a guarantee of reliability. In this, Packets do not follow the same path to
reach their destination.
46
between the virtual
sender and the connection or
receiver. path between
the sender
and the
receiver.
47
congestion as it congestion
provides an due to not
end-to-end providing an
connection end-to-end
between sender connection
and receiver between the
during source and
transmission of receiver to
data. transmit of
data packets.
48
Design issues with data link layer are :
1. Services provided to the network layer –
The data link layer act as a service interface to the network layer. The principle
service is transferring data from network layer on sending machine to the network
layer on destination machine. This transfer also takes place via DLL (Data link-
layer).
It provides three types of services:
1. Unacknowlwdged and connectionless services.
2. Acknowledged and connectionless services.
3. Acknowledged and connection-oriented services
Unacknowledged and connectionless services.
Here the sender machine sends the independent frames without any
acknowledgement from the sender.
There is no logical connection established.
Acknowledged and connectionless services.
There is no logical connection between sender and receiver established.
Each frame is acknowledged by the receiver.
If the frame didn’t reach the receiver in a specific time interval it has to be
sent again.
It is very useful in wireless systems.
Acknowledged and connection-oriented services
A logical connection is established between sender and receiver before
data is trimester.
Each frame is numbered so the receiver can ensure all frames have arrived
and exactly once.
2. Frame synchronization –
The source machine sends data in the form of blocks called frames to the destination
machine. The starting and ending of each frame should be identified so that the
frame can be recognized by the destination machine.
3. Flow control –
Flow control is done to prevent the flow of data frame at the receiver end. The
source machine must not send data frames at a rate faster than the capacity of
destination machine to accept them.
4. Error control –
Error control is done to prevent duplication of frames. The errors introduced during
transmission from source to destination machines must be detected and corrected at
the destination machine.
Data Link Layer is responsible for reliable point-to-point data transfer over a physical
medium. To implement this data link layer provides three functions :
Line Discipline:
Line discipline is the functionality used to establish coordination between link systems. It
decides which device sends data and when.(who should send the data ?)
49
Flow Control:
Flow control is an essential function that coordinates the amount of data the sender can
send before waiting for acknowledgment from the receiver.(how much data should be sent?)
Error Control:
Error control is functionality used to detect erroneous transmissions in data frames and
retransmit them. (how can errors be detected and corrected)
Buffers are blocks in the memory that store data until it is processed. If the buffer is
overloaded and there is more incoming data, then the receiver will start losing frames.
The flow control mechanism was devised to avoid this loss and wastage of frames.
Following this mechanism, the receiver, as per its capacity, sends an acknowledgment to send
fewer frames or temporarily halt the transmission until it can receive again.
Thus, flow control is the method of controlling the rate of transmission of data to a value that
the receiver can handle.
50
Stop-and-wait Protocol
Stop-and-wait protocol works under the assumption that the communication channel
is noiseless and transmissions are error-free.
Working:
The sliding window protocol is the flow control protocol for noisy channels that allows the
sender to send multiple frames even before acknowledgments are received. It is called
a Sliding window because the sender slides its window upon receiving the acknowledgments
for the sent frames.
Working:
The sender and receiver have a “window” of frames. A window is a space that consists of
multiple bytes. The size of the window on the receiver side is always 1.
Each frame is sequentially numbered from 0 to n - 1, where n is the window size at the
sender side.
51
The sender sends as many frames as would fit in a window.
After receiving the desired number of frames, the receiver sends an acknowledgment. The
acknowledgment (ACK) includes the number of the next expected frame.
Example:
1. The sender sends the frames 0 and 1 from the first window (because the window size
is 2).
2. The receiver after receiving the sent frames, sends an acknowledgment for frame 2 (as
frame 2 is the next expected frame).
3. The sender then sends frames 2 and 3. Since frame 2 is lost on the way, the receiver
sends back a “NAK” signal (a non-acknowledgment) to inform the sender that
frame 2 has been lost. So, the sender retransmits frame 2.
52
Error detection is the process by which the receiver informs the sender about any erroneous
frame (damaged or lost) sent during transmission.
In the case of stop-and-wait ARQ after the frame is sent, the sender maintains a timeout
counter.
If acknowledgment of the frame comes in time, the sender transmits the next frame in the
queue.
Else, the sender retransmits the frame and starts the timeout counter.
In case the receiver receives a negative acknowledgment, the sender retransmits the frame.
53
Sliding Window ARQ
To deal with the retransmission of lost or damaged frames, a few changes are made to the
sliding window mechanism used in flow control.
Go-Back-N ARQ :
In Go-Back-N ARQ, if the sent frames are suspected or damaged, all the frames are re-
transmitted from the lost packet to the last packet
54
transmitted.
Selective repeat ARQ/ Selective Reject ARQ is a type of Sliding Window ARQ in which
only the suspected or damaged frames are re-
55
transmitted.
56
What is ARP?
ARP stands for Address Resolution Protocol which is a LAN protocol. It is a
process that links the Internet Protocol (IP) address to the media access
control (MAC) address, often known as a fixed physical machine address in a
local area network (LAN).
Types of ARP
They are divided into different types, namely
Proxy ARP
Gratuitous ARP
What is RARP?
A TCP/IP protocol called RARP is in charge of converting physical addresses
(MAC addresses) into IP addresses. For example, Diskless Workstations have
57
only the MAC address but do not have IP addresses. So using the RARP
protocol one can find the IP address via any external source.
1. The ARP protocol obtains the receiver's physical address. In contrast, the RARP
protocol obtains the protocol's logical (IP) address.
2. ARP protocol translates a 32-bit logical (IPv4) address to a receiver's 48-bit
physical address. In contrast, the RARP protocol transfers the receiver's 48-bit
physical address to its 32-bit logical address.
3. ARP protocol is utilized by the router or host to determine the address
(physical address) of another router/host in the LAN network. In contrast, the
RARP protocol is operated by small clients with low resources.
4. The local host manages or handles the ARP protocol table. In contrast, the
RARP server administers or handles the RARP protocol table.
5. ARP protocol is utilized by hosts and routers to determine the other host's
and router's MAC addresses in the network. In contrast, the RARP protocol is
utilized by small users with limited facilities.
6. The ARP protocol reply is mostly utilized to update or modify the ARP table. In
contrast, the RARP protocol reply is primarily utilized to set the local host's IP
address.
7. The client broadcasts its IP address and asks for a MAC address through ARP
protocol, and the server answers with the associated MAC address. In contrast,
58
in the RARP protocol, the client broadcasts its MAC address and asks for an IP
address, and the server answers with the associated IP address.
8. The ARP protocol utilizes the value 1 for requests or asks and the value
2 for answers. In contrast, the RARP protocol utilizes the value
3 for requests or asks and the value 4 for answers.
Full Form The ARP is commonly known as an Address The RARP is commonly known
Resolution Protocol. as a Reverse Address
Resolution Protocol.
Definition The MAC address of the user or server is The client's IP address is
converted to the IP address of the host. mapped from the server's
MAC address.
Table The local host maintains and handles the ARP The RARP server maintains
Maintained table. and handles the RARP table.
Mapping It translates a 32-bit logical (IPv4) address to It maps the receiver's 48-bit
a receiver's 48-bit physical address. physical address to its 32-bit
logical address.
Reply Its reply is mostly utilized to update or modify Its reply is primarily utilized to
Information the ARP table. set the local host's IP address.
59
Values It utilizes the value 1 for requests or asks and It utilizes the value 3 for
the value 2 for answers. requests or asks and the value
4 for answers.
IP address It will help to identify the IP address of several It will assist in identifying the
systems. IP address of the same
system.
60
1. Random Access Protocol: In this, all stations have same superiority that is no
station has more priority than another station. Any station can send data depending
on medium’s state( idle or busy). It has two features:
1. There is no fixed time for sending data
2. There is no fixed sequence of stations sending data
The Random access protocols are further subdivided as:
o Aloha
o CSMA
o CSMA/CD
o CSMA/CA
(a) ALOHA – It was designed for wireless LAN but is also applicable for
shared medium. In this, multiple stations can transmit data at the same
time and can hence lead to collision and data being garbled.
Pure Aloha
61
Pure Aloha:
When a station sends data it waits for an acknowledgement. If the
acknowledgement doesn’t come within the allotted time then the
station waits for a random amount of time called back-off time (Tb)
and re-sends the data. Since different stations wait for different
amount of time, the probability of further collision decreases.
Vulnerable Time = 2* Frame transmission time
Throughput = G exp{-2*G}
Maximum throughput = 0.184 for G=0.5
Slotted Aloha:
The slotted Aloha is designed to overcome the pure Aloha's efficiency because
pure Aloha has a very high possibility of frame hitting. In slotted Aloha, the
shared channel is divided into a fixed time interval called slots. So that, if a station
wants to send a frame to a shared channel, the frame can only be sent at the
beginning of the slot, and only one frame is allowed to be sent to each slot. And if
the stations are unable to send data to the beginning of the slot, the station will
have to wait until the beginning of the slot for the next time. However, the
possibility of a collision remains when trying to send a frame at the beginning of
two or more station time slot.
Vulnerable Time = Frame transmission time
Throughput = G exp{-*G}
Maximum throughput = 0.368 for G=1
62
Key Pure Aloha Slotted Aloha
It is a carrier sense multiple access based on media access protocol to sense the
traffic on a channel (idle or busy) before transmitting the data. It means that if the
channel is idle, the station can send data to the channel. Otherwise, it must wait until
the channel becomes idle. Hence, it reduces the chances of a collision on a
transmission medium.
1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first sense
the shared channel and if the channel is idle, it immediately sends the data. Else it
must wait and keep track of the status of the channel to be idle and broadcast the
frame unconditionally as soon as the channel is idle.
Non-Persistent: It is the access mode of CSMA that defines before transmitting the
data, each node must sense the channel, and if the channel is inactive, it immediately
sends the data. Otherwise, the station must wait for a random time (not
continuously), and when the channel is found to be idle, it transmits the frames.
63
P-Persistent: It is the combination of 1-Persistent and Non-persistent modes. The P-
Persistent mode defines that each node senses the channel, and if the channel is
inactive, it sends a frame with a P probability. If the data is not transmitted, it waits
for a (q = 1-p probability) random time and resumes the frame with the next time
slot.
CSMA/ CD
64
shared channel to terminate data transmission. After that, it waits for a random time
before sending a frame to a channel.
(c)CSMA/ CA
Following are the methods used in the CSMA/ CA to avoid the collision:
Interframe space: In this method, the station waits for the channel to become idle,
and if it gets the channel is idle, it does not immediately send the data. Instead of
this, it waits for some time, and this time period is called the Interframe space or IFS.
However, the IFS time is often used to define the priority of the station.
Contention window: In the Contention window, the total time is divided into
different slots. When the station/ sender is ready to transmit the data frame, it
chooses a random slot number of slots as wait time. If the channel is still busy, it
does not restart the entire process, except that it restarts the timer only to send data
packets when the channel is inactive.
2. Controlled Access:
In this, the data is sent by that station which is approved by all other stations.
3. Channelization:
In this, the available bandwidth of the link is shared in time, frequency and
code to multiple stations to access channel simultaneously.
(b)
65
High-level Data Link Control (HDLC)
Transfer Modes
HDLC supports two types of transfer modes, normal response mode and
asynchronous balanced mode.
Normal Response Mode (NRM) − Here, two types of stations are there, a primary
station that send commands and secondary station that can respond to received
commands. It is used for both point - to - point and multipoint communications.
Asynchronous Balanced Mode (ABM) − Here, the configuration is balanced, i.e. each
station can both send commands and respond to commands. It is used for only point - to -
point communications.
66
HDLC Frame format
HDLC is a bit - oriented protocol where each frame contains up to six fields.
There is a beginning flag field, the address field then, a control field, an information
field, a frame check sequence field(FCS), and an ending field. The structure varies
according to the type of frame. The fields of a HDLC frame are −
Flag − It is an 8-bit sequence that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
Address − It contains the address of the receiver. If the frame is sent by the primary
station, it contains the address(es) of the secondary station(s). If it is sent by the
secondary station, it contains the address of the primary station. The address field may be
from 1 byte to several bytes.
Control − It is 1 or 2 bytes containing flow and error control information.
Payload − This carries the data from the network layer. Its length may vary from one
network to another.
FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard
code used is CRC (cyclic redundancy code)
67
Types of HDLC Frames
There are three types of HDLC frames. The type of frame is determined by
the control field of the frame −
I-frame − I-frames or Information frames carry user data from the network layer. They
also include flow and error control information that is piggybacked on user data. The first
bit of control field of I-frame is 0.
S-frame − S-frames or Supervisory frames do not contain information field. They are
used for flow and error control when piggybacking is not required. The first two bits of
control field of S-frame is 10.
U-frame − U-frames or Un-numbered frames are used for myriad miscellaneous
functions, like link management. It may contain an information field, if required. The first
two bits of control field of U-frame is 11.
3. HDLC is one of the most widely used data link layer protocols
68
4. HDLC is a protocol that is based on bits
5. Error control and flow control are both implemented in this protocol
Both MAC Address and IP Address are used to uniquely identify a machine on
the internet. MAC address is provided by the chip maker while IP Address is
provided by the Internet Service Provider.
Mac Address
Media Access Control (MAC) address is a physical address that works at the
data link layer of the OSI model.
69
A 48-bit MAC address is represented as a string of six octets,
"MM:MM:MM:SS:SS:SS".
The first half (24 bits) of the MAC address contains the ID number of the adapter
manufacturer. These IDs are regulated by an Internet standards organization.
The second half (24 more bits) of the MAC address represents the serial number assigned
to the adapter by the manufacturer.
IP address
An IP address represents a unique address that distinguishes any device on the internet
or any network from another.
An IP address is the identifier that enables your device to send or receive data
packets across the internet. It holds information related to your location and
therefore making devices available for two-way communication.
Need
if someone wants to send you a mail then he/she must have your home address.
Similarly, your computer too needs an address so that other computers on the
internet can communicate with each other without the confusion of delivering
information to someone else’s computer. And that is why each computer in this
world has a unique IP Address.
Types of IP address
There are mainly four types of IP addresses:
Version of IP address
70
Two types of IP addresses are 1)IPV4 and 2) IPV6.
The IPv4 uses a 32-bit address scheme allowing to store 2^32 addresses,
which is more than 4 billion addresses. To date, it is considered the
primary Internet Protocol and carries 94% of Internet traffic.
2.IPv6
This new IP address version is being deployed to fulfill the need for
more Internet addresses. It was aimed to resolve issues which are
associated with IPv4. With 128-bit address space, it allows 340
undecillion unique address space.
there is a problem with the IPv4 address. With IPv4, we can connect only the above
number of 4 billion devices uniquely, and apparently, there are much more devices
in the world to be connected to the internet. So, gradually we are making our way
to IPv6 Address which is a 128-bit IP address. In human-friendly form, IPv6 is
written as a group of 8 hexadecimal numbers separated with colons(:). But in the
computer-friendly form, it can be written as 128 bits of 0s and 1s. Since, a unique
sequence of binary digits is given to computers, smartphones, and other devices to
be connected to the internet. So, via IPv6 a total of (2^128) devices can be assigned
with unique addresses which are actually more than enough for upcoming future
generations.
Classes IPv4 has 5 different classes of IP IPv6 does not contain classes of
address that includes Class A, Class B, IP addresses.
Class C, Class D, and Class E.
Security features In IPv4, security depends on the In IPv6, IPSEC is developed for
application. This IP address is not security purposes.
developed in keeping the security
feature in mind.
Packet flow It does not provide any mechanism It uses flow label field in the
72
identification for packet flow identification. header for the packet flow
identification.
Checksum field The checksum field is available in IPv4. The checksum field is not
available in IPv6.
Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.
A communication
A communication A communication
where a message is
where a message is where a message is
Definition sent from one sender
sent from one sender sent from one sender
to a group of
to one receiver. to all receivers.
receivers
73
amount of network amount of network
Traffic network traffic
traffic traffic
Bandwidth
Moderate High Moderate
usage
1. Unicast:
74
2. Broadcast:
75
Direct Broadcasting: This is useful when a device in one network wants to transfer
packet stream to all the devices over the other network. This is achieved by
translating all the Host ID part bits of the destination address to 1, referred to
as Direct Broadcast Address in the datagram header for information transfer.
This mode is mainly utilized by television networks for video and audio
distribution. One important protocol of this class in Computer Networks is Address
Resolution Protocol (ARP) which is used for resolving an IP address into a physical
address which is necessary for underlying communication.
3. Multicast:
Routing
o A Router is a process of selecting path along which the data can be transferred from
source to the destination. Routing is performed by a special device known as a router.
o A Router works at the network layer in the OSI model and internet layer in TCP/IP
model
o A router is a networking device that forwards the packet based on the information
available in the packet header and forwarding table.
76
o The routing algorithms are used for routing the packets. The routing algorithm is
nothing but a software responsible for deciding the optimal path through which
packet can be transmitted.
o The routing protocols use the metric to determine the best path for the packet
delivery. The metric is the standard of measurement such as hop count, bandwidth,
delay, current load on the path, etc. used by the routing algorithm to determine the
optimal path to the destination.
o The routing algorithm initializes and maintains the routing table for the process of
path determination.
IP Routing:
IP routing is the process that defines the shortest path through which data travels to
reach from source to destination. It determines the shortest path to send the data
from one computer to another computer in the same or different network.
When the data is sent from the source to the destination the TCP and other protocols
of the source work and form an IP packet that is sent to the network. When an IP
packet is sent to the network from the source it has to pass through multiple routers
to reach the destination. The router in the network gets the destination address from
the packet and through its routing table identifies the next router information to
which the data packet has to be passed. The routing table of the router includes
various information about the next router, its cost, and other necessary information.
The router takes the routing decision with the help of routing protocols and a routing
table to which next router the packet has to be sent to find the best route to reach the
destination. Different packets can be sent through different paths but all the packets
reach their intended destination. When the packets reach the destination through
different routers it sends them to the TCP for further processing.
77
Default Routing: In this type of routing the router is configured to send all the data
towards a specific router. This routing is generally used with the stub routers.
Routing Protocols:
For taking routing decisions router needs various routing protocols and a routing
table. The routing protocols are divided into two domains:
1. Interdomain Routing protocols
2. Intradomain Routing protocols
Routing Algorithm
The network layers give a routing protocol, which may be a routing algorithm in
computer networking that decides the best possible and minimum cost pathway
for data communication from the supply to the destination location.
78
Adaptive Routing Algorithms
Adaptive routing algorithms, also known as dynamic routing algorithms,
makes routing decisions dynamically depending on the network conditions. It
constructs the routing table depending upon the network traffic and topology.
They try to compute the optimized route depending upon the hop count,
transit time and distance.
Centralized algorithm − It finds the least-cost path between source and destination
nodes by using global knowledge about the network. So, it is also known as global
routing algorithm.
Isolated algorithm − This algorithm procures the routing information by using local
information instead of gathering information from other nodes.
Distributed algorithm − This is a decentralized algorithm that computes the least-cost
path between source and destination iteratively in a distributed manner.
79
The two types of non – adaptive routing algorithms are −
Flooding − In flooding, when a data packet arrives at a router, it is sent to all the
outgoing links except the one it has arrived on. Flooding may be uncontrolled, controlled
or selective flooding.
Random walks − This is a probabilistic algorithm where a data packet is sent by the
router to any one of its neighbours randomly.
Dijkstra's Algorithm
(least cost routing algo.)
Dijkstra's Algorithm. Dijkstra's Algorithm is a Graph algorithm that finds the shortest
path from a source vertex to all other vertices in the Graph (single source shortest path). It is
a type of Greedy Algorithm that only works on Weighted Graphs having positive weights.
The time complexity of Dijkstra's Algorithm is O(V2) with the help of the adjacency matrix
representation of the graph. This time complexity can be reduced to O((V + E) log V) with
the help of an adjacency list representation of the graph, where V is the number of vertices
and E is the number of edges in the graph.
Step 1: First, we will mark the source node with a current distance of 0 and set the
rest of the nodes to INFINITY.
Step 2: We will then set the unvisited node with the smallest current distance as the
current node, suppose X.
80
Step 3: For each neighbor N of the current node X: We will then add the current
distance of X with the weight of the edge joining X-N. If it is smaller than the current
distance of N, set it as the new current distance of N.
Step 5: We will repeat the process from 'Step 2' if there is any node unvisited left in
the graph.
Let us now understand the implementation of the algorithm with the help of an
example:
1. We will use the above graph as the input, with node A as the source.
2. First, we will mark all the nodes as unvisited.
3. We will set the path to 0 at node A and INFINITY for all the other nodes.
4. We will now mark source node A as visited and access its neighboring nodes.
Note: We have only accessed the neighboring nodes, not visited them.
5. We will now update the path to node B by 4 with the help of relaxation
because the path to node A is 0 and the path from node A to B is 4, and
the minimum((0 + 4), INFINITY) is 4.
6. We will also update the path to node C by 5 with the help of relaxation
because the path to node A is 0 and the path from node A to C is 5, and
the minimum((0 + 5), INFINITY) is 5. Both the neighbors of node A are now
relaxed; therefore, we can move ahead.
7. We will now select the next unvisited node with the least path and visit it.
Hence, we will visit node B and perform relaxation on its unvisited neighbors.
After performing relaxation, the path to node C will remain 5, whereas the
path to node E will become 11, and the path to node D will become 13.
81
8. We will now visit node E and perform relaxation on its neighboring nodes B,
D, and F. Since only node F is unvisited, it will be relaxed. Thus, the path to
node B will remain as it is, i.e., 4, the path to node D will also remain 13, and
the path to node F will become 14 (8 + 6).
9. Now we will visit node D, and only node F will be relaxed. However, the path
to node F will remain unchanged, i.e., 14.
10. Since only node F is remaining, we will visit it but not perform any relaxation
as all its neighboring nodes are already visited.
11. Once all the nodes of the graphs are visited, the program will end.
1. A = 0
2. B = 4 (A -> B)
3. C = 5 (A -> C)
4. D = 4 + 9 = 13 (A -> B -> D)
5. E = 5 + 3 = 8 (A -> C -> E)
6. F = 5 + 3 + 6 = 14 (A -> C -> E -> F
Robotic Path: These days, drones and robots have come into existence, some
operated manually and some automatically. The drones and robots which are
operated automatically and used to deliver the packages to a given location or used
for any certain task are configured with Dijkstra's Algorithm module so that
whenever the source and destination are known, the drone and robot will move in
82
the ordered direction by following the shortest path keeping the time taken to a
minimum in order to deliver the packages
Designate the File Server: Dijkstra's Algorithm is also used to designate a file server in a
Local Area Network (LAN).
starting vertex to all other vertices. Then it iteratively relaxes those estimates by
finding new paths that are shorter than the previously overestimated paths.
By doing this repeatedly for all vertices, we can guarantee that the result is
optimized.
83
84
Step-4 for Bellman Ford's algorithm
85
Network Routing: Bellman-Ford is used in computer networking to find the shortest paths in
routing tables, helping data packets navigate efficiently across networks.
GPS Navigation: GPS devices use Bellman-Ford to calculate the shortest or fastest routes
between locations, aiding navigation apps and devices.
Transportation and Logistics: Bellman-Ford’s algorithm can be applied to determine the
optimal paths for vehicles in transportation and logistics, minimizing fuel consumption and
travel time.
Game Development: Bellman-Ford can be used to model movement and navigation within
virtual worlds in game development, where different paths may have varying costs or obstacles.
Robotics and Autonomous Vehicles: The algorithm aids in path planning for robots or
autonomous vehicles, considering obstacles, terrain, and energy consumption.
Drawback of Bellman Ford’s Algorithm:
Bellman-Ford algorithm will fail if the graph contains any negative edge cycle.
86
Features of TCP
TCP keeps track of the segments being transmitted or received by assigning numbers to every
single one of them.
Flow control limits the rate at which a sender transfers data. This is done to ensure reliable
delivery.
TCP implements an error control mechanism for reliable data transfer.
TCP takes into account the level of congestion in the network.
Advantages of TCP
Disadvantages of TCP
Features of UDP
Used for simple request-response communication when the size of data is less and hence there is
lesser concern about flow and error control.
It is a suitable protocol for multicasting as UDP supports packet switching.
UDP is used for some routing update protocols like RIP(Routing Information Protocol).
87
Normally used for real-time applications which can not tolerate uneven delays between sections
of a received message.
Advantages of UDP
Disadvantages of UDP
We can not have any way to acknowledge the successful transfer of data.
UDP cannot have the mechanism to track the sequence of data.
UDP is connectionless, and due to this, it is unreliable to transfer data.
In case of a Collision, UDP packets are dropped by Routers in comparison to TCP.
UDP can drop packets in case of detection of errors.
Which Protocol is Better: TCP or UDP?
The answer to this question is difficult because it totally depends on what work we are doing and what type
of data is being delivered. UDP is better in the case of online gaming as it allows us to work lag-free. TCP is
better if we are transferring data like photos, videos, etc. because it ensures that data must be correct has to be
sent.
In general, both TCP and UDP are useful in the context of the work assigned by us. Both have advantages
upon the works we are performing, that’s why it is difficult to say, which one is better.
88
Online Video Chats
Differences between TCP and UDP
The main differences between TCP (Transmission Control Protocol) and UDP (User
Datagram Protocol) are:
UDP is the
Datagram-oriented
protocol. This is
because
TCP is a connection-oriented there is no overhead
protocol. Connection for opening a
orientation means that the connection,
communicating devices should maintaining a
Type of Service
establish a connection before connection, or
transmitting data and should terminating a
close the connection after connection. UDP is
transmitting the d ata. efficient for
broadcast and
multicast types of
network
transmission.
No
An acknowledgment segment is
Acknowledgment acknowledgment
present.
segment.
89
Transmission Control User Datagram
Basis Protocol (TCP) Protocol (UDP)
There is no
Sequencing of data is a feature
sequencing of data
of Transmission Control
in UDP. If the order
Sequence Protocol (TCP). this means that is required, it has to
packets arrive in order at the be managed by the
receiver.
application layer.
UDP is faster,
TCP is comparatively slower
Speed simpler, and more
than UDP.
efficient than TCP.
There is no
Retransmission of lost packets retransmission of
Retransmission is possible in TCP, but not in lost packets in the
UDP. User Datagram
Protocol (UDP).
It’s a
Uses handshakes such as SYN, connectionless
Handshaking Techniques
ACK, SYN-ACK protocol i.e. No
handshake
90
Transmission Control User Datagram
Basis Protocol (TCP) Protocol (UDP)
This protocol is
used in situations
where quick
This protocol is primarily
communication is
utilized in situations when a
necessary but
safe and trustworthy
where
Applications communication procedure is
dependability is not
necessary, such as in email, on
a concern, such as
the web surfing, and in military
VoIP, game
services.
streaming, video,
and music
streaming, etc.
Example: Suppose there are two houses, H1 and H2, and a letter has to be sent from H1 to H2. But there is a
river in between those two houses. Now how can we send the letter?
Solution 1: Make a bridge over the river and then it can be delivered.
Solution 2: Get it delivered by a pigeon.
Consider the first solution as TCP. A connection has to be made (bridge) to get the data (letter)
delivered. The data is reliable because it will directly reach another end without loss of data or
error.
The second solution is UDP. No connection is required for sending the data. The process is fast
as compared to TCP, where we need to set up a connection(bridge). But the data is not reliable:
we don’t know whether the pigeon will go in the right direction, will drop the letter on the way,
or some issue is encountered mid-travel.
91
Working of TCP
To make sure that each message reaches its target location intact, the TCP/IP model breaks down the data into
small bundles and afterward reassembles the bundles into the original message on the opposite end. Sending
the information in little bundles of information makes it simpler to maintain efficiency as opposed to sending
everything in one go.
After a particular message is broken down into bundles, these bundles may travel along multiple routes if one
route is jammed but the destination remains the same.
The application layer is the topmost layer of the OSI model and the TCP/IP model.
In TCP/IP model, the application layer is formed by combining the top three layers, i.e., the
application layer, the presentation layer, and the session layer. In the OSI model, the
application layer is the layer closest to the end-user, implying that the application
layer and the end-user can interact directly with the software application.
1. The application layer guarantees that the receiver is recognized, accessible, and
ready to receive data from the sender.
2. It enables authentication between devices for an extra layer of network security.
3. It determines the protocol and data syntax rules at the application level.
4. The protocols of the application layer also define the basic syntax of the message
being forwarded or retrieved.
5. It also checks whether the sender's computer has the necessary communication
interfaces, such as an Ethernet or Wi-Fi interface.
6. Finally, the data on the receiving end is presented to the user application.
1. The Application Layer provides protocols that allow the software to communicate and
receive data and finally present it to users in a meaningful way.
2. This layer allows users to log on as a remote host.
3. The Application Layer provides various facilities for users to forward multiple emails
and a storage facility.
4. This layer acts as a window via which users and application processes can access
network resources.
5. This layer provides services such as email, file transfer, results distribution, directory
services, network resources, etc.
92
6. The application layer communicates with the operating system and guarantees that
data is properly saved.
7. This layer allows users to interact with other software applications.
8. This application layer generally performs host initialization followed by remote login
to hosts.
9. This layer visualizes data, allowing individuals to grasp it rather than memorize it or
see it in binary format (1s or 0s).
The various protocols used in the application layer make the communication between the
sender and receiver faster, efficient, reliable, and safe. These protocols are discussed below.
HTTP
Hypertext transfer protocol enables us to access data via the internet. It sends data in plain
text, audio, and video formats. Client and servers exchange resources over the internet using
the HTTP protocol. Client devices request servers for the resources required to load a web
page, and the servers respond by sending responses to the client.
SMTP
The SMTP (Simple Mail Transfer Protocol) is the TCP/IP protocol that handles email. The
data is sent to another email address using this protocol. SMTP uses a procedure known
as "store and forward" to transmit user emails on and across networks. It works with the
Mail Transfer Agent to ensure that your message is sent to the correct computer and email
mailbox. The port number for SMTP is 25.
TELNET
It's a tool that allows you to save and manage files over the internet. This protocol can be
used to set up equipment for the first time, such as switches. The Telnet protocol is used by
telnet command to communicate with a remote device or system. The port number
for Telnet is 23.
FTP
The FTP (File Transfer Protocol) is a standard internet protocol for transferring data from
one computer to another. FTP uses TCP to transmit data because TCP provides reliability and
error-free data transmission. It facilitates file sharing via remote computer devices while
ensuring dependable and efficient data delivery. For data control, FTP utilizes port 21, and
for data access, it uses port 20.
TFTP
The TFTP (Trivial File Transfer Protocol) is a simple file transfer protocol. The TFTP uses
User Datagram Protocol (UDP) to transmit data from one end to the other. The most common
usage of TFTP is to read and write files/mail to and from a distant server. Compared to File
Transfer Protocol, Trivial File Transfer Protocol is straightforward in design and has
limited functionalities. While transmitting files, TFTP does not provide any authentication or
93
security. As a result, it's commonly used to transfer boot files or configuration information
between workstations in a local setup. Users in a computer network rarely use it due to its
simplistic architecture. It is also unsafe to use the internet due to its lack of security.
The TFTP port number is 69.
NFS
It's known as a NFS (network file system). It enables remote computers to mount file
systems over a network and interact with them as if they were mounted locally. System
administrators can combine resources on the network's centralized servers as a result of this.
Port number for the NFS is 2049.
DNS
DNS stands for (Domain Name System). Similar to how a phone's contacts list matches
names to numbers, the domain name system is a naming database that locates and translates
internet domain names to their unique IP addresses. DNS was created because it is more
difficult for humans to recall numerical numbers than alphabetic names. DNS is used in a
variety of internet activities to swiftly discover an IP address to connect to and access
content.
DHCP
94
o Framing & Link access: Data Link Layer protocols encapsulate each network frame
within a Link layer frame before the transmission across the link. A frame consists of a
data field in which network layer datagram is inserted and a number of data fields. It
specifies the structure of the frame as well as a channel access protocol by which
frame is to be transmitted over the link.
o Reliable delivery: Data Link Layer provides a reliable delivery service, i.e., transmits
the network layer datagram without any error. A reliable delivery service is
accomplished with transmissions and acknowledgements. A data link layer mainly
provides the reliable delivery service over the links as they have higher error rates and
they can be corrected locally, link at which an error occurs rather than forcing to
retransmit the data.
o Flow control: A receiving node can receive the frames at a faster rate than it can
process the frame. Without flow control, the receiver's buffer can overflow, and
frames can get lost. To overcome this problem, the data link layer uses the flow
control to prevent the sending node on one side of the link from overwhelming the
receiving node on another side of the link.
o Error detection: Errors can be introduced by signal attenuation and noise. Data Link
Layer protocol provides a mechanism to detect one or more errors. This is achieved
by adding error detection bits in the frame and then receiving node can perform an
error check.
o Error correction: Error correction is similar to the Error detection, except that
receiving node not only detect the errors but also determine where the errors have
occurred in the frame.
o Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes can transmit the
data at the same time. In a Half-Duplex mode, only one node can transmit the data at
the same time.
95
Link Access Procedure (LAP): LAP protocols are Data Link Layer protocols that are used
to frame and transfer data via point-to-point lines.
Network Control Protocol (NCP): NCP is a mechanism for establishing and configuring
various Network Layer protocols for Point-to-Point Protocol (PPP) connections.
DNS
o DNS stands for Domain Name System.
o DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
o DNS is a service that translates the domain name into IP addresses. This allows the users of
networks to utilize user-friendly names when looking for other hosts instead of remembering
the IP addresses.
o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50, most
people would reach this site by specifying ftp.EduSoft.com. Therefore, the domain name is
more reliable than IP address.
o DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.
Working of DNS
o DNS is a client/server network communication protocol. DNS clients send requests to the.
server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known as a forward DNS
lookups while requests containing an IP address which is converted into a name known as
reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts available on the
internet.
o If a client like a web browser sends a request containing a hostname, then a piece of software
such as DNS resolver sends a request to the DNS server to obtain the IP address of a
hostname. If DNS server does not contain the IP address associated with a hostname, then it
forwards the request to another DNS server. If IP address has arrived at the resolver, which in
turn completes the request over the internet protocol .
o SERVICES
96
o Name Resolution:
o Hostname to IP Address: DNS translates human-friendly domain names (e.g.,
www.example.com) into IP addresses that computers use to locate each other on the
network.
o IP Address to Hostname: DNS can also perform reverse lookups, converting IP
addresses back into domain names.
o Domain Name Distribution:
o DNS distributes domain names across a hierarchical structure of authoritative name
servers. This hierarchy helps in efficient and scalable management of the domain
name space.
o Domain Name Registration:
o DNS facilitates the registration of domain names through accredited registrars. Users
and organizations can register unique domain names for their websites or services.
o Caching:
o DNS servers cache resolved queries to improve efficiency. Cached information reduces
the need to repeatedly query authoritative servers for the same domain name,
thereby speeding up the resolution process.
o Load Balancing:
o DNS can be used for load balancing by distributing traffic across multiple servers or IP
addresses associated with a single domain name. This helps optimize resource
utilization and improve service availability.
o Redirection:
o DNS can be configured to redirect requests for a domain to a different domain or
server. This is often used for load balancing, content delivery networks (CDNs), or
when migrating services to different locations.
o Mail Server Configuration (MX Records):
o DNS includes Mail Exchange (MX) records that specify the mail servers responsible for
receiving emails for a specific domain. This ensures that emails are routed to the
correct mail servers.
o Security (DNS Security Extensions - DNSSEC):
o DNSSEC is a suite of extensions to DNS that adds an additional layer of security by
signing DNS data with cryptographic signatures. This helps prevent various types of
attacks, such as DNS spoofing or man-in-the-middle attacks.
o Dynamic Host Configuration Protocol (DHCP) Integration:
o DNS can work in conjunction with DHCP to automatically assign and update IP
addresses for devices on a network. This integration is particularly useful in dynamic
network environments.
o Global Distribution:
o DNS operates globally, providing a decentralized and distributed system. This ensures
redundancy and fault tolerance, improving the overall reliability of the Internet.
IEEE
IEEE standards in computer networks are a set of guidelines and protocols developed
by the Institute of Electrical and Electronics Engineers (IEEE) to ensure compatibility
97
and interoperability in networking technologies. These standards help different
devices and systems communicate with each other effectively.
The IEEE 802 family of standards specifically deals with local area networks (LANs)
and metropolitan area networks (MANs). Each substandard within the 802 family
focuses on a specific aspect of network communication. Let's break down some key
standards in simple language:
98
1. IEEE 802.1 - Network Architecture and Management:
Key Aspects: It deals with things like how devices find and recognize
each other on a network, how data traffic is managed, and how
potential issues are addressed. It's like the supervisor that ensures
everyone is doing their job correctly and the network is running
smoothly.
2. IEEE 802.2 - Logical Link Control:
Key Aspects: This standard governs how devices communicate over a
network. It ensures that data is formatted properly into frames before
being sent and manages the flow of these frames between devices.
Think of it as the language interpreter that makes sure everyone speaks
the same network language.
3. IEEE 802.3 - Ethernet:
Key Aspects: Ethernet is the most widely used standard for wired local
area networks (LANs). It specifies how data is packaged into frames,
how devices on the network access the communication medium (like a
cable), and how collisions are handled. It's the rulebook for talking over
wires.
4. IEEE 802.4 - Token Bus:
Key Aspects: Token Bus networks use a token-passing method, where
devices take turns sending data. This standard defines how devices gain
access to the token, pass it along, and communicate in an orderly
fashion. It's like a scheduled talking system to prevent chaos.
5. IEEE 802.5 - Token Ring:
Key Aspects: Similar to Token Bus, but here devices are arranged in a
physical ring. The token circulates, and only the device holding the
token can send data. It's like a speaking order in a roundtable
discussion, ensuring fair communication in a ring-shaped network.
6. IEEE 802.11 - Wireless LAN (Wi-Fi):
Key Aspects: Wi-Fi is all about wireless communication. It defines how
devices communicate over the airwaves, addressing issues like signal
strength, interference, and security. It's like the conductor orchestrating
a symphony of wireless devices, making sure everyone plays in
harmony.
99
FDDI stands for Fiber Distributed Data Interface. It is a set of ANSI and ISO
guidelines for information transmission on fiber-optic lines in Local Area Network
(LAN) that can expand in run upto 200 km (124 miles). The FDDI convention is
based on the token ring protocol.
100