The Application Layer
The application layers provides applications with access to the communications environment. A network-enabled application will create a user interface as well as interfacing with application layer network protocols.
A protocol in this layer defines the format and order of the messages exchanged by the application. This sets up a virtual connection between the hosts at the application layer. The protocol will define the actions it takes as a result of sending a message or receiving a message - and how to use the relevant lower layer transport layer protocol.
Messages in the protocol will have to be clearly defined, with defined message types, semantics and rules for message exchange. Some protocols are public domain, such as SMTP and HTTP and are documented and governed by an international body. Other protocols are proprietary, and may or may not conform to general standards and may or may not be publicly documented.
In order to send a message, the message must be addresses to the correct remote host. The message is addresses with the IP address of the remote host, and the port number associated with the receiving process (such as 80 for HTTP, 25 for SMTP etc)
A port is viewed as a specific place for a connection to some device, on a physical device this is a physical connection - such as a parallel port for connecting a printer - however in programming a port is more of a logical construct, a way of identifying what sort of process a network communication is aimed at (for example, a web server will listen for connections on port 80, and a web browser knows to direct requests for web content to port 80 on remote hosts - regardless of the exact web server software or hardware being used).
A socket is a connection endpoint within a port, each port can have a single incoming passive socket awaiting new connections, and multiple active sockets each corresponding to open connections on those ports (so more that one communication can be going through a single port at a time).
Domain Name Server (DNS)
DNS is a hierarchical, domain based naming scheme, it is stored as a distributed database system, and allows the mapping of host names and e-mails to actual IP addresses. In practice, this works by following the steps below:
- An Application program calls a library procedure called the resolver, passing the DNS name as a parameter.
- The resolver sends a UDP packet to a local DNS server.
- The local DNS server looks up the name and returns the IP address to the resolver (by checking for a resource record (RR) identifying the host. If the local DNS server does not have the correct record, it begins an upstream search of its parent DNS servers until it finally gets a record.
- The resolver returns it to the calling application
- The program then uses the IP address to establish a TCP/UDP connection with the destination host.
ICANN maintain the DNS structure, and it is tightly regulated with different top level domains assigned to countries or for specific purposes.
MIME Types
MIME, or Multipurpose Internet Mail Extensions, are a way of identifying the type of content which a communication contains. For example, the mime type "text/plain" means that the communication is just unformatted plain text, while type "image/jpeg" means that a jpeg file is being sent. The MIME type allows the browser or e-mail client to correctly display the data for the user - potentially calling a necessary plugin or helper application from its mime type table if necessary..
References:
- Janet Lavery - Durham University Computer Systems, Introduction to Networks Lecture 3, 2007
- Janet Lavery - Durham University Computer Systems, Introduction to Networks Lecture 4, 2007
- A2 Computing Revision - Paul Nicholls - http://resources.r9paul.org/ASA2/Computing/A2ComputingRevision.pdf

October 28th, 2008 - 18:19
Interesting to know.