Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two nodes on a wireless network. Node A is streaming data to node B. Most of the time it works fine, but sometimes there is packet loss and the stream is interrupted.

To improve performance and reduce packet loss, should I

  1. move node A to be closer to node B, or
  2. move node A to be closer to the base station

?

share|improve this question
    
Both modes are allowed, unless the AP explicitly forbade. The stations decide which next-hop address to use. –  Simon Richter Nov 28 '12 at 11:32
    
If you can switch from 2.4 to 5.x GHz, that'll help greatly with noise. There is a lot less noise on the 5GHz bands (because its less common, and also because its better blocked by walls). Of course, its better blocked by walls, so you may have signal strength issues, depending. –  derobert Dec 3 '12 at 17:58

4 Answers 4

up vote 25 down vote accepted

Move it closer to the Base station. Everything you send in typical wifi links goes to/from the base station. Ad-hoc connections are different, but not many use those.

Really, though, I expect your problem has to do with interference. That is much more likely to be the problem than distance. Here's the kicker: that interference may be your own signal.

With wifi, you may have a base station can do a hypothetical 65 Mbit connection. Unfortunately, that is not 65 Mbit for each node: that is 65 Mbit total, shared among not only nodes A and B, but also any other clients on that same channel in the same area. Worse, let's say one of your nodes is only able to get an 18 Mbit signal, and is actively using 3Mbit of that signal. That use scales proportionally to the max theoretical number for the base station. The client is using air time, not bandwidth, and so 3 Mbit of a total available 18 Mbit (one sixth) means it's using one sixth of the total theoretical 65 Mbit supported by the base station, or about 11 Mbit worth of air time. This leaves at most 54 Mbit for all other clients combined on the same channel in the same area. Worse than that, you can even get interference from devices on different channels, because the channel frequency ranges overlap (this is why 2.4Ghz radios should only ever use channels 1, 6, or 11 in the US).

In your situation, when A streams to B, you must upload the data to the base station, which must then resend it to B. That means you cut your available wireless bandwidth in half, because you're having to share. If A is also downloading its data for the stream from the internet you take a share away again, and you're down to one third of the original total. We also need to account for command and control information from the protocols used that must be transmitted. Worse than that, the bandwidth is not shared perfectly. Different nodes can try to send at the same time, resulting in collisions. When that happens, all colliding nodes must re-send the packet. As the traffic increases, the number of collisions increase. As the number of collisions increase, the amount of data needed to be re-transmitted increases, and the odds of additional collisions go even higher. This doesn't even begin to account for other interference sources like cordless phones, video game controllers, microwave ovens, wireless keyboards/mice, running water, etc. In the end, you may only have a small fraction of the original and reported 65 Mbit actually usable. Newer 5Ghz radios can help with this, but it's not a panacea; if you're sharing a base station, you're still sharing a single channel and still sharing your theoretical max among all clients of that base station.

If you really want good performance here, go wired or go home. Wired connections can fix the issues described above in three ways: they can provide a connection that is switched, full-duplex, and that is almost completely insusceptible to outside interference. Switched means that if each node has a 100 Mbit connection to the base, that is 100 Mbit devoted exclusively to that node. If two nodes try to send at the same time, the base is able to hold packets from one and forward them when the line is clear, reducing collisions and therefore reducing the need to re-transmit the same data. Full-duplex means that nodes are able to both send and receive at the same time... again, reducing collisions. Here, node A could be downloading stream data from the internet at the same time that it is sending it back towards B, with no interference or collisions.

In this case, because of all the re-transmission of the same data, you might see dramatic performance improvement if even one of nodes A or B has a wired connection.

A recent example where I'm at is that we deployed iPads to all the faculty this term at the college where I work. To support these devices, during the trial we deployed a few AppleTV devices to classrooms and connected them to the projector to support AirPlay mirroring from an iPad to the front of the classroom. We learned from this that leaving both the AppleTV and the iPad wireless did not work well, especially as we may have two instructors in neighboring rooms both wanting to do mirroring. The solution for us was to install software on the PCs in each room to support AirPlay mirroring to the PC, which is wired. We had to make some network changes so the classroom PCs were on the same subnet as iPads, but the result is much more reliable and with much better video quality.

share|improve this answer
    
I have seen a local file transfer within a G network go from < 100Kb per second to several megabytes per second, by logging in to the router and changing the channel. :) –  Kaz Nov 27 '12 at 22:02

You should (generally speaking) move both nodes closer to the WAP/base station/wireless router they're associated with, because, generally speaking, wireless traffic between nodes goes from the source, to a WAP/base station/wireless router, and then to its destination. (You mention the presence of a base station, so it's probably not the case that traffic is passing directly from one node to another, AKA: "ad-hoc mode.")

That said, distance isn't your only problem, or generally speaking, even the biggest problem. You need to consider absorption (the wireless signal is weakened as some of it gets absorbed passing through objects), reflection (the wireless signal bouncing around off of objects that reflect wireless signals and interfering with itself) and general interference. Since the wireless spectrums are unlicensed, and anyone can use them, "anyone" does use them. So your stream could well be getting interrupted when someone else nearby starts using their wireless network, talking on a wireless phone, or just from whatever other E/M transmissions are flying through the area.

Finally, there are (and always will be) frame collisions - when your WAP/base station/wireless router receives two transmissions at the same time. When this happens, it's resolved by the sender resending the frame, after a delay. And random E/M interference causes collisions, so if you're just in a noisy area for wifi, there may not be much you can do about it.

Really, the best way to improve performance is to use a wire - if both nodes are showing strong signal strength, there's generally not a whole lot you can do about it, unless you're willing to pay a fortune to have your wireless network insulated against outside interference (by installing materials to reflect and absorb external E/M transmissions at the edge of your wireless coverage zones).

share|improve this answer

Closer is (usually) better but there are other factors than distance when radio waves are involved.

  • Other signals. If there are other networks operating on the same frequency they may cause interference. You can download http://www.metageek.net/products/inssider/ and then use it to discover networks that might operate on the same band.
  • Walls. If there are thick walls between, epecially reinforced concrete, they might cause trouble.

If moving closer won't do it, try INSSIDER as I mentioned and follow the instructions.

share|improve this answer
    
+1 for inssider - a tool that recently helped me fix a slow wireless network. –  Mauro Nov 28 '12 at 8:30

With wireless networks in Infrastructure mode (when an AP is involved), all traffic goes through the access point. In ad-hoc mode, traffic goes directly from node-to-node.

That said, it's very possible that moving the nodes closer to the access point will not improve the situation. Wi-Fi operates in the unlicensed portions of the RF spectrum, which is shared by all manner of other wireless devices. As such, this portion of the spectrum can be very noisy at times. This kind of noise will cause lost packets, retransmits, etc.

Just connect the three devices with wired network cables and you'll see performance improve significantly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.