President Trump has opened a rift with one of America's closest allies. But things have been worse. Here's everything you need to know:

Are the two countries close?
The strong, neighborly ties between Canada and the U.S. are virtually unprecedented in world history. The two nations share the world's longest border, which is mostly undefended except for civilian law enforcement, and the American and Canadian militaries work hand in hand for joint defense through the North American Aerospace Defense Command, or NORAD. The U.S. and Canada also have the largest trading relationship of any two nations in the world, exchanging $1.9 billion in goods and services every day. The nations' electrical grids are completely integrated as well. Nevertheless, Canadian-American relations appear to be at their lowest point in years, thanks to President Trump's decision to levy tariffs on Canadian steel and aluminum imports in the interest of "national security." The tariffs, as well as Trump's personal attacks on Prime Minister Justin Trudeau, have enraged Canadians. "The idea that we're some national security threat is just preposterous," said David Perry, a senior analyst at the Canadian Global Affairs Institute.

Have we always been allies?
No. In fact, Canada's identity was forged in its opposition to its southern neighbor. During the American Revolution, Britain's Canadian colonies rebuffed invitations to join the revolt against the crown, and Canada ultimately became a haven for some 40,000 loyalist refugees fleeing persecution at the hands of the victorious patriots. When hostilities broke out again between the U.S. and the British in the War of 1812, American troops invaded Canada expecting to be greeted as liberators, only to be beaten back by British and Canadian troops. The war contributed greatly to Canada's emerging sense of self. Travel to Ontario, which saw much of the cross-border fighting, and you'll find monuments celebrating the triumph of Canadian arms over the invading Americans.

Did relations improve after that?
Somewhat. The U.S. never invaded Canada again, and the border was largely demilitarized in successive treaties between Britain and the U.S. But disputes over the border persisted throughout the early 19th century as the U.S. pushed westward. After the American Civil War, some Republicans demanded that Britain cede all of Canada as reparation for supporting the defeated Confederacy. Fears of another American invasion helped lead to the creation of the Dominion of Canada on July 1, 1867 — now celebrated as Canada Day — which united the colonies of Canada, New Brunswick, and Nova Scotia into one semi-autonomous confederation within the British Empire. It was the beginning of the modern Canadian nation.

When did tensions subside?
Canadian-American cooperation during World War II and the emerging threat of the Soviet Union ended the cross-border conflicts. Nevertheless, there have been flashes of disagreement over the decades, especially regarding American foreign policy. Some 30,000 Americans fled to Canada to avoid the draft during the Vietnam War, which Canada opposed. It also refused to join the U.S.-led invasion of Iraq in 2003. Canadians have long been leery of being dominated by their much larger neighbor, which has a population nearly 10 times that of Canada. Former Canadian Prime Minister Pierre Trudeau famously compared his country's relationship with the U.S. to a mouse sitting next to a sleeping elephant. "No matter how friendly and even-tempered is the beast," he said, "one is affected by every twitch and grunt."

What are Trump's complaints?
He says America is being treated unfairly, falsely claiming that the country runs a trade deficit with Canada. Trump is particularly angry about Canada's fierce protection of its dairy farmers. Canada sets production quotas for dairy, eggs, and poultry products to keep prices stable and guarantee farmers a steady income, while charging tariffs of up to 270 percent on imported dairy products. The Trump administration wants Canada to open up its dairy market as part of the ongoing renegotiation of the North American Free Trade Agreement. "It's not about Trump and Trudeau," said former American diplomat Stephen Kelly. "This has been an irritant for many years."

What do Canadians think?
Canadians point out that the U.S. also heavily subsidizes its dairy industry, by about $22 billion a year. Canada offered to open up its dairy market to join the Trans-Pacific Trade Partnership, but Trump pulled out of the agreement in one of his first acts as president. Historically, Canadians have had a positive view of the U.S., but that's changing under the Trump administration. For the first time in more than three decades, more Canadians have an unfavorable view of the U.S. than have a favorable one. Some Canadians are even boycotting U.S. products. Trump's hard-line immigration policy is also rubbing Canadians the wrong way. The U.S. Border Patrol recently boarded 10 Canadian fishing boats in disputed boundary waters to look for illegal immigrants, triggering howls of protest from Canadians. "Not surprised to see the Americans trying to push people around," said Laurence Cook of New Brunswick's Grand Manan Fishermen's Association. "Typical American bullies."

The price of a trade war
Who would win a trade war between the U.S. and Canada? Arguably, no one. Canada and the U.S. export almost exactly the same value of goods and services to each other every year — about $670 billion. Canada, however, is likely to suffer more in the long run because it's so heavily dependent on trade with the U.S. Canada's trade with the U.S. is worth as much as its trade with all other countries combined; Canada exports as much to the U.S. in a single month as it sends to the 28 countries of the European Union in an entire year. But Americans will also pay a price. Canada is the top export market for 35 U.S. states, and 9 million U.S. jobs depend on exports to its northern neighbor. If President Trump follows through on threats to impose a 25 percent tariff on Canadian-built cars, it would immediately rebound on the American auto industry, whose supply chain is inextricably intertwined with Canadian auto plants. "It should worry everyone," said Bruce Heyman, a former U.S. ambassador to Canada.