Top Banner
Data Communication Part 7 Alex Fernandez
12

Data communication part 7

Apr 16, 2017

Download

Technology

Alex Fernandez
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Data communication part 7

Data CommunicationPart 7

Alex Fernandez

Page 2: Data communication part 7

DYNAMIC IP ADDRESSING

◎ Dynamic IP addressing, better known as Dynamic Host Configuration Protocol (DHCP)or the older (and much less popular) Bootstrap Protocol (BOOTP) , automatically as- signs an IP address whenever a computer connects to the network. DHCP (and BOOTP, but for simplicity I’ll just say DHCP) works in a very simple process. First, a computer is configured to use DHCP. Every OS has some method to tell the computer to use DHCP, like the Windows exampleshown in Figure 7.38.

Page 3: Data communication part 7
Page 4: Data communication part 7

HOW DHCP WORKS◎ Once a computer is configured to use DHCP, it’s called a

DHCP client. When a DHCP client boots up it automati- cally sends out a special DHCP discovery packet using the broadcast address. This DHCP discovery message asks:

◎ “Are there any DHCP servers out there?” (See Figure 7.39.)

◎ For DHCP to work, there must be one system on the LAN running special DHCP server software. This server is designed to respond to DHCP discovery requests with a DHCP offer. The DHCP server is configured to pass out IP addresses from a range (called a DHCP scope), a subnet mask, and a default gateway (Figure 7.40)

Page 5: Data communication part 7
Page 6: Data communication part 7

◎ DHCP client sends out a DHCP request a poor name ⎯choice as it really is accepting the offer. The DHCP server then sends a DHCP ac-knowledge and lists the MAC address as well as the IP information given to the DHCP client in a database(Figure 7.41).

◎ The acceptance from the DHCP client of the DHCP server’s data is called a DHCP lease . A DHCP lease is set for a fixed amount of time, usually 5 to 8 days. At the end of the lease time, the DHCP client simply makes another DHCP discovery message. The DHCP server looks at the MAC address information and, un-less another computer has taken the lease, will always give the DHCP client the same IP information, including the same IP addre

Page 7: Data communication part 7

LIVING WITH DHCP◎ DHCP is very convenient and, as such, very popular. So popular that it’s very

rare to see a user’s computer on any network using static addressing.

◎ The single biggest issue is when a DHCP client tries to get a

◎ DHCP address and fails. It’s easy to tell when this happens because the operating system will post some form of error telling you there’s a problem (Figure 7.42) and the DHCP client will have a rather strange address in the 169.254/16 network ID.

◎ This special IP address is generated byAutomatic Private IP Ad-dressing (APIPA). All DHCP clients are designed to generate an APIPA address automatically if there’s no response to a DHCP dis-covery message. The client generates the last two octets of an APIPA address automatically. This will at least allow all the DHCP clients on a sin -gle network to continue to communicate with each other because they are on the same network ID. Unfortunately, there’s no way for APIPA to give a default gateway, so you’ll never get on the Internet using APIPA. That pro -vides a huge clue to a DHCP problem: you can communicate with other computers on your network, but you can’t get out to the Internet

Page 8: Data communication part 7

◎ If you can’t get out to the Internet, use whatever tool your OS provides to check your IP address. If it’s an APIPA address, you instantly know you have a DHCP problem. First of all, try to reestablish the lease manually. Every OS has some way to do this. In Windows, you can type the following command:

◎ ipconfig /renew

◎ On a Macintosh, you can go to System Preferences and use the Network utility (Figure 7.43).

◎ Sometimes you might find yourself in a situation where your computer gets confused and won’t grab an IP address no matter what you try. In these cases you should first force the computer to release its lease. In Windows, get to a command prompt and type these two commands, each followed by pressing ENTER:

ipconfig /release

ipconfig /renew

◎ In UNIX/Linux and even Macintosh you can use the IFCONFIG command to release and renew your DHCP address. Here’s the syntax to reease:

sudo ifconfig eth0 down

And here is the syntax to renew:

sudo ifconfig eth0 up

Page 9: Data communication part 7
Page 10: Data communication part 7

SPECIAL IP ADDRESSES

◎ The folks who invented TCP/IP created a number of special IP addresses you need to know about. The first special address is 127.0.0.1, the loopback address. When you tell a device to send data to 127.0.0.1, you’re telling that device to send the packets to itself. The loopback address has a number of uses. One of the most common is to use it with the PING command. We use the command PING 127.0.0.1 to test a NIC’s capability to send and receive packets.

◎ For the moment, however, let’s just look at the

◎ ranges of addresses that are designated private IP addresses:

◎ ■ 10.0.0.0 through 10.255.255.255 (1 Class A license)

◎ ■ 172.16.0.0 through 172.31.255.255 (16 Class B licenses)

◎ ■ 192.168.0.0 through 192.168.255.255 (256 Class C licenses)

◎ All other IP addresses are public IP addresse

Page 11: Data communication part 7
Page 12: Data communication part 7