Show Bid Request
C Program on UNIX
Bid Request Id: 7711
|
|
|
Posted by: |
shotglass (9 ratings)
(Software buyer rating 10)
|
Posted: |
Jan 18, 2002 2:26:16 PM EDT
|
Bidding Closes: |
Jan 22, 2002 12:27:19 AM EDT
|
Viewed (by coders): |
242 times
|
|
|
|
Description:
Ethernet Switch Program in ANSI C on UNIX,Use of semaphores & threads Create program that simulates single switch with numClients machines sending messages through it. Switch will be modeled by main thread. Will be several parameters: 1.numClients-number of ports. Assume that each port is connected to single machine (client). Thread will be created for each client. 2.rngSeed-seed for random number generator 3.maxCount-number of times each client will attempt to send essage 4.sendProbability-probability ( × 10000) that client will send message on each attempt
Will be data structure shared among all threads. an array, one for each client, of port s described below.
message:: source // sender's address destination // destination address data // an integer value
port:: message // described above empty // binary semaphore (initially 1) mutex // binary semaphore (initially 1) maddr // address of connected machine
Entry port[i].message represents packet input on port[i] of switch. Ports are numbered 0 through numClients - 1 . Entry port[i].maddr is the information thats maintained in forwarding table. You wont need to keep seperate forwarding table. The field maddr with index is sufficient. You will need to update this field accordingly, its initially set to NULL .
Output of simulation will be list of messages forwarded by switch. For each forwarded message a line will be printed indicating output port , source machine address , destination machine address , and data First message arrived on port 1:
0 1234567 9876 10125 2 1234567 9876 10125 3 1234567 9876 10125 1 74855 1234567 77449201
Switch thread will implement following pseudocode.
srand( rngSeed ) InitClient( numClients ) // supplied function Create array of ports Initialize array of ports Initialize sendingClients to numClients for i = 0 to numClients - 1 Start new thread for client attached to port i while sendingClients > 0 for i = 0 to numClients - 1 if message on port i // new entry in port[i] update forwarding table if new information search forwarding table for output port if port found send message out port else send message out all ports except i
Check out attached to continue
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
Special Conditions / Other:
Program MUST be completed by Monday January 28th at 12:00pm Central Time
Additional Attached Files
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$25 (USD)
|
Jan 18, 2002 5:48:54 PM EDT
|
9.82
(Excellent)
|
|
|
Accept my bid and you will have your program in 48 hours.
Regards. Daniel. |
|
|
|
|
|