In many settings, including campuses, enterprises, militaries, and datacenters, networks must be shared between entities that send and receive traffic over common hardware. The authors analyze the fundamental problem of how to program shared networks in a secure and reliable manner. Their solution is based on a new programming model that supports the concept of a network slice. Slices isolate the traffic of one program from another, and also isolate traffic within a single program from other traffic generated by the same program. Consequently, slices bring a critical form of modularity to network programs that have long been absent.