You are on page 1of 14

APPLICATION LAYER

E-MAIL

E-Mail (SMTP, IMAP, MIME),

  • One of the oldest network application.

  • Client / Server model.

To understand E-Mail,

  • Distinguish the user interface (Mail reader) from the underlying message transfer protocol (SMTP)

  • Distinguish between the transfer protocol and companion protocol (MIME).

Protocols used,

Message Format,

Header

Value

Type and value is separated by a colon.

E mail message can have many different types of data (like images, videos,

documents, audio, etc…)

These different types of data are defined in MIME.

MIME (Multipurpose Internet Mail Extension)

MIME contains three parts,

  • First piece of information collection of header lines that augments the original set defined by RFC822.

o

It describes the data being carried in the message.

o

It contains,

  • MIME-Version

http://csetube.weebly.com/

  • Content-Type

  • From

  • To

  • Content-Description (Subject)

  • Date

  • Second piece of information defines the content type of the message. i.e., ―Content- Type” field o Eg., image/jpeg, image/gif text/plain, text/richtext audio/basic, multipart/mixed video/mpeg, video/quicktime application/pdf, application/zip, application/postscript

  • Third piece of information defines the content encoding scheme for the message. i.e., “Content-Transfer-Encoding” field.

<a href=http://csetube.tk/  From  To  Content-Description (Subject)  Date  Second piece of information – defines the content type of the message. i.e., ― Content- Type” field o Eg., image/jpeg, image/gif text/plain, text/richtext audio/basic, multipart/mixed video/mpeg, video/quicktime application/pdf, application/zip, application/postscript  Third piece of information – defines the content encoding scheme for the message . i.e., “Content -Transfer- Encoding” field . E.g., 7 bit, base 64, quoted-printable http://csetube.weebly.com/ " id="pdf-obj-1-45" src="pdf-obj-1-45.jpg">

http://csetube.weebly.com/

Message Transfer

  • SMTP is used to transfer message from one host to another host.

  • Key players,

    • Mail reader web browser

<a href=http://csetube.tk/ Message Transfer  SMTP is used to transfer message from one host to another host.  Key players, Mail reader – web browser Mail daemon – process runs on host Mail Daemon, Act as a Mail Transfer Agent (MTA) The daemon uses SMTP running over TCP to transmit the message to a daemon running on another machine, and the daemon puts incoming messages into the user’s mailbox. MTA on a sender’s machine establishes an SMTP/TCP connection to the MTA on the recipient’s mail server; in many cases the mail traverses one or more mail gateways on its route from the sender’s host to the receiver’s host. Job of the gateway is to store and forw ard email messages, much like an ― IP gateway ‖. But the difference is, mail gateway typically buffers messages on disk and is willing to t ry retransmitting them to the next machine for several days, while an IP router buffers datagrams in memory and is only willing to retry transmitting them fo r a fraction of a s econd. Fig. Sequence of mail gateways store and forward email messages  Some of the commands used by the client, HELO, MAIL, RCPT, DATA, QUIT  Server responds with code. Mail Reader  Users actually retrieve his or her messages from the mailbox, read them, reply to them, and possibly save a copy for future reference.  The user performs all these actions by interacting with a mail reader.  The reader was a program running on the same machine as the user’s mailbox, in which case it could simply read and write the file that implements the mailbox.  Protocols used to retrieve mails are, http://csetube.weebly.com/ " id="pdf-obj-2-57" src="pdf-obj-2-57.jpg">

Fig. Sequence of mail gateways store and forward email messages

  • Some of the commands used by the client,

