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

Chapter 5 Network Layer

Chapter Five discusses the Network Layer's role in delivering packets across multiple networks, highlighting its functions such as logical addressing, routing, and encapsulation. It explains the Internet Protocol (IP) as the primary protocol for routing, emphasizing its connectionless, best-effort, and media-independent characteristics. The chapter also covers IP addressing, subnetting, and the importance of subnet masks in network communication.

Uploaded by

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

Chapter 5 Network Layer

Chapter Five discusses the Network Layer's role in delivering packets across multiple networks, highlighting its functions such as logical addressing, routing, and encapsulation. It explains the Internet Protocol (IP) as the primary protocol for routing, emphasizing its connectionless, best-effort, and media-independent characteristics. The chapter also covers IP addressing, subnetting, and the importance of subnet masks in network communication.

Uploaded by

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

Chapter Five

Network Layer: Addressing and


Routing
Network Layer
 It is responsible for the source to destination delivery of a
packet across multiple networks.
 If two systems are attached to different networks with
devices like routers, then network layer is used.
 Routers (layer-3 devices) are specified at the Network
layer and provide the routing services within an
internetwork.
 Thus Data link layer overseas the delivery of the packet
between the two systems on same network and the
network layer ensures that the packet gets its point of
origin to its final destination.
Basic operations/ functions of the
network layer
1. Logical addressing
 If a packet passes the network boundary, we need
another addressing system to help distinguish the
source and destination systems.
 The network layer adds a header to the packet coming
from the upper layer that, among other things, includes
the logical addresses of the sender and receiver.
Cont..
2. Routing
 Routing is method to route a data packet from source to
destination.
 It is determined by the hope count, the bandwidth of the path.
 When independent networks or links are connected to create
internetworks (network of networks) or a large network, the
connecting devices (called routers) route the packets to their
final destination.
.
Cont..
 For example : when you want to access some data from
Facebook, you open your laptop, type Facebook URL
and send request to Facebook for some data.
 Since Facebook server is outside your local area
network , your request is forward to Facebook through
the default gateway or router of your institution.
 This forwarding of data request to the server or user is
known as routing.
Cont..
3. Encapsulation and De-encapsulation
 It is a service that is offered by the network layer.
 Itis the process of encapsulating the data received
(payload) from upper layers of the network layer packet at
the source and de-capsulating the payload from the network
layer packet at the destination.
 The source adds source and destination address to the data
received from the upper layer and delivers the packet to
data link layer.
 The destination receives the network layer packet and de-
capsulates it, and delivers it to the upper layer.
Network protocol
 The most significant network layer protocol is the Internet
protocol or IP.
 IP is the standard for routing packets across interconnected
networks or internet.
IP is meant to have low overhead and may be described as:
◦ Connectionless
◦ Best Effort
◦ Media Independent
Cont..
IP is Connectionless
 IP does not establish a connection with the destination before
sending the packet.
 There is no control information needed (synchronizations,
acknowledgments, etc.).
 The destination will receive the packet when it arrives, but no
pre-notifications are sent by IP.
Cont..
IP is Best Effort
 IP will not guarantee delivery of the packet.
 IP has reduced overhead since there is no mechanism to
resend data that is not received.
 IP does not expect acknowledgments.
 IP does not know if the other device is operational or if it
received the packet.
Cont..
IP is unreliable:
◦ It cannot manage or fix undelivered or corrupt packets.
◦ IP cannot retransmit after an error.
◦ IP cannot realign out of sequence packets.
◦ IP must rely on other protocols for these functions.
IP is media Independent:
◦ IP does not concern itself with the type of frame required at
the data link layer or the media type at the physical layer.
◦ IP can be sent over any media type: copper, fiber, or
wireless.
NIC addressing
 Every NIC (Network Interface Card) has a 48-bit globally
unique identifier called as MAC address (Media Access
Control Address) that is burned into its ROM chip.
 This address is a String of usually six sets of two-
characters or digits separated by colons.
 Example: 00:0a:95:9d:68:16
 The MAC address is the physical address.
 The MAC address is used to deliver packets to a
computer.
 The NIC driver software passes the data between the
