0% found this document useful (0 votes)
17 views25 pages

CN Unit 3 CN Unit 3

Uploaded by

aradhya mittal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views25 pages

CN Unit 3 CN Unit 3

Uploaded by

aradhya mittal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

lOMoARcPSD|29317061

CN UNIT-3 - CN UNIT 3

Computer Networks (Dr. A.P.J. Abdul Kalam Technical University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)
lOMoARcPSD|29317061

Computer Networks(CN)
Unit – 3
Network Layer

3.1 Point-to-point networks


Point - to - Point Protocol (PPP) is a communication protocol of the data link layer that is used to
transmit multiprotocol data between two directly connected (point-to-point) computers. It is a
byte - oriented protocol that is widely used in broadband communications having heavy loads
and high speeds. Since it is a data link layer protocol, data is transmitted in frames. It is also
known as RFC 1661.

The main services provided by Point - to - Point Protocol are

● Defining the frame format of the data to be transmitted.


● Defining the procedure of establishing link between two points and exchange of data
● Stating the method of encapsulation of network layer data in the frame.
● Stating authentication rules of the communicating devices
● Providing addresses for network communication.
● Providing connections over multiple links
● Supporting a variety of network layer protocols by providing a range of services

Fig 1: point to point connection

Point - to - Point Protocol is a layered protocol having three components −

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Encapsulation Component − It encapsulates the datagram so that it can be transmitted over


the specified physical layer.

Link Control Protocol (LCP) − It is responsible for establishing, configuring, testing,


maintaining and terminating links for transmission. It also imparts negotiation for set up of
options and use of features by the two endpoints of the links.

Authentication Protocols (AP) − These protocols authenticate endpoints for use of services.
The two authentication protocols of PPP are

Password Authentication Protocol (PAP)


Challenge Handshake Authentication Protocol (CHAP)

Network Control Protocols (NCPs) − These protocols are used for negotiating the parameters
and facilities for the network layer. For every higher-layer protocol supported by PPP, one NCP
is there.

Key takeaway:
A private data links securely linking two or more locations for private data services is known as a
point-to-point connection.
Point - to - Point Protocol is a communication protocol of the data link layer that is used to
transmit multiprotocol data between two directly connected computers.

3.2 Logical addressing

What is IP?
An IP stands for internet protocol. An IP address is assigned to each device connected to a
network. Each device uses an IP address for communication. It also behaves as an identifier as
this address is used to identify the device on a network. It defines the technical format of the
packets. Mainly, both the networks, i.e., IP and TCP, are combined together, so together, they
are referred to as TCP/IP. It creates a virtual connection between the source and the
destination.

We can also define an IP address as a numeric address assigned to each device on a network.
An IP address is assigned to each device so that the device on a network can be identified
uniquely. To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address
known as IPv4(Internet Protocol version 4).

IPv4 on its own does not provide any security feature which is vulnerable as data on the
Internet, which is a public domain, is never safe. Data has to be encrypted with some other
security application before being sent on the Internet. Data prioritization in IPv4 is not up to
date. Though IPv4 has few bits reserved for Type of Service or Quality of Service, they do not
provide much functionality.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

IPv4 enabled clients can be configured manually or they need some address configuration
mechanism. There exists no technique which can configure a device to have globally unique IP
addresses.

An IP address consists of two parts, i.e., the first one is a network address, and the other one is
a host address.

There are two types of IP addresses:


● IPv4
● IPv6

What is IPv4?
IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a
32-bit address written in four numbers separated by 'dot', i.e., periods. This address is unique
for each device.

For example, 66.94.29.13

The above example represents the IP address in which each group of numbers separated by
periods is called an Octet. Each number in an octet is in the range from 0-255. This address can
produce 4,294,967,296 possible unique addresses.
In today's computer network world, computers do not understand the IP addresses in the
standard numeric format as the computers understand the numbers in binary form only. The
binary number can be either 1 or 0. The IPv4 consists of four sets, and these sets represent the
octet. The bits in each octet represent a number.
Each bit in an octet can be either 1 or 0. If the bit is 1, then the number it represents will count,
and if the bit is 0, then the number it represents does not count.

