INTRODUCTION TO COMPUTERS AND INTERNET · TCP is used in Internet operations UDP is used in...

Post on 03-Aug-2020

0 views 0 download

Transcript of INTRODUCTION TO COMPUTERS AND INTERNET · TCP is used in Internet operations UDP is used in...

B.BHUVANESWARAN / AP (SS) / CSE / REC - 2

CHAPTER - 1INTRODUCTION TO COMPUTERS AND INTERNET

1. Distinguish between Internet and WWW.

The Internet is a massive network of networks, a networking infrastructure. It connectsmillions of computers together globally, forming a network in which any computer cancommunicate with any other computer as long as they are both connected to the Internet.Information that travels over the Internet does so via a variety of languages known asprotocols.

The World Wide Web, or simply Web, is a way of accessing information over themedium of the Internet. It is an information-sharing model that is built on top of the Internet.The Web uses the HTTP protocol, only one of the languages spoken over the Internet, totransmit data. Web services, which use HTTP to allow applications to communicate in orderto exchange business logic, use the the Web to share information. The Web also utilizesbrowsers, such as Internet Explorer or Firefox, to access Web documents called Web pagesthat are linked to each other via hyperlinks. Web documents also contain graphics, sounds,text and video.

2. Define: WWW.

The World Wide Web, or simply Web, is a way of accessing information over themedium of the Internet. It is an information-sharing model that is built on top of the Internet.The Web uses the HTTP protocol, only one of the languages spoken over the Internet, totransmit data. Web services, which use HTTP to allow applications to communicate in orderto exchange business logic, use the the Web to share information. The Web also utilizesbrowsers, such as Internet Explorer or Firefox, to access Web documents called Web pagesthat are linked to each other via hyperlinks. Web documents also contain graphics, sounds,text and video.

3. What are the components of web? What is the communication protocol betweenthem?

Let's take www.wiki.com as an example

