Iran's main naval base is at Bandar Abbas. But if the Strait of Hormuz was blockaded the Iranian fleet (including submarines) would be bottled up in the Persian Gulf. Iran has therefore been building up naval facilities at Chabahar - less easily blockaded.
Iran has a small navy with a small submarine force of 3 Russian built Kilo class 2,300 ton (surfaced) and many more mini-submarines. Most are at Iran's main naval base of Bandar Abbas. In a major war those unfortunate Kilos would be rapidly destroyed as they can only operate in small well identified parts of the very shallow Persian Gulf (average depth is 50 meters and maximum depth is only 90 meters) and must travel through the narrows of the Strait of Hormuz. See map with depths below.
The very shallow depths in the Persian Gulf and the Strait of Hormuz force ships and Iran's Kilo class subs into very restricted waters. This makes Kilos even more vulnerable - one reason why Iran has gone for mini-subs A third of world oil that travels by sea goes from the Persian Gulf through the Strait of Hormuz.
Irans most important mini-submarines are 21 Ghadir class 115 ton (surfaced). They have 2 x 533mm torpedo tubes for torpedos or mines. Mini-subs permit safety in numbers against the powerful Western forces in the Persian Gulf. Numerous mini-subs also permit "swarm" tactics against more formidable, but less numerous, Western naval vessels. If just one Ghadir sank or at least ruptured a tanker's tanks this may be a major environmental and economic disaster for the region. (Photo courtesy FARS News Agency via Covert Shores)
The congested, shallow, hence noisy waters of the Strait of Hormuz may limit the effectiveness of fixed or floating sound-acoustic sensors. However more effective may be magnetic anomally technology including detectors (indicator loops) slaved to remote control arming and firing mines.
Iran is better known for developing swarm tactics using small fast surface suicide boats. See them firing small missiles at a mockup of a US carrier. One minute in land based anti-ship missiles are fired.