Execution environments (EEs) are infrastructures on which applications and mobile code are programmed, managed and executed. A new type of EE for active network based on programmable mobile softdevices is presented in this paper. Programmable units, called softdevices in the EEs, are formed according to functions of protocol sub-trees. By means of demux (demultiplexer), passive packets and active packets can find and execute corresponding codes. In these EEs, functions of active nodes are extended flexibly,user prpgramming is facilitated by rich APIs,and protocols or appications are tested and deployed dynamically.