Clustering is an important characteristic of most sensor applications. In this paper we define COSMOS, the Cluster-based Heterogeneous Model for Sensor networks. The model assumes a hierarchical network architecture comprising of a large number of low cost sensors with limited computation capability, and fewer number of powerful clusterheads, uniformly distributed in a two dimensional terrain. The sensors are organized into single hop clusters, each managed by a clusterhead. The clusterheads are organized in a mesh-like topology. All sensors in a cluster are time synchronized, whereas the clusterheads communicate asynchronously. The sensors are assumed to have multiple power states and a wake-up mechanism to facilitate power management. To illustrate algorithm design using our model, we discuss implementation of algorithms for sorting and summing in sensor networks.