Outline

Lecture 10. ÏSubnetting ÙVariable Length Subnet Mask (VLSM) Subnetting & Supernetting ÏSupernetting ÙClassless Inter-Domain (CIDR)

Giuseppe Bianchi Giuseppe Bianchi

medium org: N x class C? Class B? Need for subnetting 130.11.0.7 213.2.96.0 ÏClass C addresses: Net ÏNet_id-Host_id: Ù Undersized (254 R2 130.11.0.0 R3 hosts) 213.2.97.0 Ùplace host_id on physical network net_id ÏClass B addresses: Ù M uch m ore than R2 Routing Table 131.175.0.2 131.175.0.3 131.175.45.54 131.175.255.254 213.2.98.0 enough (65534 hosts) dest Next ÏN x class C: 130.11.0.0/16 Direct fwd Ù Unw ise: exponential … … 213.2.99.0 grow th of routing 213.2.96.0/24 130.11.0.7 tables 131.175.0.1 213.2.97.0/24 130.11.0.7 Corporate ÏR esult: Class B 65534 hosts on a same physical network???? 213.2.98.0/24 130.11.0.7 CLASS B: addresses w ere - performance? 213.2.99.0/24 130.11.0.7 From: 131.175.0.1 - management? largely preferred To: 131.175.255.254 T he afterm ath: 10 bit class C design w ould have been m uch better… Giuseppe Bianchi Giuseppe Bianchi

Idea: further hierarchy level Subnet creation and management Ùsubdivide a network in several Give me a class B, please Private Ùeach subnet = a physical network (Ethernet, FDDI, X.25, 131.175.0.0 for you! Network ATM, Frame Relay, etc….) InterNIC Administrator 131.175.21.42 131.175.12.33 131.175.12.34 131.175.12.0 131.175.21.4 131.175.12.12 131.175.12.0 131.175.12.254 113311.1.17755.2.211.0.0 131.175.15.0 Ethernet FDDI 131.175.15.0 131.175.33.0 113311.1.17755.x.x.0.0 Host 131.175.0.0 Best for local adm inistrator: 131.175.12.0 flexibility to create new netw orks w ithout asking InterN IC 131.175.21.0 131.175.21.1 new classfuladdresses. Sub-Net ATM Best for Internet: Class B network: 131.175.0.0 R oute flapping in the private dom ain do not affect Internet May use third byte to identify subnet: 131.175.X.0 (or may not!) O ne single entry in core router tables address all subnetw orks Giuseppe Bianchi Giuseppe Bianchi

1 Subnetting Subnet Address & Mask Class B address example ÏH ost IP address: 159.100.9.18 10011111.01100100.00001001.00010010 network prefix ÏClass B - netw ork m ask: (network address) 255.255.0.0 11111111.11111111.00000000.00000000 ÏS ubnet M ask 1 0 NET ID (14bit) HOST ID (16 bit) Ù Longer than natural class m ask; Length set by adm inistrator Ù T ells w here the boundary netw ork-host really is Ï Exam ple: class B address w ith 5 bits subnet_id Extended network prefix Ù subnet m ask = /21 11111111.11111111.11111000.00000000 (subnet address) Ù/prefix-length notation Ù subnet m ask = 255.255.248.0 Ù(dot decimal notation) 1 0 NET ID (14bit) SUBNET ID (n bit) HOST ID (16-n bit) Ù 159.100.0.0 = net_id 10011111.01100100.00001000.00000000 Ù 159.100.8.0 = extended netw ork address (net_id+subnet_id) Ù T o avoid am biguity: 159.100.8.0/21

Giuseppe Bianchi Giuseppe Bianchi

