Reference for Sukkah 51:3
ת"ר הולכי דרכים ביום פטורין מן הסוכה ביום וחייבין בלילה הולכי דרכים בלילה פטורין מן הסוכה בלילה וחייבין ביום הולכי דרכים ביום ובלילה פטורין מן הסוכה בין ביום ובין בלילה הולכין לדבר מצוה פטורין בין ביום ובין בלילה כי הא דרב חסדא ורבה בר רב הונא כי הוו עיילי בשבתא דרגלא לבי ריש גלותא הוו גנו ארקתא דסורא אמרי אנן שלוחי מצוה אנן ופטורין
Our rabbis taught: Day travelers are exempt from the sukkah during day but are obligated at night. Night travelers are exempt from the sukkah at night, but are obligated during the day. Travelers by day and night are exempt both day an night. Those who are going to perform a mitzvah are exempt both by day and by night. As in the case of R. Hisda and Rabbah son of R. Huna who, when they went up to the house of the Exilarch on the Shabbat of the Festival, slept on the river bank of Sura, saying, ‘We are messengers engaged on a mitzvah and are exempt.’