Overview of IPv4
Definition
Internet Protocol version 4 (IPv4) is the core of the TCP/IP protocol suite and works at the Internet layer in the TCP/IP model. This layer corresponds to the network layer in the OSI model. At the IP layer, information is divided into data units, and address and control information is added to allow datagrams to be routed.
IP provides unreliable and connectionless data transmission services. Unreliable transmission means that IP does not ensure that IP datagrams successfully arrive at the destination. IP only provides best effort delivery. Once an error occurs, for example, a router exhausts the buffer, IP discards the excess datagrams and sends ICMP messages to the source. The upper layer protocols, such as TCP, are responsible for resolving reliability issues. Connectionless transmission means that IP does not maintain status information for subsequent datagrams. Every datagram is processed independently, meaning that IP datagrams may not be received in the same order they are sent. If a source sends two consecutive datagrams A and B in sequence to the same destination, each datagram is possibly routed over a different path to the destination, and therefore B may arrive ahead of A.
The network ID uniquely identifies a network segment or the summarized network segment of multiple network segments. The IP address and subnet mask are converted to be binary numbers. The network ID is obtained after the bit-by-bit AND operation is performed.
The host ID uniquely identifies a specific device on a network segment. The IP address and subnet mask are converted to be binary numbers. Taking the reverse of the subnet mask, the host ID is obtained after the bit-by-bit AND operation is performed.
If multiple devices on the same network segment have the same network ID, they belong to the same network, regardless of their physical locations.
Purpose
IPv4 shields link layer protocol differences and provides a uniform standard for transmission at the network layer.