Monday 9 September 2019

Application Layer Protocols and Services

Application Layer Protocols and Services

In this article we will learn about application layer protocols and services . We will see how each of them works. Following is the list of most popular protocols of this layers:

TCP / IP application layer protocols table
ProtocolDescription
File Transfer Protocol (FTP)It is used for interactive transfer of connection-oriented files, requires ACK. TCP 20, 21
Trivial File Transfer Protocol (TFTP)It is used for simple and offline file transfer. UDP 69
Simple Mail Transfer Protocol (SMTP)It is used to transfer (send) messages and email attachments. TCP 25
Post Office Protocol (POP)It is used by email clients to retrieve and download email from a remote server. TCP 110
Internet Message Access Protocol (IMAP)Another protocol for retrieving email stored on a server. It keeps the messages on the server. TCP 143
Domain Name Service Protocol (DNS)It is used to resolve Internet names in IP addresses. TCP, UDP 53
Telnet: terminal emulation protocolIt is used to provide remote access to servers and network devices. TPC 23
Bootstrap Protocol (BOOTP)a precursor to the DHCP protocol. Network protocol used to obtain IP address information during startup. UDP 68 CUSTOMER, UDP 67 SERVER
Dynamic Host Configuration Protocol (DHCP)It is used to assign an IP address, a subnet mask, a default gateway and a DNS server to a host. UDP 68 CUSTOMER, UDP 67 SERVER
Hypertext Transfer Protocol (HTTP)It is used to transfer files that make up the Web pages of the World Wide Web. TCP 80, 8080
Safe Hypertext Transfer Protocol (HTTPS)The browser uses encryption to protect HTTP communications, authenticates the website. TCP, UDP 443

HTTP and HTML

When you type a web address or a uniform resource locator (URL) in a web browser, the browser establishes a connection to the web service that runs on the server using the HTTP protocol.

URL example: https://ccnacompletecourse.blogspot.com

First, the browser interprets the three parts of the URL:
  • https (the protocol or scheme)
  • ccnacompletecourse.blogspot.com (the name of the server)
Through the requirements of the HTTP protocol, the browser sends a GET request to the server and requests the file.

HTTP AND HTTPS

HTTP is a request / response protocol. When a client, usually a web browser, sends a request to a web server, HTTP specifies the types of messages that are used for that communication. The three types of common messages are GET, POST and PUT.
  1. GET is a request for data from the client. A web browser sends the GET message to the web server to request the HTML pages
  2. POST and PUT are used to send messages that upload data to the Web server.
Although HTTP is extremely flexible, it is not a secure protocol. In summary:
  • HTTP is not secure. The messages can be intercepted.
  • HTTPS uses authentication and encryption to secure data.

EMAIL PROTOCOLS 

  • Email is a storage and shipping method used to send, store and retrieve electronic messages.
  • Email messages are stored on mail servers.
  • Email clients communicate with email servers to send and receive email messages.
  • Mail servers communicate with other mail servers to transport messages from one domain to another.
  • Email depends on three separate protocols to work: SMTP, POP and IMAP.

SMTP OPERATION

SMTP message formats need a header and a message body. While the body of the message can contain the desired amount of text, the header must have a properly formatted recipient email address and a sender address.

When a client sends email, the client's SMTP process connects to a server's SMTP process on the well-known port 25 . After the connection is established, the client tries to send the email to the server through it. Once the server receives the message, it locates it in a local account (if the recipient is local) or forwards it to another mail server for delivery. The destination mail server may be disconnected or busy. In these cases, the SMTP queues the messages to send them later. The server periodically checks the queue for messages and tries to send them again. If the message has not yet been delivered after a predetermined expiration time, it will be returned to the sender as impossible to deliver.

POP OPERATION

