Introduction. A major benefit of software-defined networking (SDN) over traditional networking is simpler and easier programming of networks. In particular, the emergence of OpenFlow (OF) [1] has provided a standard, centralized approach for a network controller to install forwarding rules at the forwarding engines (called flow tables) of a heterogenous set of network switches, substantially reducing controller-switch dependency, and hence programming complexity. One key issue that such a controller-switch protocol cannot resolve, however, is the diversity of switch implementations, capabilities, and behaviors. For example, hardware-based switches can have significant differences in their physical structures such as TCAM size, which significantly affects forwarding throughput over large sets of rules. Their software behaviors, such as their TCAM cache replacement algorithms and flow installation efficiency, also differ drastically. Since such diversity reflects many factors, including real-life, random, idiosyncratic designs as well as systematic switch vendor engineering exploration (which can be essential to foster switch vendor innovation), it is inconceivable that all switches will have the same capabilities and behaviors. The presence of diverse switch capacities and behaviors can make a network much harder to understand and/or to control. For example, consider two switches with the same TCAM size, but one adds a software flow table on top. Then, insertion of the same sequence of rules may result in a rejection in one switch (TCAM full), but unexpected low throughput in the other (ended up in software flow table). Now consider that the two switches have the same TCAM and software flow table sizes; but they introduce different cache replacement algorithms on TCAM: one uses FIFO but the other traffic dependent. Then, insertion of the same sequence of rules may again produce different configurations of flow tables entries: which rules will be in the TCAM will be switch dependent. Whether a rule is in TCAM, however, can have a significant impact on its throughput, and hence QoS. In this project, we design Jive, the first SDN programming system that systematically explores the issues of understanding and optimization of SDN programming in the presence of diverse switch capacities and behaviors. The basic idea of Jive is novel, simple, and yet quite powerful. In particular, different from all previous SDN programming systems, which ignore switch diversity or at most simply receive reports of switch features (in newer version of OpenFlow), Jive introduces a novel, proactive probing engine that measures the performance of each switch according to a well-structured set of Jive patterns, where each Jive pattern consists of a sequence of standard OpenFlow flow modification commands and a corresponding data traffic pattern. Utilizing the measurement results from the Jive patterns, Jive derives switch capabilities as well as the costs of a set of equivalent operations that can be utilized, through expression rewriting, to optimize networks with diverse capabilities and behaviors. We emphasize that despite the progress made by Jive, its scope is still limited, focusing mainly on performance. Additional switch diversities, such as ability to provide different functionalities, remain to be explored.