WEBVTT

0
00:00.240 --> 00:02.820
Hey guys, it's Angela from The App Brewery

1
00:02.820 --> 00:05.040
and in this lesson we're going to deep dive

2
00:05.040 --> 00:08.610
into how exactly does the Internet work.

3
00:08.610 --> 00:11.220
So what exactly is the Internet?

4
00:11.220 --> 00:13.470
A lot of people think it's a cloud

5
00:13.470 --> 00:15.480
something that's hanging around in the sky.

6
00:15.480 --> 00:18.450
It's super complex, super difficult to understand

7
00:18.450 --> 00:20.490
but actually that's not it at all.

8
00:20.490 --> 00:23.160
The Internet is pretty simple.

9
00:23.160 --> 00:26.850
All it is is just a long piece of wire.

10
00:26.850 --> 00:29.700
And the wire connects different computers to each other.

11
00:29.700 --> 00:32.310
So you might have one computer that's in London

12
00:32.310 --> 00:35.160
and another one that's in Seattle, and they can talk

13
00:35.160 --> 00:38.640
to each other and transfer data through this giant wire.

14
00:38.640 --> 00:40.440
Now, some of these computers attached

15
00:40.440 --> 00:42.840
to the Internet have a very special job.

16
00:42.840 --> 00:47.100
They have to be online 24/7, ready to serve you all the data

17
00:47.100 --> 00:49.830
and files that you are requesting when you try to

18
00:49.830 --> 00:51.630
access a website,

19
00:51.630 --> 00:54.330
and these are called Servers.

20
00:54.330 --> 00:57.720
And what they do is they serve you all the data

21
00:57.720 --> 01:00.090
and files you need to be able to access

22
01:00.090 --> 01:02.340
and interact with certain websites.

23
01:02.340 --> 01:04.950
So these computers are called Servers,

24
01:04.950 --> 01:07.710
and any computer that a user would use to

25
01:07.710 --> 01:10.380
access the Internet is called a Client.

26
01:10.380 --> 01:12.360
Now, you can imagine a web server

27
01:12.360 --> 01:15.720
as a giant library that's open 24/7

28
01:15.720 --> 01:17.190
and you can go in there at any hour

29
01:17.190 --> 01:20.370
of the day and say, I want to see Google's homepage

30
01:20.370 --> 01:23.310
or I want to see the latest posts on TechCrunch,

31
01:23.310 --> 01:24.570
and it would be able to serve you

32
01:24.570 --> 01:27.180
with all the files and data you would need to

33
01:27.180 --> 01:29.490
be able to view whatever website you want.

34
01:29.490 --> 01:30.600
Now, as you can imagine

35
01:30.600 --> 01:32.905
if there's a library that's big enough to house all

36
01:32.905 --> 01:36.030
of these websites, then it's going to be pretty

37
01:36.030 --> 01:39.660
difficult to quickly locate the thing that you want

38
01:39.660 --> 01:42.120
out of this giant library, right?

39
01:42.120 --> 01:44.493
So how is this problem solved on the Internet?

40
01:45.330 --> 01:47.160
Well, let's say that you're sitting at home

41
01:47.160 --> 01:50.040
on your computer and you type in google.com

42
01:50.040 --> 01:53.340
because you want to head over to the main Google homepage.

43
01:53.340 --> 01:56.100
Well, what happens behind the scenes is

44
01:56.100 --> 01:59.760
that your browser will send that message

45
01:59.760 --> 02:03.240
to your ISP or your Internet Service Provider.

46
02:03.240 --> 02:05.400
So these are the people who you pay to be able to

47
02:05.400 --> 02:07.140
access the Internet.

48
02:07.140 --> 02:10.830
If you live in the US, that will be AT&amp;T or Comcast.

49
02:10.830 --> 02:12.300
And if you're in the UK,

50
02:12.300 --> 02:14.820
it'll be something like BT or TalkTalk.

51
02:14.820 --> 02:17.100
Now, the message that you're sending the ISP

52
02:17.100 --> 02:19.680
is I want to see google.com

53
02:19.680 --> 02:22.560
and the ISP will then relay that message

54
02:22.560 --> 02:25.110
to something called a DNS server

55
02:25.110 --> 02:28.890
which stands for a Domain Name System server.

56
02:28.890 --> 02:33.480
And a DNS server is essentially just a souped up phone book.

57
02:33.480 --> 02:35.460
And what happens when you make that request

58
02:35.460 --> 02:38.340
through your browser is the DNS server will look

59
02:38.340 --> 02:42.570
up in its database to find the exact IP address

60
02:42.570 --> 02:45.240
of that website that you're trying to access.

61
02:45.240 --> 02:47.790
And every single computer that's connected

62
02:47.790 --> 02:50.400
to the Internet has an IP address.

63
02:50.400 --> 02:53.190
It's kind of like a postal code for your computer

64
02:53.190 --> 02:55.710
so that when people need to send and receive files

65
02:55.710 --> 02:59.070
on the Internet, each computer can be located

