One of the challenges of networks is how to signify who the recipients of packets are. This is called the addressing problem. In a single LAN, addressing is simple. Just number each computer and put that number into the packet as the address. Of course, a network administrator must keep track of who has what addresses so there is no confusion and so packets don't get lost or corrupted (altered) or received by two or more different computers.
There is also a security issue here because it might be possible to lie about your own computer's address and thereby snarf up others' packets, thereby eavesdropping on them. Ethernet technology has already thought of this, and each transceiver has an immutable ROM with a pre-assigned Ethernet address burned into it so they cannot be changed.
With today's complicated mesh of networks, addressing is a real problem. Each network has its own address, which is a number, and each host on that network has its own host number. This is the origin of the famous and abstruse IP addresses, which are the ways that networks and hosts address themselves in the world of TCP/IP. Below are some typical IP address.
138.92.4.254 192.67.231.180 10.0.0.8 138.92.0.1
These addresses are all 32 bits long but the bits are grouped into 4 8-bit chunks, called octets (the European word for "byte") Things are complicated because there are at least 3 different ways of breaking the octets into the network portion and the host portion.
Type A IP addresses use only the first octet for the network number and the other 3 for host numbers. Thus, there are can only be 126 network numbers because the first bit is used to designate that this is a type A address. Also, 00000000 and 01111111 are reserved for broadcast addresses so they are not assigned to specific networks. The old ARPANET used the number 10 for its network number.
Type B IP addresses assign the first two octets to the network portion, leaving the last two for the host. This increases the number of networks (to 2048 due to encoding schemes) but decreases the number of hosts on each network. However, it is unlikely that any single class B network would have the maximum number of hosts, which is about 65,534.
Type C assigns the first three octets to the network and the last octet to the host. The tradeoff is again, more network numbers but fewer hosts on each individual network.
Returning to type B again, most networks use the 3rd octet as the subnet number instead of a host number. Many medium sized institutions such as colleges have a number of LANs that are interconnected and all managed by the same governing body, so it makes sense to lump them together as one big network for the purposes and view of the outside world. Yet internally, they are WANs, with gateways between each of the component LANs. Thus, there can be 254 subnets, which is what these smaller component LANs are called, each having 254 hosts on it.
Numbers are just great for computers but they are very taxing on humans' memories. People want to use alphabetic names both for people's usernames on computers, as well as for hosts and even networks. For example, the fictitious name
joe@gandalf.net17.att.com
has all the necessary components, only in an alphabetic format. Joe is the name of the user, the recipient of email or "talk." gandalf is the name of the computer on which Joe has an account. (Many computer geeks who run networks were J.R.R. Tolkien fans in the early 1970s so they often use characters from "The Lord of the Rings" and "The Hobbit." Gandalf was the chief wizard of this series of books.) Net17 is the name of the subnet while att.com is the name of the overall network.
Ironically, the numerical IP address begins with the network number, followed by subnet followed by host. Thus, it proceeds from the most general to the specific, whereas the alphabetic form of addresses usually go from the most specific to the most general in a backwards fashion.
There must be a way to translate from alphabetic addresses to numerical numbers, so that people can express recipients of email and remote hosts by easily remembered names, while the underlying protocols can continue to rely on the more economical numerical "names." For a while, each host had a file that was essentially a translation table, matching alphabetic names of hosts with their IP numerical equivalents. After the number of hosts began to climb into the thousands, this got ridiculous.
Nowadays, special software and protocols exist to translate alphabetic names dynamically upon request, calling upon distributed database servers for translation. This is called the DNS or Domain Naming System. When somebody says that they want to remotely log in gandalf.net17.att.com, their host computer first consults its own private cache of recently translated names in case that particular name was looked up recently. If not, it consults another computer, using a protocol, which acts as the root server for all com addresses. This computer directs the translation request to a machine that translates just att addresses, and then this one looks up gandalf in net17 and sends the IP address for that machine back to the original recipient.