SlideShare a Scribd company logo
1 of 75
Download to read offline
1
Diploma in Computer Engineering
COMPUTER NETWORKS
(6131 Rev 2015)
Module 4
Presenter: Jeseena A
Lecturer in Computer Engineering
Government Polytechnic College, Punalur
Ref: Data Communications and Networking, 5E by Forouzan
2
3
MODULE 4 - APPLICATION LAYER
â—Ź Application layer services
● WWW – architecture, URL
● HTTP – connections, message formats
â—Ź FTP - control connections, data connections
● Electronic mail – architecture, sending, receiving mails, SMTP,transfer
phases, POP and IMAP
â—Ź TELNET
● DNS – name space, DNS in internet, resolution, resource records, DNS
messages – Dynamic DNS
Ref: Data Communications and Networking - Behrouz A. Forouzan -
McGraw Hill Edn.- Fifth Edition
4
APPLICATION LAYER
â—Ź Provides services to the user.
â—Ź Communication is provided using a logical connection between the source
and destination application layers.
5
APPLICATION LAYER - Services
â—Ź Highest layer in the protocol suite.
â—Ź Do not provide service to any layers, but receive service from transport layer.
â—Ź Hence new protocols can be easily added.
â—Ź All protocols in the lower four layers are standardized, but application layer
protocols can be standardized or non-standardized.
â—Ź Standardized:
â—‹ can be used anywhere in the internet.
â—‹ provides a standard set of services.
â—Ź Non-standardized:
â—‹ created for proprietary use in some offices for private use.
â—‹ use the standard services provided by transport layer.
6
Application-Layer Paradigms
â—Ź Two types of paradigms: client-server (traditional) and peer-to-peer.
â—Ź Client-Server
â—‹ An application program, called the server process, runs continuously,
waiting for another application program, called the client process, to
make a connection through the Internet and ask for service.
â—‹ Server processes do some specific services; but clients can ask for a
number of services to different servers.
â—‹ Many clients can ask for a service to a single server. Hence the server
will be loaded heavily and thus need a powerful computer to work.
â—‹ Eg: WWW, e-mail.
7
Application-Layer Paradigms..
â—Ź Peer-to-Peer (P2P)
â—‹ No server process running all the time and waiting for the client
processes to connect.
â—‹ One device provide service to the other, and vice versa, and both can be
at the same time. Ie, responsibility is shared between peers.
â—‹ Eg: BitTorrent, IPTV, Internet Telephony, Skype
â—Ź Mixed Paradigm
â—‹ Combining the advantages of both.
8
World Wide Web (abbreviated WWW or Web)
â—Ź A standard client-server protocol.
â—Ź Proposed by Tim Berners-Lee.
â—Ź Repository of information in which the documents, called web pages, are
distributed all over the world and related documents are linked together.
â—Ź Linking of web pages was achieved using a concept called hypertext, now
hypermedia.
â—Ź Now interactive and streaming data are available such as gaming, radios,
etc.
9
WWW - Architecture
â—Ź Distributed client-server service, in which a client using a browser can
access a service using a server.
â—Ź Service is distributed over many locations called sites.
â—Ź Each site holds one or more web pages. Each web page can contain some
links to other web pages in the same or other sites.
â—Ź Thus a web page can be simple (no links) or composite (contains at least a
link).
â—Ź Each web page is a file with a name and address.
â—Ź Accessing a web page is done by a web client from a web server.
WWW - Architecture..
10
â—Ź Web Client (Browser)
â—‹ Consists of three parts: a controller, client protocols, and
interpreters.
â—‹ Controller receives input from the keyboard or the mouse and uses the
client programs (protocols) to access the document.
â—‹ Controller uses one of the interpreters to display the document onthe
screen.
â—‹ Eg: Firefox, Chrome, Opera
WWW - Architecture..
11
â—Ź Web Server
â—‹ The web page is stored at the server.
â—‹ Each time a request arrives, the corresponding document is sent to the
client.
â—‹ Efficiency can be improved by caching, multithreading or
multiprocessing.
â—‹ Eg: Apache and Microsoft Internet Information Server (IIS).
WWW - Architecture..
12
â—Ź Uniform Resource Locator (URL)
â—‹ A unique identifier for a web page.
â—‹ Combination of the Protocol to be used by the browser, Host address
of the server, Port to be accessed and the actual Path of the file to be
accessed.
â–  Protocol: http, ftp
â–  Host: IP address (eg: 93.184.216.34) or domain name (eg:
example.com)
â–  Port: A 16-bit integer. Normally pre-defined forclient-server
application. Eg. HTTP port number is 80.
â–  Path: The location and the name of the file in theunderlying
operating system.
â—‹ protocol://host/path Eg: http://www.tekerala.org/staff_login.php
â—‹ protocol://host:port/path Eg:
http://www.example.com:8080/samples/index.html
WWW - Web Documents
13
â—Ź Classified into three: static, dynamic and active.
â—Ź Static Documents:
â—‹ Fixed-content documents that are created and stored in a server.
â—‹ Client can get a copy only.
â—‹ The document content in the server can be changed, but the user
cannot change them.
â—‹ The user can see the document copy in the browser.
â—‹ Some languages used for static document creation are: HyperText
Markup Language (HTML), Extensible Markup Language (XML),
Extensible Style Language (XSL), and Extensible Hypertext Markup
Language (XHTML).
WWW - Web Documents
14
â—Ź Dynamic Documents:
â—‹ Created by a web server whenever a browser requests the document.
â—‹ Whenever a request arrives from the client, the web server runs an
application program or a script that freshly creates the dynamic
document every time.
â—‹ Some languages for this are Java Server Pages (JSP), ActiveServer
Pages (ASP), etc.
â—Ź Active Documents:
â—‹ Documents containing scripts that works at the client side.
â—‹ Such as a program that creates animated graphics on the screen or a
program that interacts with the user.
â—‹ When a browser requests an active document, the server sends a copy
of the document or a script.
â—‹ This can be done using Java applet, javascript, etc.
15
HyperText Transfer Protocol (HTTP)
â—Ź Used to define how the client-server programs can be written to retrieve web
pages from the Web.
â—Ź An HTTP client sends a request; an HTTP server returns a response.
â—Ź The server uses the port number 80; the client uses a temporaryport
number.
â—Ź Uses the services of TCP (ie, connection oriented and reliable).
â—Ź To display a web document on the browser, there may be a need for several
objects, that may reside in different servers or in the same server.
â—Ź The objects are accessed using TCP connections (ie, connection
establishment, data transfer, connection termination).
â—Ź Some of these objects may be on the same server. Here the client can use a
new TCP connection for each object or make a TCP connection and retrieve
them all.
â—‹ These refers to non persistent and persistent connections.
HyperText Transfer Protocol (HTTP)...
Non Persistent Connection:
16
â—Ź One TCP connection is made for each request/response.
1. The client opens a TCP connection and sends a request.
2. The server sends the response.
3. The client reads the data until it encounters an end-of-file marker; itthen
closes the connection.
â—Ź If a file contains links to N different pictures in different files (all located on
the same server), the connection must be opened and closed N + 1 times.
â—Ź Very high overhead.
HyperText Transfer Protocol (HTTP)...
Non Persistent Connection:
17
HyperText Transfer Protocol (HTTP)...
18
Persistent Connection:
â—Ź Present HTTP versions have persistent connections by default.
â—Ź Here the server opens a connection, send the response and remains open
for more requests.
â—Ź The server can close the connection at the request of a client or if a time-out
has been reached.
â—Ź For static documents, the sender sends the length of the data with each
response.
â—Ź For active and dynamic documents, the server informs the client that the
length is not known and closes the connection after all the data are sent. So
the client knows that the end of the data has been reached.
â—Ź Less time and resource usage.
â—Ź Only one set of buffers and variables are needed for the whole transfer.
â—Ź Less round trip time.
HyperText Transfer Protocol (HTTP)...
19
Persistent Connection:
HyperText Transfer Protocol (HTTP)...
20
Non Persistent and Persistent Connections - Comparison:
HyperText Transfer Protocol (HTTP)...
21
Message Formats:
HyperText Transfer Protocol (HTTP)...
22
Message Formats: Request Methods
â—Ź GET
â—‹ To send a request to the server.
â—‹ Most common.
â—‹ No body.
â—Ź HEAD
â—‹ When the client need some information about the web page from the server,such
as page modified date.
â—‹ Used to to test the validity of the URL.
â—‹ No body.
â—Ź PUT
â—‹ Inverse of GET.
â—‹ Put some information in to the server (if permitted).
â—Ź POST
â—‹ To send some information to the server or to modify the page.
â—Ź TRACE
â—‹ An echo service for debugging.
â—Ź DELETE
â—‹ To delete a web page from the server (if permitted).
HyperText Transfer Protocol (HTTP)...
23
Message Formats: Request Header field
â—Ź It contains one or more headers.
â—Ź They are additional information from the client.
â—Ź Eg: the client can request that the document be sent in a special format.
â—‹ Accept: text/html
â—‹ Accept-Charset: utf-8
â—‹ Content-Length: 348
â—‹ Host: en.wikipedia.org
HyperText Transfer Protocol (HTTP)...
24
Message Formats: Response Message
â—Ź Contains version, status code, phrase, headers and the body of the response.
â—Ź Version: http version such as 1.0, 1.1, etc.
â—Ź Status codes in the 100 range are only informational, the codes in the 200 range
indicate a successful request. The codes in the 300 range redirect the client to another
URL, the codes in the 400 range indicate an error at the client site,and the codes in the
500 range indicate an error at the server site.
â—Ź Status phrase explains the status code in text form.
â—Ź Some common status codes are;
○ 200 – OK: The request succeeded.
â—‹ 301 - Moved Permanently
â—‹ 404 - Page Not Found: The requested resource does not exist on the server.
â—‹ 500 - Server Error: Due to a malfunctioning script, server configuration error or
similar.
File Transfer Protocol (FTP)
25
â—Ź Used to transfer files from one host to another.
â—Ź File transfer means retrieving a file (server to client), storing a file (client to server), or
directory listing (server to client).
â—Ź Uses TCP/IP.
â—Ź Transfers files even though both hosts have different directory structures, naming
conventions, data representation.
â—Ź The basic model for FTP is;
File Transfer Protocol (FTP)
26
â—Ź The client has three components: the user interface, the client control process,and
the client data transfer process.
â—Ź The server has two components: the server control process and the server data
transfer process.
â—Ź The control connection is made between the control processes. The data connection is
made between the data transfer processes.
â—Ź When a user starts an FTP session, the control connection opens.
â—Ź Control connection remains connected during the entire interactive FTP session. Data
connection is opened and then closed for each file transfer activity.
â—Ź TCP port 21 is used for the control connection, and port 20 is used for thedata
connection.
File Transfer Protocol (FTP)
27
â—Ź Control Connection:
â—‹ Communication through commands and responses as ASCII characters.
â—‹ Each line is terminated with a two-character (carriage return and linefeed)
end-of-line token.
â—‹ Commands are sent from client to server as uppercase letters and responses
from server to client as digits and letters.
â—‹ Some commands are:
â–  ALLO (Allocate sufficient disk space to receive a file), DELE filename (delete
a file), QUIT (log out)
â—‹ Every FTP command generates one or more responses.
â–  Response format: <a three digit code> <description>
â–  Eg: 125 Data connection open, 230 User login OK
File Transfer Protocol (FTP)
28
â—Ź Data Connection:
â—‹ To transfer data.
â—‹ Server uses its port 20.
â—‹ The client defines the type of file to be transferred, the structure of the data, and
the transmission mode through control connection before every data connection
is made.
â—‹ The steps for data connection are;
â–  The client issues a passive open request to the server from an ephemeral
port.
â–  Using the PORT command the client sends this port number to the server.
â–  The server receives the port number and issues an active open using the
well-known port 20 and the received ephemeral port number.
File Transfer Protocol (FTP)
29
Some FTP commands:
File Transfer Protocol (FTP)
30
Some FTP responses:
File Transfer Protocol (FTP)
31
â—Ź Data Connection..
1. File Type
â–  FTP transfers the following file types: ASCII file, EBCDIC (Extended Binary
Coded Decimal Interchange Code) file, or image file.
2. Data Structure
â–  FTP uses file structure, record structure, or page structure for file transfer.
â—Ź File structure is continuous stream of bytes (used by default).
â—Ź Record structure is used for text files by dividing the file into records.
â—Ź In the page structure, the file is divided into pages, with each page
having a page number and a page header. The pages can be stored
and accessed randomly or sequentially.
File Transfer Protocol (FTP)
32
â—Ź Data Connection..
3. Transmission Mode
â–  FTP uses stream mode, block mode, or compressed mode.
â—Ź The stream mode is the default mode; data are delivered from FTPto
TCP as a continuous stream of bytes.
â—Ź In the block mode, data can be delivered from FTP to TCP inblocks.
File Transfer Protocol (FTP)
33
Example:
ELECTRONIC MAIL
34
â—Ź E-mail is a one-way transaction.
â—Ź If A sends an e-mail to B, it is a one-way transaction. If B replies to A that is another
one-way transaction.
â—Ź Intermediary servers always keep running to transfer the emails; the users are just
clients.
ELECTRONIC MAIL: Architecture
35
Consider a common scenario as in the figure below. Here Alice is sending a mail toBob,
both belong to two different mail domains.
ELECTRONIC MAIL: Architecture
36
User Agent Example: Mozilla Thunderbird
ELECTRONIC MAIL: Architecture
37
User Agent Example: Outlook Express
ELECTRONIC MAIL: Architecture
38
â—Ź In the common scenario, the sender and the receiver of the e-mail, Alice andBob
respectively, are connected via a LAN or a WAN to two mail servers.
â—Ź The administrator has created one mailbox for each user where the received
messages are stored. A mailbox is part of a server hard drive, a special file with
permission restrictions. Only the owner of the mailbox has access to it.
â—Ź The administrator has also created a queue (spool) to store messages waiting to be
sent.
â—Ź To send an email, Alice and Bob use three different agents: a user agent (UA), a
message transfer agent (MTA), and a message access agent (MAA).
â—Ź UA: program to prepare the message and send it to the sender's mail server.Receiver
UA interprets the mail. It can be CLI (Eg: elm, pine) or GUI (Eg: outlook)based.
â—Ź MTA: A push program to transfer the email from one point to theother.
â—Ź MAA: A pull program to get the email from one point to theother.
â—Ź The given electronic mail system needs two UAs, two pairs of MTAs (2 client and 2
server), and a pair of MAAs (client and server).
ELECTRONIC MAIL...
39
â—Ź Sending Mail
â—‹ A user creates a mail through a UA.
â—‹ An email has an envelope and a
message.
â—‹ The envelope usually contains the
sender address, the receiver
address, and other information.
â—‹ The message contains the header
and the body.
â—‹ The header of the message defines
the sender, the receiver, the subject of
the message, and some other
information.
â—‹ The body of the message contains the
actual information to be read by the
recipient.
ELECTRONIC MAIL...
40
â—Ź Receiving Mail
â—‹ The user agent is triggered by the user (or a timer). If a user has mail, the UA
informs the user with a notice.
â—‹ The user can select any of the messages and display its contents on the screen.
â—Ź Addresses
â—‹ Consists of two parts: a local part (called user mailbox) and a domain name
(called mail servers or exchangers), separated by an @ sign.
â—‹ The local part defines the name of a special file, called the user mailbox, where
all the mail received for a user is stored for retrieval by the message access
agent
ELECTRONIC MAIL...
41
Protocols used in electronic mail
ELECTRONIC MAIL...
42
Message Transfer Agent: SMTP (Simple Mail Transfer Protocol)
â—Ź The formal protocol that defines the MTA client and server in the Internet.
● SMTP is used two times, between the sender and the sender’s mail serverand
between the two mail servers.
â—Ź A push protocol, it pushes the message from the client to the server.
â—Ź Done by commands and responses.
â—Ź Command format: Keyword: argument(s). Sent from client to server.
â—Ź Responses: A three-digit code that may be followed by additional textual information.
Sent from the server to the client.
â—‹ Eg: 220 Service ready
250 Request command completed
450 Mailbox not available
ELECTRONIC MAIL...
Mail Transfer Phases
43
Three phases:
1) Connection establishment
2) Mail transfer
3) Connection termination.
ELECTRONIC MAIL...
Mail Transfer Phases
44
1. Connection Establishment:
Client TCP connect to well-known port 25 of the server and does the following threesteps:
1) If the server is ready it sends a code 220 (service ready), otherwise 421 (service not
available).
2) The client sends the HELO message to identify itself, using its domain name address.
3) The server responds with code 250 (request command completed) or some other code
depending on the situation.
ELECTRONIC MAIL...
Mail Transfer Phases
2. Message Transfer: Eight steps
45
Client Server
ELECTRONIC MAIL...
Mail Transfer Phases
2. Message Transfer: Eight steps
46
1) The client sends the MAIL FROM message to introduce the sender of the message.
It includes the mail address of the sender (mailbox and the domain name). This
step is needed to give the server the return mail address for returning errors and
reporting messages.
2) The server responds with code 250 or some other appropriate code.
3) The client sends the RCPT TO (recipient) message, which includes the mail
address of the recipient.
4) The server responds with code 250 or some other appropriate code.
5) The client sends the DATA message to initialize the message transfer.
6) The server responds with code 354 (start mail input) or some other appropriate
message.
7) The client sends the contents of the message in consecutive lines. Each line is
terminated by a two-character end-of-line token (carriage return and line feed). The
message is terminated by a line containing just one period (.).
8) The server responds with code 250 (OK) or some other appropriate code.
47
ELECTRONIC MAIL...
Mail Transfer Phases
3. Connection Termination: Two steps:
1) The client sends the QUIT command.
2) The server responds with code 221 or some other appropriate code.
Client Server
48
ELECTRONIC MAIL: Mail Transfer Phases (3 in one figure)
ELECTRONIC MAIL...
49
â—Ź The third stage of the mail delivery needs a pull protocol; the client must pull
messages from the server.
â—Ź Two such protocols are Post Office Protocol, version 3 (POP3) and Internet Mail
Access Protocol, version 4 (IMAP4).
Message Access Agent: POP andIMAP
ELECTRONIC MAIL...
50
Post Office Protocol, version 3 (POP3)
â—Ź Simple but limited in functionality.
â—Ź The client POP3 software is installed on the recipient computer; the server POP3
software is installed on the mail server.
â—Ź Mail access starts with the client when the user needs to download its e-mail from
the mailbox on the mail server.
â—Ź The client opens a connection to the server on TCP port 110.
â—Ź It then sends its username and password to access the mailbox. The user canthen
list and retrieve the mail messages, one by one.
â—Ź POP3 has two modes: the delete mode and the keep mode.
â—Ź In the delete mode, the mail is deleted from the mailbox after each retrieval.
â—‹ Used when the user is working at her permanent computer and can save and
organize the received mail after reading or replying.
â—Ź In the keep mode, the mail remains in the mailbox after retrieval.
â—‹ Used when the user accesses her mail away from her primary computer.
ELECTRONIC MAIL...
51
Post Office Protocol, version 3 (POP3) - Disadvantages
â—Ź Does not allow the user to organize the mails on the server.
â—Ź User cannot have different folders on the server.
â—Ź Does not allow the user to partially check the contents of the mail before downloading.
ELECTRONIC MAIL...
52
Post Office Protocol, version 3 (POP3)
ELECTRONIC MAIL...
53
Internet Mail Access Protocol, version 4 (IMAP4)
â—Ź More feature rich, powerful and complex than POP3.
â—Ź Extra functions;
â—‹ A user can check the email header prior to downloading.
â—‹ A user can search the contents of the email for a specific string of characters prior
to downloading.
â—‹ A user can partially download e-mail. This is especially useful if bandwidth is
limited and the email contains multimedia with high bandwidth requirements.
â—‹ A user can create, delete, or rename mailboxes on the mail server.
â—‹ A user can create a hierarchy of mailboxes in a folder for email storage.
ELECTRONIC MAIL...
54
Multipurpose Internet Mail Extensions (MIME)
â—Ź A supplementary protocol that allows non-ASCII data to be sent through email(SMTP).
â—Ź MIME transforms non-ASCII data (including video and audio) at the sender site
to NVT 7-bit ASCII data and delivers it to the client MTA to be sent through the
Internet. The message at the receiving site is transformed back to the original data.
â—Ź (NVT: Network Virtual Terminal)
ELECTRONIC MAIL...
55
WEB BASED EMAIL
TELNET (TErminaL NETwork)
56
â—Ź A remote logging, client-server protocol.
â—Ź Remote Logging: If a user log into a remote computer and access an application
program or utility of that system, it is called remote logging.
â—‹ When a user logs into a local system, it is called local logging.
â—Ź TELNET requires a logging name and password, but vulnerable to hacking becauseit
sends all data including the password in plaintext (not encrypted). Hence a secure
protocol called Secure Shell (SSH) is more common.
â—Ź Network administrators often use TELNET for diagnostic and debugging purposes.
â—Ź Working:
TELNET (TErminaL NETwork)...
57
â—Ź The user keystrokes are accepted by a terminal driver and pass them to TELNET client.
â—Ź The TELNET client converts the text into a Universal Character set called Network
Virtual Terminal (NVT) characters and delivers them to the local TCP/IP stack. (NVT is
needed as the client and the server systems may have different working environment
and OS).
â—Ź At the server, the NVT text are accepted by the TCP/IP stack and pass them to TELNET
server, which changes the characters to the corresponding characters.
â—Ź The OS cannot accept the text/commands from a TELNET server, but can accept from
a terminal driver. Here a pseudo terminal driver accepts the text from the TELNET server
and pass them to the OS. The OS then passes the characters to the appropriate
application program.
DOMAIN NAME SYSTEM (DNS)
58
â—Ź Machines can understand only IP (numeric) address while people can
remember only names.
â—Ź Hence IP addresses are mapped to some names and the whole such
information in the network are distributed among many computersin
the world.
â—Ź Any host that needs the mapping from names to IP address can contactthe
nearby computer that holds this information.
â—Ź This method is called the DOMAIN NAME SYSTEM (DNS) and the computer
that holds such mapping information is called a DNS server.
â—Ź The DNS client sends the name to the DNS server which returns the
corresponding IP address.
The Domain Name System (or DNS) converts human readable domain
names (like: www.google.com) into Internet Protocol (IP) addresses(like:
173.194.39.78).
DOMAIN NAME SYSTEM (DNS)...
59
Consider a file transfer scenario where the user gives a host name instead ofIP
address:
DOMAIN NAME SYSTEM (DNS)...
60
â—Ź Name Space
â—‹ It is a collection of names and addresses; both are unique.
â—‹ Names can be organized in two ways: flat or hierarchical.
â—‹ Flat Name Space: A name is assigned to an address, one by one. It
can't be used for large number of names-address combinations.
â—‹ Hierarchical Name Space: Each name is made of several parts.
â–  Eg: kerala.bsnl.co.in, www.indiana.edu
DOMAIN NAME SYSTEM (DNS)...
â—Ź Domain Name Space
61
â—‹ Designed to implement hierarchical name space.
â—‹ The names are defined in an inverted-tree structure with the root at the top.The
tree can have only 128 levels: level 0 (root) to level 127.
â—‹ Each node in the tree has a label, which is a string with a maximum of 63
characters. The root label is a null string (empty string).
â—‹ Each node in the tree has its domain name.
â—‹ A full domain name is a sequence of labels, read from the node up to theroot,
separated by dots (.).
â—‹ The last label is the label of the root (null), which means the last character is a
dot.
DOMAIN NAME SYSTEM (DNS)...
â—Ź Domain Name Space
62
â—Ź If a label is terminated by a null string, it is called a fully qualified domain name
(FQDN). An FQDN can unambiguously indicate the position of a host relative to the
DNS Root.
â—‹ Eg: bDept.topUniversity.edu.
â—Ź If a label is not terminated by a null string, it is called a partially qualifieddomain
name (PQDN). A PQDN starts from a node, but it does not reach theroot.
â—‹ Eg: bDept
DOMAIN NAME SYSTEM (DNS)...
63
â—Ź A domain is a subtree of the domain name space.
â—Ź For efficiency, domains are stored in different places called domain servers.
â—Ź Since the complete domain hierarchy can't be stored on a single server, it is divided
among different servers; each one is said to have an authority of a zone.
â—Ź A root server is a server whose zone consists of the entire tree.
DOMAIN NAME SYSTEM (DNS)...
64
â—Ź DNS defines two types of servers: primary and secondary.
â—Ź A primary server is a server that stores a file about the zone for which it is an
authority and is responsible for creating, maintaining, and updating the zonefile.
It stores the zone file on a local disk.
â—Ź A secondary server is a server that transfers the complete information about a
zone from another server (primary or secondary) and stores the file on its local
disk. The secondary server neither creates nor updates the zone files.
DOMAIN NAME SYSTEM (DNS)...
65
DNS in the Internet
â—Ź The domain name space was divided into three: Generic domains, Country
domains and Inverse domains. But Inverse domain does not exist now due tothe
growth of the Internet.
DOMAIN NAME SYSTEM (DNS)...
66
1. Generic Domains
â—Ź Based on generic behaviour.
â—Ź Each node in the tree defines a domain, which is an index to the domain namespace
database.
â—Ź There are 14 generic domain labels.
DOMAIN NAME SYSTEM (DNS)...
67
2. Country Domains
â—Ź Uses two-character country abbreviations (Eg: in for India).
â—Ź Second labels can be organizational (Eg: co.in), or they can be more specificnational
designations, and so on. (Eg: ca.us)
DOMAIN NAME SYSTEM (DNS)...
Resolution
68
â—Ź Mapping a name to an address is called name-address resolution.
â—Ź A host that needs to map an address to a name or a name to an address calls a DNS
client called a resolver.
â—Ź The resolver accesses the closest DNS server with a mapping request (query).
â—Ź If the server has the information, it satisfies the resolver (as in the figure); otherwise,
it either asks other servers to provide the information or refers the resolver to other
servers.
â—Ź After the resolver receives the mapping, it interprets the response to see if it is a real
resolution or an error, and finally delivers the result to the process that requested it.
FTP example
DOMAIN NAME SYSTEM (DNS)...
Resolution
â—Ź A resolution can be either recursive or iterative.
Imagecourtesy:https://www.ques10.com/p/41452/how-iterative-resolution-differs-from-recursive--1/
69
â—Ź Recursive Resolution
DOMAIN NAME SYSTEM (DNS)...
Resolution
â—Ź A resolution can be either recursive or iterative.
Imagecourtesy:https://www.ques10.com/p/41452/how-iterative-resolution-differs-from-recursive--1/
70
â—Ź Iterative Resolution
Request for
ques10.com
DOMAIN NAME SYSTEM (DNS)...
Resource Records
71
â—Ź The zone information associated with a server is implemented as a set of resource
records.
â—Ź A name server stores the database of resource records.
â—Ź A resource record is a five-tuple structure:
(Domain Name, Type, Class, TTL, Value)
â—‹ Domain Name: identifies the record.
â—‹ Type: The Value depends on the Type parameter.
â—‹ Class: Type of network (Here IN for the Internet).
â—‹ TTL: Time for which the information is valid.
DOMAIN NAME SYSTEM (DNS)...
Resource Records
72
DOMAIN NAME SYSTEM (DNS): DNS Message Format
73
Query and Response; both have the same format.
Identification: To identify a response for a query
Flags: To know whether the message is a query, response or error.
74
Dynamic DNS (DDNS)
â—Ź Since the Internet is very large, manual updation of DNS entries is not possible.
â—Ź Dynamic DNS updates the DNS server data dynamically.
â—Ź When a new name-IP pair is bound, normally the DHCP informs a primary DNS
server.
â—Ź The primary server makes changes in its records and notifies the secondary DNS
servers actively or passively.
â—‹ Active notification: The primary DNS server sends message to the secondary
ones about the updation.
â—‹ Passive notification: The secondary DNS servers periodically checks the
primary DNS servers whether there is any update.
â—Ź In either case the secondary server requests information about the entire zone
(called the zone transfer).
75
End of Module 4
Thank You

