Application Layer

Protocols

Various applications communicate using different protocols used in application layer:

  • Web Apps: HTTP, HTTPS

  • Mails: POP, SMTP, IMAP

  • DNS, FTP, SSH, etc.

LayerApplication Layer
ProtocolsDNS, HTTP, FTP, SSH, ..
Data UnitMessage

IP Address

We learned previously that each server has an IP address.

  • It is very difficult to memorize the IP address.
  • Things get more complicated when, as users, we access various websites and services.
  • It becomes quite a challenge when the addresses of those services are dynamic.

Accessing Websites

URL - Uniform Resource Locator

Every object (image, html document) has a unique path (URL) on the web server

Domain Name

Domain Registrars

Domain Name Registrars manage the reservation of internet domain names.

DNS: Domain Name System

  • DNS is a global and highly distributed network service.

  • DNS is a translation service .

  • It resolves strings of letters into IP address.
  • IP Addresses of these servers may change, which will appropriately be updated.

DNS Server

There are five primary types of DNS servers:

  • Root Name Servers.

  • TLD Name Servers.

  • Authoritative Name Servers.

  • Caching Name Servers.

  • Recursive Name Servers.

  1. Root Name Servers redirect to appropriate TLD Name Server.

  2. TLD Name Server redirect to appropriate Authoritative Name Server for the domain.

  3. Authoritative Name Server gives the appropriate IP for the domain.

  4. Caching and Recursive Name Servers are provided by ISP. These reduce the load on the root, tld, authoritative name servers.

Root Server

  • Any domain name registered in the DNS is a domain name.
  • Domain names are organized in subordinate levels (subdomains) of the DNS root domain, which is nameless.

DNS Resolution

  • The first step is always to contact a root named server.

  • The root servers will respond to a local DNS server with the TLD name server that should be queried like (.in). For each TLD in existence, there is a TLD name server.

  • The TLD name servers will respond again to the Local DNS server with what authoritative DNS server(.ccbp.in) to contact.

  • The Local DNS server could be redirected at the authoritative server for ccbp.in which would finally provide the actual IP of the server in question.

Recursive & Caching Name Servers

  • Recursive name servers are ones that perform full DNS resolution requests.
  • Performs a fully recursive resolution to discover the correct IP for www.facebook.com. This involves a bunch of steps we'll cover in just a moment.

Since the domain name learning.ccbp.in had just been looked up, the local name server still has the IP that it resolved to stored and is able to deliver that back to your computer without having to perform a full lookup.

DNS

  • DNS uses UDP for the transport layer instead of TCP.

  • UDP is connectionless.

  • A single DNS request and its response can usually fit inside of a single UDP datagram.

DNS Record Types

  • DNS servers create a DNS record.

  • It provides important information about a domain or hostname, particularly its current IP address.
  • DNS record type allows for different kinds of DNS resolutions to take place.
Record TypeAbbreviationDescription
AAddress Mapping recordA record is used to point a certain domain name at a certain IPv4 IP address.
AAAAIP Version 6 Address recordA record is used to point a certain domain name at a certain IPv6 IP address.
CNAMECanonical Name recordA CNAME record is used to redirect traffic from one domain to another
MXMail exchanger recordMx record is used in order to deliver email to the correct server.
NSName Server recordsIt allows you to delegate the DNS of one of your subdomains to a different nameserver.
TXTText RecordTypically carries machine-readable data
Note
A single A record is configured for a single domain name. But, a single domain name can have multiple A records, too.

Web

Web is a "Client-Server Application".

  • A standard for document formats (HTML).

  • Web Browsers.

  • Web Servers.

  • Relies on HTTP, HTTPS application-layer protocols which rely on TCP.

Client-Server Architecture

  • In a client-server architecture, there is an always-on host, called the server, which services requests from many other hosts, called clients.
  • A classic example is the “Web application” for which an always-on Web server services requests from browsers running on client hosts.

Web Servers

  • They host Web objects, each addressable by a URL.

  • A Web server is always ON, with a fixed IP address.

  • 80 is default port used by a HTTP web server.

HTTP

Request & Response

  • The messages sent by the client usually a Web browser, are called requests.

  • The messages sent by the server as an answer are called responses.

Request

  • A HTTP request consists of a Request Header and a Request Body.

  • A Request Header contains various info like:

    • Host : (Example: developer.mozilla.org)

    • Method : (Example: GET).

    • Path : (Example: /).

    • HTTP version : (Example: HTTP/1.1).

HTTP Message Format - Request

HTTP Method

  • GET : retrieves data, like a blog article.

  • POST : creates data, like a new blog article.

  • PUT : replaces data, like an existing blog article.

  • DELETE : deletes data, like an existing blog article.

Response

HTTP Message Format - Response

HTTP Response Codes

  • A HTTP response of a Response Header and a Response Body.

  • A Response Header contains various info like:

    • Response Code : (1XX, 2XX, 3XX, 4XX, 5XX).

    • Content Type : (e.g.: text/html, image/png).

    • Content Length.

HyperText Transfer Protocol

Computer Networks

Transferring Data Over Network

  • The header (and footer) and the data together form the Protocol Data Unit (PDU) for the next layer.
  • The process continues until reaching the lowest-level layer (physical layer or network access layer), from which the data is transmitted to the receiving device.
  • The receiving device reverses the process, de-encapsulating the data at each layer with the header and footer information directing the operations.
  • Then the application finally uses the data.
  • The process is continued until all data is transmitted and received.

HTTPS Protocol

HTTP Secure Protocol encrypts the data between the Browser and Server.

  • Protects the privacy and security of the users.

  • Protects the integrity of the website.

  • Uses 443 port by default.

Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post

Contact Form