Remember: subnetting is arbitrary! Typical class B subnetting Example: subnetting Class C 193.1.1.0 Address ÏClass B address = /16 network prefix Base net 11000001.00000001.00000001.00000000 193.1.1.0/24 Class C ‰network address = 131.175.0.0 1 1 0 NET ID (21bit) HOST ID (8 bit) /24 prefix ‰natural mask = 255.255.0.0 Subnetted Subnet Host id 255.255.255.224 1 1 0 NET ID (21bit) ÏSubnetted with /24 network prefix (3 bit) (5bit) /27prefix 1 0 NET ID (14bit) SUBNET ID (8 bit) HOST ID (8 bit) Subnet # 0 11000001.00000001.00000001.00000000 193.1.1.0/27 Subnet # 1 11000001.00000001.00000001.00100000 193.1.1.32/27 Ù255.255.255.0 subnet mask Subnet # 2 11000001.00000001.00000001.01000000 193.1.1.64/27 Ù Subnet # 3 11000001.00000001.00000001.01100000 193.1.1.96/27 subnet ID = third number in dotted notation Subnet # 4 11000001.00000001.00000001.10000000 193.1.1.128/27 ‰131.175. .0 Subnet # 5 11000001.00000001.00000001.10100000 193.1.1.160/27 21 Subnet # 6 11000001.00000001.00000001.11000000 193.1.1.192/27 No technical reasons to use /24 subnets, but convenient for humans Subnet # 7 11000001.00000001.00000001.11100000 193.1.1.224/27 (subnet boundary clearly visible in dotted notation) Remember: maximum 30(25-2) hosts attachable to each subnet Giuseppe Bianchi Giuseppe Bianchi

Example: route 193.205.102.36

193 205 102 36 Possible netmask values 1 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0

Class C address; 128 64 32 16 8 4 2 1 Outside private domain routed with mask 255.255.255.0 1 0 0 0 0 0 0 0 = 128 network host 1 1 0 0 0 0 0 0 = 192 193 205 102 36 1 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 0 0 = 224 1 1 1 1 0 0 0 0 = 240 Inside private domain, administrator has set netmask 255.255.255.248 255 255 255 248 1 1 1 1 1 0 0 0 = 248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 = 252 Hence, route to subnet address and then to host id, computed as: 1 1 1 1 1 1 1 0 = 254 network subnet host 1 1 1 1 1 1 1 1 = 255 1 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 193.205.102.32 /29 4 Giuseppe Bianchi Giuseppe Bianchi

2 Subnet routing – 2nd example Router configuration Core routers unaware of subnetting – route via class mask Ï Classful routing: Net = 162.12.0.0; subnet mask 255.255.255.224 … … … … … … 162.12.0.0 193.1.1.36 162.12.0.0 145.54.3.5 162.12.0.0 145.54.3.5 Ù All necessary information To other nets … … … … … … included in Ipaddr 162.12.2.33 Ï Subnet routing 162.12.34.75 145.54.55.1 193.1.1.36 Ù Specific subnet mask 162.12.1.11 To other … … 162.12.1.0 subnets (set by admin) required 162.12.1.12 114455.5.544.0.0.0.0 145.54.3.5 162.12.34.64 162.12.1.1 162.12.1.1 119933.1.1.1.1.0.0 162.12.2.32 162.12.1.33 Routing Table default 162.12.9.65 Subnet mask: 162.12.34.65 255.255.255.224 162.12.70.96 193.1.1.1 dest Next Hop 162.12.70.96 162.12.1.1 162.12.1.33 162.12.9.65 162.12.1.0 Direct fwd 162.12.2.33 162.12.34.66 116622.1.122.3.355.1.12288 … … 162.12.34.64 Direct fwd 162.12.34.75 162.12.34.64 162.12.0.0 193.1.1.36 162.12.35.128 162.12.34.66 … … Net = 162.12.0.0 162.12.70.96 162.12.1.12 Ï routing tables in the 131.175.0.0 162.12.34.66 Internet: subnet mask = 255.255.255.224 May be quite a complex To 131.176.0.0 162.12.34.66 Ù route according to net_id Ï Corporate routers & hosts: Routing table… 131.175.0.0 default 162.12.1.11 Ù Use natural class mask Ù Route according to subnet_id VLSM will help (later) 131.176.0.0 Ù Need to KNOW subnet mask Giuseppe Bianchi Giuseppe Bianchi

Subnetting Example (problem) Subnetting Example (solution?)

algebra algebra 12 hosts 193.1.1.32/27 up to 30 hosts Computation A A Computation (33-62) 193.1.1.64/27 Math dept 28 host Math dept up to 30 hosts 22 hosts 193.1.1.96/27 (65-94) Link-1 up to 30 hosts Link-1 B (97-126) B physics physics 193.1.1.160/27 10 host up to 30 hosts (161-190)

Link-2 Link-2

C C Where are the errors? 193.1.1.0 network 193.1.1.0 network Giuseppe Bianchi Giuseppe Bianchi

Subnetting Example (solution!)

