Net Gains: A Linux Networking Overview - page 3
Introducing Our Networking Series
This article is running a bit long but we can't close without providing at least some usable information. While TCP/IP is probably familiar to most readers, those new to networking need to understand it. IPX is another network protocol that will be used in the Netware article, but it will be addressed in that article alone.
The IP protocol has a number of aspects, but the most important for our purposes is the IP address. Each IP packet includes a source and destination IP address. Each address is four bytes or octets, where a byte is 8 bits. Each octet represents a number from 0 to 255. An IP address is normally written using the following format: 18.104.22.168. A new version of the IP protocol, called IPv6, doubles the size of the address but keeps the same format so each item is sixteen bits instead of eight. A discussion of IPv6 is beyond the scope of this series and most users will not have to deal with IPv6 for many years.
Another important part of the IP protocol is the network mask or net mask. It specifies the number of high order bits not used for address resolution. The mask can be specified by the number of bits or using what appears to be an IP address. For example, 22.214.171.124/24 and 255.255.255.0 each specify a 24-bit mask. That leaves 8 bits for 255 unique addresses. This group of addresses is called a subnet. Computers on the same subnet can communicate directly with each other. Access to other computers must be done through a router, also called a gateway. The router must have an IP address on the subnet.
Netmasks can have an arbitrary number of bits, but standard blocks exist. A class A block has an 8-bit netmask. Class B and C blocks have 16- and 24-bits, respectively.
IP addresses may appear to be arbitrary, but they are allocated by a central agency. Certain blocks are reserved for internal use though and most local networks will utilize one of these. The 10.0.0.0/8 block is the largest. The 192.168.0.0/16 is smaller but more common. A smaller block like 10.10.10.0/24 can be used on a local network.
A computer can have one or more IP addresses per network adapter. IP addresses can be fixed or dynamically assigned. Fixed definitions are easiest, but each computer must have a unique IP address. For example, a three-computer network commonly uses the following IP addresses: 192.168.0.1, 192.168.0.2, and 192.168.0.3.
Assigning IP addresses can get tedious, especially as the size of the network grows. In such cases, a DHCP server is used to assign IP addresses when a computer starts up. Linux can run a DHCP service. A DHCP server is also handy when other computers occasionally plug into your network, such as laptops from work.
IP addresses are easy to remember for a very small network, but become unwieldy as the number of IP addresses grows. This is where a DNS server comes into play. A DNS server converts DNS domain names to IP addresses or vice versa. A local network can have its own DNS server, and Linux distributions come with the most famous version, called "bind." A small network connected to the Internet will typically use an ISP's DNS server instead of having one locally, since most named accesses will be to sites on the Internet.
So much for Networking 101. There are definitely a number of topics not addressed, such as details about TCP and UCP messaging or DNS operation, as this tends to get technical very quickly. Something like DNS can fill a book--a fact I can attest to, having worked on a DNS book for many months now.
Don't expect to be a networking wizard when you get through this series, but you should be able to configure Linux to handle networking chores while getting a basic understanding of IP along the way.