 In larger cities, a moat surrounded the wall.This could be connected to canals or rivers both in the city and outside, thus providing both a defense and a convenient transportation route.Nearby waterways might be adopted or altered to connect to, or form part of, the moat.