algebra 193.1.1.32/27 up to 29 hosts Computation (33-62) A 193.1.1.64/27 Math dept up to 29 hosts VLSM 193.1.1.96/27 Link-1 (65-94) up to 29 hosts 193.1.1.128/27 (97-126) B physics Variable Length Subnet Mask 193.1.1.160/27 Subnet mask: up to 28 hosts RFC 1009 (1987) /27 255.255.255.224 (161-190) SUBNETS: Math 193.1.1.96/27 Link-2 193.1.1.192/27 Algebra 193.1.1.32/27 Physics 193.1.1.160/27 Comput 193.1.1.64/27 C Link-1 193.1.1.128/27 Link-2 193.1.1.192/27 193.1.1.0 network --- 193.1.1.0/27 --- 193.1.1.224/27 Giuseppe Bianchi Giuseppe Bianchi

3 A typical problem Variable Length Subnet Mask

Ïallows more than one subnet mask in the A same network pc-net x-net-1 100 host 20 host ÙA) more efficient use of organization’s IP address space Link-1 ‰Subnets may significantly vary in relative size (computer B room = 200 hosts, secretary = 4 hosts…) Link-3 ‰consider a 4 host network with mask 255.255.255.0: wastes 250 IP addresses! Link-2 ÙB) allows route aggregation, thus reducing routing ws-net x-net-2 20 host 10 host information needed C ÏNeeds further support by Ùe.g. RIP1 doesn’t support VLSM 100+20+20+10 = 150 total hosts: 1 class C enough (including growth projections). 7 subnets (4 LANS + 3 point to point links): 3 bit subnet ID (= up to 8 subnets) BUT then max 30 host per subnet: no way to accommodate pc-net!! Giuseppe Bianchi Giuseppe Bianchi

Solution without VLSM 192.168.1.0/25 Using VLSM (up to 126 hosts) Ù R ecursive address space need 2 class C address! (pc-net) aggregation! 192.168.1.0/24 Ù First, divide netw ork in subnets (up to 254 hosts) Ù then, S O M E subnets further pc-net A x-net-1 divided into sub-subnets 192.168.1.0/25 192.168.2.0/27 192.168.1.128/25 Ù then, som e sub-subnets further (0-127, 126 host) (0-31, 30 host) (up to 126 hosts) 192.168.2.64/27 192.168.1.128/27 divided… etc Link-1 (up to 30 hosts)(ws-net) B 192.168.1.160/27 192.168.1.192/28 Link-3 (x1-net) 192.168.2.128/27 (up to 30 hosts) (up to 14 hosts) (x2-net) 192.168.1.192/27 (up to 30 hosts) ws-net Link-2 x-net-2 192.168.1.208/28 192.168.1.128/25 192.168.2.96/27 192.168.2.32/27 192.168.1.224/27 (up to 14 hosts) (128-255, 126 host) (32-63, 30 host) (up to 30 hosts) (available) 192.168.1.208/30 (ptp) C 192.168.1.212/30 (ptp) 192.168.1.0 192.168.2.0 192.168.1.216/30 (ptp) mask 255.255.255.128 mask 255.255.255.224 192.168.1.220/30 (avail) Giuseppe Bianchi Giuseppe Bianchi

Final solution with VLSM 1 C address is enough address pie for our sol.

Available for further subnets pc-net A x-net-1 192.168.1.0/25 192.168.1.160/27 Link3 216-219 (0-127, 126 host) (160-191, 30 host) 192.168.1.208/30 Link2 212-215 255.255.255.128 255.255.255.224 Link-1 Link1 208-211 B Point2point links: Link-3 x-net-2 255.255.255.252 192.168.1.216/30 192-207 PC-net ws-net Link-2 x-net-2 x-net-1 0-127 192.168.1.128/27 192.168.1.212/30 192.168.1.192/28 160-191 (128-159, 30 host) (192-207, 14 host) 255.255.255.224 255.255.255.240 C WS-net 128-159 192.168.1.0

Giuseppe Bianchi Giuseppe Bianchi

