All about IP

Here are some excellent tutorials about how the Internet Protocol works:

Temp stuff

Example: -> netmask = Note: 240 in base 10 = 1111.0000 in base 2 To extract the network # 1. Find which byte has some of its bits used to specify the network # (4th here) 2. Express the value of this byte in base 2 (19 is 0001.0011 in base 2) 3. Extract network part, and convert to base 10 (the first four bits = 0001.xxxx -> 16 in base 10) => Network # is To find the range of hosts available for a given network The first host is the network # + 1 (here, 16 + 1 = .17) The last host is (256 - 2) - bitmask, and add to network # (256 - 2 = 254; 254 - 240 = 14 ; 16 + 14 = .30) => Hosts range from through The reason for substracting 2 addresses is to remove the first and last addresses (network and broadcast, respectively) To find the broadcast address Any full "host byte" uses 255 for broadcast (there's none in our example; here, only one byte is left to represent hosts.) The only issue left is to compute the value of the byte whose left part represents the network #, and its right part the host range. For this, extract the "host" part from this important byte, set all bits to 1, compute the value in base 10 of the entire byte (ie. including the network part). => Broadcast address is (network part = 16, host part = 15, 16 + 15 = 31) To create sub-nets of different sizes Assume your corporate top admin grants your site the private IP network address Instead of building a single network, you would like to split hosts into several sub-nets, but not of the same size. Books on TCP/IP usually only present the simple case where only one netmask is used, and each sub-net ends up having the same maximum number of possible hosts. For instance, suppose you want to split your private "class C" into 4 sub-networks: If it's OK with you and your users that each sub-net has the same size, just use a sub-net mask of, with networks being,,, and But, what if your local configuration is such that some sub-nets will only contain a few hosts, while others will have significantly more? In this case, you'll have to use different sub-net masks, starting with the smalled network to check how many bits you can steal to build your sub-nets. Let's go back to the example of Suppose two sub-networks (A and B) will never more than 11 hosts, a third sub-network (C) will need up to 55, while the last and fourth sub-net (D) needs 125. 2^3 = 8, and 2^4 = 16. Since sub-nets A and B will never have more than 9 hosts, the closest and adequate mask is 16, ie. since we use the 4 left-most bits of the our class C to build those two sub-nets. The netmask for sub-net B is /192, since no more than 55 hosts will belong to that network. Finally, the netmask for sub-net A is /128. Host ranges are: - Subnet A -> (broadcast = .15) - Subnet B -> (broadcast = .31) - Subnet C -> (broadcast = .126) - Subnet D -> (broadcast = .255)