SlideShare a Scribd company logo
Client Server
Communication
Presented to :
Sir Ahmad Mohsin
Deliverers :
Athar kashan 131356
Junaid Lodhi 131357
Ahsan Saleem 131358
Topics
• Client Server Communication
• Strategies of Communication
• Sockets
• Pipes
• RPC (Remote Procedural Calls)
Sockets
• A socket is defined as an endpoint for communication
• Concatenation of IP (Internet Protocol) address and port
• The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8
• Communication consists between pair of sockets.
Socket Communication
PIPES
A pipe in computing is way of communication between more than one process
.Pipe strictly follows the Inter Process Communication.
Pipes were the one of the first mechanism in early UNIX systems.It provides one
of the simplest way of communication between different process
General View of Pipe
Types of Pipes
• Ordinary Pipes
• Named Pipes
Ordinary Pipes:
The Ordinary pipe in Operating Systems allows the two procedures to communicate in a standard
way: the procedure writes on the one end (the write end) and reads on the consumer side or another
end (the read-end). As a result, ordinary pipes are unidirectional, allowing only one-way
communication as shown in a figure.
Ordinary Pipe
Ordinary Pipes in Unix System
#define BUFFER_SIZE 25
#define READ_END 0 // fd[0] is the read-end of the pipe
#define WRITE_END 1 //fd[1] is the write-end
int main(void)
{
char write_msg[BUFFER_SIZE]
char read_msg[BUFFER_SIZE];
int fd[2];
pid_t pid;
Example Continued
• I* create the pipe *I
• if (pipe(fd) == -1) {
• fprintf(stderr,"Pipe failed");
• return 1;
• }
• I* fork a child process *I
• pid = fork();
• if (pid < 0) { I* error occurred *I
• fprintf(stderr, "Fork Failed");
• return 1;
• }
• if (pid > 0) { I* parent process *I
• }
• I* close the unused end of the pipe *I
• close(fd[READ_END]);
• I* write to the pipe *I
• write(fd[WRITE_END], write_msg, strlen(write_msg)+1);
• I* close the write end of the pipe *I
• close(fd[WRITE_END]);
• else { I* child process *I
• }
Example Continued
• I* close the unused end of the pipe *I
• close(fd[WRITE_END]);
• I* read from the pipe *I
• read(fd[READ_END], read_msg, BUFFER_SIZE);
• printf ("read %s", read_msg) ;
• I* close the write end of the pipe *I
• close(fd[READ_END]); }
• return 0; }
In Windows
•
Ordinary pipes on Windows systems are termed anonymous pipes.
• the pipe is created by using CreatePipe() function
• Functionality, they are unidirectional.
• Readfile() and Writefile() functions are used for reading and writing to the file.
Point of significance:
Note that ordinary pipes require a parent-child relationship between computing processes in both UNIX and Windows
systems. This means that pipes can be used only for communication between processes on the same machine.
Named pipes
Named Pipes
• Communication can be bi-directional
• no parent-child relationship is required between process
• More than two process can communicate with each other a time
• named pipes exist after completion and termination of all the processes
In Unix
Name pipes referred to as FIFO (first in first out) in UNIX systems.
Once they created.
They appear as typical files in the file systems.
A FIFO is created with the mkfifo() system call and manipulated with open(), read(), write() and close() system
calls.
FIFO supports two-way communication, only half-duplex transmission is permitted.
In Windows
• Much richer communication mechanism between processes rather than UNIX systems
• Full-duplex communication is allowed in Windows named pipe
• The communication may run from either different sides or from the same side of the pipe at a same time
• Name pipe is created with CreateNamedPipe() function, and a client can connect the named pipe using
ConnectNamedPipe(). Communication over the named pipe can be accomplished using the ReadFile() and
WriteFile() functions
POINT OF SIGNIFICANCE:
Windows provides the facility of the communication between processed residing on different machines.
Introduction
• One of the most common forms of remote service is the RPC paradigm
• The RPC was designed as a way to abstract the procedure-call mechanism for
use between systemswith network connections.
• abstract the procedure-call mechanism for use between systemswith network
connections.
Ahsan 25
Index
Mechanism
Architectural Hurdles
Solution
Ahsan 26
Mechanism
• The semantics of RPCs allows a client to invoke a procedure on a remote host as it
would invoke a procedure locally.
• The RPC system hides the details that allow communication to take place by
providing a stub on the client side
• A separate stub exists for each separate remote procedure
• This stub locates the port on the server and marshals the parameters.
Ahsan 27
Stubs
• Client stub
• Packs parameter into message.
• Calls : Send & Receive.
• Server Stub
• Calls : Receive & Send.
• Unpacks parameter from the message.
• Details of message passing are hidden – two libraries.
Ahsan 28
Ahsan 29
Steps
1. The client procedure calls the client stub in the normal way.
2. The client stub builds a message and traps to the kernel.
3. The kernel sends the message to the remote kernel.
4. The remote kernel gives the message to the server stub.
5. The server stub unpacks the parameters and calls the server.
6. The server does the work and returns the result to the stub.
7. The server stub packs it in a message and traps to the kernel.
8. The remote kernel sends the message to the clients kernel.
9. The client’s kernel gives the message to the client stub.
10. The stub unpacks the result and returns to the client.Ahsan 30
Client-side stub
 Looks like local server