4 Requirements for VLSM support (1) Routing tables for previous example Ï R outing tables: need to specify extended netw ork prefix inform ation (subnet m ask) … … … per each entry net mask route pc-net 192.168.1.0/25 Ï R outing protocol: m ust carry extended … … … A x-net-1 (0-127, 126 host) 192.168.1.160/27 netw ork prefix inform ation w ith each route 255.255.255.128 (160-191, 30 host) 192.168.1.208/30 advertisem ent 255.255.255.224 Link-1 192.168.1.217 B Point2point links: Link-3 255.255.255.252 192.168.1.216/30 New route advertise + mask (or prefix len): 192.168.1.213 131.175.192.0 10000011.10101111.11000000.00000000 ws-net Link-2 x-net-2 255.255.240.0 11111111.11111111.11110000.00000000 192.168.1.128/27 192.168.1.212/30 192.168.1.192/28 prefix /20 (128-159, 30 host) (192-207, 14 host) 255.255.255.224 Router C table 255.255.255.240 Without this feature: manually compiled tables (!!! Human error!!!) C 192.168.1.128 /27 192.168.1.213 192.168.1.0 /25 192.168.1.213 VLSM bottomline: need to use more complex routing protocols 192.168.1.208 /30 192.168.1.213 (e.g. OSPF) even for small org 192.168.1.192 /28 Direct fwd 192.168.1.0 network 192.168.1.192 /28 Direct fwd Giuseppe Bianchi Giuseppe B1ia92n.c1h68i .1.212 /30 Direct fwd 192.168.1.216 /30 Direct fwd

VLSM engineering VLSM engineering ÏV LS M is a hierarchical subnet address ÏV LS M is a hierarchical subnet address assignm ent assignm ent Ù BUT does not necessarily im plies, by itself, a Ù BUT does not necessarily im plies, by itself, a hierarchical routing!! hierarchical routing!!

ÏEffective designs com bine: ÏEffective designs com bine: Ù address space reduction Ù address space reduction Ù w ith topologically significant address assignm ent Ù w ith topologically significant address assignm ent ‰Substantial reduction of routing table sizes ‰Substantial reduction of routing table sizes ‰Multiple route aggregation ‰Multiple route aggregation

Giuseppe Bianchi Giuseppe Bianchi

Solution – no route aggregation Complete example 1 È sufficiente uno /24, es: 64.2.1.0 /24 Acquistando uno spazio di indirizzi il più piccolo possibile, da un provider che network mask dest Una soluzione possibile, con massima aggregazione 64.2.1.128 /25 64.2.1.129 gestisce lo spazio 64.2.0.0 /16, dei route, è illustrata in figura (si assume che 64.2.1.64 /26 64.2.1.65 -Si divida in sottoreti la rete illustrata in figura in modo da soddisfare alle capacità richieste il routing esterno alla rete avvenga tramite 64.2.1.48 /28 64.2.1.66 l’interfaccia remota 64.2.100.1) -Si assegnino indirizzi IP alle interfacce dei router 64.2.1.0 /28 64.2.1.66 -Si mostri la routing table del router R 64.2.1.16 /28 64.2.1.66 still 64.2.100.1 obscure 0.0.0.0 /0 Edificio A network mask dest Router R 64.2.1.129 110 hosts 64.2.1.65 64.2.1.128 /25 64.2.100.1 … Edificio A Edificio D Router R 11100 hosts Edificio B 11 hosts 64.2.1.64 /26 64.2.1.17 55 hosts 64.2.1.50 64.2.1.16 /28 Edificio D 11 hosts Edificio B 64.2.1.66 Edificio C 15150 hosts 64.2.1.2 64.2.1.49 10 hosts Edificio C 1505 hosts 64.2.1.48 /28 Edificio E Edificio E 12 hosts 12 hosts 64.2.1.0 /28 Giuseppe Bianchi Giuseppe Bianchi

5 Solution – final Complete example 2 È sufficiente uno /24, es: 64.2.1.0 /24 network mask dest Una soluzione possibile, con massima aggregazione Acquistando uno spazio di indirizzi il piu’ piccolo possibile, da un provider che 64.2.1.128 /25 64.2.1.129 dei route, è illustrata in figura (si assume che gestisce lo spazio 64.2.0.0 /16, 64.2.1.64 /26 64.2.1.65 il routing esterno alla rete avvenga tramite -Si subnetti la rete illustrata in figura in modo da soddisfare alle capacità richieste 64.2.1.0 /26 64.2.1.66 still l’interfaccia remota 64.2.100.1) - 0.0.0.0 /0 64.2.100.1 Si assegnino indirizzi IP alle interfacce dei router obscure -Si mostri la routing table del router R Edificio A network mask dest Router R 64.2.1.129 110 hosts 64.2.1.65 64.2.1.128 /25 64.2.100.1 … Edificio D Edificio A Edificio B 11 hosts Router R 10 hosts 64.2.1.64 /26 55 hosts 64.2.1.50 64.2.1.17 64.2.1.16 /28 Edificio D 11 hosts 64.2.1.66 Edificio C Edificio B 64.2.1.2 110 hosts 64.2.1.49 10 hosts Edificio C 55 hosts 64.2.1.48 /28 Edificio E Edificio E 12 hosts 12 hosts

