User:Dandorid/Sandbox/IPv4 address

Talk:IPv4 address edit

 Computing NA‑class
 This page is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
NAThis page does not require a rating on Wikipedia's content assessment scale.
 Internet NA‑class
 This page is within the scope of WikiProject Internet, a collaborative effort to improve the coverage of the Internet on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
NAThis page does not require a rating on Wikipedia's content assessment scale.

IPv4 address edit

 
Decomposition of the quad-dotted IPv4 address representation to its binary value

An Internet Protocol Version 4 address (IPv4 address) is a numerical label that is used to identify a network interface of a computer or a network node participating in an IPv4 computer network.

An IP address serves the purpose of identifying an individual network interface of a host, locating it on the network, and thus permitting the routing of IP packets between hosts. For routing, IP addresses are present in fields of the packet header where they indicate source and destination of the packet.

IPv4 uses 32-bit addresses which defines the address space to have a total of 232 or 4294967296 addresses. Most of these are public addresses, allowing them to be used for routing accross the Internet. IPv4 reserves 3 special address blocks for private networks[1] (~18 million addresses) and one special address block for multicast addresses[2] (~270 million addresses).

Representation edit

IPv4 addresses may be represented in any notation expressing a 32-bit integer value. They are most often written in the dot-decimal notation, which consists of four octets of the address expressed individually in decimal numbers and separated by periods.

For example, an IP address with the 32-bit decimal value 3221226219, which in hexadecimal format is 0xC00002EB, is represented by the quad-dotted 192.0.2.235 (0xC0 = 192, 0x00 = 0, 0x02 = 2, 0xEB = 235). This value may also be expressed in dotted hex format as 0xC0.0x00.0x02.0xEB, or with octal byte values as 0300.0000.0002.0353, but this is seen less often.

CIDR notation edit

The Classless Inter-Domain Routing (CIDR) notation[3] combines the address with its routing prefix in a compact format, in which the address is followed by a slash character (/) and the count of consecutive 1 bits in the routing prefix (subnet mask).

For example, instead of 192.0.2.235/255.255.255.0, the shorter 192.0.2.235/24 is used, indicating that there are 24 consecutive 1 bits in the routing prefix.

Address space allocation edit

The hierarchical structure created by CIDR is managed by the Internet Assigned Numbers Authority (IANA) and the regional Internet registries (RIRs). Each RIR maintains a publicly searchable WHOIS database that provides information about IP address assignments.

Special addresses edit

The Internet Engineering Task Force (IETF) and the Internet Assigned Numbers Authority (IANA) have restricted from general use various reserved IP addresses for special purposes. Some are used for maintenance of routing tables, for multicast traffic, operation under failure modes, or to provide addressing space for public, unrestricted uses on private networks.

Special address blocks
CIDR address block First address Last address Number of addresses Scope Description
0.0.0.0/8 0.0.0.0 0.255.255.255 232-8 = 224 = 16777216 Software Current network[4] (only valid as source address).
10.0.0.0/8 10.0.0.0 10.255.255.255 16777216 Private network Used for local communications within a private network.[1]
100.64.0.0/10 100.64.0.0 100.127.255.255 4194304 Private network Shared address space[5] for communications between a service provider and its subscribers when using a carrier-grade NAT.
127.0.0.0/8 127.0.0.0 127.255.255.255 16777216 Host Used for loopback addresses to the local host.[4]
169.254.0.0/16 169.254.0.0 169.254.255.255 65536 Subnet Used for link-local addresses[6] between two hosts on a single link when no IP address is otherwise specified, such as would have normally been retrieved from a DHCP server.
172.16.0.0/12 172.16.0.0 172.31.255.255 1048576 Private network Used for local communications within a private network.[1]
192.0.0.0/24 192.0.0.0 192.0.0.255 256 Private network IETF Protocol Assignments.[4]
192.0.2.0/24 192.0.2.0 192.0.2.255 256 Documentation Assigned as TEST-NET-1, documentation and examples.[7]
192.88.99.0/24 192.88.99.0 192.88.99.255 256 Internet Reserved.[8] Formerly used for IPv6 to IPv4 relay[9] (included IPv6 address block 2002::/16).
192.168.0.0/16 192.168.0.0 192.168.255.255 65536 Private network Used for local communications within a private network.[1]
198.18.0.0/15 198.18.0.0 198.19.255.255 131072 Private network Used for benchmark testing of inter-network communications between two separate subnets.[10]
198.51.100.0/24 198.51.100.0 198.51.100.255 256 Documentation Assigned as TEST-NET-2, documentation and examples.[7]
203.0.113.0/24 203.0.113.0 203.0.113.255 256 Documentation Assigned as TEST-NET-3, documentation and examples.[7]
224.0.0.0/4 224.0.0.0 239.255.255.255 268435456 Internet In use for IP multicast.[2] (Former Class D network).
240.0.0.0/4 240.0.0.0 255.255.255.254 268435456 Internet Reserved for future use.[11] (Former Class E network).
255.255.255.255/32 255.255.255.255 255.255.255.255 1 Subnet Reserved for the "limited broadcast" destination address.[4][12]

