Author Topic: Logic Behind Router and Multiple Devices  (Read 2120 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Logic Behind Router and Multiple Devices
« on: April 22, 2009, 10:56:41 PM »
I'm designing a system that is very similar to wifi and I was wondering how wifi supports multiple devices. I know that the router and the devices have transceivers. So how does the router "talk" to multiple devices at once if it only has one transmitter in its transceiver? Or if it doesn't do it at once , how does it coordinate, I mean devices are constantly talking back and forth with it.... whats the logic in the code?

My logic to go about it is to do the following:
Code: [Select]
Device sends a request data info to the router with its address posted
Router checks for requests when its free ( aka done transmitting data to the last device that wanted it0
Router sends the data with an address of hte device posted so only that device reads the data
But then if multiple devices are constantly sending requests over the same frequency and same channel, then you have interference, so how can you do multiple devices???
How does wifi do it? How would you do it?
Check out the Roboduino, Arduino-compatible board!

Link: http://curiousinventor.com/kits/roboduino


Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: Logic Behind Router and Multiple Devices
« Reply #1 on: April 23, 2009, 03:07:02 AM »
you are describing one of the problems in any point to multi-point protocol.
i can think of 2 simple ways of addressing this:

you assign one system bus master.
the master controls all communication. it sends a data request to a specific address. the device with that replies with the requested data.
the down side of this system is the master needs to know about all the other devices in advance.

there is a random delay before any device transmits data.
any device can transmit data to any other device. the other device will reply with an ACK (acknowledge) packet.
before a device transmits the first thing it does is check the channel to see if anything else is transmitting. if the channel is busy then it waits.
even if the channel appears to be clear it is possible that there is another device out of range (but in range of the recipient) using the channel.
if no ACK is received in reply to a transmission then a random delay is inserted before a retry.
this way with luck the delays will be of different lengths and the 2 transmitting stations will send data at different times on the retry.
this system is far less efficient but it means any node can communicate with any other node without the need of a bus master.

your wifi router uses a more complicated system but generally more similar to #2.
the RFCs on IEEE 802.11 are available online but they are heavy reading.


Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: Logic Behind Router and Multiple Devices
« Reply #2 on: April 23, 2009, 03:17:17 PM »
I don't know if what I say is similar to what Dunk said...
But hey... you can simply use timeslots!!! ::)
For whom the interrupts toll...


Get Your Ad Here