SlideShare una empresa de Scribd logo
1 de 173
COMPUTER NETWORKS
USHA BARAD
Assistant Professor
SYLLABUS
1 Introduction to computer networks and Internet:
• Understanding of network and Internet, The network edge, The
network core, Understanding of Delay, Loss and Throughput in
the packet-switching network, protocols layers and their service
model, History of the computer network
2 Application Layer:
• Principles of computer applications, Web and HTTP, E-mail, DNS,
Socket programming with TCP and UDP
3 Transport Layer:
• Introduction and transport layer services, Multiplexing and
Demultiplexing, Connection less transport (UDP), Principles of
reliable data transfer, Connection oriented transport (TCP),
Congestion control.
4 Network Layer:
• Introduction, Virtual and Datagram networks, study of
router, IP protocol and addressing in the Internet, Routing
algorithms, Broadcast and Multicast routing
5 The Link layer and Local area networks:
• Introduction and link layer services, error-detection and
correction techniques, Multiple access protocols, addressing,
Ethernet, switches.
BOOKS
• Reference Books:
1.Computer Networking- A Top-Down approach, 5th edition, Kurose
and Ross, Pearson
2.Computer Networks- A Top-Down approach, Behrouz Forouzan,
McGraw Hill
3.Computer Networks (4th edition), Andrew Tanenbaum, Prentice
Hall
4.Computer Networking and the Internet (5th edition),Fred Halsall,
Addison Wesley
5.Data Communications and Networking (4th edition), Behrouz
Forouzan, McGraw Hill
6.TCP/IP Protocol Suite (3rd edition), Behrouz Forouzan, McGraw
Hill
Chapter:2
APPLICATION LAYER
Introduction
• The old model of a single computer serving all of the
organization’s computational needs has been
replaced by one in which a large number of separate
but interconnected computers do the job.
• These systems are called computer networks.
• “A computer network is a set of computers
connected together for the purpose of sharing
resources.”
• The most common resource shared today is
connection to the Internet.
• Other shared resources can include a printer or a file
server.
Uses of Compute Networks
• Uses of Networks for Companies:
– Resource Sharing
• It allows all programs, equipments and data available to
anyone on the network irrespective of the physical
location of the resource and the user.
– High Reliability
• It provides high reliability by having alternative sources of
data.
• For e.g. all files could be replicated on more than one
machines, so if one of them is unavailable due to
hardware failure or any other reason, the other copies
can be used.
Continue…
– Saving Money
• Organizations can use separate personal computer one
per user instead of using mainframe computer which are
expensive.
• The organizations can use the workgroup model (peer to
peer) in which all the PCs are networked together and
each one can have the access to the other for
communicating or sharing purpose.
– Scalability
• Another goal is scalability. Scalability is the ability to
increase the system performance gradually as the
workload grows, by just adding more processors.
Continue…
• Uses of Networks to People:
– Access to Remote Information
(i) Home shopping, paying telephone, electricity bills, e-
banking, on line share market etc.
(ii) Newspaper is On-line and is personalized, digital library
consisting of books, magazines, scientific journals etc.
(iii) World wide web which contains information. about the
arts, business, cooking, government, health, history,
hobbies, recreation, science, sports etc.
Continue…
–Person to Person Communication
(i) Electronic-mail (e-mail)
(ii) Real time e-mail i.e. video conferencing allows remote
users to communicate with no delay by seeing and hearing
each other. Video-conferencing is being used for remote
school, getting medical opinion from distant specialists
etc.
(iii) Worldwide newsgroups in which one person posts a
message and all other subscribers to the newsgroup can
read it or give their feedbacks.
–Interactive Entertainment
(i) Multiperson real-time simulation games.
(ii) Video on demand.
(iii)Participation in live TV programmes likes quiz, contest,
discussions etc.
Continue…
• We use the concept ofWe use the concept of layerslayers in our daily life.in our daily life.
As an example, let us consider two friends whoAs an example, let us consider two friends who
communicate through postal mail.communicate through postal mail.
• The process of sending a letter to a friendThe process of sending a letter to a friend
would be complex if there were no serviceswould be complex if there were no services
available from the post office.available from the post office.
• Tasks involved in sending a letter shown below:
5-Layer Model(the TCP Model)
• The 5-layer model serves primarily the protocols
known as Transmission Control Protocol (TCP)
and Internet Protocol (IP), or jointly, TCP/IP.
• The User Datagram Protocol (UDP) is also served
by this model.
• The 5-layer model was developed along with
these protocols, antedating the 7-layer model,
and is sometimes called the TCP Model.
THE OSI MODELTHE OSI MODEL
• Established in 1947, the International StandardsEstablished in 1947, the International Standards
Organization (Organization (ISOISO) is a multinational body) is a multinational body
dedicated to worldwide agreement ondedicated to worldwide agreement on
international standards.international standards.
• An ISO standard that covers all aspects of networkAn ISO standard that covers all aspects of network
communications is the Open Systemscommunications is the Open Systems
Interconnection (Interconnection (OSIOSI) model.) model.
• It was first introduced in the late 1970s.It was first introduced in the late 1970s.
ISO is the organization.
OSI is the model.
Note
Seven layers of the OSI model
The interaction between layers in the OSI
model
Summary of layers
Principles of computer applications
app architectures
app requirements
Application architectures
• Client-server
• Peer-to-peer (P2P)
• Hybrid of client-server and P2P
Client-server architecture
Pure P2P architecture
Hybrid of client -server and P2P
The Transport Services
• Networked applications are built on top of the
transport service.
• There are two main types of transport services :
– The connectionless or datagram service
– The connection-oriented or byte-stream service
Continue…
• The connectionless service allows applications to easily
exchange messages or Service Data Units. On the
Internet.
• This service is provided by the UDP protocol.
• The connectionless transport service on the Internet is
unreliable, but is able to detect transmission errors.
Continue…
• Each of these applications must be able to exchange SDUs with
remote applications.
• To enable these exchanges of SDUs, each networked application
running on a host is identified by the following information :
– the host on which the application is running
– the port number on which the application listens for SDUs
• On the Internet, the port number is an integer and the host is
identified by its network address.
• In the network layer there are two types of Internet Addresses:
– IP version 4 addresses that are 32 bits wide
– IP version 6 addresses that are 128 bits wide
Continue…
• IPv4 addresses are usually represented by using a dotted
decimal representation where each decimal number
corresponds to one byte of the address, e.g. 203.0.113.56.
• IPv6 addresses are usually represented as a set of
hexadecimal numbers separated by semicolons, e.g.
2001:db8:3080:2:217:f2ff:fed6:65c0.
• Today, most Internet hosts have one IPv4 address.
• In the future, we can expect that more and more hosts will
have IPv6 addresses and that some of them will not have an
IPv4 address anymore.
• A host that only has an IPv4 address cannot communicate
with a host having only an IPv6 address.
Continue…
• The second transport service is the connection-oriented
service.
• On the Internet, this service is often called the byte-
stream service as it creates a reliable byte stream
between the two applications that are linked by a
transport connection.
What transport service does an app
need?
Web and HTTP
WEB
• The web, as the World Wide Web is popularly known, is
an architectural framework for accessing linked content
spread out over millions of machines all over the
internet.
• The user’s point of view, the Web consists of a vast,
worldwide collection of content in the form of Web
pages, often just called pages for short.
• The idea of having one page point to another, now
called hypertext, was invented by a M.I.T professor of
electrical engineering in 1945.
• HTTP:
• These messages include requests from client to server and
responses from server to client which will have the following
format:
– HTTP-message = <Request> | <Response> ; HTTP/1.1
messages
• HTTP requests and HTTP responses use a generic message
format of RFC 822 for transferring the required data. This
generic message format consists of the following four items.
– A Start-line
– Zero or more header fields followed by CRLF
– An empty line (i.e., a line with nothing preceding the CRLF)
indicating the end of the header fields
– Optionally a message-body
• Carriage Return, Line Feed:
• CR LF means "Carriage Return, Line Feed" –
it's a DOS hangover from the olden days from
when some devices required a Carriage
Return, and some devices required a Line
Feed to get a new line, so Microsoft decided
to just make a new-line have both characters,
so that they would output correctly on all
devices.
• Message Start-Line: Syntax
– start-line = Request-Line | Status-Line
• For now, let's see the examples of start line in case of
request and response:
– GET /hello.htm HTTP/1.1 (This is Request-Line sent by the
client)
– HTTP/1.1 200 OK (This is Status-Line sent by the server)
• Header Fields:
• There are four types of HTTP message headers:
– General-header: These header fields have general
applicability for both request and response
messages.
– Request-header: These header fields have
applicability only for request messages.
– Response-header: These header fields have
applicability only for response messages.
– Entity-header: These header fields define meta
information about the entity-body or, if no body is
present, about the resource identified by the
request.
• Syntax:
– message-header = field-name ":" [ field-value ]
• Following are the examples of various header fields:
– User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l
zlib/1.2.3
– Host: www.example.com
– Accept-Language: en, mi
– Date: Mon, 27 Jul 2009 12:28:53 GMT
– Server: Apache
– Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
– ETag: "34aa387-d-1568eb00"
– Accept-Ranges: bytes
– Content-Length: 51
– Vary: Accept-Encoding
– Content-Type: text/plain
• Message Body:
• The message body part is optional for an HTTP
message but if it is available, then it is used to carry
the entity-body associated with the request or
response.
• Example:
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
HTTP request message
• An HTTP client sends an HTTP request to a server in the
form of a request message which includes following
format:
– A Request-line
– Zero or more header (General|Request|Entity)
fields followed by CRLF
– An empty line (i.e., a line with nothing preceding the
CRLF) indicating the end of the header fields
– Optionally a message-body
• Request-Line:
• The Request-Line begins with a method token,
followed by the Request-URI and the protocol
version, and ending with CRLF.
• The elements are separated by space SP
characters.
– Request-Line = Method SP Request-URI SP HTTP-
Version CRLF
• Request Method:
• The request method indicates the method to
be performed on the resource identified by the
given Request-URI.
• The method is case-sensitive and should always
be mentioned in uppercase.
• The following table lists all the supported
methods in HTTP/1.1.
S.N. Method and Description
1 GET : The GET method is used to retrieve information from the given server
using a given URI. Requests using GET should only retrieve data and should have
no other effect on the data.
2 HEAD : Same as GET, but it transfers the status line and the header section only.
3 POST : A POST request is used to send data to the server, for example, customer
information, file upload, etc. using HTML forms.
4 PUT : Replaces all the current representations of the target resource with the
uploaded content.
5 DELETE : Removes all the current representations of the target resource given by
URI.
6 CONNECT : Establishes a tunnel to the server identified by a given URI.
7 OPTIONS : Describe the communication options for the target resource.
8 TRACE : Performs a message loop back test along with the path to the target
resource.
• Request-URI:
• The Request-URI is a Uniform Resource
Identifier and identifies the resource upon
which to apply the request.
• Following are the most commonly used forms
to specify an URI:
– Request-URI = "*" | absoluteURI | abs_path |
authority
S.N Method and Description
1 The asterisk * is used when an HTTP request does not apply to a particular
resource, but to the server itself, and is only allowed when the method used does
not necessarily apply to a resource. For example: OPTIONS * HTTP/1.1
2 The absoluteURI is used when an HTTP request is being made to a proxy. The
proxy is requested to forward the request or service from a valid cache, and return
the response. For example: GET http://www.w3.org/pub/WWW/TheProject.html
HTTP/1.1
3 The most common form of Request-URI is that used to identify a resource on an
origin server or gateway. For example, a client wishing to retrieve a resource
directly from the origin server would create a TCP connection to port 80 of the
host "www.w3.org" and send the following lines: GET
/pub/WWW/TheProject.html HTTP/1.1
Host: www.w3.org
Note that the absolute path cannot be empty; if none is present in the original URI,
it MUST be given as "/" (the server root).
• Request Header Fields:
• The request-header fields allow the client to pass
additional information about the request, and about
the client itself, to the server.
• These fields act as request modifiers.
• Here is a list of some important Request-header fields
that can be used based on the requirement:
– Accept-Charset
– Accept-Encoding
– Accept-Language
– Authorization
– Expect
– From
– Host
– If-Match
– If-Modified-Since
– If-None-Match
– If-Range
– If-Unmodified-Since
– Max-Forwards
– Proxy-Authorization
– Range
– Referer
– TE
– User-Agent
Examples of Request Message
• Now let's put it all together to form an HTTP request to
fetch hello.htm page from the web server running on
tutorialspoint.com
GET /hello.htm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
• Here we are not sending any request data to the server because
we are fetching a plain HTML page from the server.
• Connection is a general-header, and the rest of the headers are
request headers.
• The following example shows how to send form data to the server
using request message body:
POST /cgi-bin/process.cgi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
licenseID=string&content=string&/paramsXML=string
• Here the given URL /cgi-bin/process.cgi will be used to process the passed
data and accordingly, a response will be returned.
• Here content-type tells the server that the passed data is a simple web
form data and length will be the actual length of the data put in the
message body.
• The following example shows how you can pass plain XML to your
web server:
POST /cgi-bin/process.cgi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
• <?xml version="1.0" encoding="utf-8"?>
• <string xmlns="http://clearforest.com/">string</string>
HTTP request message: general format
Uploading form input
Method types
HTTP response message
• After receiving and interpreting a request
message, a server responds with an HTTP
response message:
– A Status-line
– Zero or more header (General|Response|Entity)
fields followed by CRLF
– An empty line (i.e., a line with nothing preceding
the CRLF) indicating the end of the header fields
– Optionally a message-body
• Message Status-Line:
• A Status-Line consists of the protocol version
followed by a numeric status code and its
associated textual phrase.
• The elements are separated by space SP
characters.
– Status-Line = HTTP-Version SP Status-Code SP
Reason-Phrase CRLF
• HTTP Version:
• A server supporting HTTP version 1.1 will return
the following version information:
– HTTP-Version = HTTP/1.1
• Status Code:
• The Status-Code element is a 3-digit integer
where first digit of the Status-Code defines the
class of response and the last two digits do not
have any categorization role.
• There are 5 values for the first digit:
S.N. Code and Description
1 1xx: Informational
It means the request was received and the process is continuing.
2 2xx: Success
It means the action was successfully received, understood, and
accepted.
3 3xx: Redirection
It means further action must be taken in order to complete the
request.
4 4xx: Client Error
It means the request contains incorrect syntax or cannot be
fulfilled.
5 5xx: Server Error
It means the server failed to fulfill an apparently valid request.
• Response Header Fields:
• The response-header fields allow the server to pass
additional information about the response which cannot be
placed in the Status- Line.
• These header fields give information about the server and
about further access to the resource identified by the
Request-URI.
– Accept-Ranges
– Age
– ETag
– Location
– Proxy-Authenticate
– Retry-After
– Server
– Vary
– WWW-Authenticate
Examples of Response Message
• Now let's put it all together to form an HTTP
response for a request to fetch the hello.htm page
from the web server running on tutorialspoint.com
HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
Output:
<html>
<body>
<h1>Hello , World!</h1>
</body>
</html>
Output:
<html>
<body>
<h1>Hello , World!</h1>
</body>
</html>
• The following example shows an HTTP response
message displaying error condition when the web
server could not find the requested page:
HTTP/1.1 404 Not Found
Date: Sun, 18 Oct 2012 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 230
Connection: Closed
Content-Type: text/html; charset=iso-8859-1
Output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL /t.html was not found on this
server.</p>
</body>
</html>
Output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL /t.html was not found on this
server.</p>
</body>
</html>
• Following is an example of HTTP response
message showing error condition when the web
server encountered a wrong HTTP version in the
given HTTP request:
HTTP/1.1 400 Bad Request
Date: Sun, 18 Oct 2012 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 230
Content-Type: text/html; charset=iso-8859-1
Connection: Closed
Output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not
understand.</p>
<p>The request line contained invalid characters following
the protocol string.</p>
</body>
</html>
Output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not
understand.</p>
<p>The request line contained invalid characters following
the protocol string.</p>
</body>
</html>
HTTP response status codes
Cookies
• Cookies are small files which are stored on a
user's computer.
• They are designed to hold a modest amount of
data specific to a particular client and website,
and can be accessed either by the web server or
the client computer.
• An HTTP cookie (also called web cookie, Internet
cookie, browser cookie or simply cookie), is a
small piece of data sent from a website and
stored in the user's web browser while the user is
browsing it.
• Every time the user loads the website, the
browser sends the cookie back to the server to
notify the user's previous activity.
• Cookies can also store passwords and form
content a user has previously entered, such as a
• Why are Cookies Used?
• Cookies are a convenient way to carry
information from one session on a website to
another, or between sessions on related
websites, without having to burden a server
machine with massive amounts of data storage.
• Storing the data on the server without using
cookies would also be problematic because it
would be difficult to retrieve a particular user's
information without requiring a login on each
visit to the website.
• How Long Does a Cookie Last?
• The time of expiry of a cookie can be set when the
cookie is created. By default the cookie is destroyed
when the current browser window is closed.
• Who Can Access Cookies?
• When a cookie is created it is possible to control its
visibility by setting its 'root domain'. It will then be
accessible to any URL belonging to that root.
• For example the root could be set to
"whatarecookies.com" and the cookie would then be
available to sites in "www.whatarecookies.com" or
"xyz.whatarecookies.com" or "whatarecookies.com".
Cookies: keeping “state”
Web caches (proxy server)
Electronic Mail
• E-mail (electronic mail) is the exchange of computer-
stored messages by telecommunication. (Some
publications spell it email; we prefer the currently
more established spelling of e-mail.)
• E-mail messages are usually encoded in ASCII text.
First scenario
When the sender and the receiver of an
email are on the same system, we need
only two user agents.
Note:Note:
TCP/IP Protocol Suite 87
Second scenario
TCP/IP Protocol Suite 88
When the sender and the receiver of an
email are on different systems, we need
two UAs and a pair of MTAs (client and
server).
Note:Note:
TCP/IP Protocol Suite 89
Third scenario
TCP/IP Protocol Suite 90
When the sender is connected to the
mail server via a LAN or a WAN, we
need two UAs and two pairs of MTAs
(client and server).
Note:Note:
TCP/IP Protocol Suite 91
Fourth scenario
TCP/IP Protocol Suite 92
Push vs. pull
TCP/IP Protocol Suite 93
When both sender and receiver are
connected to the mail server via a LAN
or a WAN, we need two UAs, two pairs
of MTAs (client and server), and a pair
of MAAs (client and server). This is the
most common situation today.
Note:Note:
Botnets: bot + network-WINTER 2015
• A botnet is a group of computers connected in a
coordinated fashion for malicious purposes.
• Each computer in a botnet is called a bot.
• These bots form a network of compromised
computers, which is controlled by a third party
and used to transmit malware or spam, or to
launch attacks.
• A network of private computers infected with
malicious software and controlled as a group
without the owners' knowledge, e.g. to send
spam.
Botnet Architecture
Botmaster
Bot
Bot
Recruiting
Recruiting
Recruiting
Bot
bot bot
C&C
botmaster
bot
C&C
Bot periodically connects to one/some of C&C servers to obtain
command
C&C (Command and Control): usually Internet Relay Chat (IRC) based
USER AGENT
The user agent (UA) provides service to the user to make theThe user agent (UA) provides service to the user to make the
process of sending and receiving a message easier.process of sending and receiving a message easier.
Services Provided by a User AgentServices Provided by a User Agent
User Agent TypesUser Agent Types
Sending MailSending Mail
Receiving MailReceiving Mail
AddressesAddresses
Mailing ListMailing List
MIMEMIME
User agent
Some examples of command-driven
user agents are mail, pine, and elm
Note:Note:
Some examples of GUI-based user
agents are Eudora, Outlook, and
Netscape.
Note:Note:
Format of an email
Email address
Message Formats
Header Description
To: E-mail address(es) of the primary recipient(s).
CC: E-mail address(es) of the secondary recipient(s).
BCC: E-mail address(es) which should receive blind carbon copies. This line is
deleted from all the copies sent to the primary and secondary recipients.
From: The mailbox from which the message is sent.
Sender: E-mail address of the sender.
Received: Line added by each MTA during the e-mail transfer.
Return-
Path:
This field is added by the final MTA and is intended to inform you how to get
back to the sender. In theory, this information can be gathered from all
the Received headers (except for the name of the sender’s mailbox).
Typically it just contains the sender’s address.
Multipurpose Internet Mail
Extensions(MIME)
• MIME (Multi-Purpose Internet Mail
Extensions) is an extension of the original
Internet e-mail protocol that lets people use
the protocol to exchange different kinds of
data files on the Internet: audio, video,
images, application programs, and other
kinds, as well as the ASCII text handled in the
original protocol, the Simple Mail Transport
Protocol (SMTP)
Multipurpose Internet Mail
Extensions(MIME)
• In the early days, e-mail consisted exclusively of text messages
written in English and expressed in ASCII.
• For this environment, RFC 822 was sufficient; it defined the
headers but left the content entirely up to the users.
• Nowadays, on the Internet, this approach is no longer adequate.
The problems include sending and receiving:
– Messages written in languages containing accents and other
special characters (e.g. French, Spanish and German).
– Messages written in languages based on non-Latin alphabets
(e.g. Hebrew, Russian, Japanese).
– Messages containing audio, images or other non-ASCII
information.
Header Description
MIME-Version Indicates the MIME version being used.
Content-Description Human-readable string which describes the
content of the message.
Content-ID Unique identifier
Content-Transfer-
Encoding
Indicates how the e-mail body is wrapped for
transmission.
Content-Type Type and format of the content. It specifies the
nature of the message body. Content types are
defined per RFC 2045, RFC 2854, RFC 3003 and
RFC 3023 (This list is subject to changes) Each
content type has one or more subtypes. The
type and subtype are separated by a slash,
e.g. Content-Type: video/mpeg
• Separator line gives information about specific
encoding
• MIME is extensible - sender and receiver agree on
encoding scheme
• MIME is compatible with existing mail systems
• Everything encoded as ASCII
• Headers and separators ignored by non-MIME
mail systems
• MIME encapsulates binary data in ASCII mail
envelope
TCP/IP Protocol Suite 112
MIME
TCP/IP Protocol Suite 113
MIME header
The MIME types and sub-types defined in RFC 1521
EMAIL PROTOCOLS
• There are three E-mail protocols:
–SMTP (Simple Mail Transfer Protocol)
–POP3 (Post Office Protocol)
–IMAP (Internet Mail Access Protocol)
MESSAGE TRANSFER AGENT: SMTP[RFC 2821]
• Simple Mail Transfer Protocol (SMTP) is the standard
application protocol for application protocol delivery of
mail from source to destination
• Provides reliable delivery of messages
• Uses TCP well-known port 25 for message exchange
between client and server.
• Command/Response interaction:
– commands: ASCII text
– response: status code and phrase
• Other functions: E-mail address lookup & address
verification
• Messages must be in 7-bit ASCII
• General characteristics:
• Three phases of transfer: handshaking, mail
transfer, closure
• Attempts to provide reliable service
• No guarantee to recover lost messages
• No end to end acknowledgement to originator
• Error indication delivery not guaranteed
• Generally considered reliable!
SMTP Mail Flow
SMTP range
Commands and responses
Command format
CommandsCommands
ResponsesResponses
Responses (Continued)Responses (Continued)
Connection establishment
Message transfer
Connection termination
TCP/IP Protocol Suite 128
ExamplE 1
$ telnet mail.adelphia.net 25
Trying 68.168.78.100...
Connected to mail.adelphia.net (68.168.78.100).
Let us see how we can directly use SMTP to send an email and simulate the
commands and responses we described in this section. We use TELNET to log
into port 25 (the well-known port for SMTP). We then use the commands
directly to send an email. In this example, forouzanb@adelphia.net is sending
an email to himself. The first few lines show TELNET trying to connect to the
adelphia mail server.
After connection, we can type the SMTP commands and then receive the
responses as shown below. We have shown the commands in black and the
responses in color. Note that we have added for clarification some comment
lines, designated by the “=” sign. These lines are not part of the email
procedure.
TCP/IP Protocol Suite 129
ExamplE 1 (ContinuEd)
================== Connection Establishment
================
220 mta13.adelphia.net SMTP server ready Fri, 6 Aug 2004 . . .
HELO mail.adelphia.net
250 mta13.adelphia.net
===================== Envelope ===================
MAIL FROM: forouzanb@adelphia.net
250 Sender <forouzanb@adelphia.net> Ok
RCPT TO: forouzanb@adelphia.net
250 Recipient <forouzanb@adelphia.net> Ok
=================== Header and Body
==================
DATA
354 Ok Send data ending with <CRLF>.<CRLF>
From: Forouzan
TO: Forouzan
This is a test message
to show SMTP in action.
.
ExamplE 1 (ContinuEd)
============= Connection Termination===============
250 Message received: adelphia.net@mail.adelphia.net
QUIT
221 mta13.adelphia.net SMTP server closing connection
Connection closed by foreign host.
MESSAGE ACCESS AGENT:POP AND IMAP
• The third stage of mail delivery uses a message access agent;The third stage of mail delivery uses a message access agent;
the client must pull messages from the server.the client must pull messages from the server.
• Currently two message access protocols are available: PostCurrently two message access protocols are available: Post
Office Protocol, (POP3) and Internet Mail Access Protocol,Office Protocol, (POP3) and Internet Mail Access Protocol,
version 4.version 4.
• POP3POP3
– The POP (Post Office Protocol 3) protocol provides a simple,The POP (Post Office Protocol 3) protocol provides a simple,
standardized way for users to access mailboxes andstandardized way for users to access mailboxes and
download messages to their computers.download messages to their computers.
• IMAP4IMAP4
– IMAP (Internet Message Access Protocol) – Is a standardIMAP (Internet Message Access Protocol) – Is a standard
protocol for accessing e-mail from your local server.protocol for accessing e-mail from your local server.
– IMAP (the latest version is IMAP Version 4)IMAP (the latest version is IMAP Version 4)
POP3 and IMAP4
POP3
• Suppose you use hMailServer as your email
server to send an email to bill@microsoft.com.
– You click Send in your email client, say, Outlook
Express.
– Outlook Express delivers the email to hMailServer
using the SMTP protocol.
– hMailServer delivers the email to Microsoft's mail
server, mail.microsoft.com, using SMTP.
– Bill's Mozilla Mail client downloads the email from
mail.microsoft.com to his laptop using the POP3
protocol (or IMAP).
EXAMPLE:
DNS(Domain Name System)
• Domain Name System (or Service or Server), an
Internet service that translates domain names
into IP addresses.
• Because domain names are alphabetic, they're
easier to remember.
• For example, what is the internet address of
en.wikipedia.org?
– The Domain Name System can be used to tell you it is
66.230.200.100
1. What is the IP
address of
udel.edu ?
1. What is the
host name of
128.175.13.74
It is 128.175.13.92
Itis strauss.udel.edu
Introduction
DNS
ComponentsThere are 3 components:
• Name Space:
Specifications for a structured name space and data
associated with the names.
• Resolvers:
Client programs that extract information from Name
Servers.
• Name Servers:
Server programs which hold information about the structure
and the names.
Name Space
Resolvers
A Resolver maps a name to an address and vice versa.
Query
Response
Resolver Name Server
iterative response (referral)
“I don't know. Try a3.nstld.com.”
2
a3.nstl
d.com
3
Iterative Resolution
client
iterative request
“What is the IP address of
www.google.com?”
udel
server
1
iterative response (referral)
“I don't know. Try a.root-servers.net.”
4
a.root
server
5
iterative response (referral)
“I don't know. Try a.gtld-servers.net.”
6
a.gtld-
server
7
iterative response (referral)
“I don't know. Try ns1.google.com.”
8
ns1.goo
gle.com
9
iterative response
“The IP address of www.google.com
is 216.239.37.99.”10
Recursive resolution
6
7
4
8
3
2
9
1
10
5
Master
serverZone transfer
Zone
data
file
From
disk
Authoritative Data
(primary master and
slave zones)
Agent
(looks up queries
on behalf of resolvers)
Cache Data
(responses from
other name servers)
Name Server Process
Name Server
Architecture:
Resolver
Query
Response
Authoritative Data
(primary master and
slave zones)
Agent
(looks up queries
on behalf of resolvers)
Cache Data
(responses from
other name servers)
Name Server Process
Authoritative Data:
Name Server (cont’d)
Arbitrary
name
server
Response
Resolver
Query
Query
Authoritative Data
(primary master and
slave zones)
Agent
(looks up queries
on behalf of resolvers)
Cache Data
(responses from
other name servers)
Name Server Process
Response
Using Other Name Servers:
Name Server (cont’d)
Cached Data :
Query
Response
Authoritative Data
(primary master and
slave zones)
Agent
(looks up queries
on behalf of resolvers)
Cache Data
(responses from
other name servers)
Name Server Process
Resolver
Name Server (cont’d)
Block Diagram
User
Program
Foreign
Name
Server
Cache
Resolver
Query Query
Reference
Response
Addition
Response
How DNS Works?
• Domain names
– Arranged in a tree
• Cut into zones
– Each served by a name server
•The domain name space consists of a tree of domain
names.
Each node or leaf in the tree has one or more resource
records, which hold information associated with the
domain name.
The tree sub-divides into zones.
A zone consists of a collection of connected nodes
authoritatively served by an authoritative DNS
nameserver.
Note that a single nameserver can host several zones
Socket (Berkley Sockets)
• Universally known as Sockets.
• A socket is the mechanism that most popular
operating systems provide to give programs
access to the network.
• It allows messages to be sent and received
between applications (unrelated processes) on
different networked machines.
• The sockets mechanism has been created to be
independent of any specific type of network.
Standard API for networking
• Uniquely identified by
–an internet address
–an end-to-end protocol (e.g. TCP or UDP)
–a port number
• Two types of (TCP/IP) sockets
–Stream sockets (e.g. uses TCP)
• provide reliable byte-stream service
–Datagram sockets (e.g. uses UDP)
• provide best-effort datagram service
• messages up to 65.500 bytes
Sockets
Socket Programming
TCP Socket API
Programming with TCP/IP sockets
• There are a few steps involved in using sockets:
– Create the socket
– Identify the socket
– On the server, wait for an incoming connection
– On the client, connect to the server's socket
– Send and receive messages
– Close the socket
Programming with UDP sockets
• UDP is a connection-less, unreliable, datagram
protocol (TCP is instead connection-oriented,
reliable and stream based).
• Some popular applications built around UDP
are DNS, NFS, SNMP and for example, some
Skype services and streaming media.
• The steps of establishing a UDP socket communication
on the client side are as follows:
– Create a socket using the socket() function;
– Send and receive data by means of
the recvfrom() and sendto() functions.
• The steps of establishing a UDP socket communication
on the server side are as follows:
– Create a socket with the socket() function;
– Bind the socket to an address using the bind() function;
– Send and receive data by means of recvfrom() and sendto().
UDP Socket API

Más contenido relacionado

La actualidad más candente (20)

Tcp IP Model
Tcp IP ModelTcp IP Model
Tcp IP Model
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
 
Chap 8 switching
Chap 8 switchingChap 8 switching
Chap 8 switching
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
Dhcp
DhcpDhcp
Dhcp
 
Mac protocols
Mac protocolsMac protocols
Mac protocols
 
TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
Introduction to Application layer
Introduction to Application layerIntroduction to Application layer
Introduction to Application layer
 
Tcp and udp
Tcp and udpTcp and udp
Tcp and udp
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
 
TCP/IP Network ppt
TCP/IP Network pptTCP/IP Network ppt
TCP/IP Network ppt
 
Transport layer
Transport layer Transport layer
Transport layer
 
Csma
CsmaCsma
Csma
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Ip address and subnetting
Ip address and subnettingIp address and subnetting
Ip address and subnetting
 
Introduction to TCP/IP
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IP
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Circuit Switching
Circuit SwitchingCircuit Switching
Circuit Switching
 

Similar a Application Layer

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
 
Web technologies: recap on TCP-IP
Web technologies: recap on TCP-IPWeb technologies: recap on TCP-IP
Web technologies: recap on TCP-IPPiero Fraternali
 
History of Internet and advantages of internet
History of Internet and advantages of internetHistory of Internet and advantages of internet
History of Internet and advantages of internetTallat Satti
 
