NetEgg is a toolkit of scenario-based programming, that allows network operators who may not be trained in programming to develop network policies by describing representative example behaviors. Instead of implementing a network policy by programming, the network operator simply specifies the desired network using scenarios, which consist of packet traces, and corresponding actions to each packet. Given these scenarios, a synthesis algorithm automatically infers the controller state that needs to be maintained along with the rules to process network events and update state. NetEgg targets network operators that may not be skilled to program the behavior of a router by a standard programming language.