CH5
CH5
4
Reserved IPv4 Address Ranges
The IPv4 address range is 0.0.0.0 to 255.255.255.255= 2^32
Not all of these addresses can be used as host addresses.
Experimental Addresses
Ranges from 240.0.0.0 to 255.255.255.254. Reserved for special
purposes (research or experimentation).
Multicast Addresses
Ranges from 224.0.0.0 to 239.255.255.255.
Addresses 224.0.0.0 to 224.0.0.255 are reserved link local addresses.
The globally scoped addresses are 224.0.1.0 to 238.255.255.255.
Host Addresses
an address range of 0.0.0.0 to 223.255.255.255 is used for IPv4 hosts.
However, within this range are many addresses that are already reserved
for special purposes.
5
Public and Private Addresses
Private Addresses
The private address blocks are:
10.0.0.0 to 10.255.255.255 (10.0.0.0 /8)
172.16.0.0 to 172.31.255.255 (172.16.0.0 /12)
192.168.0.0 to 192.168.255.255 (192.168.0.0 /16)
Are set aside for use in private networks.
Hosts that do not require access to the Internet at large
may make unrestricted use of private addresses.
Packets using these addresses as the source or destination
should not appear on the public Internet.
6
Public and Private Addresses, Cont
Network Address Translation (NAT):
allows the hosts in the network to "borrow" a public address for
communicating to outside networks.
Public Addresses
The vast majority of the addresses in the IPv4 unicast
host range are public addresses.
These addresses are designed to be used in the hosts that
are publicly accessible from the Internet.
Even within these address blocks, there are many
addresses that are designated for other special purposes.
7
Special IPv4 Addresses
Addresses that cannot be assigned to hosts for various reasons
Special addresses that can be assigned to hosts but with restrictions on how
those hosts can interact within the network.
Network and Broadcast Addresses
within each network the first and last addresses cannot be assigned to
hosts.
These are the network address and the broadcast address,
Default Route
Is used as a "catch all" route when a more specific route is not available.
reserves all addresses in the 0.0.0.0 - 0.255.255.255. address block.
8
Special IPv4 Addresses
Loopback
is a special address that hosts use to direct traffic to themselves.
Although only the single 127.0.0.1 address is used, addresses 127.0.0.0 to
127.255.255.255 are reserved.
Link-Local Addresses
These addresses can be automatically assigned to the local host by the
operating system in environments where no IP configuration is
available.
The address block is 169.254.0.0 to 169.254.255.255
TEST-NET Addresses
The address block 192.0.2.0 to 192.0.2.255 (192.0.2.0 /24) is set aside for
teaching and learning purposes. can be used in documentation and network
examples.
9
Primary address classes
• Internet address designers (IPV4) decided to divide
the IP address space into three classes varying in
their size.
• These are:
– Class A
– Class B
– Class C
• Each class fixes the boundary between the
network prefix and the host number at a
different point within the 32 bit address.
10
Primary address classes
Class A
0 78 32
0 Prefix Suffix
Class B
1 0 Prefix Suffix
Class C
1 1 0 PrefixPre Suffix
Class D
Class E
11
Class A networks ( /8 )
• Have 8 bit network prefix starting with o, 7 bit network number,
followed by 24 bit host number.
• A maximum of 126 (2 ^7-2) /8 networks can be defined.
• All zeros (00000000) is reserved for default route, & 127 is reserved for
the “loopback” (01111111).
• Each network supports a maximum of 16,777,214(2 ^ 24-2) hosts.
• All zeros “for this network” and all ones for broadcast number in each
network.
• IPV4 address space is 2 ^ 32 = 4,294,967,296 addresses.
• Class A’s individual addresses = 2 ^ 31= 2,147,483,648 which is 50
percent of IPV4 unicast address space.
12
Class B networks ( /16 )
• Has 16 bit network prefix starting with 10.
• 14 bit network number & 16 bit host number.
• A maximum of 2 ^ 14= 16,384 networks can be
defined.
• 2 ^ 16-2= 65,534 hosts per network.
• Class B individual addresses= 2 ^ 30
=1,073,741,842 .
• Is 25 percent of the total IPV4 unicast address
space.
13
Class C networks ( /24 )
• Each network address has a 24 bit network prefix.
• Starts with 110 and 21 bit network number.
• A maximum of 2 ^ 21= 2,097,152 networks can be
defined with up to 2 ^ 8-2 = 254 hosts per network.
• Class C’s individual addresses is 2 ^ 29 = 536,870,912.
• This represents 12.5 percent of the total IPV4 unicast
address spaces.
• Class D address starts with 1110 (for research and
multicast addressing purposes).
• Class E address starts with 1111 (reserved for future
use).
14
Dotted decimal notation
15
Dotted decimal notation
16
Problems with IPV4 addressing
• The eventual exhaustion of IPV4 address space.
• The need to route traffic between the increasing
number of networks that comprise the Internet.
• Addresses are assigned to those asked without
concerns of their actual need, but according
their request.
• Lack of a network class that support medium size
organizations. (/24 supports 254 hosts, too small,
while /16 supports 65,534 hosts, too large).
17
Sub netting
• Is a procedure for dividing a single class A, B, or C network number
into smaller pieces.
• Invented in 1985.
• Goal is to:
– extend address space, and prevent address exhaustion of IPV4.
– Control the growth of Internet routing tables.
– Avoid or minimize the local network administrators request to other
Internet addresses for every new networks in an organization.
• Instead of the class-ful two-level hierarchy, sub netting supports a three
level hierarchy.
• Two level class-full hierarchy
• Three level subnet hierarchy
18
Benefits of sub netting
The size of the global Internet routing table does not
grow, since there is no need of additional address,
and for all subnets there is only single routing table
entry.
• Possibility of adding subnets when needed
without obtaining a new network number from
the Internet.
• Since Internet routers do not know about individual
subnets, route flapping (rapid change of routing)
within the private network doesn’t affect the Internet
routing table. 19
Extended network prefix
• Is composed of the classful network prefix and the
subnet number.
• Internet routers use only the network prefix of destination
address.
• Routers in sub netted environment use the extended
network prefix to route traffic between individual subnets.
– IP address = 130.5.5.25/24 (24 bit extended network prefix).
10000010.00000101.00000101.00011001
network prefix subnet # host #
10000010.00000101.00000101.00011001
24 bit extended network prefix 8 bit host #
20
Subnet mask
• Identifies how much of the address spaces are
used for the network and for the host.
• Accompanies IP addresses. 32 bit binary value.
• Identifies Prefix / suffix boundary.
– 1 bits cover prefix
– 0 bits cover suffix
• 10000010.00000101.00000101.00011001= 130.5.5.25/24
• 11111111.11111111.11111111.00000000 = 255.255.255.0
Subnet mask host #
Default subnet mask for class A = 255.0.0.0
Default subnet mask for class B = 255.255.0.0
Default subnet mask for class C = 255.255.255.0
21
Subnet design
• Four key points taken into consideration:
– How many total subnets does the organization need today?
– How many total subnets will the organization need in the future?
– How many hosts are on the organization’s largest subnet today?
– How many hosts will there be on the organization’s largest subnet in
the future?
• It is to take the maximum number of subnets required and round
up to the nearest power of two.
• To ensure that there are enough host addresses for the
organization’s largest subnet.
22
Subnet example
• An organization is assigned a network number 193.1.1.0/24
and it needs to define six subnets. The largest subnet is
required to support 25 hosts. How can you define the
extended network prefix, the subnet mask, the subnets
and hosts?
• Solution:
– For six subnets 2 ^ 3= 8 subnets (2 reserved for future use)
– For 25 hosts 2 ^ 5= 32 hosts. But all 0s and 1s host addresses can not be
allocated. Therefore, there are (2 ^ 5)-2= 30 host addresses on each subnet.
– As 193.1.1.0/24 is a class C address, its network prefix is /24.
– But, it needs to use 8 subnets and need three more bits /27.
– 193.1.1.0 = 11000001.00000001.00000001.00000000 /24
– 193.1.1.0 = 11000001.00000001.00000001.00000000 /27 E.N.P.
255.255.255.224= 11111111.11111111.11111111.11100000/27 is
Subnet mask.
23
Subnet number definition
• The eight subnets will be numbered 0 through 7.
• The 3 bit binary values for subnet are:
000= 0, 001= 1, 010= 2, 011= 3, 100= 4, 101= 5, 110= 6, and 111= 7.
• The eight subnet numbers can be listed as follows:
Base net: 11000001.00000001.00000001.00000000= 193.1.1.0/24
Subnet#0: 11000001.00000001.00000001.00000000= 193.1.1.0/27
Subnet#1: 11000001.00000001.00000001.00100000= 193.1.1.32/27
Subnet#2: 11000001.00000001.00000001.01000000= 193.1.1.64/27
Subnet#3: 11000001.00000001.00000001.01100000= 193.1.1.96/27
Subnet#4: 11000001.00000001.00000001.10000000=193.1.1.128/27
Subnet#5: 11000001.00000001.00000001.10100000=193.1.1.160/27
Subnet#6: 11000001.00000001.00000001.11000000= 193.1.1.192/27
Subnet#7: 11000001.00000001.00000001.11100000= 193.1.1.224/27
All subnets have to be multiples of subnet # 1 (32 in this case).
24
Host addresses for each subnet
• The host number field of IP addresses can’t contain all zero bits and all one bits.
• All zeros identify base network or subnet.
• All ones represent the broadcast address for the subnet.
• In our example, each subnet represents a block of 30 host addresses (2 ^ 5)-2.
• A valid host addresses for subnet # 1 is:
• Host #1: 11000001.00000001.00000001.00100001 = 193.1.1.33/27
• Host #2: 11000001.00000001.00000001.00100010 = 193.1.1.34/27
• Host #3: 11000001.00000001.00000001.00100011 = 193.1.1.35/27
• Host #4: 11000001.00000001.00000001.00100100 = 193.1.1.36/27
• Host #5: 11000001.00000001.00000001.00100101 = 193.1.1.37/27
• Host #6: 11000001.00000001.00000001.00100110 = 193.1.1.38/27
• Host #7: 11000001.00000001.00000001.00100111 = 193.1.1.39/27
• .
• .
• .
• Host#30: 11000001.00000001.00000001.00111110 = 193.1.1.62/27
• All ones: 11000001.00000001.00000001.00111111 = 193.1.1.63/27 is a
broadcast address for subnet # 1, which is always one less than address of subnet
#2. 25
Variable Length Subnet Mask (VLSM)
• VLSM is a technique where sub netting is performed
several times to allow a network to be divided into a
hierarchy of sub networks that vary in size,
• This allows an organization to much better match the size
of it’s sub netes to the requirements of it’s networks.
• Consider a company with class C address 201.45.22.0/24,
with six sub networks:
– S1, S2, S3 and S4 have only 10 hosts each.
– S5 has 60 hosts and
– S6 has 100 hosts.
We use VLSM for the different subnets.
26
Variable Length Subnet Mask (VLSM)
1. First we borrow one bit for subnet and use the
remaining 7 bits for hosts.???????????????
2. We can create 2 subnets having 126 hosts each :
i. 201.45.22.0/25 and
ii. 201.45.22.128/25 ?????????
The first subnet can be used for S6 with 100 hosts.
Take 201.45.22.128/25 and create 2 subnets each with
62 hosts.
201.45.22.128/26 and
201.45.22.192/26
Again we can use 201.45.22.128 for S5 for it’s 60 hosts.
27
Variable Length Subnet Mask (VLSM)
• Take the second subnet 201.45.22.192/26 and further
subnet it into 4 sub subnets each with 14 hosts for S1,
S2, S3 and S4.
• 201.45.22.192/28
• 201.45.22.208/28
• 201.45.22.224/28
• 201.45.22.240/28
28
Variable Length Subnet Mask (VLSM)
Subnetting a subnet, or using Variable Length Subnet Mask (VLSM) was designed
to maximize addressing efficiency.
Given an address block 192.168.15.0/24, we have the following requirements:
Addis AbabaHQ 58 host addresses
BahirdarHQ 26 host addresses
GondarHQ 10 host addresses
DessieHQ 10 host addresses
WAN links (3) 2 host addresses (each)
When creating an appropriate addressing scheme, always begin with the largest
requirement.
Addis Ababa HQ with 58 host addresses
Starting with 192.168.15.0, we will need 6 host bits to accommodate the
requirement of 58 hosts. (2^6)-2, = 62.
This allows 2 additional bits for the network portion.
The prefix for this network would be /26 and a subnet mask of
255.255.255.192.
29
Variable Length Subnet Mask (VLSM)
Address: 192.168.15.0
In Binary: 11000000.10101000.00001111.00000000
Mask: 255.255.255.192
26 Bits in binary: 11111111.11111111.11111111.11000000
fixed block addressing:
Subnet 0: 192.168.15.0 /26, host address range 1 to 62
Subnet 1: 192.168.15.64 /26, host address range 65 to 126
Subnet 2: 192.168.15.128 /26, host address range 129 to 190
Subnet 3: 192.168.15.192 /26, host address range 193 to 254
The requirements for the next largest subnet is the
BahirdarHQ LAN, requiring 26 host addresses.
We use next available address of 192.168.15.64 to create an
address block for this subnet.
30
Variable Length Subnet Mask (VLSM)
By borrowing one more bit, we are able to meet the needs of BahirdarHQ
while limiting the wasted addresses.
The borrowed bit gives us a /27 mask with the following address range:
192.168.15.64 /27, host address range 65 to 94 .
provides 30 addresses, which meets the requirement of 26 hosts and allows
room for growth for this subnet.
Next steps provide the addressing for the next largest subnets:
GondarHQ and DessieHQ, 10 host addresses each.
It requires us to borrow another bit, to extend the mask to /28.
Starting with address 192.168.15.96, we get the following address blocks:
Subnet 0: 192.168.15.96 /28, host address range 97 to 110
Subnet 1: 192.168.15.112 /28, host address range 113 to 126
31
Variable Length Subnet Mask (VLSM)
• The last step shows subnetting for the WAN links
• With these point-to-point WAN links only two
addresses are required.
• To meet the requirement, we borrow 2 more bits to
use a /30 mask.
• And we get the following address blocks:
– Subnet 0: 192.168.15.128 /30, host address 129 to 130.
– Subnet 1: 192.168.15.132 /30, host address 133 to 134.
– Subnet 2: 192.168.15.136 /30 host address 137 to 138
• As we have seen, the usage of VLSM enables us to
maximize addressing while minimizing waste.
32
IPv6
• Development started in 1990s because of concerns about
IPv4 addresses running out.
• A whole new protocol suite – not just layer 3.
• Uses 128-bit hierarchical addressing, written using
hexadecimal.
• Simpler header
• Integrated security – authentication, privacy
• Quality of service mechanisms.
33
IPv6
• IPv6 has unicast and multciast addresses like IPv4.
• There is no concept of broadcast address in IPv6.
• A new type of address called anycast address has been added to
allow a message to be sent to anyone member of a group of
devices.
• IPv4 address space is 2^32= 4,294,967,296.
• IPv6 address space is 2^128=
340,282,366,920,938,463,463,374,607,431,768,211,456 =
3.4*10^38 or about 340 trillion, trillion, trillion addresses.
• Is spitted into 16 octet/bytes representing each with a decimal
number 0 – 255.
• Eg. 128.91.45.157.220.40.0.0.0.0.252.87.212.200.31.255
34
Selecting Routing Protocols
• They all have the same general goal:
– To share network reachability information among
routers
• They differ in many ways:
– Interior versus exterior
– Metrics supported
– Dynamic versus static
– Distance-vector versus link-sate
– Classful versus classless
– Scalability
Interior Versus Exterior Routing
Protocols
• Interior routing protocols are used within an
autonomous system
• Exterior routing protocols are used between
autonomous systems
Autonomous system
“A network or set of networks that are under the administrative control
of a single entity”
Routing Protocol Metrics
• Metric: the determining factor used by a routing
algorithm to decide which route to a network is
better than another
• Examples of metrics:
– Bandwidth - capacity
– Delay - time
– Load - amount of network traffic
– Reliability - error rate
– Hop count - number of routers that a packet must
travel through before reaching the destination network
Metrics
Metrics
e0 e0 e0
172.16.10.1 172.16.30.1 172.16.50.1
e0 e0 e0
172.16.10.1 172.16.30.1 172.16.50.1
Distance-Vector Link-State
• Routing Information Protocol • Open Shortest Path First
(RIP) Version 1 and 2 (OSPF)
• Interior Gateway Routing • Intermediate System-to-
Protocol (IGRP) Intermediate System (IS-IS)
• Enhanced IGRP
• Border Gateway Protocol
(BGP)
Routing Information Protocol (RIP)
• First standard routing protocol developed for TCP/IP
environments
• Easy to configure and troubleshoot
• Broadcasts its routing table every 30 seconds; 25 routes per
packet
• Uses a single routing metric (hop count) to measure the
distance to a destination network; max hop count is 15
RIP V2 Features
• Includes the subnet mask with route updates
– Supports prefix routing (classless routing, supernetting)
– Supports variable-length subnet masking (VLSM)
• Intermediate System-to-Intermediate
System
• Link-state routing protocol
• Designed by the ISO for the OSI protocols
• Integrated IS-IS handles IP also
Border Gateway Protocol (BGP)
• Allows routers in different autonomous
systems to exchange routing information
– Exterior routing protocol
– Used on the Internet among large ISPs and major
companies
• Supports route aggregation
Summary
• The selection of switching and routing
protocols should be based on an analysis of
– Goals
– Scalability and performance characteristics of the
protocols