64.2.1.0 /28 Giuseppe Bianchi Giuseppe Bianchi

Solution – no route aggregation È sufficiente uno /24, es: 64.2.1.0 /24 Requirements for VLSM support (2) network mask dest Una soluzione possibile, con massima aggregazione 64.2.1.128 /25 64.2.1.129 dei route, è illustrata in figura (si assume che 64.2.1.64 /26 64.2.1.200 il routing esterno alla rete avvenga tramite Ï“Longest Match” Forwarding Algorithm 64.2.1.48 /28 64.2.1.49 l’interfaccia remota 64.2.100.1) 64.2.1.0 /28 64.2.1.200 Routing table 64.2.1.16 /28 64.2.1.200 now clear 0.0.0.0 /0 64.2.100.1 Edificio A 11.0.0.0 /8 Route 1 Router R 64.2.1.49 10 hosts Three 11.1.0.0 /16 Route 2 64.2.1.129 64.2.1.48 /28 IP packet matches 64.2.100.1 … Edificio D Destination: 11.1.2.5 11.1.2.0 /24 Route 3 Edificio B 11 hosts 64.2.1.128 /25 64.2.1.22 110 hosts 64.2.1.66 64.2.1.16 /28 Longest match = smaller network Best (longest) match 64.2.1.200 Edificio C 64.2.1.2 64.2.1.77 55 hosts

64.2.1.64 /26 Edificio E 12 hosts no simple aggregation! 64.2.1.0 /28 Giuseppe Bianchi Giuseppe Bianchi

Solution - final E’ sufficiente uno /24, es: 64.2.1.0 /24 Example: VLSM engineering network mask dest Una soluzione possibile, con massima aggregazione 64.2.1.128 /25 64.2.1.129 dei route, e’ illustrata in figura (si assume che 64.2.1.0 /25 64.2.1.200 Il routing esterno alla rete avvenga tramite 64.2.1.48 /28 64.2.1.49 l’interfaccia remota 64.2.100.1): 0.0.0.0 /0 64.2.100.1 VLSM subnetting of class A 11.0.0.0 Edificio A 11.1.0.0/24 11.1.254.0/28 Router R 64.2.1.49 10 hosts 11.0.0.0/16 11.1.1.0/24 11.1.254.16/28 64.2.1.129 64.2.1.48 /28 11.1.0.0/16 11.1.254.32/28 64.2.100.1 … 11.2.0.0/16 11.1.254.0/24 Edificio D 11.1.254.208/28 Edificio B 11 hosts 11.0.0.0/8 11.1.255.0/24 64.2.1.128 /25 64.2.1.22 11.253.0.0/16 11.1.254.224/28 110 hosts 64.2.1.66 64.2.1.16 /28 11.254.0.0/16 11.254.0.0/19 11.1.254.240/28 64.2.1.200 Edificio C 64.2.1.2 11.255.0.0/16 11.254.32.0/19 64.2.1.77 55 hosts 11.254.64.0/19 64.2.1.64 /26 Edificio E 11.254.192.0/19 12 hosts 11.254.224.0/19 64.2.1.0 /28 Giuseppe Bianchi Giuseppe Bianchi

6 Route aggregation with VLSM Ï VLSM allows to hide detailed structure of routing information for one subnet group from other routers - reducing routing table Size

11.1.0.0/16 11.0.0.0/16 11.1.0.0/24 Router A 11.1.0.0/16 Router B CIDR 11.0.0.0/8 11.1.1.0/24 11.253.0.0/16 11.254.0.0/16 11.1.254.0/24 Classless Inter-Domain Routing 11.255.0.0/16 11.1.255.0/24 Internet RFC 1517 to 1520 (1993) 11.254.0.0/16 11.1.254.0/24 Router C Router C

11.254.32.0/19 11.1.254.0/28 11.254.64.0/19 11.1.254.16/28 11.1.254.32/28 11.254.192.0/19 11.1.254.224/28 11.254.224.0/19 11.1.254.240/28 Giuseppe Bianchi Giuseppe Bianchi