Representation of 8 Bit Octet

Fig 2: structure of 8-bit octet

The above representation shows the structure of 8- bit octet.


Now, we will see how to obtain the binary representation of the above IP address, i.e.,
66.94.29.13

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Step 1: First, we find the binary number of 66

To obtain 66, we put 1 under 64 and 2 as the sum of 64 and 2 is equal to 66 (64+2=66), and the
remaining bits will be zero, as shown above. Therefore, the binary bit version of 66 is 01000010.

Step 2: Now, we calculate the binary number of 94


To obtain 94, we put 1 under 64, 16, 8, 4, and 2 as the sum of these numbers is equal to 94,
and the remaining bits will be zero. Therefore, the binary bit version of 94 is 01011110.

Step 3: The next number is 29


To obtain 29, we put 1 under 16, 8, 4, and 1 as the sum of these numbers is equal to 29, and
the remaining bits will be zero. Therefore, the binary bit version of 29 is 00011101.

Step 4: The last number is 13


To obtain 13, we put 1 under 8, 4, and 1 as the sum of these numbers is equal to 13, and the
remaining bits will be zero. Therefore, the binary bit version of 13 is 00001101.

Drawback of IPv4
Currently, the population of the world is 7.6 billion. Every user is having more than one device
connected with the internet, and private companies also rely on the internet. As we know that
IPv4 produces 4 billion addresses, which is not enough for each device connected to the
internet on a planet.
Although various techniques were invented, such as variable- length mask, network address
translation, port address translation, classes, inter-domain translation, to conserve the
bandwidth of IP address and slow down the depletion of an IP address. In these techniques,
public IP is converted into a private IP due to which the user having public IP can also use the
internet. But still, this was not so efficient, so it gave rise to the development of the next
generation of IP addresses, i.e., IPv6.

Key takeaways:
● An IP stands for internet protocol. An IP address is assigned to each device connected
to a network.
● Each device uses an IP address for communication.
● It also behaves as an identifier as this address is used to identify the device on a
network.
● It creates a virtual connection between the source and the destination.
● We can also define an IP address as a numeric address assigned to each device on a
network.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

● An IP address is assigned to each device so that the device on a network can be


identified uniquely.
● An IP address consists of two parts, i.e. The first one is a network address, and the other
one is a host address.

3.3 Basic internetworking (IP, CIDR, ARP, RARP, DHCP, ICMP)

IP
An IP stands for internet protocol. An IP address is assigned to each device connected to a
network. Each device uses an IP address for communication. It also behaves as an identifier as
this address is used to identify the device on a network. It defines the technical format of the
packets. Mainly, both the networks, i.e., IP and TCP, are combined together, so together, they
are referred to as TCP/IP. It creates a virtual connection between the source and the
destination.
We can also define an IP address as a numeric address assigned to each device on a network.
An IP address is assigned to each device so that the device on a network can be identified
uniquely. To facilitate the routing of packets, TCP/IP protocol uses a 32-bit logical address
known as IPv4(Internet Protocol version 4).

Function:
The internet protocol's main purpose is to provide hosts with addresses, encapsulate data into
packet structures, and route data from source to destination through one or more IP networks.
The internet protocol provides two main items in order to achieve these functionalities, which
are mentioned below.
● Format of IP packet
● IP Addressing system

IP packet
Until an IP packet is sent over the network, it contains two main components: a header and a
payload.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Fig 3: IP packet

An IP header provides a lot of details about the IP packet, such as:

● The source IP address is that of the person who is sending the data.
● IP address of the destination: The destination is a host that collects data from the
sender.
● Header length
● Packet length
● TTL (Time to Live) of a packet is the amount of hops that must occur before the packet is
discarded.
● The internet protocol's transport protocol, which can be TCP or UDP, is known as the
transport protocol.

