Menu
Theme

IP Addressing

Data Communication and Networking

Habari Class! Welcome to the World of IP Addressing!

Imagine you want to send a letter to your friend in another county. What do you need? An address, right? You need their name, house number, estate, town, and county. Without a proper address, your letter would get lost!

The internet works in a very similar way. Every single device connected to the internet – your phone, your laptop, even that smart TV at home – needs a unique address so that data can be sent and received correctly. This unique address is called an IP Address.

Think of it like your M-Pesa number. It's unique to you, and that's how Safaricom knows exactly where to send the money. Today, we are going to learn how to be the "postmasters" of the internet! Sawa sawa? Let's begin!

Real-World Scenario: When you type 'google.com' into your browser, your computer first asks a server (called a DNS server) "What is the IP address for Google?" The server replies with an address like '172.217.16.78'. Your computer then sends your request directly to that address, and Google's servers send the webpage back to your computer's IP address. It's a two-way street!

Anatomy of an IP Address (IPv4)

For our lesson, we will focus on the most common type of IP address, called IPv4 (Internet Protocol version 4). It's the one you'll see most often.

An IPv4 address is a 32-bit number. But who wants to remember 32 ones and zeros? Hakuna! So, we make it easy to read by following these rules:

  • We split the 32 bits into four sections.
  • Each section has 8 bits and is called an octet.
  • We convert each octet into a regular decimal number (from 0 to 255).
  • We separate the numbers with a dot (.). This is called dotted-decimal notation.

    Binary:    11000000.10101000.00000001.00000001
                  |        |        |        |
    Decimal:      192   .  168   .    1   .    1

So, the IP address 192.168.1.1 is how we humans read it, but the computer sees the long binary number.

IP Address Classes: The Original Neighbourhoods

In the early days of the internet, IP addresses were grouped into "classes" to help organize them. Think of it like organizing land in Kenya: Some land is for huge national projects (Class A), some for large institutions like universities (Class B), and some for smaller businesses or home estates (Class C).

  • Class A: For very, very large networks. The first octet is between 1 and 126.
    • Example: 10.50.30.10 (Used by giant organizations)
  • Class B: For medium to large networks. The first octet is between 128 and 191.
    • Example: 172.16.20.5 (Could be for a university like UoN or Strathmore)
  • Class C: For small networks. The first octet is between 192 and 223.
    • Example: 192.168.1.101 (Perfect for your home Wi-Fi, a school, or a cyber cafe)
  • Class D & E: Reserved for special purposes like research and multicasting (don't worry too much about these for now).
Image Suggestion: A colorful, animated chart showing the IP Address classes. Class A is a huge cityscape (representing a massive network), Class B is a large university campus, and Class C is a small, neat housing estate. Each section is labeled with its corresponding IP range (1-126, 128-191, 192-223).

Subnetting: Dividing Your Shamba

Imagine you are given a whole Class C network, which has 254 usable addresses. But your company only has 30 computers. You have over 200 wasted addresses! Hiyo ni hasara! Also, what if you want to create two separate networks, one for the 'Accounts' department and one for the 'Sales' department, for better security and organization?

This is where subnetting comes in. Subnetting is the process of taking one large network and breaking it down into smaller, more manageable pieces called subnets. It's like taking a big shamba (farm) and dividing it into smaller plots for planting different crops.

To do this, we use a Subnet Mask. A subnet mask looks like an IP address (e.g., 255.255.255.0) and it helps devices figure out which part of the IP address is the Network ID (the estate) and which part is the Host ID (the specific house number).

Let's Get Practical: A Subnetting Example

A small company in Nakuru is given the network address 192.168.20.0. They need to create two subnets. Let's do the math!


### STEP-BY-STEP SUBLETTING CALCULATION ###

1.  **Identify the Network:**
    Address: 192.168.20.0
    This is a Class C address.
    Default Subnet Mask: 255.255.255.0

2.  **Convert the Mask to Binary:**
    255.255.255.0  =  11111111.11111111.11111111.00000000
                       (Network Part)      (Host Part)

3.  **How many bits to borrow?**
    We need 2 subnets. We use the formula 2^n >= (number of subnets needed).
    If n=1, 2^1 = 2. Perfect! So, we need to borrow **1 bit** from the host part.

4.  **Create the New Subnet Mask:**
    We take the first bit from the host part (the zeros) and turn it into a 1.

    Old mask: 11111111.11111111.11111111.00000000
    New mask: 11111111.11111111.11111111.10000000

    Now, convert the new mask back to decimal:
    11111111.11111111.11111111.10000000 = 255.255.255.128
    Our **New Subnet Mask is 255.255.255.128**

5.  **Calculate the Subnets:**
    We find the 'block size' by subtracting the last non-zero octet of the mask from 256.
    Block Size = 256 - 128 = 128.
    This means our networks will go up in steps of 128.

    *   **Subnet 1:**
        - Network ID: 192.168.20.0
        - Usable Host Range: 192.168.20.1 to 192.168.20.126
        - Broadcast ID: 192.168.20.127

    *   **Subnet 2:**
        - Network ID: 192.168.20.128
        - Usable Host Range: 192.168.20.129 to 192.168.20.254
        - Broadcast ID: 192.168.20.255

There you have it! You've successfully created two separate small networks from one larger one. You can now assign one to the 'Accounts' team and the other to the 'Sales' team.

Private vs. Public IP Addresses

Not all IP addresses can be used on the public internet. Some are reserved for private use inside our own local networks (like at home or in school).

  • A Public IP Address is the main address your Internet Service Provider (like Safaricom, Zuku, or Faiba) gives you. It’s unique across the entire world and allows you to be identified on the global internet.
  • A Private IP Address is used within a private network. Your Wi-Fi router at home gives a private IP address to your phone, your laptop, and your family's phones. These addresses are not visible on the internet.

Kenyan Analogy: Think of a big building in Nairobi CBD like The Stanley Hotel. It has one main public address (Kimathi Street). That's its Public IP. But inside, it has many rooms: Room 101, Room 102, Room 205. These are the Private IPs. People outside only need to know the hotel's address to send a package. The receptionist (your router) knows which room to deliver it to.

The ranges for private addresses are:

  • 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 (You've probably seen this one on your home router!)

The Future is Here: IPv6

The world has a lot of devices! We have run out of IPv4 addresses, just like we sometimes run out of number plates for cars. To solve this, a new version was created: IPv6 (Internet Protocol version 6).

It is a 128-bit address, which is much, much longer. It uses hexadecimal numbers (0-9 and a-f) and looks very different.


    Example IPv6 Address: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

You don't need to be an expert on IPv6 right now, but it's important to know it exists because it is the future of the internet!

Let's Wrap It Up!

Wow, that was a lot! But you've done great. Today we learned:

  • An IP Address is a unique address for a device on a network.
  • IPv4 is a 32-bit address written in dotted-decimal notation.
  • Classes (A, B, C) were an early way to organize networks by size.
  • Subnetting is the smart way to divide a large network into smaller ones, and it's a very important skill for any network technician.
  • The difference between Public (globally unique) and Private (for local networks) IPs.

Msijali, don't worry if the subnetting math seems tricky at first. Like anything, practice makes perfect. The more you work with these numbers, the easier it will become. You are well on your way to becoming a networking guru! Keep up the great work!

Pro Tip

Take your own short notes while going through the topics.

Previous OSI Model
KenyaEdu
Add KenyaEdu to Home Screen
For offline access and faster experience