Presentation is loading. Please wait.

Presentation is loading. Please wait.

IP – Subnetting and CIDR

Similar presentations


Presentation on theme: "IP – Subnetting and CIDR"— Presentation transcript:

1 IP – Subnetting and CIDR

2 Logical sub-grouping of nodes
A single class C IP network address (say) is to be used for several physical networks; Subnet mask: One seemingly plausible way might simply be to divide the addresses: Lan X: hosts 1 – 30, Lan Y: hosts 40 – 70, Lan Z: hosts 100 – 130 However, this simple allocation does not separate the nodes into broadcast domains (it does not divide the numbers on ‘binary boundaries’ in the number ranges) Thus routers cannot use the network portion to make forwarding decisions within the network. → need a structured approach to subnetting LAN X LAN Z LAN Y WAN link to Internet

3 IP subnetting Allow arbitrary complexity of internetworked LANs within organization To reduce the size of a broadcast domain To facilitate routing between networks within an autonomous system Insulate overall internet from growth of network numbers and routing complexity Site looks to rest of internet like single network Each LAN is assigned subnet number Host portion of address partitioned into subnet number and host number Local routers route within the subnetted network Subnet mask indicates which bits are subnet number and which are host number

4 Borrowing bits for the subnet
Subnet mask ….… ……… ….……..00 32-bit IP address Network portion Host portion Subnet bits We extend the network address by a few bits by borrowing from the host part Subnet bits are the most-significant of the host bits Subnet bits appear as ‘1’ s in the subnet mask At least 2 bits must be borrowed The host portion must contain at least 2 bits With a subnet mask of the network part of the address is the same for all nodes – same logical network. Subnetting involves ‘borrowing’ some bits from the host part of the address to indicate sub-division into logical groupings:

5 Another example Assigned network address – class C, 192.228.17.0
Borrow 3 bits for subnetting: see next Subnets: 1 to 6, up to 30 hosts in each slide (32, hosts 33 to 62, 63 is broadcast) (X) (64, hosts 65 to 94, 95 is broadcast) (Y) (96, hosts 97 to 126, 127 broadcast) (Z) ………………….. …………………… (192: hosts , 223 is broadcast)

6

7 Class C subnetting Statistics
256 128 124 180 196 Subnet bits Total number of host addresses For Class C network addresses: Total Subnet bits Usable subnets Host bits Usable hosts hosts 2 22 – 2 = – 2 = 3 23 – 2 = – 2 = 4 24 – 2 = – 2 = 5 25 – 2 = – 2 = 6 180 6 26 – 2 = – 2 = 2 124 Subnetting is inefficient in the sense that many addresses are unusable: Subnetting reduces the number of available addresses

8 IP addressing: CIDR Classful addressing:
inefficient use of address space, address space exhaustion e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network CIDR: Classless InterDomain Routing network portion of address of arbitrary length address format: a.b.c.d/x, where x is the number of bits in network portion of address network part host /23

9 Supernetting CIDR Routers use the most specific (longest) match for forwarding packets. A routing table entry can represent an aggregation of networks that exist in the forward path that don't need to be specified on that particular gateway: A B C /18 /18 Router X Router Y Shorter prefix → less specific, more addresses. Longer prefix – fewer addresses, more specific. Routers use the most specific prefix in the routing table when forwarding packets. A routing table entry can represent an aggregation of networks that exist in the forward path that don't need to be specified on that particular gateway: Router X: / class-B (aggregation) Router Y will have separate entries for the two.

10 Hierarchical addressing: route aggregation (a class C example)
The 3rd byte of network address holds two-levels of address data (part of the supernet address – same for each organisation, and each organisation’s specific address extension bits - shown RED: 16 is , 18 is , 20 is , 24 is , 28 is , 30 is “Send me anything with addresses beginning /20” /24 /24 /24 Fly-By-Night-ISP Organization 1 Organization 6 Internet Organization 2 ISPs-R-Us /16” /24 Organization 3 . Fly By Night ISP receives anything matching x for the first 20 bits. Remember 16 is He then divides his client organisations into subnets with prefixes of 24 bits: Thus the last 4 bits of the third octet are used for subnetting. The last octet is used for host-ids. Org-2 is /24, remember 18 is (16+2); org-1 can use the last 8 bits to accommodate 254 hosts. Org -6 is /24, where 30 is: The last 8 bits are used for host id’s

11 More specific route preferred
Where there are multiple address matches, the more-specific match is chosen. This allows different routers to use different size masks (with apparent addressing overlap - but in fact choosing the most-specific match ensures correctness in all cases). Destination add: Matches /20 AND /24 The /24 is more specific and is chosen. “Send me anything with addresses beginning /20” /24 /24 /24 Fly-By-Night-ISP Organization 1 Organization 6 Internet Organization 2 ISPs-R-Us beginning /16 or /24” /24 Organization 3 . Organisation 2 has moved to ISPs-R-Us. How will the routing work now? The routing table entry for ISPs-R=Us now has an entry for org-2 with a 24 bit suffix, more specific.

12 Subnetting problems– a worked example
You have a class C network address You need to create 8 subnetworks containing up to 12 hosts in each. What is the address of the second usable host in the third usable subnet? How many bits to borrow? 4 bits would allow up to 14 subnetworks this would leave 4 host bits, allowing up to 14 hosts per subnet. Subnet mask will be Identify the values of the subnet bits, and host bits 128, 64, 32, 16, 8, 4, 2, 1 The first usable subnet would contribute the value 16 The second usable subnet would contribute the value 32 The third usable subnet would contribute 48 ( ) The first usable host would contribute the value 1 The second usable host would contribute the value 2 The second usable address in the third usable subnet would be (48 + 2)

13 Subnetting examples What is the subnet mask for a class A network in which four bits have been used for subnetting ? What is the subnet mask for a class B network in which seven bits have been used for subnetting ? How many usable subnets are created if ten bits are borrowed using a class B address ? Refer to the subnets created in Q3. How many usable host addresses are available each subnet ? How many usable subnets are created if seven bits are borrowed using a class B address ? Refer to the subnets created in Q5. How many usable host addresses are available in each subnet ? = 1022 62 126 510

14 More examples 7. Five bits are used for subnetting with 201.45.67.0
In which usable subnet (i.e. 1st, 2nd etc) is host ? 8. Six bits are used for subnetting In which usable subnet (i.e. 1st, 2nd etc) is host ? 9. Ten bits are used for subnetting with In which usable subnet (i.e. 1st, 2nd etc) is host ? 10. Seven bits are used for subnetting: In which usable subnet (i.e. 1st, 2nd etc) is host ? 25 = rd 26 = , 6th. Subnet 2.67 = th. 7.132 = rd.


Download ppt "IP – Subnetting and CIDR"

Similar presentations


Ads by Google