www is the first part telling the browser that you are trying to access the world wideweb. The second part would be the actual name of the website which is in our example wiki.Last comes the .com which is more of a direction giver (.com for most American sites,.de forGerman,government site's are .gov and organizations .org)

http:// is the browser protocol but typing it in is mostly optional since most browseruse this as a default.

If it was www.wiki.com/pic, pic would be your file name.

B.BHUVANESWARAN / AP (SS) / CSE / REC - 3

4. What do you mean by website?

A website is a group of Web pages that typically interacts with one another and arelocated on a server. Creating an effective Web site is a difficult process, requiring planning,effort and time.

5. Distinguish between TCP and UDP protocols.

TCP UDPTCP provides connection oriented service(ACK is there)

UDP provides connectionless service (Noacknowledgement)

TCP is reliable UDP is unreliableTCP is used in Internet operations UDP is used in multimedia operationsTransfer of data in continuous streams Data is passed in the form of datagrams

6. What is the use of HTTP protocols?

HTTP is the standard protocol for communication between web browsers and webservers. HTTP specifies how a client and server establish a connection, how the clientrequests data from the server, how the server responds to that request, and finally, how theconnection is closed. HTTP connections use the TCP/IP protocol for data transfer. For eachrequest from client to server, there is a sequence of four steps:

Making the connection Making a request The response Closing the connection

7. What is the primary function of an HTTP server?

The primary function of an HTTP server is to service client requests for documents. Itwaits for HTTP requests and then returns data for each one. An HTTP daemon provides anHTTP service. It allows a server to support client requests for documents. It generates errorswhen invalid requests are received or when a document cannot be found. The Web serverprocess also generates log files of requests, errors, and other information.

8. Explain the HTTP request and HTTP response?

Request

The client sends a message to the server requesting the page at a specified URL. Theformat of this request is typically something like:

GET /index.html HTTP/1.0

Response

The server sends a response to the client. The response begins with a response code,followed by a header full of metadata, a blank line, and the requested document or an errormessage. Assuming the requested document is found, a typical response looks like this:

B.BHUVANESWARAN / AP (SS) / CSE / REC - 4

HTTP/1.1 200 OKDate: Mon, 15 Sep 2003 21:06:50 GMTServer: Apache/2.0.40 (Red Hat Linux)Last-Modified: Tue, 15 Apr 2003 17:28:57 GMTConnection: closeContent-Type: text/html; charset=ISO-8859-1Content-length: 107

<html><head><title>A Sample HTML file</title></head><body>The rest of the document goes here</body></html>

9. Why is HTTP called as a stateless protocol? Explain.

Either the client or the server or both close the connection. Thus, a separate networkconnection is used for each request. If the client reconnects, the server retains no memory ofthe previous connection or its results. A protocol that retains no memory of past requests iscalled stateless; in contrast, a stateful protocol such as FTP can process many requests beforethe connection is closed. The lack of state is both a strength and a weakness of HTTP.

10. What is the use of MIME? (or) What is the purpose of MIME? (or) What is MIME?Explain its usage. (or) What is MIME? Name any four content types that MIMEsupports. (or) What is MIME? List its content types.

MIME is an acronym standing for Multipurpose Internet Mail Extensions, and refersto a standard that can be used to pass a variety of types of information, including graphics andapplications, through e-mail as well as through other Internet message protocols. The contentof a MIME message is specified using a two-part, case-insensitive string which, in webapplications, is known as the content type of the message.

Standard top-level a MIME content types:

Application Audio Image Message Model Multipart Text video

B.BHUVANESWARAN / AP (SS) / CSE / REC - 5

Some common MIME content types

text/html image/gif image/jpeg text/plain audio/basic video/mpeg

11. State the uses of Internet Protocol.

The function of IP software is to transfer data from one computer (the source) toanother computer (the destination). When an application on the source computer wants tosend information to a destination, the application calls IP software on the source machine andprovides it with data to be transferred along with an IP address for ach of the source anddestination computes.

12. What are the basic Internet Protocols? (or) List the different basic protocols used ininternet.

Protocol Port Protocol Purpose

FTP 21 TCPThis port is used to send FTP commands like put andget.

SMTP 25 TCPThe Simple Mail Transfer Protocol is used to send emailbetween machines.

HTTP 80 TCP The underlying protocol of the World Wide Web.

POP3 110 TCPPost Office Protocol Version 3 is a protocol for the transferof accumulated email from the host to sporadicallyconnected clients.

13. Define URI.

A Uniform Resource Identifier (URI) is a string of characters in a particular syntaxthat identifies a resource. The resource identified may be a file on a server, but it may also bean email address, a news message, a book, a person's name, an Internet host, the current stockprice of Sun Microsystems, or something else. An absolute URI is made up of a scheme forthe URI and a scheme-specific part, separated by a colon, like this:

scheme:scheme-specific-part

The syntax of the scheme-specific part depends on the scheme being used. Currentschemes include:

data - Base64-encoded data included directly in a link; see RFC 2397file - A file on a local diskftp - An FTP serverhttp - A World Wide Web server using the Hypertext Transfer Protocolgopher - A Gopher server

B.BHUVANESWARAN / AP (SS) / CSE / REC - 6

mailto - An email addressnews - A Usenet newsgrouptelnet - A connection to a Telnet-based serviceurn - A Uniform Resource Name

14. Define URN.

A URN is a name for a particular resource but without reference to a particularlocation. For instance, urn:isbn:1565928709 is a URN referring to the same book. As thisexample shows, URNs, unlike URLs, are not limited to Internet resources.

The goal of URNs is to handle resources that are mirrored in many different locationsor that have moved from one site to another; they identify the resource itself, not the placewhere the resource lives. For instance, when given a URN for a particular piece of software,an FTP program should get the file from the nearest mirror site. Given a URN for a book, abrowser might reserve the book at the local library or order a copy from a bookstore.

A URN has the general form:

urn:namespace:resource_name

The namespace is the name of a collection of certain kinds of resources maintainedby some authority. The resource_name is the name of a resource within that collection.For instance, the URN urn:ISBN:1565924851 identifies a resource in the ISBN namespacewith the identifier 1565924851.

15. Define URL.

A URL identifies the location of a resource on the Internet. It specifies the protocolused to access a server (e.g., FTP, HTTP), the name of the server, and the location of a file onthat server. A typical URL looks like http://www.ibiblio.org/javafaq/javatutorial.html. Thisspecifies that there is a file called javatutorial.html in a directory called javafaq on the serverwww.ibiblio.org, and that this file can be accessed via the HTTP protocol. The syntax of aURL is:

protocol://username@hostname:port/path/filename?query#fragment

Here the protocol is another word for what was called the scheme of the URI. (Schemeis the word used in the URI RFC. Protocol is the word used in the Java documentation.) In aURL, the protocol part can be file, ftp, http, https, gopher, news, telnet, wais, or various otherstrings (though not urn).

16. What do you mean by Relative URLs?

URLs that aren't complete but inherit pieces from their parent are called relativeURLs. In contrast, a completely specified URL is called an absolute URL. In a relative URL,any pieces that are missing are assumed to be the same as the corresponding pieces from theURL of the document in which the URL is found. For example, suppose that while browsinghttp://www.ibiblio.org/javafaq/javatutorial.html you click on this hyperlink:

B.BHUVANESWARAN / AP (SS) / CSE / REC - 7

<a href="javafaq.html">

The browser cuts javatutorial.html off the end ofhttp://www.ibiblio.org/javafaq/javatutorial.html to get http://www.ibiblio.org/javafaq/. Then itattaches javafaq.html onto the end of http://www.ibiblio.org/javafaq/ to gethttp://www.ibiblio.org/javafaq/javafaq.html. Finally, it loads that document.

If the relative link begins with a /, then it is relative to the document root instead ofrelative to the current file. Thus, if you click on the following link while browsinghttp://www.ibiblio.org/javafaq/javatutorial.html:

<a href="/boutell/faq/www_faq.html">

the browser would throw away /javafaq/javatutorial.html and attach/boutell/faq/www_faq.html to the end of http://www.ibiblio.org to gethttp://www.ibiblio.org/boutell/faq/www_faq.html.

17. Write the functions of a Web Server.

The primary feature of every web server is to accept HTTP requests from web clientsand return an appropriate resource (if available) in the HTTP response. Even this basicfunctionality involves a number of steps:

1. The server calls on TCP software and waits for connection requests to one or moreports.

2. When a connection request is received, the server dedicates a “subtask” tohandling this connection.

3. The subtask establishes the TCP connection and receives an HTTP request.4. The subtask examines the Host header field of the request to determine which

“virtual host” should receive this request and invokes software for this host.5. The virtual host software maps the Request-URI field of the HTTP request start

line to a resource on the server.6. If the resource is a file, the host software determines the MIME type of the file

(usually by a mapping from the file-name extension portion of the Request-URI),and creates an HTTP response that contains the file in the body of the responsemessage.

7. If the resource is a program, the host software runs the program, providing it withinformation from the request and returning the output from the program as thebody of an HTTP response message.

8. The server normally logs information about the request and response-such as theIP address of the requester and the status code of the response-in a plain-text file.

9. If the TCP connection is kept alive, the server subtask continues to monitor theconnection until a certain length of time has elapsed, the client sends anotherrequest, or the client initiates a connection close.

B.BHUVANESWARAN / AP (SS) / CSE / REC - 8

18. State the function of DNS and the protocol used.

One Internet application that is often run using UDP rater than TCP is the DomainName Service (DNS). While every device on the Internet has an IP address such as192.0.34.166, humans generally find it easier to refer to machines by names such aswww.example.org. DNS provides a mechanism for mapping back and forth between IPaddresses and host names.

19. Explain the way in which a DNS server resolves addresses.

Basically, there are a number of DNS servers on the Internet, each listening throughUDP software to a port (port 53 if the server is following the current IANA assignment).When a computer on the Internet needs DNS services-for example, to convert a host namesuch as www.example.org to a corresponding IP address-it uses the UDP software running onits system to send a UDP message to one of these DNS servers, requesting the IP address. Ifall goes well, this server will then send back a UDP message containing the IP address. Recallthat it took three messages just to get a TCP connection set up, so the UDP approach is muchmore efficient for sporadic DNS queries.

20. State the use of web server logs and list the content of a message log.

Web server logs record information about server activity. The primary web server logrecording normal activity is an access log, a file that records information about every HTTPrequest processed by the server. A web server may also produce one or more message logscontaining a variety of debugging and other information generated by web applications aswell as possibly by the web server itself.

B.BHUVANESWARAN / AP (SS) / CSE / REC - 9

CHAPTER - 2MICROSOFT INTERNET EXPLORER 6

1. What is Web browser? Mention any two popular web browsers. (or) What is theneed for Web browser?

Web browsers are software programs that allow users to access the Web’s richmultimedia content. Whether for business or for personal use, millions of people use Webbrowsers to access the tremendous amount of information available on the Web.

The two most popular Web browsers are Microsoft’s Internet Explorer and Netscape’sCommunicator.

2. List any four common browsers.

Internet Explorer Microsoft Internet ExplorerFirefox Mozilla Firefox (identified as Mozilla before 2005)Chrome Google ChromeMozilla The Mozilla Suite (Gecko, Netscape)Safari Safari (and Konqueror. Both identified as Mozilla before 2007)Opera Opera (as of 2011, Opera Mini is included here)Netscape Netscape Navigator (identified as Mozilla after 2006)AOL America Online (based on both Internet Explorer and Mozilla)

3. How does a web browser work?

Web browsers communicate with Web servers primarily using HTTP (hypertexttransfer protocol) to fetch webpages. HTTP allows Web browsers to submit information toWeb servers as well as fetch Web pages from them.

Web pages are located by means of a URL (uniform resource locator) which is treatedas an address, beginning with http: for HTTP access. Many browsers also support a variety ofother protocols, such as ftp: for FTP (file transfer protocol), rtsp: for RTSP (real-timestreaming protocol- A protocol for use in streaming media systems), and https: for HTTPS (anSSL encrypted version of HTTP- used to indicate a secure HTTP connection).

B.BHUVANESWARAN / AP (SS) / CSE / REC - 10

CHAPTER - 3HTML5

1. Write the significance of HTML5.

One of the most important HTML5 features is the hyperlink, which references (orlinks to) other resources, such as HTML5 documents and images. When a user clicks ahyperlink, the browser tries to execute an action associated with it (for example, navigate to aURL or open an e-mail client). Any displayed element can act as a hyperlink. Web browserstypically underlinetext hyperlinks and color their text blue by default so that users candistinguish hyperlinks from plain text.

2. Give the structure of an HTML5 program.

<html><head><title>My first HTML5 document</title></head><body>Hello world!</body></html>

3. List the attributes that the <BODY> tag can take.

alink background bgcolor link text vlink

4. What is the use of HREF?

One of the most important HTML5 features is the hyperlink, which references (orlinks to) other resources, such as HTML5 documents and images. When a user clicks ahyperlink, the browser tries to execute an action associated with it (for example, navigate to aURL or open an e-mail client). Any displayed element can act as a hyperlink. Web browserstypically underlinetext hyperlinks and color their text blue by default so that users candistinguish hyperlinks from plain text.

Links are created using the a (anchor) element:

<a href = "http://www.facebook.com">Facebook</a>

defines a hyperlink to the URL assigned to attribute href (hypertext reference), whichspecifies a resource’s location, such as

B.BHUVANESWARAN / AP (SS) / CSE / REC - 11

• a web page or location within a web page• a file• an e-mail address

5. List and explain any two HTML5 elements.

The paragraph tags (<p> and </p>) in line

<p>Welcome to HTML5!</p>

markup text for display in a browser. All text placed between the <p> and </p> tagsform one paragraph. When the browser renders a paragraph, a blank line usually precedes andfollows paragraph text.

Some text in an HTML5 document may be more important than other text. HTML5provides six heading elements (h1 throughh6) for specifying the relative importance ofinformation.

Heading element h1:

<h1>Level 1 Header</h1>

is considered the most significant one and is typically rendered in a larger font than theother five:

<h2>Level 2 header</h2><h3>Level 3 header</h3><h4>Level 4 header</h4><h5>Level 5 header</h5><h6>Level 6 header</h6>

6. When it is useful to redirect a request to a different resource?

Redirecting a request to a different resource is used in situation like:

a. The requested resource is busy for a long time and there are similar resourcesavailable.

b. When the request resource is not acknowledging the receipt of request.c. When efficient load sharing is implemented in the system.

7. Distinguish between a static web page and a dynamic web page. (or) What is thedifference between static and dynamic web pages?

Static Page: A HTML5 page consist of fixed content, edited / typed at the design time.Eg: google.com (Home page).

Dynamic Page: A HTML5 page loads information from Database according to theinput provided by the user. Eg: google.com's result page, after providing some keywords.

B.BHUVANESWARAN / AP (SS) / CSE / REC - 12

8. Explain the difference between get request type and post request type. (or) What isthe difference between GET and POST request?

The form’s attribute method) specifies how the form’s data is sent to the web server.Using method = "post" appends form data to the browser request, which contains the protocol(HTTP) and the requested resource’s URL. This method of passing data to the server istransparent—the user doesn’t see the data after the form is submitted. The other possiblevalue, method = "get", appends the form data directly to the end of the URL of the script,where it’s visible in the browser’s Address field.

