Docsity

Mobile communication system, Schemes and Mind Maps of Mobile Communication Systems

Partial preview of the text

Download Mobile communication system and more Schemes and Mind Maps Mobile Communication Systems in PDF only on Docsity!

ECE 303 Communication

Networks

Chapter 3

Application Layer

DR. SHUVABRATA BANDOPADHAYA

BANASTHALI 2 Application Layer For a network application's software/ process is distributed among two or more end systems (i.e., host computers). For example, with the Web there are two pieces of software that communicate with each other:

  1. Browser software in the user's host (PC, Mac or workstation), and
  2. Web server software in the Web server. Processes on two different end systems communicate with each other by exchanging messages across the computer network.
  3. A sending process creates and sends messages into the network;
  4. A receiving process receives these messages and possibly responds by sending messages back. Networking applications have application-layer protocols that define the format and order of the messages exchanged between processes, as well as the actions taken on the transmission or receipt of a message.

BANASTHALI 4 Ex 2  (^) Internet electronic mail has many components, including mail servers that house user mailboxes, mail readers that allow users to read and create messages, a standard for defining the structure of an email message (i.e., MIME) and application-layer protocols.  (^) The application layer protocol defines:

  1. how messages are passed between servers,
  2. how messages are passed between servers and mail readers, and
  3. how the contents of certain parts of the mail message (e.g., a mail message header) are to be interpreted.  (^) The principal application-layer protocol for electronic mail is SMTP (Simple Mail Transfer Protocol.  (^) Thus, SMTP is only one piece (albeit, a big piece) of the email application

BANASTHALI 5 What application layer protocol defines?

An application layer protocol defines how an application's processes,

running on different end systems, pass messages to each other. In

particular, an application layer protocol defines:

 the types of messages exchanged, e.g., request messages and

response messages;

 the syntax of the various message types, i.e., the fields in the message

and how the fields are delineated;

 the semantics of the fields, i.e., the meaning of the information in the

fields;

 rules for determining when and how a process sends messages and

responds to messages.

BANASTHALI 7 Cont.

A process's socket can be thought of as the process's door: a process sends

messages into, and receives message from, the network through its socket.

When a process wants to send a message to another process on another host, it

shoves the message out its door.

The process assumes that there is a transportation infrastructure on the other

side of the door that will transport the message to the door of the destination

process.

It is also referred to as the API (application programmers’ interface) as the

socket is the programming interface with which networked applications are built

in the Internet.

The application developer has control of everything on the application-layer side

of the socket but has little control of the transport-layer side of the socket

BANASTHALI 8 Addressing Processes

To send a message by a process on one host to a process on another host,

the sending process must identify the receiving process.

To identify the receiving process, one must typically specify two pieces of

information:

i. Name or address of the host machine: Globally unique IP address

ii. Port number: An identifier that specifies the identity of the receiving

process on the destination host.

 Each application process needs a unique port number using which two

processes in distinct hosts can communicate.

 Popular application-layer protocols have been assigned specific port

numbers. (Ex: HTTP: 80; SMTP: 25)

 When a developer creates a new network application, the application

Client-server model:

  • (^) The client-server model describes how a server provides resources and services to one or more clients.
  • (^) When a client requests a connection to a server, the server can either accept or reject the connection.
  • (^) If the connection is accepted, the server establishes and maintains a connection with the client over a specific protocol.
  • (^) The server serves a specific client by receiving request from the client via the protocol and responds with the needful content 10

HTTP:

  • (^) This is the foundation for data communication for the World Wide Web (i.e. internet).
  • (^) It is an application-level protocol for distributed, collaborative, hypermedia information systems.
  • (^) HTTP functions as a request–response protocol in the client–server computing model.
  • (^) HTTP has four versions — HTTP/0.9, HTTP/1.0, HTTP/1.1, and HTTP/2.0. Today the version in common use is HTTP/1.1 and the future will be HTTP/2.0. 11

HTTP Request Format: 13

HTTP Request Line:

  • (^) It begins with a method token , followed by the Request-URI and the protocol version , and ending with CRLF.
  • (^) The elements are separated by space SP characters. Request-Line = Method SP Request-URI SP HTTP-Version CRLF 14

Uniform Resource Indicator (URI))

  • (^) A URI is used to uniquely identify a resource over the web. URL has the following syntax: protocol://hostname:port/path-and-file-name
  • (^) There are 4 parts in a URI: 1. Protocol: The application-level protocol used by the client and server, e.g., HTTP, FTP, and telnet. 2. Hostname: The DNS domain name (e.g., www.nowhere123.com) or IP address (e.g., 192.128.1.2) of the server. 3. Port: The TCP port number that the server is listening for incoming requests from the clients. 4. Path-and-file-name: The name and location of the requested resource, under the server document base directory. - (^) Example http://www.nowhere123.com/docs/index.html, Protocol: HTTP; Hostname: www.nowhere123.com. Port number : not specified (default TCP port 80 for HTTP ) The path and file name: "/docs/index.html". - (^) Other examples of URL are: ftp://www.ftp.org/docs/test.txt mailto:[email protected] news:soc.culture.Singapore telnet://www.nowhere123.com/ 16

Request Header:

  • (^) The request headers are in the form of

name:value pairs.

  • (^) Multiple values, separated by commas, can

be specified.

request-header-name: request-header-

value1, request-header-value2, ...

  • (^) Examples of request headers are:

Host: www.xyz.com

Connection: Keep-Alive

Accept: image/gif, image/jpeg, /

Accept-Language: us-en, fr, cn

17

HTTP Response:

  • (^) When this request message reaches the server, the server can take either one of these actions :
  1. The server interprets the request received, maps the request into a file under the server's document directory, and returns the file requested to the client.
  2. The server interprets the request received, maps the request into a program kept in the server, executes the program, and returns the output of the program to the client.
  3. The request cannot be satisfied , the server returns an error message. Example of a HTTP Respond: 19 HTTP/1.1 200 OK Date: Sun, 18 Oct 2009 08:56:53 GMT Server: Apache/2.2.14 (Win32) Last-Modified: Sat, 20 Nov 2004 07:16:26 GMT ETag: "10000000565a5-2c-3e94b66c2e680“ Accept-Ranges: bytes Content-Length: 44 Connection: close Content-Type: text/html X-Pad: avoid browser bug It works!

HTTP Request-Response Cycle 20