Networking can be complicated; the bigger the job, the more tiny puzzle pieces you have to figure out how to put together. At the most basic level, however, many of the networking concepts that seem most complicated are actually rather simple … barring their implementation, of course. Here's an overview of some of these key concepts.
IP addresses are like the physical address for your house or your phone number: They provide a way to map a physical device to a number, whether it’s a PC, a router or a mobile device. IP Version 4 (IPv4) is still the most common form of IP address, although IP Version 6 (IPv6) is starting to emerge as IPv4 addresses are exhausted. (Learn more about the two versions in The Trouble With IPV6.)
IP addresses are typically written out in dotted decimal form, with four "octets" separated by dots. It’s actually a representation of the 32 bits in IPv4 addresses, with each octet making up eight bits. Although the highest number in an eight-bit byte is 256, 0 is reserved, so the range of each octet is really one to 255.
IP Version 6 addresses, on the other hand are 128 bits long and are written in hexadecimal. They’re only starting to come into use as IPv4 has been exhausted.
Historically, IP addresses were divided into classes, which were determined by the initial numbers in the address. Class A has a range of one to 126, Class B from 128–191, and Class C ranging from 192–223. The number of networks these addresses can host varies, with Class A having a maximum of 126 hosts with 16,777,216 hosts per network. These addresses also differ on how much of the address is reserved for the network and how much of it is available for the host. For example, a Class A address reserves the first octet while leaving the rest available for the host, while a Class C address uses three octets. It’s possible for network administrators to subdivide networks even further, which leads to subnetting.
Subnetting is a way of dividing up IP addresses in an attempt to use them efficiently. This is done by means of a subnet mask. As previously mentioned, traditional IP addresses reserve part of the address for the network and leave the rest for the host. This is known as a subnet mask, which can also be represented in dotted decimal form. For example, the default subnet mask for a Class A address would be 255.0.0.0, while a Class C address would be 255.255.255.0.
Another way to represent them is using Classless Inter-Domain Routing (CIDR). CIDR simply appends the subnet mask to the IP address. In her book "Essential System Administration," author Aeleen Frisch uses the example of the 192.168.10.0. This class C address would be written with its subnet mask as 192.168.10.0/24, because the first three octets add up to 24 bits. There are plenty of good networking books that can go into greater detail. There are also calculators that can help you determine the best subnetting scheme that makes sense for your network.
Subnetting reserves some addresses available for hosts and designates them as small networks, hence the term "subnet." While there are fewer hosts available, it can be easier for administrators to manage than having one large network. (Learn more about this topic in 8 Steps to Understanding IP Subnetting.)
So, you have addresses for your networks squared away, but how do you get packets from point A to point B? Routing, of course. While it might sound complicated, it’s actually quite simple. Despite the complexity of the internet, sending packets across the hall or across the world is easy and reliable.
Most TCP/IP networks are configured to have a gateway, which is either a specific piece of networking equipment or a computer with two or more connections between different networks. This is what the term "router" means. The connection of different networks is also the true meaning of the term "internet."
The robustness of the internet is due to its simplicity. Each router only knows about the networks it’s connected to, but you can send packets to hosts across the hall or around the world. If a router gets a packet, it simply forwards it on to the next network until it gets to its destination. You can see this process in detail using a tool known as a traceroute, although it's known by different names on different systems.
Each packet is set with a time to live (TTL), the maximum number of "hops" across different networks it can make. Each hop reduces the TTL. If it gets to zero, the packet is simply dropped. This is usually the result of some misconfiguration along the line, such as a network sending packets in circles. This is rare, and it’s amazing how reliable the internet is.
Addresses are fine, but you can’t really memorize them. The Domain Name System (DNS) is what creates those web addresses that we are most familiar with. It's DNS that maps IP addresses to names.
The Internet Corporation for Assigned Names and Numbers (ICANN) maintains a list of top-level domains, such as .com and .org. There are more than 250 global TLDs, as seen on ICANN’s microsite.
Each machine has a host name file somewhere that maps names to addresses, but this gets unwieldy even with more than a few machines. Just try to imagine millions of machines around the world. DNS is a decentralized system, which makes this process much easier.
The key to DNS’s success is its ability to perform recursive lookups. If a DNS server gets a request for a name it doesn’t know, it will ask another server, which will ask another server and so on until it gets an answer. DNS servers typically cache their names to make this faster.
Despite its simplicity in operation, DNS can be challenging to set up, and the process includes more detail than can be covered in this article. Fortunately, there are plenty of guides that can outline this sometimes daunting process. A good one is Craig Hunt's "TCP/IP Network Administration." (Learn more in DNS: One Internet Protocol to Rule Them All.)
On to Further Research
This article should help clarify some issues that appear complicated when first studying TCP/IP networks. Of course, each one of these sections could easily qualify for an article of its own. Now that you've gotten this far, it's time for further study. Good luck!