Open In App

What is an IP Address?

Last Updated : 17 Dec, 2024
Suggest changes
Share
Like Article
Like
Report

Imagine every device on the internet as a house. For you to send a letter to a friend living in one of these houses, you need their home address. In the digital world, this home address is what we call an IP (Internet Protocol) Address. It's a unique string of numbers separated by periods (IPv4) or colons (IPv6) that identifies each device connected to the internet or a local network.

Here's the definition:

What is an IP Address?

An IP address, or Internet Protocol address, is a unique string of numbers assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as an identifier that allows devices to send and receive data over the network, ensuring that this data reaches the correct destination.

Types of IP Address

IP addresses can be classified in several ways based on their structure, purpose, and the type of network they are used in. Here's a breakdown of the different classifications of IP addresses:

1. Based on Addressing Scheme (IPv4 vs. IPv6)

IPv4:

This is the most common form of IP Address. It consists of four sets of numbers separated by dots. For example, 192.158.1.38. Each set of numbers can range from 0 to 255. This format can support over 4 billion unique addresses. Here's how the structure is broken down:

  • Four Octets: Each octet represents eight bits, or a byte, and can take a value from 0 to 255. This range is derived from the possible combinations of eight bits (2^8 = 256 combinations).
  • Example of IPv4 Address: 192.168.1.1
    • 192 is the first octet
    • 168 is the second octet
    • 1 is the third octet
    • 1 is the fourth octet

Each part of the IP address can indicate various aspects of the network configuration, from the network itself to the specific device within that network. In most cases, the network part of the address is represented by the first one to three octets, while the remaining section identifies the host (device).

IPv4-address-format
IPv4 Address Format

IPv6:

IPv6 addresses were created to deal with the shortage of IPv4 addresses. They use 128 bits instead of 32, offering a vastly greater number of possible addresses. These addresses are expressed as eight groups of four hexadecimal digits, each group representing 16 bits. The groups are separated by colons.

  • Example of IPv6 Address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
    • Each group (like 2001, 0db8, 85a3, etc.) represents a 16-bit block of the address.

For detailed information, refer to this article - IPv4 vs. IPv6

2. Based on Usage (Public vs. Private)

Public IP Addresses

A Public IP address is assigned to every device that directly accesses the internet. This address is unique across the entire internet. Here are the key characteristics and uses of public IP addresses:

  • Uniqueness: Each public IP address is globally unique. No two devices on the internet can have the same public IP address at the same time.
  • Accessibility: Devices with a public IP address can be accessed directly from anywhere on the internet, assuming no firewall or security settings block the access.
  • Assigned by ISPs: Public IP addresses are assigned by Internet Service Providers (ISPs). When you connect to the internet through an ISP, your device or router receives a public IP address.
  • Types: Public IP addresses can be static (permanently assigned to a device) or dynamic (temporarily assigned and can change over time).

Example Use: Public IP addresses are typically used for servers hosting websites, email servers, or any device that needs to be accessible from the internet. For instance, if you host a website on your own server at home, your ISP must assign a public IP address to your server so users around the world can access your site.

Private IP Addresses

Private IP addresses are used within private networks (such as home networks, office networks, etc.) and are not routable on the internet. This means that devices with private IP addresses cannot directly communicate with devices on the internet without a translating mechanism like a router performing Network Address Translation (NAT). Key features include:

  • Not globally unique: Private IP addresses are only required to be unique within their own network. Different private networks can use the same range of IP addresses without conflict.
  • Local communication: These addresses are used for communication between devices within the same network. They cannot be used to communicate directly with devices on the internet.
  • Defined ranges: The Internet Assigned Numbers Authority (IANA) has reserved specific IP address ranges for private use:
    • IPv4: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, 192.168.0.0 to 192.168.255.255
    • IPv6: Addresses starting with FD or FC

Example Use: In a typical home network, the router assigns private IP addresses to each device (like smartphones, laptops, smart TVs) from the reserved ranges. These devices use their private IPs to communicate with each other and with the router. The router uses NAT to allow these devices to access the internet using its public IP address.

Private-_-Public-Address

3. Based on Assignment Method (Static vs. Dynamic)

Static IP Addresses:

  • These are permanently assigned to a device, typically important for servers or devices that need a constant address.
  • Reliable for network services that require regular access such as websites, remote management.

Dynamic IP Addresses:

  • Temporarily assigned from a pool of available addresses by the Dynamic Host Configuration Protocol (DHCP).
  • Cost-effective and efficient for providers, perfect for consumer devices that do not require permanent addresses.

For detailed information, refer to this article - Static vs. Dynamic IP Address

