Sei sulla pagina 1di 93

Addressing the Network: IPv4

CSE3&5INE
Dr. Rabee Elhdad
 At the Network layer, the packets of the
communication need to be identified with the
source and destination addresses
 In IPv4, each packet has a 32-bit source
address and a 32-bit destination address in the
Layer 3 header
 For convenience, IPv4 addresses are
represented by using dotted decimal format
 The IPv4 Classful Addressing Structure (RFC 790)
An IP address has 2 parts:
 The network portion
Found on the left side of an IP address
The host portion
Found on the right side of an IP address
 Classes of IP addresses are identified by the decimal
number of the 1st octet
Class A address begin with a 0 bit
Range of class A addresses = 0.0.0.0 to 127.255.255.255
Class B address begin with a 1 bit and a 0 bit
Range of class B addresses = 128.0.0.0 to 191.255.255.255
Class C addresses begin with two 1 bits & a 0 bit
Range of class C addresses = 192.0.0.0 to 223.255.255.255.
 To define the network and host portions of an address, a devices
use a separate 32-bit pattern called a subnet mask

 The subnet mask does not actually contain the network or host
portion of an IPv4 address, it just says where to look for these
portions in a given IPv4 address
 Within the address range of each IPv4 network, we have
three types of addresses:
 Network address - The address by which we refer to the network
 Broadcast address - A special address used to send data to all
hosts in the network
 Host addresses - The addresses assigned to the end devices in the
network.
1 AND 1 = 1 1 AND 0 = 0 0 AND 1 = 0 0 AND 0 = 0
 Not all organizations' requirements fit well into
one of these three classes
 Classful allocation of address space often wasted
many addresses, which exhausted the availability
of IPv4 addresses
 Therefore,nowadays, classless addressing is used
 With the classless system, address blocks
appropriate to the number of hosts are assigned to
companies or organizations without regard to the
unicast class
 Subnetting is the process of segmenting a network into multiple
smaller network spaces called subnetworks or subnets.
 Large networks must be segmented into smaller subnetworks,
creating smaller groups of devices and services to:
• Control traffic by containing broadcast traffic within each
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.
 Devices on a network and subnet use the router interface attached
to their LAN as their default gateway.
 Borrowing Bits to Create Subnets
 Borrowing 1 bit 21 = 2 subnets

Borrowing 1 Bit from the host portion creates 2 subnets with the same subnet mask

Subnet 0 Subnet 1
Network 192.168.1.0-127/25 Network 192.168.1.128-255/25
Mask: 255.255.255.128 Mask: 255.255.255.128
Subnets in Use

Subnet 0
Network 192.168.1.0-127/25

Subnet 1
Network 192.168.1.128-255/25
Calculate number of
subnets

Calculate number of
hosts
Borrowing 2 bits to create 4 subnets. 22 = 4 subnets

Creating 4 Subnets
Borrowing 3 bits to Create 8 Subnets. 23 = 8 subnets
192.168.5.0/24
6 Hosts 10 Hosts

5 Hosts
 How many subnets needed ?
 How many bits we should borrow ?
192.168.5.0/24
6 Hosts Subnet 2 Subnet 4 10 Hosts

Subnet 1 Subnet 3 Subnet 5

5 Hosts

 192.168.5.0
 255.255.255.00000000
 Subnet mask /27
192.168.5.0/24
30 Hosts 30 Hosts
Subnet 2 Subnet 4
Subnet 1 Subnet 5
Subnet 3

30 Hosts

 How many number of hosts needed ?


 How many bits we should borrow ?
192.168.5.0/24
30 Hosts 30 Hosts

Subnet 2 Subnet 4
Subnet 1 Subnet 5
Subnet 3

30 Hosts

 192.168.5.0
 255.255.255.00000000
 Subnet mask /27
 Total number of host will be 2^5 = 32 total hosts
192.168.5.0/24
14 Hosts Subnet 2 60 Hosts

