Assume that you have four hosts in an Ethernet segment These
Solution
IP address was an address used in order to uniquely identify a device on an IP network. The address is made up of 32 binary bits, which can be divisible into a network portion and also the host portion with the use help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). For this reason only, an IP address is said to be expressed in dotted decimal format (for example, 145.122.146.25). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary.
Here was how binary octets converted to decimal: The right most bit, or least significant bit, of an octet holds a value of 20. The bit just to the left of that holds a value of 21. This continues until the left most bit, or most significant bit, which holds the value of 27. So if all binary bits are a one, the decimal equivalent would be 255 as shown here:
Here was a sample octet conversion when not all of the bits are set to 1.
here the given ip address is 145.122.146.25
this ip address is in host1.first we find the subnet mask as the 122 is convert in binary 11110100
122=11110100
now find the subnet mask as the using formula
128 64 32 16 8 4 2 1
1 1 1 1 0 1 0 0
128+64+32+16+0+4+0+0=244
find to the all adresses
145 binary is 10010001
128+0+0+16+0+0+0+1=145
146 binary is 10010010
128+0+0+16+0+0+2+0=146
25 binary is 11001
128+64+0+0+8+0+0+0=200
the given ip address is 145.122.146.25
the subnet mask is 145.244.146.200