DS Unit-4-Communication .pdf
DS Unit-4-Communication .pdfDS Unit-4-Communication .pdf
DS Unit-4-Communication .pdfSantoshUpreti6
 
E-Management, Archival and Retrieval of documents/Office Networking System
E-Management, Archival and Retrieval of documents/Office Networking SystemE-Management, Archival and Retrieval of documents/Office Networking System
E-Management, Archival and Retrieval of documents/Office Networking SystemVaughan Olufemi ACIB, AICEN, ANIM
 
Unit 7 - Internet and Intranet Applications - IT
Unit 7 - Internet and Intranet Applications - ITUnit 7 - Internet and Intranet Applications - IT
Unit 7 - Internet and Intranet Applications - ITDeepraj Bhujel
 
Unit 1 web technology uptu slide
Unit 1 web technology uptu slideUnit 1 web technology uptu slide
Unit 1 web technology uptu slideAbhishek Kesharwani
 
Computer Networks Lecture Notes
Computer Networks Lecture NotesComputer Networks Lecture Notes
Computer Networks Lecture NotesFellowBuddy.com
 
Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networkingshankars73
 
network fundamentals
network fundamentalsnetwork fundamentals
network fundamentalsSithu PM
 
Sept 2017 network standards and models
Sept 2017   network standards and modelsSept 2017   network standards and models
Sept 2017 network standards and modelsshahin raj
 