An historical perspective N x class C? Class B? The 1992 Internet scenario 130.11.0.7 213.2.96.0 ÏN ear-term exhaustion of class B address space ÏClass C addresses: Net ÙIn early years, Class B addresses given away! Ù Undersized (254 R2 130.11.0.0 R3 ÙUnefficient division into A, B, C classes hosts) 213.2.97.0 ‰byte-word: unwise choice (class C too little, class B too big) ÏClass B addresses: ‰The aftermath: much better, e.g. C=10 bits, B=14 bits Ù M uch m ore than R2 Routing Table Ù 213.2.98.0 Projections at the time: class B exhaustion by 1994/95 enough (65534 hosts) dest Next Hop ÏN x class C: 130.11.0.0 Direct fwd Ù Unw ise: exponential … … 213.2.99.0 grow th of routing 213.2.96.0 131.11.0.7 tables 213.2.97.0 131.11.0.7 Corporate ÏR esult: Class B 213.2.98.0 131.11.0.7 addresses w ere N ot a real problem : there are in 213.2.99.0 131.11.0.7 largely preferred principle 2M class C addresses! … w hat are w e m issing??

Giuseppe Bianchi Giuseppe Bianchi

Routing table growth

The problem 130.11.0.7 213.2.96.0 ÏCorporate has to build 4 Net R2 130.11.0.0 R3 physical networks (e.g. 213.2.96.0/24 213.2.97.0 buildings) Ï4 x netw orks ÙExample: networks up to 254 hosts 213.2.97.0/24 ÙUnw ise: R2 Routing Table Ï 213.2.98.0 Must “buy” 4 IP network dest Next Hop addresses exponential grow th of 130.11.0.0 /xx Direct fwd 213.2.98.0/24 routing tables … … 213.2.99.0 213.2.96.0 /24 131.11.0.7 213.2.99.0/24 213.2.97.0 /24 131.11.0.7 Corporate ÏWhy this is bad? 213.2.98.0 /24 131.11.0.7 Corporate 213.2.99.0 /24 131.11.0.7

Giuseppe Bianchi Giuseppe Bianchi

7 The 1992 Internet scenario Multiple class C assignment Corporate Network ÏExponential grow th of routing tables 213.2.96.8 11.0.0.32 20.0.0.5 20.0.0.6 130.11.0.12 130.11.0.7 ÙMultiple class C allocation dramatic for routing tables 213.2.96.0 ‰necessary because of Class B exhaustion Net Net Net 11.0.0.0 R1 20.0.0.0 R2 130.11.0.0 R3 ‰100.000 entries highly critical for performance 213.2.97.0 » 2M class C: WAY OUT of the capabilities of routing sw & hw R2 Routing Table 213.2.98.0 Destination Network Next Hop 213.2.99.5 213.2.99.0 20.0.0.0 Direct forward 130.11.0.0 Direct forward Ù Projections at the time Ï Default routes: suboptimal ‰ End 1990: 2190 routes; end 1992: 8500 routes; 11.0.0.0 20.0.0.5 traffic balancing ‰ End 1995 projection: 70000 routes (critical); 213.2.96.0 130.11.0.7 Ï Core routers: cannot have ‰ End 1995 factual: 30000 routes thanks to default routes (large tables) classless routing 213.2.97.0 130.11.0.7 Ï ‰ Mid 1999: 50000 routes HW and SW limits on routing 213.2.98.0 130.11.0.7 table lookup time Ï Routing table updates are 213.2.99.0 130.11.0.7 critical (large tables traveling among routers for updates) Giuseppe Bianchi Giuseppe Bianchi

Classless Inter-Domain Routing CIDR model CIDR ÏClassless ÏO fficially developed in septem ber 1993 ÙCompletely eliminates traditional concepts of Class A, B and Ù R FC 1517,1518,1519,1520 C addresses ÏCID R also know n as S upernetting Ïnetwork prefix based ÏFundam ental solution for R outing table problem Ùrouters do not make any assumption on the basis of the Ï T em porary solution to Internet address space three leading bits depletion Ùthey require an explicit network prefix to determine dividing Ù32 bits: unwise choice ‰nobody could expect such an Internet growth point between net_id and host_id ‰and Internet appliances will have a terrific impact Ùclearly, capability of advertise prefix must be supported by Ùunwise address assignment in early days routing protocol (e.g. BGP4) ‰class B addresses with less than 100 hosts are common!! ÙProjections (RFC 1752): address depletion between 2005 ÏIn essence: CIDR = VLSM applied to the and 2001 WHOLE Internet!! ÙUltimate solution: IPv6 (128 bits address!) Giuseppe Bianchi Giuseppe Bianchi

