24
Matthias Schulz An Object-oriented Framework to Speed Up WARP-SDR Development Scandinavian workshop on testbed based wireless research Stockholm, November 27th, 2013

Matthias Schulz An Object-oriented Framework to Speed Up …perz/swtbwr2/2013/slides/Matthias... · 2013. 11. 29. · Slide 3 NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz Introduction

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • Matthias Schulz An Object-oriented Framework to Speed Up WARP-SDR Development

    Scandinavian workshop on testbed based wireless research Stockholm, November 27th, 2013

  • Slide 2

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    §  Introduction to WARP and WARPLab §  Scenario/Motivation §  Object-Oriented WARPLab Framework §  Coding Examples §  Channel Model §  Abstraction from Physical Nodes §  Wrap-Up

    Content

    An Object-oriented Framework to Speed Up WARP-SDR Development

  • Slide 3

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Introduction to WARP

    An Object-oriented Framework to Speed Up WARP-SDR Development

    Virtex 6 FPGA FMC Expansion 2.4/5 GHz Radio Interface

    2 GB RAM 1 Gb/s Ethernet

  • Slide 4

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Introduction to WARPLAB

    An Object-oriented Framework to Speed Up WARP-SDR Development

  • Slide 5

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Development of a new algorithm §  Theory on paper §  First prototype in MATLAB §  Simulation in MATLAB §  Iterative improvements §  Evaluation on real channels

    with WARP and WARPLAB §  Iterative improvements §  optional: Real-time

    implementation in FPGA

    Scenario/Motivation

    An Object-oriented Framework to Speed Up WARP-SDR Development

    e = mc2

    Xk =N�1X

    n=0

    xne�j2⇡k nN

    f(x) =1

    p2⇡

    e

    � 12 (x�µ�

    )2

    ↵ 2 [��;⇡]

    Two separate scripts/programs

  • Slide 6

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Experiment Experiment

    OO WARPLab Framework

    Design of our Object-Oriented WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    WARPLab

    WARP Hardware

    Simulation

    Channel Model

  • Slide 7

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    WarpLab 6 Example Transmission using Radio 2 of WARP Node 1

    An Object-oriented Framework to Speed Up WARP-SDR Development

    warplab_defines  [socketHandles,  packetNum]  =  warplab_initialize;  udp_Sync  =  socketHandles(1);  udp_node1  =  socketHandles(2);  warplab_writeRegister(udp_node1,TX_LENGTH,2000);  warplab_setRadioParameter(udp_node1,CARRIER_CHANNEL,14);  warplab_setRadioParameter(udp_node1,RADIO2_TXGAINS,(40  +  3*2^16));  TxData  =  exp(linspace(0,2000/40e6,2000)*j*2*pi*1e6);  warplab_writeSMWO(udp_node1,  RADIO2_TXDATA,  TxData);  warplab_sendCmd(udp_node1,  RADIO2_TXEN,  packetNum);  warplab_sendCmd(udp_node1,  RADIO2TXBUFF_TXEN,  packetNum);  warplab_sendCmd(udp_node1,  TX_START,  packetNum);  warplab_sendSync(udp_Sync);  warplab_sendCmd(udp_node1,  RADIO2TXBUFF_TXDIS,  packetNum);  warplab_sendCmd(udp_node1,  RADIO2_TXDIS,  packetNum);  pnet('closeall');  

    What do we need to

    change to transmit

    using radio 1?

  • Slide 8

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Experiment

    OO WARPLab Framework

    Design of our Object-Oriented WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    WARPLab

    WARP Hardware

    Simulation

    Channel Model

  • Slide 9

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    OO WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    CWarplab

    CWarpnode

    CWarpnode

    CRadio CRadio

    CRadio CRadio

  • Slide 10

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    OO WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    CWarplab

    CWarpnode

    CWarpnode

    CRadio CRadio

    CRadio CRadio

    warplab  =  CWarplab(  ...  

       CWarpnode(  ...  

           'radio1',  CRadio(),  ...  

           'radio2',  CRadio(),  ...  

       ),  ...  

       CWarpnode(...  

           'radio1',  CRadio(),  ...  

           'radio2',  CRadio(),  ...  

       )  ...  

    );  

  • Slide 11

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    WarpLab 6 Example Transmission using Radio 2 of WARP Node 1

    An Object-oriented Framework to Speed Up WARP-SDR Development

    warplab_defines  [socketHandles,  packetNum]  =  warplab_initialize;  udp_Sync  =  socketHandles(1);  udp_node1  =  socketHandles(2);  warplab_writeRegister(udp_node1,TX_LENGTH,2000);  warplab_setRadioParameter(udp_node1,CARRIER_CHANNEL,14);  warplab_setRadioParameter(udp_node1,RADIO2_TXGAINS,(40  +  3*2^16));  TxData  =  exp(linspace(0,2000/40e6,2000)*j*2*pi*1e6);  warplab_writeSMWO(udp_node1,  RADIO2_TXDATA,  TxData);  warplab_sendCmd(udp_node1,  RADIO2_TXEN,  packetNum);  warplab_sendCmd(udp_node1,  RADIO2TXBUFF_TXEN,  packetNum);  warplab_sendCmd(udp_node1,  TX_START,  packetNum);  warplab_sendSync(udp_Sync);  warplab_sendCmd(udp_node1,  RADIO2TXBUFF_TXDIS,  packetNum);  warplab_sendCmd(udp_node1,  RADIO2_TXDIS,  packetNum);  pnet('closeall');  

    What do we need to

    change to transmit

    using radio 1?

  • Slide 12

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    warplab  =  CWarplab(...          CWarpnode(...                  'radio2',  CRadio(...                          'dir',  'tx'...                  ),  ...                  'txlength',  2000  ...            )...  );    TxData  =  exp(linspace(0,2000/40e6,2000)*j*2*pi*1e6);  warplab.nodes(1).radio2.txdata  =  TxData;  warplab.transferDataStartTransmission();  pnet('closeall');        

    OO WARPLab Framework Example Transmission using Radio 2 of WARP Node 1

    An Object-oriented Framework to Speed Up WARP-SDR Development

    What do we need to

    change to transmit

    using radio 1?

  • Slide 13

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Experiment

    OO WARPLab Framework

    Design of our Object-Oriented WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    WARPLab

    Simulation

    Channel Model

    Experiment and Simulation

    OO WARPLab Framework

    WARPLab 6/7/…

    WARP Hardware Channel Model Channel Model

  • Slide 14

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Channel Model

    An Object-oriented Framework to Speed Up WARP-SDR Development

    Impulse response Frequency Response

    DFT

    DFT

    |H11| |H12|

    |H21| |H22| f f

    f f

    t

    t

    t

    t

    ANTRX 1

    ANTRX 2

    ANTTX 1

    ANTTX 2

  • Slide 15

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Channel Model

    An Object-oriented Framework to Speed Up WARP-SDR Development

    TX1 RX1

    RX2TX2

    h11h12

    h21

    h22

    Convolution of TX signal with channel

    impulse response

    RX2 = TX1 ⇤ h21 + ⌘1 + TX2 ⇤ h22 + ⌘2

    RX1 = TX1 ⇤ h11 + ⌘1 + TX2 ⇤ h12 + ⌘2

    Additive white Gaussian noise

    (AWGN)

  • Slide 16

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    N1 N2 N3 N1 N2 N3 N1 N2 N3

    Channel Representation in MATLAB

    An Object-oriented Framework to Speed Up WARP-SDR Development

    t

    h

    N1 N2

    node N1 node N2 node N3

    N3

    IF1 IF2

    IF1 IF2

    IF1 IF2

    • DIM1: Impulse Response • DIM2: Transmit Node • DIM3: Transmit Antenna (here: IF1 (orange), IF2 (green)) • DIM4: Receive Node (here: N1) • DIM5: Receive Antenna (here: IF1)

    N1 N2 N3 N1 N2 N3

    DIM4: N2 DIM5: IF1

    DIM4: N3 DIM5: IF1

    DIM5: IF2 DIM5: IF2 DIM5: IF2

  • Slide 17

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    ntap  =  5;  online  =  0;  warplab  =  CWarplab(...          CWarpnode(...                  'radio1',  CRadio(),  ...                  'radio2',  CRadio(),  ...                  'radio3',  CRadio(),  ...                  'radio4',  CRadio(),  ...                  'txlength',  2000  ...            ),...          'offline_channel',  (randn(ntaps,1,4,1,4)  +  ...                  1j  *  randn(ntaps,1,4,1,4)),  ...          'awgn_matrix',  25  *  ones(1,1,4,1,4),  ...          'online',  online  ...  );  

    Channel Representation in MATLAB

    An Object-oriented Framework to Speed Up WARP-SDR Development

    No. of TX Nodes No. of TX Antennas/Node No. of RX Nodes No. of RX Antennas/Node

    0 = simulation; 1 = use WARPs

  • Slide 18

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Experiment

    OO WARPLab Framework

    Design of our Object-Oriented WARPLab Framework

    An Object-oriented Framework to Speed Up WARP-SDR Development

    WARPLab

    Simulation

    Channel Model

    Experiment and Simulation

    OO WARPLab Framework

    WARPLab 6/7/…

    WARP Hardware Channel Model Channel Model

  • Slide 19

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Abstraction from Physical Nodes

    An Object-oriented Framework to Speed Up WARP-SDR Development

    6x4 MIMO

    Channel

    6x2 MIMO Channel Alice

    Bob

    Eve

  • Slide 20

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    alice_if  =  [  ...          struct('node',1,'radio',1)  struct('node',1,'radio',2)  ...          struct('node’,2,'radio’,1)  struct('node’,2,'radio’,2)  ...          struct('node’,3,'radio’,1)  struct('node’,3,'radio’,2)  ...  ];  alice  =  CNode(warplab,  alice_if,  1);      bob_if  =  [  ...          struct('node’,4,'radio',1)  struct('node’,4,'radio',2)  ...          struct('node’,5,'radio',1)  struct('node’,5,'radio',2)  ...  ];  bob  =  CNode(warplab,  bob_if,  2);    eve_if  =  [  ...          struct('node’,6,'radio',1)  struct('node’,6,'radio',2)  ...  ];  eve  =  CNode(warplab,  bob_if,  3);    

    Abstraction from Physical Nodes

    An Object-oriented Framework to Speed Up WARP-SDR Development

  • Slide 21

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    Abstraction from Physical Nodes

    An Object-oriented Framework to Speed Up WARP-SDR Development

    6x4 MIMO

    Channel

    6x2 MIMO Channel Alice

    Bob

    Eve

    |H|

    f

    OFDM Each subchannel represented by only one complex number

  • Slide 22

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    nsym  =  100;  %  100  OFDM  symbols  NFFT  =  128;  %  Number  of  subcarriers  %  Create  BPSK  symbols  frame1  =  randi([0  1],  length(alice_if),nsym,NFFT)*2-‐1;  %  Set  unusable  subcarriers  to  zero  and  adjust  power  frame1(:,:,[1:6  64:66  124:128])  =  0;  frame1  =  frame1  /  sqrt(114)  /  sqrt(length(alice_if));  %  Start  transmission  alice.transmit_frame(frame1,40,2,0.01);  warplab.transferDataStartTransmission();  alice.clean_transmission();  %  Get  received  frame  and  estimated  channel  [frame,  channel]  =  bob.receive_frame();        

    Applying the Abstraction

    An Object-oriented Framework to Speed Up WARP-SDR Development

    Bandwidth = 20 or 40 MHz Preamble repetition pre-transmission CFO corr.

  • Slide 23

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz

    §  Introduction to WARP/WARPLab §  Object-Oriented WARPLab Framework §  use the same code base for simulation and

    experimentation §  Abstraction from Physical Nodes §  Combine multiple nodes into logical named nodes §  Use OFDM to abstract from the fading channels

    Wrap-Up

    An Object-oriented Framework to Speed Up WARP-SDR Development

  • Slide 24

    NOV-27 | TU Darmstadt | SEEMOO | Matthias Schulz An Object-oriented Framework to Speed Up WARP-SDR Development

    Matthias Schulz Department of Computer Science SEEMOO Mornewegstr. 32 64293 Darmstadt/Germany [email protected]

    Phone +49 6151 16-70928 Fax +49 6151 16-70921

    www.seemoo.tu-darmstadt.de