The World Wide Web: Crash Course Computer Science #30

The World Wide Web: Crash Course Computer Science #30

CrashCourse

0:03 Hi, I’m Carrie Anne, and welcome to CrashCourse Computer Science.

0:05 Over the past two episodes, we’ve delved into the wires,

0:09 signals, switches, packets, routers and protocols that make up the internet.

0:12 Today we’re going to move up yet another level of abstraction and talk

0:15 about the World Wide Web.This is not the same thing as the Internet,

0:18 even though people often use the two terms interchangeably in everyday language.

0:21 The World Wide Web runs on top of the internet,

0:24 in the same way that Skype, Minecraft or Instagram do.

0:27 The Internet is the underlying plumbing that conveys

0:29 the data for all these different applications.

0:31 And The World Wide Web is the biggest of them

0:34 all– a huge distributed application running on millions of servers worldwide,

0:37 accessed using a special program called a web browser.

0:40 We’re going to learn about that, and much more, in today’s episode.

0:43 INTRO The fundamental building block of the World Wide

0:54 Web– or web for short– is a single page.

0:58 This is a document, containing content, which can include links to other pages.

1:01 These are called hyperlinks.

1:03 You all know what these look like:

1:04 text or images that you can click, and they jump you to another page.

1:08 These hyperlinks form a huge web of interconnected information,

1:10 which is where the whole thing gets its name.

1:13 This seems like such an obvious idea.

1:15 But before hyperlinks were implemented,

1:16 every time you wanted to switch to another piece of information on a computer,

1:19 you had to rummage through the file system to find it,

1:22 or type it into a search box.

1:24 With hyperlinks, you can easily flow from one related topic to another.

1:28 The value of hyperlinked information was conceptualized

1:30 by Vannevar Bush way back in 1945.

1:33 He published an article describing a hypothetical machine called a Memex,

1:36 which we discussed in Episode 24.

1:39 Bush described it as "associative indexing...

1:41 whereby any item may be caused at will

1:44 to select another immediately and automatically." He elaborated:

1:47 "The process of tying two things together

1:50 is the important thing...thereafter, at any time,

1:53 when one of those items is in view,

1:55 the other [item] can be instantly recalled merely by tapping a button." In 1945,

1:59 computers didn’t even have screens, so this idea was way ahead of its time!

2:04 Text containing hyperlinks is so powerful,

2:06 it got an equally awesome name: hypertext!

2:09 Web pages are the most common type of hypertext document today.

2:12 They’re retrieved and rendered by web browsers

2:13 which we'll get to in a few minutes.

2:15 In order for pages to link to one another,

2:18 each hypertext page needs a unique address.

2:20 On the web, this is specified by a Uniform Resource Locator, or URL for short.

2:25 An example web page URL is thecrashcourse.com/courses.

2:29 Like we discussed last episode, when you request a site,

2:31 the first thing your computer does is a DNS lookup.

2:34 This takes a domain name as input– like “the crash course

2:37 dot com”– and replies back with the corresponding computer’s IP address.

2:40 Now, armed with the IP address of the computer you want,

2:43 your web browser opens a TCP connection to a computer

2:46 that’s running a special piece of software called a web server.

2:49 The standard port number for web servers is port 80.

2:52 At this point, all your computer has done

2:53 is connect to the web server at the address

2:55 thecrashcourse.com The next step is to ask

2:58 that web server for the “courses” hypertext page.

3:01 To do this, it uses the aptly named Hypertext Transfer Protocol, or HTTP.

3:05 The very first documented version of this spec,

3:09 HTTP 0.9, created in 1991, only had one command– “GET”.

3:13 Fortunately, that’s pretty much all you need.

3:15 Because we’re trying to get the “courses” page,

3:17 we send the server the following command– GET /courses.

3:21 This command is sent as raw ASCII text to the web server,

3:24 which then replies back with the web page hypertext we requested.

3:27 This is interpreted by your computer's web browser and rendered to your screen.

3:31 If the user follows a link to another page,

3:33 the computer just issues another GET request.

3:35 And this goes on and on as you surf around the website.

3:38 In later versions, HTTP added status codes,

3:41 which prefixed any hypertext that was sent following a GET request.

3:45 For example, status code 200 means OK– I’ve got the page and here it is!

3:49 Status codes in the four hundreds are for client errors.

3:51 Like, if a user asks the web server for a page that doesn’t exist,