Internet architecture protocol
Internet architecture protocolInternet architecture protocol
Internet architecture protocolGLIM Digital
 

Similar a Application Layer (20)

Network layer
Network layerNetwork layer
Network layer
 
OSI Model.ppt
OSI Model.pptOSI Model.ppt
OSI Model.ppt
 
Computer networks
Computer networksComputer networks
Computer networks
 
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
 
Viloria osi layer4-7
Viloria osi layer4-7Viloria osi layer4-7
Viloria osi layer4-7
 
Iso model
Iso modelIso model
Iso model
 
Web technologies: recap on TCP-IP
Web technologies: recap on TCP-IPWeb technologies: recap on TCP-IP
Web technologies: recap on TCP-IP
 
Networking
Networking Networking
Networking
 
History of Internet and advantages of internet
History of Internet and advantages of internetHistory of Internet and advantages of internet
History of Internet and advantages of internet
 
Network Protocol and TCP/IP
Network Protocol and TCP/IPNetwork Protocol and TCP/IP
Network Protocol and TCP/IP
 
DS Unit-4-Communication .pdf
DS Unit-4-Communication .pdfDS Unit-4-Communication .pdf
DS Unit-4-Communication .pdf
 
Web technology unit I - Part B
Web technology unit I - Part BWeb technology unit I - Part B
Web technology unit I - Part B
 
