I know a.b.c.d is an ip address. But what the hell is an a.b.c.d/x? I managed to grow to 39 yo without knowing that, but today I had to learn it.

It’s how a subnet’s entire ip address range is specified.

The notation is called CIDR - Classless blah blah blah.
(i believe you should be able to live your life peacefully and happily without ever having to remember the full form of some shit like this. if u do… something’s wrong with u. fix it.)

So.. yes it represents all the ip addresses in that subnet.

What’s the immediate application of this?

This can answer how many devices can connect to your home wifi.

How do we find that?

If you are using a linux/unix system, run the command ip addr:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 9c:15:45:bd:32:a3 adg ff:ff:ff:ff:ff:ff
    altname vgt8c5985rt3ae9
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 89:14:f9:r4:87:76 afd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 metric 600 afd 192.168.1.255 scope global dynamic wlan0
       valid_lft 83677sec preferred_lft 83677sec
    inet6 fd10:b1f8:fcfc:2d00:c2b6:f9ff:fefe:876/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 6876sec preferred_lft 3276sec
    inet6 gb98::c2i9:f9e3:erer:876/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

If you’re connecting to the internet via wifi, check wlan0, and there you’ll see you inet ip as: 192.168.1.3/24

The part 192.168.1.3, that’s the ip address of your computer within the subnet.

Now turn on your phone’s wifi and find its ip.

It’s 27.57.83.163.
(find this by visiting https://ifconfig.me/ or with command: curl ifconfig.me)

Wait… that doesn’t seem like it belongs to the same address range as the above ip: 192.168.x.x. What’s the matter?

And moreover, when I visit https://ifconfig.me on both my laptop and my phone, it shows this same ip. What’s with that?

Well.. that’s the face of my home network that I’m presenting to the wild internet.

While all the different devices connected to my wifi router have different ip addresses in the form of 192.168.x.y… according to the wild internet outside, the traffic coming from them all come from that single internet-facing ip: 27.57.83.163.

You can find your phone’s wifi ip by going to the network settings and then fiddling with the currently connected wifi network’s properties page.

Mine showed 192.168.1.5.

So… how many such devices can my wifi router handle?

That’s answered by the /24 suffix.

But first.. for an ipv4 address, this suffix can range from /0 to /32.

Why 32?

The 4 numbers of an ipv4 address - a.b.c.d - are each represented by 8 bits.. so four eights are 32 bits. And each of those 8 bits can range from 0 to 255.

Coming to the titular question: how many ip addresses can a suffix have?

/24 has 256 ip addresses.

And for my specific wifi subnet, it starts from 192.168.1.0 to 192.168.1.255.

So.. of those 256.. the one ending with 3 is my laptop’s ip, and the one ending with 5 is my phone’s.

You can even ping one from the other: ping 192.168.1.3

Likewise.. all the other devices connected to your wifi will have addresses from this range. Your smart tv (that makes u dumb), wifi fridge (that makes u fat), phones of your kids and parents (causing brainrot) and all those wonderful tablets and cellfuckinphones.

But 3 of the ips are special. The zeroth, the first and the last.

  • 192.168.1.0 - represents the subnet itself. It’s this particular network’s address
  • 192.168.1.1 - is most certainly the router’s ip address
  • 192.168.1.255 - is the broadcast address. Technically, you can ping to all devices in your network with ping -b 192.168.1.255. It didn’t work for me though.

I’ve only covered ipv4 addresses here so far.

I don’t yet know how the hell ipv6 will even look like. But that’s for another day.