More Related Content

Similar to CN 6131(15) Module IV.pdf

Hyper Text Transfer Protocol
Hyper Text Transfer ProtocolHyper Text Transfer Protocol
Hyper Text Transfer ProtocolSouganthikaSankaresw
 
Network protocols
Network protocolsNetwork protocols
Network protocolsAbiud Orina
 
Support formobility
Support formobilitySupport formobility
Support formobilityRahul Hada
 
The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stackLuca Mattia Ferrari
 
Application layer
Application layerApplication layer
Application layerNeha Kurale
 
Application layer
Application layerApplication layer
Application layerNeha Kurale
 
WP Chap 1 & 2.pptx
WP Chap 1 & 2.pptxWP Chap 1 & 2.pptx
WP Chap 1 & 2.pptxAnkitaChauhan79
 
Computer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdfComputer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdfShanthalaKV
 
Group20 Dynamic Networks
Group20 Dynamic NetworksGroup20 Dynamic Networks
Group20 Dynamic Networkshariprasadnr
 
Sync IT Presentation 3.16
Sync IT Presentation 3.16Sync IT Presentation 3.16
Sync IT Presentation 3.16Marcus Grimaldo
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocolsFabMinds
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfProf. Dr. K. Adisesha
 

Similar to CN 6131(15) Module IV.pdf (20)

