Advanced IP-Addressing

IP Addressing
• IP addresses uniquely identify a host or
router on the Internet
• It is a 32-bit address (4 octets)
• Has two main fields: NetId and HostId
• The MSBs of the NetId identify the IP class
• There are five IP classes: A, B, C, D, E
IP Addressing
• Decimal dotted notation Ex.
• Classes:
A: MSB =0, from 1 to 126 first octet
B: MSBs =10, from 128 to 191 first octet
C: MSBs = 110 from 192 to 223 first octet
D: MSBs =1110 from 224 to 239 first octet
E: MSBs = 1111 from 240 to 255 first octet
IP Addressing
• Classes A, B, C are used for unicasting
• Class D is used for multicasting. There is no
NetId nor HostId, all bits are used for the
different multicasting addresses.
• Class E is reserved by the Internet for
special use
IP Addressing
Number of Networks and Hosts per class
Class Networks
27 - 2 = 126
224 -2 = 16777214
214 = 16384
216 -2 = 65534
221 = 2097152 28 - 2 = 254
IP Addressing
• Multihomed devices:
– Can be computers that are connected to
different networks, with different IP numbers
for each
– Routers, each of its interfaces must have an
assigned IP number
IP Addressing
• Special addresses (Can not be assigned to
Network Address Has Host ID all zeros
Direct Broadcast Has host ID all 1s
Limited Broadcast Has Net and Host ID all 1s
This host on this net All zeros
Specific host/this net NetId= 0s, HostID specific
Loopback address
NetId = 127, HostID any
IP Addressing
• Limited Broadcasts will be blocked by a
router and confined to the local network
• This host on this network is an IP address used
by a host at bootup, when it does not know its
IP address and sends it as source address to
the server (all zeros)
• Specific host on this network is an IP address
used by a host to communicate with another
IP Addressing
• Specific host on this network ( NetID = 0,
HostID = specific )
– Allows a host to communicate with another host
on the same network
– Used only in the destination field of an IP packet
• Loopback address (127 in first octet)
– The packet with this destination address will not
leave the machine. Used to test the machine
IP Addressing
• Multicast addresses
– Are class D
– Can be used only as destination address
– Can be local or global level
• Local means a group of users in one network
• Global means a group of users belonging to different
• A system (host) can have several multicast addresses in
addition to its own unicast address
IP Addressing
• Assigned Multicast Addresses (by internet)
Address Group
DVMRP routers
IP Addressing
• Assigned Multicast Addresses (by internet)
Address Group
ST Routers
ST Hosts
RIP2 Routers
IGRP Routers
IP Addressing
• Assigned Multicast Addresses (by internet)
Address Group
– 224.0.1.X
For Conferencing/Teleconferencing
• Private Networks
• For organizations that want to use TCP/IP but
do not need internet access.
• Although they could pick any set of IP
addresses, this could cause some confusion
IP Addressing
• A block of IP addresses on the three classes
have been reserved for this purpose
172.16 to 172.31
192.168.0 to 192.168.255
IP Addressing - Subnetting
• Subnetting is the process of dividing a
network into several smaller subnetworks
• To the Internet, the organization that subnetted
its network still has one network address.
• The router at the organization will direct the
traffic to the different subnets, based on the
subnet masks placed at each subnet.
IP Addressing - Subnetting
• Each of the three primary IP address classes
has an associated default subnet mask
• The subnet mask is a 32-bit number (also four
decimal dotted notation) in which the bits that
correspond to the IP network address are
made equal to one (1) and the bits that
correspond to the hosts (in the IP address) are
made equal to zero.
IP Addressing - Subnetting
• The default subnet masks for classes A, B, C
– Class A:
– Class B:
– Class C:
• A network using the default subnet mask is
not subnetted.
IP Addressing - Subnetting
• Depending on the available routers and
routing protocols, you can implement one of
two types of subnetting:
– Constant Length subnet masks (CLSM)
– Variable Length subnet mask (VLSM)
• When you subnet, you are borrowing bits
from the HostId field and assign them to the
NetId field; that way you have more bits to
encode subnets Ids but less bits for hosts
IP Addressing - Subnetting
• Example of CLSM: IP address=
– This is a class B IP network address and has an
associated default subnet mask of
– This two pieces of information could have been
obtained using another IP addressing notation
called slashed IP. In this example the IP network
address would be /16 (slash 16) which
means that 16 bits are used for the associated
NetId field of the subnet mask.
IP Addressing - Subnetting
• Example of CLSM: IP address=
– If we want to subnet it, and we use for example a
two bit subnet field, then two bits will be
borrowed from the HostId field, of the default
subnet mask, and will be used to identify up to
four possible subnets: using the bit combinations:
00, 01, 10, 11.
– The subnet mask will become:
IP Addressing - Subnetting
• Example of CLSM: IP address=
– Working it out in binary for :
– 1111 1111.1111 1111.1100 0000.0000 0000
– The group of bits=1 not bolded, correspond to
what is called the network prefix.
– The two bits=1 that are bolded are the subnet Id.
– The collection of all the bits=1 is the extended
network prefix.
IP Addressing - Subnetting
• Using two bits for subnetId (b=2) allows us to
subnet into 2b =22 = 4 subnets. But since the
all zeros and all ones combinations are not
allowed, the usable subnets are 2b – 2 = 2
• From a routing perspective, subnetting can be
used to create network regions where
machines would be on the same physical
network(segment) and thus communicate
using their MAC addresses
IP Addressing - Subnetting
• When a computer in one subnet wishes to
communicate with a computer on another
subnet, traffic must be forwarded from the
sender to a nearby IP gateway (router).
• The Gateway will send its message on its way
to the destination, which could be local to the
router (another port) or to another router that
is closer to the destination host.
IP Addressing - Subnetting
• Exercise of CLSM subnetting:
– Net Inc. wants 12 subnets for its class C IP
network address No subnet will
require more than 10 hosts addresses
– Solution:
• 1. Add two to the number of subnets needed. In this
case 12 + 2 = 14.
• Find the power of two closest to that number but larger
to it. In this case 16
IP Addressing - Subnetting
• Solution:
• 3. Which exponent must be used in base two to obtain
the number of subnets calculated before? 2 n = 16 ?
Answer, n = 4
• 4. Thus you will borrow 4 bits from the associated
HostId bits of default subnet mask and use them for the
associated NetId bits of the subnet mask to be used
• In binary : 1111 1111.1111 1111.1111 1111.1111 0000
• In dotted decimal:
IP Addressing - Subnetting
• Variable Length Subnet Mask (VLSM)
– If all segments(subnets) must support roughly the
same number of hosts (+/- 20%), CLSM makes
the most sense; but if some subnets require a large
number of hosts and others do not, CLSM will
waste IP address space. In these cases VLSM is
– Basically with VLSM, the larger subnets are
subnetted again, using a second subnet mask.
IP Addressing - Subnetting
• Variable Length Subnet Mask (VLSM)
– To implement VLSM, you must have:
– 1. Routing protocols that carry the extended
network prefix information with each route
advertised. For example: RIP-2, and OSPF.
– 2. The routers must implement a “longest match”
algorithm, whereby, the router will select the route
with the longest extended network prefix (the
most specific network), when several routes
IP Addressing - Subnetting
• Variable Length Subnet Mask (VLSM)
– 3. The address assigned must mirror the physical
topology of the network. This reduces the amount
of routing information by taking the set of
addresses assigned to a particular region of the
topology and aggregating them into a single
routing advertisement for the entire set.
– This issue is important for routing purposes and is
called CIDR (Classless Interdomain Routing)
Related flashcards
Create Flashcards