<a href=http://csetube.tk/ Message Transfer  SMTP is used to transfer message from one host to another host.  Key players, Mail reader – web browser Mail daemon – process runs on host Mail Daemon, Act as a Mail Transfer Agent (MTA) The daemon uses SMTP running over TCP to transmit the message to a daemon running on another machine, and the daemon puts incoming messages into the user’s mailbox. MTA on a sender’s machine establishes an SMTP/TCP connection to the MTA on the recipient’s mail server; in many cases the mail traverses one or more mail gateways on its route from the sender’s host to the receiver’s host. Job of the gateway is to store and forw ard email messages, much like an ― IP gateway ‖. But the difference is, mail gateway typically buffers messages on disk and is willing to t ry retransmitting them to the next machine for several days, while an IP router buffers datagrams in memory and is only willing to retry transmitting them fo r a fraction of a s econd. Fig. Sequence of mail gateways store and forward email messages  Some of the commands used by the client, HELO, MAIL, RCPT, DATA, QUIT  Server responds with code. Mail Reader  Users actually retrieve his or her messages from the mailbox, read them, reply to them, and possibly save a copy for future reference.  The user performs all these actions by interacting with a mail reader.  The reader was a program running on the same machine as the user’s mailbox, in which case it could simply read and write the file that implements the mailbox.  Protocols used to retrieve mails are, http://csetube.weebly.com/ " id="pdf-obj-2-64" src="pdf-obj-2-64.jpg">

HELO, MAIL, RCPT, DATA, QUIT

  • Server responds with code.

Mail Reader

  • Users actually retrieve his or her messages from the mailbox, read them, reply to them, and possibly save a copy for future reference.

  • The user performs all these actions by interacting with a mail reader.

  • The reader was a program running on the same machine as the user’s mailbox, in which case it could simply read and write the file that implements the mailbox.

  • Protocols used to retrieve mails are,

http://csetube.weebly.com/

  • POP (Post office Protocol)

  • IMAP (Internet Message Access Protocol)

IMAP

It is a client/server protocol running over TCP, where the client (running on the user’s desktop machine) issues commands in the form of <CRLF>-terminated ASCII text lines and the mail server (running on the machine that maintains the user’s mailbox) responds in-kind. The exchange begins with the client authenticating him or herself, and identifying the mailbox he or she wants to access. Commands used by IMAP,

<a href=http://csetube.tk/  POP (Post office Protocol)  IMAP (Internet Message Access Protocol) IMAP It is a client/server protocol running over TCP, where the client (running on the user’s desktop machine) issues commands in the form of <CRLF> -terminated ASCII text lines and the mail server (running on the machine that maintains the user’s mailbox) responds in -kind. The exchange begins with the client authenticating him or herself, and identifying the mailbox he or she wants to access. – Commands used by IMAP, – –  LOGIN  AUTHENDICATE  SELECT EXAMINE CLOSE LOGOUT Fig. State transition diagram of IMAP http://csetube.weebly.com/ " id="pdf-obj-3-44" src="pdf-obj-3-44.jpg">

Fig. State transition diagram of IMAP

http://csetube.weebly.com/

HTTP (HyperText Transfer Protocol)

  • HyperText Transport Protocol (HTTP) is an application protocol that is used to retrieve Web pages from remote servers.

  • All the web browsers use HTTP protocol to communicate with Web servers over the Internet.

  • The main goal of the Web is to organize and retrieve information over the internet.

o

HyperText (Interlinked documents) is used for this purpose.

o

Hypertext is a document can link to another document

  • HTTP protocol used to retrieve hypertext

  • HTML Document language or Markup language used to create hypertext

  • To organize information into a system of linked documents or objects, we need to be able to retrieve one document to get started.

  • We can retrieve a hypertext document by ―opening a URLURL Location of a resource on the internet.

e.g.,

START_LINE <CRLF> MESSAGE_HEADER <CRLF> <CRLF> MESSAGE_BODY <CRLF>

START_LINE indicates, whether it is a request or response.

Request Messages:

  • The first line of an HTTP request message specifies three things: the operation to be performed, the Web page the operation should be performed on, and the version of HTTP being used.

http://csetube.weebly.com/

For absolute URL, START_LINE - GEThttp://www.xyz.com/index.html HTTP/1.1 For relative URL, START_LINE - GETindex.htmlHTTP/1.1 MESSAGE_HEADER host: www.xyz.com