Hyper Text Transfer Protocol
Hyper Text Transfer ProtocolHyper Text Transfer Protocol
Hyper Text Transfer Protocol
 
Network protocols
Network protocolsNetwork protocols
Network protocols
 
UNIT 1 (8).pptx
UNIT 1 (8).pptxUNIT 1 (8).pptx
UNIT 1 (8).pptx
 
Http/2
Http/2Http/2
Http/2
 
Support formobility
Support formobilitySupport formobility
Support formobility
 
The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
Application layer
Application layerApplication layer
Application layer
 
Application layer
Application layerApplication layer
Application layer
 
WP Chap 1 & 2.pptx
WP Chap 1 & 2.pptxWP Chap 1 & 2.pptx
WP Chap 1 & 2.pptx
 
Computer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdfComputer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdf
 
Group20 Dynamic Networks
Group20 Dynamic NetworksGroup20 Dynamic Networks
Group20 Dynamic Networks
 
CN UNIT V.pptx
CN UNIT V.pptxCN UNIT V.pptx
CN UNIT V.pptx
 
15 Application layer.pptx
15 Application layer.pptx15 Application layer.pptx
15 Application layer.pptx
 
MODULE-5_CCN.pptx
MODULE-5_CCN.pptxMODULE-5_CCN.pptx
MODULE-5_CCN.pptx
 
