Lecture 10. Subnetting & Supernetting - Inria

Transcription

Lecture 10.Subnetting & SupernettingG.Bianchi, G.Neglia, V.Mancuso

OutlineÎSubnettingÖVariable Length Subnet Mask (VLSM)ÎSupernettingÖClassless Inter-Domain Routing (CIDR)G.Bianchi, G.Neglia, V.Mancuso

medium org: N x class C? Class B?130.11.0.7ÎClass C addresses:Ö Undersized lass B addresses:Ö Much more thanenough (65534 hosts)ÎN x class C:Ö Unwise: exponentialgrowth of routingtablesÎResult: Class Baddresses werelargely preferredR2 Routing Tabledest213.2.98.0Next Hop130.11.0.0/16 Direct fwd 213.2.96.0/24 130.11.0.7213.2.97.0/24 130.11.0.7213.2.99.0Corporate213.2.98.0/24 130.11.0.7213.2.99.0/24 130.11.0.7The aftermath: 10 bit class C design would have been much better G.Bianchi, G.Neglia, V.Mancuso

Need for subnettingÎNet id-Host id:Öplace host id on physical network net id131.175.0.2 CLASS B:From: 131.175.0.1To:131.175.255.254G.Bianchi, G.Neglia, V.Mancuso65534 hosts on a same physical network?- performance?- management?

Idea: further hierarchy levelÖsubdivide a network in several subnetworksÖeach subnet a physical network (Ethernet, FDDI, X.25,ATM, Frame Relay, etc ATMSub-NetClass B network: 131.175.0.0May use third byte to identify subnet: 131.175.X.0 (or may not!)G.Bianchi, G.Neglia, V.Mancuso

Subnet creation and managementGive me a class B, please131.175.0.0 for .0Best for local administrator:flexibility to create new networks without asking InterNICnew classful addresses.Best for Internet:Route flapping in the private domain do not affect InternetOne single entry in core router tables address all subnetworksG.Bianchi, G.Neglia, V.Mancuso

SubnettingClass B address examplenetwork prefix(network address)1 0NET ID (14bit)HOST ID (16 bit)Extended network prefix(subnet address)1 0NET ID (14bit)G.Bianchi, G.Neglia, V.MancusoSUBNET ID (n bit) HOST ID (16-n bit)

Subnet Address & MaskÎHost IP 10010ÎClass B - network 0ÎSubnet MaskÖ Longer than natural class mask; Length set by administratorÖ Tells where the boundary network-host really isÎ Example: class B address with 5 bits subnet idÖ subnet mask /2111111111.11111111.11111000.00000000Ö /prefix-length notationÖ subnet mask 255.255.248.0Ö (dot decimal notation)10011111.01100100.00001000.00000000Ö 159.100.0.0 net idÖ 159.100.8.0 extended network address (net id subnet id)Ö To avoid ambiguity: 159.100.8.0/21G.Bianchi, G.Neglia, V.Mancuso

Typical class B subnettingÎClass B address /16 network prefixÆnetwork address 131.175.0.0Ænatural mask 255.255.0.0ÎSubnetted with /24 network prefix1 0NET ID (14bit)SUBNET ID (8 bit)HOST ID (8 bit)Ö255.255.255.0 subnet maskÖsubnet ID third number in dotted notationÆ131.175.21.0No technical reasons to use /24 subnets, but convenient for humans(subnet boundary clearly visible in dotted notation)G.Bianchi, G.Neglia, V.Mancuso

Remember: subnetting is arbitrary!Example: subnetting Class C 193.1.1.0 AddressBase netClass C/24 000001.00000001.000000001 1 0NET ID (21bit)1 1 0NET ID (21bit)193.1.1.0/24HOST ID (8 bit)Subnet(3 bit)Host id(5bit)Subnet # 0 net # 1 bnet # 2 bnet # 3 bnet # 4 ubnet # 5 ubnet # 6 ubnet # 7 emember: maximum 30(25-2) hosts attachable to each subnetG.Bianchi, G.Neglia, V.Mancuso

Possible netmask 100001111000001110000001100000001G.Bianchi, G.Neglia, V.Mancuso 128 192 224 240 248 252 254 255

Example: route 193.205.102.36193205102361 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 0Class C address;Outside private domain routed with mask 255.255.255.0network193205host102361 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 0Inside private domain, administrator has set netmask 255.255.255.2482552552552481 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 0Hence, route to subnet address and then to host id, computed as:networksubnethost1 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 0193.205.102.32 /29G.Bianchi, G.Neglia, V.Mancuso4

Subnet routing – 2nd exampleCore routers unaware of subnetting – route via class mask 162.12.0.0 193.1.1.36 162.12.0.0 145.54.3.5 162.12.0.0 145.54.3.5 1 162.12.0.0 193.1.1.36 Î routing tables in theInternet:Ö route according to net idÖ Use natural class maskG.Bianchi, G.Neglia, V.Mancuso145.54.3.5162.12.1.33 162.12.34.64 162.12.1.1162.12.2.32 162.12.1.33default 162.12.9.65162.12.9.65162.12.2.33162.12.34.75Net 162.12.0.0subnet mask 255.255.255.224Î Corporate routers & hosts:Ö Route according to subnet idÖ Need to KNOW subnet mask

Router configurationÎ Classful routing:Ö All necessary informationincluded in IpaddrÎ Subnet routingÖ Specific subnet mask(set by admin) requiredNet 162.12.0.0; subnet mask 255.255.255.224To other ing TableSubnet mask:255.255.255.224destNext Hop162.12.1.0Direct fwd162.12.34.64Direct fwd162.12.35.128 162.12.34.66162.12.70.96 162.12.1.12131.175.0.0 162.12.34.66131.176.0.0 162.12.34.66default162.12.1.11G.Bianchi, G.Neglia, 2.34.66162.12.35.128162.12.35.128162.12.34.64May be quite a complexRouting table VLSM will help (later)To othersubnetsTo131.175.0.0131.176.0.0

Subnetting Example (problem)algebra12 hostsAMath dept22 hostsLink-1Bphysics10 hostLink-2C193.1.1.0 networkG.Bianchi, G.Neglia, V.MancusoComputation28 host

Subnetting Example (solution?)Math dept193.1.1.96/27up to 30 hosts(97-126)algebra193.1.1.32/27up to 30 hosts(33-62)ALink-1physics193.1.1.160/27up to 30 hosts(161-190)BLink-2CWhere are the errors?G.Bianchi, G.Neglia, V.Mancuso193.1.1.0 networkComputation193.1.1.64/27up to 30 hosts(65-94)

Subnetting Example (solution!)Math dept193.1.1.96/27up to 29 hosts(97-126)Subnet gebra 193.1.1.32/27Physics 193.1.1.160/27Comput 193.1.1.64/27Link-1 193.1.1.128/27Link-2 chi, G.Neglia, V.Mancusoalgebra193.1.1.32/27up to 29 0/27up to 28 hosts(161-190)BLink-2193.1.1.192/27C193.1.1.0 networkComputation193.1.1.64/27up to 29 hosts(65-94)

VLSMVariable Length Subnet MaskRFC 1009 (1987)G.Bianchi, G.Neglia, V.Mancuso

Variable Length Subnet MaskÎallows more than one subnet mask in thesame networkÖA) more efficient use of organization’s IP address spaceÆSubnets may significantly vary in relative size (computerroom 200 hosts, secretary 4 hosts )Æconsider a 4 host network with mask 255.255.255.0: wastes250 IP addresses!ÖB) allows route aggregation, thus reducing routinginformation neededÎNeeds further support by routing protocolÖe.g. RIP1 doesn’t support VLSMG.Bianchi, G.Neglia, V.Mancuso

