NETWORK 1
1)when your computer or PC want to connect or communicate with another one
in a Local LAN .An ARP [ARP stands for Address Resolution Protocol, this is
used to translate IP protocol to Ethernet Address] request is started, If
the IP address is on the local network, the source host [your computer]
checks its ARP cache [A place in your memory which have some IPs and some
MAC addresses for the local PCs] to see if it already has the hardware
address [MAC address] of the receiving host.Think about it. if your computer
dun know where is the distination place? will it communicate with it? i
guess NO.So the ARP request is important for the connection between
computers in LAN.. If your PC didnt find the MAC address for the destination
PC, a broadcast [with the IP needed] is sent to all local hosts. If the
receiving host finds that the IP address of the source host matches it's own
then it sends a reply to the source host with it's hardware address. When
received by the source host, it's ARP cache is updated to include this info.
If no hosts respond to the broadcast then the request is discarded .. but
wait , the ARP entries in the ARP cache can be stored for 2 min [in case of
dynamic IPs, like Dialup IPs] and stored for the next ReBoot [in case of
static IPs]
2)If your computer want to communicate with a remote computer [i mean not in
the same LAN] .So the source host checks the local routing table for a path
to the destination computer. If one is not found then a broadcast is sent to
the router (gateway). The router replies with its hardware address [MAC
address] and then the packet [this packet is sent from your computer and
include the information you want to send it to the remote computer] is sent
to the router.The router will do the same as what your computer have done
,It checks its cache for the path to the distnation computer. If one is
found then it fowards the packet [your packet]. If not, it sends a broadcast
again and waits for a reply from the host. It may again determine that it is
a remote host and then the process repeats with a broadcast to the next
router and so on ,when the distination host gets the request, it sends an
ICMP echo request and done.. ICMP packets stands for Internet Control
Message Protocol and it is used for error messages for the TCP/IP and for
troubleshooting TCP/IP networks..