I have a question regarding the internet layer of the TCP/IP model: When a data frame is sent by a client to a server located on another network, we know that the routing tables and the ARP protocol are used to "find" the routing path and also route the message to the right machine using the MAC address... But in what order are these two "protocols" used by routers? ARP first then routing table? Routing table then ARP request? Or both at the same time? I don't know if I'm clear enough... Thanks for your help!
1 Answer
The routing (or forwarding) table is not a protocol. It's a mechanism to implement the network layer function(s).
In order to route an IP packet, you first need to know which interface you will be sending the packet out of and then which gateway (next hop) to use. That is the main purpose of the routing table (and other mechanisms): to determine which outgoing interface will be used and where to send the packet.
Once you have decided which interface to use, you can encapsulate the data in the data link layer frame with the destination MAC address. If you don't know the destination address, you use ARP to learn it. ARP is used to find the data link layer address (MAC) for a given network layer address (IP).