function
 Same interface as local
function
 Bundles arguments into
message, sends to server-
side stub
 Waits for reply, un-bundles
results
 Returns to kernel
Server-side stub
 Looks like local client
function to server
 Listens on a socket for
message from client stub
 Un-bundles arguments to
local variables
 Makes a local function call
to server
 Bundles result into reply
message to client stub
Ahsan 31
Architectural Hurdles and Solution
• One issue that must be dealt with concerns differences in data
representation on the client and server machines.
• Some systems (known as big-endian) store the most significant
byte first
• while other systems (known as little-endian) store the least
significant byte first.
• To resolve differences like this, many RPC systems define a
machine-independent representation of data.
• .Onesuchrepresentation is known as external data representation
(XDR).
Ahsan 32
• procedure calls fail only under extreme circumstances, RPCs can fail, or
be duplicated and executed more than once, as a result of common
network errors.
• One way to address this problem is for the operating system to ensure
that messages are acted on exactly once, rather than at most once.
• First, consider “at most once.” This semantic can be implemented by
attaching a timestamp to each message.
Hurdles and solutions continued,
• For “exactly once” to accomplish this, the server must implement the “at
most once” protocol described above but must also acknowledge to the
client that the RPC call was received and executed.
• .These ACK messages are common through out net working.The client must
resend each RPC call periodically until it receives the ACK for that call.
Ahsan 34
communication Mechanism in Client Server Model
communication Mechanism in Client Server Model

More Related Content

What's hot

Database systems
Database systemsDatabase systems
Database systems
Dhani Ahmad
 
Host-based Security
Host-based SecurityHost-based Security
Host-based Security
secdevmel
 
Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application Vulnerabilities
Preetish Panda
 
Authentication Models
Authentication ModelsAuthentication Models
Authentication Models
Raj Chanchal
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
webhostingguy
 
Data models
Data modelsData models
Data models
KIRANPREET KAUR
 
Directory services
Directory servicesDirectory services
Directory services
Christalin Nelson
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
Mythili Kannan
 
Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)
Fabiha Shahzad
 
3 tier data warehouse
3 tier data warehouse3 tier data warehouse
3 tier data warehouse
J M
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
bilcorry
 
Ch02 System Threats and Risks
Ch02 System Threats and RisksCh02 System Threats and Risks
Ch02 System Threats and Risks
Information Technology
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server Administration
Raja Waseem Akhtar
 
System Administration: Introduction to system administration
System Administration: Introduction to system administrationSystem Administration: Introduction to system administration
System Administration: Introduction to system administration
Khang-Ling Loh
 
Sql injection - security testing
Sql injection - security testingSql injection - security testing
Sql injection - security testing
Napendra Singh
 
Data base management system
Data base management systemData base management system
Data base management system
ashirafzal1
 
slide on DNS
slide on DNSslide on DNS
slide on DNS
webhostingguy
 
The database applications
The database applicationsThe database applications
The database applications
Dolat Ram
 
system Security
system Security system Security
system Security
Gaurav Mishra
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
Akansha Kesharwani
 

What's hot (20)

Database systems
Database systemsDatabase systems
Database systems
 
Host-based Security
Host-based SecurityHost-based Security
Host-based Security
 
Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application Vulnerabilities
 
Authentication Models
Authentication ModelsAuthentication Models
Authentication Models
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Data models
Data modelsData models
Data models
 
Directory services
Directory servicesDirectory services
Directory services
 
Distributed Query Processing
Distributed Query ProcessingDistributed Query Processing
Distributed Query Processing
 
Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)
 
3 tier data warehouse
3 tier data warehouse3 tier data warehouse
3 tier data warehouse
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Ch02 System Threats and Risks
Ch02 System Threats and RisksCh02 System Threats and Risks
Ch02 System Threats and Risks
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server Administration
 
System Administration: Introduction to system administration
System Administration: Introduction to system administrationSystem Administration: Introduction to system administration
System Administration: Introduction to system administration
 
Sql injection - security testing
Sql injection - security testingSql injection - security testing
Sql injection - security testing
 
Data base management system
Data base management systemData base management system
Data base management system
 
slide on DNS
slide on DNSslide on DNS
slide on DNS
 
The database applications
The database applicationsThe database applications
The database applications
 
system Security
system Security system Security
system Security
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
 

Similar to communication Mechanism in Client Server Model

Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
RockyBhai46825
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
Abhishek Sagar
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
Ajit Nayak
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx
KushalSrivastava23
 
Os lectures
Os lecturesOs lectures
Os lectures
Adnan Ghafoor
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
Taymoor Nazmy
 
NTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC PresentationNTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC Presentation
Muhamad Hesham
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
Aya Mahmoud
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
N.Jagadish Kumar
 
Network troubleshooting
Network troubleshootingNetwork troubleshooting
Network troubleshooting
Skillspire LLC
 
Application layer
Application layerApplication layer
Application layer
Neha Kurale
 
Application layer
Application layerApplication layer
Application layer
Neha Kurale
 
Application Protocol
Application Protocol Application Protocol
Application Protocol
Chandnigupta80
 
SOHO Network Setup Tutorial
SOHO Network Setup Tutorial SOHO Network Setup Tutorial
SOHO Network Setup Tutorial
junaidahmedsaba
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
sehrish saba
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next Level
Intel® Software
 
TCP/IP
TCP/IPTCP/IP
DS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.pptDS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.ppt
menoralemu03
 
Networking basics PPT
Networking basics PPTNetworking basics PPT
Networking basics PPT
Ehsan Ullah Kakar
 

Similar to communication Mechanism in Client Server Model (20)

Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
 
Socket programming using C
Socket programming using CSocket programming using C
Socket programming using C
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx
 
Os lectures
Os lecturesOs lectures
Os lectures
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
 
NTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC PresentationNTP Software Jan 2012 Monthly Meeting IPC Presentation
NTP Software Jan 2012 Monthly Meeting IPC Presentation
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
 
Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Network troubleshooting
Network troubleshootingNetwork troubleshooting
Network troubleshooting
 
Application layer
Application layerApplication layer
Application layer
 
Application layer
Application layerApplication layer
Application layer
 
Application Protocol
Application Protocol Application Protocol
Application Protocol
 
SOHO Network Setup Tutorial
SOHO Network Setup Tutorial SOHO Network Setup Tutorial
SOHO Network Setup Tutorial
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Move Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next LevelMove Message Passing Interface Applications to the Next Level
Move Message Passing Interface Applications to the Next Level
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
DS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.pptDS-Chapter DDEFR2-Communication_105220.ppt
DS-Chapter DDEFR2-Communication_105220.ppt
 
Networking basics PPT
Networking basics PPTNetworking basics PPT
Networking basics PPT
 

