To allow end users define network behavior andto make communication network evolution service-driven, we propose fast and
secure capsule processing environment, dedicated CPU architecture named StreamCode and related mechanisms. In our proposed
arc hitecture each packet contains a program for the packet written in StreamCode binary instructions. Every computational
resources for packet processing is isolated for each packet and is cleared when execution time limit expires. This prevents
malicious programs affecting other packets without virtual machines. Middleware attaches appropriate StreamCode programs considering
the user requirements. A sample application, contents-sensitive multicast on our StreamCode emulator, in which a streaming
application on a server attaches appropriate multicast program for each contents, optimizes packet loss in multicast in per-user
and per-contents basis.