operating system and the NIC.
IP addressing
 IP (Internet Protocol address) address is a logical address
in the network layer.
 It is a series of numbers that identifies any device on a
network uniquely.
 Example: 192.168.123.132
 The Internet addresses are 32 bits in length.
 These addresses are referred to as IPv4 (IP version 4)
addresses or simply IP addresses.
IPv4
 An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for
example, a computer or a router) to the Internet.
 IPv4 addresses are unique.
 They are unique in the sense that each address defines
one, and only one, connection to the Internet.
 Two devices on the Internet can never have the same
address at the same time.
 The IPv4 addresses are universal in the sense that the
addressing system must be accepted by any host that
wants to be connected to the Internet.
Classfull Addressing
 IPv4 addressing uses the concept of classes.
 This architecture is called classful addressing.
 In classful addressing, the address space is divided into five
classes: A, B, C, D, and E.
 Each class occupies some part of the address space.
IPv4 addresses classes are:-
 Class A (1.0.0.0/8 to 127.0.0.0/8)
 Class B (128.0.0.0 /16 – 191.255.0.0 /16)
 Class C (192.0.0.0 /24 – 223.255.255.0 /24)
 Class D (224.0.0.0 to 239.0.0.0)
 Class E (240.0.0.0 – 255.0.0.0)
 Classful addressing wasted many IPv4 addresses.
 Classful address allocation was replaced with classless addressing .
Cot..
 Class A- IP address belonging to class A are assigned to the
networks that contain a large number of hosts.
 It has 8 bits long network id
 It has 24 bits host id
 Default subnet mask is 255.0.0.0
 The address range is 1-127
 Class B- IP address belonging this class are assigned to the
medium-sized to large-sized networks.
 It has 16 bits long network id
 It has 16 bits host id
 Default subnet mask is 255.255.0.0
 The address range is 128-191
Cont..
 Class C- IP address belonging this class are assigned to the
small-sized networks.
 It has 24 bits long network id
 It has 8 bits host id
 Default subnet mask is 255.255.255.0
 The address range is 192-223
 Class D- IP address belonging this class are reserved for
multi-casting.
 The address range is 224-239
 Class E- IP address belonging this class are reserved for
experimental and research purposes.
 The address range is 240-255
Cont..
An IPv4 address is a 32-bit hierarchical address that is made
up of a network portion and a host portion.
When determining the network portion versus the host
portion, you must look at the 32-bit stream.
A subnet mask is used to determine the network and host
portions.
Cont..
Devices on the Same Network
 When devices are on the same network the source and
destination will have the same number in network portion of
the address.
◦ PC1 – 192.168.1.110 PC2 – 192.168.1.20
◦ FTP Server – 192.168.1.9
Cont..
The Subnet Mask
It is a 32 bit number created by setting all host bits to ‘0’and
all network bits to ‘1’.
This way the subnet mask separates the IP address in to the
network and host addresses.
Class A, B, and C has default subnet masks.
To identify the network and host portions of an IPv4 address,
the subnet mask is compared to the IPv4 address bit for bit,
from left to right.
The actual process used to identify the network and host
portions is called ANDing.
Cont..

In the above example, the IP address is class C.


So that, 192.168.10 is the network portion and 10
is the host portion of the IP address.
Cont..
The Prefix Length
 A prefix length is a less cumbersome method used to
identify a subnet mask address.
The prefix length is the number of bits set to 1 in the subnet
mask.
It is written in “slash notation” therefore, count the number of
bits in the subnet mask and prepend it with a slash.
Cont..
Cont..
Network, Host, and Broadcast Addresses
Within each network are three types of IP addresses:
◦ Network address
◦ Host addresses
◦ Broadcast address
Cont..
Determining the Network: Logical AND
 A logical AND Boolean operation is used in determining
the network address.
◦ Logical AND is the comparison of two bits where only
a 1 AND 1 produces a 1 and any other combination
results in a 0.
◦ 1 AND 1 = 1, 0 AND 1 = 0, 1 AND 0 = 0, 0 AND 0 = 0
◦ 1 = True and 0 = False
 To identify the network address, the host IPv4 address is