More from Junaid Lodhi

Case Study 2: Instrumentation Software
Case Study 2: Instrumentation SoftwareCase Study 2: Instrumentation Software
Case Study 2: Instrumentation Software
Junaid Lodhi
 
Peer to peer data management
Peer to peer data managementPeer to peer data management
Peer to peer data management
Junaid Lodhi
 
Syntax directed-translation
Syntax directed-translationSyntax directed-translation
Syntax directed-translation
Junaid Lodhi
 
Regex by 131357
Regex by 131357Regex by 131357
Regex by 131357
Junaid Lodhi
 
Employee Motivation
Employee MotivationEmployee Motivation
Employee Motivation
Junaid Lodhi
 
Pipes in Windows and Linux.
Pipes in Windows and Linux.Pipes in Windows and Linux.
Pipes in Windows and Linux.
Junaid Lodhi
 

More from Junaid Lodhi (6)

Case Study 2: Instrumentation Software
Case Study 2: Instrumentation SoftwareCase Study 2: Instrumentation Software
Case Study 2: Instrumentation Software
 
Peer to peer data management
Peer to peer data managementPeer to peer data management
Peer to peer data management
 
Syntax directed-translation
Syntax directed-translationSyntax directed-translation
Syntax directed-translation
 
Regex by 131357
Regex by 131357Regex by 131357
Regex by 131357
 
Employee Motivation
Employee MotivationEmployee Motivation
Employee Motivation
 
Pipes in Windows and Linux.
Pipes in Windows and Linux.Pipes in Windows and Linux.
Pipes in Windows and Linux.
 

Recently uploaded

Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 

Recently uploaded (20)

Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 

