Docsity

Client-Server Model and Communication in System Programming, Study notes of Computer Science

Partial preview of the text

Download Client-Server Model and Communication in System Programming and more Study notes Computer Science in PDF only on Docsity!

CS241 System Programming Introduction to Communication (I)

Klara Nahrstedt Lecture 34 4/14/

Content z^ Communication^ โ€“^ Motivation^ โ€“^ Network Categories and Applications z^ Client-Server Model^ โ€“^ Communication Channels^ โ€“^ Naming of Client/Server^ โ€“^ Types of Communication and Protocols^ โ€“^ Connection-oriented Server Strategies

Network Category z^ Resource Sharing Networks.^ โ€“^ Communication is typically between a user process on onehost and a resource manager process on another host.^ โ€“^ Examples:^ z^ Access remote files^ z^ Transfer files between hosts^ z^ Database distributed among hosts^ z^ Access peripheral device (e.g., printer) on remote host z^ Distributed Computation Networks.^ โ€“^ A group of processes cooperating in one activity aredistributed over several hosts throughout a network.^ โ€“^ Examples:^ z^ Large database systems^ z^ Real time process-control systems

Network Categories z^ Remote Communication Networks.^ โ€“^ Typically a batch system with most facilities inone or a few central locations, accessed frommany remote locations.^ โ€“^ Examples:^ z^ Bank ATMs

Communication Channel^ One way Channel

Two-way Channel C S S^

C

Symmetric Channel Asymmetric Ch. S

C^ S^

C

-- Shared Channel -- Private Channel

Client-Server Model/Examples

IPC (e.g., Pipes^ ) Network (e.g., LAN)

Ports z^ Ports < 1024, standard z^ Ports > 1024, user created z^ Well-known Port Numbers^ โ€“^ mail: 25^ โ€“^ ftp: 21^ โ€“^ telnet: 23^ โ€“^ rlogin 513^ โ€“^ http: 80^ โ€“^ nfs: 2049 z^ IP address (161.25.19.8)

Kinds of Communication z^ In connectionless communication, the client makesa request to an endpoint on a server and the servercan respond to the client's endpoint (that is includedin the client request). z^ In connection-oriented communication, the clientsets up a connection using the server's well-knownport number and then communicates over a privatecommunications channel as shown

TCP/IP Protocol Layers

END USER APPLICATION TCP IP^ IEEE802.X

UDP FTP, TELNET, SMTP, NSP, SNMP^ LAN/WAN Layers 5-7Layers 4Layers 1-

SystemInterfaceWe willstudyUser SpaceProcesses^ Kernel

Connection-oriented CommunicationProtocol 1.^ Server monitors a passive end-point whose address isknown to clients^ 1.^ Listening (passive) endpoints have resources for queuingclient connection requests and establishing client connections 2.^ Action of accepting a client request creates a newendpoint for private, two-way symmetriccommunication with that client 3.^ Client and server communicate by using handles (filedescriptors) and do not explicitly include addresses intheir messages 4.^ When finished, client and server close their filedescriptors, system releases resources associatedwith the connection

Connection-Oriented Server Strategies z^ Serial-server strategy z^ Parent-server strategy z^ Threaded-server strategy

Multiple Clients (Serial-server Strategy)

Threaded-server Strategy^ thread

Summary z^ Client-Server Process Communication^ โ€“^ Communication Channel^ โ€“^ Communication Protocols^ โ€“^ Connectionless vs Connection-oriented^ โ€“^ Connection-oriented Server Strategies