Edited Unit 3 CN 4TH Sem
Edited Unit 3 CN 4TH Sem
Edited Unit 3 CN 4TH Sem
Network Layer
o The Network Layer is the third layer of the OSI model.
o It handles the service requests from the transport layer and further
forwards the service request to the data link layer.
o The network layer translates the logical addresses into physical
addresses
o It determines the route from the source to the destination and also
manages the traffic problems such as switching, routing and
controls the congestion of data packets.
o The main role of the network layer is to move the packets from
sending host to the receiving host.
o Routing: When a packet reaches the router's input link, the router
will move the packets to the router's output link. For example, a
packet from S1 to R1 must be forwarded to the next router on the
path to S2.
o Logical Addressing: The data link layer implements the physical
addressing and network layer implements the logical addressing.
Logical addressing is also used to distinguish between source and
destination system. The network layer adds a header to the packet
which includes the logical addresses of both the sender and the
receiver.
o Internetworking: This is the main role of the network layer that it
provides the logical connection between different types of networks.
o Fragmentation: The fragmentation is a process of breaking the
packets into the smallest individual data units that travel through
different networks.
1
Design Issues in Network Layer :
Network layer is majorly focused on getting packets from the source to
the destination, routing error handling and congestion control.
Before learning about design issues in the network layer, let’s learn about
it’s various functions.
Addressing:
Maintains the address at the frame header of both source and
destination and performs addressing to detect various devices in
network.
Packeting:
This is performed by Internet Protocol. The network layer converts
the packets from its upper layer.
Routing:
It is the most important functionality. The network layer chooses
the most relevant and best path for the data transmission from
source to destination.
Inter-networking:
It works to deliver a logical connection across multiple devices.
2
The transport layer needs to be protected from the type, number
and topology of the available router.
The network addresses for the transport layer should use
uniform numbering pattern also at LAN and WAN connections.
Based on the connections there are 2 types of services provided :
Connectionless – The routing and insertion of packets into
subnet is done individually. No added setup is required.
Connection-Oriented – Subnet must offer reliable service and
all the packets must be transmitted over a single route.
3
Network Layer Protocols
There are various protocols used in the network layer. Each protocol is used
for a different task. Below are the protocols used in the network layer:
1. IP (Internet Protocol)
IP stands for Internet Protocol. Internet Protocol helps to uniquely
identify each device on the network. Internet protocol is responsible for
transferring the data from one node to another node in the network.
Internet protocol is a connectionless protocol therefore it does not
guarantee the delivery of data. For the successful delivery higher level
protocols such as TCP are used to guarantee the data transmission. The
Internet Protocol is divided in two types. They are:
4
supports end-to-end connection integrity. IPv6 provides with
more range of IP adress as compared to IPv4.
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.
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.
Issues :
The process of routing is extremely important in networking. There is a
lot of flow of data over a network. Data needs to be sent and received
continuously without any issue and problem. In fact, one of the most
essential functions performed by a network is to ensure that each data
packet reaches its destination without any modification or deletion. In
this regard, the process of routing comes into existence.
The process of routing ensures that the data reaches its exact
destination. This process comes into being during the layer 3 of OSI
model. It is quite essential that data packets have specific routes which
they can follow to reach their destination. In this regard, the map of the
whole network is stored beforehand in each router which makes use of it
to send data packets on appropriate routes. However, any issue in this
integral process of routing can lead to the breaking down of the network.
In this regard the data packets might get deleted or modified, the flow of
data might get slow or the connection might get lost. These issues need
5
to be dealt with seriousness and they should be resolved as soon as
possible. Following are one of the most common issues with routing and
ways in which they can be resolved.
Bad Cables
The process of routing is quite delicate and it requires all the cables in
the network to be perfect. This is because the data has to be sent out
these cables generally and any problem in these cables could lead to
issues in the process of routing. These problems could lead to connection
problems as well as loss of data packets. In addition to this, it could also
lead to interference of electrical signals which might modify or delete the
data packets. Hence, it is important to replace all the bad cables covered
with insulated material which will be able to carry the data packets
efficiently.
Power Failure
6
immediately in case of a power failure. This will ensure that the process
of routing does not stop in any condition.
The subnet mask is a part of the IPv4 addresses. In order to get the exact
position of a client, the router needs to know the subnet mask. However,
sometimes the wrong subnet mask is entered which leads to the
incorrect routing of data packets. In fact, the router will not even get to
know the exact destination without the subnet mask. Hence, it needs to
be ensured that the subnet mask is correct.
Duplicate IP Addresses
7
Distance Vector Routing –
It is a dynamic routing algorithm in which each router computes
a distance between itself and each possible destination i.e. its
immediate neighbors.
The router shares its knowledge about the whole network to its
neighbors and accordingly updates the table based on its
neighbors.
The sharing of information with the neighbors takes place at
regular intervals.
It makes use of Bellman-Ford Algorithm for making routing
tables.
Problems – Count to infinity problem which can be solved by
splitting horizon.
– Good news spread fast and bad news spread slowly.
– Persistent looping problem i.e. loop will be there forever.
Link State Routing –
It is a dynamic routing algorithm in which each router shares
knowledge of its neighbours with every other router in the
network.
A router sends its information about its neighbors only to all the
routers through flooding.
Information sharing takes place only whenever there is a change.
It makes use of Dijkstra’s Algorithm for making routing tables.
Problems – Heavy traffic due to flooding of packets.
– Flooding can result in infinite looping which can be solved by
using the Time to live (TTL) field.
RIP Protocol
RIP stands for Routing Information Protocol. RIP is an intra-domain routing
protocol used within an autonomous system. Here, intra-domain means
routing the packets in a defined domain, for example, web browsing
within an institutional area. To understand the RIP protocol, our main
focus is to know the structure of the packet, how many fields it contains,
and how these fields determine the routing table.
8
o In a routing table, the first column is the destination, or we can say
that it is a network address.
o The cost metric is the number of hops to reach the destination. The
number of hops available in a network would be the cost. The hop
count is the number of networks required to reach the destination.
o In RIP, infinity is defined as 16, which means that the RIP is useful
for smaller networks or small autonomous systems. The maximum
number of hops that RIP can contain is 15 hops, i.e., it should not
have more than 15 hops as 16 is infinity.
o The next column contains the address of the router to which the
packet is to be sent to reach the destination.
OSPF Protocol
The OSPF stands for Open Shortest Path First. It is a widely used and
supported routing protocol. It is an intradomain protocol, which means
that it is used within an area or a network. It is an interior gateway
protocol that has been designed within a single autonomous system. It is
based on a link-state routing algorithm in which each router contains the
information of every domain, and based on this information, it
determines the shortest path. The goal of routing is to learn routes. The
OSPF achieves by learning about every router and subnet within the
entire network. Every router contains the same information about the
network. The way the router learns this information by sending LSA (Link
State Advertisements). These LSAs contain information about every
router, subnet, and other networking information. Once the LSAs have
been flooded, the OSPF stores the information in a link-state database
known as LSDB. The main goal is to have the same information about
every router in an LSDBs.
9
ADDITIONAL INFORMATION 😊 \\
IPv4 vs IPv6
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 a TCP/IP. It creates a virtual connection between the source and
the destination.
An IP address consists of two parts, i.e., the first one is a network address, and
the other one is a host address.
o IPv4
o 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.
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.
10
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 the 1, then the number it
represents will count, and if the bit is 0, then the number it represents does not
count.
Now, we will see how to obtain the binary representation of the above IP
address, i.e., 66.94.29.13
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.
11
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.
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 are
not enough for each device connected to the internet on a planet. Although the
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.
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 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:
o Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6,
on the same device.
o Tunneling: In this approach, all the users have IPv6 communicates with
an IPv4 network to reach IPv6.
12
o 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.
Address format
The address format of IPv4:
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.
Ipv4 Ipv6
13
colon.
Classes IPv4 has 5 different classes of IPv6 does not contain classes
IP address that includes Class of IP addresses.
A, Class B, Class C, Class D,
and Class E.
14
Packet flow It does not provide any It uses flow label field in the
identificatio mechanism for packet flow header for the packet flow
n identification. identification.
Features of RIP
1. Updates of the network are exchanged periodically.
2. Updates (routing information) are always broadcast.
3. Full routing tables are sent in updates.
15
4. Routers always trust routing information received from neighbor routers.
This is also known as Routing on rumors.
RIP versions:
There are three versions of routing information protocol – RIP Version1, RIP
Version2, and RIPng.
16
R1# show ip protocols
Configuration :
Consider the above-given topology which has 3-routers R1, R2, R3. R1 has IP
address 172.16.10.6/30 on s0/0/1, 192.168.20.1/24 on fa0/0. R2 has IP
address 172.16.10.2/30 on s0/0/0, 192.168.10.1/24 on fa0/0. R3 has IP
address 172.16.10.5/30 on s0/1, 172.16.10.1/30 on s0/0, 10.10.10.1/24 on
fa0/0.
17
R2(config-router)# version 2
R2(config-router)# no auto-summary
RIP timers:
Update timer: The default timing for routing information being
exchanged by the routers operating RIP is 30 seconds. Using an
Update timer, the routers exchange their routing table periodically.
Invalid timer: If no update comes until 180 seconds, then the
destination router considers it invalid. In this scenario, the
destination router mark hop counts as 16 for that router.
Hold down timer: This is the time for which the router waits for a
neighbor router to respond. If the router isn’t able to respond within
a given time then it is declared dead. It is 180 seconds by default.
Flush time: It is the time after which the entry of the route will be
flushed if it doesn’t respond within the flush time. It is 60 seconds by
default. This timer starts after the route has been declared invalid
and after 60 seconds i.e time will be 180 + 60 = 240 seconds.
Note that all these times are adjustable. Use this command to change the
timers :
R1(config-router)# timers basic
R1(config-router)# timers basic 20 80 80 90
18
3. Lab conditions: RIP is much of the time utilized in lab conditions
for testing and learning purposes. A basic convention is not
difficult to set up, which pursues it a decent decision for
instructive purposes.
4. Backup or repetitive steering: In certain organizations, RIP
might be utilized as a reinforcement or excess directing
convention, on the off chance that the essential steering
convention falls flat or encounters issues. RIP isn’t generally so
productive as other directing conventions, however, it very well
may be helpful as a reinforcement if there should be an
occurrence of crisis.
Advantages of RIP :
Disadvantages of RIP :
Limited scalability: RIP has limited scalability, and it may not
be the best choice for larger networks with complex topologies.
RIP can only support up to 15 hops, which may not be sufficient
for larger networks.
19
Routing loops: RIP can sometimes create routing loops, which
can cause network congestion and reduce overall network
performance.
20
To make this happen, each router advertises information about its interfaces
(connected networks) to its neighbors. These advertisements are passed along to
other routers until all the other routers in the network develop the same map of the
network.
Therefore, it is very important to note that each of the routers then uses this same
map to calculate the best routers for each destination.
Since more information is shared, link-state protocols use more resources on the
router.
The link-state routers react faster to the changes in the network than the distance
vector routers.
OSPFv1: This is the first version of OSPF created in the year 1989. It is no
longer in use.
OSPFv2: This is the second version of OSPF created in 1998. It is used in IPv4.
This version is important for CCNA 200-301.
OSPFv3: This is the latest version of OSPF created in the year 2008. This version
is used for IPv6 and as well as for IPv4.
The routers store information about networks in Link State Advertisements (LSAs)
which are organized in a structure called the Link State Database (LSDB).
Routers flood the LSAs until all the routers in the OSPF area develop the same map of
the network (LSDB).
This flooding is similar to switches when they receive a broadcast frame or an
unknown unicast frame.
In OSPF, flooding means that they send the LSAs to all of their OSPF neighbors.
21
The basic functioning of OSPF is carried out through LSA Flooding. As we know by now, the
OSPF chooses the shortest path for the routers. The main process involves the sharing of
LSAs and determining the best route to each destination.
Exchange:
The actual DBDs are exchanged in this state.
Loading:
22
The Link State Advertisements (LSAs) along with LSUs and LSRs are exchanged in this state.
Full:
All the information is synced in this state. It is only after the Full state that the OSPF routing
begins!
Therefore, there are a total of seven states of OSPF that the routers undergo before the
actual OSPF routing begins.
23