Class Notes (811,659)
Canada (494,847)
CS 100 (114)
Dan Brown (12)

Module 5 notes.docx

13 Pages
Unlock Document

Computer Science
CS 100
Dan Brown

Module 5 notes 5.1 Communicating Among Computers Our daily use of the Internet is almost an automatic process. This leads to us taking the Internet for granted, so we forget or ignore what is needed to make possible our experience of the Internet. In order to make our use of the Internet more efficient, we need to learn about or reacquaint ourselves with its implementation details. When you send information from one computer to another, you implicitly make use of many hardware components and pieces of systems software. Much like an operating system provides services for using a computer on its own, communications systems provide services for using collections of computers together. As explained in Section 1.3, a network consists of two or more computers that are connected by physical cables or satellite and radio communication. A network can be configured as a chain of computers (computer A is connected to computer B, which is connected to computer C, etc.) or in the shape of a star (A is connected to B, C, D, and E, and none of the others are connected directly to each other), but more often the configurations are more varied, as depicted above. Users on any one of the computers might wish to share data or exchange messages with users using any of the other computers in the network. How can this be managed? When information is to be transferred from one computer to another, it must first be represented as data, such as text in an email message or derived calculations in a spreadsheet. The data content is then enveloped by other data that specifies (among other things) the address of the recipient, much as a letter is placed into a physical envelope. The communications system running on the originating computer then examines the envelope to determine how to route the data to its destination. Each computer along the way examines the envelope to determine whether that computer itself is the final destination or how to continue routing the data to one of its neighbours. The destination computer then unwraps the data and delivers it to the intended application (e.g., the email system or a spreadsheet program). 5.1.1 Addressing on the Internet The communications systems on each computer in the network must agree on the design of the envelope and what sort of routing to follow. Without such an agreed upon protocol, when computer B receives an envelope from computer A, it might see only gibberish or it might decide to route the envelope back through A again (which might, in turn, send it back to B, which sends it to A, and on and on). A commonly used protocol that is the main workhorse of the Internet is called TCP/IP (Transmission Control Protocol / Internet Protocol), developed by Bob Kahn and Vint Cerf in 1974. When a large piece of data is sent using TCP/IP, it is broken down into smaller units, known as data packets, that are sent in separate, numbered envelopes. If any packet is lost, the protocol resends it. The small packets are easier to resend and also allow better sharing of network bandwidth. The original data is reassembled from the individual packets by the destination computer before it is delivered to the application. (As an analogy, think of cutting a manuscript into small pieces, putting each into a separate numbered envelope, and then mailing them.) The Internet Protocol dictates that each computer (also known as a host) on the network must have a unique IP address. To ensure that they are unique, IP addresses are allocated to organizations hierarchically. For example, all addresses of the form 129.97.M.N have been allocated to the University of Waterloo by a central authority (ICANN). Then UW has allocated all addresses of the form 129.97.51.N to the cslab1 subnetwork. Finally each value for N refers to a computer on that subnet. For example, is the address for the MacOS X server for UW’s CS 100 labs. IP addresses are not very human-friendly. (The analogous situation with physical mail would be to require addresses to be expressed as latitude and longitude coordinates, rather than in terms of countries, towns, and streets, another hierarchical system designed to support the allocation of unique addresses.) Just as named cells were often more convenient to use than cell addresses when working with spreadsheets, Internet sites are more conveniently referenced by a hierarchical system of names separated by dots (periods). As a result, the Internet includes several computers that translate computer names into corresponding IP addresses. A server for this Domain Name System (DNS) consults a registry to translate hierarchically allocated host names (e.g., to corresponding IP addresses. As a result, when you send email using the symbolic address [email protected], the various Internet services and protocols provide mechanisms to route it from computer to computer until it reaches its destination. 5.1.2 Communicating applications The following list is a reminder of only a few of the Internet’s uses: o Electronic mail (email) – This method of communication has essentially replaced the traditional ―snail mail‖ method of letter writing. We use email to send messages anywhere in the world (that is connected to the Internet). o File exchange – Programs and files can be exchanged using the File Transfer Protocol (FTP). FTP client programs allow users to copy files from remote websites and download these files onto their computers. An example of this occurs when you download files from D2L and upload assignment files when you complete them. o Electronic forums – The electronic forum goes by a number of different names such as (electronic) bulletin board, discussion board, and so forth. You may have already used one or more of the discussion boards on D2L; quite different forums are provided by Facebook, MySpace, and Twitter, among others. The electronic forum’s main purpose is to provide a site at which people can exchange information and ideas. o Chat programs – Instant messaging programs, such as MSN Messenger, simulate real-life conversations. Users converse with one another by typing rather than speaking. These programs transmit messages immediately to replicate the speed of live conversations. o Voice over IP – Your voice can be digitized and then broken into packets to be sent from computer to computer. At the destination, the packets can be reassembled and the data converted back to audio. Services such as Skype are based on this technology. o Electronic business – eBay, Amazon, and other corporations provide services for buying almost anything via the Internet. Traditional ―bricks and mortar‖ businesses, such as HMV and The Bay, have also established interfaces through which they can sell directly to customers via the Internet. Behind these are B2B (business to business) applications that connect suppliers to their business customers electronically. o Web search – Google, Microsoft, Yahoo, and others provide applications that try to catalogue or index all the contents on the Web (and even other data available through the Internet, but not directly on the Web). We’ll examine how these systems work during the next several modules. 5.2 The World Wide Web In 1945, Vannevar Bush, then U.S. Director of the Office of Scientific Research and Development, wrote a visionary piece entitled As We May Think, which appeared in The Atlantic. (It is a very interesting paper to read, even after more than 60 years.) In that paper, Bush described the memex, a machine that could support a person’s knowledge and memory by providing any piece of recorded information instantly. His imagined memex extended several pieces of then-existing technology (including cameras, projectors, faxes, phonographs, and calculators, among others). ―The owner of the memex, let us say, is interested in the origin and properties of the bow and arrow. Specifically he is studying why the short Turkish bow was apparently superior to the English long bow in the skirmishes of the Crusades. He has dozens of possibly pertinent books and articles in his memex. First he runs through an encyclopedia, finds an interesting but sketchy article, leaves it projected. Next, in a history, he finds another pertinent item, and ties the two together. Thus he goes, building a trail of many items. Occasionally he inserts a comment of his own, either linking it into the main trail or joining it by a side trail to a particular item. When it becomes evident that the elastic properties of available materials had a great deal to do with the bow, he branches off on a side trail which takes him through textbooks on elasticity and tables of physical constants. He inserts a page of longhand analysis of his own. Thus he builds a trail of his interest through the maze of materials available to him.‖ Over the next decades, technological advances brought the ideas closer to realization. Several separate and distinct regional, national, and international computer networks (e.g., ARPAnet, Usenet, CSnet, BITNET, EARN) were created during the 1970s and 1980s. As TCP/IP became more commonly adopted, these networks were interconnected, resulting in the Internet. However, creating and sharing data on the Internet required more specialized knowledge than most people were willing to learn. By 1989, Tim Berners-Lee, a physicist working at CERN (the European Organization for Nuclear Research), envisaged a method by which several commonly used data sharing protocols could all be supported through one medium. Soon thereafter, he proposed a new data exchange protocol, which he named the Hypertext Transfer Protocol (HTTP), and a new text representation, which he named the Hypertext Markup Language (HTML). Because he believed that the entire world’s information could be shared through this medium, he named the resulting network the World Wide Web (WWW, now also known as the Web). As unbelievable as Berners-Lee’s vision was at the time, the Web became pervasive within a decade. Today it is hard to imagine trying to find information without consulting the Web. The widespread adoption of the Web was due in part to the simplicity of using HTML to create pages containing text, pictures, and sound; the simplicity of linking from one page to the next; and the emergence of Web search engines to locate pages of interest. Bush’s memex is no longer just a dream. Chapters 1 and 2 in Web Dragons compare the Web to the world’s ancient and modern libraries. 5.3 Introduction to HTML HTML is the language of the Web. It provides a browser with instructions on how the information within a page is to be displayed. When you visit a webpage, the browser you are using interprets the HTML to render the page. For example, open a second browser window and look at Jane Smith’s homepage. How did Jane achieve the text formatting shown? How did she insert pictures? How does this page get linked to others? 5.3.1 Characteristics of Tags The first line in the file for Jane’s homepage, beginning with , declares that the file contains HTML. Including this line is optional, but is considered to be good practice. An obvious thing to note about the following HTML source is that it contains many angle brackets. The words enclosed by left and right angle brackets, called tags, indicate to the browser the nature of information on the webpage (e.g., headings, paragraphs, tables, and lists), and the browser responds by displaying that information appropriately. Some browsers render tags in colour when displaying the HTML source. HTML tags are not case-sensitive. For example, , , and are all equivalent. Also, carriage returns (included by pressing enter or return) in the source code do not affect how a page will be displayed in the browser, and a series of consecutive spaces or tabs is treated as just one space. Tags are paired. Tags usually appear in pairs. For example, the second line for Jane Smith’s page contains the opening tag and the last line has the matchingclosing tag . They share the same tag name but the closing tag name is preceded by a slash. This pattern of pairing opening and closing tags occurs throughout the source. Paired tags surround the text to be affected. If you compare the source code to the actual homepage that appears in the browser, you will notice that tags surround the text that they affect. For example, the and pair surrounds the words Jane Smith, which are therefore displayed in the browser’s title bar. Similarly and surround the words Welcome to my Homepage! that represents aheading on the homepage. Thus the opening tag indicates the start of an HTML element and the closing tag shows where that element terminates. So in the examples above, a browser will know the extent of the text to display in the title area and the extent of the text to display in a large bold font. A few tags, such as and do not have matching closing tags because there is no text that needs to be delineated. The first of these causes a horizontal rule to appear and the second forces the browser to start a new line (i.e., to break the line). Tag pairs are nested. One pair of tags can be included with the text that appears within another pair. For example, … appears within …, which appears within …, which appears within …, which appears within …, which appears within …. In general, patterns such as One pair of tags can be included with the text that appears within another pair. For example, … appears within …, which appears within …, which appears within …, which appears within …, which appears within …. In general, patterns such as xxxxxxxxxxxxxxxxxxx are allowed, but xxxxxxxxxxxxxxxxxxx is not allowed because the opening C tag appears within …, but its matching closing tag does not. Opening tags may have attributes. Optional attributes may be included in an opening tag. For example, the tag declares a table with a 1 pixel border around it and a table width of 300 pixels (where a pixel is the size of the smallest dot that can be displayed on your screen). Similarly the tag declares a table heading for a column that should have a width that is 40% of the complete table width. Note that even though many browsers are quite forgiving, the values for each attribute should always appear within quotation marks, even if they represent numbers. 5.3.2 Character Entity References When writing the text for a webpage, you might find the need to use a character that does not appear on your keyboard. How can you create text that includes mathematics, diacritical marks, Greek letters, and other special characters? HTML provides character entity references to represent symbols that cannot be entered directly. To signal that a special character is being used, HTML uses the ampersand symbol (&) as an escape character, much like a special shift character. This is followed by several letters representing the name of the special character and terminated by a semicolon (;). For example, × represents the multiplication symbol (×), é represents an e with an acute accent (é); Æ represents a capital AE ligature (Æ), and © represents a copyright symbol (©). For example, to display the foll
More Less

Related notes for CS 100

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.