Private networks edit

Of the approximately four billion addresses defined in IPv4, three ranges are reserved for use in private networks, where they are commonly subnetted.

Name CIDR address block First address Last address Number of addresses Classful description
24-bit block 10.0.0.0/8 10.0.0.0 10.255.255.255 16777216 Single Class A.
20-bit block 172.16.0.0/12 172.16.0.0 172.31.255.255 1048576 Contiguous range of 16 Class B blocks.
16-bit block 192.168.0.0/16 192.168.0.0 192.168.255.255 65536 Contiguous range of 256 Class C blocks.

Packets with addresses in these ranges are not routable in the public Internet, because they are ignored by all public routers. Therefore, private hosts cannot directly communicate with public networks, but require network address translation (NAT) at a routing gateway for this purpose. This also means that two private networks, e.g., two branch offices, cannot directly interoperate via the public Internet. The two networks can be bridged across the Internet, however, via a virtual private network (VPN) or an IP tunnel, which encapsulate the packet in a protocol layer during transmission across the public network. Additionally, encapsulated packets may be encrypted for the transmission across public networks to secure the data.

Link-local addressing edit

The address block 169.254.0.0/16 is reserved for link-local addressing.[6] These addresses are only valid on links (such as a local network segment or point-to-point connection) connected to a host. These addresses are not routable. Like private addresses, these addresses cannot be the source or destination of packets traversing the internet. These addresses are primarily used for address autoconfiguration when a host cannot obtain an IP address from a DHCP server or other internal configuration methods.

When the address block was reserved,[citation needed] no standards existed for address autoconfiguration. Microsoft created an implementation called Automatic Private IP Addressing (APIPA), which was deployed on millions of machines and became a de facto standard. Many years later, in May 2005, the IETF defined a formal standard for it.[6]

Loopback edit

The class A network 127.0.0.0 (classless network 127.0.0.0/8) is reserved for loopback. IP packets whose source addresses belong to this network should never appear outside a host. The modus operandi of this network expands upon that of a loopback interface:[citation needed]

  • IP packets whose source and destination addresses belong to the network (or subnetwork) of the same loopback interface are returned to that interface;
  • IP packets whose source and destination addresses belong to networks (or subnetworks) of different interfaces of the same host, one of them being a loopback interface, are forwarded regularly.

Shared address space edit

The block 100.64.0.0/10 is meant to be used by Internet Service Providers (or ISPs) that implement carrier-grade NAT, to connect their customer-premises equipment (CPE) to their core routers.

Addresses for documentation edit

Networks 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), and 203.0.113.0/24 (TEST-NET-3) have been reserved for use in documentation.[7] These addresses should not be assigned to hosts, as routing packets over the Internet with these networks as destination is actively discouraged.

Multicast addresses edit

Broadcast address edit

A broadcast address is a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. A message sent to a broadcast address may be received by all network-attached hosts.

