DHT based p2p systems are designed based on 128 bit(sometimes more bits) length unique hash value as the node id. There are several ways this can be done and this should be done. It depends on the way that the system need to be performed in message routing. For an example one may need to route messages anonymously to all the nodes in the ring(DHT based nodes are normally organized to a ring of nodes). But another may need to rout a message to some particular node. So there are several scenarios to be considered when deciding which way to use in order generate node ids. Most popular ways of generating node ids are using the peer's IP or its public key. Some system uses randomly generated 128 bit hash as the node id.
However in my research work I wanted to generate a nodeId based on not neither the IP nor the Public key of the node but using some unique key/number given or that can be used to identified the node. For an example the mobile number of a mobile device(phone, PDA, iPhone, etc) which represents a peer in a p2p network. Since I am using Freepastry API this capability is not provided directly. But extending its NodeIdFactory class this can be done easily. Its quite simple. :)