How does a host decide whether a destination is local or remote?
IntermediateConceptIP Addressing, CIDR, Subnetting & Routing
Answer
It ANDs the destination IP with its own mask and compares to its own network. If they match, the destination is on-link and the host ARPs for it directly. If not, the host sends the frame to the default gateway's MAC address with the original destination IP intact.
The IP header stays end to end (apart from NAT); the Ethernet header is rebuilt at each hop.
More on IP Addressing, CIDR, Subnetting & Routing
What is an IPv4 address and how is it structured?BeginnerWhat are the private IPv4 ranges (RFC 1918)?BeginnerWhat is CIDR notation?BeginnerHow many usable hosts are in a /24, and why minus two?BeginnerSubnet 10.0.0.0/16 into /24 subnets. How many do you get and what are the first three?IntermediateGiven 172.16.37.200/21, what is the network address, broadcast and range?Intermediate