IPv4

IPv4 (Internet Protocol version 4), prior to the development of IPv6 simply IP, the fourth version of the Internet Protocol ( IP). It was the first version of the Internet Protocol, which was distributed and used worldwide, and is an important technical foundation of the Internet. It is defined in RFC 791 in 1981.

Address format

IPv4 uses 32 -bit addresses, so a maximum of 4,294,967,296 unique addresses are possible. IPv4 addresses are usually written in decimal in four blocks, for example 207 142 131 235. The block can be summarized 8 bits; thus results for each block a range of values ​​from 0 to 255 in the further IPv6 128 -bit addresses are used.

An IP address is divided in part into a network part and a host ( address ). Computers are on the same IP network when the network part of their address is the same - this is a requirement that these computers can communicate with each other directly, eg via a hub, a switch or a cross link cable. In the same network no host address may be assigned twice.

For communication between different networks requires a router. The address part is assigned by the administrator responsible for each participating device differently. The network address is assigned by the owner or designer of the network. On the Internet, the IANA ( Internet Assigned Numbers Authority ) is responsible for the allocation of network addresses.

The exact breakdown between the network part and address part is determined by the subnet mask (for example 255.255.255.0). In CIDR notation, this is written as 192.168.0.23/24, where the " 24 " means that the first 24 bits of the subnet mask are equal to 1. The bits of the subnet mask ( in binary notation ) are "1", set the number of the IP address belonging to the network share.

Example:

Net classes

There used to be firmly prescribed classifications for network classes with a fixed length. Since this classification is very inflexible, which is Classless since 1993, especially in the WAN mainly inter-domain routing procedures carried out which bit variable subnet masks allows. Many network-capable operating systems determine the default netmask based on the old classification, there is still worked in the local network mainly with the classes.

The maximum number of marks host addresses in a network is

Two host addresses always fall off - the first address (for example 192.168.0.0 ) identifies the network itself, the last address (eg 192.168.0.255 ) is for the broadcast (all nodes are addressed ) reserved.

Special network addresses

Some classes of network addresses are reserved for special purposes. See RFC 6890:

Local / private network addresses

Examples

Example: ( / 24 (formerly Class C network ) )

Example: ( Classless )

Subnetting

Packet length

An IP packet consists of a header and the actual data. The data section generally contains an additional protocol usually TCP, UDP, or ICMP. The maximum length of an IP packet is 65535 bytes ( 216-1 ), the maximum data length 65515 bytes ( packet length - minimum header length of 20 bytes). Normally, the transmitter restricts the packet length to that of the underlying medium. When Ethernet is the so-called MTU (Maximum Transmission Unit) 1500 bytes, as an Ethernet data block can be up to 1518 bytes long and 18 bytes are occupied by the Ethernet itself. For IP (header and data) so are only 1500 bytes are available. Therefore, the length of IP packets is often set at 1500 bytes.

Routing

IPv4 does not distinguish between terminals (hosts) and transmission devices ( routers). Each computer, and each device may be the end point and the router at the same time. A router connects multiple networks while. The totality of all networks connected by routers is the Internet (see also Internetworking ).

IPv4 is suitable for both LANs and WANs. A package can go through different networks from transmitter to receiver, the networks are connected by routers. Using routing tables that maintains each router individually, the network part is assigned to a target network. The entries in the routing table can be carried out statically or dynamically through routing protocols. The routing protocols may thereby even use IP.

Overloading a network or other failure, a router must also discard packets. Packets from the same transmitter can be " routed " alternatively in case of failure of a network. Each packet is individually " routed ", which leads to increased reliability.

When routing over IP can therefore

  • Lost individual packages,
  • Packets arrive at the receiver twice,
  • Packets take different routes,
  • Fragmented packets arrive at the receiver.

TCP is mounted on the IP (i.e., the data of each IP packet containing a TCP packet is divided into the TCP header and data ), it is next to the canceling of the restriction length and the packet loss is corrected by repeating. Duplicate packets are detected and discarded. The combination of TCP with IP represents represents a reliable bi-directional connection of a data stream

ICMP

IP is closely linked to the Internet Control Message Protocol (ICMP), which is used for troubleshooting and control. ICMP is based on IP, it is an ICMP packet is stored in the data portion of an IP packet. An IP implementation always contains an ICMP implementation. It is important, for example, the ICMP source quench message that informs the sender about the discarding packets due to congestion of a router. Since each IP packet contains the source address, information can be transmitted back to the sender. This may reduce the packet transmission rate and thus minimizing or avoiding the need for further discarding after a " Source Quench".

ICMP can be used with the Do not Fragment bit of the IP packet and used to determine the maximum packet size of a transmission path MTU ( PMTU called Path Maximum Transmission Unit ). This is the MTU of that network with the smallest MTU of all the networks passed. This eliminates the need for fragmentation, if the transmitter generates only packets with the maximum size of the PMTU.

IPv4 to Ethernet

IPv4 can be based on many different media, for example on serial interfaces ( PPP or SLIP), satellite links, etc. In the LAN area is now almost always used in Ethernet. Ethernet maintains its own 48-bit addresses. When IP is transmitted via Ethernet, a 14 ( or VLAN 18) -byte Ethernet header is transmitted before the IP headers. After the data is followed by a 32-bit CRC checksum. Be expanded addition to the maximum packet length of 1522 (or 1518) bytes Ethernet can not transmit packets smaller than 64 bytes, so too short IP packets ( data length less than 46 bytes ) with zero bytes ( called padding). The length of the IP header then provides information about the actual packet size.

In Ethernet every network card has its own manufacturer-specific 48 -bit address, in addition there is an Ethernet broadcast address. A station must have the Ethernet address of the destination network card to know before an IP packet can be sent. These ARP (Address Resolution Protocol) is used. Each computer maintains an ARP cache, where it stores it known assignments from Ethernet card addresses. He learns unknown addresses via ARP means of a request ( ARP request) via an Ethernet broadcast ( message to all recipients ) who answered the associated receiver ( ARP Reply).

Header Format

The IPv4 header is normally 20 bytes long. For transmission based on Ethernet it follows the Ethernet type field is set for IP packets on 080016. On other transmission media and protocols of the header can also be the first entry.

IPv4 provides various, mostly unused options that can extend the header to 60 bytes (in 4 - byte increments ).

A special importance is the Type of Service field in modern implementations. Originally, this field was used in the mediation of a data packet as a decision aid for routers involved in the choice of transmission parameters. In modern implementations of this field is used in connection with congestion avoidance.

Fragmentation

On the way from the sender to the receiver, it may happen that a datagram must traverse a network that supports only small datagrams. Each datagram from the transmitter an identifier ( Identification). Provides a router firmly on the path to the goal that the datagram for the next subnet is too large, it may split it into two fragments. The following steps are necessary:

  • Dividing the user data to a 64- bit boundary (the second fragment will contain not necessarily a multiple of 64 -bit data )
  • Copy the header data of the original datagram into the new header
  • Setting the " more- fragments" flags in the first fragment
  • In the second fragment, the more- fragments flag receives the value of the original datagram because the original datagram may have been a fragment already.
  • Re- setting the length fields in the headers
  • The second fragment fragment offset contains the sum of the fragment offset of the original datagram and number ( payload ) bytes in the first fragment.

The fragmentation in n> 2 fragments works accordingly.

To assemble a package again, the receiver combines all the fragments that have the same identifier ( ID ), the same sender, recipient, and the same protocol. In this case it detects the first fragment because the fragment offset is set to 0. The respectively next fragment he also recognizes the fragment offset and the last fragment because more fragment has the value 0.

Higher-level protocols

IPv4 is a routed protocol ( layer 2 in the TCP / IP Reference Model - Layer 3 in the ISO / OSI model). In IPv4 other protocols are placed, that is, in the data portion of the IP packet header, data, and any trailer of the upper logs are included ( protocol stack ). A list of registered protocols can be found in UNIX-like operating systems in the file " / etc / protocols ".

In addition to the mentioned ICMP TCP is used, the TCP / IP have been together with the IP name. TCP is a connection-oriented protocol that provides a byte-oriented, bi-directional, reliable data stream. It is used in the WAN area convenient for all types of data and information transfers.

UDP, a packet-oriented protocol, also based on IP. It is a simple protocol that the packet IP properties of substantially retains ( connectionless, unreliable, doubling, etc.). TCP and UDP IP add a checksum of the data ( the checksum in the IP header checks only the header data ) and as source and destination port should each have a 16- bit number. These form the so-called endpoints together with the respective source and destination address in the IP packet. Processes communicate via these endpoints. TCP establishes a connection between not IP addresses, but between two endpoints.

The other protocols all set to either TCP or UDP. An important protocol is the Domain Name System DNS that allows a conversion of computer names to IP addresses. It transmits information usually via UDP, but the balance between two DNS servers can also use TCP.

The ports are divided into:

  • Privileged ports ( 1-1023 ); these may be used only by the root user.
  • Registered ports ( 1024-49151 ); the registration is subject to the IANA. A list can be found on Unix systems in the file " / etc / services".
  • Not registered ports ( 49152-65535 )

Past and future

IPv4 has long survived virtually unchanged. From 1983, the IP protocol family was taken as the only protocol family for the Arpanet, which later became the Internet. At that time, only a few hundred computers were connected to the network. 1989, the limit was exceeded by 100,000 computers, and / s upgraded in the same year the backbone to 1.5 Mbps. At the beginning of the 1990s it had become clear that the IP addresses would soon close. This led first to the development of a design for a standard with the version number 7 (TP / IX), but was then discarded in favor of IPv6. TP / IX should thereby support a 64 -bit address range. The version number 5 was used in 1995 for the Internet Stream Protocol Version 2 (ST2 ), which was not planned as a successor to IPv4, but as simultaneously usable, optimized for streaming protocol. Meanwhile, however, the project is set. Some properties, such as fragmentation are no longer needed, because they are too complex for today's fast networks. Path Maximum Transmission Unit Discovery solves this problem. IPv4 still seems the protocol commonly used to remain so in the near future on the internet. Finally, IP has displaced the competing LAN protocols, such as DECnet. NetWare, AppleTalk, and NetBIOS were spawned as new versions that are based on IP.

On 3 February 2011 the IANA missed the last IPv4 addresses to the Regional Internet Registries. On 15 April 2011 APNIC allocated to the last freely assignable addresses for the Southeast Asia region. From this point on, all APNIC members only entitled to a single allocation of IPv4 address space to the minimum allocation size.

415389
de