Tutorial (03) IP addresses & Sub netting Dr. Ahmed M. ElShafee ١
Agenda IP Addressing Conventions Original IPv4 Address Classes Subnetting CIDR (Classless InterDomain Routing) ٢
IP Addressing Conventions 32 bits (4 bytes) unique value for each host Address composed of 2 parts (2 level hierarchy): Prefix (network ID): identifies network to which host attaches Suffix (host ID ): identifies host on that network Dotted decimal notation: Each byte is written in decimal in MSB order, separated by decimals. Example: ٣
All hosts on same network assigned same address prefix Prefixes assigned by central authority Obtained from ISP Each host on a network has a unique suffix Assigned locally by system admin Local administrator must ensure uniqueness DHCP: Dynamic Host Configuration Protocol: dynamically get address from a server ٤
Original IPv4 Address Classes There are two types of classifications Class full addresses Classless addresses Class full address Three principles class (A, B, C) Other classes (D, E) ٥
Class A: (1.0.0.0 127.255.255.255) For very large organizations 2 7 2 = (126) networks, 16 million hosts allowed ٦
Class B: (128.0.0.0 191.255.255.255) For large organizations 2 14 2 = 16 K networks, 64 K hosts allowed ٧
Class C: (192.0.0.0 223.255.255.255) For small organizations 2 21 2 =2 M networks, 254 hosts allowed ٨
Class D: (224.0.0.0 239.255.255.255) Multicast addresses No network/host hierarchy ٩
Class E: reserved for experiments ١٠
Broadcasting rules ١١
Example Consider an organization that has 2 networks, each with 500 hosts 2 prefixes are assigned to the organization (one per network), which class? Class C: supports up to 254 hosts, too small Class B: supports up to 65634 hosts, too large Class B should be chosen, how many addresses are wasted? ١٢
Class full advantages: simple, easy to understand Class full disadvantages limited address space 2 32 = 4G addresses, not enough. limited network size choices (3) Ex.: what if a class C net needs to grow beyond 255 hosts? moving to a new network requires changing IP addresses ١٣
Internet is expanding; depletion of addresses (running out of classes A and B) Class B sparsely populated (too big), People refuse to give it back Very few LANs have close to 64 K hosts Class C too small. Solution: Subnetting Classless addressing (CIDR) ١٤
Subnetting A class B address is divided into two parts: network part and local part Local part is further divided locally into subnet and host parts Network part is interpreted as before (no change) Splitting is done internally, yet looks like a single network to the outside world A single network address spans multiple physical networks ١٥
Class C address: ١٦
2 physical networks sharing the same network prefix 128.10 (same organization) Router Ruses third byte to differentiate between the 2 networks Appears as a single network with prefix 128.10 for the outside world ١٧
Subnet mask needed to differentiate between different sub nets Allows hosts to determine if another IP address is on the same sub net or the same network l's represent network part, O's represent host part ١٨
Example 01 Assume an organization with multiple subnets is assigned address 150.100.0.0. Assume each subnet has up to 120 hosts How many host bits do we need? What is the maximum number of subnets What is the network mask? ١٩
Example 02 Consider a class B network 166.113.0.0, with a total of 15 subnets and the largest has 450 hosts. Suggests four acceptable options for subnetting. Which one would you choose ٢٠
٢١
Subnetting problems Continued Internet growth (running out of IP addresses) Subnetting insufficient Prediction made in 1993: We will exhaust the address space "in a few years". Solution: Classful ip and Sub netting: forget about them CIDR (Classless InterDomain Routing): get rid of classes ٢٢
CIDR (Classless InterDomain Routing) get rid of classes Temporary fix until next generation of IP (extending the IPv4 life) Backward compatible with class full addressing Extend variable length subnet technology to prefixes Do not use classes to determine network ID. Network part can be any number of bits long Address written as a.b.c.d/x a.b.c.d: IP prefix X:address mask length (how many bits used to specify the network ٢٣
Example: 214.5.480.0/20 Prefix occupies 20 bits Suffix occupies 12 bits Class A network is a /8 Class B network is a /16 Class C network is a /24 ٢٤
Example Consider a relatively small company with a Class C network, 201.45.222.0, and 6 subnetworks {S1, S2,..., S6}. S1, S2, S3 and S4 are relatively small, containing only 10 hosts each, S5 has S5 hosts and S6 has 100 hosts. Suggest an efficient way to assign IP range for each subnetwork. ٢٥
No subnetting: Total number of hosts needed is 192 enough hosts in the Class C network to handle them all. With subnetting: 6 subnets 3 bits for the subnet Id, 5 bits for the host Id. Every subnet has the identical capacity of 30 hosts, what about 55 and 56 get another Class C block for the two big subnets and use the original for the four small ones. Use variable length mask subnetting (VLMS) ٢٦
٢٧
Thanks,.. See you next week (ISA), ٢٨