By "ancient times" I'm primarily interested in Greek and Roman periods, but other historical periods before the Industrial Revolutions are also welcome.
By "traveling long distances" I'm primarily interested in the ancient Silk Road and the Indian Ocean trading network.
Oh man, this is a really cool question, and I'll answer it as well as I can. I'll start by discussing the ancient Silk Road, because bad news always comes first. We know virtually nothing about a land route between Rome and China, if there actually was one. We know about routes between Parthia and China (Chinese envoys were generally received with high aplomb and they lavished gifts on each other), and we have a few trade cities that sprung up on the eastern frontiers of the Roman Empire (and a bit beyond, really, which is potentially why they were so prosperous). You may have heard of these names a couple of times: Petra and Palmyra. Petra is famous because of its glorious, extant, architecture, even if most of it is closed to tourists for the purpose of preservation (see: tourists who vandalize ancient sites, like carving their names into the Colosseum or stealing pieces of Pompeii). Palmyra is famous for a much sadder reason: the ancient site recently suffered enormous damage at the hands of IS. Both of these sites were trade cities. Petra was a "Last gas station for the next hundred miles" kinda place - it was built around an oasis and water was one of its most precious resources. As a result, it became the natural gathering point for merchants heading both east and west, and its prosperity fueled the Nabatean Kingdom for centuries. Goods came in, merchants were taxed appropriately, merchants bought the supplies that they would need for their journey, and merchants sold goods to those who wanted them. It was a busy and prosperous place and, if there was a Silk Road between Rome and China (again, unknown because we have no direct evidence for one), this would be the city where it started and ended.
What is more likely, however, is the idea of periodic trade. For example, the Periplus of the Erythrian Sea records that:
There is a very great inland State called Thina (China). From there, silk floss, yarn, and cloth are transported by land via Bactria to Barygaza and via the Ganges River to the Malabar Coast.
From there, Roman merchants avidly traded for these resources, selling them for a huge markup back in Rome. Another example of periodic trade is the idea that Chinese merchants would sell goods to nomads, who would trade these goods among each other across the steppe until they reached Rome through a more northern town - Palmyra. There are no extant documents about the silk trade in Palmyra, though there's plenty about trade in general, but there's a huge amount of physical evidence (literally thousands of fragments of silk and other foreign textiles) that has been found at the site. Palmyra, like Petra, was a caravan city. It was founded around an oasis, and was the last port of call for merchants heading East - this time, more heavily focused directly toward Parthia. Like Petra, Palmyra was founded independently, but unlike Petra, it was conquered much earlier, and therefore gives an example of a city directly under Roman auspices. And it seems like that overhead didn't hurt the city at all - in fact, Palmyra just continued to grow and develop, with its apex sometime in the second century.
These cities were responsible for guarding the roads nearby - as caravan cities, they had a special interest in chasing off bandits, and there are epigraphic texts attesting to relatively nearby cities fending off bandits (and being rewarded for doing so). Here's a letter from Commodus to Boubon, a small town in Lycia (trust me on this one - I'll bold the part where the actual letter starts):
Imperator Caesar, son of the divine Marcus Antoninus Pius Germanicus Sarmaticus, grandson of the divine Pius, great-grandson of the divine Hadrianus, descendant of the divine Traianus Parthicus and of the divine Nerva, Marcus Aurelius Commodus Antoninus Pius Felix Augustus Sarmaticus Germanicus Maximus Britannicus, pontifex maximus, holder of the tribunician power for the fifteenth time, imperator for the eighth time, consul for the sixth time, pater patriae, greets the magistrates, the council, and the people of Boubon. I have commended you for your zeal and bravery and I have endorsed the (decision of the) federal council of the Lycian League. For you set out with such great zeal to catch the brigands and you defeated them, and either killed or took them captive; and the Lycian League acted justly when, in response to those (deeds), it bestowed upon you the appropriate honor of increasing your votes by one. This was bound to enhance your reputation, and it made others more eager toward such brave deeds. I have therefore confirmed the decision taken at the sitting of the federal (body) and have permitted you to be counted henceforth among the cities that own three votes. The embassy was undertaken by Meleager, son of Meleager, grandson of Artemon. Be happy.
And you thought Daenarys had a long title ;) Here's another example that actually directly concerns Palmyra (and the subject at hand):
[The statues?], this one in [the temple of Athen]a, one in the sacred garden, and one in the temple of Atargatis, [which] have been erected next to the first four statues that were erected by the first caravan (synodia) for Soados son of Boliades son of Thaimisamsos, who is pious and patriotic, through his benevolence and magnanimity towards the citizens in every way, adorned with distinctions and very great honours, the caravan (synodia) of all Palmyrenes which came back from Vologaesias erected, because he advanced in a distinguished manner, taking with him a large force, and he protected (them) against [Ab]dallathos from Eeithe and those ('the robbers' in the Palmyrene text) that were brought together by him from P[ .......] who for a long time were lying in wait in order to harm the [caravan...] he preserved them. Therefore they erected for him [the statues?] to honour him, when Male son of Sumonos [.....] and [E]nnibel son of Sumonos son of Bazekes were caravan-leaders (συνοδιαρχούντων) in the year 455 (144 CE) month Daisius (June).
There are a pretty decent number of these, highlighting how, despite being a part of the Roman Empire, Palmyra maintained its own military force specifically to handle the prevalence of banditry in the region. If a certain area was dangerous for merchants, this military would neutralize the threat. The surrounding desert was regularly patrolled, units were stationed along the river, even on the islands in the middle of the Euphrates. The city did its best to facilitate and encourage this trade, providing pack animals to both go to the Euphrates and a trade station at the Euphrates to come back to Palmyra specifically. Basically, Palmyra did its best to say "Hey! Look! We've got a safer, easier, more comfortable route to India than sailing the Red Sea!" They also maintained an excellent relationship with Parthia, ensuring that the Persian Kingdom treated their merchants well.
So, let's look at how those merchant caravans were organized! A caravan was formed when a certain number (Probably a large number, in the hundreds) of merchants banded together to work together to reach a common goal. They would elect a leader, a head-merchant if you will, who would be responsible for the logistics of travel and for speaking on behalf of the group to negotiate collective deals. The members of the caravan would each contribute to a common pool of money, administered by the head-merchant, which would pay for the armed guards (which every caravan would hire), tolls, "protection money" (read: bribes), etc. These individual contributions may have been funded by a wealthy benefactor back home who sponsored said merchant, but they were paid nonetheless. Those guards came in handy on a regular basis, too - there's an inscription in 199 that honours Ogelos, son of Makkaios for "having given satisfaction through continued commands against the nomads, and having provided safety for the merchants and the caravans in all his commands of caravans." They were organized guards who had made this job their livelihood - and it paid dividends for all parties involved.