We design and analyze a mechanism for forming coalitions of peers in a data swarming system where peers have heterogeneous upload capacities. A coalition is a set of peers that explicitly cooperate with other peers inside the coalition via choking, data replication, and capacity allocation strategies. Further, each peer interacts with other peers outside its coalition via potentially distinct choking, data replication, and capacity allocation strategies. Following on our preliminary work in IEEE ICNP 2011 that demonstrated significant performance benefits of coalitions, we present here a comprehensive analysis of the choking and data replication strategies for coalitions. We first develop an analytical model to understand a simple random choking strategy as a within-coalition strategy and show that it accurately predicts a coalition's performance. Our analysis formally shows that the random choking strategy can help a coalition achieve near-optimal performance by optimally choosing the re-choking interval lengths and the number unchoke slots. Further, our analytical model can be easily adapted to model a BitTorrent-like swarm. We also introduce a simple data replication strategy which significantly improves data availability within a coalition as compared to the rarest-first piece replication strategy employed in BitTorrent systems. We further propose a cooperation-aware better response strategy that achieves convergence of the dynamic coalition formation process when peers freely join or leave any coalition. Finally, using extensive simulations, we demonstrate improvements in the performance of a swarming system due to coalition formation.