We have touched on and worked with IP addresses
in many, many Nuggets throughout these modules and courses.
And so in this Nugget, I want to go over some basics
with you regarding IPv4.
Number one, an IPv4 address is 32 bits in length.
And instead of writing it out in a bunch of ones and zeros,
et cetera, et cetera, et cetera, what we do as humans,
we represent them as four decimal numbers.
Like 192, 168, 1, 102.
And then we put periods between those numbers just
to separate where the numbers start and stop.
So we represent it as decimal, and behind the scenes
it's binary.
Now a part of this IP address that server two has,
right here, represents the actual network ID.
And a part of that IP address represents the actual host
portion.
And the way we determine that is using the mask.
And what the mask does is simple.
It simply identifies where the network portion stops,
and where the host portion starts.
For example, in our case right here, it's right here.
And the way it does that, it represents how many bits
are being used by the network.
So slash 24 means that the first 24 bits are the network,
then the remaining 8 bits over here on the right
represent the host addressing on that network.
Now for the purposes of unicast routing,
we have three classes of addresses.
Class A, B, and C. And it's really easy to identify a class
A from a class B from a class C. All we do
is simply look at the very first number, the first octet
before that first period.
And for a class A, that very first octet
is going to be between 1 and 126.
There's also 127, which is also a Class A address,
but it's reserved for loopback purposes.
So as far as routable class A addresses,
the first octet would be between 1 and 126.
For a class B address, it's between 128 and 191.
And for a class C, it's 192 through to 223.
And the question may come up, well,
Keith, why do we even care about class A, B, or C?
And today, we pretty much don't, because we
use whatever masks we need to.
However, there are some default masks, and here they are.
A default mask for a class A address is 8 bits, meaning
the first 8 bits are the network, and the remaining
three octets, or the remaining 24 bits,
are used for host addressing.
With a class B address, the default mask is 16.
And with a class C address, the default mask is 24.
And we don't have to use those conventions,
but those are the defaults.
Another thing that's important to be aware of
is that there are some private address space, based on an RFC.
It's RFC, that's a Request For Comments number 1918.
And in RFC 1918 18, it allocates some address space
from each of the classes that can be used inside companies.
And when the companies use those addresses inside,
they don't have to tell anybody about it.
They don't have to register, or request addresses,
they can just go ahead and use them.
In the RFC 1918 addresses, any IP
address that begins with 10--
and I'm going to say 10, anything.
So we have an example of one right here.
We're using a 10.0.0 network with this last 24-bit mask.
And that's an example of an RFC private address
in the class A range.
And in RFC 1918 for a class B address,
there's a 172.16 through 31, dot anything.
And for class C, there's a 192 dot 168 dot anything.
And that's the RFC 1918 private address
space in the class C range.
Now, one thing about these RFC 1918 addresses
is that they're not routable over the internet.
So service providers are going to knock those
off right at the edges.
So if we're using a private address, like this one right
here, 192.168.1, which is an example of the RFC 1918
private address space, what we would have to do
is do network address translation
before those packets are sent out to the public internet.
Now, one of the challenges that comes up with IPv4
is the concept of subnets.
Now, the idea of subnets isn't too tricky.
It's taking one network--
for example, the 10 network--
with the default mask of slash 8.
That's, again, from the RFC 1918 private address space.
And then carving it up into multiple sub networks.
And to understand what's really going on there,
it takes a little bit of time with binary
to look at what's going on behind the scenes.
So regarding subnets, and how they're created,
and how they work, I've got a few videos
that will walk you through some of the basics of binary
and how to do custom subnetting.
Another challenge that comes up is routing, and reverse
engineering with IPv4.
Now, from routing perspective, when a Windows Server gets
a packet, it's going to forward it based on its routing table.
And if routing is enabled, it's also
willing to forward other devices' traffic through it.
But in either case, it's going to refer to its routing table
when it's making a routing decision.
And so as we look at this routing table,
the rule is we're looking for the longest
match in the routing table.
That's the route we're going to use.
So as I look at the entries here,
I don't see anything that start with 23.
And as a result, it's going to go to the default route.
I call it the Obi-wan Kenobi route.
Help us, Obi-wan, you're our only hope.
And so in this example, you use the default gateway 192.168.1.1
to forward that packet.
Another challenge that comes up is the need
to be able to do reverse engineering.
For example, let's say we saw a computer,
we looked at its IP address, and let's say
the IP address was 23.17.204.98, and it had a mask of 19,
meaning the first 19 bits of the IPv4 address
are representing the network.
And the rest is representing the host address.
A good question is, what exactly is the network--
the subnet-- that this host is connected to?
And the ability to take a host address like this one with
a mask and reverse engineer the network ID-- the subnet ID--
also requires, my friend, a pretty good understanding
of binary and subnetting.
And have no fear, that's what the next several videos is
going to walk us through together.
So until then, I hope this has been informative for you.
And I'd like to thank you for viewing.