9. How to write comment statements in HTML5?

Inserting comments in HTML5 markup improves readability and describe the contentof a document. The browser ignores comments when your document is rendered. HTML5comments start with <!-- and end with -->.

<!-- Fig. 2.1: main.html --><!-- First HTML5 example. -->

10. Write HTML5 code to display an image.

<img src = "cpphtp.png" width = "92" height = "120"alt = "C++ How to Program book cover">

use an img element to include an image in the document. The image file’s location isspecified with the src (source) attribute. This image is located in the same directory as theHTML5 document, so only the image’s file name is required. This is known as a relativepath—the image is stored relative to the location of the document. Optional attributes widthand height specify the image’s dimensions. You can scale an image by increasing ordecreasing the values of the image width and height attributes. If these attributes are omitted,the browser uses the image’s actual width and height. Images are measured in pixels (“pictureelements”), which represent dots of color on the screen.

11. Develop an HTML5 page to use an image as a link to another page.

<html><head><title>Internet and WWW How to Program - Navigation Bar</title></head><body><a href = "links.html"><img src = "links.jpg" width="65" height="50"

alt="Links Page" /></a><br /></body></html>

B.BHUVANESWARAN / AP (SS) / CSE / REC - 13

12. Write HTML code to create the following Table:

w x

y z

