President Donald Trump speaks at the Naval Academy graduation on Friday, May 25, 2018, in Annapolis, Md. Trump touted U.S. might during the graduation speech Friday.

The seeming collapse of the North Korea summit and the U.S. withdrawal from the Iran nuclear deal have led top officials in the Trump administration to once again make veiled references to military action, with President Donald Trump most recently touting American might in a speech Friday at the U.S. Naval Academy.

But beyond the saber-rattling is a sobering reality well known by strategists and planners at the Pentagon: The unlikely, worst-case scenario of sliding into open armed conflict with both Iran and North Korea simultaneously would strain the U.S. military to a degree few Americans could fathom.

Defense Secretary Jim Mattis has repeatedly warned that an open conflict on the Korean Peninsula alone would be catastrophic, resulting in the sort of warfare the U.S. military hasn't seen in generations. The outside chance of a conflict with Iran at the same time would present Pentagon leaders with logistical, tactical and personnel challenges unenviable for any commander.

Former top Pentagon officials say the possibility of coinciding wars with Iran and North Korea remains extremely remote, and the United States could drift in the space between diplomatic breakthrough and all-out war for years. Still, if the dual wars were to occur, they would test decades of contingency planning that anticipates huge risks to the U.S. armed forces despite ultimate victory.

"Both fights would be costly," said David Ochmanek, a senior researcher at the Rand Corp. and a former top Pentagon strategist in the Clinton and Obama administrations. "In the end you would expect the U.S. and its allies to prevail but at a human and material cost that would be almost incalculable, particularly in the case of the Korea example."

For decades dating back to the Cold War, planners at the Pentagon have grappled with the question of how the U.S. military should prepare for the remote possibility of having to fight two full-scale regional wars at once. The new national defense strategy issued by Mattis, however, emphasizes the need to build up military capability for a possible great-power conflict with Russia and China, and largely backs off the focus on waging two regional wars at once that once consumed the Pentagon.

But as the U.S. military pivots its focus to countering Russia and China, regional challenges from Iran and North Korea continue to consume the administration and the public.

"If you want to ensure the Pentagon can actually plan and prepare and resource for a potential conflict with China or Russia, then getting into conflict with Iran and North Korea is the exact wrong thing to do," said Mara Karlin, an associate professor at the Johns Hopkins School of Advanced International Studies and a former Pentagon strategist.

Whereas military planners envision a war with North Korea as primarily a land and air fight, ultimately requiring a massive ground invasion and ending in regime change followed by stabilization, conflict with Iran would more likely be primarily a naval and air battle, focused on crippling specific missile and nuclear sites rather than dismantling the government itself.

Simultaneous warfare in the two countries would stress intelligence and reconnaissance assets such as drone overflights, which the U.S. military has come to rely on heavily, according to former Pentagon officials. Battles in two theaters also would strain Special Operations forces and possibly electronic warfare and tactical air support units, they said. Another challenge would be getting forces and equipment to both theaters in a prompt manner and sustaining them once they arrive.

Amid the attention on Iran and North Korea, Trump has stressed the strength of the U.S. military and his administration's efforts to reverse what military commanders say has been underinvestment in the force.

"We're sharpening the fighting edge of everything, from Marine infantry squads to combat ships to deliver maximum lethal force," Trump said during his Naval Academy address. "We will have the strongest military that we've ever had, and it won't even be close. And when did we need it more than now?"

While Trump has boasted of major increases to defense spending, the impact of greater budgets won't be felt for some time. Meanwhile, the military continues to feel the effects of more than a decade and a half of war in Afghanistan and Iraq.

"It's still in many respects a tired force - the toll of the wars and constant deployments, the effect on both manpower and equipment, the lack of opportunity to do the right kind of training," said Brian McKeon, who served as acting undersecretary of defense for policy during the Obama administration.

Mattis has regularly emphasized the need for diplomacy for Iran and North Korea, even as other members of the Trump administration have threatened military options.

Michael O'Hanlon, a senior fellow at the Brookings Institution, suggested Mattis's approach might reflect his firsthand understanding of the potential costs and uncertainties of any conflict, regardless of the Pentagon's many contingency plans.

"There's such an inherent unpredictability to war," O'Hanlon said. "The minute you start to think your beautiful battle plan is going to work the way you designed it, that's where it gets dangerous."