logically ANDed, bit by bit, with the subnet mask to
identify the network address.
Cont..
Cont..
 192.168.5.85/24
 The network address/id is 192.168.5.0
 The first usable host is 192.168.5.1
 The last usable host is 192.168.5.254
 The braodcast address is 192.168.5.255
Convert Binary to Decimal
 Convert 11000000.10101000.00001011.00001010 to
decimal.
Positional Value 128 64 32 16 8 4 2 1

Binary Number 1 1 0 0 0 0 0 0
(11000000)
Calculate 1x128 1x64 0x32 0x16 0x8 0x4 0x2 0x1 192
Add Them Up… 128 + 64 +0 +0 +0 +0 +0 +0

Binary Number 1 0 1 0 1 0 0 0
(10101000)
168
Calculate 1x128 0x64 1x32 0x16 1x8 0x4 0x2 0x1

Add Them Up… 128 +0 + 32 +0 +8 +0 +0 +0

Binary Number 0 0 0 0 1 0 1 1
(00001011) 11
Calculate 0x128 0x64 0x32 0x16 1x8 0x4 1x2 1x1

Add Them Up… 0 +0 +0 +0 +8 +0 +2 +1

Binary Number 0 0 0 0 1 0 1 0
(00001010) 10
Calculate 0x128 0x64 0x32 0x16 1x8 0x4 1x2 0x1
01/23/2025
Add Them Up… 0 +0 +0 +0 +8 +0 +2 +0
192.168.11.10
Subnetting
 Subnetting is a process of dividing or segmenting a
network into smaller networks called subnets.
 A subnet or a subnetwork is a segmented piece of a larger
network.
 If an organization was granted a large block in class A or
B, it could divide the addresses into several contiguous
groups and assign each group to smaller networks (called
subnets).
 or, in rare cases, share part of the addresses with
neighbors.
Reasons for Subnetting
 Large networks need to be segmented into smaller sub-
networks, creating smaller groups of devices and
services in order to:
 Control traffic by containing broadcast traffic within
subnetwork
 Reduce overall network traffic and improve network
performance
 Communication Between Subnets
 A router is necessary for devices on different networks and
subnets to communicate.
 Each router interface must have an IPv4 host address that
belongs to the network or subnet that the router interface is
connected to.
 Devices on a network and subnet use the router interface
attached to their LAN as their default gateway.
Subnetting cont..
Networks are most easily subnetted at the octet boundary of /8,
/16, and /24.
Notice that using longer prefix lengths decreases the number of
hosts per subnet.
Cont..
 Example IP Address 192.168.5.85
 This address is a class C address. Its default subnet mask is
255.255.255.0.
 Or it could be written as 192.168.5.85/24. this shows 24 bits are
network portion.
 Binary of 192.168.5.85 and 255.255.255.0 are
11000000.10101000.00000101.01010101
11111111.11111111.11111111.00000000
 By Anding these two, we get
11000000.10101000.00000101.00000000 = 192.168.5.0
 This is the network address and 192.168.5.255 is the broadcast
address.
 192.168.5.1 - 192.168.5.254 will be the usable host address range.
Cont..
Formulas for Subnet Calculation
Possible Number of Subnets
 To calculate the number of possible subnets, use the formula 2 n,
where n equals the number of host bits borrowed.
 For example, if three host bits are borrowed, then n=3.

 23 = 8, so eight subnets are possible if three host bits are borrowed.


Possible Number of Hosts per Subnet
 To calculate the number of possible hosts per subnet, use the

formula 2h, where h equals the number of host bits.


Possible Number of usable Hosts per Subnet
 To calculate the number of possible hosts per subnet, use the

formula 2h - 2, where h equals the number of host bits.


 The reason two addresses must be subtracted is because of the
network address and the broadcast address.
Cont..
 In order to create IP subnets, host bits are changed to network
bits.
 This is often called borrowing bits.
 It is also often referred to as taking host bits and giving them to
the network.
 By borrowing host bits, more IP subnets are created, but each
subnet can support fewer hosts.
 To change a host bit to a network bit, the subnet mask must be
changed.
 Remember, a binary 0 in the subnet mask means that bit is part of