<html><head><title>HTML table</title></head><body><table border = "1"><tr><td>w</td><td>x</td></tr><tr><td>y</td><td>z</td></tr></table></body></html>

13. Develop an HTML page to display a square with the use of 4 images.

<html><head><title>A simple XHTML table</title></head><body><table border = "0"><tr><td><img src = "tl.jpg" width="50" height="50" /></td><td><img src = "tr.jpg" width="50" height="50" /></td></tr><tr><td><img src = "bl.jpg" width="50" height="50" /></td><td><img src = "br.jpg" width="50" height="50" /></td></tr></table></body></html>

B.BHUVANESWARAN / AP (SS) / CSE / REC - 14

14. Write the HTML5 code for creating multi-line text box with necessary parameters?

<p><label>Comments:<br /><textarea name = "comments" rows = "4" cols = "36">Enter your comments here.</textarea></label></p>

15. How will you create a password field in a HTML5 form?

The "password" input in lines

<input name = "passwd" type = "password" size = "25" />

inserts a password box with the specified size. A password box allows users to entersensitive information, such as credit card numbers and passwords, by “masking” theinformation input with asterisks. The actual value input is sent to the Web server, not thecharacter that mask the input.

16. Write the HTML code to create a radio button.

<html><body><form method = "post" action = "/cgi-bin/formmail">How did you get to our site?: <br />Search engine<input name = "howtosite" type = "radio" value = "searchengine" checked = "checked" />Links from another site<input name = "howtosite" type = "radio" value = "link" />Deitel.com Web site<input name = "howtosite" type = "radio"value = "deitel.com" />Reference in a book<input name = "howtosite" type = "radio" value = "book" />Other<input name = "howtosite" type = "radio" value = "other" /></form></body></html>