Cidr addresses CIDR = supernetting

10.23.64.0/20 00001010.00010111.01000000.00000000 ÏOrganization assigned 2n class C addresses Ùwith contiguous address space 130.5.0.0/20 10000010.00000101.00000000.00000000 Ïaddressing: use network bits with host_id meaning 200.7.128.0/20 11001000.00000111.10000000.00000000 Ùthe opposite of subnetting!

Regardless the traditional class, all these addresses are similar! Example: 4 class C addresses appear to networks outside as All address a network composed of as much as 4094 hosts a single network Interpreting 200.7.128.0/20: a SINGLE NETWORK, contiguous block of 16 class C addr Natural class C mask 200.7.128.0 200.7.132.0 200.7.136.0 200.7.140.0 200.7.129.0 200.7.133.0 200.7.137.0 200.7.141.0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 200.7.130.0 200.7.134.0 200.7.138.0 200.7.142.0 200.7.131.0 200.7.135.0 200.7.139.0 200.7.143.0 (Super) netmask: 255.255.252.0 Giuseppe Bianchi Giuseppe Bianchi

8 Routing with CIDR Supernet Address 213.2.96.8 Ï4 address-contiguous networks: 11.0.0.32 20.0.0.5 20.0.0.6 130.11.0.12 130.11.0.7 213.2.96.0 Net Net Net Ù213.2.96.0 11010101.00000010.01100000.00000000 11.0.0.0 R1 20.0.0.0 R2 130.11.0.0 R3 Ù213.2.97.0 11010101.00000010.01100001.00000000 213.2.97.0 Ù213.2.98.0 11010101.00000010.01100010.00000000 R2 Routing Table Ù213.2.99.0 11010101.00000010.01100011.00000000 Dest.Net Dest.Netmask Next Hop 213.2.99.5 213.2.98.0 Ïsupernet mask: 20.0.0.0 255.0.0.0 Direct forward 130.11.0.0 255.255.0.0 Direct forward 213.2.99.0 Ù255.255.252.0 11.0.0.0 255.0.0.0 20.0.0.5 Ïsupernet address: 213.2.96.0/22 213.2.96.0 255.255.252.0 130.11.0.7 Corporate Network Ù11010101 . 00000010 . 011000 00 . 00000000 Corporate Supernet address: 213.2.96.0/22 11010101 . 00000010 . 011000 00 . 00000000

Giuseppe Bianchi Giuseppe Bianchi

Large networks depolyment Requirements for CIDR support ÏS am e of V LS M (but on a w orldw ide scale) ÏOrganization assigned 2n class C addresses Ïmay arbitrarily deploy subnetworks with more ÙRouting protocol must carry network prefix information with each route advertising than 254 hosts! ÙThis was impossible with class C, as natural netmask Ùall routers must implement a consistent was /24 forwarding algorithm based on the “longest match” ÏBUT Software running on all the subnet hosts need to accept larger masks than natural one Ùfor route aggregation to occur, addresses Ùe.g. setting netmask = 255.255.252.0 for host IP must be assigned to be topologically significant address 193.21.34.54 may be forbidden by sw

Giuseppe Bianchi Giuseppe Bianchi

Route aggregation CIDR allocation control of internet tables growth topological allocation of ex class-C addresses

1 single advertise for 256 /24!! Multi regional 192.0.0.0 - 193.255.255.255 Europe 194.0.0.0 - 195.255.255.255 200.25.0.0/16 Large ISP The Internet Others 196.0.0.0 - 197.255.255.255 North America 198.0.0.0 - 199.255.255.255 200.25.16.0/20 Central-South America 200.0.0.0 - 201.255.255.255 200.25.16.0/21 200.25.16.0/24 Pacific Rim 202.0.0.0 - 203.255.255.255 200.25.17.0/24 200.25.24.0/22 Others 204.0.0.0 - 205.255.255.255 200.25.18.0/24 200.25.28.0/23 200.25.30.0/23 200.25.19.0/24 200.25.24.0/24 Others 206.0.0.0 - 207.255.255.255 200.25.20.0/24 200.25.25.0/24 IANA reserved 208.0.0.0 - 223.255.255.255 200.25.21.0/24 200.25.26.0/24 200.25.28.0/24 200.25.30.0/24 200.25.22.0/24 200.25.27.0/24 200.25.29.0/24 200.25.31.0/24 All are class C blocks, since class B blocks are no more allocated… Recent trends: “attack” unused class A addresses 200.25.23.0/24 Company B Company C Company D Company A (address space 64.0.0.0/2: from 64.0.0.0 to 126.0.0.0) Giuseppe Bianchi Giuseppe Bianchi

