There are two basic types of interconnection agreements between providers in the Internet: peering and transit. A decision every Internet network service provider (INSP) has to make is which other peering/transit INSPs to connect with. The potential peering/transit partners offer (obviously) different routes and they may differ quite drastically in the amount and type of charges (line costs, exchange point related costs, settlement costs, administrative costs) they demand as well as in reliability and quality of service. In this article, we discuss and solve problems in this context: the first problem is finding the optimal set of peering and transit partners for one INSP at one point in time, given the routing information and the cost functions of the potential peering/transit partners and the Internet exchange points. Reliability issues (for example enforcing enough spare capacity to absorb the complete failure of one provider) are considered as well as quality of service constraint...