40 likes | 55 Views
Learn how to calculate and determine IP subnetting and masking for network addressing. Discover how IP addresses can be identified as local or remote within a subnet.
E N D
The network mask is represented as a 32 bit string. The network portion of the IP address is represented as a string of ones starting at the highest order bit position. The host portion of the mask is represented by a string of zeros starting at the lowest order bit. Ex: 255:255:255:0 Binary 11111111 11111111 11111111 00000000 Since there are 24 1’s in this mask this is known as a 24 bit mask. An IP subnet is specified by the address of the network portion of the subnet and the host portion as zeros. The length of the mask is appended, after a ‘/’ character, to the subnet address. Ex: 144.167.26.0/24 Binary: 10010000 10100111 00011010 00000000 Mask: 11111111 11111111 11111111 00000000 ---------Network -------------------- ^---Host---
Example addresses: Subnet: 144.167.26.0/24 IP: 144.167.26.26 Binary 10010000 10100111 00011010 00011010 Mask: 11111111 11111111 11111111 00000000 IP&MASK 10010000 10100111 00011010 00000000 IP: 144.167.26.55 Binary 1001000 10100111 00011010 00110111 IP&MASK 1001000 10100111 00011010 00000000 Since the IP&MASK calculations are identical, these two addresses are on the same subnet (local), If the target IP was not in the host’s ARP table the host would generate an ARP request for the target IP and then send an ethernet packet directly to the destination.
Example addresses: Subnet: 144.167.26.0/24 IP: 144.167.26.26 Binary 10010000 10100111 00011010 00011010 Mask: 11111111 11111111 11111111 00000000 IP&MASK 10010000 10100111 00011010 00000000 IP: 144.167.27.26 Binary: 10010000 10100111 00011011 00011010 IP&MASK 10010000 10100111 00011011 00000000 Since the IP&MASK outcomes for these two addresses are not equal, they are not on the same subnet. (remote) In this case the IP configuration would be examined for the address of the default gateway. The packet would be sent to the default gateway for routing. If the default gateway’s IP address was not in the ARP table of the host, and ARP would be issued first then the MAC address of the default gateway would be used to forward the packet to the router.
Addresses not on byte boundries may be more difficult to determine by examination, but the technique is the same: Subnet: 144.167.16.0/23 Binary: 10010000 10100111 00010000 00000000 Mask: 11111111 11111111 11111110 00000000 -----Network------------------------^----Host---- Ex:IP: 144.167.17.16 Binary 10010000 10100111 00010001 00010000 Notice the the 9th bit, which has changed between the subnet address and the Target IP, is in the host portion of the address and is thus local to the subnet. ExIP: 144.167.18.16 Binary 10010000 10100111 00010010 00010000 This time the 10th bit has changed and this is in the network portion of the address so this target address is not local to the subnet.