The IP header contains a total of 14 fields, one of which is optional.

The data to be transported is known as the payload.

CIDR
CIDR stands for Classless Inter-Domain Routing, and it is an IP addressing scheme that
enhances IP address allocation. It replaces the old scheme of A, B, and C classes. This scheme
also aided in extending the life of IPv4 and reducing the size of routing tables.

CIDR IP addresses are made up of two groups of numbers, also known as groups of bits. The
network address is the most significant of these types, since it is used to define a network or a
sub-network (subnet). The host identifier is the smallest of the bit classes. The host identifier is
used to identify which network host or computer should accept incoming data packets.

A new paradigm of Classless Inter-Domain Routing has been implemented to minimize IP


address waste. This technique is now used by IANA to provide IP addresses. When a user
requests IP addresses, IANA will allocate the number of IP addresses to the user.

Representation: It's also a 32-bit address with a special number indicating the number of bits in
the Block Id.
a. b. c. d / n

Where n is the number of bits in the Block Id / Network Id.

Example:
If you need to quickly figure out what IP range a given CIDR address corresponds to, the CIDR
Calculation tool comes in handy. Simply type in the CIDR address and hit the Calculate button.
The first IP, last IP, number of hosts, and other details will be returned.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Fig 4: example

Address Resolution Protocol (ARP)


Address Resolution Protocol (ARP) is a communication protocol used to find the MAC (Media
Access Control) address of a device from its IP address. This protocol is used when a device
wants to communicate with another device on a Local Area Network or Ethernet.

Types of ARP
There are four types of Address Resolution Protocol, which is given below:
● Proxy ARP
● Gratuitous ARP
● Reverse ARP (RARP)
● Inverse ARP

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Fig 5: ARP

Proxy ARP - Proxy ARP is a method through which a Layer 3 device may respond to ARP
requests for a target that is in a different network from the sender. The Proxy ARP configured
router responds to the ARP and maps the MAC address of the router with the target IP address
and fools the sender that it has reached its destination.

At the backend, the proxy router sends its packets to the appropriate destination because the
packets contain the necessary information.

Example - If Host A wants to transmit data to Host B, which is on the different network, then
Host A sends an ARP request message to receive a MAC address for Host B. The router
responds to Host A with its own MAC address pretending itself as a destination. When the data
is transmitted to the destination by Host A, it will send to the gateway so that it sends to Host B.
This is known as proxy ARP.

Gratuitous ARP - Gratuitous ARP is an ARP request of the host that helps to identify the
duplicate IP address. It is a broadcast request for the IP address of the router. If an ARP request
is sent by a switch or router to get its IP address and no ARP responses are received, so all
other nodes cannot use the IP address allocated to that switch or router. Yet if a router or switch
sends an ARP request for its IP address and receives an ARP response, another node uses the
IP address allocated to the switch or router.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

There are some primary use cases of gratuitous ARP that are given below:
● The gratuitous ARP is used to update the ARP table of other devices.
● It also checks whether the host is using the original IP address or a duplicate one.

Reverse ARP (RARP)


It is a networking protocol used by the client system in a local area network (LAN) to request its
IPv4 address from the ARP gateway router table. A table is created by the network
administrator in the gateway-router that is used to find out the MAC address to the
corresponding IP address.

When a new system is set up or any machine that has no memory to store the IP address, then
the user has to find the IP address of the device. The device sends a RARP broadcast packet,
including its own MAC address in the address field of both the sender and the receiver
hardware. A host installed inside of the local network called the RARP-server is prepared to
respond to such a type of broadcast packet. The RARP server is then trying to locate a mapping
table entry in the IP to MAC address. If any entry matches the item in the table, then the RARP
server sends the response packet along with the IP address to the requesting computer.

Fig 6: RARP

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Inverse ARP (In ARP) - Inverse ARP is inverse of the ARP, and it is used to find the IP
addresses of the nodes from the data link layer addresses. These are mainly used for the frame
relays, and ATM networks, where Layer 2 virtual circuit addressing are often acquired from
Layer 2 signaling. When using these virtual circuits, the relevant Layer 3 addresses are
available.
ARP conversions Layer 3 addresses to Layer 2 addresses. However, its opposite address can
be defined by In ARP. The In ARP has a similar packet format as ARP, but operational codes
are different.

Dynamic Host Configuration Protocol (DHCP)


Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to
dynamically assign an IP address to any device, or node, on a network so they can
communicate using IP (Internet Protocol). DHCP automates and centrally manages these
configurations. There is no need to manually assign IP addresses to new devices. Therefore,
there is no requirement for any user configuration to connect to a DHCP based network.

DHCP can be implemented on local networks as well as large enterprise networks. DHCP is the
default protocol used by most routers and networking equipment. DHCP is also called RFC
(Request for comments) 2131.

DHCP does the following:


● DHCP manages the provision of all the nodes or devices added or dropped from the
network.
● DHCP maintains the unique IP address of the host using a DHCP server.
● It sends a request to the DHCP server whenever a client/node/device, which is
configured to work with DHCP, connects to a network. The server acknowledges by
providing an IP address to the client/node/device.

DHCP is also used to configure the proper subnet mask, default gateway and DNS server
information on the node or device.

There are many versions of DHCP available for use in IPV4 (Internet Protocol Version 4) and
IPV6 (Internet Protocol Version 6).

How DHCP works


DHCP runs at the application layer of the TCP/IP protocol stack to dynamically assign IP
addresses to DHCP clients/nodes and to allocate TCP/IP configuration information to the DHCP
clients. Information includes subnet mask information, default gateway, IP addresses and
domain name system addresses.

DHCP is based on client-server protocol in which servers manage a pool of unique IP


addresses, as well as information about client configuration parameters, and assign addresses
out of those address pools.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

The DHCP lease process works as follows:


● First of all, a client (network device) must be connected to the internet.
● DHCP clients request an IP address. Typically, clients broadcast a query for this
information.
● DHCP server responds to the client request by providing IP server address and other
configuration information. This configuration information also includes a time period,
called a lease, for which the allocation is valid.
● When refreshing an assignment, a DHCP client requests the same parameters, but the
DHCP server may assign a new IP address. This is based on the policies set by the
administrator.

Components of DHCP
When working with DHCP, it is important to understand all of the components. Following is the
list of components:

● DHCP Server: DHCP server is a networked device running the DCHP service that holds
IP addresses and related configuration information. This is typically a server or a router
but could be anything that acts as a host, such as an SD-WAN appliance.
● DHCP client: DHCP client is the endpoint that receives configuration information from a
DHCP server. This can be any device like computer, laptop, IoT endpoint or anything
else that requires connectivity to the network. Most of the devices are configured to
receive DHCP information by default.
● IP address pool: IP address pool is the range of addresses that are available to DHCP
clients. IP addresses are typically handed out sequentially from lowest to the highest.
● Subnet: Subnet is the partitioned segment of the IP networks. Subnet is used to keep
networks manageable.
● Lease: Lease is the length of time for which a DHCP client holds the IP address
information. When a lease expires, the client has to renew it.
● DHCP relay: A host or router that listens for client messages being broadcast on that
network and then forwards them to a configured server. The server then sends
responses back to the relay agent that passes them along to the client. DHCP relay can
be used to centralize DHCP servers instead of having a server on each subnet.

Benefits of DHCP
There are following benefits of DHCP:

● Centralized administration of IP configuration: DHCP IP configuration information can be


stored in a single location and enables that administrator to centrally manage all IP
address configuration information.
● Dynamic host configuration: DHCP automates the host configuration process and
eliminates the need to manually configure individual hosts. When TCP/IP (Transmission
control protocol/Internet protocol) is first deployed or when IP infrastructure changes are
required.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

