Hello Laz,
I wanted to introduce a different scenario related to the discussion we were having, and discuss the process involved here.
Scenario 1:
Assume we have two routers (R11 and R12), directly connected to eachother on their G0/0 interfaces on a 10.1.1.0/24 subnet. R11 has IP 10.1.1.1/24 on its G0/0 interface, and R12 has 10.1.1.2/24 configured on its G0/0 interface. R11 also has a loopback address configured, 11.11.11.11/32 and R12 has a loopback as well 12.12.12.12/32.
My question is, we spoke about how when a multilayer/Router receives a frame with a destination MAC that matches its receiving interface, we de-encapsulate the frame, and if the destination IP of the packet is not the IP of the receiving interface, then we have to route the packet. But, what if a packet originates from R11 itself, destined to the 10.1.1.2 interface of R12? For example, if i were to login to the CLI of R11, and ping 10.1.1.2, would the RIB be involved here? I am sure that when R12 receives the packet, since it was destined for that interface, and the source IP of R12s response is on the same subnet as the destination IP of the response packet, then it just replies without using the RIB, but was curious on R11’s process on whether or not it should reference the routing table. I dont believe it does, since the destination IP of the packet is on the same subnet as R11s GI0/0 interface configured with 10.1.1.1/24. So even though both routers have a directly connected network on their routing tables of 10.1.1.0/24, any packets generated from either router going to either of their interfaces would not use the RIB.
The source of these questions are that when I have IP packet debugging, and I try this scenario on R11, i get “IP: tableid=0, s=10.1.1.2 (GigabitEthernet0/1), d=10.1.1.1 (GigabitEthernet0/1), routed via RIB”
So while its clear on how the routing process begins from the perspective of a router receiving a packet from a host that needs to be routed, how would we describe the routing process as it begins when the routers themselves generate a packet? My take on this is when the router generates a packet with a destination IP thats on the same subnet as one if its interfaces, then we do not need to reference the routing table and we just send the packet sourced from whatever interface is on that same subnet as the destination IP. But when the destination IP of the generated packet is not in the same subnet as one of the routers interfaces, then we have to reference the routing table and find a match.
are these explanations correct?
Scenario 2
What if the multilayer switch/router receives a frame on one of its interfaces, and upon de- encapsulation the destination IP of the packet is not for the interface itself, but its for another interface on that same router, what this scenario cause a routing table lookup?
Scenario 3
I wanted to shift and ask about the actual end user devices that send a packet to their default gateways. We always talk about how the end user devices determine whether to send a packet to their gateway or to try to ARP for a device it wants to communicate with by looking at the destination IP of the packet it generates, and comparing it to its own IP address and subnet mask. If the destination IP is on the same subnet it tries to ARP for the MAC of said IP address, and its its on a different subnet it ARPs for the default gateways MAC and sends the packet to the default gateway. My question is specifically related to a windows host running windows OS. Arent these functions done by checking the windows routing table that we get by doing “route print” on the command terminal? So for example, a windows host generating a packet would check its routing table to see if it has an entry that matches the destination IP. If theres an entry that matches the destination IP address of the packet “on-link” then we know that destination we want to reach is on the same subnet as one of our interfaces so we try to ARP. If there are no “on-link” entries then the destination IP is not an IP on the same subnet as any of our interfaces (since we may be using more than one network interface card) and we use the 0.0.0.0 0.0.0.0 entry which is our gateway. So am i correct in understanding that the windows routing table is always used for this process? I understand doing the windows routing table lookups provide the same end result as the explanation that a device compares he destination IP of the packet it generates to its IP address and subnet mask to determine how to handle that packet, but I just wanted to discuss this
Thank You Laz