66
02:59.070 --> 03:03.090
and contacted using their unique IP address.

67
03:03.090 --> 03:06.330
And once the DNS server finds that IP address

68
03:06.330 --> 03:08.580
it'll send it back to your browser

69
03:08.580 --> 03:11.460
through the ISP over the Internet.

70
03:11.460 --> 03:13.740
Then you can make a direct request

71
03:13.740 --> 03:15.795
to that address and what lives

72
03:15.795 --> 03:19.710
at that IP address is, of course the Google servers

73
03:19.710 --> 03:22.590
and they'll be able to send you back all the files

74
03:22.590 --> 03:27.360
and data you need to be able to view the Google homepage.

75
03:27.360 --> 03:29.370
Now, you can try this for yourself to look

76
03:29.370 --> 03:32.790
up the IP address of the Google homepage, head

77
03:32.790 --> 03:37.680
over to this website, NSlookup.io, and type in google.com,

78
03:37.680 --> 03:40.800
and they should show you the exact IP address

79
03:40.800 --> 03:43.710
of the Google servers that you can access.

80
03:43.710 --> 03:45.060
Now, if you try checking this

81
03:45.060 --> 03:48.540
on a different day, say in a week or in a month's time,

82
03:48.540 --> 03:51.900
you might see that this address actually changes.

83
03:51.900 --> 03:54.240
And that's because many websites including Google

84
03:54.240 --> 03:57.150
use something called Dynamic IP addresses, as well

85
03:57.150 --> 04:00.060
as, a content distribution network or a CDN.

86
04:00.060 --> 04:02.070
This basically ensures that it gets you

87
04:02.070 --> 04:05.430
to the closest server to where you are located,

88
04:05.430 --> 04:08.610
and also this address will change depending

89
04:08.610 --> 04:11.100
on whether if it's being used or not.

90
04:11.100 --> 04:13.230
So don't type in what you see on screen.

91
04:13.230 --> 04:16.050
Instead, head over to NSlookup.io

92
04:16.050 --> 04:18.600
and look up what is the closest IP address

93
04:18.600 --> 04:21.510
to you that is currently being used.

94
04:21.510 --> 04:25.140
So if you copy it and paste it into a new tab

95
04:25.140 --> 04:27.360
then you'll be able to replicate that process

96
04:27.360 --> 04:29.730
and see the Google Homepage show up.

97
04:29.730 --> 04:33.600
So to summarize, the Internet is just a bunch

98
04:33.600 --> 04:37.800
of wires that connects up different computers, but it's just

99
04:37.800 --> 04:39.750
on a much bigger scale connecting

100
04:39.750 --> 04:42.330
up all the computers in the world.

101
04:42.330 --> 04:44.970
But what about the oceans I hear you ask.

102
04:44.970 --> 04:47.460
Well, that's one of the coolest things.

103
04:47.460 --> 04:49.950
There are these massive undersea cables

104
04:49.950 --> 04:52.890
connecting all the continents on earth.

105
04:52.890 --> 04:56.010
And if you head over to submarinecablemap.com,

106
04:56.010 --> 04:58.590
you can see all of these cables

107
04:58.590 --> 05:01.740
and see the ones that connect you up to the Internet.

108
05:01.740 --> 05:05.760
And these undersea cables are massive consisting of hundreds

109
05:05.760 --> 05:09.960
of fiber optic fibers, each of them using lasers to transmit

110
05:09.960 --> 05:13.260
up to 400 gigabytes of data per second.

111
05:13.260 --> 05:14.640
This is a cross section of one

112
05:14.640 --> 05:17.010
of the cables that run to New Zealand.

113
05:17.010 --> 05:20.100
It's an absolute marvel of modern technology

114
05:20.100 --> 05:22.920
and it looks really beautiful, don't you think?

115
05:22.920 --> 05:25.860
And to think that every single time we load up a webpage

116
05:25.860 --> 05:29.130
or click on a button on a website, behind the scenes

117
05:29.130 --> 05:31.440
we're sending signals that navigates all

118
05:31.440 --> 05:34.800
of this crazy underwater and above water wires.

119
05:34.800 --> 05:37.860
And all I need is just an IP address.

120
05:37.860 --> 05:40.110
And through tiny electric signals traveling

121
05:40.110 --> 05:42.270
at the speed of light through the oceans

122
05:42.270 --> 05:45.630
and halfway around the world, in a matter of milliseconds

123
05:45.630 --> 05:48.390
I get to view my favorite websites.

124
05:48.390 --> 05:51.360
And that is how awesome the Internet is.

125
05:51.360 --> 05:54.570
And we're going to be taming it to build our own websites

126
05:54.570 --> 05:55.890
and web apps.

127
05:55.890 --> 05:57.300
And to be able to do that

128
05:57.300 --> 06:01.560
we first have to understand how exactly do websites work.

129
06:01.560 --> 06:03.540
So for all of that and more,

130
06:03.540 --> 06:05.140
I'll see you on the next lesson.