IP Addressing and Subnetting Tony Madden John Paul McCann NEI
2 IP ADDRESSING 32 Bit Address 2 32 = 4.2 billion possible addresses Decimal Network.Network.Network.Host (N.N.N.H) (Class C Address) Binary HexC0 Government broken addressing system down into classes A, B, C, D, E A – very large organisations( , ) –Network.Host.Host.Host (N.H.H.H) –The first bit of the Network address is reserved for ease of recognition i.e. 0 by routers –2 7 Networks (128) with 2 24 Nodes ( )
3 IP ADDRESSING Government broken addressing system down into classes B – large organisations ( , ) –Network.Network.Host.Host (N.N.H.H) –The two bits of the Network address are reserved for ease of recognition i.e. 10 by routers –2 14 Networks (16384) with 2 16 Nodes (65534) C – small organisations( , ) –Network.Network.Network.Host (N.N.N.H) –The three bits of the Network address are reserved for ease of recognition i.e. 110 by routers –2 21 Networks ( ) with 2 8 Nodes (256)
4 IP ADDRESSING NOTE: Cisco state that you cannot use the first and last of any of the network or node ranges as they are reserved for network or node addresses and broadcasts Therefore: –A = 2 7 – 2 = 126 Networks 2 24 – 2 = Nodes –B = 2 14 – 2 = Networks 2 16 – 2 = Nodes –C = 2 21 – 2 = Networks2 8 – 2 = 254 Nodes
5 IP ADDRESSING Internet addresses Assigned to us by the Network Information Centre upon application A = * Binary Chart - all binary no.s beginning with 0 B = Binary Chart - all binary no.s beginning with 10 C = Binary Chart - all binary no.s beginning with 110 »Ref: Binary – Decimal Conversion Chart Appendix D P
6 IP ADDRESSING AND SUBNETTING Class C addressN.N.N.H DecimalBinary IP Subnet Mask Host range – Cannot use 0 (0) Network address or 255 ( ) Broadcast addresses Usable Hosts –
7 Subnetting a Class C addressN.N.N.H Subnet into 2 subnets Borrow 2 bits from the Host part of the IP address (N.N.N.H ) This now gives you a network address that is now 26 bits long and leaves 6 bits to assign to node addresses. You can borrow a minimum of 2 bits and a maximum of 6 bits from a class C IP address IP ADDRESSING AND SUBNETTING
8 IP ADDRESSING AND SUBNETTING Borrow 2 bits (subnetting into 2 subnetworks) (remember that you cannot use the first or last as they refer to the network address and the broadcast address) 2 2 – 2 = 2 There are in fact 4 subnet address, but only 2 of them are usable BINARY to DECIMAL –00cannot use –0164 –10128 –11cannot use New Network address are and The Subnet Mask also changes –To do this you must add the binary value of two bits borrowed ( = 192) –The new Subnet Mask is IP Address Subnet Mask Range of HostsNo. of Hosts – –
9 IP ADDRESSING AND SUBNETTING Borrow 3 bits (subnetting into 4 subnetworks) 2 3 – 2 = 6 There are in fact 8 subnet address, but only 6 of them are usable BINARY to DECIMAL –000Cannot use –00132 –01064 –01196 – – – –111Cannot use New address , , , , , The Subnet Mask also changes –To do this you must add the binary value of two bits borrowed ( = 224) –The new Subnet Mask is
10 IP ADDRESSING AND SUBNETTING IP Address Subnet Mask Range of HostsNo. of Hosts – – –
11 SUBNET MASKS Why do you need a subnet mask? Hosts and routers use the ANDing process to determine if a destination host is on the same network or not. The ANDing operation happens any time a host wants to send a packet to another host on an IP network. The result of the 1st AND is to identify the network where the source host resides. It will then compare the destination IP address to its own subnet mask (2nd AND) to determine the network address of the destination host.
12 SUBNET MASKS Host x (Source) on network (Class C Network) has an IP address of and wants to send a packet to Host Z (Destination) on network and has an IP address of All hosts on each network are connected to hubs or switches and then to a router (Remember that with a class C network, ARIN assigns the first 3 octets (24 bits) as the network address, so these are two different networks. Source Net Dest. Net Subnet Mask Subnet Mask Host IP Host
13 SUBNET MASKS Host X compares it’s own IP address to its own subnet mask using the ANDing process Host X IP Subnet Mask ANDing result The result of the 3rd step gives the network address Next Host X compares the IP address of the Host Z dest. to its own subnet mask using the ANDing process Host Z IP Subnet Mask ANDing result The result of the 3rd step gives the network address
14 SUBNET MASKS Host X now knows that host Z is not in its Local Area Network (LAN) and it must send the packet to its “Default Gateway” which is the IP address of the router interface of on network The router will then repeat the ANDing process to determine which router interface to send the packet out. Host X Router Hub Host Z Source Net Dest Net Subnet Mask Host IP Host IP Router Interface IP Router Interface IP