Addresses ending in 0 or 255 edit

Networks with subnet masks of at least 24 bits, i.e. Class C networks in classful networking, and networks with CIDR suffixes /24 to /32 (255.255.255.0255.255.255.255) may not have an address ending in 0 or 255.

Classful addressing prescribed only three possible subnet masks: Class A, 255.0.0.0 or /8; Class B, 255.255.0.0 or /16; and Class C, 255.255.255.0 or /24. For example, in the subnet 198.51.100.0/255.255.255.0 (198.51.100.0/24) the identifier 198.51.100.0 commonly is used to refer to the entire subnet. To avoid ambiguity in representation, the address ending in the octet 0 is reserved.

A broadcast address is an address that allows information to be sent to all interfaces in a given subnet, rather than a specific machine. Generally, the broadcast address is found by obtaining the bit complement of the subnet mask and performing a bitwise OR operation with the network identifier. In other words, the broadcast address is the last address in the address range of the subnet. For example, the broadcast address for the network 198.51.100.0/24 is 198.51.100.255. For networks of size /24 or larger (/23, /22, etc.), the broadcast address always ends in 255.

However, this does not mean that every address ending in 0 or 255 cannot be used as a host address. For example, in the /16 subnet 192.168.0.0/255.255.0.0, which is equivalent to the address range 192.168.0.0192.168.255.255, the broadcast address is 192.168.255.255. One can use the following addresses for hosts, even though they end with 255: 192.168.1.255, 192.168.2.255, etc. Also, 192.168.0.0 is the network identifier and must not be assigned to an interface.[13]: 31  However, the addresses 192.168.1.0, 192.168.2.0, etc., may be assigned, despite ending with 0.

In the past, conflict between network addresses and broadcast addresses arose because some software used non-standard broadcast addresses with zeros instead of ones.[13]: 66 

In networks smaller than /24, broadcast addresses do not necessarily end with 255. For example, a CIDR subnet 203.0.113.16/28 has the broadcast address 203.0.113.31.

Default address selection edit

On hosts that have IPv4 addresses only, the source address for outgoing packets is determined by the routing table. On dual-stacked hosts, IPv6 addresses may be favored over IPv4 addresses,[14] when an IPv6 route exists to the destination host.

Address resolution edit

Hosts on the Internet are usually known by names, e.g., www.example.com, not primarily by their IP address, which is used for routing and network interface identification. The use of domain names requires translating, called resolving, them to addresses and vice versa. This is analogous to looking up a phone number in a phone book using the recipient's name.

The translation between addresses and domain names is performed by the Domain Name System (DNS), a hierarchical, distributed naming system which allows for subdelegation of name spaces to other DNS servers.

History edit

In the original design of IPv4,[15] an IP address was divided into two parts: the network identifier was the most significant (highest order) octet of the address, and the host identifier was the rest of the address. The latter was also called the rest field. This structure permitted a maximum of 256 network identifiers, which was quickly found to be inadequate.

To overcome this limit, the most-significant address octet was redefined in 1981[16] to create network classes, in a system which later became known as classful networking. The revised system defined five classes. Classes A, B, and C had different bit lengths for network identification. The rest of the address was used as previously to identify a host within a network, which meant that each network class had a different capacity for addressing hosts. Class D was defined for multicast addressing and Class E was reserved for future applications.

Starting around 1985,[citation needed] methods were devised to subdivide IP networks. One method that has proved flexible is the use of the variable-length subnet mask (VLSM).[17][18] In 1993, this system of classes was officially replaced[3] with Classless Inter-Domain Routing (CIDR), which expressed the number of bits (from the most significant) as, for instance, /24, and the class-based scheme was dubbed classful, by contrast. CIDR was designed to permit repartitioning of any address space so that smaller or larger blocks of addresses could be allocated to users.

See also edit

