This paper examines the structure of the shipping network and its implications on global trade and welfare. Using novel data on the movements of container ships, we calculate optimal travel routes. We then estimate the impact of a shock to the network on global trade by analyzing the effect of the 2016 Panama Canal Expansion. Trade between country pairs using the canal increased by 10% after the expansion. While the building costs were borne by Panama alone, a model-based quantification analysis shows that the welfare gains were shared by many countries, due to the network structure of shipping.