A U.S. Border Patrol officer and his K-9 search for a group of illegal immigrants near U.S.-Mexico border on August 15, 2016 in McAllen, Texas.

From Donald Trump's promise to make Mexico pay for a wall to Kenya's planned 435-mile security barrier along its boundary with Somalia, borders are big business.



"There were more borders and barriers being built in the last 10 years than ever before," says Thomas Tass, the chairman of Borderpol — an organization of border security agents and officials.

The border security market was worth $15.6 billion in 2015, according to estimates from marketing firm Strategic Defense Intelligence. It is expected to grow to $23.7 billion by 2025.

Researchers from the University of Quebec say there are now at least 65 physical barriers along national borders around the world.

And while Trump's vow suggests there will be no sign of construction slowing, governments around the world are doing more than just putting up walls.

The big question for those watching the borders is how to keep criminals and terrorists out, without infringing on the rights and safety of legitimate travelers.

To accomplish this balancing act, border agencies — and the security companies that supply them — are deploying smarter technology as well.

"Border management programs are basically the biggest business for the security industry now," says Frank Doherty, the European operations director for border technology firm MSA.

The company offers "intelligent fences" that can detect intruders as well as ground sensors and expensive high-range security cameras that can see up to 15 miles away.

MSA has mainly focused on the Middle East, and is now seeing opportunities to increase its business in Europe. But Doherty says Europeans don't want highly visible, fortified barriers that are popular in countries such as Jordan, Saudi Arabia or Oman.

Netanyahu Tweet

"In Europe they're more covert," he told NBC News. "They want to know the intruder is there but they don't necessarily want to show everybody that they're stopping them coming in."

The largest share of the market is expected to be maritime surveillance with which SID project manager Mainak Kar said is driven in part by demand for unarmed drones, helicopters and patrol vessels to monitor the number of migrants crossing the Mediterranean Sea.

"Instead of active aggressive measures like armed patrol boats, electrical fences, a lot of equipment will be surveillance based just to know when and how people are coming in," Kar said.

Security agencies are also deploying a decidedly low-tech, but perhaps the most user-friendly method available: sniffer dogs.

"The dogs are still renowned as the best method of detecting a scene," says Colin Singer, managing director of Wagtail UK. His dogs are trained to sniff out a variety of scents ranging from drugs or tobacco to human beings.

"They're very accurate, so the use of the dogs is a favorite method by border agencies because of their accuracy and speed," he added.

More from NBC News:

Here's what the US-Mexico border looks like now

Donald Trump, Australian PM offer mixed messages on refugee deal

Civilians, including children, killed in US raid on Al Qaeda in Yemen, military says



While public opinion may be aligning against globalization and the free movement of people, information sharing among security agencies remains a powerful tool in the fight against crime and terror.

Attila Freska, chief operating officer of Securiport, a company that provides security information management services to governments, says by better utilizing all the available data, security forces have something akin to "a crystal ball."

"Most people have a data footprint," he told NBC News. "But even if there is no data footprint, that's a flag. People buying expensive tickets for a flight with cash — that's a flag these days."

Interpol also makes freely available its extensive databases which include the red notices flagging arrest warrants for international suspects.

The organization also has a database of stolen and lost travel documents that lists some 70 million passports, according to Royce Walters, assistant director for terrorism and border security at Interpol.

He says it takes a fraction of second for a border agent to get information from the database, just by scanning a passport.

"Pretty much before you can finish swiping it, it's already hit the database and come back with information as to if there's a problem," he says.

Walters says another available database has millions of sets of fingerprints, "everything from small-time petty thieves, all the way up to terrorists that were identified during the war in Afghanistan and Iraq."

Despite such advances, sometimes a physical barrier is deemed necessary.

Hungary put up hundreds of miles of fencing along its borders with Serbia and Croatia in 2015 to stop waves of migrants who were crossing over to gain access to other European Union countries.

Hungarian Interior Ministry Deputy Secretary Matyas Hegyaljai told NBC News that the country, which typically received about 20,000 illegal migrant crossings each year, saw 400,000 crossings in 2015.

When border patrols and police were not enough to contain the influx, the country took action.

"We have an obligation to defend not only Hungary, but the European Union," Hegyaljai said.

Hegyaljai suggested the fence could come down if the situation improves. "This is not a wall, forever, like on some other border lines," he added.

Tass, with Borderpol, says the challenges faced by Hungary provided a "litmus test of what the border management community will encounter in the months and years ahead."

ISIS has also changed the equation, and put pressure on the so-called Schengen system — which allows travelers free passage to other EU countries without passport checks.

The Islamist group has urged its fighters to use migrant routes to enter Europe. That includes two suicide bombers who had trained in Syria before taking part in the attacks Paris in November 2015.

"The real challenge for the entire civilized global community is the foreign fighters," says Peter Vincent, an assistant director for international policy at Borderpol.

But Vincent, who is a former official in the U.S. Department of Homeland Security and Department of Justice, says it is "unfortunate" to see European countries building fences and worries that strict controls put in place to stop terrorists will instead impact on lawful travelers.

"The trick for all of us is to have the proper safeguards in place to detect and capture that very small minority of committed terrorists, while the same time providing asylum and refugee status … to those that are truly fleeing terrorism, not committing acts of terrorism," he added.

According to Securiport's Freska, different legal structures between countries and privacy concerns mean there is no perfect solution to border security.

"You look at water and how it flows," he said. "You may build a dam in one area, it will flow around as we see over and over again."