Lecture 2- Application Layer
Lecture 2- Application Layer
Networking
Applications areas
Without useful
networking
applications, there
would be no need
for networks !
network-core devices
do not run user
applications
applications on end
systems allows for Application Layer 2-5
Application architectures
possible structure of applications:
client-server
peer-to-peer (P2P)
clients:
communicate with
server
client/server may be intermittently
connected
may have dynamic IP
addresses
do not communicate
directly with each
other Application Layer 2-7
P2P architecture
no always-on server peer-peer
arbitrary end systems
directly communicate
peers request service
from other peers,
provide service in
return to other peers
self scalability –
new peers bring
new service
capacity, as well as
new service
demands
peers are
intermittently
connected and change
Application Layer 2-8
IP addresses
Processes communicating
process: program clients, servers
running within a client process:
host process that initiates
within same host, two communication
processes server process:
communicate using process that waits to
inter-process be contacted
communication
(defined by OS) aside: applications
processes in different with P2P architectures
hosts communicate have client processes
by exchanging & server processes
messages
transport transport
network network controlled
link
by OS
link Internet
physical physical
mail server
Application Layer 2-39
Electronic Mail: SMTP [RFC
2821]
uses TCP to reliably transfer email
message from client to server, port 25
direct transfer: sending server to
receiving server
three phases of transfer
handshaking (greeting)
transfer of messages
closure
command/response interaction (like
HTTP, FTP)
commands: ASCII text
response: status code and phrase
messages must be in 7-bit ASCI
Application Layer 2-40
Scenario: Alice sends message
to Bob
1) Alice uses UA to 4) SMTP client sends
compose message “to” Alice’s message over
[email protected] the TCP connection
2) Alice’s UA sends 5) Bob’s mail server
message to her mail places the message in
server; message Bob’s mailbox
placed in message 6) Bob invokes his user
queue agent to read message
3) client side of SMTP
opens TCP connection
with Bob’s mail server
1 user mail user
mail agent
agent server server
2 3 6
4
5
Alice’s mail server Bob’s mail server
Application Layer 2-41
Sample SMTP interaction
S: 220 hamburger.edu
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?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection
… …
example 2
host at cis.poly.edu 3
TLD DNS server
wants IP address 4
for
gaia.cs.umass.edu 5
example 2 3
7
recursive query: 6
puts burden of TLD DNS
server
name resolution
on contacted local DNS server
name server dns.poly.edu 5 4
heavy load at 1 8
upper levels of
authoritative DNS server
hierarchy? dns.cs.umass.edu
requesting host
cis.poly.edu
gaia.cs.umass.edu
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent