IP – Network Layer
Internet Protocol is the end to end addressing system used on the Internet with the Domain name system to identify unique hosts.
Host and Net
An IP address is made up of two parts a host and a network. The host identifies the individual computer while the network provide routing information. An example would be :
- 192.168.0.1 with a subnet mask of 192.168.0.255
This address has a total of 255 total addresses
- The network is 192.168.0
- The Host is 1
Subnet masks are used to divide up sections of IP addresses into smaller logical elements. It is used by CIDR to handle routing. It splits the host portion into a smaller unit. Since all IP addresses are represented by binary numbers it takes additional space. This type of subnetting is identified with a slash notation.
|Dotted Decimal Format||Binary||Slash Format||Available Addresses|
|255.255.255.0||11111111 11111111 11111111 00000000||/24||256|
|255.255.255.128||11111111 11111111 11111111 10000000||/25||128|
|255.255.255.192||11111111 11111111 11111111 11000000||/26||64|
|255.255.255.224||11111111 11111111 11111111 11100000||/27||32|
|255.255.255.240||11111111 11111111 11111111 11110000||/28||16|
|255.255.255.248||11111111 11111111 11111111 11111000||/29||8|
|255.255.255.252||11111111 11111111 11111111 11111100||/30||4|
|255.255.252.0||11111111 11111111 11111100 00000000||/22||1024|
Slash notation represents where the netmask ends and the host mask beings based in location in binary.
Calculating NetMask IP Ranges
The easiest way to calulate netmask ranges is using the binary notation. If the netmask is 255.255.255.224 this is represented in binary by : 11111111 11111111 11111111 11100000 if you examine the last set of numbers and using binary notation you find that you have 32 addresses available. 1*128 + 1*64 + 1*32 + 0*16 + 0*8 + 0*4 + 0*2 + 0*1 = 224 256 – 224 = 32.
This becomes a lot more complicated when using higher level notation. For example 255.255.252.0 or /22 subnet is : 11111100 00000000 we have to break each section up seperatly. 11111100 = 252 and 00000000 = 0 then we subtract those numbers from 256 – 11111111 – 11111100 = 4 and 11111111 – 00000000 = 256 and we multiply those numbers 4 * 256 = 1024.
Gateway and Broadcast
One overhead of subnetting is the gateway and broadcast address. You subnet is really only routable by one address called the gateway. This address provides access to all your other ip addresses. You cannot assign this address to a device. Normally the first address in your range is the gateway. Also you are required to have a broadcast address that sends messages to all devices in your subnet this is normally the last address.
Private IP Addresses
Some groups of IP addresses are reserved for home or private networks these addresses are not routable on the Internet.
|Starting IP||Ending IP||Number of Addresses|
Machines using private ip addresses are able to access the Internet using Network Address Translation (NAT).
The address 127.0.0.1 refers to you local machines network interface. This address can be used to test the hardware on your network interface using ping. It is not routable outside your machine.