Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This assignment is meant to: Introduce students to writing basic client / server programs in C using the UNIX / Linux platform Provide an opportunity
This assignment is meant to: Introduce students to writing basic clientserver programs in C using the UNIXLinux platform Provide an opportunity to write code that will become the base for projects similar to that of a simulated operating system component Objective: Create programs that run independently and can perform simple IPC using FIFOsnamed pipes to pass information back and forth in a clientserver fashion. This assignment requires the analysis, implementation, testing and documentation of two small programs written in C on the UHCL Linux server ruby or your own Linux box or virtual machine. A server program and a client program that will be run concurrently. Server program: The server program will provide a simple convert&store service to clients that connect with it and send it requests. Server program will be an iterative server can process ONLY one client at a time and it needs to do the following: Create a wellknown receive FIFOs where it will read its inputrequests from the client and open it in READ mode will block of course until a client opens the same fifo in write mode Then go into an infinite loop to read requests from the clients, each request will be a simulated system call each requestsystem call should include: Process ID of process sendingmaking the system call System call number integer or byte Number n of parameters in the system call integer or byte Size of the rest of the message that includes Actual values for the n parameters indicated in As described below: System Call would be the first request sent by a new client connect system call Process ID System Call Number Number n of parameters Size of Actual values for the parameter the name of the clients specific FIFO which the server should use to reply to that client. Server should open that clientspecific FIFO in WRITE mode, save the file descriptor and the pid of the client for use when replies need to be sent to that client. No need to return anything. System Call Number to text Process ID System Call Number Number n of parameters Size of parameter bytes for integer Actual values for the parameter Return the number converted to text zero, one, two, three, etc. assume number will be between and System Call Text to number Process ID System Call Number Number n of parameters Size of parameter Actual values for the parameter zero one, two, three, etc. Return the number four five etc System Call Store Process ID System Call Number Number n of parameters Size of parameter Actual values for the parameter Return stored value System Call Recall Process ID System Call Number Number n of parameters Actual values for the parameter NA Return storedrecalled value System Call Exit Process ID System Call Number Number n of parameters Actual values for the parameter NA Return value NA System Call Terminate Process ID System Call Number Number n of parameters Actual values for the parameter NA Return value NA Server must print to the screen a message indicating the system call received something like: Client pid: System Call Requested: with parameters which are: Paramxxxx paramYYYY resultXXXX Server must reply back to the client through the client specific fifo with a reply message that should include a result as appropriate. If the request is the system call EXIT the server program must close the client specific fifo and continue to receive the next system call ready for the next client to connect When the last client terminates, ie sends system call the server should close the well known FIFO, delete it and terminate as well. Client Program: The client program will connect to the server through the wellknown FIFO and send requests through it to the server, obtaining information from the user as to what system call to make and the corresponding values for the parameters more specifically, the client program should: Acquire from the user through the command line or reading from the keyboard what the client number this instance of the program will be ie client client etc. or use the actual processid if you prefer. Open the wellknown servers fifo in write mode to communicate with the server which will unblock the server from its fifo open call Create the clientspecific FIFO using an appropriate name egClientNfifo where N is the client number and send the initial connect system call to the server including Client number and name of the clientspecific FIFO. Open the clientspecific FIFO in READ mode to be able to read replies from the serve
This assignment is meant to:
Introduce students to writing basic clientserver programs in C using the UNIXLinux platform
Provide an opportunity to write code that will become the base for projects similar to that of a simulated operating system component
Objective: Create programs that run independently and can perform simple IPC using FIFOsnamed pipes to pass information back and forth in a clientserver fashion.
This assignment requires the analysis, implementation, testing and documentation of two small programs written in C on the UHCL Linux server ruby or your own Linux box or virtual machine. A server program and a client program that will be run concurrently.
Server program:
The server program will provide a simple convert&store service to clients that connect with it and send it requests.
Server program will be an iterative server can process ONLY one client at a time and it needs to do the following:
Create a wellknown receive FIFOs where it will read its inputrequests from the client and open it in READ mode will block of course until a client opens the same fifo in write mode
Then go into an infinite loop to read requests from the clients, each request will be a simulated system call each requestsystem call should include:
Process ID of process sendingmaking the system call
System call number integer or byte
Number n of parameters in the system call integer or byte
Size of the rest of the message that includes
Actual values for the n parameters indicated in
As described below:
System Call would be the first request sent by a new client connect system call
Process ID
System Call Number
Number n of parameters
Size of
Actual values for the parameter the name of the clients specific FIFO which the server should use to reply to that client. Server should open that clientspecific FIFO in WRITE mode, save the file descriptor and the pid of the client for use when replies need to be sent to that client.
No need to return anything.
System Call Number to text
Process ID
System Call Number
Number n of parameters
Size of parameter bytes for integer
Actual values for the parameter
Return the number converted to text zero, one, two, three, etc. assume number will be between and
System Call Text to number
Process ID
System Call Number
Number n of parameters
Size of parameter
Actual values for the parameter zero one, two, three, etc.
Return the number four five etc
System Call Store
Process ID
System Call Number
Number n of parameters
Size of parameter
Actual values for the parameter
Return stored value
System Call Recall
Process ID
System Call Number
Number n of parameters
Actual values for the parameter NA
Return storedrecalled value
System Call Exit
Process ID
System Call Number
Number n of parameters
Actual values for the parameter NA
Return value NA
System Call Terminate
Process ID
System Call Number
Number n of parameters
Actual values for the parameter NA
Return value NA
Server must print to the screen a message indicating the system call received something like:
Client pid:
System Call Requested: with parameters which are:
Paramxxxx paramYYYY resultXXXX
Server must reply back to the client through the client specific fifo with a reply message that should include a result as appropriate.
If the request is the system call EXIT the server program must close the client specific fifo and continue to receive the next system call ready for the next client to connect
When the last client terminates, ie sends system call the server should close the well known FIFO, delete it and terminate as well.
Client Program:
The client program will connect to the server through the wellknown FIFO and send requests through it to the server, obtaining information from the user as to what system call to make and the corresponding values for the parameters more specifically, the client program should:
Acquire from the user through the command line or reading from the keyboard what the client number this instance of the program will be ie client client etc. or use the actual processid if you prefer.
Open the wellknown servers fifo in write mode to communicate with the server which will unblock the server from its fifo open call
Create the clientspecific FIFO using an appropriate name egClientNfifo where N is the client number and send the initial connect system call to the server including Client number and name of the clientspecific FIFO.
Open the clientspecific FIFO in READ mode to be able to read replies from the serve
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started