● Seamless IP host configuration: The use of DHCP ensures that DHCP clients get
accurate and timely IP configuration IP configuration parameters such as IP address,
subnet mask, default gateway, IP address of DND server and so on without user
intervention.
● Flexibility and scalability: Using DHCP gives the administrator increased flexibility,
allowing the administrator to easily change IP configuration when the infrastructure
changes.

ICMP
The ICMP stands for Internet Control Message Protocol. The ICMP protocol is a network layer
protocol that hosts and routers use to notify the sender of IP datagram problems. The echo
test/reply method is used by ICMP to determine if the destination is reachable and responding.

ICMP can handle both control and error messages, but its primary purpose is to record errors
rather than to fix them. An IP datagram includes the source and destination addresses, but it
does not know the address of the previous router it passed through.

As a result, ICMP can only send messages to the source, not to the routers in the immediate
vicinity. The sender receives error messages via the ICMP protocol. The errors are returned to
the user processes via ICMP messages.
ICMP messages are sent as part of an IP datagram.

Fig 7: ICMP

Format of ICMP

Fig 8: ICMP format

● The message's form is defined in the first sector.


● The reason for a particular message form is specified in the second sector.
● The checksum field is used to verify the integrity of the entire ICMP message.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Key takeaways:
● Address Resolution Protocol (ARP) is a communication protocol used to find the MAC
(Media Access Control) address of a device from its IP address.
● This protocol is used when a device wants to communicate with another device on a
Local Area Network or Ethernet.
● An IP address is assigned to each device connected to a network.
● CIDR IP addresses are made up of two groups of numbers, also known as groups of
bits.
● It is a networking protocol used by the client system in a local area network (LAN) to
request its IPv4 address from the ARP gateway router table.
● DHCP automates and centrally manages these configurations.

3.4 Routing

A Router is a process of selecting a path along which the data can be transferred from source to
the destination. Routing is performed by a special device known as a router. A Router works at
the network layer in the OSI model and internet layer in TCP/IP model A router is a networking
device that forwards the packet based on the information available in the packet header and
forwarding table.
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 packets can be transmitted.
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. The
routing algorithm initializes and maintains the routing table for the process of path
determination.

Routing Metrics and Costs


Routing metrics and costs are used for determining the best route to the destination. The factors
used by the protocols to determine the shortest path, these factors are known as a metric.
Metrics are the network variables used to determine the best route to the destination. For some
protocols the static metrics means that their value cannot be changed and for some other
routing protocols the dynamic metrics means that their value can be assigned by the system
administrator.

The most common metric values are given below:

Hop count: Hop count is defined as a metric that specifies the number of passes through
internetworking devices such as a router, a packet must travel in a route to move from source to
the destination. If the routing protocol considers the hop as a primary metric value, then the path
with the least hop count will be considered as the best path to move from source to the
destination.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Delay: It is a time taken by the router to process, queue and transmit a datagram to an
interface. The protocols use this metric to determine the delay values for all the links along the
path end-to-end. The path having the lowest delay value will be considered as the best path.

Bandwidth: The capacity of the link is known as the bandwidth of the link. The bandwidth is
measured in terms of bits per second. The link that has a higher transfer rate like gigabit is
preferred over the link that has the lower capacity like 56 kb. The protocol will determine the
bandwidth capacity for all the links along the path, and the overall higher bandwidth will be
considered as the best route.

Load: Load refers to the degree to which the network resource such as a router or network link
is busy. A Load can be calculated in a variety of ways such as CPU utilization, packets
processed per second. If the traffic increases, then the load value will also be increased. The
load value changes with respect to the change in the traffic.

Reliability: Reliability is a metric factor that may be composed of a fixed value. It depends on
the network links, and its value is measured dynamically. Some networks go down more often
than others. After network failure, some network links are repaired more easily than other
network links. Any reliability factor can be considered for the assignment of reliability ratings,
which are generally numeric values assigned by the system administrator.

Types of Routing
Routing can be classified into three categories:
● Static Routing
● Default Routing
● Dynamic Routing