the host portion of an IP address. A binary 1 in the subnet mask
means that bit is part of the network portion of an IP address.
 So, to change a bit from a host bit to a network bit, the binary
value of the bit must be changed from 0 to 1 in the subnet mask.
Cont..
 Borrowing Bits to Create Subnets
 Borrowing 1 bit 21 = 2 subnets

Subnet 0 Subnet 1
Network 192.168.1.0-127/25 Network 192.168.1.128-
Mask: 255.255.255.128 255/25
Mask: 255.255.255.128
Cont..
 192.168.1.0/25

Subnet 0
Network 192.168.1.0-
127/25

Subnet 1
Network 192.168.1.128-
255/25
Cont..
It is important to balance the number of subnets needed and
the number of hosts required for the largest subnet.
 Design the addressing scheme to accommodate the
maximum number of hosts for each subnet.
Allow for growth in each subnet.
Cont..
Example
Number of needed subnets 14
Number of needed usable hosts 10
Network Address 192.10.10.0
 No of subnets 2n = 24 = 16
 No of hosts 2h = 24 = 16
 No of usable hosts = no of hosts – 2 = 16 -2 = 14
Network id usable host range broadcast address
 Subnet 1-> 192.10.10.0 192.10.10.1-192.10.10.14
192.10.10.15
 Subnet 2-> 192.10.10.16 192.10.10.17-192.10.10.30
192.10.10.31
 Subnet 3-> 192.10.10.32 192.10.10.33-192.10.10.46
192.10.10.47
 Subnet 4-> 192.10.10.48 192.10.10.49-192.10.10.62
192.10.10.63
Cont..
 Subnet 5-> 192.10.10.64 192.10.10.65-192.10.10.78 192.10.10.79
 Subnet 6-> 192.10.10.80 192.10.10.81-192.10.10.94 192.10.10.95
 Subnet 7-> 192.10.10.96 192.10.10.97-192.10.10.110 192.10.10.111
 Subnet 8-> 192.10.10.112 192.10.10.113-192.10.10.126 192.10.10.127
 Subnet 9-> 192.10.10.128 192.10.10.129-192.10.10.142 192.10.10.143
 Subnet 10-> 192.10.10.144 192.10.10.145-192.10.10.158 192.10.10.159
 Subnet 11-> 192.10.10.160 192.10.10.161-192.10.10.174 192.10.10.175
 Subnet 12-> 192.10.10.176 192.10.10.177-192.10.10.190 192.10.10.191
 Subnet 13-> 192.10.10.192 192.10.10.193-192.10.10.206 192.10.10.207
 Subnet 14-> 192.10.10.208 192.10.10.209-192.10.10.222 192.10.10.223
 Subnet 15-> 192.10.10.224 192.10.10.225-192.10.10.238 192.10.10.239
 Subnet 16-> 192.10.10.240 192.10.10.241-192.10.10.254 192.10.10.255
Subnetting Based on Host
Requirements
There are two considerations when planning subnets:
 Number of Subnets required
 Number of Host addresses required
To Calculate number of subnets
Formula 2n (where n is the number of bits borrowed)
 Subnet needed for each department in graphic
Example
You have been given the network
address 192.168.10.0/25 by your customer. Based
on this information, answer the ff questions.
1) Find the subnet mask?
2) Find the total number of network can be created?
3) Find the total number of IP address on each
network?
4) Find the total number of host on each network?
5) Find the first usable host IP address and the last
usable host IP address on each network?
 Solution:-
 Number of network: 2n
 Total number of bits borrowed from host)
 21=2
 Number of IP add on each network: 2n
 Total number of host bits)
 27=128
 Number of hosts on each network: 2n-2
 Total number of remaining host bits)
 27-2=126
Exercise
 You have been given the network address 192.168.10.0/28
