Skip to main content

IP Addresses and Network Communication

Learning Objectives

By the end of this section, you will be able to:

  • Understand what an IP address is and why every device needs one
  • Distinguish between IPv4 and IPv6 addresses
  • Explain the concept of subnets and network ranges
  • Identify private vs public IP addresses
  • Use basic network tools to find and test IP addresses

Introduction: Every Device Needs an Address

Imagine trying to deliver a package without an address - impossible, right? Similarly, for computers to talk to each other over a network, each device needs a unique address called an IP address.

What is an IP Address?

IP stands for Internet Protocol - which is just a fancy way of saying "the rules for how devices communicate on networks."

An IP address is like a postal address for your computer. Just as your house has a unique address that helps the postman deliver mail, every device on a network has a unique IP address that helps data reach the right destination.

Real-World Analogy: Apartment Building Addresses

Think of an apartment building:

  • Building Address: "123 MG Road, Bangalore" (like a network address)
  • Apartment Number: "Flat 4B" (like a specific device address)
  • Complete Address: "Flat 4B, 123 MG Road, Bangalore" (like a complete IP address)

When someone wants to visit you, they need both parts - the building address to find the building, and the apartment number to find your specific flat.

Similarly, IP addresses have two parts:

  • Network part: Identifies which network the device is on
  • Host part: Identifies the specific device on that network

IPv4 Addresses: The Most Common Type

Most IP addresses you'll encounter look like this: 192.168.1.100

Let's break this down:

  • It has four numbers separated by dots
  • Each number can range from 0 to 255
  • This format is called IPv4 (Internet Protocol version 4)

Reading IPv4 Addresses

Using our apartment analogy:

  • 192.168.1 could be the "building address" (network part)
  • 100 could be the "apartment number" (host part)

So 192.168.1.100 means "device number 100 on network 192.168.1"

Common IPv4 Address Ranges You'll See

Home/Office Networks (Private Addresses):

  • 192.168.1.1 to 192.168.1.254 - Very common in home routers
  • 192.168.0.1 to 192.168.0.254 - Also common in home networks
  • 10.0.0.1 to 10.255.255.254 - Used in larger office networks
  • 172.16.0.1 to 172.31.255.254 - Used in corporate networks

Special Addresses:

  • 127.0.0.1 - "Localhost" - your computer talking to itself
  • 0.0.0.0 - Means "any address" or sometimes "no address assigned"
  • 255.255.255.255 - Broadcast address (sends to everyone)

Private vs Public IP Addresses

This is a crucial concept for understanding how the internet works!

Private IP Addresses

What they are: Addresses used inside your home or office network

Characteristics:

  • Cannot be reached directly from the internet
  • Can be reused in different networks
  • Free to use (no registration required)
  • Like internal phone extensions in an office

Examples:

  • Your laptop: 192.168.1.105
  • Your phone: 192.168.1.106
  • Office printer: 192.168.1.200

Real-world analogy: Like apartment numbers within a building. "Flat 2A" exists in many buildings, but each building has a unique street address.

Public IP Addresses

What they are: Addresses that can be reached from anywhere on the internet

Characteristics:

  • Must be globally unique
  • Assigned by internet service providers
  • Cost money to obtain
  • Like your building's street address

Example: Your office's public IP might be 203.123.45.67

How Private and Public Addresses Work Together

Here's a common scenario in your office:

  1. Your laptop has private IP: 192.168.1.105
  2. Office router has:
    • Private side: 192.168.1.1 (talking to office devices)
    • Public side: 203.123.45.67 (talking to internet)

When you browse a website:

  1. Your laptop (192.168.1.105) sends request to router (192.168.1.1)
  2. Router changes the request to come from 203.123.45.67 and sends to internet
  3. Website sends response back to 203.123.45.67
  4. Router receives response and forwards it to your laptop at 192.168.1.105

This process is called NAT (Network Address Translation) - like having a receptionist who takes messages for everyone in the office.

IPv6: The Future (But Still Used Today)

IPv4 addresses are running out! There are only about 4.3 billion possible IPv4 addresses, but we have more devices than that now.

IPv6 addresses look like this: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Key differences from IPv4:

  • Uses letters and numbers (0-9, A-F)
  • Separated by colons (:) instead of dots (.)
  • Much longer - allows for trillions of addresses
  • No need for private/public separation

Simplified IPv6 example: 2001:db8::1 (the :: means several zeros are skipped)

Subnets: Organizing Network Addresses

Think of subnets as organizing a large office building into departments.

What is a Subnet?

A subnet (subnetwork) is a smaller network within a larger network. It's like dividing a large office building into different floors or departments.

Subnet Mask: Defining Network Boundaries

A subnet mask tells us which part of an IP address is the network and which part identifies the specific device.

Common subnet mask: 255.255.255.0

What it means:

  • In IP 192.168.1.100 with subnet mask 255.255.255.0
  • Network part: 192.168.1 (first three numbers)
  • Host part: 100 (last number)
  • This means devices 192.168.1.1 through 192.168.1.254 are on the same network

Real-World Subnet Example

Company Office Building:

  • Floor 1 (HR Department): 192.168.1.x (x = 1 to 254)

    • HR Manager: 192.168.1.10
    • HR Assistant: 192.168.1.11
    • HR Printer: 192.168.1.100
  • Floor 2 (IT Department): 192.168.2.x

    • IT Manager: 192.168.2.10
    • Network Admin: 192.168.2.11
    • Server: 192.168.2.50
  • Floor 3 (Sales Department): 192.168.3.x

    • Sales Manager: 192.168.3.10
    • Sales Rep 1: 192.168.3.11
    • Sales Rep 2: 192.168.3.12

Hands-On: Finding Your IP Address

Let's learn some practical commands to find and work with IP addresses.

On Windows:

  1. Press Windows key + R
  2. Type cmd and press Enter
  3. In the black window, type: ipconfig
  4. Look for "IPv4 Address"

On Mac:

  1. Press Cmd + Space
  2. Type Terminal and press Enter
  3. Type: ifconfig | grep inet
  4. Look for your IP address

On Android Phone:

  1. Go to Settings > WiFi
  2. Tap on the connected network
  3. Look for "IP Address"

Basic Network Testing Tools

Ping: Testing if a Device is Reachable

What it does: Sends a small message to another device and waits for a response

How to use:

  1. Open command prompt (Windows) or Terminal (Mac)
  2. Type: ping 8.8.8.8 (Google's public DNS server)
  3. You should see responses like "Reply from 8.8.8.8"

Real-world use:

  • Test if internet is working: ping google.com
  • Test if printer is working: ping 192.168.1.200
  • Test if server is running: ping 192.168.1.50

What Ping Results Tell You:

Good result:

Reply from 8.8.8.8: bytes=32 time=20ms TTL=118
  • Device is reachable
  • Response took 20 milliseconds
  • Network is working fine

Bad result:

Request timed out
  • Device is not reachable
  • Could be offline, blocked, or network issue

Common IP Address Problems and Solutions

Problem 1: "Can't connect to printer"

Check: Can you ping the printer?

  • Try: ping 192.168.1.200 (printer's IP)
  • If no response, printer might be off or network cable unplugged

Problem 2: "Internet is slow"

Check: How long does ping take?

  • Try: ping google.com
  • Normal: 10-50ms
  • Slow: 100-500ms
  • Very slow: 1000ms+

Problem 3: "Can't access company server"

Check: Is the server running?

  • Try: ping 192.168.1.50 (server's IP)
  • If no response, server might be down or network issues

Problem 4: "My IP address keeps changing"

Explanation: Most devices use DHCP (Dynamic Host Configuration Protocol)

  • Router automatically assigns IP addresses
  • Addresses can change when device reconnects
  • Usually not a problem unless running a server

DHCP vs Static IP Addresses

DHCP (Automatic Assignment)

How it works: Router acts like a hotel reception desk, assigning room numbers automatically

Advantages:

  • No manual configuration needed
  • Prevents IP address conflicts
  • Easy to add new devices

Disadvantages:

  • IP addresses can change
  • Harder to remember device addresses

Best for: Regular computers, phones, laptops

Static IP Addresses (Manual Assignment)

How it works: You manually assign a specific IP address to a device

Advantages:

  • IP address never changes
  • Easy to remember (you choose it)
  • Required for servers and printers

Disadvantages:

  • Must manually configure each device
  • Risk of IP address conflicts if not managed properly

Best for: Servers, printers, network equipment

Practical Exercise: Network Discovery

Try this in your office or home:

  1. Find your IP address using the commands above
  2. Find your router's IP (usually your IP address with last number as 1)
    • If your IP is 192.168.1.105, router is probably 192.168.1.1
  3. Test internet connectivity: ping 8.8.8.8
  4. Find other devices on your network:
    • Try pinging 192.168.1.1 through 192.168.1.20
    • Note which ones respond

Key Takeaways

  • Every device on a network needs a unique IP address to communicate
  • IPv4 addresses look like 192.168.1.100 - four numbers separated by dots
  • Private IP addresses (like 192.168.x.x) are used inside networks
  • Public IP addresses are used to reach the internet
  • Subnet masks define which devices are on the same network
  • DHCP automatically assigns IP addresses to most devices
  • Static IP addresses are manually set and never change
  • Ping is a useful tool for testing network connectivity
  • Understanding IP addresses helps troubleshoot network problems

What's Next?

In the next section, we'll learn about the physical and wireless technologies that actually carry the data between devices - from ethernet cables to WiFi signals!