Understanding and Configuring DNS Settings

Assuming that you do plan to use your home network to share an Internet connection, one addition piece of information that you’ll need to supply as part of the TCP/IP configuration of computers is the IP address of one or more DNS servers. DNS is the domain name system, which is responsible for translating fully qualified domain names (FQDNs) into IP addresses on the public Internet. For example, when you attempt to access the PC Answers website, you would typically submit the FQDN www.pcanswers.co.uk in the address bar of your web browser. While this name is easier to remember than the IP address of the PC Answers website, TCP/IP ultimately requires the IP address of the site in order to make communication possible. The “resolution” of FQDNs to IP addresses on the public Internet is the primary responsibility of DNS servers.

The IP address that you would enter in the DNS server address section of your TCP/IP properties typically belongs to a DNS server of your ISP. This information is usually provided by the ISP when sign up for their service. This is not to say that it is impossible to host your own DNS server on your network, because it is indeed possible. However, most home network users really have no need for an internal DNS server, a topic that we’ll explore further in future articles in this series.

One thing that you’ll notice with the configuration of DNS settings is that Windows versions allow you to configure the IP addresses of both a “preferred” and “alternate” DNS server (the terms used differ between Windows versions). The main reason for this is redundancy. If your computer attempts to contact one DNS server to resolve a name to an IP address and the server is unavailable, the second DNS server will be sent the queries. One DNS server IP address is usually sufficient, but if this server becomes unavailable, you would no longer be able to resolve names correctly, so configuring both is a good idea. Unless, of course, you want to try to remember the IP address associated with every website you ever visit – certainly not a simple task.

Understanding the Purpose of the Default Gateway

When configuring TCP/IP settings on your home network, only an IP address and subnet mask are explicitly required. However, if you want your computers to be able to communicate with outside networks (like the Internet), you will also need to configure a default gateway IP address. The default gateway is the IP address to which packets destined for outside networks are sent by default. To be clearer, the default gateway is the IP address of a router connected to the local network. For home users, this would be the internal IP address of your hardware router, or of the computer configured as a NAT server (such as a Windows XP system running ICS). Just remember that if you need to communicate with an outside network like the Internet, you will need to configure a default gateway IP address as well.

Understanding the Purpose of Subnet Masks

Subnet masks are easily one of the most confusing elements in the configuration of TCP/IP, although they need not be. In large, complex networks, subnet masks like 255.255.255.0 are used to segment IP addresses from one large network into many smaller ones. For example, a large corporate might be assigned a range of IP addresses by their ISP, and then want to internally divide their network into a number of smaller networks to improve overall performance. At the end of the day, subnet masks are used to help a host determine which portion of an IP address represents the network, and which part represents the host. While the class of an IP address does this, many companies create custom subnet masks that divide their networks beyond typical class boundaries. Based on the combination of an IP address and subnet mask, a host can determine whether a destination host is one the same network, or a different one.

The good news is that for a home network, you really don’t need to put much thought into the subnet mask to be used. Windows will automatically populate the subnet mask field in your TCP/IP configuration after you specify the IP address to be used. Effectively, the value generated is known as the “default” subnet mask based on the class of address you input. So, is you used the Class A IP address 10.1.1.1 for a host, the subnet mask 255.0.0.0 would be allocated automatically. In this case, the “255” means that the first octet of the IP address identifies the network, and the last three octets identify a host. Similarly, entering a Class C IP address of 192.168.1.1 would result in Windows automatically entering the subnet mask 255.255.255.0, in which case the first three octets of the IP address identify the network, and the last represents a host.

For best results, make sure that your PCs are configured with IP addresses in the same network range (such as all starting with 192.168.1), and then let Windows specify the subnet mask automatically. If incorrect subnet masks values are configured, computers on the same network may not be able to communicate.

Private IP Addresses

In the same way that you can’t just randomly choose the numbers to use for an IP address, you also need to be careful with the addresses you ultimately use. IP addresses used on the public Internet are assigned to companies from organizations like RIPE (the European IP address registry), or from an ISP. Although using a range assigned to a company might work on your home network, it can also impact your ability to connect to certain Internet resources. It’s for that reason that “private” IP addresses exist.

Private IP addresses were designated as a solution to the public Internet quickly running out of available addresses. As the Internet has grown, the number of available unique IP addresses has quickly dwindled. In order to satisfy the need for more IP addresses, certain ranges were designated as private, or available for anyone (including home or business networks) to use. These addresses are not valid on the public Internet, so they do not impact TCP/IP communication outside of a network. For example, you could be using the same private IP addresses on your network as your neighbor is, and the whole Internet would still function in peace and harmony.

This begs the question – if private IP addresses aren’t valid on the Internet, how can the computers on your home network access Internet resources? The answer is found in something called Network Address Translation (NAT). When a computer using a private IP address wants to access the Internet, that private address must be “translated” to a public address that is valid on the Internet. On your home network, one system (such as a dedicated router or one of your PCs) will still need at least one public address that will be shared amongst your internal computers. On systems like Windows 98 or XP, this functionality is provided by a service known as Internet Connection Sharing, or ICS. More on ICS and other NAT techniques will follow later in the series.

For now, the most important thing for you to remember is that you should always use private IP addresses on your internal network. These are first and foremost more secure, and will help you to avoid problems later. The private IP address ranges available to anyone who wants to use them are:

10.0.0.1 to 10.255.255.254
172.16.0.1 to 172.31.255.254
192.168.0.1 to 192.168.255.254

In general, most home users tend to stick with addresses that start with 192.168, and you should as well to keep things simple. For example, if you start all of your IP addresses with 192.168.1.X, you can support up to 254 IP addresses on your home network, which should be more than you would ever need.

Understanding IP Addresses

At the root of any network running TCP/IP is a unique identifier known as an IP address. In the same way that your home is identified by a street name (more general) and numeric address (more specific), a computer on a TCP/IP network is identified by an IP address like 192.168.1.100. Similar to your home address, part of an IP address identifies a particular network, and another part represents a unique computer (referred to as a host in TCP/IP jargon) on that network.

Because of the way in which hosts running TCP/IP identify and communicate with one another,
you cannot just blindly pick numbers to assign as IP addresses. In order for two computers on the same network to communicate, they must be assigned addresses that begin with the same network number, and then the host portion of each address must be unique. For example, if you were to give one computer an IP address of 10.10.10.10 and another on the same network an IP address of 11.11.11.11, the two could never communicate – from their internal calculations, the two hosts would “see” each other as being on different networks, and would not attempt to communicate directly.

Distinguishing network numbers isn’t quite as easy as starting IP addresses with a common number like “192”. IP addresses are divided into what are known as “classes”, and the first number in an IP address is used to determine how much of the IP address is the network portion, and how much is the host portion. For example, when an IP address starts with the number 10, only the first section (known as an octet) represents the network, and the last three octets are used to identify a host. However, when an IP address starts with the number 213, the first three octets uniquely identify the network, and only the last octet identifies a host.

The reason for IP addresses being separated into different classes is to allow for networks of different sizes on the Internet – some networks are small, while others are much larger. The table below outlines the three main address classes used on the Internet. The value in the first octet of the address is used to determine the address class. For this information you can subsequently determine which portion of an IP address identifies a network, and which a host.

Address Class First Octet Range Network Portion (N) and Host Portion (H)
Class A 1-126 N.H.H.H
Class B 128-191 N.N.H.H
Class C 192-223 N.N.N.H

Looking at the table above, you would now know that the IP address 167.204.7.1 is a Class B address, and that 167.204 identifies the network, while 7.1 uniquely identifies the host. So, if two hosts on the same network were configured with the IP addresses 167.204.7.1 and 167.204.99.2 respectively, they would be able to communicate using TCP/IP.

You may have noticed that the number “127” appears to be missing from the table above. It is, and this is on purpose. IP addresses starting with 127 are reserved for a special diagnostic function on a TCP/IP network, and are known as “loopback” addresses. When you ping the address 127.0.0.1, you are effectively pinging the same machine from which the command is issued. If you receive a reply, it means that TCP/IP is functioning on that computer. However, it still doesn’t mean that your configuration settings are correct.

Getting to Know TCP/IP

The truth be told, both NWLink and NetBEUI are easier to configure than TCP/IP. Just because they’re easier to get up and running, that doesn’t make them better. Since TCP/IP is the protocol used on the Internet, it best to take the time to properly configure your home network to use TCP/IP rather than the other two. In fact, for almost all home or small networks, you’re almost better offer pretending that TCP/IP is the only protocol that exists.

One of the reasons that users have commonly avoided TCP/IP back when home networks first came on the scene was that it takes a little more understanding to install and configure correctly. Instead of just “turning it on”, you need to configure systems with settings like IP addresses, subnet masks, default gateways, and DNS server settings. While it is possible to make your computers acquire or generate this information automatically, those methods can involve additional configuration or be subject to limitations. The main focus of this article is to help you understand how TCP/IP works, and how to manually configure the correct settings for your network. The “automatic” stuff will all be looked at later in the series, once you understand how to make it all work manually.

Wiring Network Cables the DIY Way

If you’re planning to wire your own cables, all you need is a little know-how and a whole lot of patience. Ok, so you’ll also need a box or appropriate length of Cat5 twisted pair cabling, a bunch of RJ-45 plug (always get more than you’ll need), and a crimping tool. But that’s it, really.

Without getting into the details of measurements, always make your cables at least 10% longer than you think you’ll need, and measure before you cut – otherwise, Murphy says you’ll always be 10% shorter than you thought, and that’s just a waste. In side a UTP cable you’ll find 8 wires, 4 solid and 4 striped. The solid wires are referred to by their color, for example solid green is just “green”. The striped wires are referred to as “white-color”, or “white-green” for the white cable with the green stripe. Keep that in mind.

After you’ve cut your length of cable (the maximum distance between a PC and a switch is 100 meters, keep that in mind), you need to slice away approximately 1 cm of the outer coating to expose the wires on each end – any more, and the cable is unlikely to function optimally, if at all. After untwisting the individual wire pairs, you need to line them up. The color chart below shows how they should be lined up for a straight cable (both ends the same) and a crossover cable. When creating a crossover cable, wire one end according to the “straight” diagram, and one according to the “crossover” diagram. The diagrams show how the cables show be inserted into the RJ-45 plug with the clip facing down. Before inserted the wires, trim them into a perfectly straight line, being sure you have at least 1 cm of exposure wire available. When you insert the wires into the plug, they should fit into each of the 8 grooves, and touch the far end of the plug when you look inside. If they don’t, you’ll need to try again – this is the patience part.

The last step in creating your cables is crimping them. Never crimp until you are certain that the wires are in the correct order, or your cable will not work, and you’ll have wasted a plug. Trust us when we say that those plugs can get much more expensive that you think, especially if you’re not careful!

Installing Network Cabling

No, the cabling part isn’t quite done yet. Outside of choosing the correct cable type or wiring them correctly, you should also know a thing or those about wiring cable runs. In the most basic sense, cable runs are the wiring that will ultimately run from your switch to the various rooms in your house. The methods that can be used here vary, depending upon how fancy you want to be.

Most users opt for the easiest solution when running wires to other rooms, namely creating one very long cable with a plug on each end. While this works, it can also be messy, and you probably don’t want loose cable running across your floor. Instead, most people fasten the wire to the wall, along the top or bottom of baseboard. But therein lies the problem – if the cable is fastened to the wall, what happens when you need to move things? The answer is simple, but not very nice – usually you would need to remove the cable and start over. One quick note here – never ever use metal staples to fasten Ethernet cabling to a wall, as you’ll likely damage it. Use little screw-in plastic fasteners instead, available at any hardware store.

A better idea is to wire your house with RJ-45 Ethernet jacks, similar to the phone connectors found in different rooms of your house. Optimally these would be fixed to the wall, with the cables actually inside the wall. However, many jacks can be wall-mounted, saving you the hassle of tearing down walls (and from the wrath of your spouse), allowing you to run the cable along that baseboard. The whole idea here is that one end of the jack would be placed in a convenient location for a PC, and the other end would terminate to another jack (or small patch panel) in the room with your switch. Then, the PC would be connected to the jack by a shorter patch cable, giving you the flexibility to use a longer cable in that room if you decide to rearrange the furniture. Changing one of these small cables is a whole lot easier than re-wiring your house. In the room with your switch, another patch cable connects the other jack (or patch panel) to the switch port. For a much longer read about wiring your home, be sure to check out http://www.swhowto.com.

Understanding Straight and Crossover Ethernet Cables

You may have heard the terms “straight” and “crossover” used to describe Ethernet cables. In order for your network to function correctly, it’s important to recognize the differences between one and the other. “Straight” is the term used to describe an Ethernet cable that will connect a PC to a switch or a hub. The ports on a PC and a switch are wired differently, and a straight cable makes sure that the transmit wires on one connect to the receive wires on the other – simple enough. There’s nothing too fancy about a straight cable, but being able to identify one is important. Basically, when if you flip both ends of a cable upside down (with the clip facing the floor) and look at the ends side-by-side, the colored wires should be in precisely the same order on both ends. If you’re worried about the colors, we’ll get to that in a future article.

Where a straight cable is used to connect different types of ports, a crossover cable is used to connect ports of the same type. For example, if you wanted to connect two PCs directly to one another (without a switch or hub), a crossover cable would be used. The wires in a crossover cable are literally “crossed” so that the transmit wires on one device will now connect to the receive wires on the same type of device. So, any time that you want to connect devices of the same type, use a crossover cable. Note that switches and hubs use the same type of port, so when connecting a PC to a PC, a switch to a switch, or a switch to a hub, always use a crossover cable. Unless…

Right. There’s always an exception. If you’ve ever looked at a hub or switch, you may have noticed a port marked with an X that includes a little button or switch next to it that can be turned on or off. This is an “uplink” port, and is used to connect to another switch or hub. The uplink port is a special port that contains a built-in crossover capability, basically allowing you to either use a crossover cable to connect to another switch or hub, or a straight cable. If the crossover button is “on”, then you could use a straight cable to connect the hub or switch to another hub or switch. If switched “off”, a crossover cable would be used instead.

Home Network Cabling

Now you have network cards installed in your PCs, and a switch. All that’s left on the hardware side are some cable to tie everything together. This is where things get tricky, because you can go one of two ways – either purchase the cables pre-made, or make them yourself. The real decision rests on what you’re planning to do. If you’re wiring your whole house, you’ll want to go out and buy a box of Category 5 unshielded twisted pair cabling (aka Cat5 UTP), some RJ-45 plugs, and make the cables yourself. If the cables you need are much shorter (limited to a room or two), then it may be cheaper to buy the cables pre-made. There are upsides and downsides to each method.

The upside of purchasing cables is that the work is already done for you – the cable is wired correctly, and all you need to do is plug it in. The downside is that pre-made cables are generally expensive – you’re being charged an arm and a leg for someone else to have done the work. However, if you only a need a few cable runs to connect your equipment, it’s generally a waste to buy a huge box of cable, the RJ-45 plugs, and the crimping tool you’ll need to make your own.

If you do choose to make your own cables, you need all three of these elements, plus a whole lot of patience. While making a cable may look easy, it can also be a real pain, especially trying to get everything just right. It’s too easy to accidentally nick a wire, wire the plug wrong, or mess things up in a myriad of other ways if you’re not careful. If you are going the DIY route, make sure that you create your cables correctly, as outlined in a later article in this series.