IPv4 Networking Basics

So, you want to know a bit about IPv4 networking, subnetting, etc., but you have no interest in or need to learn the whole CCNA stack?
Maybe this is the right place to be.

Caveat:
None of this is about IPv6, which uses hexadecimal - base 16. Nobody really understands what the heck IPv6 is or how it works.
That is why subnetting was created, so that IPv4 can continue to be used and we can pretend that IPv6 was never invented.

There are exactly 40,282,366,920,938,463,463,374,607,431,768,211,456 unique IPv6 addresses. That’s enough for every grain of sand on every beach in the world to have a unique IP address, with a few quadrillion addresses to spare.
IPV6 is a perfect solution to IP addressing that would be implemented, except that it makes everyone’s head hurt so bad that they want to just crawl into a hole and die.

For instance, my current IPv6 address is 2601:14f:4400:bcc0:8cc:f417:9794:4bc5, my current IPv4 address is 10.0.0.46
Let's just pretend that IPv6 doesn’t exist, and nobody gets hurt.

- -

IPv4 adheres to Computer Science Rule #1 below

Computer science/Networking Rule #1:
Everything is base 2 (boolean) - on/off, yes/no, etc.
This is also known as "binary" numbers.
At the risk of sounding pedantic, here’s some basic IT binary maths:
  • A BIT is a single boolean decision (1 in base 2)
  • A BYTE consists of 8 bits
  • A KILOBYTE is 1024 bytes
  • A MEGABYTE is 1024 kilobytes
  • etc.

  • One byte can have 256 possible values, from 0-255. an IPv4 address has 4 bytes.

    The reason that kilo/mega/giga, etc. is 1024 instead of 1000 is because everything is in base 2, we are just translating it to base 10. 1024 in base 2 is 10000000000, 1000 in base 2 is 1111101000.
    Humans are basically not too smart - most amateurs and IT companies just say "1000", which is perfectly fine as long as we remember that that is grossly and patently incorrect, and will seriously fuck up your code and calculations. If you do this, things will break and you should go sit in the corner and hang your head in shame.

    - -

    IPv4 Basics:

    An IPv4 address consists of 4 "triads" of 8 bits each - for a total of 32 bits.
    In base 2, that would be 00000000.00000000.00000000.00000000, in base 10, we read it as 0.0.0.0
    - Or alternately 11111111.11111111.11111111.11111111 would read 255.255.255.255 in base 10.

    So, once we wrap our brains around the concept of base 2, we can see that, for example, 192.168.6.6 (base 10) would be 11000000.10101000.00000110.00000110 (base 2).

    Learning binary numbering - and being able to instantly translate between base 2 and base 10 - is an extremely useful tool to have in your brain when it comes to IPv4 IP addressing. It's really not that difficult, just takes practice.

    The problem with IPv4 is that there are not enough individual addresses to go around (only about 4.3 billion, which sounds like a lot but really isn’t).
    About 270 million of the addresses are "multicast" addresses, and about 18 million are considered "private" addresses. The "private" addresses are "non-routable", they cannot cross over into the public domain.

    Additionally, each subnet also has a number of unusable addresses (the “network address", “broadcast address", etc). Additionally, cloud services like Azure and AWS reserve some other addresses.
    I’ll discuss this later.

    Subnetting uses non-routable IP addresses.
    I’ll discuss this below.

    - -

    Non-Routable (Private) IP Addresses

    These non-routable IP addresses are the ones used in subnetting. Since they cannot be routed, they can be reused in separate subnets over and over again. They are commonly known as "private" IP addresses.

    The ‘private" IP address ranges 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

  • If a packet forwarded to or from one of these IP addresses hits a
    switch, the switch will attempt to forward it.
    If a packet addressed to or from one of these IP addresses hits a router, it will either be kicked back, or it will fizzle into the void - hence the term “non-routable".

    - -

    Some links for you:
  • https://subnet.ninja/subnet-cheat-sheet/
  • https://www.freecodecamp.org/news/subnet-cheat-sheet-24-subnet-mask-30-26-27-29- and-other-ip-address-cidr-network-references/
  • This guy is really good, but very technical and can be hard to follow: https://www. youtube.com/watch?v=ecCuyq-Wprc
  • This is thorough, and may be way TMI: https://www.youtube.com/watch?v=BWZ-MHIhqjM


  • Much more to come, stay tuned