Presentation is loading. Please wait.

Presentation is loading. Please wait.

Position of application layer. Application layer duties.

Similar presentations


Presentation on theme: "Position of application layer. Application layer duties."— Presentation transcript:

1 Position of application layer

2 Application layer duties

3 27-Oct-03Application 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

4 27-Oct-03Application 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?

5 27-Oct-03Application 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

6 27-Oct-03Application 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

7 Figure 24.2 Client-server relationship

8 27-Oct-03Application Layer Connection Types Connectionless Sender simply sends data whenever it wants to Connection-oriented 1. Sender transmits a connection-request packet 2. Receiver acknowledges with a connection-confirm packet 3. Sender transmits data 4. Sender transmits disconnect-request packet 5. Receiver acknowledges with a disconnect-confirm packet

9 27-Oct-03Application 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

10 Figure 24.3 Connectionless iterative server

11 Figure 24.4 Connection-oriented concurrent server

12 27-Oct-03Application 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.

13 27-Oct-03Application 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

14 27-Oct-03Application 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

15 Figure 24.5 Socket structure

16 27-Oct-03Application 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

17 Figure 24.6 Socket types

18 27-Oct-03Application 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

19 27-Oct-03Application Layer Server Operations 1. Create a socket 2. Bind 3. Repeat 1. Receive a request 2. Process 3. Send

20 27-Oct-03Application Layer Client Operations 1. Create a socket 2. Repeat 1. Send 2. Receive 3. Destroy

21 Figure 24.7 Socket interface for connectionless iterative server

22 27-Oct-03Application 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

23 27-Oct-03Application Layer Server Operations 1. Create a socket 2. Bind 3. Listen 4. Repeat 1. Create a child 2. Create a new socket 3. Repeating 1. Read 2. Process 3. Write 4. Destroy socket

24 27-Oct-03Application Layer Client Operations 1. Create a socket 2. Connect 3. Repeat 1. Write 2. Read 4. Destroy

25 Figure 24.8 Socket interface for connection-oriented concurrent server


Download ppt "Position of application layer. Application layer duties."

Similar presentations


Ads by Google