IP address
An IP address serves two principal functions. It identifies the host, or more specifically its network interface, and it provides the location of the host in the network, and thus the capability of establishing a path to that host. Its role has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A route indicates how to get there."
The header of each IP packet contains the IP address of the sending host, and that of the destination host.
IPv6 address
Such an address is generated using two hash functions that take several inputs.
The first uses a public key and a random modifier; the latter being incremented repeatedly until a specific amount of zero bits of the resulting hash is acquired.
The second hash function takes the network prefix and the previous hash value.
The least significant 64 bits of the second hash result is appended to the 64-bit network prefix to form a 128-bit address.