Introduction to IP Addressing
Introduction to IP Addressing
MAC addresses are fantastic but they've got some real limitations to them.
If we take a look at our little network model that I have here you remember that
every computer has a unique MAC address for its network card.
Problem number one is that as you add more and more computers, because of the
nature of a broadcast domain, you end up getting so much broadcasting that nobody
can get anything else done.
So that's problem number one. The second problem is, is that MAC addresses don't
identify in any way that these computers are all part of a single local area
network.
That's not what MAC addresses do. I mean they come from original equipment
manufacturers and so they're very fixed and static.
And as a result of that if you want to start getting bigger networks we have to,
now I'm not saying we get rid of MAC addresses we still use them, but in order to
make a big network work we have to add a new type of addressing called logical
addressing logical addressing comes in a number of different forms.
But the overwhelming predominant version of logical addressing use today is called
IP addressing.
The idea behind IP addresses is that unlike MAC addresses they're not fixed with a
network card.
You can apply an IP address to a network card.
In fact you usually have to in one way or another go into Windows or Linux or MAC
or whatever it is and say my IP address is such and so. So IP addresses can
actually be used to identify a particular network.
So for example, if we bring this example back up, if you take a look at on this one
on the first three numbers all of the computers on this network will have these
three numbers applied as the first three values. The fourth value will be different
for every individual computer.
Now if I have another network come up, well this network will have a different what
we called network ID that shows all the computers on this network are a member of a
particular broadcast domain.
So now if we have all of these IP addresses as well as MAC addresses how do they
all tie together.
Keep in mind that routers are going to have two connections or more. So in this
case this router actually has only two connections.
There's one connection here. But the other connection is hard wired to a 4 port
switch.
So what I'm going to do is I'm going to run a cable from the router, just like
this, and I'm going to plug it into a switch.
That's one of the reasons why we see so many home routers with a built in switch.
It's because we're invariably plugging our Local Area Connection into a router.
Now if I want to connect this guy to anybody else I'll use the other connection.
And in this case I can actually connect two networks together via a router.
So what will take place is that if one of these computers on this side wants to
talk to one of these computers on this side they actually change the frame to
include the IP address of the computer that they want to talk to.
So in order to see how all this works, let me go ahead and grab some blocks and
let's do our frame one more time.
But this time we're going to add a little IP information. To appreciate the power
of IP addressing let's go through a fairly simplistic example where we have two
networks that are interconnected by a single router.
So what I have is one network and another network and they're interconnected
through this triangle which is my router.
Now what I want to do is that this computer right here he wants to talk to this
computer over here. On the other network.
Now based on what we've learned before what we have is a MAC address destination a
MAC address sourced data and a CRC.
But what we're going to do is we're going to add a little bit of extra information.
What we're putting in is the IP address of this computer right here this is the
destination IP address as well as the source IP address which is the IP address of
the sending system.
Now what we want to do is go ahead and send this packet to the correct party. So to
do that your computer right here is going to look at that IP address and he's going
to realize that it's not part of his network.
When that happens built into every computer in the universe, at least every one
that's on the internet, is something called a default gateway. The default gateway
is invariably the connection to your router itself.
So what will happen is that your computer will go ahead and put a frame around this
IP packet.
And on this frame it's going to have the destination MAC address of the router as
well as the source MAC address of the computer itself.
So this big old long frame gets sent through the network, into the switch, the
switch sends it to the router.
Now once it gets into the router the router strips away all of the frame stuff
leaving just the IP packet.
Built into every router in the universe is something called a routing table.
The routing table tells based on whatever the network information is where to send
data.
So in this case because it's a very simple network it knows basically just to send
it out on the other side.
So in order to send it your router will go ahead and get the MAC address of this
computer.
And he'll go ahead put the MAC address of the receiving computer as well as his MAC
address and then put the entire frame together off the frame goes into this guy
here.
But the important thing to appreciate is that while the frame itself change the
number of times, the IP packets never change.
And that's important because IP packets don't really care about what kind of
cabling or anything you use they always get the data there.
Keep in mind it's routers that look at IP addresses to send data to the proper
networks and also keep in mind that IP packets always sit within frames.