Default Routing
Default Routing is a technique in which a router is configured to send all the packets to the
same hop device, and it doesn't matter whether it belongs to a particular network or not. A
Packet is transmitted to the device for which it is configured in default routing. Default Routing is
used when networks deal with the single exit point. It is also useful when the bulk of
transmission networks have to transmit the data to the same hp device. When a specific route is
mentioned in the routing table, the router will choose the specific route rather than the default
route. The default route is chosen only when a specific route is not mentioned in the routing
table.

Key takeaway:
● A Router is a process of selecting a path along which the data can be transferred from
source to the destination.
● Routing is performed by a special device known as a router.
● Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or
not.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

3.5 Forwarding and delivery

● The term "forwarding" refers to the process of placing a packet on its way to its intended
destination.
1. Since the Internet today is made up of a series of connections, forwarding refers
to the process of delivering a packet to the next hop.

● Despite the fact that the IP protocol was built to be a connectionless protocol, the trend
today is to use IP as a connection-oriented protocol based on the label attached to an IP
datagram.
● Based on the destination address, forwarding is performed.
1. Next-hop
2. Network- Specific Method
3. Host-Specific Method
4. Default Method
● Label-based forwarding.

Delivery
The network layer is in charge of overseeing how packets are handled by the physical networks
under it. This is referred to as "packet distribution."

A packet may be sent to its final destination in one of two ways: direct or indirect.

Direct Delivery
● The packet's final destination is a host on the same physical network as the deliverer.
● The packet's source and destination are on the same physical network, and the packet is
sent between the last router and the destination host.
● Extract the destination's network address and link it to the addresses of the networks to
which it is connected.
○ If a match is found, the message is sent directly.
● The sender looks up the destination physical address using the destination IP address

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Fig 9: direct delivery

Indirect Delivery
● The distribution is not on the same network as the destination host.
● The packet is passed from one router to the next before it enters a router that is
connected to the same physical network.
● To find the IP address of the next router, the sender uses the destination IP address and
a routing table.

Fig 10: indirect delivery

Key takeaway:
● The term "forwarding" refers to the process of placing a packet on its way to its intended
destination.
● The network layer is in charge of overseeing how packets are handled by the physical
networks under it.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

● A packet may be sent to its final destination in one of two ways: direct or indirect.

3.6 Static and dynamic routing

Static Routing
Static Routing is also known as Non-Adaptive Routing. It is a technique in which the
administrator manually adds the routes in a routing table. A Router can send the packets for the
destination along the route defined by the administrator. In this technique, routing decisions are
not made based on the condition or topology of the network.

Advantages of Static Routing


● No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the
cheaper router can be used to obtain static routing.
● Bandwidth: It has no bandwidth usage between the routers.
● Security: It provides security as the system administrator is allowed only to have control
over the routing to a particular network.
Disadvantages of Static Routing:
● For a large network, it becomes a very difficult task to add each route manually to the
routing table. The system administrator should have a good knowledge of a topology as
he has to add each route manually.

Dynamic Routing
It is also known as Adaptive Routing. It is a technique in which a router adds a new route in the
routing table for each packet in response to the changes in the condition or topology of the
network. Dynamic protocols are used to discover the new routes to reach the destination. In
Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes. If any route
goes down, then the automatic adjustment will be made to reach the destination. The Dynamic
protocol should have the following features: All the routers must have the same dynamic routing
protocol in order to exchange the routes. If the router discovers any change in the condition or
topology, then the router broadcasts this information to all other routers.

Advantages of Dynamic Routing:


● It is easier to configure.
● It is more effective in selecting the best route in response to the changes in the condition
or topology.
Disadvantages of Dynamic Routing:
● It is more expensive in terms of CPU and bandwidth usage.
● It is less secure as compared to default and static routing.

Key takeaway:
● Static Routing is also known as Non-Adaptive Routing.
● In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

3.7 Routing algorithms and protocols

