In (Jn. 13), we are approaching the final act of the gospel. Jesus has made His entrance into Jerusalem, the hour of the cross has come. In the following few scenes, Jesus will begin teaching and preparing His disciples for His departure.
John is a beautiful account of the life and ministry of Jesus. He tells us why he is writing his account:
John 20:31 “but these are written that you may believe that Jesus is the Christ, the Son of God, and that believing you may have life in His name.”
John is writing to know and believe in Jesus, the Anointed of God. In doing so, John gives us so much to consider. For example, in our text today, I believe we find a glimpse of the glory of Jesus and the meaning of the gospel in the example of Jesus washing the disciple's feet.
TO THE FATHER
“Now before the Feast of the Passover, when Jesus knew that His hour had come that He should depart from this world to the Father, having loved His own who were in the world, He loved them to the end.” (emph. added)
As we have read and noticed, the words of Jesus, his time, or his hour had not yet come. However, in (Jn. 12), Jesus says, "The hour has come that the Son of Man should be glorified." (ref. Jn. 12:23). Jesus was to be "lifted up" (ref. 12:32ff); He said these things to signify the type of death He would experience, referencing the cross. But what do we learn new in (Jn. 13)? Jesus will depart from this world to the Father.
What is John doing? John is keying us into the mission of Jesus. In (Jn. 13), as Jesus washes the disciple's feet, we need to read carefully.
“Now before the Feast of the Passover, when Jesus knew that His hour had come that He should depart from this world to the Father, having loved His own who were in the world, He loved them to the end. And supper being ended, the devil having already put it into the heart of Judas Iscariot, Simon’s son, to betray Him, 3 Jesus, knowing that the Father had given all things into His hands, and that He had come from God and was going to God”
N. T. Wright brilliantly describes how John sets up the rest of his gospel from these first three verses.
“The first three verses form a detailed introduction both to the footwashing scene and to the whole of the rest of the book. Watch how John, like a brilliant artist, fills in the background with three quick strokes of the brush. Understand each of these, and you’ll see not only what the footwashing meant but also what Jesus’ death and resurrection mean.” 
If I may do my best to summarize what N. T. Wright describes in his commentary:
First, the scene is before the feast of the Passover. When John mentions the Passover, we know that he wants us to understand that Jesus is applying the Passover meaning to Himself. He is the Passover lamb (1:29; 36). At Passover, Jesus spoke of the Temple being destroyed and rebuilt - speaking of His body (2:19-21). Jesus feeds the multitudes (Jn. 6) at Passover-time as He taught about His body and blood. John wants us to see that Jesus is the fulfillment of the Passover.
Second, Jesus' time had come. And it's not just that Jesus will die on the cross. It goes beyond this. Jesus will leave this world and go to the Father. It's not just that Jesus will die. He will be resurrected raised to new life.
Third, what is now done is the action of supreme love. Going back to the "Good Shepherd" (Jn. 10), the greatest thing the shepherd can do is to lay down his life for the sheep. Jesus "loved them to the end" (He loved them to the uttermost).
WASHING THE DISCIPLE'S FEET
Moving back to the text, John records:
“And supper being ended, the devil having already put it into the heart of Judas Iscariot, Simon’s son, to betray Him, 3 Jesus, knowing that the Father had given all things into His hands, and that He had come from God and was going to God, 4 rose from supper and laid aside His garments, took a towel and girded Himself. 5 After that, He poured water into a basin and began to wash the disciples’ feet, and to wipe them with the towel with which He was girded. 6 Then He came to Simon Peter. And Peter said to Him, “Lord, are You washing my feet?” 7 Jesus answered and said to him, “What I am doing you do not understand now, but you will know after this.” 8 Peter said to Him, “You shall never wash my feet!” Jesus answered him, “If I do not wash you, you have no part with Me.” 9 Simon Peter said to Him, “Lord, not my feet only, but also my hands and my head!” 10 Jesus said to him, “He who is bathed needs only to wash his feet, but is completely clean; and you are clean, but not all of you.” 11 For He knew who would betray Him; therefore He said, “You are not all clean.”