Position of application layer. Application layer duties.
-
Upload
blake-strickland -
Category
Documents
-
view
237 -
download
0
Transcript of Position of application layer. Application layer duties.
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
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?
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
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
Figure 24.2 Client-server relationship
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
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
Figure 24.3 Connectionless iterative server
Figure 24.4 Connection-oriented concurrent server
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.
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
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
Figure 24.5 Socket structure
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
Figure 24.6 Socket types
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
27-Oct-03 Application Layer
Server Operations
1. Create a socket2. Bind3. Repeat
1. Receive a request2. Process3. Send
27-Oct-03 Application Layer
Client Operations
1. Create a socket2. Repeat
1. Send2. Receive
3. Destroy
Figure 24.7 Socket interface for connectionless iterative server
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
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
27-Oct-03 Application Layer
Client Operations
1. Create a socket2. Connect3. Repeat
1. Write2. Read
4. Destroy
Figure 24.8 Socket interface for connection-oriented concurrent server