3. Addressing and Routing Architecture
Objectives
• Everything You Wanted to Know about IP Addressing, by Chuck Semeria, available from 3Com at
www.3com.com.
• Interconnections, Second Edition, by Radia Perlman, Addison-Wesley Publishing, January 2000.
• Routing in the Internet, by Christian Huitema, Prentice Hall, January 2000.
• OSPF: Anatomy of an Internet Routing Protocol, by John T. Moy, Addison-Wesley Publishing, January
1998.
• BGP4 Inter-Domain Routing in the Internet, by John W. Stewart, Addison-Wesley Publishing, January
1999.
• Requirements for Internet Hosts—Communication Layers, STD 0003, R. Braden, Ed., October 1989.
• Requirements for IP Version 4 Routers, RFC 1812, F. Baker, Ed., June 1995.
9. Hosts for Classes of
IP Addresses
Class A (24 bits for hosts) 224 - 2* = 16,777,214 maximum hosts
Class B (16 bits for hosts) 216 - 2* = 65,534 maximum hosts
Class C (8 bits for hosts) 28 - 2* = 254 maximum hosts
* Subtracting the network and broadcast reserved address
11. An IP address such as 176.10.255.255 that has all binary 1s in the
host bit positions is reserved for the broadcast address.
An IP address such as 176.10.0.0 that has all binary 0s in the host
bit positions is reserved for the network address.
Network IDs and Broadcast
Addresses
14. Subnet Mask
• Determines which part of an IP address is the network field and
which part is the host field
• Follow these steps to determine the subnet mask:
• 1. Express the subnetwork IP address in binary form.
• 2. Replace the network and subnet portion of the address with all 1s.
• 3. Replace the host portion of the address with all 0s.
• 4. Convert the binary expression back to dotted-decimal notation.
20. Creating a Subnet
• Determining subnet mask size
• Computing subnet mask and IP address
• Computing hosts per subnetwork
• Boolean AND operation
• IP configuration on a network diagram
• Host and subnet schemes
• Private addresses
21. Class B address with 8 bits borrowed for the subnet
130.5.2.144 (8 bits borrowed for subnetting) routes to subnet 130.5.2.0
rather than just to network 130.5.0.0.
Determining Subnet Mask Size
22. The address 197.15.22.131 would be on the subnet
197.15.22.128.
11000101 00001111 00010110 100 00011
Network Field SN
Host
Field
Class C address 197.15.22.131 with a subnet mask of
255.255.255.224 (3 bits borrowed)
Determining Subnet Mask Size
24. The router connects subnetworks and networks.
IP Configuration on a Network Diagram
25. The number of lost IP addresses with a Class C network depends on
the number of bits borrowed for subnetting.
Host Subnet Schemes
26. Network Layer 4-26
IP addressing: CIDR
CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length
address format: a.b.c.d/x, where x is # bits in
subnet portion of address
11001000 00010111 00010000 00000000
subnet
part
host
part
200.23.16.0/23
27. Network Layer 4-27
DHCP: Dynamic Host Configuration Protocol
goal: allow host to dynamically obtain its IP address from network server when
it joins network
• can renew its lease on address in use
• allows reuse of addresses (only hold address while connected/“on”)
• support for mobile users who want to join network (more shortly)
DHCP overview:
• host broadcasts “DHCP discover” msg [optional]
• DHCP server responds with “DHCP offer” msg [optional]
• host requests IP address: “DHCP request” msg
• DHCP server sends address: “DHCP ack” msg
28. Network Layer 4-28
DHCP client-server scenario
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
223.1.1.1
223.1.1.3
223.1.1.4 223.1.2.9
223.1.3.2
223.1.3.1
223.1.1.2
223.1.3.27
223.1.2.2
223.1.2.1
DHCP
server
arriving DHCP
client needs
address in this
network
29. Network Layer 4-29
DHCP server: 223.1.2.5 arriving
client
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
lifetime: 3600 secs
DHCP client-server scenario
Broadcast: is there a
DHCP server out there?
Broadcast: I’m a DHCP
server! Here’s an IP
address you can use
Broadcast: OK. I’ll take
that IP address!
Broadcast: OK. You’ve
got that IP address!
30. Network Layer 4-30
DHCP: more than IP addresses
DHCP can return more than just allocated IP address on subnet:
address of first-hop router for client
name and IP address of DNS sever
network mask (indicating network versus host portion of address)
44. Addressing and Routing Architecture
Addressing Mechanisms
Variable-Length Subnetting
This organization has a Class B address (136.178.0.0, mask 255.255.0.0) and would like
to give one subnet to each group. If we were to use only the natural mask, this
network would support 65,534 devices, which is far more than needed. However, it is
likely that the network would have problems scaling to that size. We cannot implement
subnets of equal size, given the requirement of one subnet per group. In order to
support the largest group (Marketing, with 1950 devices), we would need a 5-bit or
smaller subnet mask. But this would give a maximum of 31 possible subnets (with a 5-
bit mask). In order to have enough subnets, we would need a 6-bit or larger subnet
mask, but then the size of the subnet would not be large enough for Marketing. By
using variable-length subnetting, we can tailor the subnets to the sizes of the groups
and the quantity of subnets we need.
45. Addressing and Routing Architecture
Addressing Mechanisms
Variable-Length Subnetting
For this example we choose to use a combination of 4-bit and 8-bit subnet masks. With a 4-bit mask
(255.255.240.0), we would have 15 subnets, each with a maximum of 4096 devices. This would be
sufficient for Engineering and Marketing. The 8-bit subnet mask (255.255.255.0) provides subnets that
can have a maximum of 254 devices each, sufficient for each of the groups Sales, R&D, and Support. The
subnet allocations are as follows: The 4-bit mask (255.255.240.0) is usedto allocate the following 15
subnets:
46. Addressing and Routing Architecture
Addressing Mechanisms
Variable-Length Subnetting
For the 8-bit mask, we would take one of the 4-bit subnets and apply the 8-bit mask to it. We could take
the next 4-bit subnet available (136.178.96.0) and apply an 8-bit mask (255.255.255.0), yielding the
following 8-bit subnets:
47. Addressing and Routing Architecture
Addressing Mechanisms
Variable-Length Subnetting
These are all the 8-bit subnets between 136.178.96.0 and 136.178.112.0. Each can support up to 254 devices. We would
allocate 15 of these subnets (136.178.97.0 through 136.178.110.0) to Sales, and the last one (136.178.111.0) to R&D. At
this point we need to create more 8-bit subnets (22 subnets for Support), so we would repeat this procedure for the
next two available 4-bit subnets (136.178.112.0 and 136.178.128.0). For 136.178.112.0:
48. Addressing and Routing Architecture
Addressing Mechanisms
Variable-Length Subnetting
For 136.178.128.0:
The 22 subnets for Support would be 136.178.113.0 through 136.178.127.0, and 136.178.129.0 through
136.178.129.0. The remaining 4-bit and 8-bit subnets would be available for future growth.
49. Addressing and Routing Architecture
Addressing Mechanisms
Supernetting
• As mentioned earlier, there are not many Class A and B networks (on the order of tens of thousands). As
these network were allocated, it became necessary to allocate several Class C network addresses in place of a
single Class A or B. Recall that there are millions of Class C networks that can be allocated. What happens
when Class C addresses are used in lieu of Class A or B addresses? Consider, for example, the addressing
strategy for a company with 10,000 devices. A single Class B could support up to 65,534 devices, which
would be plenty for this company, but a Class B is not available, so Class C addresses are used instead. A
single Class C can support up to 254 devices, so 40 Class C networks are needed (40 networks × 254
addresses/network=10,160 total addresses). When 40 Class C networks are allocated to this company (e.g.,
192.92.240.0 through 192.92.279.0), routes to each network have to be advertised to the Internet. Thus,
instead of an advertisement for a single Class B network for this company, we now have advertisements for
40 Class C networks. Each route advertisement would be added to the routers in the Internet, using memory
and processing resources. As you may imagine, the number of routes would grow exponentially, as would the
memory and processing requirements in the routers.
50. Addressing and Routing Architecture
Addressing Mechanisms
Supernetting
• Supernetting is aggregating network addresses, by changing the address mask
to decrease the number of bits recognized as the network. By decreasing the
number of bits recognized as the network, we are in effect ignoring part of
the network address, which results in aggregating network addresses.
51. Addressing and Routing Architecture
Addressing Mechanisms
Supernetting
Let’s see how this works. Consider a block of 16 contiguous Class C addresses (you will shortly see why 16 was chosen,
and why it is contiguous), 192.92.240.0 through 192.92.255.0, with their natural mask 255.255.255.0:
Notice that the first, second, and last octets of this group of addresses do not change. They are 192, 92, and 0,
respectively. The third octet does change for each address. If we look at the binary representation of this octet for these
addresses, we get Figure 6.8.