The Mishna (41b) tells of Rabban Gamliel and his comrades whose boat entered the port on Friday evening after it had already become night. Rabban Gamliel was asked whether they were allowed to disembark from the boat, or, perhaps they were restricted by the rules of tehum (=limits of) Shabbat to remain on the boat until Shabbat was over, since they were not within the boundaries of the city when Shabbat began. Rabban Gamliel responded that ordinarily one could not leave the ship, but that in this case he checked and saw that they had entered the 2,000-ama boundary of the city prior to the onset of Shabbat.
In order to clarify this issue, the Gemara cites that which was taught in a: Rabban Gamliel had a special tube through which he would look and see a distance of two thousand cubits on land, and also determine a corresponding distance of two thousand cubits at sea.
Maimonides and the Geonim identify this tube (“shfoferet”) as an engineering instrument similar to a protractor, which was also used for measuring in astronomy. This sextant – called, in the days of the Mishna, an astrolabe – allowed accurate measurements to be taken by examining the angle between two things, or between the instrument itself and a fixed spot. Even today, similar instruments based on these principles are used for purposes of surveying and mapping.
The Jerusalem Talmud asks why Rabban Gamliel was at all concerned with disembarking from the boat, since his opinion, as recorded in the Mishna in the case of someone who was transferred to a different city and put in jail, permits free access to one who enters a new tehum area on? They answer that this must have been a situation where the port was not surrounded by walls, where even Rabban Gamliel would have restricted the travelers to four cubits. The Ritva and Rashba explain that our Gemara is not concerned with this question. Apparently we are to understand that while Rabban Gamliel was not concerned about getting off the boat himself, he recognized that his fellow travelers – Rabbi Yehoshua and Rabbi Akiva – would not disembark due to their position on this matter. Keeping track of the distance to land was something that Rabban Gamliel did to accommodate those whose opinion on this halakha differed from his own.