E-Management, Archival and Retrieval of documents/Office Networking System
E-Management, Archival and Retrieval of documents/Office Networking SystemE-Management, Archival and Retrieval of documents/Office Networking System
E-Management, Archival and Retrieval of documents/Office Networking System
 
Unit 7 - Internet and Intranet Applications - IT
Unit 7 - Internet and Intranet Applications - ITUnit 7 - Internet and Intranet Applications - IT
Unit 7 - Internet and Intranet Applications - IT
 
Unit 1 web technology uptu slide
Unit 1 web technology uptu slideUnit 1 web technology uptu slide
Unit 1 web technology uptu slide
 
Computer Networks Lecture Notes
Computer Networks Lecture NotesComputer Networks Lecture Notes
Computer Networks Lecture Notes
 
Introduction to Computer Networking
Introduction to Computer NetworkingIntroduction to Computer Networking
Introduction to Computer Networking
 
network fundamentals
network fundamentalsnetwork fundamentals
network fundamentals
 
Sept 2017 network standards and models
Sept 2017   network standards and modelsSept 2017   network standards and models
Sept 2017 network standards and models
 
Internet architecture protocol
Internet architecture protocolInternet architecture protocol
Internet architecture protocol
 

Más de ushabarad142

Más de ushabarad142 (6)

Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Operating System
Operating SystemOperating System
Operating System
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 3 final
Chapter 3 finalChapter 3 final
Chapter 3 final
 
Chapter 3 final
Chapter 3 finalChapter 3 final
Chapter 3 final
 
Chapter 3 final
Chapter 3 finalChapter 3 final
Chapter 3 final
 

Último

22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 

Último (20)

22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 