9 Exception route Longest match forwarding IPDEST: 195.0.20.2 Longest match forwarding 11000011.00000000.00001100.00000010 ??? 194.0.0.0 /7 (254.0.0.0) IP packet 11000010.00000000. 00000000. 0 NY PARIS Destination: 203.22.66.5 Routing table 11001011 . 00010110 . 01000010 . 00000101 ROUTER ROUTER 203.0.0.0 /11 Route 1 Three shorter (cheaper) path 203.20.0.0 /14 Route 2 for this organization... matches European region 203.22.64.0 /20 Route 3 194.0.0.0 - 195.255.255.255

195.0.16.0 /21 Fuerteventura Best (longest) match R1: 11001011 . 00010110 . 01000010 . 00000101 11000011.00000000. 00001000. 0 router R2: 11001011 . 00010110 . 01000010 . 00000101 Lanzarote’s software inc R3: 11001011 . 00010110 . 01000010 . 00000101 195.0.16.0 - 195.0.23.0 Longest match(R3) = smaller network But why longest match is ever needed???

Giuseppe Bianchi Giuseppe Bianchi

Common exception route case Common exception route case

200.25.0.0/16 ISP (Albacom) 200.25.16.0/21 200.25.0.0/16 ISP (Albacom)

The Internet The Internet Organization A Organization A

ISP (Eunet) 199.32.0.0/16 ISP (Eunet) 199.32.0.0/16 200.25.16.0/21 200.25.16.0/21 ÏAt a point in time, organization A selects Eunet as new ISP! ÏThen organization A keeps the same address block Ù Best thing to do (for the Internet): obtain a new block of addresses ÙEunet is in charge to advertise the new block, too, by and renumber injecting in the internet more specific route infos Ù virtually impossible for a reasonably complex organization… ÙThis has created a new entry in routing tables, to be solved ‰and even think to organizations that re-sells subnets... with longest match Giuseppe Bianchi Giuseppe Bianchi

The open problems of CIDR Address blocks for private 1. S till exist pre-CID R routers (RFC 1918) Ù N on CID R routers: N eed to rely on “default” routes to keep reasonable routing table sizes Ù Consequence: not optim alrouting (longer paths) IANA-Allocated, Non-Internet Routable, 2. T he num ber of exceptions is raising IP Address Schemes Ù recent trends indicate a return to exponential routing tables grow th! Class Network Address Range ‰ Address ownership (portable blocks): dramatic » Proposals (not accepted) to allows ownership only up to /9 ISPs A 10.0.0.0-10.255.255.255 » Current “rule”: ownership starts from 8192 host networks (/19) B 172.16.0.0-172.31.255.255 ‰ Address lending » Renumbering necessary when changing ISP C 192.168.0.0-192.168.255.255 3. S hortage of IP addresses rem ains a hot problem Ù A ppeals to return unused IP addresses (R FC 1917) To be used by private organizations not connected to the Internet ‰ unlikely, as they are viewed as assets!! No need to ask to IANA or InterNIC for these addresses. Use Network Address Translator when external connectivity needed Giuseppe Bianchi Giuseppe Bianchi

10 IPv6 Network Address Translator (IP next generation - IPng) “Inside” Network “Outside” Network ÏThe ultimate address space solution NAT Ù128 bit addresses 10.0.0.2 192.69.1.1 10.0.0.2 Ùsome other very important corrections and Internet improvements to IPv4 ‰ 10.0.0.3 although mostly designed to be as close as possible Source Address to IPv4 NAT Table Inside Local Inside Global ÏPrices to pay: IP Address IP Address ÙDouble IP header size (40 bytes versus 20) 10.0.0.2 192.69.1.1 10.0.0.3 192.69.1.2 ÙDifficult and slow transitory from IPv4 to IPv6 ÏMap external address with Internal ones (may be a subset) Giuseppe Bianchi Giuseppe Bianchi

11