from EthioTelecom. Based on this information, answer the
following questions.
1) Find the subnet mask?
2) Find the total number of network can be created?
3) Find the total number of IP address on each network?
4) Find the total number of host on each network?
5) Find the first usable host IP address and the last usable
host IP address on each network?
Cont..
Traditional Subnetting Wastes Addresses
Traditional subnetting - same number of addresses
is allocated for each subnet.
Subnets that require fewer addresses have unused
(wasted) addresses.
Variable Length Subnet Mask (VLSM) or
subnetting a subnet provides more efficient use of
addresses.
Variable Length Subnet
Masks (VLSM)
VLSM allows a network space to be divided in
unequal parts.
Subnet mask will vary depending on how many
bits have been borrowed for a particular subnet.
Network is first subnetted, and then the subnets
are subnetted again.
Process repeated as necessary to create subnets of
various sizes.
Using VLSM subnets, the network segments can
be addressed with minimum waste.
Example

192.168.1.0/24 IP
Address.
Subnet 1 = 28 hosts
Subnet 2 = 52 hosts
Subnet 3 = 15 host
Subnet 4 = 5 hosts
Cont..
 To overcome this Subnetting issue, firstly we determine
the host bits for each subnet.
 For the first subnet; we need 5 host bits. With 5 bits we
can have 25=32 addresses. This means that there are 32-2
usable host addresses.
 For the second subnet; we need 6 host bits. With 6 bits we
can have 26=64 addresses. This means that there are 64-2
usable host addresses.
 For the third subnet; we need 5 host bits. With 5 bits we
can have 25=32 addresses…
 For the fourth subnet; we need 3 host bits. With 3 bits we
can have 23=8 addresses. This means that there are 8-2
usable host addresses.
Cont..
 If we use /26 with 192.168.1.0 like 192.168.1.0/26, then we
will have 4 subnets. The given Subnet was 24 and our new
subnet is 26. 26-24=2 and 22=4 subnets.
 192.168.1.0/26
192.168.1.64/26
192.168.1.128/26
192.168.1.192/26
 We will use the first one for the Subnet 2. (192.168.1.0/26)
 Now, for the first and third subnet, let’s use the second
block (192.168.1.64/26) and divide it again.
 If we divide it by borrowing a bit again, then we will have
two subnets.
 192.168.1.64/27
192.168.1.96/27
Cont..
 We can use these two Prefixes for first and second subnet.
 And lastly, for the small subnet, we can use the above third
block(192.168.10.128/26).
 We will divide it again.
 Because we need only 5 host address.
 When we divide again, we will have the below small subnets,
and we can use the first one for our fourth and last Subnet.
 192.168.1.128/29
192.168.1.136/29
192.168.1.144/29
192.168.1.152/29
192.168.1.160/29
192.168.1.168/29
192.168.1.176/29
192.168.1.184/29
Cont..
 we have used our IP Block very efficiently. The unused
remaining blocks can be used in the future. What are
these remaining blocks let’s remember. The remaining
blocks are the last block of /26 subnets and the last 7
block of /29 subnets.
 At the end our subnets will be like below:
 192.168.1.0/26
