Throughout the Syrian civil war, one of the major concerns of Western powers in particular has been the inflow of Sunni foreign fighters, who come from the wider Arab world, Western Europe, and as far afield as Kazakhstan and Indonesia.
According to a recent estimate by Aaron Zelin of the Washington Institute for Near East Policy, there could be up to 11,000 of these fighters. It raises the questions of which groups they join, and what the relations between these groups are.
By far the two most popular banners for these foreign fighters are al-Qaeda's official Syrian affiliate, the al-Nusra Front, and the Islamic State in Iraq and the Levant (ISIS).
ISIS is the result of a unilateral attempt by the leader of Iraq's al-Qaeda affiliate, Abu Bakr al-Baghdadi, to merge his group with al-Nusra. The move was rejected al-Nusra's leader, Abu Mohammed al-Julani, and by al-Qaeda overall leader, Ayman al-Zawahiri, but Baghdadi refused to disband ISIS.
Of the two organisations, ISIS appears to attract more foreign fighters.
They constitute a majority of ISIS's elite fighter corps and are disproportionately represented in its leadership, as opposed to native Syrian majorities on both counts in al-Nusra.
However, it would be a mistake to conclude, as is often reported, that ISIS in Syria overall is primarily a group of foreigners.
On the contrary, I would estimate at least a 60-70% Syrian majority in ISIS's Syrian branch.
This is because the group, bolstered by abundant financial resources, maintains extensive activist and service networks run by locals, such as the Islamic Administration for Public Services, which provides electricity and buses among other services in Aleppo.
In any event, ISIS is increasingly recruiting native Syrians to conduct important military operations, and understands that to perpetuate its existence in Syria, it must recruit from the next generation.
Hence, outreach to children is a key part of ISIS's modus operandi for consolidating power.
Saudis and Moroccans
Besides al-Nusra and ISIS, there are several other groups to which foreign fighters congregate.
They are particularly concentrated in the Latakia countryside, near the Mediterranean coastline.
During the summer, these groups - along with al-Nusra and ISIS - played a leading role in an ultimately unsuccessful rebel offensive on Alawite areas, with the aim of scoring a symbolic victory by capturing President Bashar al-Assad's ancestral village of Qardaha.
Of these other groups, some are formations independent of both al-Nusra and ISIS, even though they have ideological affinity.
For example, primarily based in the Latakia countryside, there are the two groups Suqour al-Izz and Harakat Sham al-Islam.
The former, founded at the beginning of this year, is led by Saudi foreign fighters; the latter, established in the summer, is led by Moroccan foreign fighters.
Both have attracted fighters of other nationalities, including some Syrians.
Outside of Latakia, the most notable independent formations are the Green Battalion and Jamaat Jund al-Sham.
The Green Battalion is based in the Qalamoun area of Damascus province and was founded in the summer by Saudi fighters who are of similar ideological orientation to ISIS and al-Nusra but had personal problems both groups.
However, in the recent intense battles in Qalamoun with regime forces and Shia militias, the Green Battalion co-ordinated operations with ISIS and al-Nusra.
Jamaat Jund ash-Sham was founded last year by Lebanese fighters in western Homs governorate but has since incorporated many Syrians into its ranks. Ideologically, it is close to ISIS and al-Nusra, and nothing suggests personal tensions with either organisation.
Other foreign fighter groups are or have been mere fronts for ISIS. The most notable case is Jaysh al-Muhajirin wa al-Ansar, based primarily in Aleppo, Idlib and Latakia provinces.
In May, its leader- Omar al-Shishani - was appointed northern commander for ISIS by Abu Bakr al-Baghdadi, with authority over Aleppo, Raqqa, Latakia and northern Idlib provinces.
From that time until late November, Jaysh al-Muhajirin became synonymous with ISIS, both in its own discourse and in the eyes of other rebels.
Yet since late November, Jaysh al-Muhajirin has split, with Shishani and his followers now only identifying themselves as part of ISIS, and those wanting to operate as an independent group appointing a new commander: Salah al-Din al-Shishani.
Also in November, an independent group of foreign fighters in Latakia - the Lions of the Caliphate Battalion, led by Abu Muadh al-Masri - pledged formal allegiance to ISIS.
The concluding question that vexes governments is what kind of threat, if any, these foreign fighters may pose to the outside world.
Of all the above groups, ISIS most openly expresses the ultimately global nature of its struggle, in which the end goal is world domination, delusional as that may seem.
Indeed, it is likely for this reason that ISIS appears to be attracting the most foreign fighters, who generally come from global jihadist ideological backgrounds and already had this worldview before coming to Syria.
At the same time, ISIS fighters and supporters make clear to me that a fight against the UK, for example, is destined for the far future, after an Islamic state is established in Iraq and Syria and then extended throughout the Muslim world as a caliphate.
Some statements purportedly from ISIS and al-Nusra have appeared with threats to attack Turkey, but these have all been forgeries from pro-Assad circles.
As for the other groups, the testimony of one fighter who went to Latakia has suggested that Harakat Sham al-Islam is using Syria as a training ground to prepare to fight the government in Morocco - something that has otherwise not appeared in the group's discourse.
As an official al-Qaeda affiliate, al-Nusra is committed to a transnational project of a caliphate, but its leader and its native Syrian component tend not to talk openly about such a goal. Instead, they emphasise the more immediate objective of establishing Islamic law for the people of Syria.
Given the protracted nature of the conflict in Syria that will likely continue without a meaningful peace agreement for at least 10 to 15 years, the problem of inflow of foreign fighters will remain for quite some time to come.
At present, however, there is little that can be done beyond pressuring Turkey (which it can be argued has for a while turned a blind eye partly in the belief that the foreign fighters are useful proxies against Syrian Kurdish militias seen as the greater threat) to take rigorous measures to crack down on smuggling networks for foreign fighters and adopt more thorough vetting policies at airports.
To be sure, Turkey has always denied facilitating the inflow of foreign fighters, but testimony from both foreign fighters and those who run smuggling networks points to neglect on the part of Turkish authorities.
To a lesser extent, Iraq and Lebanon have also served as conduits for foreign fighters - both Shia and Sunni.
However it is not only lack of central government control over porous border areas which has enabled foreign fighters to reach Syria from Iraq and Lebanon.
Factionalism, sectarianism and dysfunction have also led to a lack of united effort and willpower to deal with the problem.