next up previous
Next: The Apocalypse Up: No Title Previous: halt

The Network Ancestor

Based on the enhancements to the instruction set described above, in April 1996, the first fully network-able ancestor was designed and implemented. What follows is a description of the algorithm of the network ancestor, whose assembler code is available at: http://www.isd.atr.co.jp/~ray/tierra/netreport/0640aaa.tie.

The network ancestor first examines itself to determine where it begins, where it ends, and how large it is. The end address is found by searching for an ``end template'' at the end of the organism's executable code. After the beginning address is subtracted from this end address, the resulting size (320) is shifted left (multiplied by 2) to allow a private data space following the code segment. This space will be used by the sensory cell(s) to store and compare TPing data from various nodes on the net. The cell then splits into two threads, which differentiate into different ``cell types'' by jumping to different parts of the code. One cell type specializes for reproduction, the other for sensing conditions on the net using the TPing mechanism.

The reproductive cell splits into four threads in order to parallelize the time-consuming process of copying the data from the mother to the daughter space. However, just before cell division, three of the four threads halt. The remaining reproductive cell copies the IP address of the node that is the current best recommendation from the sensory cell(s), from the soup data area to the relevant register of the CPU, and sends its daughter to that node. The daughter will only be placed on the local node if it compares favorably to other nodes and receives the best recommendation from the sensory cells.

The sensory cell remains as a single thread most of the time. It uses the getipp instruction to copy successive TPing data structures into its private data space from the IPMap array on the local node. The IPMap array contains the most recently arrived TPing data structures from all the nodes on the net that this local node is aware of.

The sensory cell keeps two TPing data structures in its private data space. The first structure at the beginning of the data space is placed there immediately after the differentiation of the sensory cell. All subsequent calls to getipp or tpingr place the TPing data into the space just following the first structure. Each time the sensory cell reads a new TPing data structure into this space, it subtracts the time-stamp value from the current time, with the difference being the age of the data. This age value is then shifted right several times (that is, successively divided by 2). If the result is zero, the data is considered to be fresh enough. If the data is not fresh enough, it sends a TPing request to that node to get more recent data, and it loops back to call getipp again to look at the data from a different node (while waiting for the previous TPing reply to return). However, each time, just before the getipp instruction, the sensory cell tests for a TPing reply signal. If there is such a signal, it indicates that a TPing reply is waiting in the buffer. In this case, rather than using getipp, it uses tpingr to receive the incoming TPing data.

After each new TPing data structure is written into the (second) data space, it is compared to the data in the first space. The network ancestor looks at the ratio: Speed/NumCells. This is a measure of the amount of energy resource available to each cell on that node. If the newly arrived TPing data has a higher Speed/NumCells ratio, it is copied into the first data space, replacing the TPing data that was written there previously. In this way, the first data space always contains the most recent ``best'' recommendation. It is from this space that the reproductive cell fetches the IP address just before executing the divide instruction, and the daughter is always sent to that IP address (which could be the local node).



next up previous
Next: The Apocalypse Up: No Title Previous: halt



Thomas S.Ray
Tue Jan 14 16:09:05 JST 1997