Protocols IP Addressing Subnetting Supernetting 2 IP addresses These are unique addresses. No two machines can have same IP addresses. IP address consists of 32 bits, and divided into 4 octets of 8 bits each (e.g. 10.14.1.12) Identifies connection of an host to a network. 3 Classes of IP addresses 4 Finding the class of IP address 5 IP addresses in decimal notations 6 Range of IP address classes 7 Number of hosts & networks The number of hosts and networks that can be configured for each class can be calculated as, 8 Number of hosts for class A network 9 Number of hosts for class B network 10 Number of hosts for class C network 11 Class A, B and C network addresses 12 Two level Hierarchy of a network Only one network (141.14.0.0) No subnetwork for two level hierarchy May get complicated if number of hosts are more Two level hierarchy of a network 13 Subnetwork (or subnet) Why subnet ? Ease of identifying the host Easier to number the host Easier to add/ delete new hosts without affecting the numbering of other hosts To optimize network performance Router table entries can be minimized What is subnetting ? A bigger network is divided into various smaller networks for internal use within an organization, while for external world it is treated as a single network. 14 Subnetwork (or subnet) Three-level Hierarchy 15 Addresses with and without subnetting Bits from host part need to be borrowed to identify the subnet 16 Subnet mask Subnet mask is required to get subnet address (from IP address) IP address ANDed (bit wise) with subnet mask gives the subnet address 17 Default subnet masks Class In Binary In Dotted- Decimal Using Slash A 11111111 00000000 00000000 00000000 11111111 11111111 00000000 00000000 11111111 111111111 11111111 00000000 255.0.0.0 /8 B 255.255.0.0 /16 C 255.255.255.0 /24 18 illustration to calculate subnet mask If 3-bits are borrowed from host for a class B network, the Subnet mask will be 255.255.224.0 No. of subnets = 2 3 -2 = 6 No. of hosts per subnet = 2 13 -2 = 8190 19 Example Example 1 Example 1 Change the following IP addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111 b. 11111001 10011011 11111011 00001111 Solution Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation: a. 129.11.11.239 b. 249.155.251.15 20 Example Example 2 Example 2 Find the class of each address: a. 0 00000001 00001011 00001011 11101111 b. 1111 11110011 10011011 11111011 00001111 Solution Solution See the procedure in Figure 19.11. a. The first bit is 0; this is a class A address. b. The first 4 bits are 1s; this is a class E address. 21 Example Example 3 Example 3 Given the host address 132.6.17.85, find the corresponding network address. Solution Solution This is class B network. The first 2 bytes defines the net-id. We can find the network address by replacing the host-id bytes (17.85) with 0s. Therefore, the network address is 132.6.0.0. 22 Example Example 4 Example 4 Network address of a class-C network is 192.168.5.0. Calculate subnet addresses if there are 5 subnets and 30 hosts per subnet. Solution Solution Network IP address: 192.168.5.0000 0000 For creating 5 subnets, 3-bits must be borrowed from host-id Hence, No. of subnets = 2 3 -2 = 6 No. of hosts per subnet = 2 5 -2 = 30 23 Example (continued.) Subnet addresses would be: (224).. Subnet mask 255.255.255. 1110 0000 (192).. Subnet-6 255.255.255. 1100 0000 (160).. Subnet-5 255.255.255. 1010 0000 (128).. Subnet-4 255.255.255. 1000 0000 (96).. Subnet-3 255.255.255. 0110 0000 (64).. Subnet-2 255.255.255. 0100 0000 (32).. Subnet-1 255.255.255. 0010 0000 (0).. invalid 255.255.255. 0000 0000 24 Example (continued.) Subnet No. 1 2 3 4 5 6 Subnet Address 192.168. 5.32 192.168. 5.64 192.168. 5.96 192.168. 5.128 192.168. 5.160 192.168. 5.192 IP of the First host 5.33 5.65 5.97 5.129 5.161 5.193 IP of the Last host 5.62 5.94 5.126 5.158 5.190 5.222 Broadcast address 5.63 5.95 5.127 5.159 5.191 5.223 25 Example Example 5 Example 5 Host in a particular network has IP address of 172.16.10.65 and the subnet mask is 255.255.255.192 Find the subnet address and the broadcast address corresponding to the above mentioned host. 26 Example Example 6 Example 6 Host in a particular network has IP address of 10.10.10.5 and the subnet mask is 255.255.255.252 Find the subnet address and the broadcast address corresponding to the above mentioned host. 27 Example Example 7 Example 7 Network address of a class-B network is 172.16.0.0 and the subnet mask is 255.255.240.0 Calculate subnet addresses, IP addresses of the first and the last host and broadcast addresses for each subnet