B.BHUVANESWARAN / AP (SS) / CSE / REC - 15

CHAPTER - 4INTRODUCTION TO CASCADING STYLE SHEETS (CSS)

1. What is the usage of CSS? (or) What is the purpose of CSS? (or) List out CSSfeatures. (or) Give the features of CSS. (or) Mention the need for cascading stylesheets. (or) Give some advantages of using Cascading Style Sheets.

Cascading Style Sheets 3 (CSS3) allows you to specify the presentation of elements ona web page (e.g., fonts, spacing, sizes, colors, positioning) separately from the document’sstructure and content (section headers, body text, links, etc.). This separation of structure frompresentation simplifies maintaining and modifying web pages, especially on large-scalewebsites.

2. Give the syntax of a CSS rule. (or) Give the core syntax of CSS.

CSS rules in embedded style sheets use the same syntax as inline styles; the propertyname is followed by a colon (:) and the value of that property. Multiple properties areseparated by semicolons (;). In the rule for em elements, the color property specifies the colorof the text, and property background-color specifies the background color of the element.

em { background-color: #8000ff;color: white }

3. List the two forms of style rules with an example.

The two forms of style rules are:

Ruleset form At-rule form

Ruleset form:

p{ font-size: x-large;

background-color: yellow}

At-rule form:

@import url(“general-rules.css”);H1, h2 { background-color: aqua }

4. State the commands in cascading style sheet used for grouping of elements.

Element span is a grouping element - it does not apply any inherent formatting to itscontents. Its primary purpose is to apply CSS rules or id attributes to a block of text. Elementspan is an inline-level element - it is displayed inline with other text and with no line breaks.A similar element is the div element, which also applies no inherent styles but is displayed onits own line, with margins above and below (a block-level element).

B.BHUVANESWARAN / AP (SS) / CSE / REC - 16

5. What is the inline style sheet technique?

Inline styles that declare an individual element’s format using the HTML5 attributestyle. Inline styles override any other styles applied using the techniques.

6. Give example for inline style sheet.

<html><head><title>Inline Styles</title></head><body><p>This text does not have any style applied to it.</p><p style = "font-size: 20pt">This text has the<em>font-size</em> style applied to it, making it 20pt.</p><p style = "font-size: 20pt; color: #0000ff">This text has the <em>font-size</em> and<em>color</em> styles applied to it, making it 20pt. andblue.</p></body></html>

7. What is the embedded style sheet technique?

An embedded style sheet enables to embed a CSS3 document in an HTML5document’s head section.

The style element following:

<style type = "text/css">em { background-color: #8000ff;

color: white }h1 { font-family: arial, sans-serif }p { font-size: 14pt }.special { color: blue }

</style>

defines the embedded style sheet.

8. List few common MIME types.

B.BHUVANESWARAN / AP (SS) / CSE / REC - 17

9. What is the linking external style sheets technique?

Style sheets are a convenient way to create a document with a uniform theme. Withexternal style sheets (i.e., separate documents that contain only CSS rules), you can provide auniform look and feel to an entire website (or to a portion of one). You can also reuse thesame external style sheet across multiple websites. Different pages on a site can all use thesame style sheet. When changes to the styles are required, you need to modify only a singleCSS file to make style changes across all the pages that use those styles. This concept issometimes known as skinning. While embedded style sheets separate content frompresentation, both are still contained in a single file, preventing a web designer and a contentauthor from conveniently working in parallel. External style sheets solve this problem byseparating the content and style into separate files.

10. List the ways of positioning an element within a browser window.

The type of positioning for an element is:

Relative positioning Float positioning Absolute positioning

11. Write a CSS rule that removes the underlines from all links inside list items andshifts them left by 3 tab spaces.

<style type = "text/css">li a:link { text-decoration:none }li { margin-left:3em }

</style>

B.BHUVANESWARAN / AP (SS) / CSE / REC - 18