03 Cidr
03 Cidr
03 Cidr
Textbook Ch 3.2.5
Global addressing
Properties
globally
7 A: 0 Network 14 B: 1 0 Network 21
C:
1 1 0
Network
Internet Structure
Stanford NSFNET backbone ISU
MidNet regional
PARC
NCAR UA
UNM
UNL
KU
Classful Addressing: Do we really need to give an independent class A/B/C network number to every single AS?
CSS 432: Subnetting & CIDR 3
C with 2 hosts (2/254 = 0.78% efficient) Class B with 256 hosts (256/65534 = 0.39% efficient)
IP
tables do not scale Route propagation protocols do not scale Router gets slower to scan a big forwarding table
Hierarchy
CSS 432: Subnetting & CIDR 4
Subnetting - Concept
Simple IP networks Internet A collection of subnets Internet EDU
128.96.34.1 - 30
BBUS
128.96.35.1-40 128.96.36.1-200
40 nodes
Subnet: 128.97.2.0
BBUS
128.97.2.1-30
200 nodes
Subnet: 128.97.3.0
IAS
128.97.3.1-200
256 nodes
Subnet: 128.97.4.0
CSS
128.97.4.1 128.97.5.2
Four networks each must receive an independent class of network number, (which exhausts IP addresses and floods network #s) Subnet: collects networks belonging to the same AS and give a single class of network number, which is then divided into subnet numbers internally.
5
Subnet masks define variable partition of host part Subnets visible only within site
Network number Host number 127.97.0.1 127.97.255.254
Subnet mask (255.255.255.0) 127.97.8.254/24 Network number Subnet ID Host ID Subnet ID Subnetted address
CSS 432: Subnetting & CIDR 6
19
20 21 22 23 24 25 26 27 28 29 30 31 32
255.255.224.0
255.255.240.0 255.255.248.0 255.255.252.0 255.255.254.0 255.255.255.0 255.255.255.128 255.255.255.192 255.255.255.224 255.255.255.240 255.255.255.248 255.255.255.252 255.255.255.254 255.255.255.255
6
14 30 62 126 254 510 1022 2046 4094 8190 16382 32766 65534
1 0 2 6 14 30 62 126 254
8190
4094 2046 1022 510 254 126 62 30 14 6 2 -
= 128.96.34.0
Forwarding Algorithm
D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 == SubnetNum if NextHop is an interface deliver datagram directly to destination else deliver datagram to NextHop (a router)
Use a default router if nothing matches Not necessary for all 1s in subnet mask to be contiguous
But highly recommended Ex. Two or more departments want to have their own subnet and to allocate IP addresses in it while sharing just one physical network
10
Supernetting
Subnetting
Purpose: divide a large class of network numbers into sub network numbers helps assign addresses efficiently Problem: an AS with more than 255 hosts still needs class B
Supernetting
Ex. Assign two class C network numbers instead of one class B network.
Side effect: The information that routers store and exchange increases dramatically
Ex. If an AS has 16 class C network numbers, every Internet router needs 16 entries for this AS.
CIDR
Example: (192.5.48.0, 3)
In practice
No restriction to class C nor use of count Restrict block sizes to powers of 2 Use a bit mask (CIDR mask) to identify block size
Ex. An AS assigned a block of 2048 (211) contiguous addresses starting at 128.211.168.0 is a collection of 8 (23) class C networks (with 28 addresses each) Lowest 128.211.168.0 10000000 11010011 10101000 00000000 Highest 128.211.175.255 10000000 11010011 10101111 11111111 CIDR mask (32 11 = 21 bits) 11111111 11111111 11111000 00000000 Address Notation: 128.211.168.0/21
CSS 432: Subnetting & CIDR 12
Internet backbone
Regional network
Then, what if there is a router capable of forwarding packets both to the regional network and to the corporation Z? Prefix Next Hop 192.4.0.0/18 the regional network 192.4.48.0/20 corporation Z To which of those two should we forward a packet destined to 192.4.48.3? Use Principle of Longest Match
CSS 432: Subnetting & CIDR 13
http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
CSS 432: Subnetting & CIDR 14
http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
CSS 432: Subnetting & CIDR 15
Reviews
Subnetting:
How to address and forwarding algorithm Supernetting: CIDR, principle of longest match, and classless lookup
Exercises in Chapter 3
Ex.
16
Ex 55 (Subnetting)
Suppose a router has built up the routing table shown in Figure 3.18. The router can deliver packets directly over interfaces 0 and 1, or it can forward packets to routers R2, R3 or R4. Describe what the router does with a packet addressed to each of the following destinations: (a) 128.96.39.10 (b) 128.96.40.12 (c) 128.96.40.151 (d) 192.4.153.17 (e) 192.4.153.90 SubnetNumber SubnetMask NextHop
128.96.39.0 128.96.39.128 128.96.40.0 192.4.153.0 (default) 255.255.255.128 255.255.255.128 255.255.255.128 255.255.255.192 0.0.0.0 Interface 0 Interface 1 R2 R3 R4
17
Ex 68 (CIDR)
An organization has been assigned the prefix 212.1.1/24 (Class C) and wants to form subnets for four departments, with hosts as follows: A: 75 hosts B: 35 hosts C: 20 hosts D: 18 hosts There are 148 hosts in all. (a) Give a possible arrangement of subnet masks to make this possible (b) Suggest what the organization might do if department D grows to 32 hosts
18
Ex 72
Table 3.20 is a routing table using CIDR. Address bytes are in hexadecimal. The notation /12 in C4.50.0.0/12 denotes a netmask with 12 leading 1 bits: FEF0.0.0. Note that the last 3 entries cover every address and thus serve in lieu of a default route. State to what next hop the following will be delivered: (a) C4.5E.13.87 Net/MaskLength NextHop (b) C4.5E.22.09 C4.50.0.0/12 A (c) C3.41.80.02 C4.5E.10.0/20 B (d) 5E.43.91.12 C4.60.0.0/12 C (e) C4.6D.31.2E C4.68.0.0/14 D (f) C4.6B.31.2E
80.0.0.0/1 40.0.0.0/2 00.0.0.0/2
CSS 432: Subnetting & CIDR
E F
G
19
Ex 74
An ISP that has authority to assign addresses from a /16 prefix (an old Class B address) is working with a new company to allocate it a portion of address space based on CIDR. The new company needs IP addresses for machines in 3 divisions of its corporate network: Engineering, Marketing and Sales. These divisions plan to grow as follows:
Engineering has 5 machines as of the start of year 1 and intends to add 1 machine every week Marketing will never need more than 16 machines Sales needs 1 machine for every 2 clients
As of the start of year 1, the company has no clients, but the sales model indicates that, by the start of year 2, the company will have 6 clients and each week thereafter
will get one new client with probability 60%, will lose one client with probability 20%, or will maintain the same number with probability 20%
(a) What address range would be required to support the companys growth plans for at least 7 years if Marketing uses all 16 of its addresses and the Sales and Engineering plans behave as expected? (b) How long would this address assignment last? At the time when the company runs out of address space, how would the addresses be assigned to the three groups? (c) If, instead of using CIDR addressing, it was necessary to use old-style classful addresses, what options would the new company have in terms of getting address space?
CSS 432: Subnetting & CIDR 20