![]() |
In computer networks, an IP address is a unique address that identifies a device on the internet or a local network. Using IP address we can find information about the Class of IP address and number of computers connected in that network (range of IP address in that network), network IP address, broadcast address. Steps to find the number of computers connected in the given IP address1) Identify the class of the IP addressTo find the number of computers connected in the network first we need to identify the class of the IP address, there are 5 classes of IP addresses they are A, B, C, D, E.
Example: If the IP address given is 64.19.23.0 then the first octet is 64 which is in the range of 0 to 127, so the given IP address belongs to class A. 2) Finding network IP addressTo find the network IP address we need default mask value, Default mask value is different for each class, the default mask value for each class is given in the table below
After finding the default mask value, perform AND operation with the given IP address to get the network IP address. Example: If the given IP address is 64.0.0.8 convert this into the binary format by replacing each octet with respective binary values, then the Binary format of the given IP address will be 01000000.00000000.00000000.00001000. Now take the default mask value to which the IP address belongs (from the above table), convert that default mask value into its binary format, the default mask of class A is 255.0.0.0 converting to binary format will be 01000000.00000000.00000000. 00001000 Convert the resulting answer to decimal format to get the network IP address. The network IP address of the given IP address 64.0.0.8 is 64.0.0.0 3) Finding the number of hosts or number of computers connected to that networkThe class it belongs will tell the range of hosts that can connect to that network, it’s given in the below table.
[Note: Class D is reserved for Multicasting, group email/ broadcast, possible IP address in class D are 228 Class E is reserved for experimental and research / military purposes, possible IP addresses in class E is 228] In simple words, the Number of hosts in any network can be calculated with the formula = 2x– 2, where x is the number of host ID bits in the IP address. Why do we subtract 2? Because the first and last addresses are not used for any hosts because the first IP is used to represent the whole network ID while the last IP is used as the broadcast address. Example: The given IP address is 192.168.254.1 it belongs to class C, when we perform AND operation on IP address with a default mask of class C, we get the network IP address as 192.168.254.0 this is the IP address used to represent the whole network and the broadcast address will be the last IP address of this network which is 192.168.254.255 4) Broadcast addressBroadcast addresses are of 2 types limited broadcast and direct broadcast
Example 1: Find the Class, network IP address, number of hosts (computers), and broadcast address of 9.1.5.31Answer: Finding the Class to which the given IP address belongs to Perform the AND operation to get the network IP address The network IP address of the given IP address is 9.0.0.0
Example 2: Find the Class, network IP address, number of hosts (computers), and broadcast address of 201.20.30.40Answer: Finding the Class to which the given IP address belongs to Perform the AND operation to get the network IP address The network IP address of the given IP address is 201.20.30.0 |
Reffered: https://www.geeksforgeeks.org
Computer Networks |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |