SlideShare uma empresa Scribd logo
1 de 144
Network Layer
COMPUTER N/W
SARITA PATIL
1
Functions of Network Layer:
• Internetworking: provides a logical connection between
different devices.
• Addressing: Identify the device on the internet.
• Routing: determines the best optimal path out of the multiple
paths from source to the destination.
• Packetizing: receives the packets from the upper layer. This
process of Packetizing is achieved by internet protocol (IP).
COMPUTER N/W
SARITA PATIL
2
Routing algorithm
• Determine the best route through which packets can be transmitted.
• Whether the network layer provides datagram service or virtual circuit
service, the main job of the network layer is to provide the best route.
The routing protocol provides this job.
• The routing protocol provides the best path from the source to the
destination.
• best path is the path that has the "least-cost path" from source to the
destination.
• Routing is the process of forwarding the packets from source to the
destination but the best route to send the packets is determined by the
routing algorithm.
COMPUTER N/W
SARITA PATIL
3
Classification of a Routing algorithm
The Routing algorithm is divided into two categories:
Adaptive Routing algorithm
Non-adaptive Routing algorithm
COMPUTER N/W
SARITA PATIL
4
Adaptive Routing algorithm
• An adaptive routing algorithm is also known as dynamic
routing algorithm.
• This algorithm makes the routing decisions based on the
topology and network traffic.
• The main parameters related to this algorithm are hop count,
distance and estimated transit time.
COMPUTER N/W
SARITA PATIL
5
An adaptive routing algorithm classified into three parts:
• Centralized algorithm:
• Known as global routing algorithm as it computes the least-cost path between
source and destination by using complete and global knowledge about the
network.
• Algorithm takes the connectivity between the nodes and link cost as input, and
this information is obtained before actually performing any calculation.
• Link state algorithm is referred to as a centralized algorithm since it is aware
of the cost of each link in the network.
• Isolation algorithm:
• algorithm that obtains the routing information by using local information
rather than gathering information from other nodes.
COMPUTER N/W
SARITA PATIL
6
• Distributed algorithm:
• Known as decentralized algorithm as it computes the least-cost
path between source and destination in an iterative and distributed
manner.
• no node has the knowledge about the cost of all the network links.
• In the beginning, a node contains the information only about its
own directly attached links and through an iterative process of
calculation computes the least-cost path to the destination.
• A Distance vector algorithm is a decentralized algorithm as it never
knows the complete path from source to the destination, instead it
knows the direction through which the packet is to be forwarded
along with the least cost path.
COMPUTER N/W
SARITA PATIL
7
Non-Adaptive Routing algorithm
• Non Adaptive routing algorithm is also known as a static
routing algorithm.
• When booting up the network, the routing information stores
to the routers.
• Non Adaptive routing algorithms do not take the routing
decision based on the network topology or network traffic.
COMPUTER N/W
SARITA PATIL
8
Non-Adaptive Routing algorithm is of two types:
• Flooding:
• every incoming packet is sent to all the outgoing links except the
one from it has been reached.
• The disadvantage of flooding is that node may contain several
copies of a particular packet.
• Random walks:
• a packet sent by the node to one of its neighbors randomly.
• An advantage of using random walks is that it uses the alternative
routes very efficiently.
COMPUTER N/W
SARITA PATIL
9
Basis Of Comparison Adaptive Routing algorithm Non-Adaptive Routing algorithm
Define constructs the routing table based
on the network conditions.
constructs the static table to
determine which node to send
the packet.
Usage is used by dynamic routing. is used by static routing.
Routing decision Routing decisions are made based
on topology and network traffic.
Routing decisions are the static
tables.
Categorization The types of adaptive routing
algorithm, are Centralized,
isolation and distributed
algorithm.
The types of Non Adaptive
routing algorithm are flooding
and random walks.
Complexity Adaptive Routing algorithms are
more complex.
Non-Adaptive Routing algorithms
are simple.
Differences b/w Adaptive and Non-Adaptive Routing Algorithm
COMPUTER N/W
SARITA PATIL
10
Distance Vector Routing Algorithm
• The Distance vector algorithm is iterative, asynchronous and
distributed.
• Distributed: It is distributed in that each node receives information from
one or more of its directly attached neighbours, performs calculation
and then distributes the result back to its neighbors.
• Iterative: It is iterative in that its process continues until no more
information is available to be exchanged between neighbours.
• Asynchronous: It does not require that all of its nodes operate in the
lock step with each other.
• The Distance vector algorithm is a dynamic algorithm.
• It is mainly used in ARPANET, and RIP.
• Each router maintains a distance table known as Vector.
COMPUTER N/W
SARITA PATIL
11
Three Keys of Distance Vector Routing Algorithm:
• Knowledge about the whole network: Each router shares its
knowledge through the entire network. The Router sends its collected
knowledge about the network to its neighbors.
• Routing only to neighbors: The router sends its knowledge about the
network to only those routers which have direct links. The router sends
whatever it has about the network through the ports. The information
is received by the router and uses the information to update its own
routing table.
• Information sharing at regular intervals: Within 30 seconds, the
router sends the information to the neighboring routers.
COMPUTER N/W
SARITA PATIL
12
Distance Vector Routing Algorithm
• Distance vector routing is an asynchronous algorithm in which node
x sends the copy of its distance vector to all its neighbors.
• When node x receives the new distance vector from one of its
neighboring vector, v, it saves the distance vector of v and uses the
Bellman-Ford equation to update its own distance vector. The
equation is given below:
• dx(y) = minv{ c(x,v) + dv(y)} for each node y in N
• The node x has updated its own distance vector table by using the
above equation and sends its updated table to all its neighbors so that
they can update their own distance vectors.
COMPUTER N/W
SARITA PATIL
13
COMPUTER N/W
SARITA PATIL
14
COMPUTER N/W
SARITA PATIL
15
COMPUTER N/W
SARITA PATIL
16
COMPUTER N/W
SARITA PATIL
17
COMPUTER N/W
SARITA PATIL
18
COMPUTER N/W
SARITA PATIL
19
COMPUTER N/W
SARITA PATIL
20
COMPUTER N/W
SARITA PATIL
21
COMPUTER N/W
SARITA PATIL
22
Link State Routing
• Link state routing is a technique in which each router
shares the knowledge of its neighborhood with every
other router in the internetwork.
COMPUTER N/W
SARITA PATIL
23
The three keys to understand the Link State Routing algorithm:
•Knowledge about the neighborhood: Instead of sending its routing table, a router
sends the information about its neighborhood only. A router broadcast its identities and
cost of the directly attached links to other routers.
•Flooding: Each router sends the information to every other router on the internetwork
except its neighbors. This process is known as Flooding. Every router that receives the
packet sends the copies to all its neighbors. Finally, each and every router receives a
copy of the same information.
•Information sharing: A router sends the information to every other router only when
the change occurs in the information.
COMPUTER N/W
SARITA PATIL
24
Link State Routing has two phases:
• Reliable Flooding
• Initial state: Each node knows the cost of its neighbors.
• Final state: Each node knows the entire graph.
• Route Calculation
• Each node uses Dijkstra's algorithm on the graph to calculate
the optimal routes to all nodes.
• The Link state routing algorithm is also known as Dijkstra's
algorithm which is used to find the shortest path from one node
to every other node in the network.
• The Dijkstra's algorithm is an iterative, and it has the property
that after kth iteration of the algorithm, the least cost paths are
well known for k destination nodes.
COMPUTER N/W
SARITA PATIL
25
some notations:
c( i , j): Link cost from
node i to node j. If i and j
nodes are not directly
linked, then c(i , j) = ∞.
D(v): It defines the cost of
the path from source code
to destination v that has
the least cost currently.
P(v): It defines the
previous node (neighbor
of v) along with current
least cost path from
source to v.
N: It is the total number
of nodes available in the
network.
• Initialization
• N = {A} // A is a root node.
• for all nodes v
• if v adjacent to A
• then D(v) = c(A,v)
• else D(v) = infinity
• loop
• find w not in N such that D(w) is a minimum.
• Add w to N
• Update D(v) for all v adjacent to w and not in
N:
• D(v) = min(D(v) , D(w) + c(w,v))
• Until all nodes in N
COMPUTER N/W
SARITA PATIL
26
Step 1:
The first step is an initialization step. The currently known
least cost path from A to its directly attached neighbors, B, C,
D are 2,5,1 respectively. The cost from A to B is set to 2, from
A to D is set to 1 and from A to C is set to 5. The cost from A
to E and F are set to infinity as they are not directly linked to
A.
Step 2:
In the above table, we observe that vertex D contains the
least cost path in step 1. Therefore, it is added in N. Now, we
need to determine a least-cost path through D vertex.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
COMPUTER N/W
SARITA PATIL
27
a) Calculating shortest path from A to B
1. v = B, w = D
2. D(B) = min( D(B) , D(D) + c(D,B) )
3. = min( 2, 1+2)>
4. = min( 2, 3)
The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
b) Calculating shortest path from A to C
1. v = C, w = D
2. D(B) = min( D(C) , D(D) + c(D,C) )
3. = min( 5, 1+3)
4. = min( 5, 4)
The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p>
c) Calculating shortest path from A to E
1. v = E, w = D
2. D(B) = min( D(E) , D(D) + c(D,E) )
3. = min( ∞, 1+1)
4. = min(∞, 2)
The minimum value is 2. Therefore, the currently shortest path from A to E is 2.
Note: The vertex D has no direct link to vertex E. Therefore, the value of D(F) is
infinity.
COMPUTER N/W SARITA PATIL 28
• Step 3:
• In the above table, we observe that both E and B have the least cost path in
step 2. Let's consider the E vertex. Now, we determine the least cost path
of remaining vertices through E.
• a) Calculating the shortest path from A to B.
• v = B, w = E
• D(B) = min( D(B) , D(E) + c(E,B) )
• = min( 2 , 2+ ∞ )
• = min( 2, ∞)
• The minimum value is 2. Therefore, the currently shortest path from A to B
is 2.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
2 AD 2,A 4,D 2,D ∞
COMPUTER N/W SARITA PATIL 29
• b) Calculating the shortest path from A to C.
• v = C, w = E
• D(B) = min( D(C) , D(E) + c(E,C) )
• = min( 4 , 2+1 )
• = min( 4,3)
• The minimum value is 3. Therefore, the currently shortest path from A to C is 3.
• c) Calculating the shortest path from A to F.
• v = F, w = E
• D(B) = min( D(F) , D(E) + c(E,F) )
• = min( ∞ , 2+2 )
• = min(∞ ,4)
• The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
2 AD 2,A 4,D 2,D ∞
3 ADE 2,A 3,E 4,E
COMPUTER N/W
SARITA PATIL
30
Step 4:
In the above table, we observe that B vertex has the least cost path in step 3.
Therefore, it is added in N. Now, we determine the least cost path of remaining
vertices through B.
a) Calculating the shortest path from A to C.
1. v = C, w = B
2. D(B) = min( D(C) , D(B) + c(B,C) )
3. = min( 3 , 2+3 )
4. = min( 3,5)
5. The minimum value is 3. Therefore, the currently shortest path from A
to C is 3.
b) Calculating the shortest path from A to F.
1. v = F, w = B
2. D(B) = min( D(F) , D(B) + c(B,F) )
3. = min( 4, ∞)
4. = min(4, ∞)
5. The minimum value is 4. Therefore, the currently shortest path from A
to F is 4.
COMPUTER N/W
SARITA PATIL
31
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
2 AD 2,A 4,D 2,D ∞
3 ADE 2,A 3,E 4,E
4 ADEB 3,E 4,E
Step 5:
In the above table, we observe that C vertex has the least cost path in step
4. Therefore, it is added in N. Now, we determine the least cost path of
remaining vertices through C.
a) Calculating the shortest path from A to F.
1. v = F, w = C
2. D(B) = min( D(F) , D(C) + c(C,F) )
3. = min( 4, 3+5)
4. = min(4,8)
5. The minimum value is 4. Therefore, the currently shortest path
from A to F is 4.
COMPUTER N/W
SARITA PATIL
32
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
2 AD 2,A 4,D 2,D ∞
3 ADE 2,A 3,E 4,E
4 ADEB 3,E 4,E
5 ADEBC 4,E
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)
1 A 2,A 5,A 1,A ∞ ∞
2 AD 2,A 4,D 2,D ∞
3 ADE 2,A 3,E 4,E
4 ADEB 3,E 4,E
5 ADEBC 4,E
6 ADEBCF
Final table:
COMPUTER N/W
SARITA PATIL
33
Disadvantage:
Heavy traffic is created in Line state routing due to Flooding.
Flooding can cause an infinite looping, this problem can be
solved by using Time-to-leave field
COMPUTER N/W
SARITA PATIL
34
Network Layer Protocols
COMPUTER N/W
SARITA PATIL
35
ARP
• ARP stands for Address Resolution Protocol.
• It is used to associate an IP address with the MAC address.
• Each device on the network is recognized by the MAC
address imprinted on the NIC.
• we can say that devices need the MAC address for
communication on a local area network.
• MAC address can be changed easily.
• For example, if the NIC on a particular machine fails, the
MAC address changes but IP address does not change. ARP
is used to find the MAC address of the node when an internet
address is known.
COMPUTER N/W
SARITA PATIL
36
Types of Mapping in ARP
• There are two different ways to map the IP address into the MAC
address, which are given below:
• Static Mapping
• Dynamic Mapping
• Static Mapping - In the static mapping, a table consists of a logical address
and corresponding physical address of the destination device. In this, the IP
and MAC address of the device is entered manually in an ARP table. The
source device has to access the table first if a source wants to communicate
with the destination device.
• Dynamic Mapping - In the dynamic mapping, if a device knows the logical
address of the other device, then by using the Address Resolution protocol,
this device will also find the physical address of the device. The dynamic
entries are created automatically when the source device sends an ARP
broadcast request. These entries are not permanent and cleared periodically.
• The dynamic mapping is also used in the Reverse Address
Resolution Protocol.
COMPUTER N/W
SARITA PATIL
37
Types of ARP
There are four types of Address Resolution Protocol, which is given
below:
o Proxy ARP
o Gratuitous ARP
o Reverse ARP (RARP)
o Inverse ARP
• Proxy ARP - Proxy ARP is a method through which a Layer 3 devices
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 map the
MAC address of the router with the target IP address and fool the
sender that it is reached at its destination.
COMPUTER N/W
SARITA PATIL
38
• 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 pretend 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.
COMPUTER N/W
SARITA PATIL
39
• 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.
• 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.
COMPUTER N/W
SARITA PATIL
40
• 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 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.
COMPUTER N/W
SARITA PATIL
41
• Inverse ARP (InARP) - 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 InARP.
• The InARP has a similar packet format as ARP, but operational codes
are different.
COMPUTER N/W
SARITA PATIL
42
• MAC address: The MAC address is used to identify the actual
device.
• IP address: It is an address used to locate a device on the
network.
How ARP works
• If the host wants to know the physical address of another host on
its network, then it sends an ARP query packet that includes the
IP address and broadcast it over the network. Every host on the
network receives and processes the ARP packet, but only the
intended recipient recognizes the IP address and sends back the
physical address. The host holding the datagram adds the
physical address to the cache memory and to the datagram
header, then sends back to the sender.
COMPUTER N/W
SARITA PATIL
43
COMPUTER N/W
SARITA PATIL
44
If a device wants to communicate with another device,
the following steps are taken by the device:
• The device will first look at its internet list, called the
ARP cache to check whether an IP address contains a
matching MAC address or not.
• It will check the ARP cache in command prompt by
using a command arp-a.
COMPUTER N/W
SARITA PATIL
45
•If ARP cache is empty, then device broadcast the
message to the address is received by the device, then
the communication can take place between two
devices.
•If the device receives the MAC address, then the MAC
address gets stored in the ARP cache. We can entire
network asking each device for a matching MAC
address.
•The device that has the matching IP address will then
respond back to the sender with its MAC address
•Once the MAC check the ARP cache in command
prompt by using a command arp -a.
COMPUTER N/W
SARITA PATIL
46
COMPUTER N/W
SARITA PATIL
47
There are two types of ARP entries:
• Dynamic entry: It is an entry which is created
automatically when the sender broadcast its message
to the entire network. Dynamic entries are not
permanent, and they are removed periodically.
• Static entry: It is an entry where someone manually
enters the IP to MAC address association by using the
ARP command utility.
COMPUTER N/W
SARITA PATIL
48
RARP
• RARP stands for Reverse Address Resolution Protocol.
• If the host wants to know its IP address, then it broadcast the RARP
query packet that contains its physical address to the entire network.
A RARP server on the network recognizes the RARP packet and
responds back with the host IP address.
• The protocol which is used to obtain the IP address from a server is
known as Reverse Address Resolution Protocol.
• The message format of the RARP protocol is similar to the ARP
protocol.
• Like ARP frame, RARP frame is sent from one machine to another
encapsulated in the data portion of a frame.
COMPUTER N/W
SARITA PATIL
49
RARP
COMPUTER N/W
SARITA PATIL
50
ICMP
• ICMP stands for Internet Control Message Protocol.
• The ICMP is a network layer protocol used by hosts and routers to send the
notifications of IP datagram problems back to the sender.
• ICMP uses echo test/reply to check whether the destination is reachable
and responding.
• ICMP handles both control and error messages, but its main function is to
report the error but not to correct them.
• An IP datagram contains the addresses of both source and destination, but
it does not know the address of the previous router through which it has
been passed. Due to this reason, ICMP can only send the messages to the
source, but not to the immediate routers.
• ICMP protocol communicates the error messages to the sender. ICMP
messages cause the errors to be returned back to the user processes.
• ICMP messages are transmitted within IP datagram.
COMPUTER N/W
SARITA PATIL
51
The Format of an ICMP message
o The first field specifies the type of the message.
o The second field specifies the reason for a particular message type.
o The checksum field covers the entire ICMP message.
COMPUTER N/W
SARITA PATIL
52
Error Reporting
• ICMP protocol reports the error messages to the sender.
•Five types of errors are handled by the ICMP
protocol:
• Destination unreachable
• Source Quench
• Time Exceeded
• Parameter problems
• Redirection
COMPUTER N/W
SARITA PATIL
53
O Destination unreachable: The message of "Destination
Unreachable" is sent from receiver to the sender when
destination cannot be reached, or packet is discarded when
the destination is not reachable.
COMPUTER N/W
SARITA PATIL
54
• Source Quench: The purpose of the source quench message is
congestion control. The message sent from the congested router to
the source host to reduce the transmission rate. ICMP will take the IP
of the discarded packet and then add the source quench message to
the IP datagram to inform the source host to reduce its transmission
rate. The source host will reduce the transmission rate so that the
router will be free from congestion.
• Time Exceeded: Time Exceeded is also known as "Time-To-Live". It is a
parameter that defines how long a packet should live before it would
be discarded.
• Time Exceeded: packet discarded due to some bad routing
implementation, and this causes the looping issue and network
congestion
destination host does not receive all the fragments in a certain time
limit
COMPUTER N/W
SARITA PATIL
55
• Parameter problems: When a router or host discovers any
missing value in the IP datagram, the router discards the
datagram, and the "parameter problem" message is sent back
to the source host.
• Redirection: Redirection message is generated when host
consists of a small routing table. When the host consists of a
limited number of entries due to which it sends the datagram
to a wrong router. The router that receives a datagram will
forward a datagram to a correct router and also sends the
"Redirection message" to the host to update its routing table.
COMPUTER N/W
SARITA PATIL
56
IGMP
• IGMP stands for Internet Group Message Protocol.
• The IP protocol supports two types of communication:
• Unicasting: It is a communication between one sender and one
receiver. Therefore, we can say that it is one-to-one
communication.
• Multicasting: Sometimes the sender wants to send the same
message to a large number of receivers simultaneously. This
process is known as multicasting which has one-to-many
communication.
• The IGMP protocol is used by the hosts and router to support
multicasting.
• The IGMP protocol is used by the hosts and router to identify
the hosts in a LAN that are the members of a group.
COMPUTER N/W
SARITA PATIL
57
COMPUTER N/W
SARITA PATIL
58
IGMP
o IGMP is a part of the IP layer, and IGMP has a fixed-size message.
o The IGMP message is encapsulated within an IP datagram.
The Format of IGMP message
COMPUTER N/W
SARITA PATIL
59
• Type: It determines the type of IGMP message.
• three types of IGMP message: Membership Query, Membership Report and
Leave Report.
• Maximum Response Time: This field is used only by the Membership Query
message. It determines the maximum time the host can send the Membership
Report message in response to the Membership Query message.
• Checksum: It determines the entire payload of the IP datagram in which
IGMP message is encapsulated.
• Group Address: The behaviour of this field depends on the type of the
message sent.
• For Membership Query, the group address is set to zero for General Query
and set to multicast group address for a specific query.
• For Membership Report, the group address is set to the multicast group
address.
• For Leave Group, it is set to the multicast group address.
COMPUTER N/W
SARITA PATIL
60
COMPUTER N/W
SARITA PATIL
61
Membership Query message
• This message is sent by a router to all hosts on a local area
network to determine the set of all the multicast groups that
have been joined by the host.
• It also determines whether a specific multicast group has
been joined by the hosts on a attached interface.
• The group address in the query is zero since the router
expects one response from a host for every group that
contains one or more members on that host.
COMPUTER N/W
SARITA PATIL
62
• Membership Report message
• The host responds to the membership query message with a membership
report message.
• Membership report messages can also be generated by the host when a
host wants to join the multicast group without waiting for a membership
query message from the router.
• Membership report messages are received by a router as well as all the
hosts on an attached interface.
• Each membership report message includes the multicast address of a
single group that the host wants to join.
• IGMP protocol does not care which host has joined the group or how
many hosts are present in a single group. It only cares whether one or
more attached hosts belong to a single multicast group.
COMPUTER N/W
SARITA PATIL
63
• The membership Query message sent by a router also
includes a "Maximum Response time". After receiving a
membership query message and before sending the
membership report message, the host waits for the
random amount of time from 0 to the maximum response
time. If a host observes that some other attached host has
sent the "Maximum Report message", then it discards its
"Maximum Report message" as it knows that the
attached router already knows that one or more hosts
have joined a single multicast group. This process is
known as feedback suppression. It provides the
performance optimization, thus avoiding the unnecessary
transmission of a "Membership Report message".
COMPUTER N/W
SARITA PATIL
64
Leave Report
• When the host does not send the "Membership Report
message", it means that the host has left the group. The host
knows that there are no members in the group, so even
when it receives the next query, it would not report the
group.
COMPUTER N/W
SARITA PATIL
65
Network Addressing
COMPUTER N/W
SARITA PATIL
66
• Network Addressing is one of the major responsibilities of the network
layer.
• Network addresses are always logical, i.e., software-based addresses.
• A host is also known as end system that has one link to the network.
• Interface :boundary between the host and link is known as an.
• Host can have only one interface.
• A router is different from the host in that it has two or more links that
connect to it.
• Router forwards the datagram, then it forwards the packet to one of the
links.
• The boundary between the router and link is known as an interface,
• the router can have multiple interfaces, one for each of its links.
• Each interface is capable of sending and receiving the IP packets, so IP
requires each interface to have an address.
COMPUTER N/W
SARITA PATIL
67
• Each IP address is 32 bits long, and they are represented in
the form of "dot-decimal notation" where each byte is
written in the decimal form, and they are separated by the
period.
• An IP address would look like 193.32.216.9 where 193
represents the decimal notation of first 8 bits of an address,
32 represents the decimal notation of second 8 bits of an
address.
COMPUTER N/W
SARITA PATIL
68
• In the above figure, a router has three
interfaces labeled as 1, 2 & 3 and each
router interface contains its own IP
address.
• Each host contains its own interface and
IP address.
• All the interfaces attached to the LAN 1 is
having an IP address in the form of
223.1.1.xxx, and the interfaces attached
to the LAN 2 and LAN 3 have an IP
address in the form of 223.1.2.xxx and
223.1.3.xxx respectively.
• Each IP address consists of two parts. The
first part (first three bytes in IP address)
specifies the network and second part
(last byte of an IP address) specifies the
host in the network.
COMPUTER N/W
SARITA PATIL
69
Classful Addressing
• An IP address is 32-bit long. An IP address is divided into sub-classes:
• Class A
• Class B
• Class C
• Class D
• Class E
• An IP address is divided into two parts:
• Network ID: It represents the number of networks.
• Host ID: It represents the number of hosts.
COMPUTER N/W
SARITA PATIL
70
The class of IP
address is used to
determine the
number of bits used
in a class and
number of
networks and hosts
available in the
class.
COMPUTER N/W
SARITA PATIL
71
Class A
• In Class A, an IP address is assigned to those networks that contain a
large number of hosts.
• The network ID is 8 bits long.
• The host ID is 24 bits long.
• In Class A, the first bit in higher order bits of the first octet is always
set to 0 and the remaining 7 bits determine the network ID. The 24
bits determine the host ID in any network.
• The total number of networks in Class A = 27 = 128 network address
• The total number of hosts in Class A = 224 - 2 = 16,777,214 host
address(You subtract two to reserve one IP for the network
ID and one for the broadcast address.)
COMPUTER N/W
SARITA PATIL
72
Class B
• In Class B, an IP address is assigned to those networks that range from
small-sized to large-sized networks.
• The Network ID is 16 bits long.
• The Host ID is 16 bits long.
• In Class B, the higher order bits of the first octet is always set to 10,
and the remaining14 bits determine the network ID. The other 16 bits
determine the Host ID.
• The total number of networks in Class B = 214 = 16384 network
address
• The total number of hosts in Class B = 216 - 2 = 65534 host address
COMPUTER N/W
SARITA PATIL
73
Class C
• In Class C, an IP address is assigned to only small-sized networks.
• The Network ID is 24 bits long.
• The host ID is 8 bits long.
• In Class C, the higher order bits of the first octet is always set to 110,
and the remaining 21 bits determine the network ID. The 8 bits of the
host ID determine the host in a network.
• The total number of networks = 221 = 2097152 network address
• The total number of hosts = 28 - 2 = 254 host address
COMPUTER N/W
SARITA PATIL
74
Class D
• In Class D, an IP address is reserved for multicast addresses. It does not
possess subnetting. The higher order bits of the first octet is always set to
1110, and the remaining bits determines the host ID in any network.
Multicasting allows a single host to send a single stream of data to
thousands of hosts across the Internet at the same time. It is often used for
audio and video streaming, such as IP-based cable TV networks. Another
example is the delivery of real-time stock market data from one source to
many brokerage companies.
• Class E
• In Class E, an IP address is used for the future use or for the research and
development purposes. It does not possess any subnetting. The higher
order bits of the first octet is always set to 1111, and the remaining bits
determines the host ID in any network.
COMPUTER N/W
SARITA PATIL
75
Class D
In Class D, an IP address is reserved for multicast addresses. It does not possess subnetting. The higher order bits of the first octet is
always set to 1110, and the remaining bits determines the host ID in any network.
Class E
In Class E, an IP address is used for the future use or for the research and development purposes. It does not possess any subnetting.
The higher order bits of the first octet is always set to 1111, and the remaining bits determines the host ID in any network.
COMPUTER N/W
SARITA PATIL
76
Rules for assigning Host ID:
• The Host ID is used to determine the host within any network. The
Host ID is assigned based on the following rules:
• The Host ID must be unique within any network.
• The Host ID in which all the bits are set to 0 cannot be assigned as it is
used to represent the network ID of the IP address.
• The Host ID in which all the bits are set to 1 cannot be assigned as it is
reserved for the multicast address
COMPUTER N/W
SARITA PATIL
77
Rules for assigning Network ID:
• If the hosts are located within the same local network, then they are
assigned with the same network ID. The following are the rules for
assigning Network ID:
• o The network ID cannot start with 127 as 127 is used by Class A.
• o The Network ID in which all the bits are set to 0 cannot be
assigned as it is used to specify a particular host on the local network.
• o The Network ID in which all the bits are set to 1 cannot be
assigned as it is reserved for the multicast address.
COMPUTER N/W
SARITA PATIL
78
Classful Network Architecture
COMPUTER N/W
SARITA PATIL
79
Class Higher
bits
NET ID
bits
HOST ID
bits
No.of
networks
No.of hosts per
network
Range
A 0 8 24 27
224
0.0.0.0 to
127.255.255.255
B 10 16 16 214
216
128.0.0.0 to
191.255.255.255
C 110 24 8 221
28
192.0.0.0 to
223.255.255.255
D 1110 Not
Defined
Not
Defined
Not Defined Not Defined 224.0.0.0 to
239.255.255.255
E 1111 Not
Defined
Not
Defined
Not Defined Not Defined 240.0.0.0 to
255.255.255.255
IPv4 vs IPv6
• 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.
• 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).
• An IP address consists of two parts, i.e., the first one is a network address, and
the other one is a host address.
• two types of IP addresses:
• IPv4
• IPv6
COMPUTER N/W
SARITA PATIL
80
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.
COMPUTER N/W
SARITA PATIL
81
• 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.
• Representation of 8 Bit Octet
COMPUTER N/W
SARITA PATIL
82
• how to obtain the binary representation of the above IP address, i.e.,
66.94.29.13
• 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.
COMPUTER N/W
SARITA PATIL
83
• 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.
COMPUTER N/W
SARITA PATIL
84
Drawback of IPv4
• IPv4 produces 4 billion addresses, which are not enough for each
device connected to the internet on a planet
• 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
• still, IPV4 is not so efficient, so IPV6
COMPUTER N/W
SARITA PATIL
85
IPv6
• IPv6 is the next generation of IP addresses.
• The main difference between IPv4 and IPv6 is the address size of IP
addresses.
• 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
COMPUTER N/W
SARITA PATIL
86
strategies to convert IPv4 into IPv6
• 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 communicates
with an IPv4 network to reach IPv6.
• Network Address Translation: The translation allows the
communication between the hosts having a different version of IP.
• hexadecimal address contains both numbers and alphabets hence
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
COMPUTER N/W
SARITA PATIL
87
• Address format
• The address format of IPv4
• The address format of IPv6:
COMPUTER N/W
SARITA PATIL
88
• An IPv4 is a 32-bit decimal address. It contains 4 octets or
fields separated by 'dot', and each field is 8-bit
• IPv6 is a 128-bit hexadecimal address. It contains 8 fields
separated by a colon, and each field is 16-bit in size
COMPUTER N/W SARITA PATIL 89
Ipv4 Ipv6
Address
length
IPv4 is a 32-bit address. IPv6 is a 128-bit address.
Fields IPv4 is a numeric address
that consists of 4 fields
which are separated by dot
(.).
IPv6 is an alphanumeric
address that consists of 8
fields, which are separated
by colon.
Classes IPv4 has 5 different classes
of IP address that includes
Class A, Class B, Class C,
Class D, and Class E.
IPv6 does not contain classes
of IP addresses.
Number of
IP address
IPv4 has a limited number
of IP addresses.
IPv6 has a large number of
IP addresses.
Address space It generates 4 billion unique addresses It generates 340 undecillion unique
addresses.
End-to-end
connection integrity
In IPv4, end-to-end connection integrity is
unachievable.
In the case of IPv6, end-to-end connection
integrity is achievable.
Security features In IPv4, security depends on the
application. This IP address is not
developed in keeping the security feature
in mind.
In IPv6, IPSEC is developed for security
purposes.
Address
representation
In IPv4, the IP address is represented in
decimal.
In IPv6, the representation of the IP address
in hexadecimal.
Fragmentation Fragmentation is done by the senders and
the forwarding routers.
Fragmentation is done by the senders only.
Packet flow
identification
It does not provide any mechanism for
packet flow identification.
It uses flow label field in the header for the
packet flow identification.
Checksum field The checksum field is available in IPv4. The checksum field is not available in IPv6.
Transmission
scheme
IPv4 is broadcasting. On the other hand, IPv6 is multicasting,
which provides efficient network
operations.
Encryption and
Authentication
It does not provide encryption and
authentication.
It provides encryption and authentication.
COMPUTER N/W
SARITA PATIL
90
Subnetting in Networking
• The process of dividing a single network into multiple sub networks is
called as subnetting.
• The sub networks so created are called as subnets.
• It improves the security.
• The maintenance and administration of subnets is easy.
COMPUTER N/W
SARITA PATIL
91
Subnet ID-
• Each subnet has its unique network address known as its Subnet ID.
• The subnet ID is created by borrowing some bits from the Host ID
part of the IP Address.
• The number of bits borrowed depends on the number of subnets
created.
• Types of Subnetting-FLSM,VLSM
COMPUTER N/W
SARITA PATIL
92
1. Fixed Length Subnetting-
• Fixed length subnetting also called as classful subnetting
divides the network into subnets where-
•All the subnets are of same size.
•All the subnets have equal number of hosts.
•All the subnets have same subnet mask(valid IP range for
the N/w).
2. Variable Length Subnetting-
• Variable length subnetting also called as classless subnetting
divides the network into subnets where-
•All the subnets are not of same size.
•All the subnets do not have equal number of hosts.
•All the subnets do not have same subnet mask.
COMPUTER N/W
SARITA PATIL
93
Example-01:
We have a big single network having IP Address 200.1.2.0.
• We want to do subnetting and divide this network into 2 subnets.
• Given network belongs to class C
• For creating two subnets and to represent their subnet IDs,
• we require 1 bit.
• So borrow one bit from the Host ID part.
• After borrowing one bit,
Host ID part remains with only 7 bits.
COMPUTER N/W
SARITA PATIL
94
• If borrowed bit = 0, then it represents the first subnet.
• If borrowed bit = 1, then it represents the second subnet.
• IP Address of the two subnets are-
• 200.1.2.00000000 = 200.1.2.0
• 200.1.2.10000000 = 200.1.2.128
COMPUTER N/W
SARITA PATIL
95
• For 1st Subnet-
•
• IP Address of the subnet = 200.1.2.0
• Total number of IP Addresses = 27 = 128
• Total number of hosts that can be configured = 128 – 2 = 126
• Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] =
[200.1.2.0, 200.1.2.127]
• Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
96
• For 2nd Subnet-
•
• IP Address of the subnet = 200.1.2.128
• Total number of IP Addresses = 27 = 128
• Total number of hosts that can be configured = 128 – 2 = 126
• Range of IP Addresses = [200.1.2.10000000, 200.1.2.11111111] =
[200.1.2.128, 200.1.2.255]
• Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
97
Example-02:
• We have a big single network having IP Address 200.1.2.0.
• We want to do subnetting and divide this network into 4 subnets.
•
• Clearly, the given network belongs to class C.
• For creating four subnets and to represent their subnet IDs, we require 2
bits.
• So, We borrow two bits from the Host ID part.
• After borrowing two bits, Host ID part remains with only 6 bits.
COMPUTER N/W
SARITA PATIL
98
• If borrowed bits = 00, then it represents the 1st subnet.
• If borrowed bits = 01, then it represents the 2nd subnet.
• If borrowed bits = 10, then it represents the 3rd subnet.
• If borrowed bits = 11, then it represents the 4th subnet.
COMPUTER N/W
SARITA PATIL
99
• IP Address of the four subnets are-
• 200.1.2.00000000 = 200.1.2.0
• 200.1.2.01000000 = 200.1.2.64
• 200.1.2.10000000 = 200.1.2.128
• 200.1.2.11000000 = 200.1.2.192
COMPUTER N/W
SARITA PATIL
100
• For 1st Subnet-
•
• IP Address of the subnet = 200.1.2.0
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.00000000, 200.1.2.00111111] =
[200.1.2.0, 200.1.2.63]
• Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
101
• For 2nd Subnet-
•
• IP Address of the subnet = 200.1.2.64
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.01000000, 200.1.2.01111111] =
[200.1.2.64, 200.1.2.127]
• Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
102
• For 3rd Subnet-
•
• IP Address of the subnet = 200.1.2.128
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.10000000, 200.1.2.10111111] =
[200.1.2.128, 200.1.2.191]
• Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
103
• For 4th Subnet-
•
• IP Address of the subnet = 200.1.2.192
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.11000000, 200.1.2.11111111] =
[200.1.2.192, 200.1.2.255]
• Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
104
Example-03:
• We have a big single network having IP Address 200.1.2.0.
• We want to do subnetting and divide this network into 3 subnets.
• Here, the subnetting will be performed in two steps-
• Dividing the given network into 2 subnets
• Dividing one of the subnets further into 2 subnets
• Step-01: Dividing Given Network into 2 Subnets-
• The subnetting will be performed exactly in the same way as
performed in Example-01.
• After subnetting, we have-
COMPUTER N/W
SARITA PATIL
105
COMPUTER N/W
SARITA PATIL
106
Step-02: Dividing One Subnet into 2 Subnets-
 perform the subnetting of one of the subnets further into 2 subnets.
 Consider we want to do subnetting of the 2nd subnet having IP Address
