And what protocol should be used? Thanks.
A host or router that wants to send a packet first looks up the destination in it's routing table. This returns two peices of information.
- The interface to use.
- What the "next hop IP address" should be. If no next hop IP address is specified in the route then the destination is used as the next hop IP address.
What happens next depends on the type of interface. If it is a point to point interface the packet is just sent. the next hop IP address is ignored.
If it is a type of interface that supports multipoint addressing with it's own addressing scheme (for example the MAC addresses used by Ethernet, wifi etc) then the next hop IP address is looked up in the ARP table for the interface, if a suitable match is found then the Packet is sent.
Otherwise the packet is queued while an ARP request takes place. If the ARP request is successful then an entry is added to the ARP table and the original packet is released to continue it's journey. If the ARP requests are unsucessful the packet will be dropped, possiblly with an ICMP "destination host unreachable" error being returned to the sender.