Unit-2:: Application Layer Part-2
Unit-2:: Application Layer Part-2
Application Layer
Part-2
Authorization Recommendations
Use of Cookies
User session state
Shopping carts (Web, Email)
client server
HT proxy
TP
server q u est
r equ re
HT P
client TP est
HT
T
p o nse
res res origin
pon TP
se HT server
t
ues
req se
TP o n
HT res
p
TP
HT
client origin
server
Web Caches (Proxy Server) – Cont...
A user’s browser can be configured so, user’s HTTP requests are first directed to the Web
Cache.
A browser sends all HTTP requests to cache.
As an example, suppose a browser is requesting the object
http://www.someschool.edu/campus.gif
Object in cache returns to client browser.
Otherwise cache requests object from origin server, then returns object to client browser.
Reduce response time for client request.
Reduce traffic on an institution’s access link.
Internet dense with caches: Insufficiency for content providers to effectively deliver content.
Web Caches (Proxy Server) – Example
Example: Institutional Network and Internet
Reduce response time for client request.
Reduce traffic on an institution’s access link.
Internet dense with caches: Insufficiency for
content providers to effectively deliver
content.
FTP (FILE TRANSFER PROTOCOL)
FTP (File Transfer Protocol)
File Transfer Protocol (FTP) is the commonly used protocol for exchanging files over the
Network or Internet.
Example: Filezilla
FTP uses the Internet's TCP/IP protocols to enable data transfer.
FTP uses client-server architecture.
FTP promotes sharing of files via remote computers with reliable and efficient data transfer.
POP3
Post Office Protocol – Version 3
IMAP
Internet Mail Access Protocol
A mail access protocol, such as POP3, is used to transfer mail from the recipient’s mail server
to the recipient’s user agent.
POP3 – Post Office Version 3
POP3 is an extremely simple mail access protocol.
With the TCP connection established, POP3 progresses through three phases: authorization,
transaction and update.
In authorization, the user agent sends a username and a password to authenticate the user.
In transaction, the user agent retrieves messages, mark messages for deletion, remove
deletion marks and obtain mail statistics.
In update, after the quit command by client, ending the POP3 session; the mail server
deletes marked messages.
POP3 is designed to delete mail on the server as soon as the user has downloaded it.
IMAP - Internet Mail Access Protocol
To keeps all messages in one place: at server
The recipient can then move and organize the message into a new, user-created folder, read
the message, delete the message, move messages from one folder to another and so on.
To allow users to search remote folders for messages matching specific criteria.
Also permit a user agent to obtain components of messages, When low-bandwidth
connection between the user agent and its mail server.
In this case, user not to download all the messages in its mailbox, particularly avoiding long
messages like an audio or video clip.
DNS - DOMAIN NAME SYSTEM
DNS - Domain Name System
DNS client wants to determine the IP address for the hostname www.amazon.com
The client first contacts one of the root servers, which returns IP addresses for TLD servers -
top-level domain .com.
Then contacts TLD servers, which returns the IP address of an authoritative server for
www.amazon.com
Finally, contacts one of the authoritative servers for www.amazon.com, which returns the IP
address for the hostname www.amazon.com.
DNS: A distributed - hierarchical database
Root DNS Servers – Total 13
DNS – Cont…
Top-level domain (TLD) servers:
It is responsible for com, org, net, edu, aero, jobs, museums, and all top-level country domains, e.g.: uk,
fr, ca, jp
Network Solutions maintains servers for .com TLD
Education for .edu TLD
Authoritative DNS servers:
To organization’s own DNS servers, providing authoritative hostname to IP mappings for organization’s
named hosts.
It can be maintained by organization or service provider.
Local DNS name servers:
It does not strictly belong to hierarchy
when host makes DNS query, query is sent to its local DNS server.
It acts as proxy, forwards query into hierarchy.
DNS - Example
DNS Name Resolution Example
Iterated Query: root DNS server
A host at cis.poly.edu wants IP address for
gaia.cs.umass.edu
2
3
TLD DNS server
4
gaia.cs.umass.edu
2 3
7
6
TLD DNS
server
1 8
gaia.cs.umass.edu
Prof. Maulik D. Trivedi #3150710(CN) Unit 2 – Application Layer
DNS – Cont...
Distributed database design is more preferred over centralized design to implement DNS in
the Internet.
A single point of failure: If the DNS server crashes then the entire Internet will not stop.
Traffic volume: With millions of device and users accessing its services from whole globe at
the same time.
A Single DNS Server cannot handle huge DNS traffic but with distributed system its
distributed and reduce overload on server.
Distant centralized database: A single DNS server cannot be “close to” all the querying
clients.
If it is in New York City, then all queries from Australia must travel to the other side of the globe, perhaps
over slow and congested links cause significant delays.
Maintenance: To keep records for all Internet hosts. it would have to be updated frequently
to account for every new host.
SOCKET PROGRAMMING
Socket Programming
Socket is interface between application and network.
An application creates a socket.
Two type of socket:
TCP Socket – Reliable Transmission
UDP Socket – Unreliable Transmission
Once configured the application can pass data to the socket for transmission and receive
data from the socket (transmitted through the network by some other host).
application application
socket controlled by
process process app developer
transport transport
network network controlled
link
by OS
link Internet
physical physical
Type of Socket
SOCK_STREAM SOCK_DGRAM
E.g. TCP E.g. UDP
Reliable delivery Unreliable delivery
In-order guaranteed No order guarantees
Connection-oriented Connection-less
Bidirectional Unidirectional
App D1
App
3 2 3 2
1 D2
socket Dest. 1 socket
D3
Client-Server socket interaction: UDP
write reply to
serverSocket read datagram from
specifying clientSocket
client address,
port number close
clientSocket
Client-Server socket interaction: TCP
Thank
You