200.1.2.128.
For creating two subnets and to represent their subnet IDs, we require 1 bit.
 We borrow one more bit from the Host ID part.
 After borrowing one bit, Host ID part remains with only 6 bits.
COMPUTER N/W
SARITA PATIL
107
 If 2nd borrowed bit = 0, then it represents
one subnet.
 If 2nd borrowed bit = 1, then it represents the
other subnet.
IP Address of the two subnets are-
 200.1.2.10000000 = 200.1.2.128
 200.1.2.11000000 = 200.1.2.192
Finally, the given single network is divided into
3 subnets having IP Address-
200.1.2.0
200.1.2.128
200.1.2.192
• For 1st Subnet-
•
• IP Address of the subnet = 200.1.2.0
• Total number of IP Addresses = 27 = 128
• Total number of hosts that can be configured = 128 – 2 = 126
• Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] =
[200.1.2.0, 200.1.2.127]
• Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
108
For 2nd Subnet-
• IP Address of the subnet = 200.1.2.128
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.10000000, 200.1.2.10111111] =
[200.1.2.128, 200.1.2.191]
• Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
109
For 3rd Subnet-
• IP Address of the subnet = 200.1.2.192
• Total number of IP Addresses = 26 = 64
• Total number of hosts that can be configured = 64 – 2 = 62
• Range of IP Addresses = [200.1.2.11000000, 200.1.2.11111111] =
[200.1.2.192, 200.1.2.255]
• Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255
• Limited Broadcast Address = 255.255.255.255
COMPUTER N/W
SARITA PATIL
110
Disadvantages of Subnetting-
• We have to face a loss of IP Addresses.
• This is because two IP Addresses are wasted for each subnet.
• One IP address is wasted for its network address.
• Other IP Address is wasted for its direct broadcasting address
• the communication process becomes complex
• Identifying the network
• Identifying the sub network
• Identifying the host
• Identifying the process
COMPUTER N/W
SARITA PATIL
111
CIDR
• CIDR Notation. A system called Classless Inter-Domain Routing,
or CIDR, was developed as an alternative to traditional subnetting.
• The idea is that you can add a specification in the IP address itself as
to the number of significant bits that make up the routing or
networking portion
• an address or routing prefix is written with a suffix indicating the
number of bits of the prefix, such as 192.0. 2.0/24 for IPv4, and
2001:db8::/32 for IPv6.
COMPUTER N/W
SARITA PATIL
112
Supernetting
• Supernetting is the process of summarizing a bunch of contiguous
Subnetted networks back in a single large network. Supernetting is
also known as route summarization and route aggregation.
COMPUTER N/W
SARITA PATIL
113
Why Supernetting is done?
• Supernetting is mainly done for optimizing the routing
tables. A routing table is the summary of all known
networks. Routers share routing tables to find the new path
and locate the best path for destination.
• Without Supernetting, router will share all routes from
routing tables as they are.
• With Supernetting, it will summarize them before sharing.
Route summarization reduces the size of routing updates
dramatically.
COMPUTER N/W
SARITA PATIL
114
COMPUTER N/W
SARITA PATIL
115
Advantage of Supernetting
Supernetting provides
following advantages.
It reduces the size of routing
updates.
It provides a better overview
of network.
It decreases the use of
resources such as Memory
and CPU.
It decreases the required time
in rebuilding the routing
tables.
• to perform the Supernetting, we need Network ID, CIDR Value,
Broadcast ID, Subnet Mask and Block Size of each route.
• Network ID and broadcast ID are used to check the alignment of
routes. Supernetting can be performed only if routes are sequential.
• Block size is used to calculate the summarized route from given
routes.
• Subnet mask and CIDR value is the same thing in different notations.
Both are used to find the ON network bits in IP address. In exam,
question may use any notation. While preparing for Cisco exam, you
should practice with both.
• Since an advertise route is the combination of network ID and CIDR
value, we only need to figure out the broadcast ID, subnet mask and
block size.
COMPUTER N/W
SARITA PATIL
116
• For block size use following formulas:-
• 32-25=7, 2 to the power 7=128
• Broadcast ID is the last address of network. Once you know the block
size, to calculate the broadcast ID, simply count the addresses starting
from network ID till the last address of the block.
• For example if network ID is 192.168.1.0/25 and block size is 128 and
then broadcast ID will be 192.168.1.127/25.
• In counting, the 0 is used as a number. For example, [0, 1 and 2] are 3
numbers.
COMPUTER N/W
SARITA PATIL
117
32 – CIDR Value = Number of host bits
Block size = 2Number of host bits
For example if CIDR value is 25 then block is 128.
Hierarchical Routing
• Both LS and DV algorithms, every router has to save some
information about other routers.
• When the network size grows, the number of routers in the network
increases. Consequently, the size of routing tables increases, as well,
and routers can't handle network traffic as efficiently.
• We use hierarchical routing to overcome this problem.
• We use DV algorithms to find best routes between nodes.
• In the situation depicted below, every node of the network has to save
a routing table with 17 records.
COMPUTER N/W
SARITA PATIL
118
COMPUTER N/W
SARITA PATIL
119
graph and routing table for A:
COMPUTER N/W
SARITA PATIL
120
Destination Line Weight
A -- --
B B 1
C C 1
REGION 2 B 2
REGION 3 C 2
REGION 4 C 3
REGION 5 C 4
• In hierarchical routing, routers are classified in groups known
as regions.
• Each router has only the information about the routers in its own
region and has no information about routers in other regions.
• So routers just save one record in their table for every other region. In
this example, we have classified our network into five regions
• If A wants to send packets to any router in region 2 (D, E, F or G), it
sends them to B, and so on.
• In this type of routing, the tables can be summarized, so network
efficiency improves.
• The above example shows two-level hierarchical routing.
• We can also use three- or four-level hierarchical routing.
COMPUTER N/W
SARITA PATIL
121
• In three-level hierarchical routing, the network is classified into a
number of clusters.
• Each cluster is made up of a number of regions, and each region
contains a number or routers.
• Hierarchical routing is widely used in Internet routing and makes use
of several routing protocols.
COMPUTER N/W
SARITA PATIL
122
Unicast Routing Protocols: Routing Protocols:
RIP, OSPF, and BGP
• An internet is a combination of networks connected by
routers
• How to pass a packet from source to destination ? Which
of the available pathways is the optimum pathway ?
• Depends on the metric
• Metric: a cost assigned for passing through a network
• A router should choose the route with the smallest metric
COMPUTER N/W
SARITA PATIL
123
Introduction
• The metric assigned to each network depends on the type of protocol
• RIP (Routing Information Protocol)
• Treat each network as equal
• The cost of passing through each network is the same: one hop
count
• Open Shortest Path First (OSPF)
• Allow administrator to assign a cost for passing through a network
based on the type of serviced required
• For example, maximum throughput or minimum delay
• Border Gateway Protocol (BGP)
• The criterion is the policy, which can be set by the administrator
COMPUTER N/W
SARITA PATIL
124
Routing Information Protocol (RIP)
• Routing Information Protocol (RIP) is a dynamic routing protocol which uses hop count
as a routing metric to find the best path between the source and the destination network. It
is a distance vector routing protocol which has AD value 120 and works on the
application layer of OSI model. RIP uses port number 520.
• Hop Count :
Hop count is the number of routers occurring in between the source and destination
network. The path with the lowest hop count is considered as the best route to reach a
network and therefore placed in the routing table. RIP prevents routing loops by limiting
the number of hopes allowed in a path from source and destination. The maximum hop
count allowed for RIP is 15 and hop count of 16 is considered as network unreachable.
• 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.
4. Routers always trust on routing information received from neighbor routers. This is
also known as Routing on rumours.
• RIP versions :
There are three vesions of routing information protocol – RIP Version1, RIP
Version2 and RIPng.
COMPUTER N/W
SARITA PATIL
125
• RIP v1 is known as Classful Routing Protocol because it doesn’t send
information of subnet mask in its routing update.
• RIP v2 is known as Classless Routing Protocol because it sends
information of subnet mask in its routing update.
COMPUTER N/W
SARITA PATIL
126
>> Use debug command to get the details :
# debug ip rip
>> Use this command to show all routes configured in router, say
for router R1 :
R1# show ip route
>> Use this command to show all protocols configured in router,
say for router R1 :
R1# show ip protocols
COMPUTER N/W
SARITA PATIL
127
RIP V1 RIP V2 RIPNG
Sends update as broadcast Sends update as multicast Sends update as multicast
Broadcast at
255.255.255.255 Multicast at 224.0.0.9
Multicast at FF02::9
(RIPng can only run on
IPv6 networks)
Doesn’t support
authentication of update
messages
Supports authentication
of RIPv2 update
messages –
Classful routing protocol
Classless protocol,
supports classful Classless updates are sent
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.
COMPUTER N/W
SARITA PATIL
128
• Configure RIP for R1 :
• R1(config)# router rip
• R1(config-router)# network 192.168.20.0
• R1(config-router)# network 172.16.10.4
• R1(config-router)# version 2
• R1(config-router)# no auto-summary
• Configureg RIP for R2 :
• R2(config)# router rip
• R2(config-router)# network 192.168.10.0
• R2(config-router)# network 172.16.10.0
• R2(config-router)# version 2
• R2(config-router)# no auto-summary
COMPUTER N/W
SARITA PATIL
129
• Similarly, Configure RIP for R3 :
• R3(config)# router rip
• R3(config-router)# network 10.10.10.0
• R3(config-router)# network 172.16.10.4
• R3(config-router)# network 172.16.10.0
• R3(config-router)# version 2
• R3(config-router)# no auto-summary
• Note:: no auto-summary command disables the auto-summarisation.
If we don’t select no auto-summary, then subnet mask will be
considered as classful in Version 1.
COMPUTER N/W
SARITA PATIL
130
• RIP timers :
• Update timer : The default timing for routing information being exchanged by the
routers operating RIP is 30 seconds. Using Update timer, the routers exchange
their routing table periodically.
• Invalid timer: If no update comes until 180 seconds, then the destination router
consider it as invalid. In this scenario, the destination router mark hop count as
16 for that router.
• Hold down timer : This is the time for which the router waits for neighbour
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
COMPUTER N/W
SARITA PATIL
131
RIP Message Format
• Command: 8-bit
• The type of message: request (1) or response (2) o Version: 8-bit n
• Define the RIP version o
• Family: 16-bit n
• Define the family of the protocol used n TCP/IP: value is 2 o Network
Address: 14 bytes n Defines the address of the destination network n
14 bytes for this field to be applicable to any protocol n However, IP
currently uses only 4 bytes, the rest are all 0s o Distance: 32-bit n The
hop count from the advertising router to the destination network
COMPUTER N/W
SARITA PATIL
132
Open shortest path first (OSPF) routing protocol
• Open Shortest Path First (OSPF) is a unicast routing protocol developed
by working group of the Internet Engineering Task Force (IETF).
• It is a intradomain routing protocol.
• It is an open source protocol.
• It is similar to Routing Information Protocol (RIP)
• OSPF is a classless routing protocol, which means that in its updates, it
includes the subnet of each route it knows about, thus, enabling variable-
length subnet masks.
• With variable-length subnet masks, an IP network can be broken into
many subnets of various sizes.
• This provides network administrators with extra network-configuration
flexibility. These updates are multicasts at specific addresses (224.0.0.5
and 224.0.0.6).
COMPUTER N/W
SARITA PATIL
133
• OSPF is implemented as a program in the network layer
using the services provided by the Internet Protocol
• IP datagram that carries the messages from OSPF sets the
value of protocol field to 89
• OSPF is based on the SPF algorithm, which sometimes is
referred to as the Dijkstra algorithm
• OSPF has two versions – version 1 and version 2. Version
2 is used mostly
COMPUTER N/W
SARITA PATIL
134
OSPF terms –
• Router I’d – It is the highest active IP address present on the router. First,
highest loopback address is considered. If no loopback is configured then
the highest active IP address on the interface of the router is considered.
• Router priority – It is a 8 bit value assigned to a router operating OSPF,
used to elect DR and BDR in a broadcast network.
• Designated Router (DR) – It is elected to minimize the number of
adjacency formed. DR distributes the LSAs to all the other routers. DR is
elected in a broadcast network to which all the other routers shares their
DBD. In a broadcast network, router requests for an update to DR and DR
will respond to that request with an update.
• Backup Designated Router (BDR) – BDR is backup to DR in a broadcast
network. When DR goes down, BDR becomes DR and performs its
functions.
COMPUTER N/W
SARITA PATIL
135
• DR and BDR election – DR and BDR election takes place in
broadcast network or multi-access network. Here are the criteria for
the election:
• Router having the highest router priority will be declared as DR.
• If there is a tie in router priority then highest router I’d will be
considered.
• First, the highest loopback address is considered. If no loopback is
configured then the highest active IP address on the interface of the
router is considered.
COMPUTER N/W
SARITA PATIL
136
• OSPF states – The device operating OSPF goes through certain states.
These states are:
• Down – In this state, no hello packet have been received on the interface.
Note – The Down state doesn’t mean that the interface is physically down.
Here, it means that OSPF adjacency process has not started yet.
• INIT – In this state, hello packet have been received from the other router.
• 2WAY – In the 2WAY state, both the routers have received the hello packets
from other routers. Bidirectional connectivity has been established.
Note – In between the 2WAY state and Exstart state, the DR and BDR
election takes place.
• Exstart – In this state, NULL DBD are exchanged.In this state, master and
slave election take place. The router having the higher router I’d becomes
the master while other becomes the slave. This election decides Which
router will send it’s DBD first (routers who have formed neighbourship will
take part in this election).
COMPUTER N/W
SARITA PATIL
137
• Exchange – In this state, the actual DBDs are exchanged.
• Loading – In this sate, LSR, LSU and LSA (Link State
Acknowledgement) are exchanged.
Important – When a router receives DBD from other router, it
compares it’s own DBD with the other router DBD. If the received
DBD is more updated than its own DBD then the router will send LSR
to the other router stating what links are needed. The other router
replies with the LSU containing the updates that are needed. In return
to this, the router replies with the Link State Acknowledgement.
• Full – In this state, synchronization of all the information takes place.
OSPF routing can begin only after the Full state.
COMPUTER N/W
SARITA PATIL
138
OSPF
• OSPF Messages – OSPF is a very complex protocol. It uses five
different types of messages. These are as follows:
• Hello message (Type 1) – It is used by the routers to introduce itself to the
other routers.
• Database description message (Type 2) – It is normally send in response to
the Hello message.
• Link-state request message (Type 3) – It is used by the routers that need
information about specific Link-State packet.
• Link-state update message (Type 4) – It is the main OSPF message for
building Link-State Database.
• Link-state acknowledgement message (Type 5) – It is used to create
reliability in the OSPF protocol.
COMPUTER N/W
SARITA PATIL
139
• Timers –
• Hello timer – The interval in which OSPF router sends a hello
message on an interface. It is 10 seconds by default.
• Dead timer – The interval in which the neighbor will be declared dead
if it is not able to send the hello packet . It is 40 seconds by default.It
is usually 4 times the hello interval but can be configured manually
according to need.
COMPUTER N/W
SARITA PATIL
140
Border Gateway Protocol (BGP)
• Border Gateway Protocol (BGP) is used to Exchange routing
information for the internet and is the protocol used between ISP
which are different ASes.
• The protocol can connect together any internetwork of autonomous
system using an arbitrary topology.
• The only requirement is that each AS have at least one router that is
able to run BGP and that is router connect to at least one other AS’s
BGP router.
• BGP’s main function is to exchange network reach-ability information
with other BGP systems. Border Gateway Protocol constructs an
autonomous systems’ graph based on the information exchanged
between BGP routers.
COMPUTER N/W
SARITA PATIL
141
Characteristics of Border Gateway Protocol (BGP):
• Inter-Autonomous System Configuration: The main role of BGP is to provide
communication between two autonomous systems.
• BGP supports Next-Hop Paradigm.
• Coordination among multiple BGP speakers within the AS (Autonomous System).
• Path Information: BGP advertisement also include path information, along with
the reachable destination and next destination pair.
• Policy Support: BGP can implement policies that can be configured by the
administrator. For ex:- a router running BGP can be configured to distinguish
between the routes that are known within the AS and that which are known from
outside the AS.
• Runs Over TCP.
• BGP conserve network Bandwidth.
• BGP supports CIDR.
• BGP also supports Security.
COMPUTER N/W
SARITA PATIL
142
Functionality of Border Gateway Protocol (BGP):
BGP peers performs 3 functions, which are given below.
• The first function consist of initial peer acquisition and
authentication. both the peers established a TCP connection
and perform message exchange that guarantees both sides
have agreed to communicate.
• The second function mainly focus on sending of negative or
positive reach-ability information.
• The third function verifies that the peers and the network
connection between them are functioning correctly.
COMPUTER N/W
SARITA PATIL
143
BGP Route Information Management Functions:
• Route Storage:
Each BGP stores information about how to reach other networks.
• Route Update:
In this task, Special techniques are used to determine when and how
to use the information received from peers to properly update the
routes.
• Route Selection:
Each BGP uses the information in its route databases to select good
routes to each network on the internet network.
• Route advertisement:
Each BGP speaker regularly tells its peer what is knows about various
networks and methods to reach them.
COMPUTER N/W
SARITA PATIL
144

Mais conteúdo relacionado

Semelhante a UNIT2-nw layer autonomy.pptx

module10-rip (1).ppt
module10-rip (1).pptmodule10-rip (1).ppt
module10-rip (1).pptRakesh Dhiman
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
Unit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptUnit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptRamya Nellutla
 
Distance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing AlgorithmDistance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing AlgorithmMOHIT AGARWAL
 
Dc ch11 : routing in switched networks
Dc ch11 : routing in switched networksDc ch11 : routing in switched networks
Dc ch11 : routing in switched networksSyaiful Ahdan
 
destination. The network layer must know the topology of the subnet and choos...
destination. The network layer must know the topology of the subnet and choos...destination. The network layer must know the topology of the subnet and choos...
destination. The network layer must know the topology of the subnet and choos...Ashish Gupta
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsEast West University
 
NetworkAlgorithms.ppt
NetworkAlgorithms.pptNetworkAlgorithms.ppt
NetworkAlgorithms.ppt21121A0594
 
Routing Protocols.pptx
Routing Protocols.pptxRouting Protocols.pptx
Routing Protocols.pptxHirazNor
 
Unit 4_Network Layer_Part II.pptx
Unit 4_Network Layer_Part II.pptxUnit 4_Network Layer_Part II.pptx
Unit 4_Network Layer_Part II.pptxHODElex
 

Semelhante a UNIT2-nw layer autonomy.pptx (20)

computer communications
computer communicationscomputer communications
computer communications
 
module10-rip (1).ppt
module10-rip (1).pptmodule10-rip (1).ppt
module10-rip (1).ppt
 
CN WEEK 11.pdf
CN WEEK 11.pdfCN WEEK 11.pdf
CN WEEK 11.pdf
 
CCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. AdiseshaCCN Unit-4 Network Layer by Dr. K. Adisesha
CCN Unit-4 Network Layer by Dr. K. Adisesha
 
Routing.ppt
Routing.pptRouting.ppt
Routing.ppt
 
Unit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].pptUnit-3-Part-1 [Autosaved].ppt
Unit-3-Part-1 [Autosaved].ppt
 
Golu
GoluGolu
Golu
 
Golu
GoluGolu
Golu
 
Distance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing AlgorithmDistance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing Algorithm
 
Dc ch11 : routing in switched networks
Dc ch11 : routing in switched networksDc ch11 : routing in switched networks
Dc ch11 : routing in switched networks
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Ns lecture1: Introduction to Routing Protocol
Ns lecture1: Introduction to Routing ProtocolNs lecture1: Introduction to Routing Protocol
Ns lecture1: Introduction to Routing Protocol
 
Network_Layer.ppt
Network_Layer.pptNetwork_Layer.ppt
Network_Layer.ppt
 
destination. The network layer must know the topology of the subnet and choos...
destination. The network layer must know the topology of the subnet and choos...destination. The network layer must know the topology of the subnet and choos...
destination. The network layer must know the topology of the subnet and choos...
 
Comparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State ProtocolsComparative Analysis of Distance Vector Routing & Link State Protocols
Comparative Analysis of Distance Vector Routing & Link State Protocols
 
NetworkAlgorithms.ppt
NetworkAlgorithms.pptNetworkAlgorithms.ppt
NetworkAlgorithms.ppt
 
Routing Protocols.pptx
Routing Protocols.pptxRouting Protocols.pptx
Routing Protocols.pptx
 
Unit 4_Network Layer_Part II.pptx
Unit 4_Network Layer_Part II.pptxUnit 4_Network Layer_Part II.pptx
Unit 4_Network Layer_Part II.pptx
 
QSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network ConceptsQSpiders - Good to Know Network Concepts
QSpiders - Good to Know Network Concepts
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 

Último

Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...ZurliaSoop
 
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........deejay178
 
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Juli Boned
 
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabadgargpaaro
 
b-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardb-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardramyaul734
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaonmeghakumariji156
 
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...ruksarkahn825
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNBruce Bennett
 
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制yynod
 
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...nirzagarg
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Personal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando NegronPersonal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando Negronnegronf24
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Angela Justice, PhD
 
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Juli Boned
 
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 

Último (20)

Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hubli [ 7014168258 ] Call Me For Genuine Models We ...
 
Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........Gabriel_Carter_EXPOLRATIONpp.pptx........
Gabriel_Carter_EXPOLRATIONpp.pptx........
 
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
Specialize in a MSc within Biomanufacturing, and work part-time as Process En...
 
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad
7737669865 Call Girls In Ahmedabad Escort Service Available 24×7 In In Ahmedabad
 
b-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state boardb-sc-agri-course-curriculum.pdf for Karnataka state board
b-sc-agri-course-curriculum.pdf for Karnataka state board
 
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime MalegaonVip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
Vip Malegaon Escorts Service Girl ^ 9332606886, WhatsApp Anytime Malegaon
 
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...
Dating Call Girls inTiruvallur { 9332606886 } VVIP NISHA Call Girls Near 5 St...
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制
怎样办理伊利诺伊大学厄巴纳-香槟分校毕业证(UIUC毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rampur [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Agartala [ 7014168258 ] Call Me For Genuine Models ...
 
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Shivamogga [ 7014168258 ] Call Me For Genuine Model...
 
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Ratnagiri [ 7014168258 ] Call Me For Genuine Models...
 
Personal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando NegronPersonal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando Negron
 
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
Simple, 3-Step Strategy to Improve Your Executive Presence (Even if You Don't...
 
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Varanasi [ 7014168258 ] Call Me For Genuine Models ...
 
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
Novo Nordisk Kalundborg. We are expanding our manufacturing hub in Kalundborg...
 
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In daman [ 7014168258 ] Call Me For Genuine Models We ...
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 

UNIT2-nw layer autonomy.pptx

  • 2. Functions of Network Layer: • Internetworking: provides a logical connection between different devices. • Addressing: Identify the device on the internet. • Routing: determines the best optimal path out of the multiple paths from source to the destination. • Packetizing: receives the packets from the upper layer. This process of Packetizing is achieved by internet protocol (IP). COMPUTER N/W SARITA PATIL 2
  • 3. Routing algorithm • Determine the best route through which packets can be transmitted. • Whether the network layer provides datagram service or virtual circuit service, the main job of the network layer is to provide the best route. The routing protocol provides this job. • The routing protocol provides the best path from the source to the destination. • best path is the path that has the "least-cost path" from source to the destination. • Routing is the process of forwarding the packets from source to the destination but the best route to send the packets is determined by the routing algorithm. COMPUTER N/W SARITA PATIL 3
  • 4. Classification of a Routing algorithm The Routing algorithm is divided into two categories: Adaptive Routing algorithm Non-adaptive Routing algorithm COMPUTER N/W SARITA PATIL 4
  • 5. Adaptive Routing algorithm • An adaptive routing algorithm is also known as dynamic routing algorithm. • This algorithm makes the routing decisions based on the topology and network traffic. • The main parameters related to this algorithm are hop count, distance and estimated transit time. COMPUTER N/W SARITA PATIL 5
  • 6. An adaptive routing algorithm classified into three parts: • Centralized algorithm: • Known as global routing algorithm as it computes the least-cost path between source and destination by using complete and global knowledge about the network. • Algorithm takes the connectivity between the nodes and link cost as input, and this information is obtained before actually performing any calculation. • Link state algorithm is referred to as a centralized algorithm since it is aware of the cost of each link in the network. • Isolation algorithm: • algorithm that obtains the routing information by using local information rather than gathering information from other nodes. COMPUTER N/W SARITA PATIL 6
  • 7. • Distributed algorithm: • Known as decentralized algorithm as it computes the least-cost path between source and destination in an iterative and distributed manner. • no node has the knowledge about the cost of all the network links. • In the beginning, a node contains the information only about its own directly attached links and through an iterative process of calculation computes the least-cost path to the destination. • A Distance vector algorithm is a decentralized algorithm as it never knows the complete path from source to the destination, instead it knows the direction through which the packet is to be forwarded along with the least cost path. COMPUTER N/W SARITA PATIL 7
  • 8. Non-Adaptive Routing algorithm • Non Adaptive routing algorithm is also known as a static routing algorithm. • When booting up the network, the routing information stores to the routers. • Non Adaptive routing algorithms do not take the routing decision based on the network topology or network traffic. COMPUTER N/W SARITA PATIL 8
  • 9. Non-Adaptive Routing algorithm is of two types: • Flooding: • every incoming packet is sent to all the outgoing links except the one from it has been reached. • The disadvantage of flooding is that node may contain several copies of a particular packet. • Random walks: • a packet sent by the node to one of its neighbors randomly. • An advantage of using random walks is that it uses the alternative routes very efficiently. COMPUTER N/W SARITA PATIL 9
  • 10. Basis Of Comparison Adaptive Routing algorithm Non-Adaptive Routing algorithm Define constructs the routing table based on the network conditions. constructs the static table to determine which node to send the packet. Usage is used by dynamic routing. is used by static routing. Routing decision Routing decisions are made based on topology and network traffic. Routing decisions are the static tables. Categorization The types of adaptive routing algorithm, are Centralized, isolation and distributed algorithm. The types of Non Adaptive routing algorithm are flooding and random walks. Complexity Adaptive Routing algorithms are more complex. Non-Adaptive Routing algorithms are simple. Differences b/w Adaptive and Non-Adaptive Routing Algorithm COMPUTER N/W SARITA PATIL 10
  • 11. Distance Vector Routing Algorithm • The Distance vector algorithm is iterative, asynchronous and distributed. • Distributed: It is distributed in that each node receives information from one or more of its directly attached neighbours, performs calculation and then distributes the result back to its neighbors. • Iterative: It is iterative in that its process continues until no more information is available to be exchanged between neighbours. • Asynchronous: It does not require that all of its nodes operate in the lock step with each other. • The Distance vector algorithm is a dynamic algorithm. • It is mainly used in ARPANET, and RIP. • Each router maintains a distance table known as Vector. COMPUTER N/W SARITA PATIL 11
  • 12. Three Keys of Distance Vector Routing Algorithm: • Knowledge about the whole network: Each router shares its knowledge through the entire network. The Router sends its collected knowledge about the network to its neighbors. • Routing only to neighbors: The router sends its knowledge about the network to only those routers which have direct links. The router sends whatever it has about the network through the ports. The information is received by the router and uses the information to update its own routing table. • Information sharing at regular intervals: Within 30 seconds, the router sends the information to the neighboring routers. COMPUTER N/W SARITA PATIL 12
  • 13. Distance Vector Routing Algorithm • Distance vector routing is an asynchronous algorithm in which node x sends the copy of its distance vector to all its neighbors. • When node x receives the new distance vector from one of its neighboring vector, v, it saves the distance vector of v and uses the Bellman-Ford equation to update its own distance vector. The equation is given below: • dx(y) = minv{ c(x,v) + dv(y)} for each node y in N • The node x has updated its own distance vector table by using the above equation and sends its updated table to all its neighbors so that they can update their own distance vectors. COMPUTER N/W SARITA PATIL 13
  • 23. Link State Routing • Link state routing is a technique in which each router shares the knowledge of its neighborhood with every other router in the internetwork. COMPUTER N/W SARITA PATIL 23
  • 24. The three keys to understand the Link State Routing algorithm: •Knowledge about the neighborhood: Instead of sending its routing table, a router sends the information about its neighborhood only. A router broadcast its identities and cost of the directly attached links to other routers. •Flooding: Each router sends the information to every other router on the internetwork except its neighbors. This process is known as Flooding. Every router that receives the packet sends the copies to all its neighbors. Finally, each and every router receives a copy of the same information. •Information sharing: A router sends the information to every other router only when the change occurs in the information. COMPUTER N/W SARITA PATIL 24
  • 25. Link State Routing has two phases: • Reliable Flooding • Initial state: Each node knows the cost of its neighbors. • Final state: Each node knows the entire graph. • Route Calculation • Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes to all nodes. • The Link state routing algorithm is also known as Dijkstra's algorithm which is used to find the shortest path from one node to every other node in the network. • The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of the algorithm, the least cost paths are well known for k destination nodes. COMPUTER N/W SARITA PATIL 25
  • 26. some notations: c( i , j): Link cost from node i to node j. If i and j nodes are not directly linked, then c(i , j) = ∞. D(v): It defines the cost of the path from source code to destination v that has the least cost currently. P(v): It defines the previous node (neighbor of v) along with current least cost path from source to v. N: It is the total number of nodes available in the network. • Initialization • N = {A} // A is a root node. • for all nodes v • if v adjacent to A • then D(v) = c(A,v) • else D(v) = infinity • loop • find w not in N such that D(w) is a minimum. • Add w to N • Update D(v) for all v adjacent to w and not in N: • D(v) = min(D(v) , D(w) + c(w,v)) • Until all nodes in N COMPUTER N/W SARITA PATIL 26
  • 27. Step 1: The first step is an initialization step. The currently known least cost path from A to its directly attached neighbors, B, C, D are 2,5,1 respectively. The cost from A to B is set to 2, from A to D is set to 1 and from A to C is set to 5. The cost from A to E and F are set to infinity as they are not directly linked to A. Step 2: In the above table, we observe that vertex D contains the least cost path in step 1. Therefore, it is added in N. Now, we need to determine a least-cost path through D vertex. Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ COMPUTER N/W SARITA PATIL 27
  • 28. a) Calculating shortest path from A to B 1. v = B, w = D 2. D(B) = min( D(B) , D(D) + c(D,B) ) 3. = min( 2, 1+2)> 4. = min( 2, 3) The minimum value is 2. Therefore, the currently shortest path from A to B is 2. b) Calculating shortest path from A to C 1. v = C, w = D 2. D(B) = min( D(C) , D(D) + c(D,C) ) 3. = min( 5, 1+3) 4. = min( 5, 4) The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p> c) Calculating shortest path from A to E 1. v = E, w = D 2. D(B) = min( D(E) , D(D) + c(D,E) ) 3. = min( ∞, 1+1) 4. = min(∞, 2) The minimum value is 2. Therefore, the currently shortest path from A to E is 2. Note: The vertex D has no direct link to vertex E. Therefore, the value of D(F) is infinity. COMPUTER N/W SARITA PATIL 28
  • 29. • Step 3: • In the above table, we observe that both E and B have the least cost path in step 2. Let's consider the E vertex. Now, we determine the least cost path of remaining vertices through E. • a) Calculating the shortest path from A to B. • v = B, w = E • D(B) = min( D(B) , D(E) + c(E,B) ) • = min( 2 , 2+ ∞ ) • = min( 2, ∞) • The minimum value is 2. Therefore, the currently shortest path from A to B is 2. Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ 2 AD 2,A 4,D 2,D ∞ COMPUTER N/W SARITA PATIL 29
  • 30. • b) Calculating the shortest path from A to C. • v = C, w = E • D(B) = min( D(C) , D(E) + c(E,C) ) • = min( 4 , 2+1 ) • = min( 4,3) • The minimum value is 3. Therefore, the currently shortest path from A to C is 3. • c) Calculating the shortest path from A to F. • v = F, w = E • D(B) = min( D(F) , D(E) + c(E,F) ) • = min( ∞ , 2+2 ) • = min(∞ ,4) • The minimum value is 4. Therefore, the currently shortest path from A to F is 4. Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ 2 AD 2,A 4,D 2,D ∞ 3 ADE 2,A 3,E 4,E COMPUTER N/W SARITA PATIL 30
  • 31. Step 4: In the above table, we observe that B vertex has the least cost path in step 3. Therefore, it is added in N. Now, we determine the least cost path of remaining vertices through B. a) Calculating the shortest path from A to C. 1. v = C, w = B 2. D(B) = min( D(C) , D(B) + c(B,C) ) 3. = min( 3 , 2+3 ) 4. = min( 3,5) 5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3. b) Calculating the shortest path from A to F. 1. v = F, w = B 2. D(B) = min( D(F) , D(B) + c(B,F) ) 3. = min( 4, ∞) 4. = min(4, ∞) 5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4. COMPUTER N/W SARITA PATIL 31
  • 32. Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ 2 AD 2,A 4,D 2,D ∞ 3 ADE 2,A 3,E 4,E 4 ADEB 3,E 4,E Step 5: In the above table, we observe that C vertex has the least cost path in step 4. Therefore, it is added in N. Now, we determine the least cost path of remaining vertices through C. a) Calculating the shortest path from A to F. 1. v = F, w = C 2. D(B) = min( D(F) , D(C) + c(C,F) ) 3. = min( 4, 3+5) 4. = min(4,8) 5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4. COMPUTER N/W SARITA PATIL 32
  • 33. Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ 2 AD 2,A 4,D 2,D ∞ 3 ADE 2,A 3,E 4,E 4 ADEB 3,E 4,E 5 ADEBC 4,E Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F) 1 A 2,A 5,A 1,A ∞ ∞ 2 AD 2,A 4,D 2,D ∞ 3 ADE 2,A 3,E 4,E 4 ADEB 3,E 4,E 5 ADEBC 4,E 6 ADEBCF Final table: COMPUTER N/W SARITA PATIL 33
  • 34. Disadvantage: Heavy traffic is created in Line state routing due to Flooding. Flooding can cause an infinite looping, this problem can be solved by using Time-to-leave field COMPUTER N/W SARITA PATIL 34
  • 35. Network Layer Protocols COMPUTER N/W SARITA PATIL 35
  • 36. ARP • ARP stands for Address Resolution Protocol. • It is used to associate an IP address with the MAC address. • Each device on the network is recognized by the MAC address imprinted on the NIC. • we can say that devices need the MAC address for communication on a local area network. • MAC address can be changed easily. • For example, if the NIC on a particular machine fails, the MAC address changes but IP address does not change. ARP is used to find the MAC address of the node when an internet address is known. COMPUTER N/W SARITA PATIL 36
  • 37. Types of Mapping in ARP • There are two different ways to map the IP address into the MAC address, which are given below: • Static Mapping • Dynamic Mapping • Static Mapping - In the static mapping, a table consists of a logical address and corresponding physical address of the destination device. In this, the IP and MAC address of the device is entered manually in an ARP table. The source device has to access the table first if a source wants to communicate with the destination device. • Dynamic Mapping - In the dynamic mapping, if a device knows the logical address of the other device, then by using the Address Resolution protocol, this device will also find the physical address of the device. The dynamic entries are created automatically when the source device sends an ARP broadcast request. These entries are not permanent and cleared periodically. • The dynamic mapping is also used in the Reverse Address Resolution Protocol. COMPUTER N/W SARITA PATIL 37
  • 38. Types of ARP There are four types of Address Resolution Protocol, which is given below: o Proxy ARP o Gratuitous ARP o Reverse ARP (RARP) o Inverse ARP • Proxy ARP - Proxy ARP is a method through which a Layer 3 devices 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 map the MAC address of the router with the target IP address and fool the sender that it is reached at its destination. COMPUTER N/W SARITA PATIL 38
  • 39. • 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 pretend 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. COMPUTER N/W SARITA PATIL 39
  • 40. • 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. • 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. COMPUTER N/W SARITA PATIL 40
  • 41. • 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 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. COMPUTER N/W SARITA PATIL 41
  • 42. • Inverse ARP (InARP) - 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 InARP. • The InARP has a similar packet format as ARP, but operational codes are different. COMPUTER N/W SARITA PATIL 42
  • 43. • MAC address: The MAC address is used to identify the actual device. • IP address: It is an address used to locate a device on the network. How ARP works • If the host wants to know the physical address of another host on its network, then it sends an ARP query packet that includes the IP address and broadcast it over the network. Every host on the network receives and processes the ARP packet, but only the intended recipient recognizes the IP address and sends back the physical address. The host holding the datagram adds the physical address to the cache memory and to the datagram header, then sends back to the sender. COMPUTER N/W SARITA PATIL 43
  • 45. If a device wants to communicate with another device, the following steps are taken by the device: • The device will first look at its internet list, called the ARP cache to check whether an IP address contains a matching MAC address or not. • It will check the ARP cache in command prompt by using a command arp-a. COMPUTER N/W SARITA PATIL 45
  • 46. •If ARP cache is empty, then device broadcast the message to the address is received by the device, then the communication can take place between two devices. •If the device receives the MAC address, then the MAC address gets stored in the ARP cache. We can entire network asking each device for a matching MAC address. •The device that has the matching IP address will then respond back to the sender with its MAC address •Once the MAC check the ARP cache in command prompt by using a command arp -a. COMPUTER N/W SARITA PATIL 46
  • 48. There are two types of ARP entries: • Dynamic entry: It is an entry which is created automatically when the sender broadcast its message to the entire network. Dynamic entries are not permanent, and they are removed periodically. • Static entry: It is an entry where someone manually enters the IP to MAC address association by using the ARP command utility. COMPUTER N/W SARITA PATIL 48
  • 49. RARP • RARP stands for Reverse Address Resolution Protocol. • If the host wants to know its IP address, then it broadcast the RARP query packet that contains its physical address to the entire network. A RARP server on the network recognizes the RARP packet and responds back with the host IP address. • The protocol which is used to obtain the IP address from a server is known as Reverse Address Resolution Protocol. • The message format of the RARP protocol is similar to the ARP protocol. • Like ARP frame, RARP frame is sent from one machine to another encapsulated in the data portion of a frame. COMPUTER N/W SARITA PATIL 49
  • 51. ICMP • ICMP stands for Internet Control Message Protocol. • The ICMP is a network layer protocol used by hosts and routers to send the notifications of IP datagram problems back to the sender. • ICMP uses echo test/reply to check whether the destination is reachable and responding. • ICMP handles both control and error messages, but its main function is to report the error but not to correct them. • An IP datagram contains the addresses of both source and destination, but it does not know the address of the previous router through which it has been passed. Due to this reason, ICMP can only send the messages to the source, but not to the immediate routers. • ICMP protocol communicates the error messages to the sender. ICMP messages cause the errors to be returned back to the user processes. • ICMP messages are transmitted within IP datagram. COMPUTER N/W SARITA PATIL 51
  • 52. The Format of an ICMP message o The first field specifies the type of the message. o The second field specifies the reason for a particular message type. o The checksum field covers the entire ICMP message. COMPUTER N/W SARITA PATIL 52
  • 53. Error Reporting • ICMP protocol reports the error messages to the sender. •Five types of errors are handled by the ICMP protocol: • Destination unreachable • Source Quench • Time Exceeded • Parameter problems • Redirection COMPUTER N/W SARITA PATIL 53
  • 54. O Destination unreachable: The message of "Destination Unreachable" is sent from receiver to the sender when destination cannot be reached, or packet is discarded when the destination is not reachable. COMPUTER N/W SARITA PATIL 54
  • 55. • Source Quench: The purpose of the source quench message is congestion control. The message sent from the congested router to the source host to reduce the transmission rate. ICMP will take the IP of the discarded packet and then add the source quench message to the IP datagram to inform the source host to reduce its transmission rate. The source host will reduce the transmission rate so that the router will be free from congestion. • Time Exceeded: Time Exceeded is also known as "Time-To-Live". It is a parameter that defines how long a packet should live before it would be discarded. • Time Exceeded: packet discarded due to some bad routing implementation, and this causes the looping issue and network congestion destination host does not receive all the fragments in a certain time limit COMPUTER N/W SARITA PATIL 55
  • 56. • Parameter problems: When a router or host discovers any missing value in the IP datagram, the router discards the datagram, and the "parameter problem" message is sent back to the source host. • Redirection: Redirection message is generated when host consists of a small routing table. When the host consists of a limited number of entries due to which it sends the datagram to a wrong router. The router that receives a datagram will forward a datagram to a correct router and also sends the "Redirection message" to the host to update its routing table. COMPUTER N/W SARITA PATIL 56
  • 57. IGMP • IGMP stands for Internet Group Message Protocol. • The IP protocol supports two types of communication: • Unicasting: It is a communication between one sender and one receiver. Therefore, we can say that it is one-to-one communication. • Multicasting: Sometimes the sender wants to send the same message to a large number of receivers simultaneously. This process is known as multicasting which has one-to-many communication. • The IGMP protocol is used by the hosts and router to support multicasting. • The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the members of a group. COMPUTER N/W SARITA PATIL 57
  • 59. o IGMP is a part of the IP layer, and IGMP has a fixed-size message. o The IGMP message is encapsulated within an IP datagram. The Format of IGMP message COMPUTER N/W SARITA PATIL 59
  • 60. • Type: It determines the type of IGMP message. • three types of IGMP message: Membership Query, Membership Report and Leave Report. • Maximum Response Time: This field is used only by the Membership Query message. It determines the maximum time the host can send the Membership Report message in response to the Membership Query message. • Checksum: It determines the entire payload of the IP datagram in which IGMP message is encapsulated. • Group Address: The behaviour of this field depends on the type of the message sent. • For Membership Query, the group address is set to zero for General Query and set to multicast group address for a specific query. • For Membership Report, the group address is set to the multicast group address. • For Leave Group, it is set to the multicast group address. COMPUTER N/W SARITA PATIL 60
  • 62. Membership Query message • This message is sent by a router to all hosts on a local area network to determine the set of all the multicast groups that have been joined by the host. • It also determines whether a specific multicast group has been joined by the hosts on a attached interface. • The group address in the query is zero since the router expects one response from a host for every group that contains one or more members on that host. COMPUTER N/W SARITA PATIL 62
  • 63. • Membership Report message • The host responds to the membership query message with a membership report message. • Membership report messages can also be generated by the host when a host wants to join the multicast group without waiting for a membership query message from the router. • Membership report messages are received by a router as well as all the hosts on an attached interface. • Each membership report message includes the multicast address of a single group that the host wants to join. • IGMP protocol does not care which host has joined the group or how many hosts are present in a single group. It only cares whether one or more attached hosts belong to a single multicast group. COMPUTER N/W SARITA PATIL 63
  • 64. • The membership Query message sent by a router also includes a "Maximum Response time". After receiving a membership query message and before sending the membership report message, the host waits for the random amount of time from 0 to the maximum response time. If a host observes that some other attached host has sent the "Maximum Report message", then it discards its "Maximum Report message" as it knows that the attached router already knows that one or more hosts have joined a single multicast group. This process is known as feedback suppression. It provides the performance optimization, thus avoiding the unnecessary transmission of a "Membership Report message". COMPUTER N/W SARITA PATIL 64
  • 65. Leave Report • When the host does not send the "Membership Report message", it means that the host has left the group. The host knows that there are no members in the group, so even when it receives the next query, it would not report the group. COMPUTER N/W SARITA PATIL 65
  • 67. • Network Addressing is one of the major responsibilities of the network layer. • Network addresses are always logical, i.e., software-based addresses. • A host is also known as end system that has one link to the network. • Interface :boundary between the host and link is known as an. • Host can have only one interface. • A router is different from the host in that it has two or more links that connect to it. • Router forwards the datagram, then it forwards the packet to one of the links. • The boundary between the router and link is known as an interface, • the router can have multiple interfaces, one for each of its links. • Each interface is capable of sending and receiving the IP packets, so IP requires each interface to have an address. COMPUTER N/W SARITA PATIL 67
  • 68. • Each IP address is 32 bits long, and they are represented in the form of "dot-decimal notation" where each byte is written in the decimal form, and they are separated by the period. • An IP address would look like 193.32.216.9 where 193 represents the decimal notation of first 8 bits of an address, 32 represents the decimal notation of second 8 bits of an address. COMPUTER N/W SARITA PATIL 68
  • 69. • In the above figure, a router has three interfaces labeled as 1, 2 & 3 and each router interface contains its own IP address. • Each host contains its own interface and IP address. • All the interfaces attached to the LAN 1 is having an IP address in the form of 223.1.1.xxx, and the interfaces attached to the LAN 2 and LAN 3 have an IP address in the form of 223.1.2.xxx and 223.1.3.xxx respectively. • Each IP address consists of two parts. The first part (first three bytes in IP address) specifies the network and second part (last byte of an IP address) specifies the host in the network. COMPUTER N/W SARITA PATIL 69
  • 70. Classful Addressing • An IP address is 32-bit long. An IP address is divided into sub-classes: • Class A • Class B • Class C • Class D • Class E • An IP address is divided into two parts: • Network ID: It represents the number of networks. • Host ID: It represents the number of hosts. COMPUTER N/W SARITA PATIL 70
  • 71. The class of IP address is used to determine the number of bits used in a class and number of networks and hosts available in the class. COMPUTER N/W SARITA PATIL 71
  • 72. Class A • In Class A, an IP address is assigned to those networks that contain a large number of hosts. • The network ID is 8 bits long. • The host ID is 24 bits long. • In Class A, the first bit in higher order bits of the first octet is always set to 0 and the remaining 7 bits determine the network ID. The 24 bits determine the host ID in any network. • The total number of networks in Class A = 27 = 128 network address • The total number of hosts in Class A = 224 - 2 = 16,777,214 host address(You subtract two to reserve one IP for the network ID and one for the broadcast address.) COMPUTER N/W SARITA PATIL 72
  • 73. Class B • In Class B, an IP address is assigned to those networks that range from small-sized to large-sized networks. • The Network ID is 16 bits long. • The Host ID is 16 bits long. • In Class B, the higher order bits of the first octet is always set to 10, and the remaining14 bits determine the network ID. The other 16 bits determine the Host ID. • The total number of networks in Class B = 214 = 16384 network address • The total number of hosts in Class B = 216 - 2 = 65534 host address COMPUTER N/W SARITA PATIL 73
  • 74. Class C • In Class C, an IP address is assigned to only small-sized networks. • The Network ID is 24 bits long. • The host ID is 8 bits long. • In Class C, the higher order bits of the first octet is always set to 110, and the remaining 21 bits determine the network ID. The 8 bits of the host ID determine the host in a network. • The total number of networks = 221 = 2097152 network address • The total number of hosts = 28 - 2 = 254 host address COMPUTER N/W SARITA PATIL 74
  • 75. Class D • In Class D, an IP address is reserved for multicast addresses. It does not possess subnetting. The higher order bits of the first octet is always set to 1110, and the remaining bits determines the host ID in any network. Multicasting allows a single host to send a single stream of data to thousands of hosts across the Internet at the same time. It is often used for audio and video streaming, such as IP-based cable TV networks. Another example is the delivery of real-time stock market data from one source to many brokerage companies. • Class E • In Class E, an IP address is used for the future use or for the research and development purposes. It does not possess any subnetting. The higher order bits of the first octet is always set to 1111, and the remaining bits determines the host ID in any network. COMPUTER N/W SARITA PATIL 75
  • 76. Class D In Class D, an IP address is reserved for multicast addresses. It does not possess subnetting. The higher order bits of the first octet is always set to 1110, and the remaining bits determines the host ID in any network. Class E In Class E, an IP address is used for the future use or for the research and development purposes. It does not possess any subnetting. The higher order bits of the first octet is always set to 1111, and the remaining bits determines the host ID in any network. COMPUTER N/W SARITA PATIL 76
  • 77. Rules for assigning Host ID: • The Host ID is used to determine the host within any network. The Host ID is assigned based on the following rules: • The Host ID must be unique within any network. • The Host ID in which all the bits are set to 0 cannot be assigned as it is used to represent the network ID of the IP address. • The Host ID in which all the bits are set to 1 cannot be assigned as it is reserved for the multicast address COMPUTER N/W SARITA PATIL 77
  • 78. Rules for assigning Network ID: • If the hosts are located within the same local network, then they are assigned with the same network ID. The following are the rules for assigning Network ID: • o The network ID cannot start with 127 as 127 is used by Class A. • o The Network ID in which all the bits are set to 0 cannot be assigned as it is used to specify a particular host on the local network. • o The Network ID in which all the bits are set to 1 cannot be assigned as it is reserved for the multicast address. COMPUTER N/W SARITA PATIL 78
  • 79. Classful Network Architecture COMPUTER N/W SARITA PATIL 79 Class Higher bits NET ID bits HOST ID bits No.of networks No.of hosts per network Range A 0 8 24 27 224 0.0.0.0 to 127.255.255.255 B 10 16 16 214 216 128.0.0.0 to 191.255.255.255 C 110 24 8 221 28 192.0.0.0 to 223.255.255.255 D 1110 Not Defined Not Defined Not Defined Not Defined 224.0.0.0 to 239.255.255.255 E 1111 Not Defined Not Defined Not Defined Not Defined 240.0.0.0 to 255.255.255.255
  • 80. IPv4 vs IPv6 • 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. • 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). • An IP address consists of two parts, i.e., the first one is a network address, and the other one is a host address. • two types of IP addresses: • IPv4 • IPv6 COMPUTER N/W SARITA PATIL 80
  • 81. 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. COMPUTER N/W SARITA PATIL 81
  • 82. • 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. • Representation of 8 Bit Octet COMPUTER N/W SARITA PATIL 82
  • 83. • how to obtain the binary representation of the above IP address, i.e., 66.94.29.13 • 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. COMPUTER N/W SARITA PATIL 83
  • 84. • 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. COMPUTER N/W SARITA PATIL 84
  • 85. Drawback of IPv4 • IPv4 produces 4 billion addresses, which are not enough for each device connected to the internet on a planet • 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 • still, IPV4 is not so efficient, so IPV6 COMPUTER N/W SARITA PATIL 85
  • 86. IPv6 • IPv6 is the next generation of IP addresses. • The main difference between IPv4 and IPv6 is the address size of IP addresses. • 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 COMPUTER N/W SARITA PATIL 86
  • 87. strategies to convert IPv4 into IPv6 • 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 communicates with an IPv4 network to reach IPv6. • Network Address Translation: The translation allows the communication between the hosts having a different version of IP. • hexadecimal address contains both numbers and alphabets hence 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 COMPUTER N/W SARITA PATIL 87
  • 88. • Address format • The address format of IPv4 • The address format of IPv6: COMPUTER N/W SARITA PATIL 88
  • 89. • An IPv4 is a 32-bit decimal address. It contains 4 octets or fields separated by 'dot', and each field is 8-bit • IPv6 is a 128-bit hexadecimal address. It contains 8 fields separated by a colon, and each field is 16-bit in size COMPUTER N/W SARITA PATIL 89 Ipv4 Ipv6 Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address. Fields IPv4 is a numeric address that consists of 4 fields which are separated by dot (.). IPv6 is an alphanumeric address that consists of 8 fields, which are separated by colon. Classes IPv4 has 5 different classes of IP address that includes Class A, Class B, Class C, Class D, and Class E. IPv6 does not contain classes of IP addresses. Number of IP address IPv4 has a limited number of IP addresses. IPv6 has a large number of IP addresses.
  • 90. Address space It generates 4 billion unique addresses It generates 340 undecillion unique addresses. End-to-end connection integrity In IPv4, end-to-end connection integrity is unachievable. In the case of IPv6, end-to-end connection integrity is achievable. Security features In IPv4, security depends on the application. This IP address is not developed in keeping the security feature in mind. In IPv6, IPSEC is developed for security purposes. Address representation In IPv4, the IP address is represented in decimal. In IPv6, the representation of the IP address in hexadecimal. Fragmentation Fragmentation is done by the senders and the forwarding routers. Fragmentation is done by the senders only. Packet flow identification It does not provide any mechanism for packet flow identification. It uses flow label field in the header for the packet flow identification. Checksum field The checksum field is available in IPv4. The checksum field is not available in IPv6. Transmission scheme IPv4 is broadcasting. On the other hand, IPv6 is multicasting, which provides efficient network operations. Encryption and Authentication It does not provide encryption and authentication. It provides encryption and authentication. COMPUTER N/W SARITA PATIL 90
  • 91. Subnetting in Networking • The process of dividing a single network into multiple sub networks is called as subnetting. • The sub networks so created are called as subnets. • It improves the security. • The maintenance and administration of subnets is easy. COMPUTER N/W SARITA PATIL 91
  • 92. Subnet ID- • Each subnet has its unique network address known as its Subnet ID. • The subnet ID is created by borrowing some bits from the Host ID part of the IP Address. • The number of bits borrowed depends on the number of subnets created. • Types of Subnetting-FLSM,VLSM COMPUTER N/W SARITA PATIL 92
  • 93. 1. Fixed Length Subnetting- • Fixed length subnetting also called as classful subnetting divides the network into subnets where- •All the subnets are of same size. •All the subnets have equal number of hosts. •All the subnets have same subnet mask(valid IP range for the N/w). 2. Variable Length Subnetting- • Variable length subnetting also called as classless subnetting divides the network into subnets where- •All the subnets are not of same size. •All the subnets do not have equal number of hosts. •All the subnets do not have same subnet mask. COMPUTER N/W SARITA PATIL 93
  • 94. Example-01: We have a big single network having IP Address 200.1.2.0. • We want to do subnetting and divide this network into 2 subnets. • Given network belongs to class C • For creating two subnets and to represent their subnet IDs, • we require 1 bit. • So borrow one bit from the Host ID part. • After borrowing one bit, Host ID part remains with only 7 bits. COMPUTER N/W SARITA PATIL 94
  • 95. • If borrowed bit = 0, then it represents the first subnet. • If borrowed bit = 1, then it represents the second subnet. • IP Address of the two subnets are- • 200.1.2.00000000 = 200.1.2.0 • 200.1.2.10000000 = 200.1.2.128 COMPUTER N/W SARITA PATIL 95
  • 96. • For 1st Subnet- • • IP Address of the subnet = 200.1.2.0 • Total number of IP Addresses = 27 = 128 • Total number of hosts that can be configured = 128 – 2 = 126 • Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] = [200.1.2.0, 200.1.2.127] • Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 96
  • 97. • For 2nd Subnet- • • IP Address of the subnet = 200.1.2.128 • Total number of IP Addresses = 27 = 128 • Total number of hosts that can be configured = 128 – 2 = 126 • Range of IP Addresses = [200.1.2.10000000, 200.1.2.11111111] = [200.1.2.128, 200.1.2.255] • Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 97
  • 98. Example-02: • We have a big single network having IP Address 200.1.2.0. • We want to do subnetting and divide this network into 4 subnets. • • Clearly, the given network belongs to class C. • For creating four subnets and to represent their subnet IDs, we require 2 bits. • So, We borrow two bits from the Host ID part. • After borrowing two bits, Host ID part remains with only 6 bits. COMPUTER N/W SARITA PATIL 98
  • 99. • If borrowed bits = 00, then it represents the 1st subnet. • If borrowed bits = 01, then it represents the 2nd subnet. • If borrowed bits = 10, then it represents the 3rd subnet. • If borrowed bits = 11, then it represents the 4th subnet. COMPUTER N/W SARITA PATIL 99
  • 100. • IP Address of the four subnets are- • 200.1.2.00000000 = 200.1.2.0 • 200.1.2.01000000 = 200.1.2.64 • 200.1.2.10000000 = 200.1.2.128 • 200.1.2.11000000 = 200.1.2.192 COMPUTER N/W SARITA PATIL 100
  • 101. • For 1st Subnet- • • IP Address of the subnet = 200.1.2.0 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.00000000, 200.1.2.00111111] = [200.1.2.0, 200.1.2.63] • Direct Broadcast Address = 200.1.2.00111111 = 200.1.2.63 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 101
  • 102. • For 2nd Subnet- • • IP Address of the subnet = 200.1.2.64 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.01000000, 200.1.2.01111111] = [200.1.2.64, 200.1.2.127] • Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 102
  • 103. • For 3rd Subnet- • • IP Address of the subnet = 200.1.2.128 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.10000000, 200.1.2.10111111] = [200.1.2.128, 200.1.2.191] • Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 103
  • 104. • For 4th Subnet- • • IP Address of the subnet = 200.1.2.192 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.11000000, 200.1.2.11111111] = [200.1.2.192, 200.1.2.255] • Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 104
  • 105. Example-03: • We have a big single network having IP Address 200.1.2.0. • We want to do subnetting and divide this network into 3 subnets. • Here, the subnetting will be performed in two steps- • Dividing the given network into 2 subnets • Dividing one of the subnets further into 2 subnets • Step-01: Dividing Given Network into 2 Subnets- • The subnetting will be performed exactly in the same way as performed in Example-01. • After subnetting, we have- COMPUTER N/W SARITA PATIL 105
  • 106. COMPUTER N/W SARITA PATIL 106 Step-02: Dividing One Subnet into 2 Subnets-  perform the subnetting of one of the subnets further into 2 subnets.  Consider we want to do subnetting of the 2nd subnet having IP Address 200.1.2.128. For creating two subnets and to represent their subnet IDs, we require 1 bit.  We borrow one more bit from the Host ID part.  After borrowing one bit, Host ID part remains with only 6 bits.
  • 107. COMPUTER N/W SARITA PATIL 107  If 2nd borrowed bit = 0, then it represents one subnet.  If 2nd borrowed bit = 1, then it represents the other subnet. IP Address of the two subnets are-  200.1.2.10000000 = 200.1.2.128  200.1.2.11000000 = 200.1.2.192 Finally, the given single network is divided into 3 subnets having IP Address- 200.1.2.0 200.1.2.128 200.1.2.192
  • 108. • For 1st Subnet- • • IP Address of the subnet = 200.1.2.0 • Total number of IP Addresses = 27 = 128 • Total number of hosts that can be configured = 128 – 2 = 126 • Range of IP Addresses = [200.1.2.00000000, 200.1.2.01111111] = [200.1.2.0, 200.1.2.127] • Direct Broadcast Address = 200.1.2.01111111 = 200.1.2.127 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 108
  • 109. For 2nd Subnet- • IP Address of the subnet = 200.1.2.128 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.10000000, 200.1.2.10111111] = [200.1.2.128, 200.1.2.191] • Direct Broadcast Address = 200.1.2.10111111 = 200.1.2.191 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 109
  • 110. For 3rd Subnet- • IP Address of the subnet = 200.1.2.192 • Total number of IP Addresses = 26 = 64 • Total number of hosts that can be configured = 64 – 2 = 62 • Range of IP Addresses = [200.1.2.11000000, 200.1.2.11111111] = [200.1.2.192, 200.1.2.255] • Direct Broadcast Address = 200.1.2.11111111 = 200.1.2.255 • Limited Broadcast Address = 255.255.255.255 COMPUTER N/W SARITA PATIL 110
  • 111. Disadvantages of Subnetting- • We have to face a loss of IP Addresses. • This is because two IP Addresses are wasted for each subnet. • One IP address is wasted for its network address. • Other IP Address is wasted for its direct broadcasting address • the communication process becomes complex • Identifying the network • Identifying the sub network • Identifying the host • Identifying the process COMPUTER N/W SARITA PATIL 111
  • 112. CIDR • CIDR Notation. A system called Classless Inter-Domain Routing, or CIDR, was developed as an alternative to traditional subnetting. • The idea is that you can add a specification in the IP address itself as to the number of significant bits that make up the routing or networking portion • an address or routing prefix is written with a suffix indicating the number of bits of the prefix, such as 192.0. 2.0/24 for IPv4, and 2001:db8::/32 for IPv6. COMPUTER N/W SARITA PATIL 112
  • 113. Supernetting • Supernetting is the process of summarizing a bunch of contiguous Subnetted networks back in a single large network. Supernetting is also known as route summarization and route aggregation. COMPUTER N/W SARITA PATIL 113
  • 114. Why Supernetting is done? • Supernetting is mainly done for optimizing the routing tables. A routing table is the summary of all known networks. Routers share routing tables to find the new path and locate the best path for destination. • Without Supernetting, router will share all routes from routing tables as they are. • With Supernetting, it will summarize them before sharing. Route summarization reduces the size of routing updates dramatically. COMPUTER N/W SARITA PATIL 114
  • 115. COMPUTER N/W SARITA PATIL 115 Advantage of Supernetting Supernetting provides following advantages. It reduces the size of routing updates. It provides a better overview of network. It decreases the use of resources such as Memory and CPU. It decreases the required time in rebuilding the routing tables.
  • 116. • to perform the Supernetting, we need Network ID, CIDR Value, Broadcast ID, Subnet Mask and Block Size of each route. • Network ID and broadcast ID are used to check the alignment of routes. Supernetting can be performed only if routes are sequential. • Block size is used to calculate the summarized route from given routes. • Subnet mask and CIDR value is the same thing in different notations. Both are used to find the ON network bits in IP address. In exam, question may use any notation. While preparing for Cisco exam, you should practice with both. • Since an advertise route is the combination of network ID and CIDR value, we only need to figure out the broadcast ID, subnet mask and block size. COMPUTER N/W SARITA PATIL 116
  • 117. • For block size use following formulas:- • 32-25=7, 2 to the power 7=128 • Broadcast ID is the last address of network. Once you know the block size, to calculate the broadcast ID, simply count the addresses starting from network ID till the last address of the block. • For example if network ID is 192.168.1.0/25 and block size is 128 and then broadcast ID will be 192.168.1.127/25. • In counting, the 0 is used as a number. For example, [0, 1 and 2] are 3 numbers. COMPUTER N/W SARITA PATIL 117 32 – CIDR Value = Number of host bits Block size = 2Number of host bits For example if CIDR value is 25 then block is 128.
  • 118. Hierarchical Routing • Both LS and DV algorithms, every router has to save some information about other routers. • When the network size grows, the number of routers in the network increases. Consequently, the size of routing tables increases, as well, and routers can't handle network traffic as efficiently. • We use hierarchical routing to overcome this problem. • We use DV algorithms to find best routes between nodes. • In the situation depicted below, every node of the network has to save a routing table with 17 records. COMPUTER N/W SARITA PATIL 118
  • 120. graph and routing table for A: COMPUTER N/W SARITA PATIL 120 Destination Line Weight A -- -- B B 1 C C 1 REGION 2 B 2 REGION 3 C 2 REGION 4 C 3 REGION 5 C 4
  • 121. • In hierarchical routing, routers are classified in groups known as regions. • Each router has only the information about the routers in its own region and has no information about routers in other regions. • So routers just save one record in their table for every other region. In this example, we have classified our network into five regions • If A wants to send packets to any router in region 2 (D, E, F or G), it sends them to B, and so on. • In this type of routing, the tables can be summarized, so network efficiency improves. • The above example shows two-level hierarchical routing. • We can also use three- or four-level hierarchical routing. COMPUTER N/W SARITA PATIL 121
  • 122. • In three-level hierarchical routing, the network is classified into a number of clusters. • Each cluster is made up of a number of regions, and each region contains a number or routers. • Hierarchical routing is widely used in Internet routing and makes use of several routing protocols. COMPUTER N/W SARITA PATIL 122
  • 123. Unicast Routing Protocols: Routing Protocols: RIP, OSPF, and BGP • An internet is a combination of networks connected by routers • How to pass a packet from source to destination ? Which of the available pathways is the optimum pathway ? • Depends on the metric • Metric: a cost assigned for passing through a network • A router should choose the route with the smallest metric COMPUTER N/W SARITA PATIL 123
  • 124. Introduction • The metric assigned to each network depends on the type of protocol • RIP (Routing Information Protocol) • Treat each network as equal • The cost of passing through each network is the same: one hop count • Open Shortest Path First (OSPF) • Allow administrator to assign a cost for passing through a network based on the type of serviced required • For example, maximum throughput or minimum delay • Border Gateway Protocol (BGP) • The criterion is the policy, which can be set by the administrator COMPUTER N/W SARITA PATIL 124
  • 125. Routing Information Protocol (RIP) • Routing Information Protocol (RIP) is a dynamic routing protocol which uses hop count as a routing metric to find the best path between the source and the destination network. It is a distance vector routing protocol which has AD value 120 and works on the application layer of OSI model. RIP uses port number 520. • Hop Count : Hop count is the number of routers occurring in between the source and destination network. The path with the lowest hop count is considered as the best route to reach a network and therefore placed in the routing table. RIP prevents routing loops by limiting the number of hopes allowed in a path from source and destination. The maximum hop count allowed for RIP is 15 and hop count of 16 is considered as network unreachable. • 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. 4. Routers always trust on routing information received from neighbor routers. This is also known as Routing on rumours. • RIP versions : There are three vesions of routing information protocol – RIP Version1, RIP Version2 and RIPng. COMPUTER N/W SARITA PATIL 125
  • 126. • RIP v1 is known as Classful Routing Protocol because it doesn’t send information of subnet mask in its routing update. • RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in its routing update. COMPUTER N/W SARITA PATIL 126 >> Use debug command to get the details : # debug ip rip >> Use this command to show all routes configured in router, say for router R1 : R1# show ip route >> Use this command to show all protocols configured in router, say for router R1 : R1# show ip protocols
  • 127. COMPUTER N/W SARITA PATIL 127 RIP V1 RIP V2 RIPNG Sends update as broadcast Sends update as multicast Sends update as multicast Broadcast at 255.255.255.255 Multicast at 224.0.0.9 Multicast at FF02::9 (RIPng can only run on IPv6 networks) Doesn’t support authentication of update messages Supports authentication of RIPv2 update messages – Classful routing protocol Classless protocol, supports classful Classless updates are sent
  • 128. 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. COMPUTER N/W SARITA PATIL 128
  • 129. • Configure RIP for R1 : • R1(config)# router rip • R1(config-router)# network 192.168.20.0 • R1(config-router)# network 172.16.10.4 • R1(config-router)# version 2 • R1(config-router)# no auto-summary • Configureg RIP for R2 : • R2(config)# router rip • R2(config-router)# network 192.168.10.0 • R2(config-router)# network 172.16.10.0 • R2(config-router)# version 2 • R2(config-router)# no auto-summary COMPUTER N/W SARITA PATIL 129
  • 130. • Similarly, Configure RIP for R3 : • R3(config)# router rip • R3(config-router)# network 10.10.10.0 • R3(config-router)# network 172.16.10.4 • R3(config-router)# network 172.16.10.0 • R3(config-router)# version 2 • R3(config-router)# no auto-summary • Note:: no auto-summary command disables the auto-summarisation. If we don’t select no auto-summary, then subnet mask will be considered as classful in Version 1. COMPUTER N/W SARITA PATIL 130
  • 131. • RIP timers : • Update timer : The default timing for routing information being exchanged by the routers operating RIP is 30 seconds. Using Update timer, the routers exchange their routing table periodically. • Invalid timer: If no update comes until 180 seconds, then the destination router consider it as invalid. In this scenario, the destination router mark hop count as 16 for that router. • Hold down timer : This is the time for which the router waits for neighbour 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 COMPUTER N/W SARITA PATIL 131
  • 132. RIP Message Format • Command: 8-bit • The type of message: request (1) or response (2) o Version: 8-bit n • Define the RIP version o • Family: 16-bit n • Define the family of the protocol used n TCP/IP: value is 2 o Network Address: 14 bytes n Defines the address of the destination network n 14 bytes for this field to be applicable to any protocol n However, IP currently uses only 4 bytes, the rest are all 0s o Distance: 32-bit n The hop count from the advertising router to the destination network COMPUTER N/W SARITA PATIL 132
  • 133. Open shortest path first (OSPF) routing protocol • Open Shortest Path First (OSPF) is a unicast routing protocol developed by working group of the Internet Engineering Task Force (IETF). • It is a intradomain routing protocol. • It is an open source protocol. • It is similar to Routing Information Protocol (RIP) • OSPF is a classless routing protocol, which means that in its updates, it includes the subnet of each route it knows about, thus, enabling variable- length subnet masks. • With variable-length subnet masks, an IP network can be broken into many subnets of various sizes. • This provides network administrators with extra network-configuration flexibility. These updates are multicasts at specific addresses (224.0.0.5 and 224.0.0.6). COMPUTER N/W SARITA PATIL 133
  • 134. • OSPF is implemented as a program in the network layer using the services provided by the Internet Protocol • IP datagram that carries the messages from OSPF sets the value of protocol field to 89 • OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm • OSPF has two versions – version 1 and version 2. Version 2 is used mostly COMPUTER N/W SARITA PATIL 134
  • 135. OSPF terms – • Router I’d – It is the highest active IP address present on the router. First, highest loopback address is considered. If no loopback is configured then the highest active IP address on the interface of the router is considered. • Router priority – It is a 8 bit value assigned to a router operating OSPF, used to elect DR and BDR in a broadcast network. • Designated Router (DR) – It is elected to minimize the number of adjacency formed. DR distributes the LSAs to all the other routers. DR is elected in a broadcast network to which all the other routers shares their DBD. In a broadcast network, router requests for an update to DR and DR will respond to that request with an update. • Backup Designated Router (BDR) – BDR is backup to DR in a broadcast network. When DR goes down, BDR becomes DR and performs its functions. COMPUTER N/W SARITA PATIL 135
  • 136. • DR and BDR election – DR and BDR election takes place in broadcast network or multi-access network. Here are the criteria for the election: • Router having the highest router priority will be declared as DR. • If there is a tie in router priority then highest router I’d will be considered. • First, the highest loopback address is considered. If no loopback is configured then the highest active IP address on the interface of the router is considered. COMPUTER N/W SARITA PATIL 136
  • 137. • OSPF states – The device operating OSPF goes through certain states. These states are: • Down – In this state, no hello packet have been received on the interface. Note – The Down state doesn’t mean that the interface is physically down. Here, it means that OSPF adjacency process has not started yet. • INIT – In this state, hello packet have been received from the other router. • 2WAY – In the 2WAY state, both the routers have received the hello packets from other routers. Bidirectional connectivity has been established. Note – In between the 2WAY state and Exstart state, the DR and BDR election takes place. • Exstart – In this state, NULL DBD are exchanged.In this state, master and slave election take place. The router having the higher router I’d becomes the master while other becomes the slave. This election decides Which router will send it’s DBD first (routers who have formed neighbourship will take part in this election). COMPUTER N/W SARITA PATIL 137
  • 138. • Exchange – In this state, the actual DBDs are exchanged. • Loading – In this sate, LSR, LSU and LSA (Link State Acknowledgement) are exchanged. Important – When a router receives DBD from other router, it compares it’s own DBD with the other router DBD. If the received DBD is more updated than its own DBD then the router will send LSR to the other router stating what links are needed. The other router replies with the LSU containing the updates that are needed. In return to this, the router replies with the Link State Acknowledgement. • Full – In this state, synchronization of all the information takes place. OSPF routing can begin only after the Full state. COMPUTER N/W SARITA PATIL 138
  • 139. OSPF • OSPF Messages – OSPF is a very complex protocol. It uses five different types of messages. These are as follows: • Hello message (Type 1) – It is used by the routers to introduce itself to the other routers. • Database description message (Type 2) – It is normally send in response to the Hello message. • Link-state request message (Type 3) – It is used by the routers that need information about specific Link-State packet. • Link-state update message (Type 4) – It is the main OSPF message for building Link-State Database. • Link-state acknowledgement message (Type 5) – It is used to create reliability in the OSPF protocol. COMPUTER N/W SARITA PATIL 139
  • 140. • Timers – • Hello timer – The interval in which OSPF router sends a hello message on an interface. It is 10 seconds by default. • Dead timer – The interval in which the neighbor will be declared dead if it is not able to send the hello packet . It is 40 seconds by default.It is usually 4 times the hello interval but can be configured manually according to need. COMPUTER N/W SARITA PATIL 140
  • 141. Border Gateway Protocol (BGP) • Border Gateway Protocol (BGP) is used to Exchange routing information for the internet and is the protocol used between ISP which are different ASes. • The protocol can connect together any internetwork of autonomous system using an arbitrary topology. • The only requirement is that each AS have at least one router that is able to run BGP and that is router connect to at least one other AS’s BGP router. • BGP’s main function is to exchange network reach-ability information with other BGP systems. Border Gateway Protocol constructs an autonomous systems’ graph based on the information exchanged between BGP routers. COMPUTER N/W SARITA PATIL 141
  • 142. Characteristics of Border Gateway Protocol (BGP): • Inter-Autonomous System Configuration: The main role of BGP is to provide communication between two autonomous systems. • BGP supports Next-Hop Paradigm. • Coordination among multiple BGP speakers within the AS (Autonomous System). • Path Information: BGP advertisement also include path information, along with the reachable destination and next destination pair. • Policy Support: BGP can implement policies that can be configured by the administrator. For ex:- a router running BGP can be configured to distinguish between the routes that are known within the AS and that which are known from outside the AS. • Runs Over TCP. • BGP conserve network Bandwidth. • BGP supports CIDR. • BGP also supports Security. COMPUTER N/W SARITA PATIL 142
  • 143. Functionality of Border Gateway Protocol (BGP): BGP peers performs 3 functions, which are given below. • The first function consist of initial peer acquisition and authentication. both the peers established a TCP connection and perform message exchange that guarantees both sides have agreed to communicate. • The second function mainly focus on sending of negative or positive reach-ability information. • The third function verifies that the peers and the network connection between them are functioning correctly. COMPUTER N/W SARITA PATIL 143
  • 144. BGP Route Information Management Functions: • Route Storage: Each BGP stores information about how to reach other networks. • Route Update: In this task, Special techniques are used to determine when and how to use the information received from peers to properly update the routes. • Route Selection: Each BGP uses the information in its route databases to select good routes to each network on the internet network. • Route advertisement: Each BGP speaker regularly tells its peer what is knows about various networks and methods to reach them. COMPUTER N/W SARITA PATIL 144