It was called Khandaq, meaning 'Trench' war. Thousands of sahabis together with Rasool Allah built a trench all around Madinah to defend themselves and thier city from the nonbelievers (confederates; al- Ahzab). Bani Nadir (a Jewish tribe) went to Khaibar and gained sympathy of the people there, made an army of 10,000 and went to Madinah. RasoolAllah found out and took the opinion of Salman al-Farisi who said to build a trench all around the city so the enemies can not enter. Muhammad and 3,000 other sahabah made the trench in 20 days, SubhanAllah. There was no direct contact because of the trench standing between the two parties. The main weapon used was arrows.