Core network components - Charles Sturt University

Download Report

Transcript Core network components - Charles Sturt University

ITC242 – Introduction to
Data Communications
Internet Based Applications
1
Last Week
TCP/IP and OSI
• Describe the definition of a protocol;
• Discuss the need and benefits of using
protocol architectures;
• Describe the TCP/IP protocol architecture
• Describe the OSI reference model.
2
Topic 6 Internet Based Applications
Learning Objectives
• describe electronic mail and the basic
function of SMTP
• explain the need for MIME
• explain the role of HTTP in the operation
of the Web
• describe the functions of proxies,
gateways and tunnels in HTTP
• recognise the role of SIP
3
Question
Which layer of OSI we will study in this
class?
4
Layering: The OSI Model
layer-to-layer communication
Application
Application
Presentation
Presentation
Session
Session
7
6
5
4
3
2
1
7
6
Peer-layer communication
Transport
Router
Router
Transport
Network
Network
Network
Network
Link
Link
Link
Link
Physical
Physical
Physical
Physical
5
4
3
2
1
5
Electronic Mail Features
• Message Preparation
– Word processing
– Annotation
• Message Sending
–
–
–
–
–
–
User directory
Timed delivery
Multiple addressing
Message priority
Status information
Interface to other facilities
• Message Receiving
–
–
–
–
–
Mailbox scanning
Message selection
Message notification
Message reply
Message rerouting
6
Public vs Private Email
• Public
– Provided by a 3rd party vendor
– Available over one or more public networks
– Examples: MCI Mail, AOL
• Private
– Integrated with user’s computer equipment
– Often part of an integrated tool, eg PROFS
– Used for internal messaging
• Internet mail does not fit into either of these
categories; it is a transfer mechanism rather
than a contained system
7
Electronic Mail
outgoing
message queue
user mailbox
Three major components:
• user agents
• mail servers
• simple mail transfer protocol:
SMTP
User Agent
• a.k.a. “mail reader”
• composing, editing, reading
mail messages
• e.g., Eudora, Outlook, elm,
Mozilla Thunderbird
• outgoing, incoming messages
stored on server
user
agent
mail
server
SMTP
SMTP
mail
server
user
agent
SMTP
user
agent
mail
server
user
agent
user
agent
user
agent
8
Electronic Mail: mail servers
user
agent
Mail Servers
• mailbox contains
incoming messages
for user
• message queue of
outgoing (to be sent)
mail messages
• SMTP protocol (see
the next)
mail
server
SMTP
SMTP
mail
server
user
agent
SMTP
user
agent
mail
server
user
agent
user
agent
user
agent
9
SMTP [RFC 2821]
• uses TCP to reliably transfer email message from
client to server, port 25
• direct transfer: sending server ( “client”) to receiving
server( “server”)
• three phases of transfer
– handshaking (greeting)
– transfer of messages
– closure
• command/response interaction
– commands: ASCII text
– response: status code and phrase
• messages must be in 7-bit ASCII
10
Scenario: Alice sends message to
Bob
1) Alice uses UA to compose
4) SMTP client sends Alice’s
message over the TCP
connection
5) Bob’s mail server places the
message in Bob’s mailbox
6) Bob invokes his user agent to
read message
message and “to”
[email protected]
2) Alice’s UA sends message to
her mail server; message
placed in message queue
3) Client side of SMTP opens
TCP connection with Bob’s
mail server
1
user
agent
2
mail
server
3
mail
server
4
5
6
user
agent
11
Sample SMTP interaction
SMIT Client: C
S: 220 hamburger.edu
SMIT server: S
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <[email protected]>
S: 250 [email protected]... Sender ok
C: RCPT TO: <[email protected]>
S: 250 [email protected] ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
Sending message
C: .
S: 250 Message accepted for delivery
C: QUIT
Status code:
S: 221 hamburger.edu closing connection
Commands: HELO(HELLO), MAIL FROM,
RCPT TO, DATA, QUIT
220 Service Ready
250 OK
421 Service Not Available
12
SMTP Connection Setup
• Sender opens TCP connection to receiver
• Receiver acknowledges connection with
“220 Service Ready” or “421 Service Not
Available”
• If connection is made, sender identifies
itself with the “HELO” command
• Receiver accepts identification with “250
OK”
13
SMTP Mail Transfer
• MAIL command identifies originator, provides
reverse path for error reporting
• RCPT commands identify recipient(s) for
message
– Receiver has several positive or negative responses
to RCPT
– Sender will not send message until it is sure at least
one copy can be delivered
• DATA command transfers message
14
SMTP Connection Closing
• Sender sends a QUIT command to initiate
TCP close operation
• Receiver sends a reply to the QUIT
command, then initiates its own close
15
Single System E-Mail
16
Single System E-Mail
• Only allows users of a shared system to
exchange messages
• Each user has unique identifier and
mailbox
• Sending a message simply puts it into
recipients’ box
• Example: AOL
17
Multiple Systems E-Mail
18
Multiple Systems E-Mail
• Distributed system enables mail servers to
connect over a network to exchange mail
• Functions split
– User agent handles preparation, submission, reading,
filing, etc
– Transfer agent receives mail from user, determines
routing, communicates with remote systems
• Interconnection requires standards
19
Request For Comments
• Form the basis of the Internet's technical documentation.
• Conceptually, the Internet as a layered series of
protocols, each is documented by one or more RFCs.
• RFCs don’t change. Updates documented by new RFCs.
• Not all RFCs document protocols; Some for discussion,
informational purposes, April Fools' RFCs distinguished
by their date.
• There are more than 2000 RFCs in existence, dating
back to ARPANET in the 1970s.
• Most RFCs are available as large text files, with graphics
made out of typewriter characters.
http://www.freesoft.org/CIE/RFC/
20
Basic E-Mail Operation
• User creates message with user agent
program
– Text includes RFC 822 header and body of
message
– List of destinations derived from header
• Messages are queued and sent to SMTP
sender program running on a host
21
SMTP Mail Flow
• SMTP server transmits messages to appropriate
hosts via TCP
– Multiple messages to same host can be sent on one
connection
– Errors handling necessary for faulty addresses and
unreachable hosts
• SMTP protocol attempts to provide error-free
transmission, but does not provide end-to-end
acknowledgement
• SMTP receiver accepts messages, places it in
mailbox or forwards
22
Mail access protocols
user
agent
SMTP
SMTP
sender’s mail
server
access
protocol
user
agent
receiver’s mail
server
• SMTP: delivery/storage to receiver’s server
• Mail access protocol: retrieval from server
– POP: Post Office Protocol [RFC 1939]
• authorization (agent <-->server) and download
– IMAP: Internet Mail Access Protocol [RFC 1730]
• more features (more complex)
• manipulation of stored msgs on server
– HTTP: gmail, Hotmail, Yahoo! Mail, etc.
23
RFC 822
• Defines format for text messages via
electronic mail
• Used by SMTP as accepted mail format
• Specifies both envelope and contents
• Includes a variety of headers that can be
included in the message header lines
24
Mail message format
SMTP: protocol for
exchanging email msgs
RFC 822: standard for text
message format:
• header lines, e.g.,
– To:
– From:
– Subject:
different from SMTP
commands!
header
blank
line
body
• body
– the “message”, ASCII
characters only
25
SMTP: final words
• SMTP uses persistent connections
• SMTP requires message (header &
body) to be in 7-bit ASCII
• SMTP server uses CRLF.CRLF to
determine end of message
26
Question
• Why we are able to send emails with
attached image files?
RFC 822 was defined for sending ordinary
ASCII text, but not sufficiently rich for
multimedia messages, or for carrying nonASCII text formats( for example,
characters used by language other than
English)
27
Limitations of SMTP and
RFC822
• Cannot transmit executables or binary files
without conversion into text through nonstandard programs (e.g. UUENCODE)
• Cannot transmit diacritical marks
• Transfers limited in size
• Gateways do not always map properly between
EBCDIC and ASCII
• Cannot handle non-text data in X.400 messages
• Not all SMTP implementations adhere
completely to RFC821 (tabs, truncation, etc)
28
MIME (Multipurpose Internet
Mail Extensions)
• Intended to resolve problems with SMTP
and RFC822
• Specifies five new header fields, providing
info about body of message
• Defines multiple content formats
• Defines encodings to enable conversion of
any type of content into transferable form
29
MIME Header Fields
• MIME-Version: Indicates compliance with RFCs
1521 and 1522
• Content-Type: Describes data in sufficient detail
for receiver to pick method for representation
• Content-Transfer-Encoding: Indicates type of
transformation used to represent content
• Content-ID: Used to uniquely identify MIME
entities
• Content-Description: Plain text description for
use when object is not readable
30
Message format: multimedia extensions
• MIME: multimedia mail extension, RFC 2045,
2056
• additional lines in msg header declare MIME
content type
MIME version
method used
to encode data
multimedia data
type, subtype,
parameter declaration
encoded data
From: [email protected]
To: [email protected]
Subject: Picture of yummy crepe.
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
base64 encoded data .....
.........................
......base64 encoded data
31
HTTP Overview
• Stateless protocol
– TCP connection terminated as soon as
transaction completes
• Flexible in format handling
32
Web and HTTP
First some jargon
• Web page consists of objects
• Object can be HTML file, JPEG image, Java
applet, audio file,…
• Web page consists of base HTML-file which
includes several referenced objects
• Each object is addressable by a URL
• Example URL:
www.someschool.edu/someDept/pic.gif
host name
path name
33
HTTP overview
HTTP: hypertext
transfer protocol
• Web’s application layer
protocol
• client/server model
– client: browser that
requests, receives,
“displays” Web objects
– server: Web server
sends objects in
response to requests
• HTTP 1.0: RFC 1945
• HTTP 1.1: RFC 2068
PC running
Explorer
Server
running
Apache Web
server
Mac running
Navigator
34
HTTP overview (continued)
Uses TCP:
• client initiates TCP
connection (creates
socket) to server, port 80
• server accepts TCP
connection from client
• HTTP messages
(application-layer protocol
messages) exchanged
between browser (HTTP
client) and Web server
(HTTP server)
• TCP connection closed
HTTP is
“stateless”
• server maintains
no information
about past client
requests
Protocols that maintain “state”
are complex!
• past history (state) must be
maintained
• if server/client crashes, their
views of “state” may be
inconsistent, must be
reconciled
35
HTTP connections
Nonpersistent HTTP
• At most one object is
sent over a TCP
connection.
• HTTP/1.0 uses
nonpersistent HTTP
Persistent HTTP
• Multiple objects can
be sent over single
TCP connection
between client and
server.
• HTTP/1.1 uses
persistent
connections in default
mode
36
Nonpersistent HTTP
(contains text,
references to 10
Suppose user enters URL
www.someSchool.edu/someDepartment/home.index
jpeg images)
1a. HTTP client initiates TCP
connection to HTTP server
(process) at
www.someSchool.edu on port
80
2. HTTP client sends HTTP
time
request message (containing
URL) into TCP connection
socket. Message indicates
that client wants object
someDepartment/home.inde
x
1b. HTTP server at host
www.someSchool.edu
waiting for TCP connection
at port 80. “accepts”
connection, notifying client
3. HTTP server receives
request message, forms
response message
containing requested object,
and sends message into its
socket
37
Nonpersistent HTTP (cont.)
4. HTTP server closes TCP
5. HTTP client receives response
time
connection.
message containing html file,
displays html. Parsing html
file, finds 10 referenced jpeg
objects
6. Steps 1-5 repeated for each
of 10 jpeg objects
38
Non-Persistent HTTP: Response
time
Definition of RTT: time to
send a small packet to
travel from client to
server and back.
Response time:
• one RTT ( round-trip
time) to initiate TCP
connection
• one RTT for HTTP
request and first few
bytes of HTTP response
to return
• file transmission time
total = 2RTT+transmit time
initiate TCP
connection
RTT
request
file
RTT
file
received
time
time to
transmit
file
time
39
Persistent HTTP
Nonpersistent HTTP issues:
• requires 2 RTTs per object
• OS overhead for each TCP connection
• browsers often open parallel TCP connections to fetch
referenced objects
Persistent HTTP
• server leaves connection open after sending response
• subsequent HTTP messages between same
client/server sent over open connection
40
HTTP request message
• two types of HTTP messages: request, response
• HTTP request message:
– ASCII (human-readable format)
request line
(GET, POST,
HEAD commands)
GET /somedir/page.html HTTP/1.1
Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr
Carriage return,
line feed
indicates end
of message
(extra carriage return, line feed)
41
Uploading form input
Post method:
• Web page often
includes form input
• Input is uploaded to
server in entity body
URL method:
• Uses GET method
• Input is uploaded in
URL field of request
line:
www.somesite.com/animalsearch?monkeys&banana
42
Method types
HTTP/1.0
• GET
• POST
• HEAD
– asks server to leave
requested object out of
response
HTTP/1.1
• GET, POST, HEAD
• PUT
– uploads file in entity
body to path specified
in URL field
• DELETE
– deletes file specified in
the URL field
43
HTTP response message
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
HTTP/1.1 200 OK
Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html
data data data data data ...
44
HTTP response status codes
In first line in server->client response message.
A few sample codes:
200 OK
– request succeeded, requested object later in this message
301 Moved Permanently
– requested object moved, new location specified later in this
message (Location:)
400 Bad Request
– request message not understood by server
404 Not Found
– requested document not found on this server
505 HTTP Version Not Supported
45
HTTP Operation
46
HTTP Intermediate Systems
• Proxy
– Forwarding agent
– Security intermediary
– Different versions of HTTP
• Gateway
– Security intermediary
– Non-HTTP server
• Tunnel
– Relay point between two TCP connections
• Cache
– Facility storing previous requests and responses
47
Intermediate System Examples
48
SMTP and HTTP
• HTTP: pull
• SMTP: push
• both have ASCII
command/response interaction,
status codes
• HTTP: each object encapsulated in
its own response msg
• SMTP: multiple objects sent in
multipart msg
49
Session Initiation Protocol (SIP)
• Defined in RFC 3261
• Manages real-time sessions over IP data
network
• Intended to enable Internet telephony/VoIP
• Based on HTTP-like request/response
transaction model
• Five facets
–
–
–
–
–
User location
User availability
User capabilities
Session setup
Session management
50
SIP Components and Protocols
• Client/server elements
– Client sends/receives SIP messages
– Includes user agents, proxies
• Network elements
–
–
–
–
–
User agent (client/UAC, server/UAS)
Redirect server
Proxy server
Registrar
Location service
51
SIP Component Illustration
52
Session Description Protocol
•
•
•
•
•
•
Media Streams
Addresses
Ports
Payload types
Start and stop times
Originator
53
Summary
• SMTP - transmits messages to appropriate
hosts via TCP, attempts to provide error-free
transmission.
• MIME - Intended to resolve problems with
SMTP, provides info about body of message,
defines multiple content formats, and encodings
• HTTP - Stateless protocol, flexible format
handling, Proxy, Gateway, Tunnel, Cache
• SIP - Manages real-time sessions over IP,
enable Internet telephony/VoIP, HTTP-like
request/response transaction model
54
Topic 7 – Client Server and Intranet
Computing
Learning Objectives
• describe the features, characteristics and
architecture of client/server applications;
and
• define intranets and extranets.
55
What is Client/Server?
•
•
•
•
Client
Server
Network
How is client/server different from other
distributed computing?
– Heavy reliance on user-friendly applications
– Emphasis on centralizing databases and
management functions
– Commitment to openness/modularity
– Networking fundamental to operation
56
Client-Server Environment
57
Why is Client-Server Different?
• Emphasis on user-friendly client
applications
• Focus on access to centralized databases
• Commitment to open and modular
applications
• Networking is fundamental to the
organization
58
Client/Server Applications
• Emphasis on GUI for users
• Database Example
– Database on server, applications for access
on client, “glue” (like SQL) enables requests)
– Application logic can be client-only, or split
between client and server
59
Intranets
• Implementation of internet-based
client/server technology within an
organization, rather than for global
connectivity
• Immensely successful in corporate
computing contexts
60
Advantages of Intranets
•
•
•
•
Rapid prototyping
Scales effectively
Little training required
Can be implemented
on variety of systems
• Open architecture
allows interaction
across platforms
• Supports a range of
distributed servers
• Allows integration of
legacy systems on
client and server side
• Supports a range of
media types
• Inexpensive to
implement
61
The Intranet Web
• Web Content
– The web can be used to effectively distribute content
in a way that requires no new training for end-users
• Web/Database Connectivity
– Multiple tools exist to serve as middleware between
web servers and data sources
• Electronic Mail
• Network News
62
Web/Database Connectivity
63
Web/Database Connectivity
• Advantages
–
–
–
–
Ease of administration
Deployment
Development speed
Flexible information
presentation
• Disadvantages
– Limited functionality
– Stateless operation
makes tracking difficult
64
Intranet Disadvantages
• Long development cycles
• Difficulty in partitioning applications, and
modifying based on user feedback
• Effort in distributing upgrades to clients
• Difficult in scaling servers to respond to
increased load
• Continuous requirement for more powerful
desktop machines
65
Other Intranet Technologies
• Electronic Mail
– Closed internal mail systems (delivery
verification, etc)
– Internal mailing lists
• Network news (USENET)
– Can be adopted for internal intranet uses
66
The Extranet Web
• Extends the intranet concept to provide
information and services to selected
outside populations, such as customers
and suppliers
• Enables the sharing of information
between companies
• A TCP/IP enabled form of EDI
67
Advantages of Extranets
•
•
•
•
•
•
Reduced costs
More marketable products
Increased productivity
Enhanced profits
Reduced inventories
Faster time to market
68
Methods for Converting
Intranets to Extranets
• Long-distance dial-up access
• Internet access to intranet with security
• Internet access to an external server that
duplicates some of a company’s intranet data
• Internet access to an external server that
originates database queries to internal servers
• Virtual private network
69
Summary
• Client/server - user-friendly client applications,
centralized databases, open and modular
applications, the network is fundamental
• Intranet - internet-based client/server technology
within an organization, immensely successful
• Extranets – Extend intranet concept to outside
community, e.g customers and suppliers,
enables sharing of information between
companies, TCP/IP enabled form of EDI.
70