POP is used by an application to retrieve email from a mail server. With POP, mail is downloaded from the server to the client and then deleted on the server. POP works this way, by default. POP3 is desirable for ISPs, as it lightens their responsibility for handling large amounts of storage for their email servers. The server starts the POP service by passively listening to client connection requests on TCP port 110 . When a client wishes to use the service, it sends a request to establish a TCP connection with the server. Once the connection is established, the POP server sends a greeting. Next, the client and the POP server exchange commands and responses until the connection is closed or canceled.

IMAP OPERATION

IMAP is another protocol that describes a method to retrieve email messages. Unlike POP, when the user connects to a server with IMAP capability, copies of the messages are downloaded to the client application . The original messages are kept on the server until they are manually deleted. Users see copies of the messages in their email client software.

Users can create a hierarchy of files on the server to organize and save mail. This file structure is also duplicated in the email client. When a user decides to delete a message, the server synchronizes that action and deletes the message from the server.

DYNAMIC HOST CONFIGURATION PROTOCOL (DHCP)

  • Dynamic Host Configuration Protocol (DHCP) allows a host to obtain an IP address dynamically.
  • The DHCP server is contacted and the address is requested; it chooses the address of a configured address range called "pool" and is granted to the host for a set period.
  • The addresses are returned to the pool for reuse when they are no longer in use.
  • DHCP is used for general-purpose hosts, such as devices for end users; Static addressing is used for network devices such as gateways, switches, servers and printers.

DHCP OPERATION

  • The client transmits a DHCPDISCOVER message whose destination is broadcast (L2 FF-FF-FF-FF-FF-FF and L3 255.255.255.255), to identify any DHCP server available on the network.
  • This request reaches all PCs on the Network but only the DHCP server responds to the host with a DHCPOFFER message.
  • The client sends a DHCPREQUEST message to the server that it wishes to use (in the case of several offers).
  • A client can also request an address previously assigned by the server.
  • The server returns a DHCPACK message to confirm that the grant has ended.

FILE TRANSFER PROTOCOL (FTP)

FTP is another application layer protocol that is commonly used:

  • An FTP client is an application that runs on a client computer and is used to insert and extract data on an FTP server.
  • FTP requires two connections between the client and the server: one for commands and responses (TCP port 21), and another for file transfer (TCP port 20) itself.
  • The client can download (extract) data from the server or upload (insert) data to the server.

SERVER MESSAGE BLOCK (SMB)

  • SMB is a client / server file exchange protocol.
  • All SMB messages share the same format.
  • Printing and file sharing services from SMB became the mainstay of Windows networks.
  • Microsoft products now support TCP / IP protocols to directly support the sharing of SMB resources.
  • Mac, LINUX and UNIX operating systems have their own SMB implementation.
  • After establishing the connection, the client user can access the resources on the server as if the resource were local to the client host.
SMB messages can:
  • Start, authenticate and end sessions
  • Control access to files and printers
  • Authorize an application to send or receive messages to or from another device

DOMAIN NAME SERVICE (DNS)

Domain names were created to convert numerical addresses into a simple and recognizable name. Of course, it is simpler to work with domain names than with IP numbers; In addition, if the IP address is changed, the end user does not need to know about the change.

DNS MESSAGE FORMAT

The DNS server stores different types of resource records used to resolve names. These records contain the name, address and type of record. The common DNS records are:
  • A : an IPv4 terminal address
  • NS : an authoritative name server
  • AAAA : a terminal IPv6 address
  • MX : a mail exchange record
  • DNS servers search their own records first, and relay the client's request to other servers if they cannot resolve it. Then the answer is forwarded to the client.
The ipconfig / displaydns command in Windows shows all DNS stored in the cache.

 DNS HIERARCHY

The DNS protocol uses a hierarchical system to create a database that provides name resolution. The hierarchy is similar to an inverted tree with the root at the top and the branches below

Top-level domains represent the type of domain or country of origin.

Examples of top-level domains are .com, .org, .au and .co. In the DNS hierarchy, top-level domain servers (.com, .gov, .edu) contain records of second-level domain servers. The second level domain name server (cisco.com, etc.) is an authoritative DNS server, since it keeps all the records of the cisco company.

No comments:

Post a Comment