A typical problemApc-net100 hostx-net-120 hostLink-1BLink-3ws-net20 hostLink-2x-net-210 hostC100 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!!G.Bianchi, G.Neglia, V.Mancuso

Solution without VLSMneed 2 class C address!pc-net192.168.1.0/25(0-127, 126 -31, 30 (128-255, 126 2-63, 30 host)C192.168.1.0192.168.2.0mask 255.255.255.128mask 255.255.255.224G.Bianchi, G.Neglia, V.Mancuso

192.168.1.0/25(up to 126 hosts)(pc-net)Using VLSMÖ Recursive address spaceaggregation!Ö First, divide network in subnetsÖ then, SOME subnets further(up to 254 hosts)divided into sub-subnets192.168.1.128/25Ö then, some sub-subnets further(up to 126 hosts)192.168.1.128/27 divided etc(up to 30 hosts) (ws-net)192.168.1.0/24192.168.1.160/27(up to 30 hosts) (x1-net)192.168.1.192/27(up to 30 hosts)192.168.1.192/28(up to 14 hosts) (x2-net)192.168.1.208/28(up to 14 hosts)192.168.1.224/27(up to 30 hosts) (available)192.168.1.208/30 (ptp)192.168.1.212/30 (ptp)192.168.1.216/30 (ptp)192.168.1.220/30 (avail)G.Bianchi, G.Neglia, V.Mancuso

Final solution with VLSM1 C address is enoughpc-net192.168.1.0/25(0-127, 126 192.168.1.160/27(160-191, 30 host)255.255.255.224BLink-3Point2point links:255.255.255.252 192.168.1.216/30ws-net192.168.1.128/27(128-159, 30 .1.0G.Bianchi, G.Neglia, V.Mancusox-net-2192.168.1.192/28(192-207, 14 host)255.255.255.240

address pie for our sol.Available forfurther subnetsLink3 216-219Link2 212-215Link1 et128-159G.Bianchi, G.Neglia, V.Mancuso

Requirements for VLSM support (1)Î Routing tables: need to specify extendednetwork prefix information (subnet mask)per each entryÎ Routing protocol: must carry extendednetwork prefix information with each routeadvertisement net mask route New route advertise mask (or prefix 0prefix /20Without this feature: manually compiled tables (!!! Human error!!!)VLSM bottomline: need to use more complex routing protocols(e.g. OSPF) even for small orgG.Bianchi, G.Neglia, V.Mancuso

Routing tables for previous examplepc-net192.168.1.0/25(0-127, 126 .1.217x-net-1192.168.1.160/27(160-191, 30 host)255.255.255.224BLink-3Point2point links:255.255.255.252 7(128-159, 30 host)255.255.255.224Link-2192.168.1.212/30Router C 1.192192.168.1.192192.168.1.212G.Bianchi, G.Neglia, V.Mancuso192.168.1.216C/27 192.168.1.213/25 192.168.1.213/30 192.168.1.213/28Direct fwd/28Direct fwd/30Direct fwd/30Direct fwdx-net-2192.168.1.192/28(192-207, 14 host)255.255.255.240192.168.1.0 network

VLSM engineeringÎVLSM is a hierarchical subnet addressassignmentÖ BUT does not necessarily implies, by itself, ahierarchical routing!!ÎEffective designs combine:Ö address space reductionÖ with topologically significant address assignmentÆSubstantial reduction of routing table sizesÆMultiple route aggregationG.Bianchi, G.Neglia, V.Mancuso

VLSM engineeringÎVLSM is a hierarchical subnet addressassignmentÖ BUT does not necessarily implies, by itself, ahierarchical routing!!ÎEffective designs combine:Ö address space reductionÖ with topologically significant address assignmentÆSubstantial reduction of routing table sizesÆMultiple route aggregationG.Bianchi, G.Neglia, V.Mancuso

Complete example 1Acquistando uno spazio di indirizzi il più piccolo possibile, da un provider chegestisce lo spazio 64.2.0.0 /16,-Si divida in sottoreti la rete illustrata in figura in modo da soddisfare alle capacità richieste-Si assegnino indirizzi IP alle interfacce dei router-Si mostri la routing table del router RnetworkmaskdestEdificio A11010 hostsRouter REdificio D11 hostsEdificio B11055 hostsEdificio C1055 hostsEdificio E12 hostsG.Bianchi, G.Neglia, V.Mancuso

Solution – no route .1.064.2.1.160.0.0.0mask/25/26/28/28/28/0Router R64.2.100.1 64.2.100.264.2.1.64 /26next o B55 hosts64.2.1.66È sufficiente uno /24, es: 64.2.1.0 /24Una soluzione possibile, con massima aggregazionedei route, è illustrata in figura (si assume cheil routing esterno alla rete avvenga tramitel’interfaccia remota 64.2.100.1)Edificio A110 hosts64.2.1.128 /25Edificio D11 hosts64.2.1.50 64.2.1.17Edificio C64.2.1.49 10 hosts64.2.1.48 /2864.2.1.16 /2864.2.1.2Edificio E12 hosts64.2.1.0 /28G.Bianchi, G.Neglia, V.Mancuso

Solution – /25/26/26/0Router R64.2.100.1 64.2.100.264.2.1.64 /26next 2.1.65Edificio B55 hosts64.2.1.66È sufficiente uno /24, es: 64.2.1.0 /24Una soluzione possibile, con massima aggregazionedei route, è illustrata in figura (si assume cheil routing esterno alla rete avvenga tramitel’interfaccia remota 64.2.100.1)Edificio A110 hosts64.2.1.128 /25Edificio D11 hosts64.2.1.50 64.2.1.17Edificio C64.2.1.49 10 hosts64.2.1.48 /2864.2.1.16 /2864.2.1.2Edificio E12 hosts64.2.1.0 /28G.Bianchi, G.Neglia, V.Mancuso

Complete example 2Acquistando uno spazio di indirizzi il piu’ piccolo possibile, da un provider chegestisce lo spazio 64.2.0.0 /16,-Si subnetti la rete illustrata in figura in modo da soddisfare alle capacità richieste-Si assegnino indirizzi IP alle interfacce dei router-Si mostri la routing table del router RnetworkmaskdestEdificio A10 hostsRouter REdificio D11 hostsEdificio B110 hostsEdificio C55 hostsEdificio E12 hostsG.Bianchi, G.Neglia, V.Mancuso

Solution – no route aggregat

Example: subnetting Class C 193.1.1.0 Address 1 1 0 NET ID (21bit) HOST ID (8 bit) Class C /24 prefix Subnetted 255.255.255.224 /27prefix 1 NET ID (21bit) Host id (5bit) 1 0 Subnet (3 bit) Base net 11000001.00000001.00000001.00000000 193.1.1.0/24 Subnet # 0 11000001.00000001.00000001.00000000 193.1.1.0/27 Subnet # 1 File Size: 1MBPage Count: 62