IP地址（Internet Protocol Address）是一种在Internet上的给主机编址的方式，也称为网际协议地址。由32位二进制数组成，为便于使用，常以XXX.XXX.XXX.XXX形式表现，每组XXX代表小于等于255的10进制数。例如22.214.171.124。Internet中，IP地址是唯一的。目前IP技术可能使用的IP地址最多可有约42亿个。骤看可能觉得很难会用尽，但由于早期编码上的问题，使很多编码实际上被丢空或不能使用。加上因特网的普及，使每个家庭都至少有一部电脑，连同公司的电脑，以及连接每个网络的服务器，长此下去，专家担心随着Internet的发展，将不够用。所以相应的科研组织正在研究128位的IP地址，其IP地址数量最高可达 3.402823669 × 1038 个，地球上的每一粒沙子都可以拥有自己的IP地址，这种新版的IP地址技术叫IPv6。
An IP address (Internet Protocol address) is a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard. Any participating device — including routers, computers, time-servers, internet FAX machines, and some telephones — must have its own unique address. This allows information passed onwards on behalf of the sender to indicate where to send it next, and for the receiver of the information to know that it is the intended destination.
The numbers currently used in IP addresses range from 126.96.36.199 to 255.255.255.255, though some of these values are reserved for specific purposes. This does not provide enough possibilities for every internet device to have its own permanent number. Subnet routing, Network Address Translation and the Dynamic Host Configuration Protocol (DHCP) server all allow local networks to use the same IP addresses as other networks elsewhere though both are connected to the Internet. Devices such as network printers, web servers and email servers are often allocated static IP addresses so they can always be found.
IP addresses are conceptually similar to phone numbers, except they are used in LANs (Local Area Network), WANs (Wide Area Network), or the Internet. Because the numbers are not easy for humans to remember, the Domain Name System provides a service analogous to an address book lookup called "domain name resolution" or "name resolution". Special DNS servers on the internet are dedicated to performing the translation from a domain name to an IP address and vice versa.
The Internet Protocol (IP) knows each logical host interface by a number, the IP address. On any given network, this number must be unique among all the host interfaces that communicate through this network. Users of the Internet are sometimes given a host name in addition to their numerical IP address by their Internet service provider.
The IP addresses of users browsing the World Wide Web are used to enable communications with the server of the Web site. Also, it is usually in the header of email messages one sends. In fact, for all programs that utilize the TCP/IP protocol, the sender IP address and destination IP address are required in order to establish communications and send data.
Depending on one's Internet connection the IP address can be the same every time one connects (called a static IP address), or different every time one connects, (called a dynamic IP address). In order to use a dynamic IP address, there must exist a server which can provide the address. IP addresses are usually given out through a server service called DHCP or the Dynamic Host Configuration Protocol. If a static address is used, it must be manually programmed into parameters of the device's network interface.
Internet addresses are needed not only for unique enumeration of hosted interfaces, but also for routing purposes, therefore a high fraction of them are always unused or reserved.
The unique nature of IP addresses makes it possible in many situations to track which computer — and by extension, which person — has sent a message or engaged in some other activity on the Internet. This information has been used by law enforcement authorities to identify criminal suspects; however dynamically-assigned IP addresses can make this difficult.
IP version 4
In version 4 of the Internet protocol (IPv4), the current standard protocol for the Internet, IP addresses consist of 32 bits, which makes for 4,294,967,296 (over 4 billion) unique host interface addresses in theory. If all of these were used, that would be around one IP address per 21.3 square meters, or 70 square feet, of land. In practice, because addresses are allocated in blocks, many unused addresses are unavailable (much like unused phone numbers in a sparsely-populated area code), so that there is some pressure to extend the address range via IP version 6 (see below).
IPv4 addresses are commonly expressed as a dotted quad, four octets (8 bits) separated by periods. The host known as www.wikipedia.org currently has the number 3482223596, written as 188.8.131.52 in base-256: 3482223596 equals 207×2563 + 142×2562 + 131×2561 + 236×2560. (Resolving the name www.wikipedia.org to its associated number is handled by Domain Name System servers.)
IPv4 addresses were originally divided into two parts: the network and the host. A later change increased that to three parts: the network, the subnetwork, and the host, in that order. However, with the advent of classless inter-domain routing (CIDR), this distinction is no longer meaningful, and the address can have an arbitrary number of levels of hierarchy. (Technically, this was already true any time after the advent of subnets, since a site could elect to have more than one level of subnetting inside a network number.)
Each interface of a device is assigned, at least theoretically, a unique IP address. In practice, some interfaces may be unnumbered, and many addresses are not globally unique.
The actual assignment of an address is not arbitrary. The fundamental principle of routing, that addresses encode information about a device's location within a network, implies that an address assigned to one part of a network will not function in another part of the network. A hierarchical structure, standardized by CIDR and overseen by the Internet Assigned Numbers Authority (IANA) and its Regional Internet Registries (RIRs), manages the assignment of Internet address worldwide. Each RIR maintains a publically searchable WHOIS database that provides information about IP address assignments; information from these databases plays a central role in numerous tools which attempt to locate IP addresses geographically.
Some private IP address space has been allocated via RFC 1918. This means the addresses are available for any use by anyone and therefore the same RFC 1918 IP addresses can be reused. However they are not routable on the Internet. They are used extensively due to the shortage of registerable addresses. Network address translation (NAT) is required to connect those networks to the Internet.
While a number of measures have been taken to conserve the limited existing IPv4 address space (such as the use of NAT and Private Addressing), the number of 32-bit IP addresses is not sufficient to accommodate the long-term growth of the Internet. For this reason, the plan is that the Internet 128-bit IPv6 addressing scheme will be adopted over the next 5 to 15 years.
IP version 5
What would be considered IPv5 existed only as an experimental non-IP real time streaming protocol called ST2, described in RFC 1819. In keeping with standard UNIX release conventions, all odd-numbered versions are considered experimental, and this version was never intended to be implemented; the protocol was not abandoned. RSVP has replaced it to some degree.
IP version 6
In IPv6, the new (but not yet widely deployed) standard protocol for the Internet, addresses are 128 bits wide, which, even with generous assignment of netblocks, should suffice for the foreseeable future. In theory, there would be exactly 2128, or about 3.403 × 1038 unique host interface addresses. If the earth were made entirely out of 1 cubic millimeter grains of sand, then you could give a unique address to each grain in 300 million planets the size of the earth. This large address space will be sparsely populated, which makes it possible to again encode more routing information into the addresses themselves.
A version 6 address is written as eight 4-digit hexadecimal numbers separated by colons. For readability, addresses may be shortened in two ways. Within each colon-delimited section, leading zeroes may be truncated. Secondly, one string of zeroes (and only one) may be replaced with two colons (::). For example, all of the following addresses are equivalent:
Global unicast IPv6 addresses are constructed as two parts: a 64-bit routing part followed by a 64-bit host identifier.
Netblocks are specified as in the modern alternative for IPv4: network number, followed by a slash, and the number of relevant bits of the network number (in decimal). Example: 12AB::CD30:0:0:0:0/60 includes all addresses starting with 12AB00000000CD3.
IPv6 has many improvements over IPv4 other than just bigger address space, including autorenumbering and mandatory support for IPsec.
Further reading: Internet RFCs including RFC 791, RFC 1519 (IPv4 addresses), and RFC 2373 (IPv6 addresses).