Subnet 4
Subnet 3 Subnet 5
Subnet 1

30 Hosts

Answer ?????
14 Hosts 192.168.5.0/24 60 Hosts
Subnet 2 Subnet 4

Subnet 1 Subnet 3 Subnet 5


30 Hosts
 Classful routing
 Only allows for one subnet mask for all networks
 VLSM & Classless routing
 This is the process of subnetting a subnet
 More than one subnet mask can be used
 More efficient use of IP addresses as compared to classful IP
addressing
VLSM allows the use of different masks for each subnet:
 After a network address is subnetted, those subnets can be further
subnetted.
 VLSM is simply subnetting a subnet. VLSM can be thought of as
sub-subnetting.
 Individual host addresses are assigned from the addresses of "sub-
subnets".
 VLSM – the process of sub-netting a subnet to fit your
needs
 Example:
 Subnet 10.0.0.0/8 has been subnetted using the subnet mask /16
 8 more bits are borrowed, to create 256 subnets with a /16 mask.
 IP address : 172.16.8.0/22
 Which IP address class you been given

 What subnet mask is used ?

 Start from the largest subnet all the time


 The IP address class is class B
 The subnet mask is \22 not class B default
subnet which is \16
 The subnetting required is :
▪ 210 host
▪ 195 host
▪ 95 host
▪ 52 host
 172.16.8.0 \22
255.255.11111100.00000000
 210 host required 8 bits
 255.255.11111100.00000000
 2^2 = 4 total subnets every subnet will have
total of 256 host .

256 Host 256 Host 256 Host 256 Host


 Subnet 210 host will have 256 host
 Range from
 172.16.8.0 - 172.16.8.255 \24
 255.255.255.0

256
For subnet 256 256 256
1
 172.16.9.0 \24
255.255.11111111.00000000
 195 host required 8 bits
 255.255.11111111.00000000

 Subnet 195 host will have 256 host


 Range from
 172.16.9.0 - 172.16.9.255 \24
 255.255.255.0

256 host
256 host
For subnet
For subnet 256 256
2
1
 172.16.10.0 \24
255.255.11111111.00000000
 95 host required 7 bits
 255.255.11111111.00000000
 Subnet 95 host will have 128 host
 Range from
 172.16.10.0 - 172.16.10.127 \25
 255.255.255.128

64

128

255 Hosts 255 Hosts 255 Hosts


64

Subnet 1 Subnet 2 Subnet 3 Subnet 4


 172.16.10.128 \25
255.255.11111111.10000000
 52 host required 6 bits
 255.255.11111111.10000000

 Subnet 52 host will have 64 host


 Range from
 172.16.10.128 - 172.16.10.191 \26
 255.255.255.128

64

128

255 Hosts 255 Hosts 255 Hosts


64

Subnet 1 Subnet 2 Subnet 3 Subnet 4


Subnet name Number of Address range Subnet
hosts mask
Branch #1 100
Branch #2 55
Branch #3 25
Branch #4 6
Branch #5 4
Branch #6 2
 Which IP address class you been given

 What subnet mask is used ?

 Start from the largest subnet all the time


 The IP address class is class A
 The subnet mask is \21 not class B default
subnet which is \8
 The subnetting required is :
▪ 100 host
▪ 55 host
▪ 25 host
▪ 6 host
▪ 2 host
Subnet name Numbe Address range Subnet
r of mask
hosts
Branch #1 100 15.208.124.0 to 15.208.124.127 /25
Branch #2 55 15.208.124.128 to 15.208.124.191 /26
Branch #3 25 15.208.124.192 to 15.208.124.223 /27
Branch #4 6 15.208.124.224 to 15.208.124.231 /29
Branch #5 4 15.208.124.232 to 15.208.124.239 /29
Branch #6 2 15.208.124.240 to 15.208.124.243 /30
 When classful protocols were originally developed,
