Iran insists that it can withstand any attack, and will have no trouble blocking the export of oil via the Straits of Hormuz in retaliation. Hormuz is where ships exit the Persian Gulf and enter the Indian Ocean. Some 40 percent of the world's oil shipments pass through these straits, which comes to about 15-20 tankers a day (plus a dozen or more non-tankers). The Persian Gulf, in general, is a busy waterway. It is 989 kilometers long, and the average depth is 50 meters (maximum depth is 90 meters). Iran now openly boasts of its ability to use land based anti-ship missiles as "coastal artillery" to halt traffic in the straits. Given past performance by the Iranians, that is unlikely.
The Iranian problem is that they have a small navy, an obsolete air force and a poor track record when it comes to shutting down tanker traffic in the Persian Gulf, or the Straits of Hormuz. They tried once before, in the 1980s, when they were at war with Iraq. The two nations began attacking each other's tanker traffic early on, in an attempt to cut off each other's oil sales (and, thus, military purchases). Iran didn't want to shut the Straits of Hormuz, because it needed the oil revenue more than Iraq (which was getting billions in aid from other Arab states) did. So each country concentrated on attacking shipping in the Persian Gulf. Over 500 ships were attacked, 61 percent of them tankers. Only 23 percent of the tankers attacked (mainly with the types of anti-ship missiles that are still in use) were sunk, or immobilized. The attacks, using fighter-bombers and warships, only hit about two percent of the ship traffic in the Gulf. Iran lowered its oil prices to cover the higher cost of ship insurance, and in 1986, Russia and the United States intervened to protect Kuwaiti and Iraqi tankers (which were taking most of the damage).
The Iranian military is in worse shape today than it was 25 years ago, and would not last long trying to attack ships. That leaves the Straits of Hormuz. This is actually a wide (about 30 kilometers) deep channel. Normally, shipping sticks to narrow (a few kilometers wide) channels, going in and out, to avoid collisions. It was long believed that the main Iranian threat would be naval mines. The Arab states have lots of mine clearing equipment, and more numerous air and naval forces than Iran. In addition, there is the United States and NATO forces in the area.
If Iran tried to shut down the Straits of Hormuz, it's more likely that the straits would remain open for non-Iranian oil. With the loss of their oil exports, Iran would find its remaining military forces being hunted down and destroyed day after day. Not only would Iranian oil exports be halted, but so would imports. Iran depends on imports of food (over 100,000 tons a week) and gasoline to keep its economy operating.
Iran believes it has a secret weapon for shutting down the Straits of Hormuz. This is hundreds of Chinese C-802 anti-ship missiles mounted in trucks, some of them civilian trucks that, they hope, could slip past enemy aircraft. But the Iranians have another problems with the C-802.
Four years ago, Hezbollah received some C-802s and fired two of them at an Israeli warship. Why wasn't the 1,100 ton Israeli corvette destroyed by the 164 kg (360 pound) warhead of the C-802? That's because the C-802 missile hit the helicopter hanger on the Israeli ship. Then the missile suffered a common problem; the warhead failed to go off. The fire on the Israeli ship was caused by the half a ton of missile crashing into it, and the unburned rocket fuel. The other C-802 fired, homed in on a nearby Egyptian ship, and sank it (the warhead on that one did detonate). The Israeli anti-missile system was not turned on because it was found to interfere with the electronics on Israeli warplanes operating in the vicinity. This is also an increasing problem in modern warfare. There are so many electronic gadgets transmitting, that there are more cases of signals, literally, getting crossed.
Another problem with the C-802 is that it can hit targets over the horizon (about twenty kilometers distant), and to do that, you need an aircraft or ship on the spot to provide general location data for the C-802. This is not a big problem in the Straits of Hormuz, except in bad weather or at night. American air power would shut down nearly all Iranian radars, so the C-802s would be blind much of the time. The rest of the Gulf is too wide for the C-802 to be effective.
The C-802 is a 20 foot long, 360mm, 682 kg (1,500 pound). The Israeli warship (like most in the West) carried electronic defenses against anti-ship missiles, as well as a Phalanx auto-cannon. This system is supposed to be turned on whenever the ship is likely to have an anti-ship missile fired at it. The Phalanx radar can spot incoming missiles out to about 5,000 meters, and the 20mm cannon is effective out to about 2,000 meters. With incoming missiles moving a 250 meters a second, you can see why Phalanx is set to automatic. There's not much time for human intervention.
The C-802 needs to work with a radar that can track the target. The C-802 apparently used Lebanese government coastal radars for this. The Israelis destroyed those radars after their ship was hit, and no more C-802s were fired. The C-802 is 30 year old technology, and Iranian quality control in its weapons plants is known to be uneven. So a certain percentage of those missiles would fail for one reason or another. The Iranians would find out how effective, or not, the U.S. is on stopping any trucks from getting near the coast. In sum, the Iranians, despite their bluster, don't have a sure thing when they say they will close the Straits of Hormuz.