天天看点

Application Layer

1. Applications – The Interface Between the Networks

two programs access to the network: applications and services.

  • Applications

    are designed to interact with us. Application is software for the user.

    If the device is a computer, the application is typically initiated by

    the user. Although there may be many layers of support underneath, application software provides an interface between humans and the hardware. The application will initiate the data transfer process when the user presses the Send button, or a similar action.

  • Services

    are background programs that perform a particular function in the data

    network. Services are invoked by a device connecting to the network or

    by an application. For example, a network service can provide functions

    that transmit data or provide conversion of data in a network. In

    general, services are not directly accessible or seen by the end user.

    They provide the connection between an application and the network.

2. Application Layer

provides the interface between the applications we use to communicate and the underlying network over which our messages are transmitted.

3. Application layer protocols

used to exchange data between programs running on the source and destination hosts.

3.1 Application Layer Protocol Functions

    (1) Define Processes on either end of the communication

    (2) Define the types of message

    (3) Define the syntax of messages

    (4) Define the meaning of any informational fields

    (5) Define two messages are sent and the expected response

    (6) Define interaction with the next lower layer.

4. Network applications

  • Make communication in the workplace easier
  • Affect the amount of work completed on a daily basis
  • Reduce data communications time and costs

5. The Presentation layer has three primary functions:

  • Formats, or presents, data from the source device into a compatible form for receipt by the destination device. (Quick Time, MPEG, GIF JPEG, PNG)
  • Compression of the data in a manner that can be decompressed by the destination device.
  • Encryption of the data for transmission and the decryption of data upon receipt by the destination.

6. The Session Layer functions

This layer create and maintain dialog between source and destination applications. The Session layer handles the exchange of information to initiate dialog, keep them active, and to restart sessions that are disrupted or idle for a long period of time.

7. TCP/IP Application layer protocols:

  • DNS: resolve Internet names to IP addresses.  TCP/UDP 53
  • HTTP(Hypertext Transfer Protocol): transfer files that make up the Web pages of the World Wide Web.  TCP 80
  • SMTP(Simple Mail Transfer Protocol): the transfer of mail messages and p_w_uploads. TCP 25
  • POP(Post Office Protocol): used by email Clients to retrieve email from a remote server.
  • Telnet:a terminal emulation protocol, is used to provide remote access to servers and networking devices. TCP 23
  • FTP(File Transfer Protocol): interactive file transfer between systems. TCP 21/20
  • TFTP(Trivial File Transfer Protocol): connectionless active file transfer
  • DHCP: assign an IP address,subnet mask, default gateway, and DNS server address to a host.
  • BOOTP(Bootstrap Protocol): a precursor to the DHCP protocol.       Obtain IP address
  • IMAP(Internet Message Access Protocol): another protocol for email retrieval

8. Application Layer Protocols and Services Examples

8.1 DNS Format

Application Layer

DNS is a client/server service; mapping name-to-IP address for internal hosts & forwarding name resolution requests between servers . Computer operating systems also have a utility called nslookup that allows the user to manually query the name servers to resolve a given host name.

A DNS server provides the name resolution using the name daemon, which is often called named

The DNS server stores different types of resource records used to resolve names. These records contain the name, address, and type of record. Some of these record types are:

  • A - an end device address
  • NS - an authoritative name      server
  • CNAME - the canonical name(or Fully Qualified Domain Name) for an alias; used when multiple      services have the single network address but each service has its own entry in DNS
  • MX - mail exchange record;      maps a domain name to a list of mail exchange servers for that domain

The ipconfig /displaydns command displays all of the cached DNS entries on a Windows XP or 2000 computer system.

The Domain Name System uses a hierarchical system to create a name database to provide name resolution.

8.2 WWW Service and HTTP

  • HTTP specifies a      request/response protocol. When a client, typically a web browser, sends      a request message to a server, the HTTP protocol defines the message      types the client uses to request the web page and also the message types      the server uses to respond. The three common message types are GET, POST,      and PUT.

GET is a client request for data. A web browser sends the GET message to request pages from a web server.

POST and PUT are used to send messages that upload data to the web server.

  • HTTPS(HTTP      Secure): can      use authentication and encryption to secure data as it travels between      the client and server.