192.168.1.64/27
192.168.1.96/27
192.168.1.128/29
Classless Addressing
 Formal name is Classless Inter-Domain Routing (CIDR,
pronounced “cider.
 Created a new set of standards that allowed service providers
to allocate IPv4 addresses on any address bit boundary
(prefix length) instead of only by a class A, B, or C address.
 CIDR or Classless Inter Domain Routing provides the
flexibility of borrowing bits of Host part of the IP address
and using them as Network in Network, called Subnet.
 Eg.
 190.79.18.70/18
 This address is a traditional class B and its default subnet
mask is 255.255.0.0. but it has 18 network bits that are all 1.
therefore the subnet mask will be 255.255.192.0.
Supernetting
 It is inverse of subnetting
 Combining of multiple networks to single networks
 Converting network bits to hosts bits i.e. converting 1’s into 0’s
 It is also known as classless inter domain routing(CIDR)

Benefit of supernetting
 Reduce the network traffic
 To minimize the routing table

Steps:
 Write all numbers in binary
 Find matching bits left to write upto match
 Write them upto match and 0 upto end (New Network ID)
 Make all 1 upto match and zero upto end (New Mask)
Example
 192.168.0.0/24
 192.168.1.0/24
 192.168.2.0/24
 192.168.3.0/24

Step 1 and 2
 11000000.10101000.00000000.00000000
 11000000.10101000.00000001.00000000
 11000000.10101000.00000010.00000000
 11000000.10101000.00000011.00000000

Step 3
 11000000.10101000.00000000.00000000
 192.168.0.0 (New Network ID)

Step 4
 11111111.11111111.11111100.00000000
 255.255.252.0 (New Mask ID)

192.168.0.0/22 (New Network)


Private and Public IP addresses
 As defined in RFC 1918, public IPv4 addresses are
globally routed between internet service provider (ISP)
routers.
 Private addresses are common blocks of addresses used by
most organizations to assign IPv4 addresses to internal
hosts.
 Private IPv4 addresses are not unique and can be used
internally within any network.
 However, private addresses are not globally routable.
Routing in the Internet
 Networks are commonly implemented using private IPv4 addresses, as
defined in RFC 1918.
 Private IPv4 addresses cannot be routed over the internet and are used
within an organization or site to allow devices to communicate locally.
 To allow a device with a private IPv4 address to access devices and
resources outside of the local network, the private address must first be
translated to a public address.
 NAT(Network Address Translation) provides the translation of private
addresses to public addresses.
Network Address Translation(NAT)
 It is a way to map local private addresses to a public
address before transferring the information.
 It is designed for IP address conservation.
 It enables private IP addresses to connect to the internet.
• NAT operates on a router.
• The three reserved ranges are:
10.0.0.0 – 10.255.255.255/8 (16,777,216 hosts)
172.16.0.0 – 172.31.255.255/12 (1,048,576 hosts)
192.168.0.0 – 192.168.255.255/16 (65,536 hosts)
• It enables private IP networks that use unregistered IP
addresses to connect to the Internet.
• NAT operates on a router, usually connecting two networks
together, and translates the private (not globally unique)
addresses in the internal network into legal addresses,
before packets are forwarded to another network.
NAT Cont..
Cont..
 Types of NAT
1. Static NAT
 When the local address is converted to a public one,
static NAT chooses the same one.
 This means there will be a consistent public IP address
associated with that router or NAT device.
2. Dynamic NAT
 Instead of choosing the same IP address every time,
dynamic NAT goes through a pool of public IP addresses.
 This results in the router or NAT device getting a
different address each time the router translates the local
address to a public address.
Port address translation
(PAT)
 It is an extension to NAT.
 Itpermits multiple devices on the local area network to
be mapped to a single public IP address.
 In PAT, Private IP addresses are translated into the
public IP address via Port numbers.
 PAT also uses IPv4 address but with port number.
Address Mapping
 Address mapping is the process of determining the physical
address by knowing the logical address of the device and
vice versa.
Address mapping is required when a packet is routed from
source host to destination host in the same or different
network.
Static mapping
 In static mapping, each device connected to the network
maintains a table i.e., routing table which has a list of all
the routes from that device to a particular network or hosts.
 It maintains the network/next hop association i.e., the
logical address of next-hop and its corresponding physical
address.
Cont..
Dynamic Mapping
 In dynamic mapping usually, the source host knows the
logical address of the destination host
 but to deliver the packet to the destined host its physical
address is required, as at the physical level the device is
identified by its physical address.
 The source knows one or two addresses and it can find
the rest using mapping protocols.
Logical to Physical Address
Mapping –ARP
Address Resolution Protocol (ARP)
 It is a network layer protocol used to do address resolution
or address mapping.
 Its purpose is to find the MAC address of a device in
LAN for a corresponding IP address which a network
application is trying to communicate.
 A device uses ARP to determine the destination MAC
address of a local device when it knows its IPv4 address.
 When the destination IP address is on a remote network,
the destination MAC address is that of the default
gateway.
 ARP provides two basic functions:
 Resolving IPv4 addresses to MAC addresses
 Maintaining an ARP table of IPv4 to MAC address mappings
ARP functions
 To send a frame, a device will search its ARP table
for a destination IPv4 address and a corresponding
MAC address.
o If the packet’s destination IPv4 address is on the same network, the
device will search the ARP table for the destination IPv4 address.
o If the destination IPv4 address is on a different network, the device
will search the ARP table for the IPv4 address of the default
gateway.
o If the device locates the IPv4 address, its corresponding MAC
address is used as the destination MAC address in the frame.
o If there is no ARP table entry is found, then the device sends an ARP
request.
Physical to Logical Address Mapping
–RARP
Reverse Address Resolution Protocol (RARP)
 Its reverse ARP.
 Opposite to ARP.
 It is also known as a network layer protocol that is used
to do address resolution or address mapping.
 Its purpose is to find the logical address or the IP
address that only knows its MAC address.
Cont..
ICMP
 The Internet Control Message Protocol (ICMP) is a
protocol that devices within a network use to communicate
problems with data transmission.
 One of the primary ways in which ICMP is used is to
determine if data is getting to its destination and at the right
time.
 This makes ICMP an important aspect of the error
reporting process and testing to see how well a network is
transmitting data.
Types of Messages
Cont..
Error Reporting Messages
 These are messages which are sent when an error is reported by
ICMP protocol.
 Some of common messages under this category are as follows:
 Destination Unreachable (Type 3)
 One of the most common error reporting messages occurs when the
router is unable to locate the path of the packet where it is needed
to be delivered and in this case the packet also gets discarded and
this message is sent to the source.
 Redirect (Type 5)
 This ICMP error message occurs whenever there is a request that
demands redirection means there is a router called Gateway that has
the information of other routers and based on the destination the
packet is sent to the correct router.
Cont..
 But sometimes the packet that is needed to be sent to a
router is not in the gateway router information directly.
 It needs to get the address of that router from the routers
mentioned in its table.
 So as soon as it gets that address it gives the redirect
message to the host so that host can directly send the
message to that given address.
Cont..
Query Messages
 These are messages which are sent when ICMP queries about the status
of the host.
 Some of common messages under this category are as follows
 Echo Request (Type 8) & Echo reply (Type 0)
 This pair of messages determines whether a given host can connect to a
given destination by generating the echo request and echo reply
messages. These are used simply to diagnose a network connection
between sender and destination.
 Time-stamp Request (Type 13) & Time stamp Reply (Type14)
 These message pairs record the time taken by a host or router to reach
another host or router by generating the time-stamp request and time-
stamp reply messages where the difference between the 2 timestamps can
tell the time taken to reach from one host to another.
ICMPv6
 The Internet Control Message Protocol Version 6 (ICMPv6) is
a new version of the ICM protocol that forms an integral part
of the Internet Protocol version 6 (IPv6) architecture.
 ICMPv6 is a multipurpose protocol and is used for a variety
of activities including error reporting in packet processing,
diagnostic activities, Neighbor Discovery process and IPv6
multicast membership reporting.
 ICMP is available for both IPv4 and IPv6. ICMPv4 is the
messaging protocol for IPv4.
 ICMPv6 provides these same services for IPv6 but includes
additional functionality.
IGMP
 The Internet Group Management Protocol (IGMP) is a
protocol that allows several devices to share one IP address so
they can all receive the same data.
 IGMP is a network layer protocols used to set up multicasting
on networks that use the Internet Protocol version 4 (IPv4).
 Specifically, IGMP allows devices to join a multicasting
group.
 IGMP can be used for one-to-many networking applications
such as online streaming video and gaming, and allows more
efficient use of resources when supporting these types of
applications.
 IGMP is used on IPv4 networks.
IGMP Messages
 The IGMP protocol allows for several kinds of IGMP
messages:
 Membership reports: Devices send these to a multicast
router in order to become a member of a multicast group.
 "Leave group" messages: These messages go from a
device to a router and allow devices to leave a multicast
group.
 General membership queries: A multicast-capable router
sends out these messages to the entire connected network
of devices to update multicast group membership for all
groups on the network.
IGMP Operation
 Computers and other devices connected to a network use IGMP when
they want to join a multicast group.
 A router that supports IGMP listens to IGMP transmissions from
devices in order to figure out which devices belong to which multicast
groups.
 IGMP uses IP addresses that are set aside for multicasting.
 Multicast IP addresses are in the range between 224.0.0.0 and
239.255.255.255.
 Each multicast group shares one of these IP addresses.
 When a router receives a series of packets directed at the shared IP
address, it will duplicate those packets, sending copies to all members
of the multicast group.
 IGMP multicast groups can change at any time.
 A device can send an IGMP "join group" or "leave group" message at
any point.
 IGMP works directly on top of the Internet Protocol (IP).
 Each IGMP packet has both an IGMP header and an IP header.
Routing and forwarding
 Forwarding refers to the router-local action of transferring
packet from an input link interface to the appropriate output link
interface.
 When a packet arrives at a router’s input link, the router must
move the packet to the appropriate output link.
 For example, a packet arriving from Host H1 to Router R1 must
be forwarded to the next router on a path to H2.
 Routing refers to the network-wide process that determines the
end-to-end paths that packets take from source to destination.
 The network layer must determine the route or path taken by
packets as they flow from a sender to a receiver.
 The algorithms that calculate these paths are referred to as
routing algorithms.
 A routing algorithm would determine, for example, the path
along which packets flow from H1 to H2.
Routing algorithms
Cont..
Adaptive Routing Algorithms
 Adaptive routing algorithms, also known as dynamic routing algorithms,
makes routing decisions dynamically depending on the network conditions.
 It constructs the routing table depending upon the network traffic and
topology.
 They try to compute the optimized route depending upon the hop count,
transit time and distance.
 The three popular types of adaptive routing algorithms are −
 Centralized algorithm − It finds the least-cost path between source and
destination nodes by using global knowledge about the network. So, it is
also known as global routing algorithm.
 Isolated algorithm − This algorithm procures the routing information by
using local information instead of gathering information from other nodes.
 Distributed algorithm − This is a decentralized algorithm that computes
the least-cost path between source and destination iteratively in a
distributed manner.
Cont..
Non – Adaptive Routing Algorithms
 Non-adaptive Routing algorithms, also known as static routing
algorithms, construct a static routing table to determine the path
through which packets are to be sent.
 The static routing table is constructed based upon the routing
information stored in the routers when the network is booted up.
 The two types of non – adaptive routing algorithms are −
 Flooding − In flooding, when a data packet arrives at a router, it
is sent to all the outgoing links except the one it has arrived on.
Flooding may be uncontrolled, controlled or selective flooding.
 Random walks − This is a probabilistic algorithm where a data
packet is sent by the router to any one of its neighbors randomly.
Unicasting, Multicasting and
Broadcasting
Unicast
 Unicast transmission is sending a packet to one
destination IP address.
 For example, the PC at 172.16.4.1 sends a
unicast packet to the printer at 172.16.4.253.
Cont..
Broadcast
 Broadcast transmission is sending a packet to all
other destination IP addresses.
 For example, the PC at 172.16.4.1 sends a
broadcast packet to all IPv4 hosts.
Cont..
Multicast
 Multicast transmission is sending a packet to a multicast
address group.
 For example, the PC at 172.16.4.1 sends a multicast packet
to the multicast group address 224.10.10.5.
IPv6
IPv4 has three major limitations:
◦ IPv4 address depletion – We have basically run out of
IPv4 addressing.
◦ Lack of end-to-end connectivity – To make IPv4 survive
this long, private addressing and NAT were created. This
ended direct communications with public addressing.
◦ Increased network complexity – NAT was meant as
temporary solution and creates issues on the network as a
side effect of manipulating the network headers
addressing. NAT causes latency and troubleshooting
issues.
Cont..
IPv6 was developed by Internet Engineering
Task Force (IETF).
IPv6 overcomes the limitations of IPv4.
Improvements that IPv6 provides:
◦ Increased address space – based on 128 bit address, not 32
bits
◦ Improved packet handling – simplified header with fewer
fields
◦ Eliminates the need for NAT – since there is a huge amount
of addressing, there is no need to use private addressing
internally and be mapped to a shared public address
Cont..
IPv6 Structure
 An IPv6 address is 128 bits long and is arranged in eight
groups, each of which is 16 bits.
 Each group is expressed as four hexadecimal digits and the
groups are separated by colons.
 An example of a full IPv6 address could be:
 FE80:CD00:0000:0CDE:1257:0000:211E:729C
 An IPv6 address is split into two parts: a network and a
node/host component.

• The network component is the


first 64 bits of the address and
is used for routing.
• The node component is the
later 64 bits and is used to
identify the address of the
End of chapter 4

You might also like