Photo from the Sukkot Exhibit, curtesy of Neot Kedumim Park
(ג) הָעוֹשֶׂה סֻכָּתוֹ...בְּרֹאשׁ הָאִילָן אוֹ עַל גַּבֵּי גָמָל, כְּשֵׁרָה, וְאֵין עוֹלִין לָהּ בְּיוֹם טוֹב. שְׁתַּיִם בָּאִילָן וְאַחַת בִּידֵי אָדָם, אוֹ שְׁתַּיִם בִּידֵי אָדָם וְאַחַת בָּאִילָן, כְּשֵׁרָה, וְאֵין עוֹלִין לָהּ בְּיוֹם טוֹב. שָׁלשׁ בִּידֵי אָדָם וְאַחַת בָּאִילָן, כְּשֵׁרָה, וְעוֹלִין לָהּ בְּיוֹם טוֹב. זֶה הַכְּלָל, כֹּל שֶׁנִּטַּל הָאִילָן וִיכוֹלָה לַעֲמוֹד בִּפְנֵי עַצְמָהּ, כְּשֵׁרָה, וְעוֹלִין לָהּ בְּיוֹם טוֹב:
In the case of one who establishes his sukka at the top of a tree or atop a camel, the sukka is fit, but one may not ascend and enter it on the first Festival day because the Sages prohibit climbing or using trees or animals on the Festival. If two of the walls of the sukka are in the tree and one is established on the ground by a person, or if two are established on the ground by a person and one is in the tree, the sukka is fit, but one may not ascend and enter it on the first Festival day because it is prohibited to use the tree. However, if three of the walls are established on the ground by a person and one is in the tree, then since it contains the minimum number of walls required, it is fit, and one may enter it on the first Festival day. The mishna summarizes that this is the principle: Any case where, were the tree removed, the sukka would be able to remain standing in and of itself, it is fit, and one may ascend and enter it on the Festival, since the tree is not its primary support.