Unit 1- WEB-PART Book Notes
Unit 1- WEB-PART Book Notes
FIGURE 2.6 FTP alternative connection model (3 processes). 24.4 Telnet (a generic TCP client) ‘elnet is available on most Unix systems and is a part of Windows 95/98/2000/NT. “The Telnet. program allows the user to specify the address of a server (as an IP address and port number) and attempts to open a TCP connection to the specified process. Once a connection is established, the user can send a request by typing commands and view anything sent back by the server. Telnet is useful only for services that involve ASCII strings, binary data cannot typically be entered via a | Keyboard or displayed in a window, In ‘Telnet, logging to a remote Unix computer “means simply accessing the default port on the server machine on which the Telnet is connected to. This default port is connected to a remote session server that starts ip a shell so that commands can be typed as if they are typed on the same console. though this is the most common use of Telnet, it is no different than connecting to y other types of network service that is available via TCP. 2.4.5 HTTP (Hyper-Text Transfer Protocol) (TTP is the application level protocol used to transfer hypertext documents on the lorld Wide Web (WWW). The protocol itself is fairly simple, a client (typically aDeveloper's Perspect TP serv the @ p connection 10,0 1 | ‘go formatted aa an ag’ browser) establishes a Tc} -conmectiny. The reply 8 often also formats aa an bsg) of an ASCII string and exp! ‘data formats can be re’ | erver + ne ‘jinary data). Structure of the request is as follows, ! fare sent # ; ii equence of lines of text—each |i, te An HTTP request is. a Coat ta: ne} LF pair. The first line includes tl of methods supported by Hy d: There are a variety CRI 22 % Web Technology: string, althoug example, images HTTP Reques terminated by a CR 1. The request-metho including: cnt he client wants to get 6 vn client wants to get some resource and ui : t by the client that may modify the reque, tha mitting forms). ne nts information about sg, "Th ome resource tells the server tl e Post: tells the server the more information will be sent (used, for example, when sub e HEAD: tells the server that the client wa resource, but not the resource itself. pur: tells the server that the client wants server (not widely supported). Is the server to delete a resource. A resource-identifier: There is a strict format (syntax) for the resoun jdentifier-strings that adhere to this format are called URIs (Univers d of simple alphanumeric nam Resource Identifiers). URIs are compose’ (some punctuation characters are permitted) delimited by the character “| A URI looks like a UNIX file path, for example, the following are vali URIs: @ /~foobar/index @ /cgi-bin/pizza_server @ /£00/bar/£00/bar/fo0/bar/f00/bar/ 3A ae? version identifier: It specifies the version of HTTP that the clier understands. This string starts with the prefix HTTP/ and is followed b version number (for example, HTTP/1.1). xd eG to send a resource to th @ DELETE: tel we Some examples of the first line of an HTTP request are: GET/~foobar/index HTTP/1.1 1 gi-bin/si leds Qnup?name=daveéaddress=amos+eaton+119 HTTP/1- gi-bin/signyy HEAD/HTTP/11 eT) MTTP/1.1 ‘The remaining lines of meee contains additional inform server provide a reg) colon » followed by a fie! “hich are shown below: TTP ee ars called header lines, each includ! onermation about the client or the request that may hé tte pa includes a field name, followed by many predefined header fields, someCuarrn 2 Internet Protoc User-Agent: generic browser From: foobar@cs.man.edu Referrer: http://barfoo.com/easy Accept: */* Cookie: favorite=chocolatecookles ‘The (possibly null) list of header lines is terminated by a blank line Gust a CRLF pair). Once the server secs a blank line, it knows it has the complete request and sends back a reply. Each reply contains a single line statua code, followed by a Tet of header lines terminated with a blank line. If the reply includes some content (typically some HTML) this follows the blank line. Although there are mechanisms that the client can use to make multiple requests using a single TCP connection, in ral, the server closes the connection as soon as it has sent a complete reply. ‘The following is an example session using Telnet to connect to an HTTP server. ‘The request (typed in by the user) is shown in italics and includes no header lines. gene! GET/HTTP/1.0 HTTP/1.0 200 Ok Server: fool Content-Type: text/html Content-Length: 313 Last-Modified: Sat, 02 Sep 2005 14:21:28 GMT
Hi Dear
> 2.4.6 Email Protocols ‘There are a number of protocols in use on the Internet that support electronic mail, and in addition to this, now there are a number of very popular Web-based email systems. The structure of the Internet-based email system is depicted in Figure 2.7. MTA is a Message Transfer Agent (a.k.a. an SMTP server). The MTAs forward and/or store email messages. UA is a User Agent (a mail client). User Agents provide the user interface, and jsometimes also act as an SM'TP client or as a POP client. MIME MIME is an acronym of Multipurpose Internet Mail standard that deals with the format of messages ex‘ Extensions. It is an international changed between different email24 0 Web Technology: A Developer’ File System net email system. FIGURE 2.7 Overview of the Inter systems. This standard is developed mainly to stent ees ae Antereti 9 includ 7 | messages, non-textual mes: a to include non-US-ASCII textual me: OS ASCIT information in message headers, i itipart messages and non ormati ; i te gtondinds one provided by Internet Engineering Task Force (IETF) in following documents. rmat of ARPA Internet text messages RFC-822 Standard for the fo: a RFC-2045 Multipurpose Internet Mail Extensions (MIME) Part One: For of Internet Message Bodies RFC-2046 Multipurpose Internet Mail Extensions (MIME) Part Two: Mi Types : © RFC-2047 Multipurpose Internet Mail Extensions (MIME) Part Th Message Header Extensions for Non-ASCII Text © RFC-2048 Multipurpose Internet Mail Extensions (MIME) Part Fi Registration Procedures © RFC-2049 Multipurpose Internet Mail Extensions (MIME) Part F Conformance Criteria and Examples Need for MIME os standards for basic Internet email were set in 1982 and described in RFC locument. The 1982 standards allow mail messages with the following restriction © messages contain only ASCII characters © messages with only 1000 characters © messages should not exceed certain length ‘To eliminate all the bi ictis a MIME was developed att (re, Testtictions and to include other message ' introduced as the standard in 1992. Features MIME allows mail messages to haveCuanren 2 Internet Pr Multiple objects in a single mossnge Mossage with any number of lincs or unlimited overall length Characters othor than ASCII, allowing non-English messages Multi-font: messages Binary or application specific files Images, audio, video and multipart messages ‘MIME headers 1, w MIME messages are represented by a body part. Each and a body. While defining the header MIME specifies a registered in IANA for public use. The syntax for content ty, MIME-Version header field This header uses a version number, which declares that the message conforms to MIME standard. This field is necessary for processing MIME messages. The header will look like this. MIME-Version: 1.0 Content-Type header field ‘This field specifies the type and subtype of the data in the message body and encoding format of such data. The following are the different content types. (a) Content-Type value Text Used to represent textual information (b) Content-Type value Multipart Used to combine several body parts may be of different types into a single message. (©) Content-Type value Application Used to transmit application or binary data. (a) Content-Type value Message Used for encapsulating mail message. (e) Content-Type value Image Used for transmitting image. (f) Content-Type value Audio Used for transmitting audio. (g) Content-Type value Video Used for transmitting video or moving data. body part has a header set of values, which are pe header field is type “/” subtype [";” parameter] Content-Typvy perspective Developer's Perspes a Web Technology’ vei 26% Wel ‘abtypes and paramete for each content jp, i The defined content types * given below: Application Application! Indicates uninterpre' lication/Postscript at the JOctet-Stream ‘ ted binary data. Ane postscript document. Indicates th: body contains 4 Audio Audio!Basic / . 1 dicates that audio is encoded by 8-bit ISDN w-law. When this suby is specified the sample rate is 8000 Hz and single channel is assun, Image ImagelJPEG Indicates an image in JPEG format. ImogelGIF Indicates an image in GIF format. Message MessagelRFC822 Indicates that the body contains an encapsulated message. MessagelPartial The partial subtype allows fragments of larger message to transmitted. Three parameters are used along with this subtype: © Id—match the parts together @ = Number—part/fragment number @ = Total—total number of parts or fragments MessagelExternal-Body Indicates that actual body data are not included but only referenced. Mutipart Indic i i ates bs the data consists of multiple body parts, each having its ° pecial string called encapsulation boundary, encapsulates & body part. It is d look like lefined by boundary parameter. Multipart content type " Content-Type: Mult Multipart(Mixed When this subtype i a it} viewed. ype is g ipart/mixed; boundary = xghoTexc ecified, multiple independent body parts #Curve 2 Internet Protocols 27 Multipart/Alternative Bach part ia an alternative vorsion of the same mensnges, Mail reader ean choone boat typo banod on tho aor's environment and preferences, Multipart/Pavallel AML body parte are dinplayod nimultancounly if supported by hardware and software, Multipart/Digest Indicates each body part ia RIC822 mail message. Toxt It is default content type. The character set of the text is specified in charset parameter. Content-Type: text/Plain; charset = US_ASCIT Text!Plain Indicates plain (unformatted) text. Text/Richtext Indicates n portable word processing format defined by MIME standard. Video Specifies that body contain an image. VideoIMPEG Indicates video coded according to MPEG standard. 3, Content~Transfer-Encoding header field Usually content in email will be encoded in 8-bit character or binary data. Such data cannot be transmitted using some protocols like SMTP which requires 7-bit ASCII encoding. a mechanism to re-encode sw header field. ‘The possible val E id ch data through Content- eae Encoding ues for this header fields are: BASEG4 QUOTED-PRINTABLE 8 BIT 7 BIT BINARY X-EncodingName 4, Optional Content-ID header field h If one body part references another, those body parts are labeled witl Content-ID.reloper's Perspective a header field sociate descriP' 28% Web Technology: AB tent Descriptio’ d to as 5. Optional Cor TT i ‘This header field is use 4 7 protocol) ange email messages. $y 2.4.7 SMTP (Simple Mail Transfer i hi god by mail servers to exc! iil m f tocol at sina, put does not support extraction Of @ user's ra mjupported by 2 numbEE of other protocola inclugs tions take place over @ TCP. sonnestion and are bag, , one A i ages, tis type of Prot’ own ae on a series of command reply exchanB™ + take place in the proper order, an, dt step” protocol—a number of exchanges mus! F entire sequence of exchanges makes up 2 transaction. SMTP exchanges are based on lines of ASCII text, that of the HTTP protocol. Each line coming from the type and any parameters follow the request type On the sal request types are listed below: 2 ELO—Establish SMTP connection, MATL FROM—Tells the server that the client steps necessary to create an email message. that identifies the receiver of the message. CPT TO—Tells the server from whom the message comes (the email addres of the sender). the content of the message follows (emai paTa—Tells the server that message content can include a number of email headers). 1 d for local email addresses)~ vrry—Verify that an email address is valid (use gis the order in which an email message is exchanged between the SMTP is the protoce”, supports sending function oF © from server—that function * POP and MAP. SMTP conversa! in just the same way wig client starts with a reque, me line. Some of the maj, jdentify the client wants to initiate the sequence y ° This includes the email addres The followin: client (the sender) and the server. © Client establishes TCP connection and sends HELO command with cliex! hostname as parameter. e Server replies to the HELO with status line that indicates whether the HEC was received properly. 4 © Client sends a MAIL FROM: comma: i i nd with email address of sender. e Server responds with status indication. ient sends one or more RCPT TO: commands (one for each receiver) wit . ie email address of the receiver of the mail message. erver responds with status indication. i fe fol co: oe responds with a status indication. ; . ome sani one or more lines of message data (the email messa e- its _ eminated by a line with only a period (no spaces). oe be sponds with.the status of entire transaction a on fade This exchan ge takes place it each stat place in the order shi , each status reponse before proceeding, The only tae and the client should wait onse is during the DATA commends ne 2 Sent Without ea . ® Client sends a DATA command. : ; °asi Cuarrex 2 Internet Protocols IAS POP (Rost Office Protocol, Version 3) POP_which is similar to SMTP, involves com: ‘STP POP is used to retrieve mail fir wig ASS | a database of email mossages crentod raguire authentication in the form of a socrot th server (@ password), POP commands and replies are form: ther “OK” or —ERR™. Some of the J below: mand/reply lockatep protocol. Unlike le user, typically the POP server has by an SMTP server. POP connections at is shared by the user and the POP ‘atted as ASCII lines, and all replies start commands that make up the POP protocol specify username, specify password. fet mailbox status (number of messages in the mailbox). get a list of messages and sizes, one per line, termination line contains just a period. ntrieve a message. mark a message for deletion, remove marked messages and close the (TCP) connection. ids for Internet Message Access Protocol. This protocol is used to access the s in email or electronic bulletin board that are in a mail server. For example, a _email’message Stored in an IMAP server, can be accessed from a desktop uter in home oF i ice ’ was originally developed in 1986 at Stanford niversity. The objectives of IMAP are Compatible with Internet messaging standards, e.g, MIME. . © Allow message access from multiple computers. ¢ Provide support for “online”, “offline”, and “disconnected” access modes ° . Support for concurrent access to shared mailboxes Client software needs no knowledge about the server's file store format, The most distinctive feature of IMAP is the fact that the mail messages remain on the server, instead of being downloaded to a computer. Checking the mail with a client or Web-based environment, using this protocol will allow retaining the messages in a universally-accessible place for access. IMAP supports the use of folders for mail organization, but instead of organizing the messages on the local computer, these folders are kept on the server as well. Another advantage to IMAP is quicker access to mail. If e-mails are accessed from a slower connection, such as modem dial-up, a substantial increase in speed can be noticed. Only the message headers are initially downloaded, so the user can choose to download, open, and read only those messages of interest. One drawback to using IMAP and saving messages on the server is that the user will be restricted by any quota limitation the administrator may set.30% Web Technology: A Developer's Perspective poh cL REL ick ‘The protocol includes operations for croating mailboxes doleting mailboxes renaming mailboxes checking for new messages permanently removing messages otting and clearing flags / ; serve based RFC-2822 and MIME parsing and searching selective fetching of message attributes, texts, and portions for effcieney IMAP vs POP Some of the characteristics are common to both POP and IMAP: -“e Both support offline operation. ; a variety of client platform types. Both can access new mail from , from anywhere in the network. Both can access new mail the Internet RFCs. For both, protocols are open; defined by Both are freely available implementations. Both clients are available for PCs, Macs, and Unix. For both, commercial implementations are available. Both are Internet oriented; no SMTP mail gateways required. Protocols deal with access only; both rely on SMTP to send. Both support persistent message IDs (for disconnected operation). ‘The advantage of POP is that it is a simple protocol which is easier | nt and most client software depend on it. The benefits of IMAP are, it impleme: manipulates persistent message status flags. These include flags such: Seen, Deleted, Answered, as well as user-defined flags. © stores messages as well as fetch them. @ access and manage multiple mailboxes. This includes the ability to naz and access different incoming and archive message folders, but also th ability to list, create, delete, and rename them. These mailboxes can be ¢ the same server or on different servers. © supports concurrent updates and access to shared mailboxes. This capabili is useful when multiple individuals are processing messages coming int? common inbox. Changes in mailbox state can be presented to # concurrently active clients via IMAP. P : ule, for accessing non-email data; e.g., NetNews, documents. congiucie ie omiine paradigm, for minimum connect time and disk use. speed links ie ee ae performance optimization, especially over lot ‘mithout dowulos : include the ability to fetch the structure of a messif ie ioe it, to selectively fetch individual message parts, 2” donee go use the server for searching in order to minimize data tre Petwveen client and server. With multimedia or multipart MIME mess “a ig selected parts of a message can be a huge advantage, as ¥>¢ receiving a short text message with a 10MB video clip “attachCrarra 2 Internet Protocols 31 Efficient i i i be cient processing of MIME messages is a significant advantage of IMAP In short, IMAP offers advantages over POP in the following areas: 17. 18. . Explain briefly how the domain names are translated to II . Write shortnotes on richer functionality in manipulating someone's inbox ability to manage mail folders besides someone's inbox - primitives to allow optimization of online performance, especially when dealing with large MIME messages. REVIEW QUESTIONS . What is a protocol? . Define protocol suite. . Write a short note on Ethernet. What is the functionality of HTTP? Give the functionality and purpose of HTTP. List the notion of transactions and the primary characteristics. Describe the architecture of TCP/IP? How does TCP provides reliable and ordered delivery service? Write short notes on IP addresses. Differentiate Domain name and Domain name system. |. Mention the functionalities of IANA. Write short notes on (a) proxy server (b) firewalls. . Explain briefly the services offered by TCP/IP. "Describe the significance of IP addresses and their types. _ is the authority responsible for providing IP address space. P addresses. () HTTP (b) FTP (© TFIP @ SMTP (e) Telnet @® POP (@) Domain Name System Explain HTTP session with an example. In the original class hierarchy of the Internet, 172.34.3.245 is a: (a) Class A address the IP address of