Unit 1
Unit 1
9. Telnet is a
I. Dialup program
J. Teller network
K. Standard internet protocol for remote login
L. Telephone network
Ans: A
Lecture-2
HTML Protocols
HTTP
• Hyper Text Transfer Protocol.
• Application Layer protocol for WWW.
• State less object-oriented protocol.
• HTTP is a request-response oriented protocol.
• TCP/IP based communication protocol.
• Useful to transfer resources like HTML files,
images, query results etc..
• First versions is HTTP/1.0.
• Current version is HTTP/1.1
HTTP(contd..)
• Communication process includes
1. HTTP server process is created on port(generally 80)
and waits for clients to establish a TCP connection.
2. HTTP client initiates a TCP Connection with HTTP server
3. HTTP server accepts this connection.
4. Client sends a HTTP request to server specifying
resource.
5. Server process request and sends an HTTP response
containing the desired information back to client.
6. HTTP server closes TCP connection.
HTTP(contd..)
• HTTP is connectionless: The client disconnects once request is
established and waits for a response from server. The server
must re-establish the connection to process the request.
• HTTP is media independent: Any type of data can be sent by
HTTP as long as both the client and server know how to handle
the data content which is determined by the MIME type.
• HTTP is stateless: The server and client are aware of each
other only during a request. Afterwards, each forgets the
other. For this reason neither the client nor the browser can
retain information between different request across the web
pages.
HTTP(contd..)
HTTP Clint/
HTTP(contd..)
HTTP request message:
• Sent by web client to web server
• Consists
– A request line
– A header
– An empty line
– An optional body
HTTP(contd..)
• Request line consists
– Request type(GET, HEAD, POST, PUT, PATCH, COPY,
MOVE, DELETE,LINK, UNLINK, OPTIONS, CONNECT,
TRACE)
– URL
– HTTP version
• Request header consists
– General Header
– Request Header
– Entity Header
HTTP(contd..)
HTTP response message:
• Sent by web server to web client
• Consists
– A status line
– A header
– An empty line
– An optional body
HTTP(contd..)
• Status line consists
– HTTP version
– Status code
– Status phrase
• Request header consists
– General Header
– Response Header
– Entity Header
SMTP
• Simple Mail Transfer Protocol.
• An internet protocol for sending and receiving e-mail message
between E-mail servers over the internet.
• An Application Layer protocol in TCCP/IP suite.
• Used to send electronic mails.
• Uses TCP as underlying transport layer protocol.
• Specifies set of commands and responses to send emails.
• Establishes a TCP socket to server that implements SMTP and gives
commands to send emails.
• SMTP does not specify any user authorization procedure.
• Uses SSL(Secure Socket Layer) over SMTP to ensure
authentication.
SMTP(contd..)
• Simple Mail Transfer Protocol:
SMTP(contd..)
• SMTP model for mail exchange
SMTP(contd..)
SMTP mail transaction flow:
• The sender SMTP establishes a TCP connection with the destination SMTP
and then waits for the server to send a 220 Service ready message or
a 421 Service not available message when the destination is temporarily
unable to proceed.
• Sender sends HELO message , to which the receiver will identify himself by
sending back its domain name.
• The sender-SMTP can use this to verify if it contacted the right destination
SMTP. If the sender-SMTP supports SMTP Service Extensions as defined in
RFC 1651, it may substitute an EHLO command in place of the HELO
command. A receiver-SMTP which does not support service extensions
will respond with a 500 Syntax error, command unrecognized message.
• The sender-SMTP should then retry with HELO, or if it cannot transmit the
message without one or more service extensions, it should send a QUIT
message.
SMTP(contd..)
• If a receiver-SMTP supports service extensions, it responds with a multi-line 250
OK message which includes a list of service extensions which it supports.
• The sender now initiates the start of a mail transaction by sending a MAIL
command to the receiver. This command contains the reverse-path(user
mailbox@host domain name) and also contain a list of routing hosts.
• The second step of the actual mail exchange consists of providing the server SMTP
with the destinations for the message (there can be more than one recipient). This
is done by sending one or more RCPT TO:<forward-path> commands. Each of them
will receive a reply 250 OK if the destination is known to the server, or a 550 No
such user here if it isn't.
• When all RCPT commands are sent, the sender issues a DATA command to notify
the receiver that the message contents are following.
• The server replies with 354 Start mail input, end with <CRLF>. <CRLF>
• The client now sends the data line by line, ending with the 5-character sequence
<CRLF>.<CRLF> line upon which the receiver acknowledges with a 250 OK or an
appropriate error message if anything went wrong.
Quiz
HTML Protocols
POP3
• Post office Protocol.
• Current version 3.0 is known as POP3.
• Application layer internet standard protocol
used to retrieve emails from remote mail server
over TCP/IP.
• Allows to down load emails in local machines
and read them offline.
• POP3 is a simple request and response protocol.
POP3(contd..)
• Listens at port number 110.
• Uses Transport layer security(TLS) or Secure
Sockets Layer(SSL) on TCP.
Internet
POP3 Client POP3 Server
Mail client POP3 port 110
POP3(contd..)
MIME
• Multipurpose Internet Mail Extension is an internet standard for
extending formats of email.
• MIME was defined in 1992 by the Internet Engineering Task Force(IETF).
• A new version, called S/MIME supports encrypted messages.
• SMTP(supports 7-bit ASCII Characters) is designed to transfer E-mail
only in the form of text messages.
• MIME defines mechanisms to use character encodings other than ASCII,
and 8-bit binary content(images, files, movies etc..)
• Mapping messages into and out of MIME format done by
• MIME extends different formats of E-mail
– Text in character sets other than ASCII
– Non-text attachments
– Message bodies with multiple parts
– Header information in non-ASCII character sets.
MIME(contd..)
• MIME is extensible by registering new content type and other MIME
attribute values.
• A MIME text may interpreted by a non MIME client.
• MIME Headers
– MIME version: Indicates message is MIME formatted.
– Content Type: Indicates internet media type message type consisting type and
sub type. Ex: text/plain, image/jpeg,
audio/mp3 etc..
– Content Disposition: specifies presentation style 1. Inline
content disposition: should automatically displayed when message is displayed.
2. Attachment content disposition:
Requires some form of action from user to open
– Content-Transfer-Encoding: Defines set of methods for representing binary
data in formats other than ASCII text formats.
Quiz
1.POP stands for
A. Pre order protocol
B. peer to peer protocol
C. Post office protocol
D. All
Ans: C
2. POP3 is a ____________ layer protocol
E. Application
F. Transport
G. Network
H. Link
Ans: A
3.Which of the following is used to retrieve mails from remote mail server?
I. SMTP
J. POP3
K. HTTP
L. DNS
Ans: B
4.POP3 listens at port number ___________---
A. 110
B. 102
C. 132
D. 210
Ans: A
5. MIMS supports which of the following
E. Text in character sets other than ASCII
F. Non- text attachments
G. Message bodies with multiple parts
H. All
Ans: D
6. Emails can be transmitted through SMTP in ________ format
I. MIME
J. POP3
K. HTML
L. None
Ans: A
Lecture-4
• Unordered List:
– Created using <ul> tag. Items in the list are created using <li> tag and displayed using
bullets
– <ul>
<li> ONE </li>
</ul>
555 77 854
Telephone:
555 77 855
Tables(contd..) Examples
•bananas
•pineapples
Tables(contd..) Examples
Cell padding (control the white space between cell content and the borders
<html>
<body>
<h4>Without cellpadding:</h4>
<table border="1">
<tr>
<td>First</td>
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr>
</table>
<h4>With cellpadding:</h4>
<table border="1" cellpadding="10">
<tr>
<td>First</td>
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr>
</table>
</body>
OUT PUT
Without cell padding:
First Row
Second Row
With cell padding:
First Row
Second Row
Tables(contd..) Examples
<tr>
<td>First</td>
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr>
</table>
</body>
</html>
Out put:
Without cell spacing:
<tr>
<td>First</td>
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr>
</table>
</body>
</html>
• A background color:
• A background Image:
Tables(contd..) Examples
<td align="right">$44.45</td>
</tr>
<tr>
<td align="left">Food</td>
<td align="right">$730.40</td>
<td align="right">$650.00</td>
</tr>
<tr>
<th align="left">Sum</th>
<th align="right">$1001.50</th>
<th align="right">$744.65</th>
</tr>
</table>
</body>
</html>
Out put
Images
• An image can placed in an HTML page using
standalone <img> tag
• Uses attribute “src” indicates URL of the
image file.
– <img src=“Liiiy.jpg” width=”200”>
• The height and width can be controlled by
“height ” and “width ”attributes.
Images (contd..)
• <img>…</img> attributes:
– src: specifies URL of image located.
– alt: Displays relative text when browser fails to display
image specified.
– allign: Aligns image on the given web page( TOP/
BOTTOM/ LEFT/RIGHT/ MIDDLE).
– border: Width of the border accompanying the image can
be specified.
– height/width: Can specify height and width of the image.
– hspase/vspace: Gaps or White spaces between the text
and images can be controlled.
– name: used to specify name of the image
Quiz
1) Choose the correct HTML tag to make a text italic
a) <italic>
b) <i>
Ans: b
2)What does HTML stand for?
a)Hypertext Markup Language
b)Hypertext Markup List
c)Happytext Markup Language
d)Hypertext Mark Language
ans: a
3) How do you add a comment into HTML?
a) <-Comment->
b) <--Comment-->
c) <!--Comment-->
d) <Comment/>
4. What is the correct tag for the smallest heading?
a) <h6>
b) <h7>
c) <small>
d) <h1>
Ans: a
5. What is the correct HTML for inserting an image?
e) <img display="image.gif" />
f) <img image="image.gif" />
g) <img src="image.gif" />
h) <img ="image.gif" />
Ans: c
6. What is the correct tag for the largest heading?
i) <h6>
j) <large>
k) <bigh>
l) <h1>
Ans: d
7. What does XHTML stands for?
m) eXtra Hypertext Markup Language
n) eXtension Hypertext Markup Language
o) eXtensible Hypertext Markup Language
p) eXtended Hypertext Markup Language
Ans: c
8. What character code would be used to create a < symbol?
a) & gt ;
b) & lt ;
c) & lessthan ;
d) & lesst ;
Ans: b
9. What tag is used to define abbreviated words?
e) <abbr>
f) <abr>
g) <abbreviation>
h) <ab>
Ans: a
10. What tag is used to define a paragraph?
i) <para>
j) <p>
k) <pg>
l) <pgraph>
Ans: b
Lecture-5
• The <frame> tag defines what HTML document to put into each
frame
• In the example below we have a frameset with two columns. The
first column is set to 25% of the width of the browser window. The
second column is set to 75% of the width of the browser window.
The HTML document "frame_a.htm" is put into the first column,
and the HTML document "frame_b.htm" is put into the second
column:
• <frameset cols="25%,75%">
• <frame src="frame_a.htm">
• <frame src="frame_b.htm">
• </frameset>
Note: The frameset column size value can also be set in pixels
(cols="200,500"), and one of the columns can be set to use the
remaining space (cols="25%,*").
<frame src="frame_a.html">
<frame src="frame_b.html">
<frame src="frame_c.html">
<noframes>
<body>Your browser does not handle frames!</body>
</noframes>
</frameset>
</html>
• <h3>Frame A</h3>
• </body>
• </html>
• <h3>Frame B</h3>
• </body>
• </html>
• <h3>Frame C</h3>
• </body>
• </html>
Tag
<html>
<frameset rows="50%,50%">
<frame src="frame_a.htm">
<frameset cols="25%,75%">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</frameset>
</html>
<html>
<frameset rows="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
</html>
<html>
<frameset rows="50%,50%">
<frame noresize="noresize" src="frame_a.htm">
<frameset cols="25%,75%">
<frame noresize="noresize" src="frame_b.htm">
<frame noresize="noresize" src="frame_c.htm">
</frameset>
</frameset>
</html>
<map name=“Universal">
<area shape=“rect" coords="0,0,82,126" href="sun.html"
alt="Sun">
<area shape="circle" coords="90,58,3" href="mercury.html"
alt="Mercury">
<area shape="circle" coords="124,58,8" href="venus.html"
alt="Venus">
</map>
Image mapping(contd..)
Server side Image maps:
• The ismap attribute is a boolean attribute.
• When present, it specifies that the image is part of a server-side
image-map (an image-map is an image with clickable areas).
• When clicking on a server-side image-map, the click coordinates
are sent to the server as a URL query string.
• The ismap attribute is allowed only if the <img> element is a
descendant of an <a> element with a valid href attribute.
• <a href=“welcome.jsp">
<img src=“universal.jpg" alt=“www.google.com" ismap>
</a>