pc1 and pc2 are different subnets Actually if a pc1 wants to ping pc2

at first pc1 checks pc1 & pc2 subnets whether they equal or not if not the frame will not cross the nic of pc1

my question is how the pc1 gets the subnet of pc2 to check?


PC1 does not get the subnet mask of PC2. PC1 has its own IP address and its own subnet mask to determine what is local and what is remote. If the destination IP address of PC2 is not within the range of PC1 IP addresses that are covered by the network and subnet mask of PC1 then PC1 will know that it needs to send the data to its gateway(router) to get to PC2.

  • If you pull up a command prompt in Windows and type "route print" you'll get a bit of a demonstration in how your computer sees this. For addresses inside PC1's subnet, the default gateway is your own computer. For anything NOT in PC1's subnet (network destination netmask means anything and everything), PC1 will send the data to its default gateway. If they're in the same subnet, PC1 will send an ARP message for PC2, learn its MAC address, and communicate at layer 2 of the OSI model for the rest of the conversation. Jun 22 '14 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy