Wireless Networking

Challenges

  • Signal Strength
  • Interference from other sources
  • Bouncing off the walls interference
  • Moving around campus/town

Key Topics

  • CDMA
  • 802.11 Wireless Protocols
  • Cellular Internet Access
  • Mobile IP

CDMA

  • Used by Many US Carriers

    • Verizon
    • U.S. Cellular
    • Sprint
    • and others.
  • CDMA uses chipping codes to uniquely encode the signal from one phone.

    • Chipping codes exploit vector orthognonality! Yay Linear Algebra!
    • code1 = (1,1,1,-1,1,-1,-1,-1)
    • code2 = (1,-1,1,1,1,-1,1,1)
    • The dot product of code1 and code2 is 0, they are orthogonal.
    • When CDMA sends a bit it subdivides the bit into mini-bits or chips.

In [64]:
import random
code1 = array( (1,1,1,-1,1,-1,-1,-1) )
code2 = array( (1,-1,1,1,1,-1,1,1))

vdot(code1,code2)


Out[64]:
0

In practice the codes are much larger.

  • Represent a 0 with -1 and a 1 with 1
  • We can compute the code that is sent by taking the bit value (-1 or 1) and multiplying our code vector by the scalar.

In [51]:
bit1 = -1 * code1
bit2 = 1 * code1
print bit1
print bit2
bar(range(8),bit1)


[-1 -1 -1  1 -1  1  1  1]
[ 1  1  1 -1  1 -1 -1 -1]
Out[51]:
<Container object of 8 artists>

Now, on the receivers end, we take the incoming chipping vector, and do the dot product with the code and divide by the length of the vector.


In [52]:
print vdot(bit1,code1)/8
print vdot(bit2,code1)/8


-1
1

TADA!! We have our bits back. What happens if one or two of the chips get messed up?


In [53]:
flip = random.randrange(8)
print bit1
print 'flipping ', flip
bit1[flip] *= -1
print bit1
print vdot(bit1,code1)/8.0


[-1 -1 -1  1 -1  1  1  1]
flipping  0
[ 1 -1 -1  1 -1  1  1  1]
-0.75

Alright, how does this help in multiplexing multiple signals??

  • Through the magic of orthogonality
  • We can add multiple signals together and still recover them using our original plan!

In [54]:
s1b1 = -1 * code1
s1b2 = 1 * code1
s2b1 = 1 * code2
s2b2 = -1 * code2

bit1 = s1b1 + s2b1
bit2 = s1b2 + s2b2
print bit1
print bit2
bar(range(8),bit1)


[ 0 -2  0  2  0  0  2  2]
[ 0  2  0 -2  0  0 -2 -2]
Out[54]:
<Container object of 8 artists>

In [55]:
print vdot(bit1,code1)/8
print vdot(bit1,code2)/8


-1
1

Now its your turn.

  • Groups of 2
  • Use the following codes 3 and 4 as shown below
  • Choose a sequence of 3 bits
  • Encode the 3 bits using your code
  • Add your encoded bits to your partners encoded bits to come up with the transmitted signal
  • Now swtich codes and decode the message
  • does your message match your partners original message??
  • Now Get with another group and add use all four of our original codes
  • Once again exchange codes and check to see if your decoded message matches the original

In [65]:
code3 = array((1,-1,-1,-1,1,1,1,-1))
code4 =array((-1,1,1,1,1,1,1,-1))
vdot(code3,code4)


Out[65]:
0

In [68]:
bit11 = -1 * code1
bit12 = -1 * code2
bit13 = 1 * code3
bit14 = -1 * code4
signal = bit11+bit12+bit13+bit14
bar(range(8),signal)
print vdot(signal,code1)/8.0
print vdot(signal,code2)/8.0
print vdot(signal,code3)/8.0
print vdot(signal,code4)/8.0


-1.0
-1.0
1.0
-1.0

It looks like the efficiency of CDMA can approach .8 under the right conditions.

802.11

  • Ad-hoc versus infrastructure

  • Joining a Wireless Network

    • Beacon Frames
    • Association Request
    • Association Response
  • 802.11 MAC Protocol -- CSMA / CA

    • Cannot use CSMA/CD -- hidden terminal problem
    • We need to use ACKS!
    • Collision Avoidance!!
  1. If the channel is idle for DIFS, then transmit the frame immediately.
  2. Otherwise choose a random backoff value - exponential backoff and count down this value, but only when the channel is idle. If the channel is busy then the counter is frozen
  3. When the counter reaches 0 transmit the frame and wait for an acknowledgement. (Hmmm, sounds like stop-n-wait)
  4. If an ACK is received then success!
  5. If there is another frame to send then start at step 2
  6. If no ACK is recevied then go back to step 2

BUT -- No guarantees that this will avoid collisions.

So, we try to minimize the chance of a collision when we have a lot of data to send by using RTS / CTS -- This lets you reserve the channel for a period of time.

When a CTS is heard for another sender you must wait until you see the ACK for that data. - this fixes the hidden terminal problem by relying on the AP to send out the CTS.

What is Best case for efficiency?

$\frac{\frac{X}{11\times10^6}}{\frac{X}{11\times10^6}+789\times 10^{-6}}$

Where the 789 microseconds is the overhead for SIFS etc.

For

  • x = 1000 bytes 48%
  • x = 1500 bytes 58%
  • x = 2312 bytes 68%

BUT -- This is for a single sender with NO collisions or interferece. Typical efficiency is around 30%


In [ ]: