In Act II Macbeth kills Duncan, and in Scene II of
Act II is when the Porter enters into the scene. The Porter makes a comment saying he was the keeper of Hell's gates. As the
scene goes along, there is a the at the door, and the Porter wounder if it was Beelzebub, the cheif devil. But it
turned out to be Macduff and Lennox instread. I believe the function of the Porter scene is to show the depth of sin
that Macbeth had comminted. Macbeth had killed Duncan, out of greed and envy. The Porter was only speaking to himself about
the devilish deeds that Macbeth had comminted.
To connect the Porter scene with the events at the castle that night:
At the castle that night Lady Macbeth planned
to get all the guards drunk, get Macbeth to kill Duncan, and plant the sward on a guard. When Duncan and Lennox arrive at
the castle, the murders had already occured. Duncan went up to where King Duncan had sleeped and found him dead. Duncan was
terrified for his life so he ran, and in a sence he was running from hell.