We visited northern France, where thousands of refugees are huddled in camps, to see how different types of camps -- built by the government, by charities and by refugees themselves -- deal with this bleak situation, and how each is failing in its own way.
At the various camps we visited, refugees and migrants were happy to talk to us and keen to tell their stories, but they were wary of being photographed.
The first place we visited was the notorious encampment nicknamed "The Jungle." It's a jumble of tents and makeshift shelters.
Many nationalities live on top of one another in the Jungle, which houses refugees from Syria, Afghanistan, Iraq, Iran, Sudan, Eritrea and many other countries.
Everything in the Jungle is cobbled together, like this dilapidated caravan taped up with plastic sheeting.
Conditions in the Jungle, which grew on the site of a former landfill, are extremely unsanitary.
Aid agencies rely on donations of clothes and other essentials, including shoes, tents, blankets and food.
The camp is quiet during the day, but it comes alive at night, when refugees set out to try to climb into lorries or trains to the UK.
Tarpaulins and plastic sheeting make up most of the shelters. That's less than ideal in the winter. It's also a fire risk.
In May a fire swept through the Jungle, eating up the wood and plastic structures. There's no access to proper water supplies, which makes fire a very real danger.
The Jungle is built on litter-strewn sand dunes.
When we visited, there were about 5,500 people living in the Jungle. Today, aid agencies estimate that the number is closer to 9,000.
A large portion of the Jungle was bulldozed in March to make way for the second type of camp we encountered: a fenced-in, government-run encampment housing refugees in metal shipping containers.
The container camp is separated from the Jungle by fences and a rancid drainage ditch.
Twelve people can sleep in each modified shipping container, in bunk beds.
The shipping containers provide a much safer alternative to the squalor of the Jungle. However, there's no communal space, and nowhere to cook.
The government camp can hold up to 1,500 refugees, though nearly twice that number were displaced when the bulldozers cleared the way for the containers.
East of the Jungle and the container camp we found this camp at Grande-Synthe, founded by charity Medecins Sans Frontieres (MSF) with the backing of the local mayor. It's only 25 miles from the Jungle, but it could be another planet.
CNET's Richard Trenholm looks over the camp, which has no fences surrounding it.
The Grande-Synthe camp is much safer and more sanitary than the Jungle.
British volunteer Rory Fox runs a small school at the Grande-Synthe camp, called the Dunkirk Children's Center. Children are much safer here than in the Jungle.
The airy Grande-Synthe camp has facilities including a laundry and a small store.
Shower and toilet blocks are a far cry from the noxious and dangerously overworked portable toilets that serve the Jungle.
The inhabitants of the Grande-Synthe camp live in wooden huts, which they can lock to protect their meager possessions.
A volunteer rakes out a surface for the children to play soccer.
Posters advertise information in Arabic, Farsi and other tongues. French and English language classes are available.
French architecture students assemble a new structure.
The Kurdistan red fox -- Vulpes vulpes kurdistanica -- painted on the side of one of the huts. At Grande-Synthe, refugees are predominantly Iraqi Kurds.
The Grande-Synthe cabins are sturdy plywood constructions with watertight corrugated plastic roofs.
The huts are raised on blocks to keep out rodents and flooding.
Though it appears tranquil and safe, Grande-Synthe has a major problem: It's controlled by people-smugglers who let only certain people live there. Heartbreakingly, while the horrendous Jungle becomes increasingly overcrowded, the number of people living in this far more humane alternative is actually falling.
Trucks rumble by in the distance. There are no fences surrounding Grande-Synthe, and the lack of security is exploited by criminal gangs.
By contrast, the Jungle is bordered by looming fences topped with razor wire that keep refugees and migrants away from the road.
Workmen add more razor wire to the towering fences separating the Jungle from the road, where lorries rumble by on their way to the UK.
There's a constant police presence around the edges of the camp.
The government container camp is also fenced in. Entrance to the facility is through these turnstiles, which require refugees to input an access code and scan their palms on a hand scanner.
Refugees associate fingerprinting with deportation, so many were reluctant to have their handprints recorded -- even if it meant swapping the shelter of the containers for the squalor of the Jungle.
Help from aid agencies goes only so far. An informal economy has developed to meet the needs of the Jungle's population. For example, a bicycle repair shop helps keep the Jungle's few battered bikes on the road.
Housed in a makeshift tent, the Khyber Darbar cafe offers generous Afghan meals for 3 euros a plate. Cafés like this provide a crucial space for refugees to eat, charge their phones and socialize. Relaxation is important in such a tense living situation, where people are crowded atop one another.
Small shops sell snacks and drinks bought from nearby Calais, as well as SIM cards and mobile-phone credit.
Though Grande-Synthe doesn't have the same informal economy as the Jungle, some enterprising inhabitants have set up shop. Abdula Hamid, from Iraq, displays his wares, including bundles of 10 cigarettes for 1.50 euros (about $1.68).