8.3 E-mail Services and SMTP/POP Protocols

  • SMTP is used to send mail from the client to the server but POP3 is used to download mail from the server to the client.
  • The e-mail client processes:

    Mail User Agent (MUA) : an application that is used to compose email messages. These messages are then sent to MTA which sends it to the MDA  for delivery to the destination.

    if the mail is addressed to a user whose mailbox is on the local server, the mail is passed to the MDA. If the mail is for a user not on the local server, the MTA routes      the email to the MTA on the appropriate server.

    The Mail Transfer Agent (MTA) process is used by an email server to forward email messages destined to other email servers. The MDA process is used by the email   server to deliver an email message to the mailbox that is hosted on the      server. The MUA is an email client that allows a user to compose or read      email. The POP3 is a protocol that is used by an email client to retrieve      messages from the email server.

Some of the commands specified in the SMTP protocol are:

  • HELO - identifies the SMTP      client process to the SMTP server process
  • EHLO - Is a newer version of      HELO, which includes services extensions
  • MAIL FROM - Identifies the      sender
  • RCPT TO - Identifies the      recipient
  • DATA - Identifies the body      of the message

IMAP and POP are protocols that are used to retrieve email messages. The advantage of using IMAP instead of POP is that when the user connects to an IMAP-capable server, copies of the messages are downloaded to the client application. IMAP then stores the email messages on the server until the user manually deletes those messages.  

The destination email server may be offline or busy when email messages are sent. In either of these cases, SMTP spools messages to be sent at a later time. Periodically, the server checks the queue for messages and attempts to send them again. The message is returned to the sender as undeliverable if it is still not delivered after a predetermined expiration time.

8.4 FTP

  • The client establishes the first connection to the server on TCP port 21. This connection is used forcontrol traffic, consisting of client      commands and server replies.
  • The client establishes the second connection to the server over TCP port 20. This connection is for theactual file transfer and is created every time there is a file      transferred.
  • An FTP server runs an FTP daemon, which is a program that provides FTP services. End users who request services must run an FTP client program.

8.5 DHCP(Dynamic Host Configuration Protocol)

DHCP service enables devices on a network to obtain IP addresses and other information from a DHCP server. This service automates the assignment of IP addresses, subnet masks, gateway and other IP networking parameters.

DHCP is used for general purpose hosts such as end user devices, and fixed addresses are used for network devices such as gateways, switches, servers and printers.

  • DHCP Discover: is used to any available DHCP server on a network.
  • DHCP Offer: is used to acknowledge that the lease is successful.
  • DHCP Request: is used to identify the explicit server and lease offer to accept.
  • DHCP Acknowledge: is used to suggest a lease to a client.

When a host configured to use DHCP powers up on a network it sends a DHCPDISCOVER message. FF-FF-FF-FF-FF-FF is the L2 broadcast address. A DHCP server replies with a unicast DHCPOFFER message back to the host.

8.6 File Sharing Services and SMB Protocol

SMB (Server Message Block) is a client/server file sharing protocol. request-response protocol

SMB messages can:

  • Start, authenticate, and terminate sessions
  • Control file and printer access
  • Allow an application to send or receive messages to or from another device

IBM developed SMB to describe the structure of shared network resources. Unlike the file sharing supported by FTP, clients establish a long term connection to servers. SAMBA was originally developed by Andrew Tridgell to provide file and print services for various Microsoft Windows operating systems, as well as for UNIX and UNIX-like systems (Linux, Solaris, AIX, Mac OS X 10.2 and above, etc.)  When downloading large numbers of files from the same server it be more efficient to use SMB to transfer files instead of FTP.

8.7 Telnet Services and Protocol

Telnet is a client/server protocol and it specifies how a VTY session is established and terminated.

Each Telnet command consists of at least two bytes. The first byte is a special character called the Interpret as Command (IAC) character.

Some sample Telnet protocol commands include:

  1. Are You  There (AYT) - Lets the user request that something appear on the terminal      screen to indicate that the VTY session is active.
  2. Erase Line (EL) - Deletes      all text from the current line.
  3. Interrupt Process (IP) -      Suspends, interrupts, aborts, or terminates the process to which the      Virtual Terminal is connected. For example, if a user started a program      on the Telnet server via the VTY, he or she could send an IP command to      stop the program.