In this video were going to continue looking at how data flows
in various network devices but specifically in this video we're gonna look at routers.
Routers are layer 3 devices, in other words they operate at the network layer
of the OSI model
Routers do not make routing decisions based on MAC addresses
but rather use IP addresses when determining
out of which interface is traffic should be sent.
Routers still use MAC addresses on Ethernet interfaces
but the decision making process of which interface traffic
should be transmitted out of, is made based on IP addresses rather than MAC addresses.
A router may have serial interfaces as well as Ethernet interfaces.
An Ethernet interface uses a MAC address for forwarding of traffic at layer 2.
but a serial interface using PPP doesn’t use MAC addresses.
So when traffic arrives on 1 interface and the routers need to determine out of which
interface to forward the traffic that decision is made based on IP addresses
rather than MAC addresses.
So in this topology once again rather than using full 48 bits MAC addresses.
I’m going to represent a MAC address as a single character for readability
and ease of use, so A is the MAC address of the first PC
and it has an IP address of 10.1.1.1 we have a router with 2 interfaces.
F0/0 has an IP address of 10.1.1.100 and MAC addresses G.
F0/1 has an IP address of 10.1.2.100 and MAC addresses of H.
There are also some other PCs shown in the topology
with the relevant MAC addresses and IP addresses.
In this topology we're using a subnet mask of /24
which can also be written as 255.255.255.0
for simplicity in this topology both PC A and PC C
are connected to a hub which is connected to a router on F0/0.
PC B and PC D are also connected to a hub which in turn is connected to the router
on F0/1 the router has therefore been configured
with an IP address in the same subnet as host A and host C
it's F0/1 interface is configured in the same subnet as B and D.
when you configured an IP address on a router or layer 3 switch
you configure the IP address with the mask.
So the router knows that a /24 mask has been used here
because it was configured as part of the IP address command
when the IP address was configured on an interface.
The router will therefore update it's routing table
to indicate that network 10.1.1.0/24
is directly connected to F0/0
and network 10.1.2.0/24 is directly connected to F0/1.
Routers don’t populate their routing tables using IP addresses
but rather populate the routing tables with network addresses.
And they make their routing decision based on the network address
rather than individual IP addresses.
So the routers in this example are configured with IP addresses and the /24 mask.
So IP address 10.1.1.100 with the /24 mask
equates to a network of 10.1.1.0/24
and that network is added to the routing table of the router.
in this example the routers knows that to get to network 10.1.1.0
traffic should be sent out of F0/0
and to get to network 10.1.2.0
traffic should be sent out of interface F0/1.