0 1 00:00:00,210 --> 00:00:02,420 Hi guys! It's Angela from the App Brewery. 1 2 00:00:02,430 --> 00:00:08,610 And in this lesson, we're going to deep dive into how exactly does the Internet actually work. 2 3 00:00:08,640 --> 00:00:13,600 Because here's the thing that we use every single day and we completely take it for granted. 3 4 00:00:13,740 --> 00:00:19,020 So before we start developing awesome websites and web apps for people to access through the Internet, 4 5 00:00:19,290 --> 00:00:25,440 it's really important that we understand the fundamentals of how the Internet actually works. 5 6 00:00:25,440 --> 00:00:27,840 So what exactly is the Internet? 6 7 00:00:27,840 --> 00:00:30,610 Well, a lot of people think of it as a cloud. 7 8 00:00:30,690 --> 00:00:36,510 Something that's hanging around in the sky. It's super complex; super difficult to understand, but actually 8 9 00:00:36,570 --> 00:00:37,890 that's not it at all. 9 10 00:00:37,890 --> 00:00:39,520 The Internet is really simple. 10 11 00:00:39,600 --> 00:00:42,860 All it is is just a long piece of wire. 11 12 00:00:43,110 --> 00:00:46,610 And the wire connects different computers to each other. 12 13 00:00:46,830 --> 00:00:52,230 So you might have one computer that's in Seattle and another computer that's in London. And they can 13 14 00:00:52,230 --> 00:00:56,230 talk to each other and transfer data through this giant wire. 14 15 00:00:56,340 --> 00:01:01,250 Now some of these computers attached to the internet have a very special job. 15 16 00:01:01,290 --> 00:01:08,900 They have to be online 24/7, ready to serve you all of the data and the files that you are requesting 16 17 00:01:08,940 --> 00:01:14,700 when you try to access websites. And the computers that are doing that job, we would call a server. And 17 18 00:01:14,700 --> 00:01:19,440 the computers that any user would use to access the internet is called a client. 18 19 00:01:19,440 --> 00:01:25,830 Now you can imagine a web server as a giant library that's open 24/7. And you can go in there at any 19 20 00:01:25,890 --> 00:01:31,680 hour of the day and request "I want to see Google's home page" or "I want to see the latest post on Tech 20 21 00:01:31,680 --> 00:01:37,050 Crunch". And it would be up to serve you with all of the files and data that you would need to be able 21 22 00:01:37,050 --> 00:01:40,200 to view whatever website it is that you requested. 22 23 00:01:40,200 --> 00:01:45,570 Now you can imagine if there's a library that's big enough to house all of these websites. then it's 23 24 00:01:45,570 --> 00:01:50,910 going to be pretty difficult to quickly locate the thing that you want out of this giant library, 24 25 00:01:50,910 --> 00:01:51,310 right? 25 26 00:01:51,420 --> 00:01:53,840 So how is this problem solved on the Internet? 26 27 00:01:53,880 --> 00:01:59,130 Well, let's say that you're sitting at home on your computer and you type in google.com because you 27 28 00:01:59,130 --> 00:02:02,270 want to head over to the main Google home page. 28 29 00:02:02,280 --> 00:02:08,980 What happens behind the scenes is that your browser will send a message to your Internet service provider. 29 30 00:02:09,120 --> 00:02:13,010 So these are the people who you pay to be able to access the Internet. 30 31 00:02:13,110 --> 00:02:18,810 And if you're in the US, that's a company like AT&T or Comcast. And if you're in the U.K. then that would 31 32 00:02:18,810 --> 00:02:20,760 be something like BT or TalkTalk. 32 33 00:02:20,760 --> 00:02:28,050 Now the message that you're sending the ISP is "I want to see google.com". And the ISP will then relay 33 34 00:02:28,050 --> 00:02:36,030 that message to something called a DNS server - a domain name system server. And a DNS server is essentially 34 35 00:02:36,030 --> 00:02:38,190 just a souped up phone book. 35 36 00:02:38,220 --> 00:02:45,390 And what happens when you make that request through your browser is the DNS server will look up in its 36 37 00:02:45,390 --> 00:02:52,770 database as to what is the exact IP address of that website that you're trying to access. And every 37 38 00:02:52,770 --> 00:02:57,330 single computer that's connected to the internet has an IP address. 38 39 00:02:57,330 --> 00:03:03,330 This is like a postal address for your computer. So that when people need to send and receive files on 39 40 00:03:03,330 --> 00:03:08,100 the Internet, each computer can be located by a unique IP address. 40 41 00:03:08,100 --> 00:03:14,040 And once that DNS server finds the IP address, it sends that back to your browser. 41 42 00:03:14,040 --> 00:03:19,230 So now you know the exact address where you can find the Google home page. 42 43 00:03:19,260 --> 00:03:25,920 So, the next thing that happens, is you will send a direct request to that address through your Internet 43 44 00:03:25,920 --> 00:03:26,950 service provider. 44 45 00:03:27,000 --> 00:03:32,000 And this message will be delivered via what's called the Internet backbone. 45 46 00:03:32,000 --> 00:03:36,750 Now, the Internet backbone isn't some sort of analogy for some clever programming. 46 47 00:03:36,750 --> 00:03:39,630 It's literally the backbone of the Internet. 47 48 00:03:39,840 --> 00:03:47,910 And if you had a submarinecablemap.com, you can view all of the underwater cables that power the 48 49 00:03:47,910 --> 00:03:55,380 Internet. And the Internet is made up of these huge sprawling masses of wires, connecting all of the world's 49 50 00:03:55,410 --> 00:03:57,810 Internet users. As you can imagine 50 51 00:03:57,840 --> 00:04:00,000 it's a pretty complex world out there. 51 52 00:04:00,030 --> 00:04:07,350 Now, if I'm sitting in London and I want to see a website that's hosted in the United States, then my 52 53 00:04:07,350 --> 00:04:12,780 browser would have to make a request that goes through one of these cables under the Atlantic Ocean 53 54 00:04:13,140 --> 00:04:15,200 in order to reach the United States. 54 55 00:04:15,300 --> 00:04:21,390 And once that computers receive my request, they'll send back all of the relevant data. Again, through 55 56 00:04:21,390 --> 00:04:27,630 these giant cables. And to navigate all of this crazy underwater and above water wires, 56 57 00:04:27,690 --> 00:04:30,180 all I have is an IP address. 57 58 00:04:30,180 --> 00:04:36,180 It's like as if I'm sending a letter halfway across the world and my only hope for my letter to reach 58 59 00:04:36,180 --> 00:04:39,710 my friend is that postal address on the front of the envelope. 59 60 00:04:39,720 --> 00:04:46,200 So, once I've gotten the IP address of the website that I want to access, then my browser sends another 60 61 00:04:46,200 --> 00:04:53,190 message through the Internet service provider via the Internet backbone to the server that is located 61 62 00:04:53,280 --> 00:05:01,950 at that address 216.58.210.46. And the computer that's located at that address is of course the 62 63 00:05:01,950 --> 00:05:08,640 Google server. And on this server, there's all of the files I would need in order to be able to view the 63 64 00:05:08,640 --> 00:05:10,030 Google home page. 64 65 00:05:10,140 --> 00:05:15,930 So, the server then sends all of those files back to me through the Internet backbone and I get to see 65 66 00:05:15,930 --> 00:05:21,930 the Google home page in my browser. And all of that happens in a matter of milliseconds. 66 67 00:05:22,020 --> 00:05:27,720 And just to imagine the journey that my data has gone on, travelling through the world thousands of times 67 68 00:05:27,720 --> 00:05:28,380 per day. 68 69 00:05:28,530 --> 00:05:30,060 So, why don't you give it a go? 69 70 00:05:30,150 --> 00:05:39,630 Open up your browser and type in 216.58.210.46 and hit enter to see the Google home page being 70 71 00:05:39,630 --> 00:05:43,190 served up to you being served up to you through the Internet.