Sync IT Presentation 3.16
Sync IT Presentation 3.16Sync IT Presentation 3.16
Sync IT Presentation 3.16
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
CCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdfCCN Unit-5 Transport & Application Layer by Adi.pdf
CCN Unit-5 Transport & Application Layer by Adi.pdf
 
Application_layer.pdf
Application_layer.pdfApplication_layer.pdf
Application_layer.pdf
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

CN 6131(15) Module IV.pdf

  • 1. 1 Diploma in Computer Engineering COMPUTER NETWORKS (6131 Rev 2015) Module 4 Presenter: Jeseena A Lecturer in Computer Engineering Government Polytechnic College, Punalur Ref: Data Communications and Networking, 5E by Forouzan
  • 2. 2
  • 3. 3 MODULE 4 - APPLICATION LAYER â—Ź Application layer services â—Ź WWW – architecture, URL â—Ź HTTP – connections, message formats â—Ź FTP - control connections, data connections â—Ź Electronic mail – architecture, sending, receiving mails, SMTP,transfer phases, POP and IMAP â—Ź TELNET â—Ź DNS – name space, DNS in internet, resolution, resource records, DNS messages – Dynamic DNS Ref: Data Communications and Networking - Behrouz A. Forouzan - McGraw Hill Edn.- Fifth Edition
  • 4. 4 APPLICATION LAYER â—Ź Provides services to the user. â—Ź Communication is provided using a logical connection between the source and destination application layers.
  • 5. 5 APPLICATION LAYER - Services â—Ź Highest layer in the protocol suite. â—Ź Do not provide service to any layers, but receive service from transport layer. â—Ź Hence new protocols can be easily added. â—Ź All protocols in the lower four layers are standardized, but application layer protocols can be standardized or non-standardized. â—Ź Standardized: â—‹ can be used anywhere in the internet. â—‹ provides a standard set of services. â—Ź Non-standardized: â—‹ created for proprietary use in some offices for private use. â—‹ use the standard services provided by transport layer.
  • 6. 6 Application-Layer Paradigms â—Ź Two types of paradigms: client-server (traditional) and peer-to-peer. â—Ź Client-Server â—‹ An application program, called the server process, runs continuously, waiting for another application program, called the client process, to make a connection through the Internet and ask for service. â—‹ Server processes do some specific services; but clients can ask for a number of services to different servers. â—‹ Many clients can ask for a service to a single server. Hence the server will be loaded heavily and thus need a powerful computer to work. â—‹ Eg: WWW, e-mail.
  • 7. 7 Application-Layer Paradigms.. â—Ź Peer-to-Peer (P2P) â—‹ No server process running all the time and waiting for the client processes to connect. â—‹ One device provide service to the other, and vice versa, and both can be at the same time. Ie, responsibility is shared between peers. â—‹ Eg: BitTorrent, IPTV, Internet Telephony, Skype â—Ź Mixed Paradigm â—‹ Combining the advantages of both.
  • 8. 8 World Wide Web (abbreviated WWW or Web) â—Ź A standard client-server protocol. â—Ź Proposed by Tim Berners-Lee. â—Ź Repository of information in which the documents, called web pages, are distributed all over the world and related documents are linked together. â—Ź Linking of web pages was achieved using a concept called hypertext, now hypermedia. â—Ź Now interactive and streaming data are available such as gaming, radios, etc.
  • 9. 9 WWW - Architecture â—Ź Distributed client-server service, in which a client using a browser can access a service using a server. â—Ź Service is distributed over many locations called sites. â—Ź Each site holds one or more web pages. Each web page can contain some links to other web pages in the same or other sites. â—Ź Thus a web page can be simple (no links) or composite (contains at least a link). â—Ź Each web page is a file with a name and address. â—Ź Accessing a web page is done by a web client from a web server.
  • 10. WWW - Architecture.. 10 â—Ź Web Client (Browser) â—‹ Consists of three parts: a controller, client protocols, and interpreters. â—‹ Controller receives input from the keyboard or the mouse and uses the client programs (protocols) to access the document. â—‹ Controller uses one of the interpreters to display the document onthe screen. â—‹ Eg: Firefox, Chrome, Opera
  • 11. WWW - Architecture.. 11 â—Ź Web Server â—‹ The web page is stored at the server. â—‹ Each time a request arrives, the corresponding document is sent to the client. â—‹ Efficiency can be improved by caching, multithreading or multiprocessing. â—‹ Eg: Apache and Microsoft Internet Information Server (IIS).
  • 12. WWW - Architecture.. 12 â—Ź Uniform Resource Locator (URL) â—‹ A unique identifier for a web page. â—‹ Combination of the Protocol to be used by the browser, Host address of the server, Port to be accessed and the actual Path of the file to be accessed. â–  Protocol: http, ftp â–  Host: IP address (eg: 93.184.216.34) or domain name (eg: example.com) â–  Port: A 16-bit integer. Normally pre-defined forclient-server application. Eg. HTTP port number is 80. â–  Path: The location and the name of the file in theunderlying operating system. â—‹ protocol://host/path Eg: http://www.tekerala.org/staff_login.php â—‹ protocol://host:port/path Eg: http://www.example.com:8080/samples/index.html
  • 13. WWW - Web Documents 13 â—Ź Classified into three: static, dynamic and active. â—Ź Static Documents: â—‹ Fixed-content documents that are created and stored in a server. â—‹ Client can get a copy only. â—‹ The document content in the server can be changed, but the user cannot change them. â—‹ The user can see the document copy in the browser. â—‹ Some languages used for static document creation are: HyperText Markup Language (HTML), Extensible Markup Language (XML), Extensible Style Language (XSL), and Extensible Hypertext Markup Language (XHTML).
  • 14. WWW - Web Documents 14 â—Ź Dynamic Documents: â—‹ Created by a web server whenever a browser requests the document. â—‹ Whenever a request arrives from the client, the web server runs an application program or a script that freshly creates the dynamic document every time. â—‹ Some languages for this are Java Server Pages (JSP), ActiveServer Pages (ASP), etc. â—Ź Active Documents: â—‹ Documents containing scripts that works at the client side. â—‹ Such as a program that creates animated graphics on the screen or a program that interacts with the user. â—‹ When a browser requests an active document, the server sends a copy of the document or a script. â—‹ This can be done using Java applet, javascript, etc.
  • 15. 15 HyperText Transfer Protocol (HTTP) â—Ź Used to define how the client-server programs can be written to retrieve web pages from the Web. â—Ź An HTTP client sends a request; an HTTP server returns a response. â—Ź The server uses the port number 80; the client uses a temporaryport number. â—Ź Uses the services of TCP (ie, connection oriented and reliable). â—Ź To display a web document on the browser, there may be a need for several objects, that may reside in different servers or in the same server. â—Ź The objects are accessed using TCP connections (ie, connection establishment, data transfer, connection termination). â—Ź Some of these objects may be on the same server. Here the client can use a new TCP connection for each object or make a TCP connection and retrieve them all. â—‹ These refers to non persistent and persistent connections.
  • 16. HyperText Transfer Protocol (HTTP)... Non Persistent Connection: 16 â—Ź One TCP connection is made for each request/response. 1. The client opens a TCP connection and sends a request. 2. The server sends the response. 3. The client reads the data until it encounters an end-of-file marker; itthen closes the connection. â—Ź If a file contains links to N different pictures in different files (all located on the same server), the connection must be opened and closed N + 1 times. â—Ź Very high overhead.
  • 17. HyperText Transfer Protocol (HTTP)... Non Persistent Connection: 17
  • 18. HyperText Transfer Protocol (HTTP)... 18 Persistent Connection: â—Ź Present HTTP versions have persistent connections by default. â—Ź Here the server opens a connection, send the response and remains open for more requests. â—Ź The server can close the connection at the request of a client or if a time-out has been reached. â—Ź For static documents, the sender sends the length of the data with each response. â—Ź For active and dynamic documents, the server informs the client that the length is not known and closes the connection after all the data are sent. So the client knows that the end of the data has been reached. â—Ź Less time and resource usage. â—Ź Only one set of buffers and variables are needed for the whole transfer. â—Ź Less round trip time.
  • 19. HyperText Transfer Protocol (HTTP)... 19 Persistent Connection:
  • 20. HyperText Transfer Protocol (HTTP)... 20 Non Persistent and Persistent Connections - Comparison:
  • 21. HyperText Transfer Protocol (HTTP)... 21 Message Formats:
  • 22. HyperText Transfer Protocol (HTTP)... 22 Message Formats: Request Methods â—Ź GET â—‹ To send a request to the server. â—‹ Most common. â—‹ No body. â—Ź HEAD â—‹ When the client need some information about the web page from the server,such as page modified date. â—‹ Used to to test the validity of the URL. â—‹ No body. â—Ź PUT â—‹ Inverse of GET. â—‹ Put some information in to the server (if permitted). â—Ź POST â—‹ To send some information to the server or to modify the page. â—Ź TRACE â—‹ An echo service for debugging. â—Ź DELETE â—‹ To delete a web page from the server (if permitted).
  • 23. HyperText Transfer Protocol (HTTP)... 23 Message Formats: Request Header field â—Ź It contains one or more headers. â—Ź They are additional information from the client. â—Ź Eg: the client can request that the document be sent in a special format. â—‹ Accept: text/html â—‹ Accept-Charset: utf-8 â—‹ Content-Length: 348 â—‹ Host: en.wikipedia.org
  • 24. HyperText Transfer Protocol (HTTP)... 24 Message Formats: Response Message â—Ź Contains version, status code, phrase, headers and the body of the response. â—Ź Version: http version such as 1.0, 1.1, etc. â—Ź Status codes in the 100 range are only informational, the codes in the 200 range indicate a successful request. The codes in the 300 range redirect the client to another URL, the codes in the 400 range indicate an error at the client site,and the codes in the 500 range indicate an error at the server site. â—Ź Status phrase explains the status code in text form. â—Ź Some common status codes are; â—‹ 200 – OK: The request succeeded. â—‹ 301 - Moved Permanently â—‹ 404 - Page Not Found: The requested resource does not exist on the server. â—‹ 500 - Server Error: Due to a malfunctioning script, server configuration error or similar.
  • 25. File Transfer Protocol (FTP) 25 â—Ź Used to transfer files from one host to another. â—Ź File transfer means retrieving a file (server to client), storing a file (client to server), or directory listing (server to client). â—Ź Uses TCP/IP. â—Ź Transfers files even though both hosts have different directory structures, naming conventions, data representation. â—Ź The basic model for FTP is;
  • 26. File Transfer Protocol (FTP) 26 â—Ź The client has three components: the user interface, the client control process,and the client data transfer process. â—Ź The server has two components: the server control process and the server data transfer process. â—Ź The control connection is made between the control processes. The data connection is made between the data transfer processes. â—Ź When a user starts an FTP session, the control connection opens. â—Ź Control connection remains connected during the entire interactive FTP session. Data connection is opened and then closed for each file transfer activity. â—Ź TCP port 21 is used for the control connection, and port 20 is used for thedata connection.
  • 27. File Transfer Protocol (FTP) 27 â—Ź Control Connection: â—‹ Communication through commands and responses as ASCII characters. â—‹ Each line is terminated with a two-character (carriage return and linefeed) end-of-line token. â—‹ Commands are sent from client to server as uppercase letters and responses from server to client as digits and letters. â—‹ Some commands are: â–  ALLO (Allocate sufficient disk space to receive a file), DELE filename (delete a file), QUIT (log out) â—‹ Every FTP command generates one or more responses. â–  Response format: <a three digit code> <description> â–  Eg: 125 Data connection open, 230 User login OK
  • 28. File Transfer Protocol (FTP) 28 â—Ź Data Connection: â—‹ To transfer data. â—‹ Server uses its port 20. â—‹ The client defines the type of file to be transferred, the structure of the data, and the transmission mode through control connection before every data connection is made. â—‹ The steps for data connection are; â–  The client issues a passive open request to the server from an ephemeral port. â–  Using the PORT command the client sends this port number to the server. â–  The server receives the port number and issues an active open using the well-known port 20 and the received ephemeral port number.
  • 29. File Transfer Protocol (FTP) 29 Some FTP commands:
  • 30. File Transfer Protocol (FTP) 30 Some FTP responses:
  • 31. File Transfer Protocol (FTP) 31 â—Ź Data Connection.. 1. File Type â–  FTP transfers the following file types: ASCII file, EBCDIC (Extended Binary Coded Decimal Interchange Code) file, or image file. 2. Data Structure â–  FTP uses file structure, record structure, or page structure for file transfer. â—Ź File structure is continuous stream of bytes (used by default). â—Ź Record structure is used for text files by dividing the file into records. â—Ź In the page structure, the file is divided into pages, with each page having a page number and a page header. The pages can be stored and accessed randomly or sequentially.
  • 32. File Transfer Protocol (FTP) 32 â—Ź Data Connection.. 3. Transmission Mode â–  FTP uses stream mode, block mode, or compressed mode. â—Ź The stream mode is the default mode; data are delivered from FTPto TCP as a continuous stream of bytes. â—Ź In the block mode, data can be delivered from FTP to TCP inblocks.
  • 33. File Transfer Protocol (FTP) 33 Example:
  • 34. ELECTRONIC MAIL 34 â—Ź E-mail is a one-way transaction. â—Ź If A sends an e-mail to B, it is a one-way transaction. If B replies to A that is another one-way transaction. â—Ź Intermediary servers always keep running to transfer the emails; the users are just clients.
  • 35. ELECTRONIC MAIL: Architecture 35 Consider a common scenario as in the figure below. Here Alice is sending a mail toBob, both belong to two different mail domains.
  • 36. ELECTRONIC MAIL: Architecture 36 User Agent Example: Mozilla Thunderbird
  • 37. ELECTRONIC MAIL: Architecture 37 User Agent Example: Outlook Express
  • 38. ELECTRONIC MAIL: Architecture 38 â—Ź In the common scenario, the sender and the receiver of the e-mail, Alice andBob respectively, are connected via a LAN or a WAN to two mail servers. â—Ź The administrator has created one mailbox for each user where the received messages are stored. A mailbox is part of a server hard drive, a special file with permission restrictions. Only the owner of the mailbox has access to it. â—Ź The administrator has also created a queue (spool) to store messages waiting to be sent. â—Ź To send an email, Alice and Bob use three different agents: a user agent (UA), a message transfer agent (MTA), and a message access agent (MAA). â—Ź UA: program to prepare the message and send it to the sender's mail server.Receiver UA interprets the mail. It can be CLI (Eg: elm, pine) or GUI (Eg: outlook)based. â—Ź MTA: A push program to transfer the email from one point to theother. â—Ź MAA: A pull program to get the email from one point to theother. â—Ź The given electronic mail system needs two UAs, two pairs of MTAs (2 client and 2 server), and a pair of MAAs (client and server).
  • 39. ELECTRONIC MAIL... 39 â—Ź Sending Mail â—‹ A user creates a mail through a UA. â—‹ An email has an envelope and a message. â—‹ The envelope usually contains the sender address, the receiver address, and other information. â—‹ The message contains the header and the body. â—‹ The header of the message defines the sender, the receiver, the subject of the message, and some other information. â—‹ The body of the message contains the actual information to be read by the recipient.
  • 40. ELECTRONIC MAIL... 40 â—Ź Receiving Mail â—‹ The user agent is triggered by the user (or a timer). If a user has mail, the UA informs the user with a notice. â—‹ The user can select any of the messages and display its contents on the screen. â—Ź Addresses â—‹ Consists of two parts: a local part (called user mailbox) and a domain name (called mail servers or exchangers), separated by an @ sign. â—‹ The local part defines the name of a special file, called the user mailbox, where all the mail received for a user is stored for retrieval by the message access agent
  • 42. ELECTRONIC MAIL... 42 Message Transfer Agent: SMTP (Simple Mail Transfer Protocol) â—Ź The formal protocol that defines the MTA client and server in the Internet. â—Ź SMTP is used two times, between the sender and the sender’s mail serverand between the two mail servers. â—Ź A push protocol, it pushes the message from the client to the server. â—Ź Done by commands and responses. â—Ź Command format: Keyword: argument(s). Sent from client to server. â—Ź Responses: A three-digit code that may be followed by additional textual information. Sent from the server to the client. â—‹ Eg: 220 Service ready 250 Request command completed 450 Mailbox not available
  • 43. ELECTRONIC MAIL... Mail Transfer Phases 43 Three phases: 1) Connection establishment 2) Mail transfer 3) Connection termination.
  • 44. ELECTRONIC MAIL... Mail Transfer Phases 44 1. Connection Establishment: Client TCP connect to well-known port 25 of the server and does the following threesteps: 1) If the server is ready it sends a code 220 (service ready), otherwise 421 (service not available). 2) The client sends the HELO message to identify itself, using its domain name address. 3) The server responds with code 250 (request command completed) or some other code depending on the situation.
  • 45. ELECTRONIC MAIL... Mail Transfer Phases 2. Message Transfer: Eight steps 45 Client Server
  • 46. ELECTRONIC MAIL... Mail Transfer Phases 2. Message Transfer: Eight steps 46 1) The client sends the MAIL FROM message to introduce the sender of the message. It includes the mail address of the sender (mailbox and the domain name). This step is needed to give the server the return mail address for returning errors and reporting messages. 2) The server responds with code 250 or some other appropriate code. 3) The client sends the RCPT TO (recipient) message, which includes the mail address of the recipient. 4) The server responds with code 250 or some other appropriate code. 5) The client sends the DATA message to initialize the message transfer. 6) The server responds with code 354 (start mail input) or some other appropriate message. 7) The client sends the contents of the message in consecutive lines. Each line is terminated by a two-character end-of-line token (carriage return and line feed). The message is terminated by a line containing just one period (.). 8) The server responds with code 250 (OK) or some other appropriate code.
  • 47. 47 ELECTRONIC MAIL... Mail Transfer Phases 3. Connection Termination: Two steps: 1) The client sends the QUIT command. 2) The server responds with code 221 or some other appropriate code. Client Server
  • 48. 48 ELECTRONIC MAIL: Mail Transfer Phases (3 in one figure)
  • 49. ELECTRONIC MAIL... 49 â—Ź The third stage of the mail delivery needs a pull protocol; the client must pull messages from the server. â—Ź Two such protocols are Post Office Protocol, version 3 (POP3) and Internet Mail Access Protocol, version 4 (IMAP4). Message Access Agent: POP andIMAP
  • 50. ELECTRONIC MAIL... 50 Post Office Protocol, version 3 (POP3) â—Ź Simple but limited in functionality. â—Ź The client POP3 software is installed on the recipient computer; the server POP3 software is installed on the mail server. â—Ź Mail access starts with the client when the user needs to download its e-mail from the mailbox on the mail server. â—Ź The client opens a connection to the server on TCP port 110. â—Ź It then sends its username and password to access the mailbox. The user canthen list and retrieve the mail messages, one by one. â—Ź POP3 has two modes: the delete mode and the keep mode. â—Ź In the delete mode, the mail is deleted from the mailbox after each retrieval. â—‹ Used when the user is working at her permanent computer and can save and organize the received mail after reading or replying. â—Ź In the keep mode, the mail remains in the mailbox after retrieval. â—‹ Used when the user accesses her mail away from her primary computer.
  • 51. ELECTRONIC MAIL... 51 Post Office Protocol, version 3 (POP3) - Disadvantages â—Ź Does not allow the user to organize the mails on the server. â—Ź User cannot have different folders on the server. â—Ź Does not allow the user to partially check the contents of the mail before downloading.
  • 52. ELECTRONIC MAIL... 52 Post Office Protocol, version 3 (POP3)
  • 53. ELECTRONIC MAIL... 53 Internet Mail Access Protocol, version 4 (IMAP4) â—Ź More feature rich, powerful and complex than POP3. â—Ź Extra functions; â—‹ A user can check the email header prior to downloading. â—‹ A user can search the contents of the email for a specific string of characters prior to downloading. â—‹ A user can partially download e-mail. This is especially useful if bandwidth is limited and the email contains multimedia with high bandwidth requirements. â—‹ A user can create, delete, or rename mailboxes on the mail server. â—‹ A user can create a hierarchy of mailboxes in a folder for email storage.
  • 54. ELECTRONIC MAIL... 54 Multipurpose Internet Mail Extensions (MIME) â—Ź A supplementary protocol that allows non-ASCII data to be sent through email(SMTP). â—Ź MIME transforms non-ASCII data (including video and audio) at the sender site to NVT 7-bit ASCII data and delivers it to the client MTA to be sent through the Internet. The message at the receiving site is transformed back to the original data. â—Ź (NVT: Network Virtual Terminal)
  • 56. TELNET (TErminaL NETwork) 56 â—Ź A remote logging, client-server protocol. â—Ź Remote Logging: If a user log into a remote computer and access an application program or utility of that system, it is called remote logging. â—‹ When a user logs into a local system, it is called local logging. â—Ź TELNET requires a logging name and password, but vulnerable to hacking becauseit sends all data including the password in plaintext (not encrypted). Hence a secure protocol called Secure Shell (SSH) is more common. â—Ź Network administrators often use TELNET for diagnostic and debugging purposes. â—Ź Working:
  • 57. TELNET (TErminaL NETwork)... 57 â—Ź The user keystrokes are accepted by a terminal driver and pass them to TELNET client. â—Ź The TELNET client converts the text into a Universal Character set called Network Virtual Terminal (NVT) characters and delivers them to the local TCP/IP stack. (NVT is needed as the client and the server systems may have different working environment and OS). â—Ź At the server, the NVT text are accepted by the TCP/IP stack and pass them to TELNET server, which changes the characters to the corresponding characters. â—Ź The OS cannot accept the text/commands from a TELNET server, but can accept from a terminal driver. Here a pseudo terminal driver accepts the text from the TELNET server and pass them to the OS. The OS then passes the characters to the appropriate application program.
  • 58. DOMAIN NAME SYSTEM (DNS) 58 â—Ź Machines can understand only IP (numeric) address while people can remember only names. â—Ź Hence IP addresses are mapped to some names and the whole such information in the network are distributed among many computersin the world. â—Ź Any host that needs the mapping from names to IP address can contactthe nearby computer that holds this information. â—Ź This method is called the DOMAIN NAME SYSTEM (DNS) and the computer that holds such mapping information is called a DNS server. â—Ź The DNS client sends the name to the DNS server which returns the corresponding IP address. The Domain Name System (or DNS) converts human readable domain names (like: www.google.com) into Internet Protocol (IP) addresses(like: 173.194.39.78).
  • 59. DOMAIN NAME SYSTEM (DNS)... 59 Consider a file transfer scenario where the user gives a host name instead ofIP address:
  • 60. DOMAIN NAME SYSTEM (DNS)... 60 â—Ź Name Space â—‹ It is a collection of names and addresses; both are unique. â—‹ Names can be organized in two ways: flat or hierarchical. â—‹ Flat Name Space: A name is assigned to an address, one by one. It can't be used for large number of names-address combinations. â—‹ Hierarchical Name Space: Each name is made of several parts. â–  Eg: kerala.bsnl.co.in, www.indiana.edu
  • 61. DOMAIN NAME SYSTEM (DNS)... â—Ź Domain Name Space 61 â—‹ Designed to implement hierarchical name space. â—‹ The names are defined in an inverted-tree structure with the root at the top.The tree can have only 128 levels: level 0 (root) to level 127. â—‹ Each node in the tree has a label, which is a string with a maximum of 63 characters. The root label is a null string (empty string). â—‹ Each node in the tree has its domain name. â—‹ A full domain name is a sequence of labels, read from the node up to theroot, separated by dots (.). â—‹ The last label is the label of the root (null), which means the last character is a dot.
  • 62. DOMAIN NAME SYSTEM (DNS)... â—Ź Domain Name Space 62 â—Ź If a label is terminated by a null string, it is called a fully qualified domain name (FQDN). An FQDN can unambiguously indicate the position of a host relative to the DNS Root. â—‹ Eg: bDept.topUniversity.edu. â—Ź If a label is not terminated by a null string, it is called a partially qualifieddomain name (PQDN). A PQDN starts from a node, but it does not reach theroot. â—‹ Eg: bDept
  • 63. DOMAIN NAME SYSTEM (DNS)... 63 â—Ź A domain is a subtree of the domain name space. â—Ź For efficiency, domains are stored in different places called domain servers. â—Ź Since the complete domain hierarchy can't be stored on a single server, it is divided among different servers; each one is said to have an authority of a zone. â—Ź A root server is a server whose zone consists of the entire tree.
  • 64. DOMAIN NAME SYSTEM (DNS)... 64 â—Ź DNS defines two types of servers: primary and secondary. â—Ź A primary server is a server that stores a file about the zone for which it is an authority and is responsible for creating, maintaining, and updating the zonefile. It stores the zone file on a local disk. â—Ź A secondary server is a server that transfers the complete information about a zone from another server (primary or secondary) and stores the file on its local disk. The secondary server neither creates nor updates the zone files.
  • 65. DOMAIN NAME SYSTEM (DNS)... 65 DNS in the Internet â—Ź The domain name space was divided into three: Generic domains, Country domains and Inverse domains. But Inverse domain does not exist now due tothe growth of the Internet.
  • 66. DOMAIN NAME SYSTEM (DNS)... 66 1. Generic Domains â—Ź Based on generic behaviour. â—Ź Each node in the tree defines a domain, which is an index to the domain namespace database. â—Ź There are 14 generic domain labels.
  • 67. DOMAIN NAME SYSTEM (DNS)... 67 2. Country Domains â—Ź Uses two-character country abbreviations (Eg: in for India). â—Ź Second labels can be organizational (Eg: co.in), or they can be more specificnational designations, and so on. (Eg: ca.us)
  • 68. DOMAIN NAME SYSTEM (DNS)... Resolution 68 â—Ź Mapping a name to an address is called name-address resolution. â—Ź A host that needs to map an address to a name or a name to an address calls a DNS client called a resolver. â—Ź The resolver accesses the closest DNS server with a mapping request (query). â—Ź If the server has the information, it satisfies the resolver (as in the figure); otherwise, it either asks other servers to provide the information or refers the resolver to other servers. â—Ź After the resolver receives the mapping, it interprets the response to see if it is a real resolution or an error, and finally delivers the result to the process that requested it. FTP example
  • 69. DOMAIN NAME SYSTEM (DNS)... Resolution â—Ź A resolution can be either recursive or iterative. Imagecourtesy:https://www.ques10.com/p/41452/how-iterative-resolution-differs-from-recursive--1/ 69 â—Ź Recursive Resolution
  • 70. DOMAIN NAME SYSTEM (DNS)... Resolution â—Ź A resolution can be either recursive or iterative. Imagecourtesy:https://www.ques10.com/p/41452/how-iterative-resolution-differs-from-recursive--1/ 70 â—Ź Iterative Resolution Request for ques10.com
  • 71. DOMAIN NAME SYSTEM (DNS)... Resource Records 71 â—Ź The zone information associated with a server is implemented as a set of resource records. â—Ź A name server stores the database of resource records. â—Ź A resource record is a five-tuple structure: (Domain Name, Type, Class, TTL, Value) â—‹ Domain Name: identifies the record. â—‹ Type: The Value depends on the Type parameter. â—‹ Class: Type of network (Here IN for the Internet). â—‹ TTL: Time for which the information is valid.
  • 72. DOMAIN NAME SYSTEM (DNS)... Resource Records 72
  • 73. DOMAIN NAME SYSTEM (DNS): DNS Message Format 73 Query and Response; both have the same format. Identification: To identify a response for a query Flags: To know whether the message is a query, response or error.
  • 74. 74 Dynamic DNS (DDNS) â—Ź Since the Internet is very large, manual updation of DNS entries is not possible. â—Ź Dynamic DNS updates the DNS server data dynamically. â—Ź When a new name-IP pair is bound, normally the DHCP informs a primary DNS server. â—Ź The primary server makes changes in its records and notifies the secondary DNS servers actively or passively. â—‹ Active notification: The primary DNS server sends message to the secondary ones about the updation. â—‹ Passive notification: The secondary DNS servers periodically checks the primary DNS servers whether there is any update. â—Ź In either case the secondary server requests information about the entire zone (called the zone transfer).
  • 75. 75 End of Module 4 Thank You