References edit

  1. ^ a b c d Y. Rekhter; B. Moskowitz; D. Karrenberg; G. J. de Groot; E. Lear (February 1996). Address Allocation for Private Internets. Network Working Group. doi:10.17487/RFC1918. BCP 5. RFC 1918. Updated by RFC 6761.
  2. ^ a b M. Cotton; L. Vegoda; D. Meyer (March 2010). IANA Guidelines for IPv4 Multicast Address Assignments. Internet Engineering Task Force. doi:10.17487/RFC5771. BCP 51. RFC 5771.
  3. ^ a b R. Hinden, ed. (September 1993). Applicability Statement for the Implementation of Classless Inter-Domain Routing (CIDR). Network Working Group. doi:10.17487/RFC1517. RFC 1517.
  4. ^ a b c d M. Cotton; L. Vegoda; R. Bonica; B. Haberman (April 2013). Special-Purpose IP Address Registries. Internet Engineering Task Force. doi:10.17487/RFC6890. BCP 153. RFC 6890. Updated by RFC 8190.
  5. ^ J. Weil; V. Kuarsingh; C. Donley; C. Liljenstolpe; M. Azinger (April 2012). IANA-Reserved IPv4 Prefix for Shared Address Space. Internet Engineering Task Force (IETF). doi:10.17487/RFC6598. ISSN 2070-1721. BCP 153. RFC 6598.
  6. ^ a b c S. Cheshire; B. Aboba; E. Guttman (May 2005). Dynamic Configuration of IPv4 Link-Local Addresses. Network Working Group. doi:10.17487/RFC3927. RFC 3927.
  7. ^ a b c d J. Arkko; M. Cotton; L. Vegoda (January 2010). IPv4 Address Blocks Reserved for Documentation. Internet Engineering Task Force. doi:10.17487/RFC5737. ISSN 2070-1721. RFC 5737.
  8. ^ O. Troan (May 2015). B. Carpenter (ed.). Deprecating the Anycast Prefix for 6to4 Relay Routers. Internet Engineering Task Force. doi:10.17487/RFC7526. BCP 196. RFC 7526.
  9. ^ C. Huitema (June 2001). An Anycast Prefix for 6to4 Relay Routers. Network Working Group. doi:10.17487/RFC3068. RFC 3068. Obsoleted by RFC 7526.
  10. ^ S. Bradner; J. McQuaid (March 1999). Benchmarking Methodology for Network Interconnect Devices. Network Working Group. doi:10.17487/RFC2544. RFC 2544. Updated by: RFC 6201 and RFC 6815.
  11. ^ J. Reynolds, ed. (January 2002). Assigned Numbers: RFC 1700 is Replaced by an On-line Database. Network Working Group. doi:10.17487/RFC3232. RFC 3232. Obsoletes RFC 1700.
  12. ^ Jeffrey Mogul (October 1984). BROADCASTING INTERNET DATAGRAMS. Network Working Group. doi:10.17487/RFC0919. RFC 919.
  13. ^ a b Robert Braden (October 1989). Requirements for Internet Hosts – Communication Layers. IETF. doi:10.17487/RFC1122. RFC 1122.
  14. ^ D. Thaler; R. Draves; A. Matsumoto; T. Chown (September 2012). D. Thaler (ed.). Default Address Selection for Internet Protocol Version 6 (IPv6). IETF. doi:10.17487/RFC6724. ISSN 2070-1721. RFC 6724.
  15. ^ J. Postel, ed. (January 1980). DOD STANDARD INTERNET PROTOCOL. doi:10.17487/RFC0760. RFC 760. Obsoleted by RFC 791 in September 1981.
  16. ^ J. Postel, ed. (September 1981). INTERNET PROTOCOL, DARPA INTERNET PROGRAM PROTOCOL SPECIFICATION. IETF. doi:10.17487/RFC0791. RFC 791. Updated by RFC 1349, RFC 2474, RFC 6864.
  17. ^ "Planning Classless Routing: TCP/IP". Technet.microsoft.com. 2003-03-28. Retrieved 2012-01-20.
  18. ^ "HP Networking: switches, routers, wired, wireless, HP TippingPoint Security" (PDF). 3com.com. Retrieved 2012-01-20.

External links edit