communication Mechanism in Client Server Model

  • 1. Client Server Communication Presented to : Sir Ahmad Mohsin Deliverers : Athar kashan 131356 Junaid Lodhi 131357 Ahsan Saleem 131358
  • 2. Topics • Client Server Communication • Strategies of Communication • Sockets • Pipes • RPC (Remote Procedural Calls)
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Sockets • A socket is defined as an endpoint for communication • Concatenation of IP (Internet Protocol) address and port • The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8 • Communication consists between pair of sockets.
  • 10. PIPES A pipe in computing is way of communication between more than one process .Pipe strictly follows the Inter Process Communication. Pipes were the one of the first mechanism in early UNIX systems.It provides one of the simplest way of communication between different process
  • 12. Types of Pipes • Ordinary Pipes • Named Pipes Ordinary Pipes: The Ordinary pipe in Operating Systems allows the two procedures to communicate in a standard way: the procedure writes on the one end (the write end) and reads on the consumer side or another end (the read-end). As a result, ordinary pipes are unidirectional, allowing only one-way communication as shown in a figure.
  • 14. Ordinary Pipes in Unix System #define BUFFER_SIZE 25 #define READ_END 0 // fd[0] is the read-end of the pipe #define WRITE_END 1 //fd[1] is the write-end int main(void) { char write_msg[BUFFER_SIZE] char read_msg[BUFFER_SIZE]; int fd[2]; pid_t pid;
  • 15. Example Continued • I* create the pipe *I • if (pipe(fd) == -1) { • fprintf(stderr,"Pipe failed"); • return 1; • } • I* fork a child process *I • pid = fork();
  • 16. • if (pid < 0) { I* error occurred *I • fprintf(stderr, "Fork Failed"); • return 1; • } • if (pid > 0) { I* parent process *I • } • I* close the unused end of the pipe *I • close(fd[READ_END]);
  • 17. • I* write to the pipe *I • write(fd[WRITE_END], write_msg, strlen(write_msg)+1); • I* close the write end of the pipe *I • close(fd[WRITE_END]); • else { I* child process *I • }
  • 18. Example Continued • I* close the unused end of the pipe *I • close(fd[WRITE_END]); • I* read from the pipe *I • read(fd[READ_END], read_msg, BUFFER_SIZE); • printf ("read %s", read_msg) ; • I* close the write end of the pipe *I • close(fd[READ_END]); } • return 0; }
  • 19. In Windows • Ordinary pipes on Windows systems are termed anonymous pipes. • the pipe is created by using CreatePipe() function • Functionality, they are unidirectional. • Readfile() and Writefile() functions are used for reading and writing to the file. Point of significance: Note that ordinary pipes require a parent-child relationship between computing processes in both UNIX and Windows systems. This means that pipes can be used only for communication between processes on the same machine.
  • 21. Named Pipes • Communication can be bi-directional • no parent-child relationship is required between process • More than two process can communicate with each other a time • named pipes exist after completion and termination of all the processes
  • 22. In Unix Name pipes referred to as FIFO (first in first out) in UNIX systems. Once they created. They appear as typical files in the file systems. A FIFO is created with the mkfifo() system call and manipulated with open(), read(), write() and close() system calls. FIFO supports two-way communication, only half-duplex transmission is permitted.
  • 23. In Windows • Much richer communication mechanism between processes rather than UNIX systems • Full-duplex communication is allowed in Windows named pipe • The communication may run from either different sides or from the same side of the pipe at a same time • Name pipe is created with CreateNamedPipe() function, and a client can connect the named pipe using ConnectNamedPipe(). Communication over the named pipe can be accomplished using the ReadFile() and WriteFile() functions POINT OF SIGNIFICANCE: Windows provides the facility of the communication between processed residing on different machines.
  • 24.
  • 25. Introduction • One of the most common forms of remote service is the RPC paradigm • The RPC was designed as a way to abstract the procedure-call mechanism for use between systemswith network connections. • abstract the procedure-call mechanism for use between systemswith network connections. Ahsan 25
  • 27. Mechanism • The semantics of RPCs allows a client to invoke a procedure on a remote host as it would invoke a procedure locally. • The RPC system hides the details that allow communication to take place by providing a stub on the client side • A separate stub exists for each separate remote procedure • This stub locates the port on the server and marshals the parameters. Ahsan 27
  • 28. Stubs • Client stub • Packs parameter into message. • Calls : Send & Receive. • Server Stub • Calls : Receive & Send. • Unpacks parameter from the message. • Details of message passing are hidden – two libraries. Ahsan 28
  • 30. Steps 1. The client procedure calls the client stub in the normal way. 2. The client stub builds a message and traps to the kernel. 3. The kernel sends the message to the remote kernel. 4. The remote kernel gives the message to the server stub. 5. The server stub unpacks the parameters and calls the server. 6. The server does the work and returns the result to the stub. 7. The server stub packs it in a message and traps to the kernel. 8. The remote kernel sends the message to the clients kernel. 9. The client’s kernel gives the message to the client stub. 10. The stub unpacks the result and returns to the client.Ahsan 30
  • 31. Client-side stub  Looks like local server function  Same interface as local function  Bundles arguments into message, sends to server- side stub  Waits for reply, un-bundles results  Returns to kernel Server-side stub  Looks like local client function to server  Listens on a socket for message from client stub  Un-bundles arguments to local variables  Makes a local function call to server  Bundles result into reply message to client stub Ahsan 31
  • 32. Architectural Hurdles and Solution • One issue that must be dealt with concerns differences in data representation on the client and server machines. • Some systems (known as big-endian) store the most significant byte first • while other systems (known as little-endian) store the least significant byte first. • To resolve differences like this, many RPC systems define a machine-independent representation of data. • .Onesuchrepresentation is known as external data representation (XDR). Ahsan 32
  • 33. • procedure calls fail only under extreme circumstances, RPCs can fail, or be duplicated and executed more than once, as a result of common network errors. • One way to address this problem is for the operating system to ensure that messages are acted on exactly once, rather than at most once. • First, consider “at most once.” This semantic can be implemented by attaching a timestamp to each message.
  • 34. Hurdles and solutions continued, • For “exactly once” to accomplish this, the server must implement the “at most once” protocol described above but must also acknowledge to the client that the RPC call was received and executed. • .These ACK messages are common through out net working.The client must resend each RPC call periodically until it receives the ACK for that call. Ahsan 34