Find Jobs
Hire Freelancers

C Program on UNIX

$30-5000 USD

Terminado
Publicado hace alrededor de 22 años

$30-5000 USD

Pagado a la entrega
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. ## Deadline information Program MUST be completed by Monday January 28th at 12:00pm Central Time
ID del proyecto: 2836757

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 22 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$21,25 USD en 14 días
5,0 (53 comentarios)
5,4
5,4
2 freelancers están ofertando un promedio de $32 USD por este trabajo
Avatar del usuario
See private message.
$42,50 USD en 14 días
5,0 (14 comentarios)
3,5
3,5

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
9
Miembro desde ene 12, 2002

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.