If your computer is connected to the Internet, no matter what computer you use, no matter what connection, there are two questions can be sure: First, you are using TCP / IP network protocol; Second, your computer has a unique Internet protocol (IP, Internet Protocol) number. There is no way to access Internet. In general, there is no problem with the TCP / IP protocol, which is usually installed together when Windows is installed, or can also be installed by the network item of the control panel. But how did the computer get this unique IP number? This is a completely different problem. The computer gets IP numbers from the Internet Service Provider (ISP). ISP gets a number of such numbers from the high-level (upstream) service provider, the top of this IP number assignment tree is three regional registration center: APNIC is responsible for the Asian and Pacific (www.apnic.net), RIPE is responsible for Europe ( Www.ripe.net), ARIN (WWW.ARIN.NET) The American Internet Number Registration Center is part of the Americas and Africa. These institutions coordinate work by the Internet Numbers Authority, www.iana.org, supported by the US government's National Science Fund. ISP can be assigned to a separate user after getting a set of IP numbers. The user can be an organization that requires a large number of IP numbers, or some IP numbers need only one IP number. ISP can be static or dynamically allocated IP numbers (after allocation, IP numbers are often referred to as IP addresses). If you are using a 24-hour uninterrupted Internet connection, you like a static IP address, that is, this address will not change. On the other hand, if the modem is connected to the Internet, users tend to dynamically give an IP address - each different. For modem users, dynamic address assignments are the most common cases, but ISP does not necessarily have to assign IP addresses so. Each dial user can - is more common in early business ISP - assigned a static IP address, but because the dial user is a temporary connection, this is an inefficient method. Regardless of the 15 minutes or 15 hours, it can be seen as a temporary connection. Although the readers of this magazine are likely to be connected for hours, there are many Internet users to log in once a few days. No matter what, those accounts for 10 hours a month are still active. If an ISP has 10,000 dial-up users, if you need 10,000 IP numbers if it is using a fully static allocation method. But if this ISP is only 500 dial-in telephone lines, it only requires 500 IP numbers because only IP addresses are required to log in to the Internet. So, ISP only needs to assign IP addresses to users who have dial-up, and this address is only valid during their login. After the computer is disconnected, the ISP reclaims the assigned IP address and assigned to the next dial-up Internet. In order to dynamically assign IP numbers, the world entered the DHCP, the INTERNET Engineering Task FORCE proposes the idea of dynamic host configuration protocol, dhcp.
This protocol first appeared in RFC (RFC, Request for Comment) 1531 and 1541 (ftp://ftp.isi.edu/in-notes/rfc1541.txt), the latest definition of the protocol can see RFC 2131 (ftp: // ftp .isi.edu / in-notes / rfc2131.txt). The DHCP design is to provide greater allocation flexibility than previous protocols such as Bootp, Bootstrap Protocol. DHCP is actually BOOTP based, but it provides more features, such as limiting the rental time of the IP number, allows the DHCP server to recover and reuse these numbers. Providing an IP address for dial-up accounts may be the most common use of DHCP, but its use is not limited thereto. For example, you can use DHCP on a local area to share Internet connections. Microsoft Windows98 Second Edition provides features called Internet Connection Sharing (ICS), which can implement DHCP. After installing the ICS, it can be used as a DHCP server on the local area network, which is the IP number within 192.168.x.x, which is specifically reserved for internal networks. The computer that provides ICS service first dials to ISP, get an IP address from ISP, and then allows other computers on the LAN to share this address. It sends the request of other computers to the Internet and uses the internal IP address to track the request for each LAN user. When the Internet returns an answer, it forwards the information to the corresponding computer. The working principle of DHCP DHCP is a client / server protocol (just like TCP / IP, HTTP, FTP, and other Internet protocols). DHCP clients issued a request to the DHCP server, and the server responded in a pre-set method. If the IP address of the computer is set to 0.0.0.0, it automatically turns into a DHCP client. On the Windows operating system, TCP / IP settings can also be changed from the server to obtain an IP address (setup process, see Figure 1 to Figure 5). After the client is connected to the network, it will take four phases of DHCP communication. (Below we will discuss the case of computer dial-up to ISP, the concept of other DHCP assignments is the same.) The first step is to initialize. Because the client has no IP address, it needs to be operated (such as browsing the web), it first is first to find a DHCP server that can give it an IP address. In the case of dial-up connections, the client is connected to a modem and then broadcasts a DHCPDiscover information through the telephone line to locate the DHCP server. If ISP has more than one DHCP server, all servers send back a DHCPoffer response, and the response includes a rental time of an IP address and address. The rental time of the address is the time when the client can use this address, and is set by the system administrator. The client returns a DHCPRequest broadcast information indicating which server's DHCPOFFER is accepted. Because all servers are waiting to answer, they need to use a broadcast mode. The accepted server ends the initialization step by returning a DHCPACK message to confirm the IP address and rental time. If the IP address it provides in this time is not available (due to timeout), the server returns a DHCPNAK (not confirmed) message, forcing the client to re-perform DHCPDiscover broadcast.
In fact, the client may resend DHCPDiscover information, after receiving the DHCPACK package, it issues an address resolution protocol (ARP) broadcast to the network to detect if the address has been used. (Similarly, due to timeout) If the address has been used, the client will send a DHCPDECLINE message to the servers that provide the address and immediately issue a new DHCPDiscover message. Then the update and rebound phase. The client can only rent an IP address for a while, the rental time can be set very short, or an unlimited length, or any length between the two. It is called "rental" instead of simply saying that the rental time can be updated during the connection. The DHCP client (not server) runs T1 and T2 two timers. By default, T1 is set to 50% of the rental time, T2 is 87.5%. When the rent of the IP address is used to the T1 defined time, the client enters the update phase and applies for updates to the server to the address. If the server returns a DHCPACK response package, the address rent is updated, T1 and T2 are also reset accordingly (T2's timing period is not reached at all). If the server does not respond, the client will continue to use this address before the T2 period. When the T2 period is reached, the client will enter the rebound phase and send a DHCPRequest broadcast to all the servers. Any server that sent back to DHCPACK responders can update this lease and become the authorization server of this client. If there is still no server response, the address rent is expired, and the client no longer has an IP address. In other words, it cannot use the Internet. The last step is called a smooth server, and this step will occur when the client does no longer need to be given the IP address. The client issues DHCPRELEASE information tells the server that it can pay the IP address. Like you expect, things will not always be so smooth, if someone happens to pick up your connection, the ISP server has to wait for your T2 point point to recover the address. Figure 1-5 Tell you how to set up a DHCP client. Here we explain the Windows 95/98 system, but Windows NT 4 is also very similar. Windows 2000 handles network connections in another location: not a control panel, but a NetWork Connection folder on your desktop. DHCP is not a complex protocol, which is easy to set up DHCP clients. But this is by no means this agreement is not important. Without it, the allocation of IP addresses will be a headache for users and administrators, and the IP number that has begun to consume light faster.