What is the connection between the succah and the messianic era?
In the prophets as well as the Kabbalistic sources, we find that sukkot has a special relationship with the messianic era and a unique connection to the nations of the world.
As the spiritual climax of the year, sukkot is full of deep allusions to the messianic era - the spiritual climax of world history.
Vilna Gaon.
The ceremonies of sukkot clearly show the theme of redemption.
Pesach reminds us of creation - festival of Israels national creation, celebrated in spring (rebirth).
Shavuot commemorates Revelation of Hashem at Sinai, we celebrate with all night study.
Sukkot however, looks ahead to the final redemption. In the hoshannot we call out to Hashem to "please save us" (hoshiana na) The arba minim symbolising all the people of Israel joined together as one united group, hinting to the future.
Another allusion to the connection between sukkot and the mesianic era can be found in the haftarah for sukkot which describes the prophecy of the war of Gog and Magog.
(א) הִנֵּ֥ה יֽוֹם־בָּ֖א לַֽה' וְחֻלַּ֥ק שְׁלָלֵ֖ךְ בְּקִרְבֵּֽךְ׃ (ב) וְאָסַפְתִּ֨י אֶת־כָּל־הַגּוֹיִ֥ם ׀ אֶֽל־יְרוּשָׁלִַם֮ לַמִּלְחָמָה֒ וְנִלְכְּדָ֣ה הָעִ֗יר וְנָשַׁ֙סּוּ֙ הַבָּ֣תִּ֔ים וְהַנָּשִׁ֖ים תשגלנה [תִּשָּׁכַ֑בְנָה] וְיָצָ֞א חֲצִ֤י הָעִיר֙ בַּגּוֹלָ֔ה וְיֶ֣תֶר הָעָ֔ם לֹ֥א יִכָּרֵ֖ת מִן־הָעִֽיר׃ (ג) וְיָצָ֣א ה' וְנִלְחַ֖ם בַּגּוֹיִ֣ם הָהֵ֑ם כְּי֥וֹם הִֽלָּחֲמ֖ו בְּי֥וֹם קְרָֽב׃
(ט) וְהָיָ֧ה ה' לְמֶ֖לֶךְ עַל־כָּל־הָאָ֑רֶץ בַּיּ֣וֹם הַה֗וּא יִהְיֶ֧ה ה' אֶחָ֖ד וּשְׁמ֥וֹ אֶחָֽד׃
(יא) וְיָ֣שְׁבוּ בָ֔הּ וְחֵ֖רֶם לֹ֣א יִֽהְיֶה־ע֑וֹד וְיָשְׁבָ֥ה יְרוּשָׁלִַ֖ם לָבֶֽטַח׃
(טז) וְהָיָ֗ה כָּל־הַנּוֹתָר֙ מִכָּל־הַגּוֹיִ֔ם הַבָּאִ֖ים עַל־יְרֽוּשָׁלִָ֑ם וְעָל֞וּ מִדֵּ֧י שָׁנָ֣ה בְשָׁנָ֗ה לְהִֽשְׁתַּחֲוֺת֙ לְמֶ֙לֶךְ֙ ה' צְבָא֔וֹת וְלָחֹ֖ג אֶת־חַ֥ג הַסֻּכּֽוֹת׃
(1) Lo, a day of the LORD is coming when your spoil shall be divided in your very midst! (2) For I will gather all the nations to Jerusalem for war: The city shall be captured, the houses plundered, and the women violated; and a part of the city shall go into exile. But the rest of the population shall not be uprooted from the city. (3) Then the LORD will come forth and make war on those nations as He is wont to make war on a day of battle. (4) On that day, He will set His feet on the Mount of Olives, near Jerusalem on the east; and the Mount of Olives shall split across from east to west, and one part of the Mount shall shift to the north and the other to the south, a huge gorge. (5) And the Valley in the Hills shall be stopped up, for the Valley of the Hills shall reach only to Azal; it shall be stopped up as it was stopped up as a result of the earthquake in the days of King Uzziah of Judah.—And the LORD my God, with all the holy beings, will come to you. (6) In that day, there shall be neither sunlight nor cold moonlight, (7) but there shall be a continuous day—only the LORD knows when—of neither day nor night, and there shall be light at eventide. (8) In that day, fresh water shall flow from Jerusalem, part of it to the Eastern Sea and part to the Western Sea, throughout the summer and winter. (9) And the LORD shall be king over all the earth; in that day there shall be one LORD with one name. (10) Then the whole country shall become like the Arabah, from Geba to Rimmon south of Jerusalem. The latter, however, shall perch high up where it is, and shall be inhabited from the Gate of Benjamin to the site of the Old Gate, down to the Corner Gate, and from the Tower of Hananel to the king’s winepresses. (11) Never again shall destruction be decreed, and Jerusalem shall dwell secure. (12) As for those peoples that warred against Jerusalem, the LORD will smite them with this plague: Their flesh shall rot away while they stand on their feet; their eyes shall rot away in their sockets; and their tongues shall rot away in their mouths. (13) In that day, a great panic from the LORD shall fall upon them, and everyone shall snatch at the hand of another, and everyone shall raise his hand against everyone else’s hand. (14) Judah shall join the fighting in Jerusalem, and the wealth of all the nations roundabout—vast quantities of gold, silver, and clothing—shall be gathered in. (15) The same plague shall strike the horses, the mules, the camels, and the asses; the plague shall affect all the animals in those camps. (16) All who survive of all those nations that came up against Jerusalem shall make a pilgrimage year by year to bow low to the King LORD of Hosts and to observe the Feast of Booths. (17) Any of the earth’s communities that does not make the pilgrimage to Jerusalem to bow low to the King LORD of Hosts shall receive no rain. (18) However, if the community of Egypt does not make this pilgrimage, it shall not be visited by the same affliction with which the LORD will strike the other nations that do not come up to observe the Feast of Booths. (19) Such shall be the punishment of Egypt and of all other nations that do not come up to observe the Feast of Booths. (20) In that day, even the bells on the horses shall be inscribed “Holy to the LORD.” The metal pots in the House of the LORD shall be like the basins before the altar; (21) indeed, every metal pot in Jerusalem and in Judah shall be holy to the LORD of Hosts. And all those who sacrifice shall come and take of these to boil [their sacrificial meat] in; in that day there shall be no more traders in the House of the LORD of Hosts.
The next source shows the connection between the sukkah and the battle of Gog and Magog.
Rabbi Shimson Raphael Hirsch discusses the connection.
In the name Gog we see the word Gag, roof, something sturdy which has been built to protect us as opposed to the Sukkah which has a very weak roof made of twigs and branches.
Just as people have the power to make themselves safe and secure by building strong roofs, so they delude themselves into thinking they can make themselves safe from that which comes from above, namely Hashem . They think they can find security in the protection of their own might.
The battle of Gog and Magog is a battle of the Roof agaisnt the sukkah, the illusion of human strength and power against the sukkah truth of the confidence in Hashems protection.
Unlike all other festivals, the Temple offerings of Sukkot are dedicated to the nations of the world.
א"ר אליעזר הני שבעים פרים כנגד מי כנגד שבעים אומות
שבעים פרים - פרי החג שבעים הם חוץ משל שמיני כנגד שבעים אומות לכפר עליהם שירדו גשמים בכל העולם לפי שנידונין בחג על המים:
The Netziv explains that in the Days to come, the nations of the world will bring offerings to Jerusalem on Sukkot as we read in Zecharia ch. 14, in the full knowledge that their own well-being depends on the Temple.
Another prophecy of Yeshaya describes how foreign nations will come to Jerusalem to guard the people of Israel.
(ה) וְעָמְד֣וּ זָרִ֔ים וְרָע֖וּ צֹאנְכֶ֑ם וּבְנֵ֣י נֵכָ֔ר אִכָּרֵיכֶ֖ם וְכֹרְמֵיכֶֽם׃
Because the ultimate destiny of the world also includes the foreign nations, on Sukkot, the festival of destiny, we pray even for these seventy primary nations to reach their purpose.