How Do IP Addresses Work?

Here's how IP addresses work:

1. Unique Identification

Every device connected to a network, such as computers, smartphones, and servers, is assigned an IP address. This address is used to identify the device on the network, similar to how a home address identifies a specific location.

2. Communication Protocol

The Internet Protocol (IP), part of the broader suite of internet protocols, uses these addresses to facilitate the routing of data packets between devices. Each piece of data sent over a network is broken into smaller units called packets. Each packet includes both the sender's and the recipient's IP addresses.

3. Data Routing

When a device sends information to another device over the internet:

  • The data is divided into packets.
  • Each packet contains the IP address of the device it is destined for.
  • Routers within the network read the destination IP address on each packet and determine the best path for the packet to travel. Routers communicate with each other to update and maintain records of the fastest, most efficient routes for data.

4. Local Area Networks (LAN) and Wide Area Networks (WAN)

  • LAN: On local networks, IP addresses can be assigned manually by an administrator (static IP) or automatically by a DHCP server. Devices within the same network communicate directly using their local IP addresses.
  • WAN: For devices on different networks, the data must travel through multiple routers across the internet. Each router makes independent decisions about the best route for the packets based on the destination IP address.

5. Network Address Translation (NAT)

Most devices on a home or small business network share a single public IP address when accessing the internet, even though each device has its own private IP address within the local network. NAT is a process where multiple local IP addresses are mapped to a single public IP address. This conserves IP addresses and adds a layer of security by hiding internal IP addresses from the external network.

Real World Scenario: Sending an Email from New York to Tokyo

Let's explore how IP addresses work through a real-world example that involves sending an email from one person to another across the globe:

Step 1: Assigning IP Addresses

  • Alice in New York wants to send an email to Bob in Tokyo.
  • Alice’s laptop has a private IP address (e.g., 192.168.1.5) assigned by her router at home.
  • Bob's computer in Tokyo has a private IP address (e.g., 192.168.2.4) assigned by his router at his office.

Step 2: Connection to the Internet

  • Both Alice and Bob’s routers have public IP addresses assigned by their Internet Service Providers (ISPs). These public IP addresses are what the devices use to send and receive data over the internet.

Step 3: Sending the Email

  • Alice writes her email and hits send.
  • Her email service (e.g., Gmail) packages the message and its attachments into data packets. Each packet includes the source IP (Alice’s router's public IP) and the destination IP (Bob’s email server's public IP).

Step 4: Routing the Packets

  • The data packets leave Alice’s laptop and travel to her home router. The router notes that the destination IP is outside the local network.
  • The router sends the packets to Alice's ISP. The ISP uses routers that examine the destination IP address of the packets and determine the best route to send them toward their destination.
  • The packets may pass through several routers around the world — in data centers in countries like Canada, Germany, and finally Japan. Each router along the way reads the destination IP and forwards the packets accordingly.

Step 5: Reaching Bob

  • The packets arrive at Bob's email server's ISP in Tokyo and are then forwarded to the server.
  • Bob's email server reassembles the packets into the original email message.

Step 6: Bob Accesses the Email

  • Bob’s computer requests the email from his server using his local network IP.
  • The server sends the email to Bob's computer, allowing him to read the message Alice sent.

Additional Details

  • NAT (Network Address Translation): Both Alice and Bob's routers perform NAT, translating the private IP addresses to and from the public IP addresses when interfacing with the internet. This process is crucial for keeping the number of public IPs needed lower and adds a layer of security by masking internal network structures.
  • Dynamic IP Addressing: If either Alice or Bob’s public IP is dynamic, it might change if they restart their routers. This doesn’t affect their ongoing activities much because the DNS (Domain Name System) helps update the mapping of domain names (like gmail.com) to the current IP addresses.

This example illustrates the fundamental role of IP addresses and the complex network of routers involved in even the simplest internet activities like sending an email. Each part of the process depends on the IP address to ensure that data finds its way correctly from sender to receiver, no matter where they are in the world.

---> Other Important Things to Know About IP Address

Classes of IPv4 Address

There are around 4.3 billion IPv4 addresses and managing all those addresses without any classification is next to impossible.

Let’s understand it with a simple example. If you have to find a word from a language dictionary, how long will it take just think about it. Usually you will take less than 5 minutes to find that word. You are able to do this because words in the dictionary are organized in alphabetical order. If you have to find out the same word from a dictionary that doesn’t use any sequence or order to organize the words, it will take an eternity to find the word. If a dictionary with one billion words without order can be so disastrous, then you can imagine the pain behind finding an address from 4.3 billion addresses.

