Configuring and Troubleshooting the TCP/IP Protocol
The Transmission Control IP address The host or node) as well as the subnet on which it is located. The IP address is displayed in dotted decimal notation (each decimal represents an octet of binary ones and zeroes). For example, the binary notation of an address may be 10000000.00000001.00000001.00000011, which in dotted decimal notation it is written as 128.1.1.3.Subnet mask The subnet Default gateway The Domain Name System (DNS) server address The DNS server address is the Windows Internet Naming Service (WINS) server address The WINS server address is the location where network computers send requests to resolve NetBIOS names to IP addresses. WINS is used on Microsoft Windows networks where older Windows computers or applications require NetBIOS naming. When a user types in a NetBIOS name, such as JACKSPC, the computer sends the name to the WINS server. Because WINS is a flat-file database, it returns an IP address or a Name not found message. WINS server addresses, like DNS server addresses, are optional. A computer can use a local LMHOSTS file to map the NetBIOS names to IP addresses rather than use WINS.
Configuring IP Addresses
You can configure Dynamic Host Configuration Protocol (DHCP) services that deliver IP addresses to network computers, then a Windows XP computer can connect upon logon with the default configuration of the network adapter. However, if you need to apply a static IP address and other parameters, your only option is to manually configure the network adapter. Manually configuring one computer is time-consuming and error-prone. Multiply that by hundreds of computers and you can see why dynamic configuration has become so popular. Step by Step 11.1 describes how to configure TCP/IP.
Step by Step: 11.1 Configuring a Network Adapter with a Static IP Address
1. Right-click My Network Places and select Properties from the shortcut menu. The Network Connections window opens.2. Right-click the connection that represents the adapter you are going to configure. Select Properties from the shortcut menu. The Local Area Connection Properties dialog box opens, as shown in Figure 11.1.
Figure 11.1. The network adapter is considered a network connection.

Figure 11.2. The Internet Protocol (TCP/IP) Properties dialog box lets you define manual or dynamic IP address information.

Figure 11.3. The Advanced TCP/IP Properties dialog allows you to control granular IP addressing options.

Figure 11.4. The TCP/IP Filtering options can be configured to restrict unwanted IP traffic on a computer.

Creating a Network Bridge
Windows XP Professional includes a new type of connection called a network bridge. This type of connection is available when you have two network adapters in a computer, each connected to different network segments, and you want to connect the segments so that the computers on one segment can talk to the computers on the other segment. Basically, the network bridge connection acts as a bridge between two segments.A traditional router is a dedicated computer or a specialized piece of computer equipment that has two or more network interfaces and is connected to two or more networks. When the router receives data on its first interface, it checks to see whether the data should be sent to a host on its second interface by checking its routing table. If so, the router sends the data on its way. If not, the router discards the data.A traditional bridge is a dedicated computer or specialized piece of computer equipment that has two or more network interfaces and is connected to two or more physical networks. The networks, however, are logically the same because they are assigned to the same IP subnet. Bridges are often used to overcome the physical distance limitations that are imposed by the media used. They can also be used to link two different media types in a single logical network, as depicted in Figure 11.5.Figure 11.5. Computer B can use a Windows XP network bridge connection to enable A to send data to C.

Step by Step: 11.2 Configuring a Network Bridge
1. Right-click My Network Places and select Properties.2. The Network Connections window opens. There should be a LAN or High-Speed Internet section that contains the network connections for each of the two network adapters.3. Click each of the network connections while simultaneously pressing the Ctrl key, so that both are highlighted.4. Right-click the connections and select Bridge Connections from the shortcut menu, as depicted in Figure 11.6.
Figure 11.6. When both network connections are selected, a right-click shows the Bridge Connections option in the shortcut menu.
[View full size image]

Implementing APIPA
The Automatic Private Internet Protocol Addressing (APIPA) system provides an alternate configuration to Dynamic Host Configuration Protocol (DHCP) for automatic IP addressing in small networks. When a computer uses APIPA, Windows XP assigns itself an IP address and then verifies that it is unique on the local network. To work effectively, APIPA is useful only on a small local area network (LAN) or as a backup to DHCP.Note
What is APIPA? APIPA is not a protocol; it is an internal procedure that the operating system performs.When a Windows XP Professional computer begins its network configuration, it performs the following procedures:1. It checks to see whether there is a manually configured (or static) IP address.2. If there is none, it contacts a DHCP server with a query for configuration settings. A response from a DHCP server leasesor validates the lease ofan IP address, subnet mask, and extended IP information such as DNS server, default gateway, and so on.3. If there is no DHCP server response, Windows XP looks to see whether an alternate configuration has been applied by the administrator.4. If there is no alternate configuration, Windows XP uses APIPA to define an IP address unique on the LAN.
APIPA defines its IP addresses in the range of 169.254.0.1 to 169.254.255.254. The subnet mask on these addresses is configured as 255.255.0.0. You do have administrative control over APIPA. When Windows XP selects an address from this range, it then performs a duplicate address detection process to ensure that the IP address it has selected is not already being used, while continuing to query for a DHCP server in the background. If the address is found to be in use, Windows XP selects another address. The random IP selection occurs recursively until an unused IP address is selected, a DHCP server is discovered, or the process has taken place ten times.To determine whether the IP address the computer is using has been provided by APIPA, you can check the address of the interface by using the ipconfig command at a command prompt. The syntax for this command, which shows you the configuration of all network adapters, is ipconfig /allIn the resulting text, such as is shown in Figure 11.7, you can see whether the line Autoconfiguration Enabled is Yes or No. If Yes, and the IP address is 169.254.0.1 through 169.254.255.254, you are using an APIPA address.
Figure 11.7. APIPA addresses require autoconfiguration to be enabled.
[View full size image]

Static IP Addressing
IP addresses indicate the same type of location information as a street address. A building on a street has a number, and when you add it to the street address, you can find it fairly easily because the number and the street will be unique within a city. This type of address schemean individual address plus a location addressallows every computer on the Internet to be uniquely identified.A static IP address is one that is permanently assigned to a computer on the network. Certain computers require static IP addresses because of their functions, such as routers or servers. Client computers are more often assigned dynamic addresses because they are more likely to be moved around the network or retired and replaced. DSL and cable modem users are usually given a static IP address, whereas dial-up users are provided with dynamic addresses.As discussed earlier, IP addresses consist of two parts: one that specifies the network and the other that specifies the computer. These addresses are further categorized with Classes, as described in Table 11.1.Table 11.1. IP Address Classes
ClassDotted Decimal RangeFirst Octet BinaryUsageNumber of NetworksNumber of Hosts per NetworkA1.0.0.0126.255.255.2550xxxxxxxLarge networks/ISPs16,777,214B128.0.0.0191.255.255.25510xxxxxxLarge or mid-size networks/ISPs16,38265,534C192.0.0.0223.255.255.2551110xxxxSmall networks2,097,150D224.0.0.0239.255.255.255110xxxxxMulticastingN/AN/AE240.0.0.0254.255.255.2551111xxxxReserved for future useN/AN/ALoopback127.0.0.1127.255.255.255Loopback testingN/AN/APrivate IP Class A address10.0.0.010.255.255.255Reserved for a private network16,777,214Private IP Class B address172.16.0.0172.16.255.255Reserved for a private network65,534Private IP Class C address192.168.0.0192.168.255.255Reserved for a private network254Note
Loopback testing TCP/IP has a predefined IP address that identifies a computer to dial itself up to perform loopback testing. If TCP/IP is configured, you should be able to run the ping 127.0.0.1 command when troubleshooting a connectivity problem. The private IP address classes are used on private networks that utilize Network Address Translation or proxy services to communicate on the Internet. Internet routers are preconfigured to not forward data that contains these IP addresses.The portion of the address that decides on which network the host resides varies based on the class, and, as you will see further on, the subnet mask. In the following list, the uppercase Ns represent which binary bits represent the part of the IP address that specifies the network, and the lowercase Cs represent the part of the address that specifies the computer. This explains why there are differing numbers of networks per class, and different numbers of hosts per network, as listed in Table 11.1.Class A NNNNNNNN.cccccccc.cccccccc.ccccccccClass B NNNNNNNN.NNNNNNNN.cccccccc.ccccccccClass C NNNNNNNN.NNNNNNNN.NNNNNNNN.ccccccccThese address portions coincide with the default subnet masks for each address class. A Class A subnet mask is 255.0.0.0, a Class B subnet mask is 255.255.0.0, and a Class C subnet mask is 255.255.255.0.Subnet masks enable you to reconfigure what constitutes the network portion and what constitutes the computer portion. When you apply the subnet mask to the IP address by using a "bitwise logical AND" operation, the result is a network number. A bitwise logical AND operation adds the bit, whether 1 or 0, to the corresponding bit in the subnet mask. If the subnet mask bit is a 1, the corresponding IP address bit is passed through as a result. If the subnet mask bit is a 0, a zero bit is passed through. For example, if the IP address is 141.25.240.201, you will have the following:IP address10001101.00011001.11110000.11001001Subnet mask11111111.11111111.00000000.00000000Result from bitwise logical ANDNetwork10001101.00011001.00000000.00000000
This shows the network address as 141.25.0.0 and the host address to 0.0.240.201. If you add bits to the mask, you will be able to have additional subnetworks when you perform a bitwise logical AND, and each subnetwork will have fewer hosts because fewer bits are available for the host portion of the address. Using the same address, and adding five bits to the subnet mask, you would receive the following:IP address10001101.00011001.11110000.11001001Subnet mask11111111.11111111.11111000.00000000Result from bitwise logical ANDNetwork10001101.00011001.11110000.00000000
However, Classless Inter-Domain Routing (CIDR) specification enables you to eke out more addresses when you subnet.)Therefore, the subnet mask changes the network address to 141.25.240.0. The host address changes to 0.0.0.201. Other IP addresses that are under the default Class B subnet mask that would have been considered part of the same network, such as 140.25.192.15 and 140.25.63.12, are now on different subnets. For an organization with a large number of physical networks where each requires a different subnet address, the subnet mask can be used to segment a single address to fit the network. You can easily calculate how many subnets and hosts you will receive when you subnet a network. The formula is 2n2, where n is the number of bits. 2n is the number 2 raised to the power of the number of bits, and that result minus 2 (the addresses represented by all 1s and all 0s) equals the available subnets or hosts. Therefore, if you have a subnet of 5 bits as is shown here, you are able to achieve 252 = 322 = 30 subnets. Because there are 11 bits left for host addresses, each subnet will have 2112 = 20482 = 2,046 hosts.When you multiply 2046 by 30, you will see that you have 61,380 addresses available for network hosts, and that you "lost" 4,154 addresses. This is the problem that CIDR solves, and is discussed in the sidebar.
In the Field
How Classless Inter-Domain Routing (CIDR) FunctionsWhen you consider that a Class A address has over 16 million host addresses and that no organization with a Class A address has managed to utilize each of those addresses, the use of classful addressing is extremely wasteful. CIDR was developed to prevent the Internet from running out of IP addresses, by reusing some of the unused addresses and expanding the addresses available when subnetting.With CIDR, a subnet mask is not considered separate from the network portion of the mask. Instead, whatever portion of the mask is used for the network determines how many networks there are. This means that a company can "supernet" two (or more) Class C addresses to put more than 254 hosts on a single physical network. Supernetting is the process of subtracting bits from the default subnet mask. This adds bits to the host portion, increasing the number of hosts available.CIDR notation allows you to simply specify the number of bits that are used for a mask after the IP address. For example, 192.168.1.0 with a subnet mask of 255.255.255.0 is written as 192.168.1.0/24. If the address were supernetted, it could be 192.168.1.0/22.Running out of IP addresses is still a looming problem that IPv6, which provides a 128-bit address, may help to resolve. In the meantime, network administrators may look into Network Address Translation, CIDR, DHCP leasing, and other methods to expand the availability of IP addresses to network clients.
Challenge
You are the network administrator for I.M. Society, a non-profit organization that seeks to protect the rights of Internet usage. I.M. Society has been granted some shared office space from a company named ISPrUS, an ISP. The office space is distributed across a large campus with several different buildings. Because the space has been donated, I.M. does not have the ability to consolidate onto a single network. The organization consists of 102 computers on 12 different subnets. Currently I.M. has been using the same IP addresses as ISPrUS. You have had some questions about security because public traffic has some limited access to some of the subnets that ISPrUS has provided you, so you have wired a separate network for your users. The new network consists of 102 computers on 10 physical subnetworks. You have no more than 14 computers on any single subnet. You have been told that I.M. is not planning on expanding for a long time. You have received a Class C address for your own network.
1. How can you use the Class C address to provide unique IP addresses for each of your computers?2. You have added four bits to the default subnet mask. How many subnets will you have, with how many nodes on each subnet? Will this meet your needs?3. If the Class C address you are given is 192.168.0.1, what subnet ranges will you have with the subnet mask of 255.255.255.240?4. You decide to use CIDR. How will this affect your network?
Answers to Challenge
1. You need to create a subnet mask to subdivide the address into multiple subnetworks that provide a minimum of 10 subnets and at least 14 nodes per subnetwork.2. Adding 4 bits to the subnet mask results in 14 subnets with 14 nodes on each subnet. This meets your criteria.3. You will have the following ranges. Because you cannot have a subnet with all 0s or all 1s, you cannot use the first or last subnet numbers (this is to satisfy legacy rules). The list of networks would be as follows:192.168.0.0192.168.0.15: not used192.168.0.16192.168.0.31192.168.0.32192.168.0.47192.168.0.48192.168.0.63192.168.0.64192.168.0.79192.168.0.80192.168.0.95192.168.0.96192.168.0.111192.168.0.112192.168.0.127192.168.0.128192.168.0.145192.168.0.146192.168.0.161192.168.0.162192.168.0.177192.168.0.178192.168.0.191192.168.0.192192.168.0.207192.168.0.208192.168.0.223192.168.0.224192.168.0.239192.168.0.240192.168.0.255: not used4. CIDR does not use the rules that eliminate the first and last subnet range from your options. For your current network configuration, you will not have much change. However, you are able to expand your network to two other physical subnets.
Dynamic IP Addressing
Dynamic IP addresses are provided to a computer when it needs to be connected to the network. The provider is the DHCP server. When the computer is disconnected, the IP address becomes available for use by another computer. The address does not become available immediately, however. It is leased for a specified period of time (the administrator specifies this time period when configuring the DHCP server), and when the lease is up, the IP address is placed back in an IP address pool and can be delivered to another computer.Before DHCP was developed, network administrators were forced to manually assign a separate IP address to each computer on the network. If a user left for a 2-month vacation and the computer was off the entire time, the IP address was unusable by anyone else. If the administrator (yes, to err is human) forgot to reuse an IP address for a computer that was retired, then the number of IP addresses available was also reduced. Other administrative errors included assigning duplicate IP addresses to computers on the network and misconfiguring the subnet mask, default gateway, and DNS server addresses. DHCP resolved a lot of problems.Exam AlertThe DHCP process DHCP has a set communication process that is used to lease an IP address to a DHCP client. You may see a reference to a particular part of this process, so you should be able to relate the entire sequence of events and understand where a breakdown in communications may occur.1. Client boots up and broadcasts a DHCPDiscover packet.2. Server responds with a DHCPOffer packet, containing an IP address, subnet mask, and often including the default gateway and DNS server addresses.3. Client replies with a DHCPRequest packet as a broadcast, requesting verification that it is okay to use the address. This notifies any other DHCP servers that they do not need to hold a reservation of an IP address for the client if they also responded to the original DHCPDiscover packet.4. Server responds with a DHCPACK acknowledgement packet, and the client begins using the address.
On a Windows XP Professional computer, you can configure any network connection to be a DHCP client by selecting the option to Obtain an IP Address Automatically, which is configured in the Interent Protocol (TCP/IP) Properties dialog box. If you change from a manual address to a dynamic one, you need to clear out the manual IP addressing information first.Exam AlertTroubleshooting DHCP Often a question that requires troubleshooting DHCP involves a DHCP server that resides on a different subnet than the DHCP client, usually because a router does not forward UDP broadcast packets. Routers must be configured to forward packets specifically for DHCP whenever a DHCP client is separated from the DHCP servers.
Troubleshooting TCP/IP
The TCP/IP protocol suite includes a number of tools that can help you isolate the source of connectivity problems. Windows XP Professional incorporates these tools as command-line executables. Each tool is different in what information it provides and when you might want to use it.When you are troubleshooting a connectivity problem, remember that sometimes the problem is the hardwarea failed network adapter, a failed port on the hub, a failed switch, and so on. If the communication is between two different physical segments, it could be a problem with the router between them. And if you were able to communicate in the past, and now cannot, the most likely suspect is a configuration change on one of the computers and the second most likely is that a piece of equipment has failed. To check whether there is an adapter failure, you can look at Device Manager in Windows XP.
ARP
After data reaches the segment on which the IP address resides, it needs to discover the Media Access Control (MAC) address of the machine. The address resolution Protocol (ARP) is the protocol in the TCP/IP suite that resolves IP addresses to MAC addresses by creating an Address Resolution table in each host that transmits data on the network segment. Arp is also the name of a utility in the TCP/IP suite that can check the table for errors. You should use the Arp utility when data is sent to a computer unexpectedly.Event Viewer
One of Windows XP's standard troubleshooting tools is Event Viewer, which is incorporated into the Computer Management console. You can rely on this utility to be able to see errors and system messages. The ones that would be of most concern for a network problem are in the System Event log.Finger
If you want to finger the culprit when a user has intentionally caused a problem, you can use Finger. Actually, the Finger utility, which is part of the TCP/IP protocol suite, requires the finger service to be running on the computer to which you send the command. (If the service is not running, you see a Connection Timed Out response when you run the Finger command.) What the Finger utility does is query the computer about the services and users that are running on it. Each operating system returns different output to the Finger command.FTP and TFTP
File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP) are not considered to be troubleshooting tools. Sometimes you need to make certain that a protocol is able to move data from one network segment to another and these two utilities can help out in a pinch because they verify TCP and UDP specifically, as well as all the protocols down to the Physical layer of the stack.If you want to verify whether the Transport Control Protocol (TCP) is functioning across a router, you can use FTP to download a file from an FTP server on another subnet. If you want to verify whether the User Datagram Protocol (UDP) is functioning across a router, you can use TFTP to download a file from a TFTP server on another subnet.Ipconfig
Windows XP uses the Ipconfig utility to display information about the IP address configuration of its network adapters. When you are experiencing a problem with connectivity, this is the first thing you should check (besides the link lights on the network adapter). If you are using DHCP, you can see whether the adapter was able to obtain an IP address lease. If you are using a static IP address, you can verify and validate whether it has been configured correctly. You can use Ipconfig with the following switches:ipconfig /all Displays all IP address data for all network adapters. Use this command to see whether an adapter has been misconfigured, or the adapter did not receive a DHCP lease.ipconfig /release Releases the current DHCP lease. Use this command to remove an IP address that is misconfigured, or when you have moved from one network to another and the wrong IP address is still leased to the adapter.ipconfig /renew Renews (or tries to renew) the current DHCP lease. Use this command to see whether the computer can contact the DHCP server.ipconfig /displaydns Displays the contents of the DNS cache. Use this command when the computer connects to the wrong network.ipconfig /flushdns Flushes the contents of the DNS cache. Use this command when the computer connects to the wrong network and you see incorrect entries after using the ipconfig /displaydns command.ipconfig /registerdns Renews (or tries to renew) all adapters' DHCP leases and refreshes the DNS configuration. Use this command when the network has temporarily disconnected and you have not rebooted the PC.ipconfig /showclassid adapter Shows the DHCP class ID. If you use the asterisk (*) in place of adapter, you see the DHCP class ID for all adapters.ipconfig /setclassid adapter Changes the DHCP class ID for an adapter. If you use the asterisk (*) in the place of adapter, you set the DHCP class ID of all adapters.
Nbtstat
The Nbtstat utility is used on networks that run NetBIOS over TCP/IP. This utility checks to see the status of NetBIOS name resolution to IP addresses. You can check current NetBIOS sessions, add entries to the NetBIOS name cache, and check the NetBIOS name and scope assigned to the computer.
Netstat
The Netstat command-line tool enables you to check the current status of the computer's IP connections. If you do not use switches, the results are protocol statistics and current TCP/IP connections. You should use Netstat to look for the services that are listening for incoming connections, if you have already checked the IP configuration and, though it is correct, the computer still displays a connectivity problem.
Nslookup
NSLookup literally means Name Server Lookup, and is a command-line utility that communicates with a DNS server. There are two modes to Nslookup: interactive and non-interactive. The interactive mode opens a session with a DNS server and views various records. The non-interactive mode asks for one piece of information and receives it. If more information is needed, a new query must be made.
Ping
Packet InterNet Groper (Ping) is a valuable tool for determining whether there is a problem with connectivity. The ping command uses an Echo packet at the Network layerthe default is to send a series of four echoes in a rowtransmitting the packets to the IP address specified. The Echo returns an acknowledgment if the IP address is found. The results are displayed in the command window. If an IP address is not found, you see only the response Request timed out. You see similar results to those shown in Figure 11.8, where the first address that was pinged was not found and the second address was found. Ping indicates how long each packet took for the response. You can use the ping command to determine whether a host is reachable, and to determine whether you are losing packets when sending/receiving data to a particular host.
Figure 11.8. Ping displays its results in a command window.
[View full size image]

TRacert
When you have a problem communicating with a particular host, yet you have determined that your computer is functioning well, you can use tracert (TRace Route) to tell you how the data is moving across the network between your computer and the one that you are having difficulty reaching. TRacert offers a somewhat higher level of information than Ping. Rather than simply tell you that the data was transmitted and returned effectively, as Ping does, tracert logs each hop through which the data was transmitted. Figure 11.9 shows the results of a TRacert command. Keep in mind that some network routers strip out or refuse to reply to tracert requests. When this happens, you see Request timed out messages.
Figure 11.9. tracert provides detailed information about the path that data travels between two IP hosts.
[View full size image]

1. Verify the hardware is functioning.2. Run Ipconfig to validate the IP address, mask, default gateway, and DNS server, and whether you are receiving a DHCP leased address.3. Ping 127.0.0.1, the loopback address, to validate that TCP/IP is functioning.4. Ping the computer's own IP address to eliminate a duplicate IP address as the problem.5. Ping the default gateway address, which tells you whether data can travel on the current network segment.6. Ping a host that is not on your network segment, which shows whether the router will be able to route your data.7. FTP a file from an FTP server not on your network, which tells you whether higher-level protocols are functioning. TFTP a file from a TFTP server on a different network to determine whether UDP packets are able to cross the router.