Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Network & Security Expert

Assignment: Sockets

In this project, we will implement a "message server" in a distributed environment (i.e. between processes running on machines that are physically separate) by using BSD sockets.

In this assignment, we will provide a writer program (i.e. you will be given a writer program), and you are required to create a server program, which will communicate with writers by sockets. 3 identical writer programs (except for names, writer 1, writer 2, and writer 3, respectively) will run on one or more machines and the server on another machine (netcluster.cse.usf.edu).

Assignment Specifications:

1. Each writer program will connect and send a message (i.e. message "writer1" will be sent to the server from writer 1 - you do not have to do this, our TA will take care of this part) to the server.

2. The server process will accept this socket connection from a writer, and create a thread process after the socket is accepted.

3. After a thread is created it is responsible for taking care of communication (Step 4) with the writer, and the parent process loops back to listen for a connection - this makes the parent ready for another connection.

4. A message from the writer must be stored by the appropriate thread processes in shared memory. This memory is shared by the server and all its threads, and can store only one message. The message length will be no more than 15 characters (14 chars plus 1 char string terminator in C), such as "writer1" "writer2" and "writer3".

5. A writer process should be invoked (started) with the writer name. For instance, suppose writer program name is "writerp", the first writer should be started by typing "writerp" and will read the message from the file infile.

6. The shared memory must be properly protected as a critical section so that the stored message will never be corrupted even during the handling of concurrent connections from multiple writers.

7. After a message from a writer is successfully stored in the shared memory by one of the server threads, after a 2 second sleep, the actual contents of the shared memory should be sent back to the original writer by the same server thread.

8. Set the server up to run on netcluster.cse.usf.edu (131.247.3.8 is the IP address). Use port 1050 as the port for listening. You will need to examine the socket, connect, bind, listen, accept, send and recv man pages for the appropriate system calls. (some of them, such as send, gotten via man send). Your server should loop for a total of n connection accepts, where n will be 3 in our trials.

Look at setsockopt to free the socket after use.

I suggest that first you set up your server so that it listens and responds to 1 writer. Use a C4lab machine c4lab04 131.247.2.133 or c4lab12 131.247.3.131 as the test machine to send from. You will upload your code into Canvas before the deadline.

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M92769922

Have any Question?


Related Questions in Computer Network & Security

Toms income is 480and he spends it on two goods x and y his

Tom's income is $480and he spends it on two goods, X and Y. His utility function is U = XY. Both X and Y sells for $8 per unit.   a. Use lagrangian function to calculate Tom's utility-maximizing purchases of X and Y.  b. ...

Consider the following series of paymentsyear 0 20year 1

Consider the following series of payments: Year 0: 20 Year 1: 30 Year 2: 40 Year 3: 10 Year 4: 5 Using an interest rate of 10%: a. What is the present value of this series of payments? b. What is the future value of this ...

1srin response to nmap -n -sn localhost what kind of

1. SR In response to "nmap -n -sn localhost": What kind of information did the nmap scan results show you, specifically? 2. FIB What does the "-sn" option do in nmap? ping scan -disable port scan 3. SR How does the "-sn" ...

Objectivespart 1 researching network attacks- research

Objectives Part 1: Researching Network Attacks - Research network attacks that have occurred. - Select a network attack and develop a report for presentation to the class. Part 2: Researching Network Security Audit Tools ...

Shadow register setsa describe the use of shadow register

Shadow Register Sets a. Describe the use of shadow register sets. b. How many shadow register sets are supported? c. What instructions are used to move data between them? Floating Point Numbers. We have heretofore focuse ...

Topic is impacts of data breaches the report will divide in

Topic is "Impacts of data breaches". the report will divide in to 5 section which is : "" 1-Abstract: comprehensive overview of the report in 150 to 200 words. 2- Introduction: Describe the topic and its issue in 250 to ...

Metasoft ltd is a software development company which works

MetaSoft Ltd is a software development company which works across Australia and New Zealand. The company is considering the following strategic proposal: - They plan to close down the Melbourne data centre rather than up ...

Compare the importance of three categories described in the

Compare the importance of three categories described in the article: 1. window of exposure, 2. full public disclosure, 3. reasonable disclosure for three types of software applications: 4. military, 5. medical, 6. educat ...

Below are the supply and demand schedules for fresh coffee

Below are the supply and demand schedules for fresh coffee in Vancouver: Price ($/cup) Quantity Demanded  (cups/day) Quantity Supplied (cups/day) 1 440 330 2 415 360 3 390 390 4 365 420 5 340 450 6 315 480 7 290 510 a. W ...

Part auniversity of neverland offers more than 300

Part A University of Neverland offers more than 300 undergraduate programs. The Bachelor of Dreams is one of the highly regarded program offered by the University. The University tries to improve all its programs by intr ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As