IPv4 Addresses :
An IPv4 address is a 32-bit number assigned to a computer on a TCP/IP network. Some of the bits in the address represent the network segment; the other bits represent the computer, or node, itself. For readability, the 32-bit IPv4 address is usually separated by dots into four 8-bit octets, and each octet is converted to a single decimal value. Each decimal number can range from 0 to 255, but the ﬁrst number cannot be 0. In addition, all four numbers in a host address cannot be 0 (0.0.0.0) or 255 (255.255.255.255).
Systems on a network are typically assigned a host name, in addition to the numeric address. The host name is the descriptive name you see assigned to computers on the Internet, but systems on local networks have them as well. On the Internet, these host names appear to the left of the domain name. Host names can be up to 63 characters long.
Binary and Dotted Decimal Notation
TCP/IP uses binary numbering. Binary is a base 2 numbering system in which any bit in the number is either a zero or one. An IP address might appear in binary as 11001011.01111011.00101101.00010010. Although the underlying IPv4 addresses are binary numbers, for readability, TCP/IP addresses are usually displayed in dotted decimal notation. Dotted decimal notation consists of four decimal numbers separated by three dots. Each decimal number is called an octet because it represents eight binary bits. When pronouncing a dotted decimal number, include the separator dots. For example, the IPv4 address 192.168.1.18 is pronounced “one ninety-two dot one sixty-eight dot one dot eighteen.”
A subnet mask is a 32-bit number that is assigned to each system to divide the 32-bit binary IP address into network and node portions. This makes TCP/IP routable. A subnet mask uses a binary operation to remove the node ID from the IP address, leaving just the network portion. Subnet masks use the value of eight 1s in binary, or 255 in decimal, to mask an entire octet of the IP address.
The Default Gateway
When TCP/IP communications need to be routed to systems on other networks, the protocol directs the packets to a special address known as the default gateway. The default gateway address is typically that of a network router that connects the local network to other external networks. A default gateway address is not a required component of a TCP/IP address assignment, but without a default gateway, the computer will only be able to communicate on the local network segment.
The binary logical operation applied to the subnet mask and the IP address is called binary ANDing. There are two rules in the binary AND operation:
- Zero AND any value equals zero.
- One AND one equals one.
To apply a subnet mask, you convert both the IP address and the subnet mask to binary. You AND each digit of the two binary numbers together. The zeros in the subnet mask convert all the bits in the node portion of the IP address to zeros, leaving the network portion of the address intact.
IP Address Classes
The designers of the TCP/IP suite deﬁned ﬁve ranges of addresses, called address classes, for speciﬁc network uses and sizes. Changes in the Internet since the early 90s have rendered classful addresses all but obsolete. One of the ﬁnal remnants of classful addressing is the use of the terms “Class A,” “Class B,” and “Class C” to describe common subnet masks.
Class and Subnet Mask
Class A 255.0.0.0
Class A subnet masks provide a small number of network addresses for networks with a large number of nodes per network.
- Number of nodes per network: 16,777,214
- Network ID portion: First octet
- Node ID portion: Last three octets
Used only by extremely large networks, Class A addresses are far too big for most companies. Large telephone companies and ISPs leased most Class A network addresses early in the development of the Internet.
Class B 255.255.0.0
Class B subnet masks offer a larger number of network addresses, each with fewer nodes per network.
- Number of nodes per network: 65,534
- Network ID portion: First two octets
- Node ID portion: Last two octets
Most companies leased Class B addresses for use on Internet-connected networks. In the beginning, there were plenty of Class B addresses to go around, but soon they were depleted.
Class C 255.255.255.0
Class C subnet masks offer a large number of network addresses for net works with a small number of nodes per network.
- Number of nodes per network: 254
- Network ID portion: First three octets
- Node ID portion: Last octet
Because there can be more Class C networks than any other type, they are the only addresses still generally available.
Because the traditional IP address classes have limitations on the number of available addresses in each class, there are now various implementations that utilize classless addressing. In these schemes, there is no strict dividing line between groups of addresses, and the network address/node address division is determined entirely by the number of 1 bits in the subnet mask.