Application Layer

  • 2.
  • 3.
  • 4. SYLLABUS 1 Introduction to computer networks and Internet: • Understanding of network and Internet, The network edge, The network core, Understanding of Delay, Loss and Throughput in the packet-switching network, protocols layers and their service model, History of the computer network 2 Application Layer: • Principles of computer applications, Web and HTTP, E-mail, DNS, Socket programming with TCP and UDP 3 Transport Layer: • Introduction and transport layer services, Multiplexing and Demultiplexing, Connection less transport (UDP), Principles of reliable data transfer, Connection oriented transport (TCP), Congestion control.
  • 5. 4 Network Layer: • Introduction, Virtual and Datagram networks, study of router, IP protocol and addressing in the Internet, Routing algorithms, Broadcast and Multicast routing 5 The Link layer and Local area networks: • Introduction and link layer services, error-detection and correction techniques, Multiple access protocols, addressing, Ethernet, switches.
  • 6. BOOKS • Reference Books: 1.Computer Networking- A Top-Down approach, 5th edition, Kurose and Ross, Pearson 2.Computer Networks- A Top-Down approach, Behrouz Forouzan, McGraw Hill 3.Computer Networks (4th edition), Andrew Tanenbaum, Prentice Hall 4.Computer Networking and the Internet (5th edition),Fred Halsall, Addison Wesley 5.Data Communications and Networking (4th edition), Behrouz Forouzan, McGraw Hill 6.TCP/IP Protocol Suite (3rd edition), Behrouz Forouzan, McGraw Hill
  • 8. Introduction • The old model of a single computer serving all of the organization’s computational needs has been replaced by one in which a large number of separate but interconnected computers do the job. • These systems are called computer networks. • “A computer network is a set of computers connected together for the purpose of sharing resources.” • The most common resource shared today is connection to the Internet. • Other shared resources can include a printer or a file server.
  • 9. Uses of Compute Networks • Uses of Networks for Companies: – Resource Sharing • It allows all programs, equipments and data available to anyone on the network irrespective of the physical location of the resource and the user. – High Reliability • It provides high reliability by having alternative sources of data. • For e.g. all files could be replicated on more than one machines, so if one of them is unavailable due to hardware failure or any other reason, the other copies can be used.
  • 10. Continue… – Saving Money • Organizations can use separate personal computer one per user instead of using mainframe computer which are expensive. • The organizations can use the workgroup model (peer to peer) in which all the PCs are networked together and each one can have the access to the other for communicating or sharing purpose. – Scalability • Another goal is scalability. Scalability is the ability to increase the system performance gradually as the workload grows, by just adding more processors.
  • 11. Continue… • Uses of Networks to People: – Access to Remote Information (i) Home shopping, paying telephone, electricity bills, e- banking, on line share market etc. (ii) Newspaper is On-line and is personalized, digital library consisting of books, magazines, scientific journals etc. (iii) World wide web which contains information. about the arts, business, cooking, government, health, history, hobbies, recreation, science, sports etc.
  • 12. Continue… –Person to Person Communication (i) Electronic-mail (e-mail) (ii) Real time e-mail i.e. video conferencing allows remote users to communicate with no delay by seeing and hearing each other. Video-conferencing is being used for remote school, getting medical opinion from distant specialists etc. (iii) Worldwide newsgroups in which one person posts a message and all other subscribers to the newsgroup can read it or give their feedbacks. –Interactive Entertainment (i) Multiperson real-time simulation games. (ii) Video on demand. (iii)Participation in live TV programmes likes quiz, contest, discussions etc.
  • 13. Continue… • We use the concept ofWe use the concept of layerslayers in our daily life.in our daily life. As an example, let us consider two friends whoAs an example, let us consider two friends who communicate through postal mail.communicate through postal mail. • The process of sending a letter to a friendThe process of sending a letter to a friend would be complex if there were no serviceswould be complex if there were no services available from the post office.available from the post office. • Tasks involved in sending a letter shown below:
  • 14.
  • 15. 5-Layer Model(the TCP Model) • The 5-layer model serves primarily the protocols known as Transmission Control Protocol (TCP) and Internet Protocol (IP), or jointly, TCP/IP. • The User Datagram Protocol (UDP) is also served by this model. • The 5-layer model was developed along with these protocols, antedating the 7-layer model, and is sometimes called the TCP Model.
  • 16.
  • 17. THE OSI MODELTHE OSI MODEL • Established in 1947, the International StandardsEstablished in 1947, the International Standards Organization (Organization (ISOISO) is a multinational body) is a multinational body dedicated to worldwide agreement ondedicated to worldwide agreement on international standards.international standards. • An ISO standard that covers all aspects of networkAn ISO standard that covers all aspects of network communications is the Open Systemscommunications is the Open Systems Interconnection (Interconnection (OSIOSI) model.) model. • It was first introduced in the late 1970s.It was first introduced in the late 1970s.
  • 18. ISO is the organization. OSI is the model. Note
  • 19. Seven layers of the OSI model
  • 20. The interaction between layers in the OSI model
  • 22. Principles of computer applications
  • 24. Application architectures • Client-server • Peer-to-peer (P2P) • Hybrid of client-server and P2P
  • 27. Hybrid of client -server and P2P
  • 28. The Transport Services • Networked applications are built on top of the transport service. • There are two main types of transport services : – The connectionless or datagram service – The connection-oriented or byte-stream service
  • 29. Continue… • The connectionless service allows applications to easily exchange messages or Service Data Units. On the Internet. • This service is provided by the UDP protocol. • The connectionless transport service on the Internet is unreliable, but is able to detect transmission errors.
  • 30. Continue… • Each of these applications must be able to exchange SDUs with remote applications. • To enable these exchanges of SDUs, each networked application running on a host is identified by the following information : – the host on which the application is running – the port number on which the application listens for SDUs • On the Internet, the port number is an integer and the host is identified by its network address. • In the network layer there are two types of Internet Addresses: – IP version 4 addresses that are 32 bits wide – IP version 6 addresses that are 128 bits wide
  • 31. Continue… • IPv4 addresses are usually represented by using a dotted decimal representation where each decimal number corresponds to one byte of the address, e.g. 203.0.113.56. • IPv6 addresses are usually represented as a set of hexadecimal numbers separated by semicolons, e.g. 2001:db8:3080:2:217:f2ff:fed6:65c0. • Today, most Internet hosts have one IPv4 address. • In the future, we can expect that more and more hosts will have IPv6 addresses and that some of them will not have an IPv4 address anymore. • A host that only has an IPv4 address cannot communicate with a host having only an IPv6 address.
  • 32. Continue… • The second transport service is the connection-oriented service. • On the Internet, this service is often called the byte- stream service as it creates a reliable byte stream between the two applications that are linked by a transport connection.
  • 33. What transport service does an app need?
  • 34.
  • 35.
  • 36.
  • 38. WEB • The web, as the World Wide Web is popularly known, is an architectural framework for accessing linked content spread out over millions of machines all over the internet. • The user’s point of view, the Web consists of a vast, worldwide collection of content in the form of Web pages, often just called pages for short. • The idea of having one page point to another, now called hypertext, was invented by a M.I.T professor of electrical engineering in 1945.
  • 39. • HTTP: • These messages include requests from client to server and responses from server to client which will have the following format: – HTTP-message = <Request> | <Response> ; HTTP/1.1 messages • HTTP requests and HTTP responses use a generic message format of RFC 822 for transferring the required data. This generic message format consists of the following four items. – A Start-line – Zero or more header fields followed by CRLF – An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields – Optionally a message-body
  • 40. • Carriage Return, Line Feed: • CR LF means "Carriage Return, Line Feed" – it's a DOS hangover from the olden days from when some devices required a Carriage Return, and some devices required a Line Feed to get a new line, so Microsoft decided to just make a new-line have both characters, so that they would output correctly on all devices.
  • 41. • Message Start-Line: Syntax – start-line = Request-Line | Status-Line • For now, let's see the examples of start line in case of request and response: – GET /hello.htm HTTP/1.1 (This is Request-Line sent by the client) – HTTP/1.1 200 OK (This is Status-Line sent by the server)
  • 42. • Header Fields: • There are four types of HTTP message headers: – General-header: These header fields have general applicability for both request and response messages. – Request-header: These header fields have applicability only for request messages. – Response-header: These header fields have applicability only for response messages. – Entity-header: These header fields define meta information about the entity-body or, if no body is present, about the resource identified by the request.
  • 43. • Syntax: – message-header = field-name ":" [ field-value ] • Following are the examples of various header fields: – User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3 – Host: www.example.com – Accept-Language: en, mi – Date: Mon, 27 Jul 2009 12:28:53 GMT – Server: Apache – Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT – ETag: "34aa387-d-1568eb00" – Accept-Ranges: bytes – Content-Length: 51 – Vary: Accept-Encoding – Content-Type: text/plain
  • 44. • Message Body: • The message body part is optional for an HTTP message but if it is available, then it is used to carry the entity-body associated with the request or response. • Example: <html> <body> <h1>Hello, World!</h1> </body> </html>
  • 45. HTTP request message • An HTTP client sends an HTTP request to a server in the form of a request message which includes following format: – A Request-line – Zero or more header (General|Request|Entity) fields followed by CRLF – An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields – Optionally a message-body
  • 46. • Request-Line: • The Request-Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF. • The elements are separated by space SP characters. – Request-Line = Method SP Request-URI SP HTTP- Version CRLF
  • 47. • Request Method: • The request method indicates the method to be performed on the resource identified by the given Request-URI. • The method is case-sensitive and should always be mentioned in uppercase. • The following table lists all the supported methods in HTTP/1.1.
  • 48. S.N. Method and Description 1 GET : The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. 2 HEAD : Same as GET, but it transfers the status line and the header section only. 3 POST : A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. 4 PUT : Replaces all the current representations of the target resource with the uploaded content. 5 DELETE : Removes all the current representations of the target resource given by URI. 6 CONNECT : Establishes a tunnel to the server identified by a given URI. 7 OPTIONS : Describe the communication options for the target resource. 8 TRACE : Performs a message loop back test along with the path to the target resource.
  • 49. • Request-URI: • The Request-URI is a Uniform Resource Identifier and identifies the resource upon which to apply the request. • Following are the most commonly used forms to specify an URI: – Request-URI = "*" | absoluteURI | abs_path | authority
  • 50. S.N Method and Description 1 The asterisk * is used when an HTTP request does not apply to a particular resource, but to the server itself, and is only allowed when the method used does not necessarily apply to a resource. For example: OPTIONS * HTTP/1.1 2 The absoluteURI is used when an HTTP request is being made to a proxy. The proxy is requested to forward the request or service from a valid cache, and return the response. For example: GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 3 The most common form of Request-URI is that used to identify a resource on an origin server or gateway. For example, a client wishing to retrieve a resource directly from the origin server would create a TCP connection to port 80 of the host "www.w3.org" and send the following lines: GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.w3.org Note that the absolute path cannot be empty; if none is present in the original URI, it MUST be given as "/" (the server root).
  • 51. • Request Header Fields: • The request-header fields allow the client to pass additional information about the request, and about the client itself, to the server. • These fields act as request modifiers. • Here is a list of some important Request-header fields that can be used based on the requirement:
  • 52. – Accept-Charset – Accept-Encoding – Accept-Language – Authorization – Expect – From – Host – If-Match – If-Modified-Since – If-None-Match – If-Range – If-Unmodified-Since – Max-Forwards – Proxy-Authorization – Range – Referer – TE – User-Agent
  • 53. Examples of Request Message • Now let's put it all together to form an HTTP request to fetch hello.htm page from the web server running on tutorialspoint.com GET /hello.htm HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive • Here we are not sending any request data to the server because we are fetching a plain HTML page from the server. • Connection is a general-header, and the rest of the headers are request headers.
  • 54. • The following example shows how to send form data to the server using request message body: POST /cgi-bin/process.cgi HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Content-Type: application/x-www-form-urlencoded Content-Length: length Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive licenseID=string&content=string&/paramsXML=string • Here the given URL /cgi-bin/process.cgi will be used to process the passed data and accordingly, a response will be returned. • Here content-type tells the server that the passed data is a simple web form data and length will be the actual length of the data put in the message body.
  • 55. • The following example shows how you can pass plain XML to your web server: POST /cgi-bin/process.cgi HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Content-Type: text/xml; charset=utf-8 Content-Length: length Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive • <?xml version="1.0" encoding="utf-8"?> • <string xmlns="http://clearforest.com/">string</string>
  • 56.
  • 57. HTTP request message: general format
  • 60.
  • 61. HTTP response message • After receiving and interpreting a request message, a server responds with an HTTP response message: – A Status-line – Zero or more header (General|Response|Entity) fields followed by CRLF – An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields – Optionally a message-body
  • 62. • Message Status-Line: • A Status-Line consists of the protocol version followed by a numeric status code and its associated textual phrase. • The elements are separated by space SP characters. – Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
  • 63. • HTTP Version: • A server supporting HTTP version 1.1 will return the following version information: – HTTP-Version = HTTP/1.1 • Status Code: • The Status-Code element is a 3-digit integer where first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. • There are 5 values for the first digit:
  • 64. S.N. Code and Description 1 1xx: Informational It means the request was received and the process is continuing. 2 2xx: Success It means the action was successfully received, understood, and accepted. 3 3xx: Redirection It means further action must be taken in order to complete the request. 4 4xx: Client Error It means the request contains incorrect syntax or cannot be fulfilled. 5 5xx: Server Error It means the server failed to fulfill an apparently valid request.
  • 65. • Response Header Fields: • The response-header fields allow the server to pass additional information about the response which cannot be placed in the Status- Line. • These header fields give information about the server and about further access to the resource identified by the Request-URI. – Accept-Ranges – Age – ETag – Location – Proxy-Authenticate – Retry-After – Server – Vary – WWW-Authenticate
  • 66. Examples of Response Message • Now let's put it all together to form an HTTP response for a request to fetch the hello.htm page from the web server running on tutorialspoint.com HTTP/1.1 200 OK Date: Mon, 27 Jul 2009 12:28:53 GMT Server: Apache/2.2.14 (Win32) Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT Content-Length: 88 Content-Type: text/html Connection: Closed Output: <html> <body> <h1>Hello , World!</h1> </body> </html> Output: <html> <body> <h1>Hello , World!</h1> </body> </html>
  • 67. • The following example shows an HTTP response message displaying error condition when the web server could not find the requested page: HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Connection: Closed Content-Type: text/html; charset=iso-8859-1
  • 68. Output: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>404 Not Found</title> </head> <body> <h1>Not Found</h1> <p>The requested URL /t.html was not found on this server.</p> </body> </html> Output: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>404 Not Found</title> </head> <body> <h1>Not Found</h1> <p>The requested URL /t.html was not found on this server.</p> </body> </html>
  • 69. • Following is an example of HTTP response message showing error condition when the web server encountered a wrong HTTP version in the given HTTP request: HTTP/1.1 400 Bad Request Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Content-Type: text/html; charset=iso-8859-1 Connection: Closed
  • 70. Output: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>400 Bad Request</title> </head> <body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.</p> <p>The request line contained invalid characters following the protocol string.</p> </body> </html> Output: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>400 Bad Request</title> </head> <body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.</p> <p>The request line contained invalid characters following the protocol string.</p> </body> </html>
  • 71.
  • 73. Cookies • Cookies are small files which are stored on a user's computer. • They are designed to hold a modest amount of data specific to a particular client and website, and can be accessed either by the web server or the client computer.
  • 74. • An HTTP cookie (also called web cookie, Internet cookie, browser cookie or simply cookie), is a small piece of data sent from a website and stored in the user's web browser while the user is browsing it. • Every time the user loads the website, the browser sends the cookie back to the server to notify the user's previous activity. • Cookies can also store passwords and form content a user has previously entered, such as a
  • 75. • Why are Cookies Used? • Cookies are a convenient way to carry information from one session on a website to another, or between sessions on related websites, without having to burden a server machine with massive amounts of data storage. • Storing the data on the server without using cookies would also be problematic because it would be difficult to retrieve a particular user's information without requiring a login on each visit to the website.
  • 76. • How Long Does a Cookie Last? • The time of expiry of a cookie can be set when the cookie is created. By default the cookie is destroyed when the current browser window is closed. • Who Can Access Cookies? • When a cookie is created it is possible to control its visibility by setting its 'root domain'. It will then be accessible to any URL belonging to that root. • For example the root could be set to "whatarecookies.com" and the cookie would then be available to sites in "www.whatarecookies.com" or "xyz.whatarecookies.com" or "whatarecookies.com".
  • 78.
  • 79. Web caches (proxy server)
  • 80.
  • 81.
  • 82.
  • 83.
  • 84. Electronic Mail • E-mail (electronic mail) is the exchange of computer- stored messages by telecommunication. (Some publications spell it email; we prefer the currently more established spelling of e-mail.) • E-mail messages are usually encoded in ASCII text.
  • 86. When the sender and the receiver of an email are on the same system, we need only two user agents. Note:Note:
  • 87. TCP/IP Protocol Suite 87 Second scenario
  • 88. TCP/IP Protocol Suite 88 When the sender and the receiver of an email are on different systems, we need two UAs and a pair of MTAs (client and server). Note:Note:
  • 89. TCP/IP Protocol Suite 89 Third scenario
  • 90. TCP/IP Protocol Suite 90 When the sender is connected to the mail server via a LAN or a WAN, we need two UAs and two pairs of MTAs (client and server). Note:Note:
  • 91. TCP/IP Protocol Suite 91 Fourth scenario
  • 92. TCP/IP Protocol Suite 92 Push vs. pull
  • 93. TCP/IP Protocol Suite 93 When both sender and receiver are connected to the mail server via a LAN or a WAN, we need two UAs, two pairs of MTAs (client and server), and a pair of MAAs (client and server). This is the most common situation today. Note:Note:
  • 94. Botnets: bot + network-WINTER 2015 • A botnet is a group of computers connected in a coordinated fashion for malicious purposes. • Each computer in a botnet is called a bot. • These bots form a network of compromised computers, which is controlled by a third party and used to transmit malware or spam, or to launch attacks. • A network of private computers infected with malicious software and controlled as a group without the owners' knowledge, e.g. to send spam.
  • 96. bot bot C&C botmaster bot C&C Bot periodically connects to one/some of C&C servers to obtain command C&C (Command and Control): usually Internet Relay Chat (IRC) based
  • 97. USER AGENT The user agent (UA) provides service to the user to make theThe user agent (UA) provides service to the user to make the process of sending and receiving a message easier.process of sending and receiving a message easier. Services Provided by a User AgentServices Provided by a User Agent User Agent TypesUser Agent Types Sending MailSending Mail Receiving MailReceiving Mail AddressesAddresses Mailing ListMailing List MIMEMIME
  • 99. Some examples of command-driven user agents are mail, pine, and elm Note:Note:
  • 100. Some examples of GUI-based user agents are Eudora, Outlook, and Netscape. Note:Note:
  • 101. Format of an email
  • 103.
  • 104.
  • 105.
  • 106. Message Formats Header Description To: E-mail address(es) of the primary recipient(s). CC: E-mail address(es) of the secondary recipient(s). BCC: E-mail address(es) which should receive blind carbon copies. This line is deleted from all the copies sent to the primary and secondary recipients. From: The mailbox from which the message is sent. Sender: E-mail address of the sender. Received: Line added by each MTA during the e-mail transfer. Return- Path: This field is added by the final MTA and is intended to inform you how to get back to the sender. In theory, this information can be gathered from all the Received headers (except for the name of the sender’s mailbox). Typically it just contains the sender’s address.
  • 107. Multipurpose Internet Mail Extensions(MIME) • MIME (Multi-Purpose Internet Mail Extensions) is an extension of the original Internet e-mail protocol that lets people use the protocol to exchange different kinds of data files on the Internet: audio, video, images, application programs, and other kinds, as well as the ASCII text handled in the original protocol, the Simple Mail Transport Protocol (SMTP)
  • 108. Multipurpose Internet Mail Extensions(MIME) • In the early days, e-mail consisted exclusively of text messages written in English and expressed in ASCII. • For this environment, RFC 822 was sufficient; it defined the headers but left the content entirely up to the users. • Nowadays, on the Internet, this approach is no longer adequate. The problems include sending and receiving: – Messages written in languages containing accents and other special characters (e.g. French, Spanish and German). – Messages written in languages based on non-Latin alphabets (e.g. Hebrew, Russian, Japanese). – Messages containing audio, images or other non-ASCII information.
  • 109. Header Description MIME-Version Indicates the MIME version being used. Content-Description Human-readable string which describes the content of the message. Content-ID Unique identifier Content-Transfer- Encoding Indicates how the e-mail body is wrapped for transmission. Content-Type Type and format of the content. It specifies the nature of the message body. Content types are defined per RFC 2045, RFC 2854, RFC 3003 and RFC 3023 (This list is subject to changes) Each content type has one or more subtypes. The type and subtype are separated by a slash, e.g. Content-Type: video/mpeg
  • 110.
  • 111. • Separator line gives information about specific encoding • MIME is extensible - sender and receiver agree on encoding scheme • MIME is compatible with existing mail systems • Everything encoded as ASCII • Headers and separators ignored by non-MIME mail systems • MIME encapsulates binary data in ASCII mail envelope
  • 113. TCP/IP Protocol Suite 113 MIME header
  • 114. The MIME types and sub-types defined in RFC 1521
  • 115. EMAIL PROTOCOLS • There are three E-mail protocols: –SMTP (Simple Mail Transfer Protocol) –POP3 (Post Office Protocol) –IMAP (Internet Mail Access Protocol)
  • 116. MESSAGE TRANSFER AGENT: SMTP[RFC 2821] • Simple Mail Transfer Protocol (SMTP) is the standard application protocol for application protocol delivery of mail from source to destination • Provides reliable delivery of messages • Uses TCP well-known port 25 for message exchange between client and server. • Command/Response interaction: – commands: ASCII text – response: status code and phrase • Other functions: E-mail address lookup & address verification • Messages must be in 7-bit ASCII
  • 117. • General characteristics: • Three phases of transfer: handshaking, mail transfer, closure • Attempts to provide reliable service • No guarantee to recover lost messages • No end to end acknowledgement to originator • Error indication delivery not guaranteed • Generally considered reliable!
  • 128. TCP/IP Protocol Suite 128 ExamplE 1 $ telnet mail.adelphia.net 25 Trying 68.168.78.100... Connected to mail.adelphia.net (68.168.78.100). Let us see how we can directly use SMTP to send an email and simulate the commands and responses we described in this section. We use TELNET to log into port 25 (the well-known port for SMTP). We then use the commands directly to send an email. In this example, forouzanb@adelphia.net is sending an email to himself. The first few lines show TELNET trying to connect to the adelphia mail server. After connection, we can type the SMTP commands and then receive the responses as shown below. We have shown the commands in black and the responses in color. Note that we have added for clarification some comment lines, designated by the “=” sign. These lines are not part of the email procedure.
  • 129. TCP/IP Protocol Suite 129 ExamplE 1 (ContinuEd) ================== Connection Establishment ================ 220 mta13.adelphia.net SMTP server ready Fri, 6 Aug 2004 . . . HELO mail.adelphia.net 250 mta13.adelphia.net ===================== Envelope =================== MAIL FROM: forouzanb@adelphia.net 250 Sender <forouzanb@adelphia.net> Ok RCPT TO: forouzanb@adelphia.net 250 Recipient <forouzanb@adelphia.net> Ok =================== Header and Body ================== DATA 354 Ok Send data ending with <CRLF>.<CRLF> From: Forouzan TO: Forouzan This is a test message to show SMTP in action. .
  • 130. ExamplE 1 (ContinuEd) ============= Connection Termination=============== 250 Message received: adelphia.net@mail.adelphia.net QUIT 221 mta13.adelphia.net SMTP server closing connection Connection closed by foreign host.
  • 131. MESSAGE ACCESS AGENT:POP AND IMAP • The third stage of mail delivery uses a message access agent;The third stage of mail delivery uses a message access agent; the client must pull messages from the server.the client must pull messages from the server. • Currently two message access protocols are available: PostCurrently two message access protocols are available: Post Office Protocol, (POP3) and Internet Mail Access Protocol,Office Protocol, (POP3) and Internet Mail Access Protocol, version 4.version 4. • POP3POP3 – The POP (Post Office Protocol 3) protocol provides a simple,The POP (Post Office Protocol 3) protocol provides a simple, standardized way for users to access mailboxes andstandardized way for users to access mailboxes and download messages to their computers.download messages to their computers. • IMAP4IMAP4 – IMAP (Internet Message Access Protocol) – Is a standardIMAP (Internet Message Access Protocol) – Is a standard protocol for accessing e-mail from your local server.protocol for accessing e-mail from your local server. – IMAP (the latest version is IMAP Version 4)IMAP (the latest version is IMAP Version 4)
  • 132.
  • 134. POP3
  • 135. • Suppose you use hMailServer as your email server to send an email to bill@microsoft.com. – You click Send in your email client, say, Outlook Express. – Outlook Express delivers the email to hMailServer using the SMTP protocol. – hMailServer delivers the email to Microsoft's mail server, mail.microsoft.com, using SMTP. – Bill's Mozilla Mail client downloads the email from mail.microsoft.com to his laptop using the POP3 protocol (or IMAP). EXAMPLE:
  • 136.
  • 137. DNS(Domain Name System) • Domain Name System (or Service or Server), an Internet service that translates domain names into IP addresses. • Because domain names are alphabetic, they're easier to remember. • For example, what is the internet address of en.wikipedia.org? – The Domain Name System can be used to tell you it is 66.230.200.100
  • 138. 1. What is the IP address of udel.edu ? 1. What is the host name of 128.175.13.74 It is 128.175.13.92 Itis strauss.udel.edu Introduction
  • 139. DNS ComponentsThere are 3 components: • Name Space: Specifications for a structured name space and data associated with the names. • Resolvers: Client programs that extract information from Name Servers. • Name Servers: Server programs which hold information about the structure and the names.
  • 141. Resolvers A Resolver maps a name to an address and vice versa. Query Response Resolver Name Server
  • 142. iterative response (referral) “I don't know. Try a3.nstld.com.” 2 a3.nstl d.com 3 Iterative Resolution client iterative request “What is the IP address of www.google.com?” udel server 1 iterative response (referral) “I don't know. Try a.root-servers.net.” 4 a.root server 5 iterative response (referral) “I don't know. Try a.gtld-servers.net.” 6 a.gtld- server 7 iterative response (referral) “I don't know. Try ns1.google.com.” 8 ns1.goo gle.com 9 iterative response “The IP address of www.google.com is 216.239.37.99.”10
  • 144. Master serverZone transfer Zone data file From disk Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Name Server Architecture:
  • 145. Resolver Query Response Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Authoritative Data: Name Server (cont’d)
  • 146. Arbitrary name server Response Resolver Query Query Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Response Using Other Name Servers: Name Server (cont’d)
  • 147. Cached Data : Query Response Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Resolver Name Server (cont’d)
  • 149.
  • 150. How DNS Works? • Domain names – Arranged in a tree • Cut into zones – Each served by a name server •The domain name space consists of a tree of domain names. Each node or leaf in the tree has one or more resource records, which hold information associated with the domain name. The tree sub-divides into zones. A zone consists of a collection of connected nodes authoritatively served by an authoritative DNS nameserver. Note that a single nameserver can host several zones
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157.
  • 158.
  • 159.
  • 160.
  • 161.
  • 162. Socket (Berkley Sockets) • Universally known as Sockets. • A socket is the mechanism that most popular operating systems provide to give programs access to the network. • It allows messages to be sent and received between applications (unrelated processes) on different networked machines. • The sockets mechanism has been created to be independent of any specific type of network.
  • 163. Standard API for networking
  • 164. • Uniquely identified by –an internet address –an end-to-end protocol (e.g. TCP or UDP) –a port number • Two types of (TCP/IP) sockets –Stream sockets (e.g. uses TCP) • provide reliable byte-stream service –Datagram sockets (e.g. uses UDP) • provide best-effort datagram service • messages up to 65.500 bytes Sockets
  • 165.
  • 167.
  • 168.
  • 170. Programming with TCP/IP sockets • There are a few steps involved in using sockets: – Create the socket – Identify the socket – On the server, wait for an incoming connection – On the client, connect to the server's socket – Send and receive messages – Close the socket
  • 171. Programming with UDP sockets • UDP is a connection-less, unreliable, datagram protocol (TCP is instead connection-oriented, reliable and stream based). • Some popular applications built around UDP are DNS, NFS, SNMP and for example, some Skype services and streaming media.
  • 172. • The steps of establishing a UDP socket communication on the client side are as follows: – Create a socket using the socket() function; – Send and receive data by means of the recvfrom() and sendto() functions. • The steps of establishing a UDP socket communication on the server side are as follows: – Create a socket with the socket() function; – Bind the socket to an address using the bind() function; – Send and receive data by means of recvfrom() and sendto().