3:55 that’s the dreaded 404 error!

3:57 Web page hypertext is stored and sent as plain old text, for example,

4:00 encoded in ASCII or UTF-16, which we talked about in Episodes 4 and 20.

4:05 Because plain text files don’t have a way

4:07 to specify what’s a link and what’s not, it was necessary to develop a way

4:10 to “mark up” a text file with hypertext elements.

4:13 For this, the Hypertext Markup Language was developed.

4:16 The very first version of HTML version 0.a, created in 1990,

4:20 provided 18 HTML commands to markup pages.

4:23 That’s it!

4:24 Let’s build a webpage with these!

4:25 First, let’s give our web page a big heading.

4:28 To do this, we type in the letters “H 1”,

4:30 which indicates the start of a first level heading,

4:33 and we surround that in angle brackets.

4:35 This is one example of an HTML tag.

4:38 Then, we enter whatever heading text we want.

4:40 We don’t want the whole page to be a heading.

4:42 So, we need to “close” the “h1” tag like so, with a little slash in the front.

4:45 Now lets add some content.

4:47 Visitors may not know what Klingons are, so let’s make that word a hyperlink

4:50 to the Klingon Language Institute for more information.

4:53 We do this with an “A” tag,

4:55 inside of which we include an attribute that specifies a hyperlink reference.

4:58 That’s the page to jump to if the link is clicked.

5:00 And finally, we need to close the A tag.

5:03 Now lets add a second level heading, which uses an “h2” tag.

5:06 HTML also provides tags to create lists.

5:09 We start this by adding the tag for an ordered list.

5:12 Then we can add as many items as we want,

5:14 surrounded in “L i” tags, which stands for list item.

5:17 People may not know what a bat'leth is, so let’s make that a hyperlink too.

5:21 Lastly, for good form, we need to close the ordered list tag.

5:24 And we’re done– that’s a very simple web page!

5:27 If you save this text into notepad or textedit,

5:30 and name it something like “test.html”,

5:31 you should be able to open it by dragging it into your computer’s web browser.

5:35 Of course, today’s web pages are a tad more sophisticated.

5:38 The newest version of HTML, version 5,

5:40 has over a hundred different tags– for things like images,

5:43 tables, forms and buttons.

5:44 And there are other technologies we’re not going to discuss,

5:47 like Cascading Style Sheets or CSS and JavaScript,

5:49 which can be embedded into HTML pages and do even fancier things.

5:54 That brings us back to web browsers.

5:56 This is the application on your computer

5:57 that lets you talk with all these web servers.

6:00 Browsers not only request pages and media,

6:01 but also render the content that’s being returned.

6:04 The first web browser, and web server,

6:06 was written by (now Sir) Tim Berners-Lee over the course of two months in 1990.

6:10 At the time, he was working at CERN in Switzerland.

6:13 To pull this feat off, he simultaneously created several of the fundamental

6:17 web standards we discussed today: URLs, HTML and HTTP.

6:21 Not bad for two months work!

6:23 Although to be fair, he’d been researching hypertext systems for over a decade.

6:27 After initially circulating his software amongst colleagues at CERN,

6:29 it was released to the public in 1991.

6:32 The World Wide Web was born.

6:34 Importantly, the web was an open standard,

6:36 making it possible for anyone to develop new web servers and browsers.

6:39 This allowed a team at the University of Illinois

6:42 at Urbana-Champaign to create the Mosaic web browser in 1993.

6:45 It was the first browser that allowed graphics to be embedded alongside text;

6:49 previous browsers displayed graphics in separate windows.

6:52 It also introduced new features like bookmarks,

6:54 and had a friendly GUI interface, which made it popular.

6:57 Even though it looks pretty crusty, it’s recognizable as the web we know today!

7:01 By the end of the 1990s, there were many web browsers in use,

7:04 like Netscape Navigator, Internet Explorer, Opera, OmniWeb and Mozilla.

7:08 Many web servers were also developed,

7:09 like Apache and Microsoft’s Internet Information Services (IIS).

7:13 New websites popped up daily,

7:14 and web mainstays like Amazon and eBay were founded in the mid-1990s.

7:18 A golden era!

7:19 The web was flourishing and people increasingly needed ways to find things.

7:23 If you knew the web address of where you wanted

7:25 to go– like ebay.com– you could just type it into the browser.