For easier management and assignment IP addresses are organized in numeric order and divided into the following 5 classes:

IP addresses are also classified into different classes based on their range and intended use:

  • Class A (1.0.0.0 to 127.255.255.255):
    • Used for very large networks (like multinational companies).
    • Supports up to 16 million hosts per network.
    • Example: 10.0.0.1 (Private IP in this class).
  • Class B (128.0.0.0 to 191.255.255.255):
    • Used for medium-sized networks, such as large organizations.
    • Supports up to 65,000 hosts per network.
    • Example: 172.16.0.1 (Private IP in this class).
  • Class C (192.0.0.0 to 223.255.255.255):
    • Used for smaller networks, like small businesses or home networks.
    • Supports up to 254 hosts per network.
    • Example: 192.168.1.1 (Private IP in this class).
  • Class D (224.0.0.0 to 239.255.255.255):
    • Reserved for multicast groups (used to send data to multiple devices at once).
    • Not used for traditional devices or networks.
  • Class E (240.0.0.0 to 255.255.255.255):
    • Reserved for experimental purposes and future use.
IP ClassAddress RangeMaximum number of networks
Class A1-126126 (27-2)
Class B128-19116384
Class C192-2232097152
Class D224-239Reserve for multitasking
Class E240-254Reserved for Research and development

Special IP Addresses

There are also some special-purpose IP addresses that don't follow the usual structure:

  • Loopback Address:
    • The loopback address 127.0.0.1 is used to test network connectivity within the same device (i.e., sending data to yourself).
    • Often called "localhost."
  • Broadcast Address:
    • The broadcast address allows data to be sent to all devices in a network. For a typical network with the IP range 192.168.1.0/24, the broadcast address would be 192.168.1.255.
  • Multicast Address:
    • Used to send data to a group of devices (multicast). For example, 233.0.0.1 is a multicast address.

How to Look Up IP Addresses?

In Windows

  1. Open the Command Prompt.
  2. Type ipconfig and press Enter.
  3. Look for your IP under your network connection.

On Mac

  1. Open System Preferences > Network.
  2. Select your active connection.
  3. You’ll see your IP address in the connection details.

On iPhone

  1. Go to Settings > Wi-Fi.
  2. Tap the (i) icon next to your network.
  3. Find your IP under "IP Address."

IP Address Security Threats

IP addresses are essential for connecting devices on the internet, but they also come with various security risks. Understanding these threats can help you protect your network and personal information more effectively. Here are some common IP address security threats:

  • IP Spoofing: Hackers use this technique to bypass security measures, launch attacks, or gain unauthorized access to systems. By pretending to be a trusted IP address, attackers can trick networks into granting them access or allowing malicious activities.
  • Distributed Denial of Service (DDoS) Attacks: This happens by overloading a website or service with too much traffic. Many hacked devices send lots of requests to a target all at once, making the website or service crash. This means real users can’t access it which can cause crashing of site, businesses to lose money and many more.
  • Man-in-the-Middle (MitM) Attacks: Eavesdropping or altering messages between two people without letting them know is MitM attack. Attackers intercept the communication between two parties and can steal sensitive information like passwords or credit card details by targeting the IP addresses involved.
  • Port Scanning: It is a technique used to identify open ports and services running on a device's IP address. Hackers use port scanners to find vulnerabilities in network services, which they can then exploit to gain unauthorized access or deploy malware. Regularly monitoring and securing open ports is essential to prevent such attacks.

How to Protect and Hide Your IP Address?

  • VPN (Virtual Private Network): A VPN hides your IP by masking it with the VPN server’s IP, giving you privacy. Your internet traffic passes through the VPN server, masking your real IP address with the server’s IP. This makes it difficult for others to track your online activities or identify your location.
  • Proxy Server: Routes your data through a different server, hiding your real IP. When you use a proxy, your requests go through the proxy server, which hides your real IP address by replacing it with its own.
  • Tor Browser: Encrypts and bounces your data around multiple servers for anonymity. This multi-layered routing makes it extremely difficult to trace your IP address or monitor your online activities.
  • Enable Your Firewall: A firewall is a security system that monitors and controls incoming and outgoing network traffic. It can block unauthorized access to your device, making it harder for attackers to target your IP address.

Conclusion

IP addresses are essential for connecting devices over the internet. While they help identify and communicate with other devices, it’s important to protect your IP to keep your information safe and private. IP addresses also come with challenges such as privacy risks and vulnerability to cyberattacks. Understanding both the benefits and drawbacks of IP addresses helps us appreciate their importance in the digital world while enabling the need for effective protection measures.


Next Article

Similar Reads