We can be sure that Jesus himself knew, and we can also be sure that the Last Supper is covered by all Gospels, so we have multiple sources to help explain the thoughts and proceedings of what happened (All quotes will be from the ESV unless otherwise stated).
The conversation is recorded in Matthew 26, Mark 14, Luke 27, and, as mentioned in the Question, John 13. The passages are provided below:
Matthew 21-23,25: "And as they were eating, he said, 'Truly, I say to you, one of you will betray me.' And they were very sorrowful and began to say to him one after another, 'Is it I, Lord?' He answered, 'He who has dipped his hand in the dish with me will betray me'... ...Judas, who would betray him, answered, 'Is it I, Rabbi?' He said to him, “You have said so.'"
Mark 14:18-20: "And as they were reclining at table and eating, Jesus said, 'Truly, I say to you, one of you will betray me, one who is eating with me.' They began to be sorrowful and to say to him one after another, 'Is it I?' He said to them, 'It is one of the twelve, one who is dipping bread into the dish with me.'"
Luke 22:3: "Then Satan entered into Judas called Iscariot, who was of the number of the twelve."
John 13:21-27: "After saying these things, Jesus was troubled in his spirit, and testified, 'Truly, truly, I say to you, one of you will betray me.' The disciples looked at one another, uncertain of whom he spoke. One of his disciples, whom Jesus loved, was reclining at table at Jesus' side, so Simon Peter motioned to him to ask Jesus of whom he was speaking. So that disciple, leaning back against Jesus, said to him, 'Lord, who is it?' Jesus answered, 'It is he to whom I will give this morsel of bread when I have dipped it.' So when he had dipped the morsel, he gave it to Judas, the son of Simon Iscariot. Then after he had taken the morsel, Satan entered into him. Jesus said to him, 'What you are going to do, do quickly'."
Out of these, Luke does not mention that he said it out loud, but the rest tell us a complete story.
Jesus washes the disciples' feet, afterwards they start to eat. Jesus tells them that someone will betray him, furthermore, it will be one of the twelve. He then adds more details, which are recorded in John: "It is he to whom I will give this morsel." He then gives it to Judas - simple. Jesus cryptically tells him to "do it" - this would confuse me, as it confused the disciples. The gospels have the gift of 20/20 hindsight, but in the moment, none of the twelve knew that Jesus needed to die to complete His mission. Despite the fact that He had been telling them (Matthew 16:21-22):
"From that time Jesus began to show his disciples that he must go to Jerusalem and suffer many things from the elders and chief priests and scribes, and be killed, and on the third day be raised. And Peter took him aside and began to rebuke him, saying, "Far be it from you, Lord! This shall never happen to you."
The disciples were likely still convinced He would deliver them from Rome. Thus, the point is, none of the disciples knew what the betrayal was, nor why Jesus was okay with it. Yet, as we see in John, they did indeed know that it would be Judas. I think that they were probably thinking that Judas would simply disavow Jesus; stop following him. Furthermore, Judas himself confirmed it when, in Matthew, Jesus tells him head-on it is him. As they often were, the disciples were simply confused about the nature of what Jesus was saying.
John 13:26-29: "Jesus said, 'The one to whom I give this crust of bread after I've dipped it.' Then he dipped the crust and gave it to Judas, son of Simon the Iscariot. As soon as the bread was in his hand, Satan entered him.
'What you must do,' said Jesus, 'do. Do it and get it over with.'
No one around the supper table knew why he said this to him. Some thought that since Judas was their treasurer, Jesus was telling him to buy what they needed for the Feast, or that he should give something to the poor" (MSG).
Jesus predicts his death, Wikipedia
The Last Supper, Wikipedia