application layer protocols - university of...

29
Principles of network applications Web and HTTP DNS (Domain Name System) Application Layer Protocols Dr. Ihsan Ullah Department of Computer Science & IT University of Balochistan, Quetta Pakistan Email: [email protected] These slides are adapted from the slides accompanying the text: Computer Networking: A Top-Down Approach 6th ed., J.F Kurose and K.W. Ross, All Rights Reserved June 22, 2015 1 / 29

Upload: others

Post on 29-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Principles of network applications Web and HTTP DNS (Domain Name System)

Application Layer Protocols

Dr. Ihsan Ullah

Department of Computer Science & ITUniversity of Balochistan, Quetta

PakistanEmail: [email protected]

These slides are adapted from the slides accompanying the text: ComputerNetworking: A Top-Down Approach 6th ed., J.F Kurose and K.W. Ross, All

Rights Reserved

June 22, 2015

1 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Outline

1 Principles of network applications

2 Web and HTTP

3 DNS (Domain Name System)

2 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Creating Network applications

• Programs that run ondifferent hosts and

• communicate over network

• example: web server andweb browser

• No user applications fornetwork core

• Rapid applicationdevelopment

3 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Network application architecture

Network application can be broadly classified into two categoriesbased on their architecture

• Client-server

• Peer-to-peer (P2P)

4 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Client-server architecture

• Server run server process

• Client run client process

• Client process initiatescommunication

• Server process waits to becontacted

• No client to clientcommunication

• Server is always on

• Clients intermittentlyconnect

• Centralized architecture

5 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

P2P architecture

• Decentralized architecture

• End-hosts (peers) containboth client & serverprocesses

• Self-scalability: new peersbring new service capacity aswell as new service demands

• Highly dynamic: End-hostsarrive and depart freely

• Complex management

6 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Process communication over a network

• Program running within a host is called a process

• Two processes on different hosts need to identify each otherfor communication

• IP address and port number pair (socket) identifies a processover a network

• IP address uniquely identifies a host on a network and a portnumber uniquely identifies a network process within a host

• Processes send/receive messages to/from sockets

• Processes rely on transport infrastructure to deliver messagesto destination process

7 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Application layer protocol defines

• Types of messages exchanged– Request, response

• Message syntax– Fields in messages & how they are delineated

• Message semantics– meaning of information in fields

• Rules for when and how processes send & respond to messages

• Open protocols: Defined in RFCs (HTTP, SMTP)

• Proprietary protocols: Specifications not revealed (Skype)

8 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Transport services required by applications

9 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Outline

1 Principles of network applications

2 Web and HTTP

3 DNS (Domain Name System)

10 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Web page

• Consists of objects:– HTML file, JPEG image, java applet, audio file ...

• Web page has a base HTML file which include references toseveral objects

• Each object is addressable by a url:– www.someschool.edu/someDept/pic.gif

host name path name

11 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

HTTP: HyperText Transfer protocol

• Web’s application layerprotocol

• Client/server model• client: Browser that

requests, receives, anddisplays Web objects

• server: Web server sendsobjects in response torequests

12 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

HTTP: HyperText Transfer protocol

• Uses TCP as transport layer protocol

• Client initiates TCP connection (creates socket) to server atport 80

• Server accepts TCP connection from client

• HTTP 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

• Statefull protocols are complex: Maintaining past history,keeping consistent views

13 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Persistent vs. non-persistent connections

Non-persistent HTTP

• After TCP connection is established between client and server,at most one object is sent over the connection by server andthen the connection is closed

• Downloading multiple objects require multiple connections

Persistent HTTP

• Multiple objects can be sent over single TCP connectionbetween client and server

14 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

HTTP request message

• HTTP uses two types of messages: request and response

• Both messages are in ASCII (human readable format)

15 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

HTTP request message

• General format

16 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

HTTP response message

17 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Outline

1 Principles of network applications

2 Web and HTTP

3 DNS (Domain Name System)

18 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS (Domain Name System)

• A directory service that translates host names to IP addresses

• Implemented as a distributed database implemented in ahierarchy of DNS servers

• An application-layer protocol that allows hosts to query thedistributed database

• DNS servers are often UNIX machines running the BerkeleyInternet Name Domain (BIND) software

• Runs over UDP and uses port 53

• DNS is commonly employed by other application-layerprotocols such as HTTP, SMTP, FTP

19 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS services

• hostname to IP address translation

• host aliasing–canonical, alias names

• mail server aliasing

• load distribution–replicated Web servers: many IP addresses correspond to onename

20 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS: a distributed hierarchical database

21 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS root name servers

• contacted by local name server that cannot resolve name

• root name server:• contacts authoritative name server if name mapping not known• gets mapping• returns mapping to local name server

22 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

TLD, Authoritative servers

Top-level domain (TLD) servers

• Responsible for com, org, net, edu, aero, jobs, museums, andall top-level country domains, e.g. uk, fr

• Network Solutions maintains servers for .com TLD

• Educause for .edu TLD

Authoritative DNS servers

• Organization’s own DNS server(s), providing authoritativehostname to IP mappings for organization’s named hosts

• Can be maintained by organization or service provider

23 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS name resolution

• host at cis.poly.edu wants IPaddress forgaia.cs.umass.edu

• Iterated query:–contacted server replieswith name of server tocontact–“I dont know this name,but ask this server”

24 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS name resolution

Recursive Query

• Puts burden of nameresolution on contactedname server

• Heavy load at upper levelsof hierarchy

25 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS caching

• Once (any) name server learns mapping, it caches mapping• Cache entries timeout (disappear) after some time (TTL)• TLD servers typically cached in local name servers

– thus root name servers not often visited

• Cached entries may be out-of-date (best effortname-to-address translation)–if name host changes IP address, may not be knownInternet-wide until all TTLs expire

• update/notify mechanisms proposed IETF standard (RFC2136)

26 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS recordsDNS: distributed database storing resource records (RR)RR format: (name, value, type, TTL)

type=A

• name is hostname

• value is IP address

• (relay1.bar.foo.com,145.37.93.126, A)

type=NS

• name is domain name

• value is hostname ofauthoritative nameserver for this domain

• (foo.com,dns.foo.com, NS)

type=CNAME

• name is alias name for somecanonical (the real) name

• value is canonical name

• (foo.com, relay1.bar.foo.com,CNAME)

type=MX

• value is name of mailserverassociated with name

• (foo.com, mail.bar.foo.com, MX)

27 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

DNS message format

• Uses the same message format for both query and replymessages

28 / 29

Principles of network applications Web and HTTP DNS (Domain Name System)

Inserting records into DNS

• example: new startup “EduOnline”

• register name eduonline.com at DNS registrar (e.g., NetworkSolutions)

• provide names, IP addresses of authoritative name server• registrar inserts two RRs into .com TLD server:(eduonline.com,

dns1.eduonline.com, NS)(dns1.eduonline.com, 191.14.12.1, A)

29 / 29