Download ch9

Document related concepts

Dynamic Host Configuration Protocol wikipedia , lookup

Server Message Block wikipedia , lookup

Airborne Networking wikipedia , lookup

Distributed firewall wikipedia , lookup

AppleTalk wikipedia , lookup

Deep packet inspection wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Lag wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

SIP extensions for the IP Multimedia Subsystem wikipedia , lookup

Remote Desktop Services wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Internet protocol suite wikipedia , lookup

Real-Time Messaging Protocol wikipedia , lookup

Hypertext Transfer Protocol wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Transcript
COM 360
1
Chapter 9
Applications
2
Applications
• Part network protocol (in the sense that they exchange
messages with their peers on other machines) and part
traditional application program in the sense that they
interact with the windowing system, the file system
and the user).
• Emphasized the system approach – the best way to
build effective network applications is to understand
the building blocks that the network can provide and
how those blocks can interact with each other.
• Applications might need their own protocols, too.
3
Traditional Applications
• Two most popular World Wide Web and
email.
• Domain Name System (DNS) – not
explicitly invoked by users, but an
application that all others depend upon.
• Network management – an application for
system administrators.
4
Applications
• Most use the request/reply paradigm- users
send requests to servers which respond.
• Distinguish between application programs and
application protocols.
• For example, HTTP is a protocol used to
retrieve programs from a web server, but there
can be many programs to do this (IE, Netscape,
Firefox, etc.) and they all use the same
protocol.
5
Application Protocols
• SMTP- Simple Mail Transfer Protocol – used to
exchange electronic mail.
• HTTP – Hypertext Transport Protocol – used to
communicate between web browsers and web
servers.
• DNS Domain Name System- used to query name
servers and send responses.
• SNMP- Simple Network Management Protocolused to query (and sometimes modify) the state of
remote network nodes.
6
Application Protocols
• Although many protocols are request/reply, they
are not all built on top of the RPC transport
protocol. Some of them are implemented on top
of TCP or UDP.
• Most protocols, except DNS, have a companion
protocol that specifies the format of the data that
can be exchanged.
• This is one reason that these protocols are
relatively simple.
7
Application Protocols
• SMTP is a protocol for exchanging email and RFC
822 and MIME ( Multipurpose Internet Mail
Extensions) define the format of the email messages.
• HTTP is a protocol for fetching web pages but the
HTML ( HyperText Markup Language) defines the
form of the pages.
• SNMP is a protocol for querying a network node but
MIB ( Management Information Base ) defines the
values that can be queried.
8
Electronic Mail
(SMTP,MIME,IMAP)
• How does email work?
• Distinguish between the user interface ( or mail reader) and the
message transfer protocol (SMTP)
• Distinguish between the transfer protocol and a companion
protocol (RFC 822 and MIME)
• RFC 822 defines email messages to have two parts: a header
and a body- both in ASCII
• MIME augments this to allow the message body to carry
different kinds of data – specifies how to convert binary data,
such as image files, to ASCII
• IMAP – Internet message Access Protocol – an application layer
protocol that allows users to retrieve email from a mail server.
9
Electronic MailMessage Transfer
• SMTP is the protocol used to transfer messages form one
host to another.
• Users interact with a mail reader, when they compose,
file, search and read email.
• There is a mail daemon (or process) running on each host,
which plays the role of post office. (The mail daemon on
most hosts is Unix sendmail.)
• Mail readers give the daemon messages they want to send,
the daemon uses SMTP running over TCP to transmit the
message to the daemon running on another machine, and
the daemon puts incoming messages into the user’s
10
mailbox (where user’s mail reader can find it).
Mail Gateways
Mail
reader
Mail gatew ay
Mail
daemon
Mail
daemon
SMTP/TCP
Mail
reader
Mail
daemon
SMTP/TCP
A sequence of mail gateways store and forward email messages.
Gateways are similar to IP gateways or routers, except they buffer
email on disks and try to transmit for several days.
11
Mail Reader
• User first retrieves messages from his/her mailbox, reads
them and replies to them and possibly saves a copy.
• User interacts with the mail reader, which reads and
writes the file that implements the mailbox.
• In other cases, the user accesses the mailbox from a
remote machine using another protocol such as the Post
Office Protocol (POP) or the Internet Message Access
Protocol (IMAP).
• IMAP is similar to SMTP in may ways.
12
Mail Reader and IMAP
• IMAP is a client/server protocol running over
TCP, where the client (on user’s desktop) issues
commands and the mail server (running on the
machine with the mailbox) responds.
• The exchange begins with the client
authenticating and then identifying the mailbox
to access.
13
Connection established
IMAP State
Transition Diagram
Server greeting
(1)
(2)
(3)
Not authenticated
(7)
(4)
Authenticated
(7)
(5)
(6)
Selected
(7)
Logout
Both sides close the connection
(1)
(2)
(3)
(4)
(5)
(6)
connection w ithout preauthentication (OK greeting)
preauthenticated connection (PREAUTH greeting)
rejected connection (BYE greeting)
successf ul LOGIN or AUTHENTICATE command
successf ul SELECT or EXA MINE command
CLOSE command, or f ailed SELECT or EXAMINE
command
(7) LOGOUT command, server shutdow n, or connection
14
closed
World Wide Web
• Think of the web as a set of cooperating clients
and servers, all using the same language: HTTP.
• Most are exposed to the web through a graphical
interface client program, or a web browser, like
Netscape, FireFox, Internet Explorer, or Opera
• A web browser has a function that allows a user to
open a URL, which provided information about
the location of objects on the web.
• Most web files contain images and text.
15
Web Browser
16
World Wide Web
• Request Messages- the first line specifies the
operation, the web page it is performed on, and the
version of HTTP. Most common are GET and
HEAD(fetch status information). See p.653
• Response Messages- The first line begins with version
number, a 3 digit code for success, and a text string
giving the reason for the response.
• Uniform Resource Identifiers-one type is the URL
that HTTP uses as addresses.
• TCP Connections- now allows client and server to
exchange multiple request/response messages.
17
World Wide Web
• Caching- one of the most active areas of Internet
research is how to effectively cache a web page.
• Caching has many benefits- from client’s perspective, a
page retrieved from nearby can be displayed more
quickly.
• From server’s perspective, having a cache intercept and
satisfy a request reduces the load on the server.
• Caching can be implemented in many different place.
• Cache needs to make sure it is not responding with an
out-of-date version of the page.
18
Name Services (DNS)
• Naming service used to map user-friendly addresses
into router-friendly addresses.
• Namespace-defines the set of possible names.
– Flat – not divisible into components
– Hierarchical – ( having a tree like-structure)
• Resolution mechanism is a procedure that can be
invoked with a name and will return a value.
• Name server implements a resolution mechanism and
can be queried by sending it a message.
19
Name Services
2
cs.princeton.edu
User
1
user @ cs.princeton.edu
Mail
program
Name
server
192.12.69.5
192.12.69.5
3
4
TCP
192.12.69.5
5
IP
Names translated into addresses, where the numbers 1-5
show the sequence of steps in the process.
20
DNS
• Internet has a well-developed naming
system- the domain name system (DNS).
• In mid-1980’s DNS was put into place.
• It uses a hierarchical namespace and the
table of name bindings is distributed
throughout the Internet.
21
Name Servers
• The complete domain name hierarchy exists only in the
abstract.
• How is the domain hierarchy implemented?
• First partitioned into sub-trees called zones,
corresponding to fundamental units.
• Information in each zone is implemented in two or
more servers for redundancy.
• Each name server is a program that can be accessed
over the Internet. Clients send queries to name servers,
which respond with the requested information.
22
Hierarchy of Name Servers
Root
name server
Princeton
Cisco
■■■
name server
CS
name server
■■■
name server
EE
name server
23
Domain Hierarchy
• DNS Implements a domain hierarchical namespace
for Internet objects.
• DNS names are processed from left to right with the
naming components separated with slashes.
• There are domains for each country and also the
“big six”: .com, .edu, .gov, .mil, .org, .net
• These were recently expanded by the addition of new
top-level domains such as .biz, coop, info, name,
museum, etc.
24
Example of A Domain Hierarchy
edu
princeton
cs
ee
■■■
com
mit
cisco
■■■
gov
yahoo nasa
■■■
mil
nsf
arpa
■■■
org
navy acm
■■■
net
uk
fr
ieee
physics
ux01 ux04
25
Domain Hierarchy Partitioned
into Zones
edu
princeton
mit
■■■
cs
ux01
ee
com
cisco
■■■
gov
yahoo
nasa
■■■
mil
nsf
arpa
■■■
org
navy
acm
■■■
net
uk
fr
ieee
physics
ux04
26
Naming Conventions
• Less technical conventions are used to decide the
names, for example all US Universities are under
the edu domain, while English universities are
under the ac (academic) domain of the UK (United
Kingdom).
• Organizations name their machines according to a
set of rules. Host names such as venus, mars, saturn
are among the most common.
• One site named its machines up, down, cracked and
rebooting, which led to confusion when they issued
messages such as “up is down” or “rebooting has
crashed”.
27
Name Resolution
• How does a client use a server to resolve a
domain name?
• For example: penguins.cs.princeton.edu
• First send a query to the root server, which
may respond with a match. If not, it then
sends to the IP host server, etc.
28
Name Resolution in Practice
2
u
.ed
n
to
1
cicada.cs.princeton.edu
Client
192.12.69.60
8
Local
name
server
Root
name
server
3
nce
.23
i
r
8
2
.p
3
6.1
.cs
9
a
1
d
.
a
28
cic
,1
u
d
n.e
o
t
4
nce
pr i
cicada.cs.princeton.edu
Princeton
name
cs.princeton.edu, 192.12.69.5 server
5
cic
ad
a.c
cic
s.p
a
19 da
rin
2.1 .cs
ce
2.6 .pr
ton
9.6 ince
.ed
6
0
u
ton
.ed
u,
CS
name
7
server
Numbers 1-10 show the sequence of steps in the process.
29
Network Management (SNMP)
• A network is a complex system with suites of
protocols running on many nodes.
• Even within a single domain there are many routers and
hundreds or thousands of hosts, with address translation
tables, routing tables, TCP connection states, etc.
• These all must be managed- to do this we use the
network to manage the network.
• SNMP is a specialized reply/request protocol
that supports two kinds of request messages:
GET and SET.
30
Network Management (SNMP)
• SNMP allows the administrator to interact with
a client program that displays information about
the network.
• SNMP runs on top of TCP
• An SNMP server locates the appropriate
information and returns it to the client program,
which displays it to the user.
• How does the client know what piece of
information to return? It uses MIB
31
MIB
• MIB- Management Information Base- defines
specific pieces of information – MIB
variables- that you can retrieve from a
network node.
• The current version MIB-II organizes
variables into 10 groups: system, interfaces,
address translation, IP, TCP, UDP, ICMP, EGP,
SNMP, and a group for different media
• MIB variables are either tables of structures.
32
Web Services
• Most of the applications previously examined
involve interactions between a human and a
machine.
• There is increasing demand for computer-tocomputer interaction and these also require
protocols.
• Many of these applications come from business
• Two architectures, called Web Services, have
been defined: SOAP and REST
33
Web Services
• SOAP- generates protocols that are customized to
each application- sort of a mass customization. It
includes a framework for protocols, software tools
kits, and modular specifications that can be
reused.
• REST regards individual web services as WWW
resources- identified by URLs and accessed via
HTTP. It is the web architecture.
34
Multimedia Applications
• Like the traditional applications, multimedia
applications, such as audio conferencing and
videoconferencing need their own protocols.
• Some of these original protocols came from
“MBone tools”- applications such as vat and vic
• The Real-time Transport Protocol (RTP) provides
many functions to multimedia applications.
• They also need a session control protocol – Session
Initiation Protocol (SIP) such as for IP telephone
calls and VoIP.
35
User Interface of a Vat
Audioconference
36
Protocol Stack for Multimedia
Applications using RTP
Application
RTP
UDP
IP
Subnet
37
RTP Header Format
V =2
P
X
CC
M
PT
Sequence number
Timestamp
Synchronization source (SSRC) identifier
Contributing source (CSRC) identif iers
Extension header
RTP payload
38
Padding of an RTP Packet
Length as carried in UDP header
UDP header
RTP header
RTP payload
Padding
Pad count
Pad count bytes
39
Session Directory
Displays information extracted from SDP messages.
40
SIP Proxies
cisco.com
prox y
bsd-pc.cisco.com
bruc [email protected]
princet on.edu
prox y
llp-ph. cs.prin ceton.edu
larry@pr inceton.ed u
Establishing communication through SIP proxies
41
Message Flow For Basic SIP
Session
bsd-pc.cisco.com
cisco.com
prox y
princet on.edu
prox y
llp-ph. cs.princet on.edu
in vite
100 trying
in vite
100 trying
in vite
180 ringing
180 ringing
200 OK
180 ringing
200 OK
200 OK
ACK
Medi a
BYE
200 OK
42
Devices in an H.323 Network
Conventional telephone
netw ork
H.323
gatekeeper
H.323
terminal
H.323
gatew ay
H.323
terminal
43
Overlay Network
Overlay network layered on top of a physical network
44
Overlay Nodes
IHdr
...
...
IHdr
A
IHdr
B
OHdr
IHdr
...
...
C
OHdr
IHdr
...
Overlay nodes tunnel through physical nodes.
45
Multicast Trees
A
5
5
C
5
D
50
R1
B
R2
5
(a)
A
C
R1
R2
B
D
(b)
A
C
R1
R2
B
D
(c)
A
C
R1
R2
B
D
(d)
46
Trees in Mesh
A
C
B
D
A
C
B
D
Multicast tree embedded in an overlay mesh.
47
Triangle inequality
10
70
125
Triangle inequality does not necessarily hold in networks.
48
Topology of a Peer-to-Peer
Network
49
Figure 9.23
2128 - 1
0
objid
nodeids
50
Figure 9.24
d471f1
d46a1c
d467c4
d462ba
d4213f
d13da3
65a1fc
locate(d46a1c)
51
Figure 9.25
Row0
0
x
1
x
2
x
3
x
4
x
Row1
6
0
x
6
1
x
6
2
x
6
3
x
6
4
x
Row2
6
5
0
x
6
5
1
x
6
5
2
x
6
5
3
x
6
5
4
x
Row3
6
5
a
0
x
6
5
a
2
x
6
5
a
3
x
6
5
a
4
x
5
x
7
x
8
x
9 a
x x
b
x
c
x
d
x
e
x
f
x
6 6
6 7
x x
6
8
x
6 6
9 a
x x
6
b
x
6
c
x
6
d
x
6
e
x
6
f
x
6
5
5
x
6
5
6
x
6
5
7
x
6
5
8
x
6
5
9
x
6
5
b
x
6
5
c
x
6
5
d
x
6
5
e
x
6
5
f
x
6
5
a
5
x
6
5
a
6
x
6
5
a
7
x
6
5
a
8
x
6
5
a
9
x
6
5
a
b
x
6
5
a
c
x
6
5
a
d
x
6
5
a
e
x
6
5
a
f
x
6
5
a
a
x
52
Figure 9.26
d471f1
d46a1c
d467c4
d462ba
d4213f
addnode(d46a1c)
d13da3
65a1fc
53
Figure 9.27
aaa.com
bbb.com
ccc.com
Backend
servers
Cache
Geographically
distributed
surrogate
servers
Redirectors
Cl ients
54