Tip:
Highlight text to annotate it
X
In the upcoming videos we're going to talk about IP Routing.
But before talking about IP Routing, we should first know the difference between Switches
and Routers!!
First of all…what is a router or what is routing exactly mean? A switch “switches”
and router “routes” but what does this exactly mean?
Switches “switch” based on MAC address
information. When an Ethernet frame enters one of the switch interfaces, it should send
this Ethernet frame by looking at the destination MAC address. The MAC Address belongs to each
device is unique.
Router have a similar task but Routers “route” based on IP information. The router look at
the IP packet to get the destination IP address and send packet out to the correct interface.
The IP Address is unique on the network also. So what is the difference here? Why don't
we use MAC addresses everywhere and switch? Why do we need to look at IP addresses and
route? Both MAC addresses and IP addresses are unique per network device. Good question
and here is the answer:
Here we have two switches and 200 computers are connected to each switch. Now if the 400
computers want to communicate with each other, every switch has to learn the 400 MAC addresses.
So they need to know the MAC addresses of the computers on the left and right side.
Now think about a really large network…for example the Internet. There are millions of
devices! Would it be possible to have millions of entries in each Switch's MAC-address table?
And For all devices on the Internet? No way!
Now we placed 2 routers and we connected the 200 computers on the left to router A with
network 192.168.1.0. And router B has 200 computers behind it and the network there
is 192.168.2.0. And here Routers “route” based on IP information,
in our example Router A ONLY has to know that network 192.168.2.0 is behind Router B. And
Router B ONLY needs to know that the network 192.168.1.0 is behind Router A.
So Instead of having a MAC-address-table with
400 MAC addresses on each switch we now only need a single entry on each router for each
other's networks. So Switches use mac address tables to forward
Ethernet frames, while routers use a routing table to learn where to forward IP packets
to.