position of application layer. application layer duties

25
Position of application layer

Upload: blake-strickland

Post on 05-Jan-2016

236 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Position of application layer. Application layer duties

Position of application layer

Page 2: Position of application layer. Application layer duties

Application layer duties

Page 3: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Client-Server Model

The most common way that a computer can ask for the services of another computer.

Operates through running application programs at both end computers and the communication is between these programs

Consist of: - A client A server

Page 4: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Design Questions

1. Should both the applications be able to request services and provide services?

2. Should an application program provide services only to one specific application program?

3. When should an application program be running?

4. Should there be only one universal application program providing any type of services required?

Page 5: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Client

A program running on the local machine requesting service from a server

Started by the user or another application program, and terminates when the service complete

Begins with active open, followed by a series of requests and responses, and ends with active close

Page 6: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Server

A program running on the remote machine and providing service to the clients

Starts with passive open and responds to the incoming requests either iteratively or concurrently

Page 7: Position of application layer. Application layer duties

Figure 24.2 Client-server relationship

Page 8: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Connection Types

Connectionless Sender simply sends data whenever it wants to

Connection-oriented1. Sender transmits a connection-request packet2. Receiver acknowledges with a connection-

confirm packet3. Sender transmits data4. Sender transmits disconnect-request packet5. Receiver acknowledges with a disconnect-

confirm packet

Page 9: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Concurrency

Concurrency in Clients Concurrency in Servers

Connectionless iterative Processes one request at a time Usually uses UDP

Connectionless concurrent Connection-oriented iterative Connection-oriented concurrent

Serves many clients at a time Usually uses TCP

Page 10: Position of application layer. Application layer duties

Figure 24.3 Connectionless iterative server

Page 11: Position of application layer. Application layer duties

Figure 24.4 Connection-oriented concurrent server

Page 12: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Programs Vs. Processes

Different, but related to one another Program

A program is a code defining all the variables and actions to be performed on those variables.

Process A process is an instance of a program. Memory is allocated for each

concurrent process separately.

Page 13: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Socket Definition

Basically, a socket enables the communication between a client and server process.

Once both sockets are engaged, the two computers can exchange data.

A socket structure contains five fields: - Family

Defines the protocol group Type

Defines the socket type Protocol

Defines the protocol used

Page 14: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Socket Definition (Continued…)

Local socket address Defines the local socket address, a

combination of The local IP address and The port address of the local application

program

Remote socket address Defines the remote socket address, a

combination of The remote IP address and The port address of the remote application

program

Page 15: Position of application layer. Application layer duties

Figure 24.5 Socket structure

Page 16: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Socket Types

Stream socket Designed to be used with a connection-

oriented protocol such as TCP Datagram socket

Designed for use with a connectionless protocol such as UDP

Raw socket Designed to be used with protocols

neither use stream socket nor datagram socket such as ICMP or OSPF

Page 17: Position of application layer. Application layer duties

Figure 24.6 Socket types

Page 18: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Connectionless Iterative Server

Using UDP and datagram sockets Serves one request at a time Pays no attention to the other packets

while processing one packet

Page 19: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Server Operations

1. Create a socket2. Bind3. Repeat

1. Receive a request2. Process3. Send

Page 20: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Client Operations

1. Create a socket2. Repeat

1. Send2. Receive

3. Destroy

Page 21: Position of application layer. Application layer duties

Figure 24.7 Socket interface for connectionless iterative server

Page 22: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Connection Oriented Concurrent Server

Using TCP and stream sockets Serves many clients at the same time Use the concept of parent and child

servers to enable connection-oriented operation

Page 23: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Server Operations

1. Create a socket2. Bind3. Listen4. Repeat

1. Create a child2. Create a new socket3. Repeating

1. Read2. Process3. Write

4. Destroy socket

Page 24: Position of application layer. Application layer duties

27-Oct-03 Application Layer

Client Operations

1. Create a socket2. Connect3. Repeat

1. Write2. Read

4. Destroy

Page 25: Position of application layer. Application layer duties

Figure 24.8 Socket interface for connection-oriented concurrent server