HTTP Communications 95 502 Bad Gateway This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response. 503 Service Unavailable The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached. 504 Gateway Timeout This error response is given when the server is acting as a gateway and cannot get a response in time. 505 HTTP Version Not Supported The HTTP version used in the request is not supported by the server. 506 Variant Also Negotiates The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. 507 Insufficient Storage (WebDAV) The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. 508 Loop Detected (WebDAV) The server detected an infinite loop while processing the request. 510 Not Extended Further extensions to the request are required for the server to fulfil it. 511 Network Authentication Required The 511 status code indicates that the client needs to authenticate to gain network access. CU IDOL SELF LEARNING MATERIAL (SLM)
96 Advanced Computer Networks 5.6 E-mail Addressing E-mail For any e-mail message, mail message begins with a sender and ends with a receiver. In between these two people are many intermediate network devices that are used for reaching data properly to receiver. This can be handled by different protocols like TCP/IP. For notification of messages and ensuring that message is properly received by the receiver, we need protocols. Before configuring an e-mail client or server, it is to be understand first how e-mail works and how the programs are to be used or made available to your users. Every e-mail has a header section with TO (recipient Address), CC (Carbon Copy), BCC (Blind Carbon Copy) and Subject (To enter subject line). There is more to an e-mail than just the “To” and “From” addresses. Sometimes, you might receive an e-mail that does not have your address in the To: or Cc: fields. The content of an e- mail is actually completely separate from how the e-mail is delivered between computers on the internet. So, the addresses you see on the To or Cc lines of an e-mail are necessarily to whom the e-mail is actually delivered to, and the From line of an e-mail is not always of those who actually sent it. The To and From e-mail addresses listed have nothing to do with the delivery process. There is a legitimate case where the To and Cc lines may not list your address. That is when someone sends to you via Bcc. When someone Bccs you in on an e-mail, their e-mail client uses your address in the “envelope-to” when delivering, but removes the Bcc header before sending. How E-mail is Sent? If the actual content of the e-mail does not control where the e-mail goes, what does? E-mail is sent by a separate system called SMTP (Simple Mail Transfer Protocol). When e- mail is handed over from one computer (the “SMTP client”) to another computer (the “SMTP server”), the sending computer creates a sender address (the “envelope-from”, which is the address that bounce messages will go to if delivery fails at a later stage) and one or more recipient addresses (“envelope-to”), which tells the e-mail where to be sent to. These addresses are not part of the e-mail message itself, and normally they are just discarded once the message has been delivered. At Fastmail, though, we add special headers CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 97 called X-Mail-from (for “envelope-from”) and X-Delivered-to (for “envelope-to”) to the e-mail. So, you can always see how the message ended up at your account. We also add another header, X-Resolved-to, that shows the final address that was used for internal delivery to your mailbox. 5.7 Message Structure HTTP is based on the client-server architecture model and a stateless request/response protocol that operates by exchanging messages across a reliable TCP/IP connection. An HTTP “client” is a program (web browser or any other client) that establishes a connection to a server for the purpose of sending one or more HTTP request messages. An HTTP “server” is a program (generally a web server like Apache Web Server or Internet Information Services IIS, etc.) that accepts connections in order to serve HTTP requests by sending HTTP response messages. HTTP makes use of the Uniform Resource Identifier (URI) to identify a given resource and establish a connection. Once the connection is established, HTTP messages are passed in a format similar to that used by the Internet mail [RFC5322] and the Multipurpose Internet Mail Extensions (MIME) [RFC2045]. These messages include requests from client to server and responses from server to client which will have the following format: HTTP-message = <Request> | <Response> ; HTTP/1.1 messages HTTP requests and HTTP responses use a generic message format of RFC822 for transferring the required data. This generic message format consists of the following four items: A start line Zero or more header fields followed by CRLF An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields Optionally a message body In the following sections, we will explain each of the entities used in an HTTP message. Message Start Line A Start Line will have the following generic syntax: Start-Line = Request-Line | Status-Line CU IDOL SELF LEARNING MATERIAL (SLM)
98 Advanced Computer Networks We will discuss Request Line and Status Line while discussing HTTP Request and HTTP Response messages respectively. For now, let’s see the examples of start line in case of request and response: GET /hello.htm HTTP/1.1 (This is Request Line sent by the client) HTTP/1.1 200 OK (This is Status Line sent by the server) Header Fields HTTP header fields provide required information about the request or response, or about the object sent in the message body. There are four types of HTTP message headers: General header: These header fields have general applicability for both request and response messages. Request header: These header fields have applicability only for request messages. Response header: These header fields have applicability only for response messages. Entity header: These header fields define meta information about the entity-body or, if no body is present, about the resource identified by the request. All the above-mentioned headers follow the same generic format and each of the header field consists of a name followed by a colon (:) and the field value as follows: message header = field-name “:” [field-value] Following are the examples of various header fields: User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3 Host: www.example.com Accept-Language: en, mi Date: Mon, 27 Jul 2009 12:28:53 GMT Server: Apache Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT ETag: \"34aa387-d-1568eb00\" Accept-Ranges: bytes Content-Length: 51 Vary: Accept-Encoding Content-Type: text/plain CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 99 Message Body The message body part is optional for an HTTP message but if it is available, then it is used to carry the entity-body associated with the request or response. If entity-body is associated, then usually Content-Type and Content-Length header lines specify the nature of the body associated. A message body is the one which carries the actual HTTP request data (including form data and uploaded, etc.) and HTTP response data from the server (including files, images, etc.). Shown below is the simple content of a message body: <html> <body> <h1>Hello, World!</h1> </body> </html> An HTTP client sends an HTTP request to a server in the form of a request message which includes following format: A request line Zero or more header (General|Request|Entity) fields followed by CRLF An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields Optionally a message body The following sections explain each of the entities used in an HTTP request message. Request Line The Request Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF. The elements are separated by space SP characters. Request-Line = Method SP Request-URI SP HTTP-Version CRLF Let’s discuss each of the parts mentioned in the Request Line. Request Method The request method indicates the method to be performed on the resource identified by the given Request-URI. The method is case-sensitive and should always be mentioned in uppercase. The following table lists all the supported methods in HTTP/1.1. CU IDOL SELF LEARNING MATERIAL (SLM)
100 Advanced Computer Networks S.No. Method and Description 1 GET The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. 2 HEAD Same as GET, but it transfers the status line and the header section only. 3 POST A POST request is used to send data to the server, e.g., customer information, file upload, etc. using HTML forms. 4 PUT Replaces all the current representations of the target resource with the uploaded content. 5 DELETE Removes all the current representations of the target resource given by URI. 6 CONNECT Establishes a tunnel to the server identified by a given URI. 7 OPTIONS Describe the communication options for the target resource. 8 TRACE Performs a message loop back test along with the path to the target resource. Request URI The Request URI is a Uniform Resource Identifier and identifies the resource upon which to apply the request. Following are the most commonly used forms to specify an URI: Request-URI = “*” | absoluteURI | abs_path | authority S.No. Method and Description 1 The asterisk * is used when an HTTP request does not apply to a particular resource, but to the server itself, and is only allowed when the method used does not necessarily apply to a resource. For example: OPTIONS * HTTP/1.1 CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 101 2 The absoluteURI is used when an HTTP request is being made to a proxy. The proxy is requested to forward the request or service from a valid cache, and return the response. For example: GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 3 The most common form of Request-URI is used to identify a resource on an origin server or gateway. For example, a client wishing to retrieve a resource directly from the origin server would create a TCP connection to port 80 of the host “www.w3.org” and send the following lines: GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.w3.org Note that the absolute path cannot be empty; if none is present in the original URI, it MUST be given as \"/\" (the server root). Request Header Fields We will study General header and Entity header in a separate chapter when we will learn HTTP header fields. For now, let’s check what Request header fields are. The request header fields allow the client to pass additional information about the request, and about the client itself, to the server. These fields act as request modifiers. Here is a list of some important Request header fields that can be used based on the requirement: Accept-Charset Accept-Encoding Accept-Language Authorization Expect From Host If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since CU IDOL SELF LEARNING MATERIAL (SLM)
102 Advanced Computer Networks Max-Forwards Proxy-Authorization Range Referer TE User-Agent You can introduce your custom fields in case you are going to write your own custom Client and Web Server. Examples of Request Message Now, let’s put it all together to form an HTTP request to fetch hello.htm page from the web server running on tutorialspoint.com GET /hello.htm HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive Here, we are not sending any request data to the server because we are fetching a plain HTML page from the server. Connection is a general header, and the rest of the headers are request headers. The following example shows how to send form data to the server using request message body: POST /cgi-bin/process.cgi HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Content-Type: application/x-www-form-urlencoded Content-Length: length Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive licenseID=string&content=string&/paramsXML=string CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 103 Here, the given URL /cgi-bin/process.cgi will be used to process the passed data, and accordingly, a response will be returned. Here, content-type tells the server that the passed data is a simple web form data and length will be the actual length of the data put in the message body. The following example shows how you can pass plain XML to your web server: POST /cgi-bin/process.cgi HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Content-Type: text/xml; charset=utf-8 Content-Length: length Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive <?xml version=\"1.0\" encoding=\"utf-8\"?> <string xmlns=\"http://clearforest.com/\">string</string> After receiving and interpreting a request message, a server responds with an HTTP response message: A status line Zero or more header (General|Response|Entity) fields followed by CRLF An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields Optionally a message body The following sections explain each of the entities used in an HTTP response message. Message Status Line A Status Line consists of the protocol version followed by a numeric status code and its associated textual phrase. The elements are separated by space SP characters. Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF HTTP Version A server supporting HTTP version 1.1 will return the following version information: HTTP-Version = HTTP/1.1 CU IDOL SELF LEARNING MATERIAL (SLM)
104 Advanced Computer Networks Status Code The StatusCode element is a 3-digit integer where first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. There are 5 values for the first digit: S.No. Code and Description 1 1xx: Informational It means the request was received and the process is continuing. 2 2xx: Success It means the action was successfully received, understood and accepted. 3 3xx: Redirection It means further action must be taken in order to complete the request. 4 4xx: Client Error It means the request contains incorrect syntax or cannot be fulfilled. 5 5xx: Server Error It means the server failed to fulfill an apparently valid request. HTTP status codes are extensible and HTTP applications are not required to understand the meaning of all registered status codes. A list of all the status codes has been given in a separate chapter for your reference. Response Header Fields We will study General header and Entity header in a separate chapter when we will learn HTTP header fields. For now, let’s check what Response header fields are. The response header fields allow the server to pass additional information about the response which cannot be placed in the Status Line. These header fields give information about the server and about further access to the resource identified by the Request-URI. Accept-Ranges Age ETag Location Proxy-Authenticate CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 105 Retry-After Server Vary WWW-Authenticate You can introduce your custom fields in case you are going to write your own custom Web Client and Server. Examples of Response Message Now, let’s put it all together to form an HTTP response for a request to fetch the hello.htm page from the web server running on tutorialspoint.com HTTP/1.1 200 OK Date: Mon, 27 Jul 2009 12:28:53 GMT Server: Apache/2.2.14 (Win32) Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT Content-Length: 88 Content-Type: text/html Connection: Closed <html> <body> <h1>Hello, World!</h1> </body> </html> The following example shows an HTTP response message displaying error condition when the web server could not find the requested page: HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 CU IDOL SELF LEARNING MATERIAL (SLM)
106 Advanced Computer Networks Connection: Closed Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"> <html> <head> <title>404 Not Found</title> </head> <body> <h1>Not Found</h1> <p>The requested URL /t.html was not found on this server.</p> </body> </html> Following is an example of HTTP response message showing error condition when the web server encountered a wrong HTTP version in the given HTTP request: HTTP/1.1 400 Bad Request Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Content-Type: text/html; charset=iso-8859-1 Connection: Closed <!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"> <html> <head> <title>400 Bad Request</title> </head> <body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.</p> <p>The request line contained invalid characters following the protocol string.</p> </body> </html> CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 107 5.8 MIME: Multipurpose Internet Mail Extensions Multipurpose Internet Mail Extension (MIME) is a standard which was proposed by Bell Communications in 1991 in order to expand limited capabilities of e-mail. MIME is a kind of add-on or a supplementary protocol which allows non-ASCII data to be sent through SMTP. It allows the users to exchange different kinds of data files on the Internet: audio, video, images, application programs as well. Purpose and Functionality of MIME There is a growing demand for e-mail message as people also want to express in terms of Multimedia. So, MIME, an another e-mail application is introduced as it is not restricted to textual data. MIME transforms non-ASCII data at sender side to NVT 7-bit data and delivers it to the client SMTP. The message at receiver side is transferred back to the original data. As well as we can send video and audio data using MIME as it transfers them also in 7-bit ASCII data. Features of MIME 1. It is able to send multiple attachments with a single message. 2. Unlimited message length. 3. Binary attachments (executables, images, audio, or video files) which may be divided if needed. 4. MIME provided support for varying content types and multi-part messages. Working of MIME Suppose a user wants to send an e-mail through user agent and it is in a non-ASCII format. So, there is a MIME protocol which converts it into 7-bit NVT ASCII format. Message is transferred through e-mail system to the other side in 7-bit format, now MIME protocol again converts it back into non-ASCII code and now the user agent of receiver side reads it and then information is finally read by the receiver. MIME header is basically inserted at the beginning of any e-mail transfer. MIME Header It is added to the original e-mail header section to define transformation. There are five headers which we add to the original header: CU IDOL SELF LEARNING MATERIAL (SLM)
108 Advanced Computer Networks 1. MIME Version: Defines version of MIME protocol. It must have the parameter value 1.0, which indicates that message is formatted using MIME. 2. Content Type: Type of data used in the body of message. They are of different types like text data (plain, HTML), audio content or video content. 3. Content Type Encoding: It defines the method used for encoding the message like 7-bit encoding, 8-bit encoding, etc. 4. Content ID: It is used for uniquely identifying the message. 5. Content description: It defines whether the body is actually image, video or audio. 5.9 SMTP: Simple Mail Transfer Protocol with Examples E-mail is emerging as one of the most valuable services on the internet today. Most of the internet systems use SMTP as a method to transfer mail from one user to another. SMTP is a push protocol and is used to send the mail whereas POP (post office protocol) or IMAP (internet message access protocol) are used to retrieve those mails at the receiver’s side. SMTP Fundamentals SMTP is an application layer protocol. The client who wants to send the mail opens a TCP connection to the SMTP server and then sends the mail across the connection. The SMTP server is always on listening mode. As soon as it listens for a TCP connection from any client, the SMTP process initiates a connection on that port (25). After successfully establishing the TCP connection, the client process sends the mail instantly. SMTP Protocol The SMTP model is of two types: 1. End-to-end method 2. Store-and-forward method The end-to-end model is used to communicate between different organizations whereas the store-and-forward method is used within an organization. A SMTP client who wants to send the mail will contact the destination’s host SMTP directly in order to send the mail to the destination. The SMTP server will keep the mail to itself until it is successfully copied to the receiver’s SMTP. The client SMTP is the one which initiates the session and let us call it as the client-SMTP. The server-SMTP is the one which responds to the session request and let us call it as receiver-SMTP. The client-SMTP will start the session and the receiver-SMTP will respond to the request. CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 109 The SMTP Model The SMTP design is based on the following model of communication: as the result of a user mail request, the sender-SMTP establishes a two-way transmission channel to a receiver-SMTP. The receiver-SMTP may be either the ultimate destination or an intermediate. SMTP commands are generated by the sender-SMTP and sent to the receiver-SMTP. SMTP replies are sent from the receiver-SMTP to the sender-SMTP in response to the commands. Once the transmission channel is established, the SMTP-sender sends a MAIL command indicating the sender of the mail. If the SMTP-receiver can accept mail, it responds with an OK reply. The SMTP-sender then sends a RCPT command identifying a recipient of the mail. If the SMTP-receiver can accept mail for that recipient, it responds with an OK reply; if not, it responds with a reply rejecting that recipient (but not the whole mail transaction). The SMTP-sender and SMTP-receiver may negotiate several recipients. When the recipients have been negotiated, the SMTP-sender sends the mail data, terminating with a special sequence. If the SMTP-receiver successfully processes the mail data, it responds with an OK reply. The dialog is purposely lock- step, one-at-a-time. +----------+ +----------+ +------+ | | | | | User |<-->| | SMTP | | +------+ | Sender- |Commands/Replies| Receiver-| +------+ | SMTP |<-------------->| SMTP | +------+ | File |<-->| | and Mail | |<-->| File | |System| | | | | |System| +------+ +----------+ +----------+ +------+ Sender-SMTP Receiver-SMTP Fig. 5.3: Model for SMTP Use The SMTP provides mechanisms for the transmission of mail; directly from the sending user’s host to the receiving user’s host when the two host are connected to the same transport service, or via one or more relay SMTP-servers when the source and destination hosts are not connected to the same transport service. To be able to provide the relay capability, the SMTP-server must be supplied with the name of the ultimate destination host as well as the destination mailbox name. CU IDOL SELF LEARNING MATERIAL (SLM)
110 Advanced Computer Networks The argument to the MAIL command is a reverse-path, which specifies the person whom the mail is from. The argument to the RCPT command is a forward-path, which specifies the person whom the mail is to. The forward-path is a source route, while the reverse-path is a return route (which may be used to return a message to the sender when an error occurs with a relayed message). When the same message is sent to multiple recipients, the SMTP encourages the transmission of only one copy of the data for all the recipients at the same destination host. The mail commands and replies have a rigid syntax. Replies also have a numeric code. In the following, examples appear which use actual commands and replies. The complete list of commands and replies appears in Section 4 on specifications. Commands and replies are not case-sensitive, i.e., a command or reply word may be upper case, lower case, or any mixture of upper and lower case. Note that this is not true of mailbox user names. For some hosts, the user name is case-sensitive, and SMTP implementations must take case to preserve the case of user names as they appear in mailbox arguments. Host names are not case-sensitive. When the transport service provides an 8-bit byte (octet) transmission channel, each 7-bit character is transmitted right justified in an octet with the high-order bit cleared to zero. Communication between sender and the receiver: The senders and user agents prepare the message and send it to the MTA. The MTA functioning is to transfer the mail across the network to the receiver MTA. To send mail, a system must have the client MTA, and to receive mail, a system must have a server MTA. Sending E-mail: Mail is sent by a series of request and response messages between the client and a server. The message which is sent across consists of a header and the body. A null line is used to terminate the mail header. Everything which is after the null line is considered as the body of the message which is a sequence of ASCII characters. The message body contains the actual information read by the receipt. Receiving E-mail: The user agent at the server side checks the mailboxes at a particular time of intervals. If any information is received, it informs the user about the mail. When the user tries to read the mail, it displays a list of mails with a short description of each mail in the mailbox. By selecting any of the mail, a user can view its contents on the terminal. CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 111 Some SMTP Commands HELO: Identifies the client to the server, fully qualified domain name, only sent once per session. MAIL: Initiates a message transfer, fully qualified domain of originator. RCPT: Follows MAIL, identifies an addressee, typically the fully qualified name of the addressee and for multiple addressees, use one RCPT for each addressee. DATA: Sends data line by line. 5.10 Summary 1. HTTP (Hypertext Transfer Protocol) is perhaps the most popular application protocol used in the Internet (or The WEB). 2. HTTP Requests: In HTTP, every request must have an URL address. Additionally, the request needs a method. The four main HTTP methods are: – GET – PUT – POST – DELETE 3. HTTP Request Header – Referer header: Tells the URL from where the request has originated. – User-Agent header: Additional information about the browser being used to generate the request. – Host header: Uniquely identifies a host name; it is necessary when multiple web pages are hosted on the same server. – Cookie header: Submits additional parameters to the client. 4. HTTP Responses: There are some other interesting things in an HTTP response: – Server header: Information about which web server software is being used. – Set-Cookie header: Issues the cookie to the browser. – Message body: It is common for an HTTP response to hold a message body. – Content-Length header : Tells the size of the message body in bytes. CU IDOL SELF LEARNING MATERIAL (SLM)
112 Advanced Computer Networks 5. E-mail Addressing: For any e-mail message, mail message begins with a sender and ends with a receiver. In between these two people are many intermediate network devices that are used for reaching data properly to receiver. This can be handled by different protocols like TCP/IP. For notification of messages and ensuring that message is properly received by the receiver, we need protocols. 6. Request Method: The request method indicates the method to be performed on the resource identified by the given Request-URI. The method is case-sensitive and should always be mentioned in uppercase. The following table lists all the supported methods in HTTP/1.1. 7. Multipurpose Internet Mail Extension (MIME): MIME is a standard which was proposed by Bell Communications in 1991 in order to expand limited capabilities of e- mail. MIME is a kind of add-on or a supplementary protocol which allows non-ASCII data to be sent through SMTP. It allows the users to exchange different kinds of data files on the Internet: audio, video, images, application programs as well. 8. The SMTP Model: The SMTP design is based on the following model of communication: as the result of a user mail request, the sender-SMTP establishes a two- way transmission channel to a receiver-SMTP. The receiver-SMTP may be either the ultimate destination or an intermediate. SMTP commands are generated by the sender- SMTP and sent to the receiver-SMTP. SMTP replies are sent from the receiver-SMTP to the sender-SMTP in response to the commands. 5.11 Keywords/Abbreviations Hyper Text Transfer Protocol (HTTP): HTTP is perhaps the most popular application protocol used in the Internet (or the web). Status Code: Browsing the web, you may have encountered “404 error: not found” pages or “500 errors: server is not responding” pages. CU IDOL SELF LEARNING MATERIAL (SLM)
HTTP Communications 113 Abbreviations HTTP: Hyper Text Transfer Protocol MIME: Multipurpose Internet Mail Extension SMTP: Simple Mail Transfer Protocol 5.12 Learning Activity 1. Write different HTTP request and response methods. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 2. Differentiate between SMTP and MIME. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 3. What do you mean by anonymous FTP? ---------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 5.13 Unit End Questions (MCQs and Descriptive) A. Descriptive Type Questions 1. Explain HTTP request in detail. 2. Explain HTTP Request Headers and HTTP Responses. 3. Write a short note on Status Code of HTTP. 4. Explain different types of Error Status Code while sending and receiving e-mails. 5. Explain what is E-mail? State E-mail Addressing. 6. Explain message structure of HTTP in detail. 7. Explain MIME protocol in detail. 8. Explain SMTP protocol in detail. 9. Explain SMTP Model. 10. Explain SMTP commands. CU IDOL SELF LEARNING MATERIAL (SLM)
114 Advanced Computer Networks B. Multiple Choice/Objective Type Questions 1. __________ is an asymmetric request-response client-server protocol. (a) FTP (b) SMTP (c) HTTP (d) None of these 2. __________ Method of HTTP is used to apply partial modifications to a resource. (a) PATCH (b) GET (c) POST (d) RESPONSE 3. __________ is a Uniform Resource Identifier and identifies the resource upon which to apply the request. (a) Request-URL (b) Response-URI (c) Request-URI (d) Request-URL 4. __________ has unlimited message length. (a) UDP (b) HTTP (c) SMTP (d) MIME 5. The Status-Code element is a __________ integer. (a) 2-digit (b) 3-digit (c) 4-digit (d) 8-digit Answers 1. (c), 2. (a), 3. (c), 4. (d), 5. (b) 5.14 References 1. https://www.fastmail.com/help/receive/emailnottome.html 2. https://rapidapi.com/blog/api-glossary/http-request-methods/ 3. https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html 4. http://www.perflensburg.se/Privatsida/cp-web/AZXXEP.HTM CU IDOL SELF LEARNING MATERIAL (SLM)
UNIT 6 MAIL EXCHANGERS Structure: 6.0 Learning Objectives 6.1 Introduction 6.2 Delivering a Message 6.3 Mailboxes POP 6.4 Post Office Protocol (POP) 6.5 Internet Message Access Protocol (IMAP) 6.6 File Transfer Protocol (FTP) 6.6.1 FTP Commands 6.6.2 Trivial File Transfer Protocol (TFTP) 6.7 Telnet 6.8 Remote Communication Protocol 6.9 Proxy Server 6.10 Proxy Web Servers 6.11 Summary 6.12 Keywords/Abbreviations 6.13 Learning Activity 6.14 Unit End Questions (MCQs and Descriptive) 6.15 References CU IDOL SELF LEARNING MATERIAL (SLM)
116 Advanced Computer Networks 6.0 Learning Objectives After studying this unit, you will be able to: Define number system Define binary operations Explain coding Describe binary arithmetic 6.1 Introduction A mail server (sometimes also referred to an e-mail server) is a server that handles and delivers e-mail over a network, usually over the Internet. A mail server can receive e-mails from client computers and deliver them to other mail servers. A mail server can also deliver e-mails to client computers. A client computer is normally the computer where you read your e-mails, e.g., your computer at home or in your office. Also an advanced mobile phone or smartphone, with e- mail capabilities, can be regarded as a client computer in these circumstances. SMTP SMTP SMTP POP Client computer Mail server Mail server Client computer Fig. 6.1: Mail Server SMTP and POP3 Server When you press the “Send” button in your e-mail program (e-mail client), the program will connect to a server on the network/Internet that is called an SMTP server. SMTP is an acronym for Simple Mail Transfer Protocol and it is a protocol that is used when e-mails are delivered from clients to servers and from servers to other servers. When you download e-mails to your e-mail program, the program will connect to a server on the net that is known as a POP3 server. A POP3 server uses a protocol named POP3 for its communication. That is the reason why it is called a POP3 server and POP3 is an acronym for Post Office Protocol version 3. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 117 6.2 Delivering a Message E-mail is a service which allows us to send the message in electronic mode over the internet. It offers an efficient, inexpensive and real-time means of distributing information among people. Each user of e-mail is assigned a unique name for his e-mail account. This name is known as E- mail address. Different users can send and receive messages according to the e-mail address. E- mail is generally of the form [email protected]. E-mail Protocols are set of rules that help the client to properly transmit the information to or from the mail server. Here, in this tutorial, we will discuss various protocols such as SMTP, POP and IMAP. SMTP stands for Simple Mail Transfer Protocol. SMTP is a set of communication guidelines that allow software to transmit an electronic mail over the internet. It is a program used for sending messages to other computer users based on e-mail addresses. It provides a mail exchange between users on the same or different computers, and it also supports Following points discussed below It can send a single message to one or more recipients. Sending message can include text, voice, video or graphics. It can also send the messages on networks outside the internet. The main purpose of SMTP is used to set up communication rules between servers. The servers have a way of identifying themselves and announcing what kind of communication they are trying to perform. They also have a way of handling the errors such as incorrect e-mail address. For example, if the recipient address is wrong, then receiving server reply with an error message of some kind. First, we will break the SMTP client and SMTP server into two components such as user agent (UA) and mail transfer agent (MTA). The user agent (UA) prepares the message, creates the envelope and then puts the message in the envelope. The mail transfer agent (MTA) transfers this mail across the internet. User deals with the user agent (UA), e.g., Microsoft Outlook, Netscape, Mozilla, etc. In order to exchange the mail using TCP, MTA is used. The users sending the mail do not have to deal with the MTA. It is the responsibility of the system admin to set up the local MTA. The MTA maintains a small queue of mails so that it can schedule repeat delivery of mail in case the receiver is not available. The MTA delivers the mail to the mailboxes and the information can later be downloaded by the user agents. CU IDOL SELF LEARNING MATERIAL (SLM)
118 Advanced Computer Networks With the help of MTA senders and user agents send and receive messages. User at a terminal User Sent mail’s Client Sender Agent queue MTA Message Transfer Agent SMTP commands, TCP connection replies a mail TCP port 25 User at a terminal User User MTA Receiver Agent Mailboxes Message Transfer Agent Server Fig. 6.2: SMTP 6.3 Mailboxes POP Mail Access by POP3 The client POP3 software is installed on the receiver’s computer and the server POP3 software is installed on the mail server. POP3 is described in RFC 1939 and it uses well-known TCP port 110. The communication procedure is similar to SMTP and uses ASCII characters. POP3 begins when user starts the mail reader. The mail reader calls up the ISP (or mail server) and establishes a TCP connection with the message transfer agent at port 110. Once the connection has been established, the POP3 protocol goes through three states in sequence: 1. Authorization 2. Transactions 3. Update The Authorization state deals with user log in. The client sends its user name and password. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 119 The transaction state deals with the user collecting the e-mails and marking them for deletion from the mailbox. The update state causes the e-mails to be deleted. Once the user has logged in, the client can send the LIST command to list the contents of its mailbox. In this case, the server displays one message per line along with its length. This list ends with a period. POP 3 server POP 3 Client Mail server Receivers Server User Name +ok Password +ok List email Number & their sizes 1 2505 2 1403 3 8122 . Retrieve e-mail 1 N RETURN e-mail DELETE e-mail DELE 2 Reference e-mail N RETRN e-mail N QUIT +ok Exchange of Command & response using Pop3 Fig. 6.3: Mail Access by POP3 The client can retrieve messages using RETR command and can also mark them for deletion with DELE. CU IDOL SELF LEARNING MATERIAL (SLM)
120 Advanced Computer Networks When all the messages have been retrieved, the client gives QUIT command to end the transaction state and enter the update state. When the server has deleted all the messages, it sends a reply and breaks the TCP connection. Although POP3 is used to download messages from the server, the SMTP client is still needed on the desktop computers to forward messages from workstation user to its SMTP mail server. 6.4 Post Office Protocol (POP) Post Office Protocol version 3 (POP3) is a standard mail protocol used to receive e-mails from a remote server to a local e-mail client. POP3 allows you to download e-mail messages on your local computer and read them even when you are offline. Note that when you use POP3 to connect to your e-mail account, messages are downloaded locally and removed from the e-mail server. This means that if you access your account from multiple locations, that may not be the best option for you. On the other hand, if you use POP3, your messages are stored on your local computer, which reduces the space your e-mail account uses on your web server. A POP3 server stores messages for each user until the user connects to download and read them using a POP3 client such as Microsoft Outlook 98, Microsoft Outlook Express, or Microsoft Mail and News. SMTP expects the destination host, the mail server receiving the mail, to be online all the time; otherwise, TCP connection cannot be established. The server receives the mail on behalf of its clients. To retrieve a message from a POP3 server, a POPS client establishes a Transmission Control Protocol (TCP) session using TCP port 110, identifies itself to the server, and then issues a series of POP3 commands such as: Stat: It asks the server for the number of messages waiting to be retrieved. List: It determines the size of each message to be retrieved. ● Retr: It retrieves individual messages. ● Quit: Ends the POP3 session. By default, the POP3 protocol works on two ports: CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 121 ● Port 110: This is the default POP3 non-encrypted port. ● Port 99: This is the port you need to use if you want to connect using POP3 securely. Delivery by Delivery by SMTP Pop SMTP IMAP Sender Receiver LAN or LAN or MAN MAN Sender Mail Internal Receiver Server Mail Server Delivery by POP3 IMAP Fig. 6.4: Post Office Protocol 6.5 Internet Message Access Protocol (IMAP) The Internet Message Access Protocol (IMAP) is a mail protocol used for accessing e-mail on a remote web server from a local client. IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving e-mails. Both protocols are supported by all modern e-mail clients and web servers. While the POP3 protocol assumes that your e-mail is being accessed only from one application, IMAP allows simultaneous access by multiple clients. This is why IMAP is more suitable for you if you are going to access your e-mail from different locations or if your messages are managed by multiple users. IMAP version 4 is mail access protocol that is similar to POP3. IMAP has more features, and is more powerful and complex as compared to POP3. It allows a client to access and manipulate e-mails and mailboxes. IMAP runs on the well-known TCP port 143. IMAP was devised to overcome the limitations of POP3. This protocol is designed to help the user who needs to use different types of computers, say a laptop computer, while on the move and a workstation while in the office or at home. This CU IDOL SELF LEARNING MATERIAL (SLM)
122 Advanced Computer Networks protocol is basically meant for the e-mail server that can be accessed from any machine. In this protocol, the user machine needs to access the server. IMAP also has the ability to process the arrived mail from the remote mail server to fetch only the specified mail. For example, the user can request for the mail sent by a particular sender such as XYZ on a specific date. Salient Features of IMAP (Additional to POP3) A client/user can create, delete, or rename mailboxes on the mail server. A user can check the e-mail header prior to downloading. A client can selectively fetch message attributes such as all, body, envelope or flags. A user can search the content of thy e-mail for a specific string of characters prior to downloading. ● A user can partially download e-mail. This is useful if bandwidth is limited and the e- mail contains multimedia with high bandwidth requirements. ● It allows a user to maintain several flags such as seen, answered, draft and deleted. ● A user can create a hierarchy of mailboxes in a folder for e-mail storage. By default, the IMAP protocol works on two ports: 1. Port 143: This is the default IMAP non-encrypted port. 2. Port 993: This is the port you need to use if you want to connect using IMAP securely. 6.6 File Transfer Protocol (FTP) FTP is an Internet standard for file transfer. It adopts two TCP links to transfer a file – one is the control link and the other is the data link. FTP adopts different TCP ports according to the port mode, Port or Passive. In the past, the default client mode was Port. In recent years, the Passive mode is widely used because the Port mode is not secure (easy to be attacked). In Port mode, FTP adopts two default port numbers 20 and 21. Port 20 is used to transfer data, and Port 21 is used to transfer commands. The VRP routers can act as the FTP client or the FTP server. In this example, the PC functions as the FTP client to log in to the FTP server through the FTP protocol. The PC runs the FTP program. The system displays the login dialog box to request the user to enter user name and password, then the user can log in. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 123 If the VRP router needs to download a file from the remote server, it can act as the FTP client to access files from the FTP server. Enter “FTP IP address of the remote server” in the VRP system view. The user is prompted to enter the user name and password. Then, the prompt is changed into [FTP]. It indicates that the user logs in successfully. Get and Put are two operations performed on files. Get means downloading files from the server, while Put means uploading files to the server. When a FTP session is started between a client and a server, the client initiates a control TCP connection with the server side. The client sends control information over this. When the server receives this, it initiates a data connection to the client side. Only one file can be sent over one data connection. But the control connection remains active throughout the user session. As we know HTTP is stateless, i.e., it does not have to keep track of any user state, but FTP needs to maintain a state about its user throughout the session. 1.1.1.1. FTP client FTP Server Login - Win7 FTP Client UserName Password HostName *Note: Most FTP Servers, where you login as “Anonymous” . Will not gave you permissions to Upload. Rename and/or Delete. Fig. 6.5: FTP 6.6.1 FTP Commands USER: This command sends the user identification to the server. ● PASS: This command sends the user password to the server. CWD: This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. CU IDOL SELF LEARNING MATERIAL (SLM)
124 Advanced Computer Networks RMD: This command causes the directory specified in the path-name to be removed as a directory. MKD: This command causes the directory specified in the path-name to be created as a directory. ● PWD: This command causes the name of the current working directory to be returned in the reply. ● RETR: This command causes the remote host to initiate a data connection and to send the requested file over the data connection. ● STOR: This command causes to store a file into the current directory of the remote host. ● LIST: This command sends a request to display the list of all the files present in the directory. ● ABOR: This command tells the server to abort the previous FTP service command and any associated transfer of data. ● QUIT: This command terminates a USER, and if file transfer is not in progress, the server closes the control connection. 6.6.2 Trivial File Transfer Protocol (TFTP) It is also file transfer protocol without sophisticated features of FTP. It is good for simple file transfers, such as during boot time. It uses UDP as transport layer protocols. Errors in the transmission (lost packets, checksum errors, etc.) must be handled by the TFTP server. It uses only one connection through well-known port 69. TFTP uses a simple lock-step protocol (each data packet needs to be acknowledged). Thus, the throughput is limited. 6.7 Telnet Telnet is used for the remote service. The user can log in to the remote server through Telnet. The transport protocol used by Telnet is TCP and the port number is 17. The main task of the internet is to provide services to users. For example, the users want to run different application programs at the remote site and transfer a result to the local site. This requires a client-server program such as FTP, SMTP, etc. But this would not allow us to create a specific program for each demand. The better solution is to provide a general client-server program that lets the user access any application program on a remote computer. Therefore, a program allows a user to log on to a CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 125 remote computer. A popular client-server program Telnet is used to meet such demands. Telnet is an abbreviation for Terminal Network. Telnet provides a connection to the remote computer in such a way that a local terminal appears to be at the remote side. It is a network protocol used on the Internet or local area networks to provide a bidirectional interactive communications facility. Typically, telnet provides access to a command-line interface on a remote host via a virtual terminal connection which consists of an 8-bit byte oriented data connection over the Transmission Control Protocol (TCP). User data is interspersed in-band with TELNET control information. The user’s computer, which initiates the connection, is referred to as the local computer. The network terminal protocol (TELNET) allows a user to log in on any other computer on the network. We can start a remote session by specifying a computer to connect to. From that time until we finish the session, anything we type is sent to the other computer. The Telnet program runs on the computer and connects your PC to a server on the network. We can then enter commands through the Telnet program and they will be executed as if we were entering them directly on the server console. This enables us to control the server and communicate with other servers on the network. To start a Telnet session, we must log in to a server by entering a valid username and password. Telnet is a common way to remotely control Web servers. 6.8 Remote Communication Protocol A remote access protocol manages the connection between a remote computer and a remote access server. These are the primary remote access protocols: Serial Line Internet Protocol (SLIP) Point-to-Point Protocol (PPP) and Point-to-Point Protocol over Ethernet (PPPoE) Point-to-Point Tunneling Protocol (PPTP) Remote Access Services (RAS) Remote Desktop Protocol (RDP) CU IDOL SELF LEARNING MATERIAL (SLM)
126 Advanced Computer Networks Serial Line Internet Protocol (SLIP) In 1984, students at the University of California, Berkeley developed SLIP for UNIX as a way to transmit TCP/IP over serial connections (such as modem connections over POTS). SLIP operates at both the Physical and Data Link layers of the OSI model. Point-to-Point Protocol (PPP) and PPPoE (Point-to-Point Protocol over Ethernet) PPP is used to implement TCP/IP. It is the protocol that establishes a connection over point- to-point links (e.g., dial-up and dedicated leased lines). It is most commonly used for remote connections to ISPs and LANs. Point-to-Point Tunneling Protocol (PPTP) PPTP is the Microsoft-created protocol based on PPP. It is used to create virtual connections across the Internet using TCP/IP and PPP so that two networks can use the Internet as their WAN link and yet retain private network security. PPTP is both simple and secure. Windows Remote Access Services (RAS) Both Windows NT and Windows 2000 include technology to allow users to dial up a server and connect to not only that server, but also to that server’s host network. This technology is known as RAS. RAS is used in smaller networks where a dedicated dial-up router is not practical or possible. In a RAS setup, you can basically connect a modem to a Windows NT or Windows 2000 server, and by way of the RAS, configure that modem as dial-out only, dial-up only, or a combination. Remote Desktop Protocol (RDP) The Remote Desktop Protocol (RDP) is very similar to the Independent Computing Architecture (ICA) protocol used by Citrix products. As a matter of fact, RDP is used to access Windows Terminal Services, a close relative of the Citrix WinFrame product line. RDP performs the same basic functions as ICA, but it does it with a lot less functionality. RDP provides remote access for Windows clients only, whereas ICA provides it for multiple platforms, including DOS, Linux, Macintosh and many others. ICA is also a much more full-featured platform, including support for automatic client updates, publishing an application to a web browser. 6.9 Proxy Server A proxy server acts as a gateway between you and the internet. It is an intermediary server separating end-users from the websites they browse. Proxy servers provide varying levels of functionality, security and privacy depending on your use case, needs or company policy. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 127 If you are using a proxy server, internet traffic flows through the proxy server on its way to the address you requested. The request then comes back through that same proxy server (there are exceptions to this rule), and then the proxy server forwards the data received from the website to you. Fig. 6.6: Proxy Server Modern proxy servers do much more than forwarding web requests, all in the name of data security and network performance. Proxy servers act as a firewall and web filter, provide shared network connections, and cache data to speed up common requests. A good proxy server keeps users and the internal network protected from the bad stuff that lives out in the wild internet. Lastly, proxy servers can provide a high level of privacy. Purpose of Proxy Servers Following are the reasons to use proxy servers: Monitoring and filtering Improving performance Translation Accessing services anonymously Security Architecture The proxy server architecture is divided into several modules as shown in the following diagram: CU IDOL SELF LEARNING MATERIAL (SLM)
128 Advanced Computer Networks Proxy server interface Proxy server listener Connection manager Cache manager Log manager Configuration Fig. 6.7: Architecture of Proxy Server Proxy User Interface This module controls and manages the user interface, and provides an easy-to-use graphical interface, window and a menu to the end-user. This menu offers the following functionalities: Start proxy Stop proxy Exit Blocking URL Blocking client Manage log Manage cache Modify configuration CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 129 Proxy Server Listener It is the port where new request from the client browser is listened. This module also performs blocking of clients from the list given by the user. Connection Manager It contains the main functionality of the proxy server. It performs the following functions: Read request from header of the client. Parse the URL and determine whether the URL is blocked or not. Generate connection to the web server. Read the reply from the web server. If no copy of page is found in the cache, then download the page from web server else will check its last modified date from the reply header, and accordingly, will read from the cache or server from the web. Then it will also check whether caching is allowed or not, and accordingly, will cache the page. Cache Manager This module is responsible for storing, deleting, clearing and searching of web pages in the cache. Log Manager This module is responsible for viewing, clearing and updating the logs. Configuration This module helps to create configuration settings which in turn let other modules to perform desired configurations such as caching. 6.10 Proxy Web Servers The Web Proxy Service The Web Proxy service supports proxy requests from any browser that is compatible with the standard CERN proxy protocol, such as Microsoft Internet Explorer or Netscape Navigator. You can use a computer that runs any operating system, such as Windows 95, Windows NT, CU IDOL SELF LEARNING MATERIAL (SLM)
130 Advanced Computer Networks Macintosh or UNIX. The following illustration shows the communication path for the Web Proxy service. Internet Web HTTP HTTP, FTP or browser TCP/IP Gopher TCP/IP Web Proxy service Client Microsoft Proxy Server Fig. 6.8: The Web Proxy Service Communication Path The Web Proxy service provides the following features: CERN-proxy compatibility: The Web Proxy service supports all popular Internet browsers and the Hypertext Transport Protocol (HTTP), Gopher and File Transfer Protocol (FTP) protocols. Also, the Web Proxy service supports the HTTP-S protocol for secure sessions by using Secure Socket Layer (SSL) connections. HTTP and FTP object caching: The Web Proxy service stores copies of requested Internet resources in a dedicated cache. Subsequent requests for these objects can be serviced from the server disk rather than by issuing the request over the Internet. This improves client browser performance, decreases user response time, and reduces bandwidth consumption on your Internet connection. Proxy Server also uses active caching. The Web Proxy service uses active caching to proactively ensure the freshness and availability of popular objects. Proxy Server can be set to automatically connect to the Internet and download certain Internet objects based on their popularity, without client initiation. Objects are subject to active caching on the basis of their popularity relative to their rate of change. You can also customize how often the cache is updated. Reverse proxying and reverse hosting for Web publishing Reverse proxying is the ability to listen to incoming requests for an internal Web (HTTP) server computer and CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 131 forward requests to that server. In this way, a server is protected by Proxy Server’s security features. Reverse hosting takes publishing to the next logical step by maintaining a list of internal server computers that have permission to publish to the Internet, thereby allowing Proxy Server to offer access to multiple servers that are located behind it. The reverse proxying and hosting features offer great flexibility and enhanced security. Virtually, any computer on your internal network that is running an HTTP server application, such as IIS, can publish to the Internet. Security is not compromised as all incoming requests and outgoing responses pass through Proxy Server first. So, there remains only a single access point to the Internet. User-level security for each application protocol: Proxy Server can be configured to allow anonymous requests by users or to require users to be authenticated (validated) by the server. Once users are authenticated, you can determine which protocols (HTTP, FTP or Gopher) are accessible for each user. Users can be granted access to selected protocols. The Web Proxy service provides secure, encrypted logon for those browsers that support Windows NT challenge/response authentication and provides basic authentication for other browsers. You can also use data encryption by means of SSL tunneling. Restricted (filtered) access to Internet sites: You can restrict access to remote websites by domain name, IP address and subnet mask. You can choose to grant access to specific websites also can deny access to specific websites. The settings are global and affect all users who access the Internet through the Proxy Server computer. IP-address aggregation: All requests to the Internet are done with the Proxy Server’s external (Internet) IP address as the source address. This hides internal IP addresses and allows the use of unregistered or private addresses. Logged information about Internet requests made by clients: A new log can be created daily, weekly or monthly. The log can be maintained in a text file or in an ODBC-compliant database (such as Microsoft SQL Server). Compatibility with all popular client operating systems and client hardware platforms, including Windows, Macintosh and UNIX. CU IDOL SELF LEARNING MATERIAL (SLM)
132 Advanced Computer Networks 6.11 Summary Delivering a Message through E-mail using SMTP E-mail is a service which allows us to send the message in electronic mode over the internet. It offers an efficient, inexpensive and real-time means of distributing information among people. Each user of e-mail is assigned a unique name for his e-mail account. This name is known as e- mail address. Different users can send and receive messages according to the e-mail address. E- mail is generally of the form [email protected] SMTP Commands HELO: Identifies the client to the server, fully qualified domain name, only sent once per session. MAIL: Initiates a message transfer, fully qualified domain of originator. RCPT: Follows MAIL, identifies an addressee, typically the fully qualified name of the addressee and for multiple addressees use one RCPT for each addressee. DATA: Sends data line by line. The client POP3 software is installed on the receiver’s computer. The server POP3 software is installed on the mail server. POP3 is described in RFC 1939 and it uses well-known TCP port 110. The communication procedure is similar to SMTP and uses ASCII characters. POP3 begins when user starts the mail reader. Internet Message Access Protocol The Internet Message Access Protocol (IMAP) is a mail protocol used for accessing e-mail on a remote web server from a local client. IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving e-mails. Both protocols are supported by all modern e--mail clients and web servers. While the POP3 protocol assumes that your e-mail is being accessed only from one application, IMAP allows simultaneous access by multiple clients. This is why IMAP is more suitable for you if you are going to access your e-mail from different locations or if your messages are managed by multiple users. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 133 FTP FTP is an Internet standard for file transfer. It adopts two TCP links to transfer a file. One is control link and the other is the data link. FTP adopts different TCP ports according to the port mode, Port or Passive. In the past, the default client mode was Port. In recent years, the Passive mode is widely used because the Port mode is not secure (easy to be attacked). In Port mode, FTP adopts two default port numbers 20 and 21. Port 20 is used to transfer data, and Port 21 is used to transfer commands. FTP Commands USER: This command sends the user identification to the server. PASS: This command sends the user password to the server. CWD: This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. RMD: This command causes the directory specified in the path-name to be removed as a directory. 6.12 Keywords/Abbreviations Sending E-mail and Receiving E-mail through SMTP Sending Mail: Mail is sent by a series of request and response messages between the client and a server. The message which is sent across consists of a header and the body. Receiving E-Mail: The user agent at the server side checks the mailboxes at a particular time of intervals. If any information is received, it informs the user about the mail. SMTP Commands HELO: Identifies the client to the server, fully qualified domain name, only sent once per session. MAIL: Initiates a message transfer, fully qualified domain of originator RCPT: Follows MAIL, identifies an addressee, typically the fully qualified name of the addressee, and for multiple addressees, use one RCPT for each addressee. DATA: Sends data line by line. CU IDOL SELF LEARNING MATERIAL (SLM)
134 Advanced Computer Networks Post Office Protocol version 3 (POP3): POP3 is a standard mail protocol used to receive e-mails from a remote server to a local e-mail client. It allows you to download e- mail messages on your local computer and read them even when you are offline. Abbreviations HTTP: Hyper Text Transport Protocol FTP: File Transfer Protocol SSL: Secure Socket Layer IMAP: Internet Message Access Protocol POP3: Post Office Protocol version 3 6.13 Learning Activity 1. Explain difference between FTP and TFTP. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 2. Explain difference between SMTP and MIME. ----------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------- 6.14 Unit End Questions (MCQs and Descriptive) A. Descriptive Type Questions 1. How message can be delivered in a mail through SMTP Protocol? 2. Explain Mailboxes POP in detail. 3. Explain Post Office Protocol. 4. Explain IMAP with its architecture. 5. Explain FTP and its commands. 6. Explain Telnet. 7. Explain Proxy Server with its architecture. 8. Explain Proxy Web Servers. CU IDOL SELF LEARNING MATERIAL (SLM)
Mail Exchangers 135 B. Multiple Choice/Objective Type Questions 1. __________ network protocol allows a user to log in on any other computer on the network. (a) TELNET (b) POP3 (c) SMTP (d) SNMP 2. __________ is the port you need to use if you want to connect using POP3 securely. (a) Port 80 (b) Port 99 (c) Port 20 (d) Port 53 3. __________ is an Internet standard for file transfer. (a) HTTP (b) SMTP (c) FTP (d) TCP 4. Which command causes the directory specified in the path-name to be removed as a directory? (a) ABBR (b) CWD (c) PWD (d) RMD 5. In __________ protocol, a client/user can create, delete or rename mailboxes on the mail server. (a) IMAP (b) SMTP (c) HTTP (d) FTP Answers 1. (a), 2. (b), 3. (c), 4. (d), 5. (a) 6.15 References 1. https://www.samlogic.net/articles/mail-server.htm 2. https://whatis.techtarget.com/definition/mail-server-mail-transfer-transport-agent-MTA- mail-router-Internet-mailer 3. https://hostadvice.com/how-to/how-to-change-your-domains-mx-mail-exchanger-record- in-cpanel/ CU IDOL SELF LEARNING MATERIAL (SLM)
UNIT 7 SNMP (SIMPLE NETWORK MANAGEMENT PROTOCOL) Structure: 7.0 Learning Objectives 7.1 Introduction 7.2 IP Management Protocol 7.3 Network Management Protocols 7.4 Simple Network Management Protocol (SNMP) 7.5 Agents and Managers 7.6 SNMP Organization 7.7 Object Identifiers 7.8 Problems with SNMP 7.9 Summary 7.10 Keywords/Abbreviations 7.11 Learning Activity 7.12 Unit End Questions (MCQs and Descriptive) 7.13 References 7.0 Learning Objectives After studying this unit, you will be able to: Elaborate simple network management protocol Define object identifiers Describe problems with SNMP CU IDOL SELF LEARNING MATERIAL (SLM)
SNMP (Simple Network Management Protocol) 137 7.1 Introduction In mail exchange management, simple network management protocol and network management protocol and internet protocols are used. The core of SNMP is a simple set of operations (and the information these operations gather) that gives administrators the ability to change the state of some SNMP-based device. For example, you can use SNMP to shut down an interface on your router or check the speed at which your Ethernet interface is operating. SNMP can even monitor the temperature on your switch and warn you when it is too high. SNMP usually is associated with managing routers, but it is important to understand that it can be used to manage many types of devices. While SNMP’s predecessor, the Simple Gateway Management Protocol (SGMP). Network management is defined as the process of managing a network for fault and performance using various tools and technologies to keep up with the business requirement. There are four critical aspects of a network management software: Fault Identification Performance Management Network Provisioning Maintaining QoS 7.2 IP Management Protocol Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. Devices that typically support SNMP include cable modems, routers, switches, servers, workstations, printers, and more. SNMP is widely used in network management for network monitoring. SNMP exposes management data in the form of variables on the managed systems organized in a management information base (MIB) which describe the system status and configuration. These variables can then be remotely queried (and, in some circumstances, manipulated) by managing applications. CU IDOL SELF LEARNING MATERIAL (SLM)
138 Advanced Computer Networks Three significant versions of SNMP have been developed and deployed. SNMPv1 is the original version of the protocol. More recent versions, SNMPv2c and SNMPv3, feature improvements in performance, flexibility and security. SNMP is a component of the Internet Protocol Suite as defined by the Internet Engineering Task Force (IETF). It consists of a set of standards for network management, including an application layer protocol, a database schema, and a set of data objects. 7.3 Network Management Protocols Network Management system consist of the following protocols: SNMP and CMIP are two well-known network management protocols. A network management system is generally described using the Open System Interconnection (OSI) network management model.Network Management Station Network Management Station Display Network Network Management Application Network Management Protocol Agent Agent Agent Managed Device Managed Device Managed Device Fig. 7.1: Network Management System SNMP used in Application Layer of OSI model: OSI Model/CMIP International standard (ISO/OSI) Management of data communications networks – LAN and WAN Deals with all seven layers Most complete model Object-oriented CU IDOL SELF LEARNING MATERIAL (SLM)
SNMP (Simple Network Management Protocol) 139 Well structured and layers Consumes large resource in implementation Internet Model/SNMP TMN International standard (ITU-T) Management of telecommunications network Based on OSI network management framework Addresses both network and administrative aspects of management IEEE LAN/WAN IEEE standards adopted internationally Addresses management of LANs and MANs Adopts OSI standards significantly Deals with first two layers of the OSI Reference Model Web-based Management Uses Web server/Web browser architecture Java Management Extensions (JMX) 7.4 Simple Network Management Protocol (SNMP) SNMP is an application layer protocol which uses UDP port number 161/162. SNMP is used to monitor the network, detect network faults and sometimes even used to configure remote devices. SNMP Components There are three components of SNMP: 1. SNMP Manager: It is a centralized system used to monitor network. It is also known as Network Management Station (NMS). 2. SNMP Agent: It is a software management software module installed on a managed device. Managed devices can be network devices like PC, router, switches, servers, etc. CU IDOL SELF LEARNING MATERIAL (SLM)
140 Advanced Computer Networks 3. Management Information Base: MIB consists of information of resources that are to be managed. These information are organized hierarchically. It consists of objects and instances which are essentially variables. SNMP Messages Different variables are: 1. GetRequest: SNMP manager sends this message to request data from SNMP agent. It is simply used to retrieve data from SNMP agent. In response to this, SNMP agent responds with requested value through response message. 2. GetNextRequest: This message can be sent to discover what data is available on a SNMP agent. The SNMP manager can request for data continuously until no more data is left. In this way, SNMP manager can take knowledge of all the available data on SNMP agent. 3. GetBulkRequest: This message is used to retrieve large data at once by the SNMP manager from SNMP agent. It is introduced in SNMPv2c. 4. SetRequest: It is used by SNMP manager to set the value of an object instance on the SNMP agent. 5. Response: It is a message sent from agent upon a request from manager. When sent in response to Get messages, it will contain the data requested. When sent in response to Set message, it will contain the newly set value as confirmation that the value has been set. 6. Trap: It is a message sent by the agent without being requested by the manager. It is sent when a fault has occurred. 7. InformRequest: It was introduced in SNMPv2c, used to identify if the trap message has been received by the manager or not. The agents can be configured to set trap continuously until it receives an Inform message. It is same as trap but adds an acknowledgement that trap does not provide. SNMP Security Levels It defines the type of security algorithm performed on SNMP packets. These are used in only SNMPv3. There are three security levels, namely: 1. noAuthNoPriv: This (no authentication, no privacy) security level uses community string for authentication and no encryption for privacy. 2. authNopriv: This security level (authentication, no privacy) uses HMAC with Md5 for authentication and no encryption is used for privacy. CU IDOL SELF LEARNING MATERIAL (SLM)
SNMP (Simple Network Management Protocol) 141 3. authPriv: This security level (authentication, privacy) uses HMAC with Md5 or SHA for authentication and encryption uses DES-56 algorithm. SNMP Versions There are three versions of SNMP: 1. SNMPv1: It uses community strings for authentication and use UDP only. 2. SNMPv2c: It uses community strings for authentication. It uses UDP but can be configured to use TCP. 3. SNMPv3: It uses Hash based MAC with MD5 or SHA for authentication and DES-56 for privacy. This version uses TCP. Therefore, conclusion is the higher the version of SNMP, more secure it will be. 7.5 Agents and Managers Fig. 7.2: SNMP Agents and Managers SNMP has two components – Manager and Agent. The manager is a host that controls and monitors a set of agents such as routers. It is an application layer protocol in which a few manager stations can handle a set of agents. The protocol designed at the application level can monitor the devices made by different manufacturers and installed on different physical networks. CU IDOL SELF LEARNING MATERIAL (SLM)
142 Advanced Computer Networks It is used in a heterogeneous network made of different LANs and WANs connected by routers or gateways. Managers and Agents A manager is a host that runs the SNMP client program while the agent is a router that runs the SNMP server program. Management of the internet is achieved through simple interaction between a manager and agent. The agent is used to keep the information in a database while the manager is used to access the values in the database. For example, a router can store the appropriate variables such as a number of packets received and forwarded while the manager can compare these variables to determine whether the router is congested or not. Agents can also contribute to the management process. A server program on the agent checks the environment. If something goes wrong, the agent sends a warning message to the manager. Management with SNMP has three basic ideas: A manager checks the agent by requesting the information that reflects the behavior of the agent. A manager also forces the agent to perform a certain function by resetting values in the agent database. An agent also contributes to the management process by warning the manager regarding an unusual condition. Management Components Management is not achieved only through the SNMP protocol but also the use of other protocols that can cooperate with the SNMP protocol. Management is achieved through the use of the other two protocols: SMI (Structure of management information) and MIB (management information base). Management is a combination of all these three protocols, i.e., SMI, MIB and SNMP such as abstract syntax notation 1 (ASN.1) and basic encoding rules (BER). CU IDOL SELF LEARNING MATERIAL (SLM)
SNMP (Simple Network Management Protocol) 143 Fig. 7.3: Management Components SMI The SMI (Structure of management information) is a component used in network management. Its main function is to define the type of data that can be stored in an object and to show how to encode the data for the transmission over a network. MIB The MIB (Management information base) is a second component for the network management. Each agent has its own MIB, which is a collection of all the objects that the manager can manage. MIB is categorized into eight groups: system, interface, address translation, ip, icmp, tcp, udp and egp. These groups are under the mib object. Fig. 7.4: MIB SNMP Messages SNMP defines five types of messages: GetRequest, GetNextRequest, SetRequest, GetResponse and Trap. CU IDOL SELF LEARNING MATERIAL (SLM)
144 Advanced Computer Networks Fig. 7.5: UDP Connection GetRequest: The GetRequest message is sent from a manager (client) to the agent (server) to retrieve the value of a variable. 7.6 SNMP Organization SNMP is the most widely used network management protocol. When we say SNMP management, we are really referring to Internet management. SNMP Management Model 1. Organization Model: Relationship between network element, agent and manager Hierarchical architecture 2. Information Model: Uses ASN.1 syntax SMI (Structure of Management Information) MIB (Management Information Base) CU IDOL SELF LEARNING MATERIAL (SLM)
Search
Read the Text Version
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210