7:28 But what if you didn’t know where to go?

7:30 Like, you only knew that you wanted pictures of cute cats.

7:33 Right now!

7:34 Where do you go?

7:35 At first, people maintained web pages which

7:37 served as directories hyperlinking to other websites.

7:40 Most famous among these was "Jerry and David's guide to the World Wide Web",

7:44 renamed Yahoo in 1994.

7:45 As the web grew, these human-edited directories started to get unwieldy,

7:49 and so search engines were developed.

7:51 Let’s go to the thought bubble!

7:52 The earliest web search engine that operated like the ones we use today,

7:56 was JumpStation, created by Jonathon Fletcher

7:58 in 1993 at the University of Stirling.

8:01 This consisted of three pieces of software that worked together.

8:04 The first was a web crawler,

8:05 software that followed all the links it could find on the web;

8:08 anytime it followed a link to a page that had new links,

8:10 it would add those to its list.

8:12 The second component was an ever enlarging index,

8:14 recording what text terms appeared on what pages the crawler had visited.

8:18 The final piece was a search algorithm that consulted the index; for example,

8:22 if I typed the word “cat” into JumpStation,

8:24 every webpage where the word “cat” appeared would come up in a list.

8:28 Early search engines used very simple

8:30 metrics to rank order their search results,

8:32 most often just the number of times a search term appeared on a page.

8:35 This worked okay, until people started gaming the system,

8:38 like by writing “cat” hundreds of times

8:40 on their web pages just to steer traffic their way.

8:43 Google’s rise to fame was in large part

8:45 due to a clever algorithm that sidestepped this issue.

8:48 Instead of trusting the content on a web page,

8:50 they looked at how other websites linked to that page.

8:53 If it was a spam page with the word cat over and over again,

8:56 no site would link to it.

8:57 But if the webpage was an authority on cats,

8:59 then other sites would likely link to it.

9:01 So the number of what are called “backlinks”,

9:04 especially from reputable sites, was often a good sign of quality.

9:07 This started as a research project

9:09 called BackRub at Stanford University in 1996,

9:12 before being spun out, two years later, into the Google we know today.

9:15 Thanks thought bubble!

9:16 Finally, I want to take a second to talk about

9:19 a term you’ve probably heard a lot recently, “Net Neutrality”.

9:21 Now that you’ve built an understanding of packets,

9:24 internet routing, and the World Wide Web,

9:25 you know enough to understand the essence–

9:27 at least the technical essence– of this big debate.

9:30 In short, network neutrality is the principle that all

9:32 packets on the internet should be treated equally.

9:35 It doesn’t matter if the packets are my email or you streaming this video,

9:38 they should all chug along at the same speed and priority.

9:41 But many companies would prefer that their data arrive to you preferentially.

9:45 Take for example, Comcast, a large ISP that also owns many TV channels,

9:49 like NBC and The Weather Channel, which are streamed online.

9:52 Not to pick on Comcast, but in the absence of Net Neutrality rules,

9:55 they could for example say that they

9:57 want their content to be delivered silky smooth,

10:00 with high priority… But other streaming videos are going to get throttled,

10:03 that is, intentionally given less bandwidth and lower priority.

10:06 Again I just want to reiterate here this is just conjecture.

10:09 At a high level, Net Neutrality advocates argue

10:12 that giving internet providers this ability to essentially set

10:14 up tolls on the internet– to provide premium packet

10:17 delivery– plants the seeds for an exploitative business model.

10:20 ISPs could be gatekeepers to content,

10:22 with strong incentives to not play nice with competitors.

10:25 Also, if big companies like Netflix and Google can pay to get special treatment,

10:29 small companies, like start-ups, will be at a disadvantage, stifling innovation.

10:34 On the other hand, there are good technical reasons why you

10:36 might want different types of data to flow at different speeds.

10:39 That skype call needs high priority,

10:40 but it’s not a big deal if an email comes in a few seconds late.

10:44 Net-neutrality opponents also argue that market

10:46 forces and competition would discourage bad behavior,

10:49 because customers would leave ISPs that are throttling sites they like.

10:53 This debate will rage on for a while yet,

10:55 and as we always encourage on Crash Course,

10:57 you should go out and learn more because

10:59 the implications of Net Neutrality are complex and wide-reaching.

11:02 I’ll see you next week.

Study with Looplines Download Captions Watch on YouTube