1 00:00:00,810 --> 00:00:03,480 Layer five, the session layer. 2 00:00:03,480 --> 00:00:05,820 Now layer five is our session layer 3 00:00:05,820 --> 00:00:09,120 and we want to start thinking about what a session is. 4 00:00:09,120 --> 00:00:10,920 The way I like to think about a session is 5 00:00:10,920 --> 00:00:13,530 that it's a conversation that has to be kept separate 6 00:00:13,530 --> 00:00:17,340 from all of the others to prevent the intermingling of data. 7 00:00:17,340 --> 00:00:19,830 Now, if you think about yourself in a classroom setting, 8 00:00:19,830 --> 00:00:22,140 we might have 20 students sitting here. 9 00:00:22,140 --> 00:00:24,990 Now, if I wanted to ask a question to one student only 10 00:00:24,990 --> 00:00:26,730 everyone else can listen to it. 11 00:00:26,730 --> 00:00:28,110 Maybe I want to take that student 12 00:00:28,110 --> 00:00:29,940 and we're going to go walk out into the hallway 13 00:00:29,940 --> 00:00:31,410 so we can have our own session, 14 00:00:31,410 --> 00:00:33,030 our own private conversation, 15 00:00:33,030 --> 00:00:34,620 while all of the other 19 students 16 00:00:34,620 --> 00:00:36,120 can talk among themselves 17 00:00:36,120 --> 00:00:38,130 and they're having their own session. 18 00:00:38,130 --> 00:00:40,500 That way we can separate these two sessions apart 19 00:00:40,500 --> 00:00:42,750 and each of us can talk at the same time 20 00:00:42,750 --> 00:00:44,250 without interfering with the other, 21 00:00:44,250 --> 00:00:45,930 me and my student out in the hall 22 00:00:45,930 --> 00:00:49,320 and all the other 19 students sitting back in the classroom. 23 00:00:49,320 --> 00:00:50,859 Now, that's the idea here 24 00:00:50,859 --> 00:00:52,440 when we talk about the session layer, 25 00:00:52,440 --> 00:00:54,510 we have all sorts of data flying around 26 00:00:54,510 --> 00:00:56,340 our networks all day long, 27 00:00:56,340 --> 00:00:58,110 and by establishing these sessions, 28 00:00:58,110 --> 00:01:00,570 we can separate them to prevent the intermingling 29 00:01:00,570 --> 00:01:03,030 or cross-contamination of that data. 30 00:01:03,030 --> 00:01:05,430 Now what we're going to do is we're going to set up a session. 31 00:01:05,430 --> 00:01:06,477 We're going to maintain a session, 32 00:01:06,477 --> 00:01:08,370 and we're going to tear down a session, 33 00:01:08,370 --> 00:01:10,500 here inside the session layer. 34 00:01:10,500 --> 00:01:12,810 Now, what is setting up a session? 35 00:01:12,810 --> 00:01:15,330 This is where we're going to check our user credentials 36 00:01:15,330 --> 00:01:17,340 and we're going to assign a number to the session 37 00:01:17,340 --> 00:01:18,810 to help identify it. 38 00:01:18,810 --> 00:01:20,340 It's basically some random number 39 00:01:20,340 --> 00:01:22,620 that's going to allow us to negotiate services 40 00:01:22,620 --> 00:01:24,750 for that session with the server 41 00:01:24,750 --> 00:01:27,030 and then negotiate who's going to talk first, 42 00:01:27,030 --> 00:01:29,220 either the server or myself. 43 00:01:29,220 --> 00:01:31,770 Now, let's go back to our classroom setting once more. 44 00:01:31,770 --> 00:01:33,487 If Johnny asked me a question, he says, 45 00:01:33,487 --> 00:01:34,890 "Hey, professor Dion." 46 00:01:34,890 --> 00:01:36,390 I'll say, "Yes, Johnny?" 47 00:01:36,390 --> 00:01:37,350 And then guess what? 48 00:01:37,350 --> 00:01:38,610 We're going to start talking 49 00:01:38,610 --> 00:01:40,530 because we've established that session. 50 00:01:40,530 --> 00:01:42,570 I know that Johnny wants to talk to me, 51 00:01:42,570 --> 00:01:45,120 and Johnny knows that I'm ready to talk to him. 52 00:01:45,120 --> 00:01:47,550 Now I know who he is, he knows who I am, 53 00:01:47,550 --> 00:01:49,170 and we both know what each other wants. 54 00:01:49,170 --> 00:01:50,790 We want to start talking. 55 00:01:50,790 --> 00:01:51,900 In a computer network, 56 00:01:51,900 --> 00:01:53,400 it's a little bit more difficult, 57 00:01:53,400 --> 00:01:54,960 but that's really the idea behind it 58 00:01:54,960 --> 00:01:56,970 when we start talking about a session. 59 00:01:56,970 --> 00:01:58,560 Now, the next thing we have to do 60 00:01:58,560 --> 00:02:00,660 is we have to maintain this session. 61 00:02:00,660 --> 00:02:02,160 This is where we're going to transfer data 62 00:02:02,160 --> 00:02:04,080 back and forth across the network, 63 00:02:04,080 --> 00:02:05,700 over and over and over again. 64 00:02:05,700 --> 00:02:07,470 Going back to my classroom example, 65 00:02:07,470 --> 00:02:09,247 if Johnny asked me a question, I'd say, 66 00:02:09,247 --> 00:02:11,550 "Yes, go ahead and ask the question, Johnny." 67 00:02:11,550 --> 00:02:13,440 And then Johnny's going to ask his question. 68 00:02:13,440 --> 00:02:15,450 And at this point, we're maintaining a session. 69 00:02:15,450 --> 00:02:17,190 So here we are going back and forth, 70 00:02:17,190 --> 00:02:19,440 back and forth where I can answer their question 71 00:02:19,440 --> 00:02:22,650 and see if I can answer everything they have for me, right? 72 00:02:22,650 --> 00:02:25,380 Well, the same idea happens here inside our networks. 73 00:02:25,380 --> 00:02:27,150 Now that the session has been established, 74 00:02:27,150 --> 00:02:28,800 we're going to send all of our data back 75 00:02:28,800 --> 00:02:30,510 and forth over and over again. 76 00:02:30,510 --> 00:02:32,280 Now, if we have a break in the connection, 77 00:02:32,280 --> 00:02:34,500 we're going to have to reestablish our connection. 78 00:02:34,500 --> 00:02:35,977 So for instance, I might say, 79 00:02:35,977 --> 00:02:37,717 "I'm sorry, I didn't hear you, Johnny. 80 00:02:37,717 --> 00:02:39,330 "Can you repeat your question?" 81 00:02:39,330 --> 00:02:41,460 Again, I'm maintaining that session 82 00:02:41,460 --> 00:02:43,080 so that way I get what they want to tell me, 83 00:02:43,080 --> 00:02:44,610 and then I can answer them. 84 00:02:44,610 --> 00:02:47,310 Now also, I'm going to acknowledge the receipt of the data. 85 00:02:47,310 --> 00:02:49,620 I'll say, did you understand my answer, Johnny? 86 00:02:49,620 --> 00:02:51,990 And they'll say, "Yeah, I did," or "No, I didn't." 87 00:02:51,990 --> 00:02:54,420 And if they did, they'll acknowledge the receipt. 88 00:02:54,420 --> 00:02:55,987 If they didn't, they're going to tell me 89 00:02:55,987 --> 00:02:56,947 "No, I didn't understand. 90 00:02:56,947 --> 00:02:59,130 "Can you tell me that again a different way?" 91 00:02:59,130 --> 00:03:02,100 Well, the same thing happens digitally with your networks. 92 00:03:02,100 --> 00:03:04,410 And that brings us to the final area, 93 00:03:04,410 --> 00:03:05,640 tearing down a session. 94 00:03:05,640 --> 00:03:07,860 So now that the student's question has been answered 95 00:03:07,860 --> 00:03:10,057 in our analogy of the classroom, I'll say, 96 00:03:10,057 --> 00:03:12,090 "Johnny, does that answer your question?" 97 00:03:12,090 --> 00:03:14,370 And hopefully he'll say, "Yes, it does." 98 00:03:14,370 --> 00:03:15,203 And at that point I'll say, 99 00:03:15,203 --> 00:03:18,000 "Okay, we're going to move on to the next thing in the course." 100 00:03:18,000 --> 00:03:20,820 And as I say that, we're going to move on to the next question 101 00:03:20,820 --> 00:03:22,350 that tears down the session. 102 00:03:22,350 --> 00:03:24,510 The session between me and Johnny is done, 103 00:03:24,510 --> 00:03:25,980 and I'm going to go back to teaching. 104 00:03:25,980 --> 00:03:27,180 And if Johnny has another question, 105 00:03:27,180 --> 00:03:29,250 he's got to raise his hand again so that I can go 106 00:03:29,250 --> 00:03:30,960 and say, "Okay, Johnny, what's your question?" 107 00:03:30,960 --> 00:03:32,700 And we'll start a new session, right? 108 00:03:32,700 --> 00:03:34,680 That would be the end of that particular session, 109 00:03:34,680 --> 00:03:36,090 once I answer his question 110 00:03:36,090 --> 00:03:38,220 and got confirmation that he has it, 111 00:03:38,220 --> 00:03:39,900 then we can move on. 112 00:03:39,900 --> 00:03:42,780 Now, this is done based on this mutual agreement. 113 00:03:42,780 --> 00:03:44,520 Once we've transferred all the data 114 00:03:44,520 --> 00:03:45,960 back and forth we wanted to, 115 00:03:45,960 --> 00:03:48,990 we're going to verify that I'm ready to tear down the session. 116 00:03:48,990 --> 00:03:50,910 You're ready for the session to be torn down, 117 00:03:50,910 --> 00:03:53,490 and then we can tear down that session. 118 00:03:53,490 --> 00:03:55,290 The other way we could take down a session 119 00:03:55,290 --> 00:03:57,090 is if one of the parties disconnects 120 00:03:57,090 --> 00:03:59,010 and we simply can't reconnect to them. 121 00:03:59,010 --> 00:04:01,410 For instance, let's go back to my classroom example. 122 00:04:01,410 --> 00:04:02,760 Johnny asked a question, 123 00:04:02,760 --> 00:04:04,620 I go on a 30-minute diatribe 124 00:04:04,620 --> 00:04:06,540 trying to explain every possible thing 125 00:04:06,540 --> 00:04:07,890 to answer his question. 126 00:04:07,890 --> 00:04:09,630 And I look up and guess what? 127 00:04:09,630 --> 00:04:11,100 Johnny has his head down on the table 128 00:04:11,100 --> 00:04:12,060 and he's fallen asleep. 129 00:04:12,060 --> 00:04:13,740 I bored him to death. 130 00:04:13,740 --> 00:04:15,780 There's no way for me to maintain that session 131 00:04:15,780 --> 00:04:17,490 because he's not getting the information. 132 00:04:17,490 --> 00:04:20,160 He's completely asleep, he is dead asleep, 133 00:04:20,160 --> 00:04:21,990 and he is not listening anymore. 134 00:04:21,990 --> 00:04:24,600 Well, he has disconnected from this conversation, 135 00:04:24,600 --> 00:04:26,572 and therefore I can't re-engage, 136 00:04:26,572 --> 00:04:28,680 so I'm just going to stop teaching 137 00:04:28,680 --> 00:04:30,900 and move on to other students who are awake 138 00:04:30,900 --> 00:04:33,720 and are paying attention and actually have questions for me. 139 00:04:33,720 --> 00:04:36,000 That's the idea here with tearing down a session. 140 00:04:36,000 --> 00:04:37,560 This can be done either mutually, 141 00:04:37,560 --> 00:04:39,330 where we both have finished the communication 142 00:04:39,330 --> 00:04:40,357 and we say, "Yep, I'm done. 143 00:04:40,357 --> 00:04:42,990 "You're done, we understand each other," we move on. 144 00:04:42,990 --> 00:04:46,170 Or the other party simply disappears, in which case, 145 00:04:46,170 --> 00:04:47,820 I want to free up my resources 146 00:04:47,820 --> 00:04:49,350 so I can go help other people again. 147 00:04:49,350 --> 00:04:51,210 And that's what I would do as a computer. 148 00:04:51,210 --> 00:04:54,930 So what are some examples of layer five devices or protocols 149 00:04:54,930 --> 00:04:57,570 or things that you should associate with layer five? 150 00:04:57,570 --> 00:05:01,770 Well, the two big ones are H.323 and NetBIOS. 151 00:05:01,770 --> 00:05:04,290 Let's talk about H.323 first. 152 00:05:04,290 --> 00:05:06,930 H.323 is used to set up, maintain, 153 00:05:06,930 --> 00:05:09,660 and tear down voice and video connections. 154 00:05:09,660 --> 00:05:11,580 If you're using FaceTime or Skype 155 00:05:11,580 --> 00:05:12,750 or something like that, 156 00:05:12,750 --> 00:05:15,360 you're probably using something like H.323. 157 00:05:15,360 --> 00:05:17,970 These operate over the real time transport protocol, 158 00:05:17,970 --> 00:05:19,440 known as RTP. 159 00:05:19,440 --> 00:05:21,390 Anytime you see RTP, 160 00:05:21,390 --> 00:05:23,580 I want you to think about streaming audio 161 00:05:23,580 --> 00:05:24,780 or streaming video, 162 00:05:24,780 --> 00:05:26,760 generally in a two-way format, 163 00:05:26,760 --> 00:05:29,490 like a phone call or a FaceTime session. 164 00:05:29,490 --> 00:05:30,323 Keep those in your head 165 00:05:30,323 --> 00:05:31,680 and you're going to do great on the exam 166 00:05:31,680 --> 00:05:33,030 because they do like to throw those in, 167 00:05:33,030 --> 00:05:34,740 and I want you to see those. 168 00:05:34,740 --> 00:05:36,360 Now, the second thing I mentioned is that 169 00:05:36,360 --> 00:05:38,730 we have something known as NetBIOS. 170 00:05:38,730 --> 00:05:40,590 Now, NetBIOS is used by computers 171 00:05:40,590 --> 00:05:42,720 to share files over a network. 172 00:05:42,720 --> 00:05:44,310 Windows uses this as a method 173 00:05:44,310 --> 00:05:46,590 of its file sharing as well inside. 174 00:05:46,590 --> 00:05:48,840 So you're going to see it a lot on your networks. 175 00:05:48,840 --> 00:05:51,600 Now, again, when we talk about layer five devices, 176 00:05:51,600 --> 00:05:53,640 there's really not a device necessarily, 177 00:05:53,640 --> 00:05:55,890 but it's more these protocols and software. 178 00:05:55,890 --> 00:05:59,280 So if you see something like H.323, RTP, 179 00:05:59,280 --> 00:06:01,380 or NetBIOS, I want you to remember 180 00:06:01,380 --> 00:06:03,273 these are all layer five issues.