Service discovery is very useful in pervasive computing environments. A service discovery architecture based on anycast is proposed. A wellknown anycast address is defined first, which stands for a group of directory servers supporting service discovery. Each node in pervasive environment determines whether it is qualified to be a directory server in accordance with its capability, such as its memory, energy, or location stability. Qualified node announces that it serves the well-known anycast address and then begins to listen and cache service register messages from other nodes. A node supplying a service sends register messages to the well-known anycast address. The message is routed the nearest one of directory servers by an underlying anycast routing protocol. When a node wants to get some service information, it sends query messages to the anycast address, too. The message is also routed to the nearest directory. The directory replies in accordance with the information cached or ...