IP address: Network Layer
IP is a connectionless protocol (that operates at the network layer of the OSI model). IP enables communication between hosts by carrying data within packets. Each host is assigned an IP address which is used to ensure that traffic is sent to the correct destination, synonymous in many ways to a postal address that we place on a letter.
An IP address (in the case of v4) is built upon 32-bits, expressed in four numbers known as octets. Each octet is 8 bits (8bits == 1 byte)
- Network -> The network the IP address belongs to. (For example, the street name).
- Host -> The host identifier of the device for the network. (For example, the house number).
IP is part of an internet protocol suite, which also includes the Transmission Control Protocol. Together, these two are known as TCP/IP. The internet protocol suite governs rules for packetizing, addressing, transmitting, roouting, and receiving data over networks.
IP addressing is a logical means of assigning addresses to devices on a network. Each device connected to the internet requires a uniqque IP address.
An IP adddress has two parts: one part idenntifies the host such as a computer or other device,, and the other art identifeis the network it belongs to. TCP/IP uses a subnet mask to separate them.
IPv4 vs IPv6
IP addresses come in 2 versions, Ipv4 and IPv6.
| IP Version | Example |
|---|---|
| IPv4 | 127.255.255.255 |
| IPv6 | 2001:0db8:85a3:0000:0000:8a2e:032e:0370:7334 |
Internet Protocol version 4 (IPv4) defines an IP address as a 32-bit number.
However, because of the growth of the internet and the depletion of available IPv4 addresses, a new version of IP (IPv6), using 128 bits for the IP address, was standardized in 1998.
Public Address vs Private Address
A public IP address is an IP address that caan be accessed directly over the internet and is assigned to your neetwork router by your internet service provider (ISP). A public (or external) IP adddress helps you connect to the internet from inside your network, to outside your network.
A private IP address is an address your network router assigns to your device. Each device within the same network is assigned a unique private IP address (sometimes called a private network address). This is how device on the same intenal network talk to each otherr.
When a network is connecteed to the internet, it cannot use an IP address from the reserved private IP addresses. The following ranges are reserved for privaate IP addresses:
192.168.0.0 - 192.168.255.255 (65,536 IP addresses)
172.16.0.0 - 172.31.255.255 (1,048,576 IP addresses)
10.0.0.0 - 10.255.255.255 (16,777,216 IP addresses)
What is a loopback address?
A loopback address is an address that is built into the IP domain system in order to allow for a device to send and receive its own data packets. And it is a distinct reserved IP address range that:
- starts from 127.0.0.0
- ends at 127.255.255.255 and its used for various kind of analyss, usually for testing purposes and debugging.