A routing algorithm is a process that establishes the route or path for data packets to be
transferred from source to destination. They aid in the efficient routing of Internet traffic. After
leaving its source, a data packet can choose from a variety of paths to reach its destination. The
best path, i.e,. the “least – cost path,” that the packet can be routed through is calculated
mathematically by the routing algorithm.

Types of routing algorithm


Adaptive and nonadaptive routing algorithms are the two types of routing algorithms that can be
used. They can be further classified as seen in the diagram below.

Fig 11: types of routing algorithm

Adaptive Routing Algorithm


Adaptive routing algorithms, also known as dynamic routing algorithms, make routing decisions
based on network conditions in real time. It creates the routing table based on the traffic and
topology of the network. They try to find the best route based on the number of hops, transit
time, and size.

The three most popular adaptive routing algorithms are as follows:

● Centralized algorithm - It uses global network awareness to find the cheapest route
between source and destination nodes. As a result, it's often referred to as the global
routing algorithm.
● Isolated algorithm - Instead of collecting information from other nodes, this algorithm
obtains routing information by using local information.
● Distributed algorithm - This is a distributed, iteratively computed decentralized
algorithm that finds the cheapest path between source and destination.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Non - Adaptive Routing Algorithm


Adaptive failure Routing algorithms, also known as static routing algorithms, construct a static
routing table to decide which direction packets should take. When the network is booted up, the
static routing table is built using the routing information stored in the routers.

There are two kinds of non-adaptive routing algorithms.

● Flooding - When a data packet arrives at a router in flooding mode, it is sent to all
outgoing links except the one on which it arrived. Uncontrolled, regulated, or selective
flooding are all possibilities.

● Random walks - This is a probabilistic algorithm in which the router sends a data packet
to all of its neighbors at random.

Key takeaway:
● A routing algorithm is a process that establishes the route or path for data packets to be
transferred from source to destination.
● Adaptive routing algorithms, also known as dynamic routing algorithms, make routing
decisions based on network conditions in real time.

3.8 Congestion control algorithms

Congestion
When message traffic is so high that network response time is slowed, a state occurs in the
network layer.

Congestion's Effects
● Output suffers as the delay lengthens.
● Retransmission happens as the delay increases, worsening the situation.

● Leaky Bucket Algorithm


Let us consider an example to understand.

Imagine a bucket with a small hole in the bottom. No matter at what rate water enters the
bucket, the outflow is at a constant rate. When the bucket is full with water additional
water entering spills over the sides and is lost.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Fig 12: Leaky bucket algorithm

Similarly, each network interface contains a leaky bucket and the following steps are involved in
leaky bucket algorithm:
● When the host wants to send a packet, the packet is thrown into the bucket.
● The bucket leaks at a constant rate, meaning the network interface transmits packets at
a constant rate.
● Bursty traffic is converted to uniform traffic by the leaky bucket.
● In practice the bucket is a finite queue that outputs at a finite rate.

Token bucket Algorithm

Need of token bucket Algorithm:

The leaky bucket algorithm enforces output patterns at the average rate, no matter how bursty
the traffic is. So, in order to deal with the bursty traffic we need a flexible algorithm so that the
data is not lost. One such algorithm is the token bucket algorithm.

Steps of this algorithm can be described as follows:


● In regular intervals tokens are thrown into the bucket. Ƒ
● The bucket has a maximum capacity. Ƒ
● If there is a ready packet, a token is removed from the bucket, and the packet is sent.
● If there is no token in the bucket, the packet cannot be sent.

Let’s understand with an example,

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

In the figure we see a bucket holding three tokens, with five packets waiting to be transmitted.
For a packet to be transmitted, it must capture and destroy one token. In figure (B) We see that
three of the five packets have gotten through, but the other two are stuck waiting for more
tokens to be generated.

Ways in which token bucket is superior to leaky bucket:

The leaky bucket algorithm controls the rate at which the packets are introduced in the network,
but it is very conservative in nature. Some flexibility is introduced in the token bucket algorithm.
In the token bucket, algorithm tokens are generated at each tick (up to a certain limit). For an
incoming packet to be transmitted, it must capture a token and the transmission takes place at
the same rate. Hence some of the busty packets are transmitted at the same rate if tokens are
available and thus introduces some amount of flexibility in the system.

Formula: M * s = C + ρ * s

where S – is time taken


M – Maximum output rate
ρ – Token arrival rate
C – Capacity of the token bucket in byte.

Key takeaway:
● When message traffic is so high that network response time is slowed, a state occurs in
the network layer.
● The leaky bucket algorithm enforces output patterns at the average rate, no matter how
bursty the traffic is. So, in order to deal with the bursty traffic we need a flexible algorithm
so that the data is not lost.

3.9 IPv6
Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol (IP) and the first
version of the protocol to be widely deployed. IPv6 was developed by the Internet Engineering
Task Force (IETF) to deal with the long-anticipated problem of IPv4 address exhaustion. The
Internet has grown exponentially and the address space allowed by IPv4 is saturating.
There is a requirement of protocol which can satisfy the need of future Internet addresses which
are expected to grow in an unexpected manner. Using features such as NAT, has made the
Internet discontinuous i.e. one part which belongs to intranet, primarily uses private IP
addresses; which has to go through a number of mechanisms to reach the other part, the
Internet, which is on public IP addresses.

What is IPv6?
IPv4 produces 4 billion addresses, and the developers think that these addresses are enough,
but they were wrong. IPv6 is the next generation of IP addresses. The main difference between

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6
is a 128-bit hexadecimal address. IPv6 provides a large address space, and it contains a simple
header as compared to IPv4.

It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows:

● Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same
device.
● Tunneling: In this approach, all the users have IPv6 and communicate with an IPv4
network to reach IPv6.
● Network Address Translation: The translation allows the communication between the
hosts having a different version of IP.

This hexadecimal address contains both numbers and alphabets. Due to the usage of both the
numbers and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*1038) addresses.

IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are
separated by a colon. In IPv6, each hexadecimal character represents 4 bits. So, we need to
convert 4 bits to a hexadecimal number at a time

The address format of IPv6:

Fig 13: address format of IPV6

The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-bit decimal
address. It contains 4 octets or fields separated by 'dot', and each field is 8-bit in size. The
number that each field contains should be in the range of 0-255. Whereas an IPv6 is a 128-bit
hexadecimal address. It contains 8 fields separated by a colon, and each field is 16-bit in size.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

Differences between IPv4 and IPv6


Ipv4 Ipv6

Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address.

Fields IPv4 is a numeric address that IPv6 is an alphanumeric address


consists of 4 fields which are that consists of 8 fields, which are
separated by dot (.). separated by colon.

Classes IPv4 has 5 different classes of IP IPv6 does not contain classes of
address that includes Class A, IP addresses.
Class B, Class C, Class D, and
Class E.

Number of IP IPv4 has a limited number of IP IPv6 has a large number of IP


address addresses. addresses.

VLSM It supports VLSM (Virtual Length It does not support VLSM.


Subnet Mask). Here, VLSM means
that Ipv4 converts IP addresses into
a subnet of different sizes.

Address It supports manual and DHCP It supports manual, DHCP,


configuration configuration. auto-configuration, and
renumbering.

Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.

Address In IPv4, the IP address is In IPv6, the representation of the


representation represented in decimal. IP address is hexadecimal.

Packet flow It does not provide any mechanism It uses a flow label field in the
identification for packet flow identification. header for the packet flow
identification.

Key takeaway:
● Network layer manages options pertaining to host and network addressing, managing
sub-networks, and internet working.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)


lOMoARcPSD|29317061

● IPv6 is the next generation of IP addresses.


● IPv6 is the latest revision of the Internet Protocol and the first version of the protocol to
be widely deployed.

Downloaded by aradhya mittal (mittalaradhya0803@gmail.com)

You might also like