<a href=http://csetube.tk/ For absolute URL, START_LINE - GE T http://www.xyz.com/in dex.html HTTP/1 .1 For relative URL, START_LINE - GE T index.html H TTP/1.1 MESSAGE_HEADER – host: www.xyz.com Fig. HTTP request Operations Response M essages:  Res ponse messages begin with a single START LINE and that line spec ifies the version of HT TP being used, a three-digit code indicating whether or not the requ est was successful, and a text string giving the reason for the response. HTTP/1.1 202 Accepted HTTP/1.1 404 Not Found HTTP/1.1 301 Moved Permanently Message Header - Location: http://www.xyz1.com/ index.html - new location of the resource. Fig. Five types of Response Codes TCP Connections  The original version of HTTP (1.0) established a separate TCP connection for each data item retrieved from the server. http://csetube.weebly.com/ " id="pdf-obj-5-22" src="pdf-obj-5-22.jpg">

Response Messages:

<a href=http://csetube.tk/ For absolute URL, START_LINE - GE T http://www.xyz.com/in dex.html HTTP/1 .1 For relative URL, START_LINE - GE T index.html H TTP/1.1 MESSAGE_HEADER – host: www.xyz.com Fig. HTTP request Operations Response M essages:  Res ponse messages begin with a single START LINE and that line spec ifies the version of HT TP being used, a three-digit code indicating whether or not the requ est was successful, and a text string giving the reason for the response. HTTP/1.1 202 Accepted HTTP/1.1 404 Not Found HTTP/1.1 301 Moved Permanently Message Header - Location: http://www.xyz1.com/ index.html - new location of the resource. Fig. Five types of Response Codes TCP Connections  The original version of HTTP (1.0) established a separate TCP connection for each data item retrieved from the server. http://csetube.weebly.com/ " id="pdf-obj-5-54" src="pdf-obj-5-54.jpg">

Fig. Five types of Response Codes

TCP Connections

  • The original version of HTTP (1.0) established a separate TCP connection for each data item retrieved from the server.

http://csetube.weebly.com/

  • But it is inefficient: connection setup and teardown messages had to be exchanged between the client and server even if all the client wanted to do was verify that it had the most recent copy of a page.

  • Thus, retrieving a page that included some text and a dozen icons or other small graphics would result in 13 separate TCP connections being established and closed.

<a href=http://csetube.tk/  But it is inefficient : connection setup and teardown message s had to be exchanged between the client and server even if all the client wanted to do was v erify that it had the most recent copy of a page.  Thus, retrieving a page that included some text and a dozen icons or other small graphics would result in 13 separate TCP connections being established and closed. Fig. HTTP1.0 Behavior HTT P 1.1,Persistent Connection - the client and server can exchange multip le request/response messages over the same TCP connection. Advantages of Persistent Connection , Eliminate the connection setup overhead . » Thereby reducing the load on the server, the load on the network caused by the additional TCP packets, and the delay perceived by the user. – A client can send multiple request messages down a single TCP connection . » TCP’s congestion window mechanism is able to ope rate more efficiently. This is because it’s not necessary to go through the slow start phase for each page. http://csetube.weebly.com/ " id="pdf-obj-6-16" src="pdf-obj-6-16.jpg">

HTTP 1.1,

» Thereby reducing the load on the server, the load on the network

caused by the additional TCP packets, and the delay perceived by the user. A client can send multiple request messages down a single TCP connection. » TCP’s congestion window mechanism is able to operate more

efficiently. This is because it’s not necessary to go through the slow

start phase for each page.

http://csetube.weebly.com/

Fig. HTTP 1.1 Behavior with persistent Connection

Caching

Benefits of caching,

http://csetube.weebly.com/

DNS (Domain Name System)

  • Used to translate host names into host addresses.

  • Domain Name System (DNS) is not an application that users normally invoke explicitly, but rather a service that almost all other applications depend upon.

  • Addresses are not user friendly, so unique host name is also provided to the host in the network.

Host names differ from host addresses in two important ways,

  • Host name is usually of variable length and mnemonic, thereby making them easier for humans to remember.

  • Host names typically contain no information that helps the network to locate (route packets toward) the host.

Name Service (DNS) Name Space,

Defines the set of possible names.

<a href=http://csetube.tk/ DNS (Domain Name System)  Used to translate host names into host addresses.  Domain Name System (DNS) is not an application that users normally invoke explicitly, but rather a service that almost all other applications depend upon.  Addresses are not user friendly, so unique host name is also provided to the host in the network. Host names differ from host addresses in two important ways ,  Host name is usually of variable length and mnemonic, thereby making them easier for humans to remember.  Host names typically contain no information that helps the network to locate (route packets toward) the host. Name Service (DNS) Name Space , – Defines the set of p ossible names. – – It c an be flat (not divisible in to components) or hierarchical. Th e naming system maintains a collection of bindings of names to value s. The value can be any thing we want the naming system to return when presented with a nam e; in many cases it is a n IP address. – A resolution mechanism is a procedure that, when invoked with a name, returns the cor responding value. A name server is a specific implementation of a res olution mechanism tha t is available on a network and that can be queried by sending it a mes sage. Fig. Names translated into addresses Domain Hierarchy  DNS implements a hierarchical name space for Internet objects.  DNS names are processed from right to left and use periods (Usually dot operator) as the separator. http://csetube.weebly.com/ " id="pdf-obj-8-65" src="pdf-obj-8-65.jpg">

Fig. Names translated into addresses

Domain Hierarchy

  • DNS implements a hierarchical name space for Internet objects.

  • DNS names are processed from right to left and use periods (Usually dot operator) as the separator.http://csetube.weebly.com/

  • Like the Unix file hierarchy, the DNS hierarchy can be visualized as a tree, where,

    • Nodes domain

    • Leaves host

<a href=http://csetube.tk/  Like the Unix file hierarchy, the DNS hierarchy can be visua lized as a tree, where,  Nodes – domain  Leaves – host Name Servers Fig. Domain Hierarchy Hierarchy Implementation, – Partition the hierarch y into sub trees called zones. – – – Eac h zone can be thought of as corresponding to some administrative aut hority that is res ponsible for that portion of the hierarchy. the top level of the hierarchy forms a zone that is managed by the Interne t Corporation for Ass igned Names and Numbers (ICANN). Eac h name server implements the zone information as a collection of reso urce records. – In e ssence, a resource record is a name-to-value binding, or more specific ally a 5-tuple that con tains the following fields: <N ame, Value, Type, Class, TTL > Name name of the host Type - specifies how the Value should be interpreted. Class used to allow entities to define useful record types . One of the widely used class is internet and it is denoted as IN. • TTL – shows how long this record in valid. Possible Types ,  A – Indicates value field contains an IP Address.  NS - The Value field gives the domain name for a host that is running a name server that knows how to resolve names within the specified domain.  CNAME - The Value field gives the canonical name for a particular host; it is used to define aliases.  MX - The Value field gives the domain name for a host that is running a mail server that accepts messages for the specified domain. E.g., <kcetvnr.edu, ns.kcetvnr.edu, NS, IN> <www.kcetvnr.edu, 220.225.32.45, A, IN> http://csetube.weebly.com/ " id="pdf-obj-9-18" src="pdf-obj-9-18.jpg">

Name Servers

Fig. Domain Hierarchy

Hierarchy Implementation,

Partition the hierarchy into sub trees called zones.

used class is internet and it is denoted as IN. TTLshows how long this record in valid. Possible Types,

  • A Indicates value field contains an IP Address.

  • NS - The Value field gives the domain name for a host that is running a name server that knows how to resolve names within the specified domain.

  • CNAME - The Value field gives the canonical name for a particular host; it is used to define aliases.

  • MX - The Value field gives the domain name for a host that is running a mail server that accepts messages for the specified domain.

E.g., <kcetvnr.edu, ns.kcetvnr.edu, NS, IN> <www.kcetvnr.edu, 220.225.32.45, A, IN>

http://csetube.weebly.com/

<www.kcetvnr.edu, kcet.kcetvnr.org, CNAME, IN>

<a href=http://csetube.tk/ <www.kcetvnr.edu, kcet.kcetvnr.org, CNAME, IN> http://csetube.weebly.com/ " id="pdf-obj-10-6" src="pdf-obj-10-6.jpg">

http://csetube.weebly.com/

TELNET

Internet’s most basic network virtual terminal application allowing users to log into a remote

host Runs on top of TCP Requires authentication via user name and password Requires host system to run a telnet server (telnetd)

Passes keystrokes to remote system and carries output back to user’s screen

Offers three basic services,

  • Network virtual terminal standard interface to remote system.

  • Mechanism for negotiating communication options.

  • Treats both ends of a connection symmetrically.

Client’s TELNET process connects to server’s TELNET

  • telnet foo.cs.wisc.edu

It’s not very secure

http://csetube.weebly.com/

SECURITY (PGP, SSH) PGP (Pretty Good Privacy)

  • - Pretty Good Privacy (PGP) is a widely used approach to providing security for electronic mail.

  • - It provides,

    • Authentication

    • Confidentiality

    • Data Integrity

    • Non Repudiation

Authentication - how the person authenticates his identity to a remote machine. Confidentiality - Ensuring that information is not accessed by unauthorized persons. Data Integrity - Ensuring that information is not altered by unauthorized persons in a way that is not detectable by authorized users. Non Repudiation - Ensuring that the originators of messages cannot deny that they in fact

sent the messages.

-

<a href=http://csetube.tk/ SECURITY (PGP, SSH) PGP (Pretty Good Privacy) - Pretty Good Privacy (PGP) is a widely used approach to providing security for electronic mail. - It provides,  Authentication  Confidentiality  Data Integrity  Non – Repudiation Authentication - how the person authenticates his identity to a remote machine. Confidentiality - Ensuring that information is not accessed by unauthorized persons. Data Integrity - Ensuring that information is not altered by unauthorized persons in a way that is not detectable by authorized users. Non – Re p udiation - Ensurin g that the ori g inators of messa g es cannot deny that they in fact sent th e messages. - PGP’s co nfidentiality a nd receiver authentication depend on the receiver of an email message having a p ublic key that is known to the sender. - To provid e sender authentication and non-repudiation, the sender must have a public key that is known by the receiver. - These publ ic keys are pre-distributed using certificates and a web-of-trust PKI. - PGP suppo rts RSA and DSA for public key certificates. - http://csetube.weebly.com/ " id="pdf-obj-12-66" src="pdf-obj-12-66.jpg">

http://csetube.weebly.com/

Secure Shell (SSH)

  • - The Secure Shell (SSH) protocol is used to provide a remote login service, and is intended to replace the less-secure Telnet and rlogin programs used in the early days of the Internet.

  • - SSH is most often used to provide strong client/server authentication/ message integritywhere the SSH client runs on the user’s desktop machine and the SSH server runs on some remote machine that the user wants to log intobut it also supports confidentiality.

  • - Telnet and rlogin does not provide authentication, message integrity and confidentiality.

<a href=http://csetube.tk/ Secure Shell (SSH) - The Secure Shell (SSH) protocol is used to provide a remote lo gin service, and is intended to replace the less-secure Telnet and rlogin programs used in the early days of the Internet. - SSH is most often used to provide strong client/server authentication/ message integrity — where the SSH client runs on the user’s desktop machine and the SSH server runs on some remote machine that the user wants to log into — but it also supports confidentiality. - Telnet and rlogin does not provide authentication, message integrity and confidentiality. http://csetube.weebly.com/ " id="pdf-obj-13-20" src="pdf-obj-13-20.jpg">

http://csetube.weebly.com/