When using the Internet, humans use names such as www.google.com or www.ebay.com, or ftp.myhostingprovider.com We call those"addresses" or in the case of websites, "URLs" but those are really just names provided for human convenience. The Internet uses its own set of unique addresses because computers run the Internet and computers use numbers. There is a system for finding which who owns the name (Domain Name registries), and another system for figuring out which unique numeric address goes with the name (Domain Name Service).
Computers do their work over the Internet and across networks using numeric addresses. Your computer is configured with an IP address and the computer you wish to communicate with (the computer-server that is serving www.google.com for instance) also has an IP address. To communicate, a connection is opened from one computer to the other computer using the IP addresses as the source and destination addresses for that communication.
Your computer gets an address one of two ways, either your network administrator enters it into your computer manually, or it is learned by the computer dynamically using a protocol called DHCP. When the IP address is assigned by the network administrator manually, this is called a ´fixed´ or ´static´ IP address. If an IP address is learned by your computer automatically when the computer starts up via DHCP, it's called a ´dynamic´ IP. If the computer has an address stored in its configuration, it is called a 'static' address.
IP Address Format
An IP address is a number used to identify the logical connection of a computer to a physical network is a 32-bit binary address, composed of four, 8-bit numbers. IP address are represented as four decimal numbers between 0 and 255 separated by dots; (eg. 220.127.116.11). This is referred to as dotted-decimal notation. Anything attatched to an IP network can be assigned an IP address. Note that this means that it is possible for a single host to have multiple IP addresses if it is running multiple network interfaces to support services such as DNS, Web or Mail server software. Addresses are always unique. Because IP addresses are software configured, it is easy to move hosts from one network to another simply by changing the IP address or the network mask. This process is called renumbering.
Network and Host Portion of an IP Address
When looking at an IP address, the left-most portion of the address identifies which network the mahcine (host) belongs to. The right-most portion is used as the address of the host itself. A large number of addresses in use (but not all of them) look something like this:
In the example above, the network address is 199.232.66 and the host portion of the address is 20, the complete IP address is 18.104.22.168. All the computers on the same local network would have the same network number in their address. Thus, two computers on the same network might be 22.214.171.124 and 126.96.36.199.
When two hosts with IP addresses communicate, they send IP datagrams. IP datagrams contain the source and destination addresses of the hosts communicating. Only the addresses are recorded in the packet. There is no information stored in the packet to tell us which part of the address is network and which is host. If this is true, then how would we figure out which part of the address is the network portion, and which is the host portion?
First, you must remember that all hosts on the same network will have the same network address (the network portion of the IP address will be the same for all hosts). Only the host portion will be different and unique for each host on the network.
Different networks also have different network addresses. Network A would have a different address from Network B. From the perspective of determining the correct network, the individual host address is irrelevant. We will need it later to find the host itself ON the network, but we don't need to look at it yet, since we need to find the correct network first.
To find a particular host, you first find the network that host is on, then ask that network to find the host host. There are two solutions to handling this network vs. host address problem, and they are similar but separate addressing types: classful, and classless.
Classful Addressing was the first addressing scheme developed. It helped manage the IP space and make organization of networks and hosts possible, but it could not support the growing complexity of the Internet, and wasted a lot of address space, so an new scheme was developed called Classless Addressing. Classless Addressing was more efficient by allowing the assignment of smaller blocks of addresses.
The Subnet Mask
The Subnet Mask is a value that is stored in the configuration of a computer along with the IP address. The Subnet Mask gives the computer a simple way to figure out whether the IP address of another computer is on the same local network, or on a different local network. Bear in mind that for this definition of a mask, a 'local network' is defined as a group of computers with IP addresses in a limited range.