Discovery
The mobile node is responsible for an ongoing discovery process. It must determine whether it's attached to its home network, in which case IP datagrams may be received without forwarding, or attached to a foreign network. Because handoff from one network to another occurs at the physical layer, a transition from the home network to a foreign network can occur at any time without notification to the network layer (the IP layer). Thus, discovery for a mobile node is a continuous process.
For the purpose of discovery, a router or other network node that can act as an agent periodically issues an agent advertisement message. A mobile node listens for these messages. Because a foreign agent could be on the mobile node's home network (set up to serve visiting mobile nodes), the arrival of an agent advertisement doesn't necessarily tell the mobile node that it's on a foreign network. The mobile node must compare the network portion of the router's IP address with the network portion of its own home address. If these network portions don't match, the mobile node is on a foreign network.
Foreign agents are expected to issue agent advertisement messages periodically. If a mobile node needs agent information immediately, it can issue an ICMP router solicitation message. Any agent receiving this message will then issue an agent advertisement.