The Pandava brothers had agreed that Draupadi will spend one year in the palace of each of the brothers. If incase any of them happens to interfere with that, they would spend 12 years in exile.
Arjuna once heard the a few brahmanas weeping who had been robbed of their cows. Arjuna promised to bring back their cows but unfortunately his weapons were in Yudhisthira’s chamber. Since Draupadi was spending time in Yudhisthira’s palace, Arjuna couldn’t enter the same. Bound by Dharma to save the Brahmanas’ cows, Arjuna dared to enter the chamber of Yiudhisthira. He quickly entered the chamber, took his weapons and left the palace immendiately. After defeating the robbers, Arjuna returned the cows to the Brahmanas. Returning to the palace, he sought the blessings of Yudhisthira to leave the palace. Yudhisthira pleaded to Arjuna that he need not follow the agreement so strictly and he was okay with Arjuna entering their chambers. He assured Arjuna that he had done nothing wrong and infact had done the right thing is helping the Brahmanas.
Arjuna stuck to his decision and left on a 12 year exile. While Arjuna was bathing on the banks of Ganga, he was dragged into the river by Ulupi, the daughter of the King of Nagas. She took him to the beautiful palace which was decked with jewels. She also expressed her desire to marry Arjuna. Arjuna was shocked at this and mentioned that he was married to Draupadi and that he was leading a life of celibacy in exile. Ulupi was stubborn and said that she would give up her life if Arjuna did not marry her. Arjuna bound by her love, married her. Ulupi gave a boon to Arjuna saying that the creatures under the water will always be Arjuna’s friends. Iravan was the son born to Arjuna and Ulupi.