networks were very different from those used now.
 The best modem speed was 300 bps, the largest WAN
line was 56 kbps, router memory was less than 640
KB, and processors were running in the kHz range.
 Routing updates had to be small enough not to
monopolize the WAN link bandwidth. In addition,
routers did not have the resources to maintain current
information about every subnet.
 Classful Routing Updates
– Recall that classful routing protocols (i.e. RIPv1) do not
send subnet masks in their routing updates
– The reason is that the Subnet mask is directly related to
the network address
 When a classful router sends or receives routing
updates, the router makes assumptions about the
subnet mask being used by the networks listed in the
update, based on IP address class.
 If that route is using a different subnet mask, the
receiving router will have incorrect information in its
routing table.
 Thus, when using a classful routing protocol, it is
important to use the same subnet mask on all subnets
belonging to the same classful network.
 When a router using a classful routing protocol needs
to send an update about a subnet of a network across
an interface belonging to a different network, the
router assumes that the remote router will use the
default subnet mask for that class of IP address.
(called auto route summarization)
Inter-domain Routing (CIDR –
 Classless
RFC 1517)
 Advantage of CIDR :
• More efficient use of IPv4 address space
• Route summarization
 Requires subnet mask to be included in routing update
because address class is meaningless
 Recall purpose of a subnet mask:
• To determine the network and host portion of an IP
address
 CIDR & Route Summarization
 Variable Length Subnet Masking (VLSM)
 Allows a subnet to be further sub-netted according to individual
needs
 Prefix Aggregation a.k.a. Route Summarization
 CIDR allows for routes to be summarized as a single route
 Characteristics of classless routing protocols:
 Routing updates include the subnet mask
 Supports VLSM
 Supports Route Summarization
Remember

 Classful routing protocols DO NOT send the subnet mask


along with their updates

 Classless routing protocols DO send the subnet mask


along with their updates
 There are 4 networks and three routers
 172.16.1.0 and 172.16.2.0 fall within the class B
range.
 192.168.12.0 and 192.168.23.0 fall within the class C
range.
 Class B subnet mask is 255.255.0.0
 Class C subnet mask is 255.255.255.0
 Router R1 and router R3 don’t send the subnet mask along
with the routing update so it will advertise the classful
network which is 172.16.0.0 in this case.

 So what happens with router R2? It thinks it can reach the


172.16.0.0 network by sending packets either left or right
and if the metric is equal it will try to load-balance.
 As you can see router R1 is now advertising its 172.16.1.0
subnet with a subnet mask.
 Router R3 is advertising its 172.16.2.0 subnet with a subnet
mask as well.
Routing Routing updates Supports Ability to send
Protocol Include subnet VLSM Supernet routes
Mask

Classful No No No

Classless Yes Yes Yes


Route summarization, also known as route aggregation, is the
process of advertising a contiguous set of addresses as a single
address with a less-specific, shorter subnet mask:
 CIDR is a form of route summarization and is synonymous
with the term supernetting.
 CIDR ignores the limitation of classful boundaries, and allows
summarization with masks that are smaller than that of the
default classful mask.
 This type of summarization helps reduce the number of entries
in routing updates and lowers the number of entries in local
routing tables.
 Route summarization done by CIDR
– Routes are summarized with masks that are less
than that of the default classful mask
– Example:
• 172.20.0.0 / 13 is the summarized route for the
172.20.0.0 / 16 to 172.23.0.0 / 16 classful networks
 Steps to calculate a route summary
 List networks in binary format
 Count number of left most matching bits to determine summary
route’s mask
 Copy the matching bits and add zero bits to determine the
summarized network address
Decimal Binary
200.199.48.0 200.199.00110000.00000000
200.199.49.0 200.199.00110001.00000000
200.199.50.0 200.199.00110010.00000000
200.199.51.0 200.199.00110011.00000000
The base address is: 200.199.48.0
New subnet mask will be \22

Potrebbero piacerti anche