Candela Technologies Logo
Network Testing and Emulation Solutions

Running UDP Traffic with Android

Goal: Set up Android to be a LANforge resource and then run UDP traffic.

Requires LANforge 5.3.3 or later. Make sure to configure a realm other than 255 for the VAP system, this is because the Android device needs to be in the same realm to be managed. This cookbook will be using realm 195. You can find information on configuring realms using lfconfig starting from step 4 here.

This cookbook will go through installing and configuring LANforge on an Android device, then setting up a Layer-3 UDP connection between the Android device and another LANforge system. Multiple VAPs will be set up to demonstrate roaming. A bridged VAP setup is used (with the bridge as DHCP server) so the device can retain the same IP during roaming, this prevents the device from having to renew its IP saving some time between roams.

 
  1. First, we will set up the LANforge system so the Android device can connect.
  2. Create the first VAP.
    1. Go to the Port Mgr tab. screenshot
    2. Select wiphy0 and click Create. screenshot
    3. Select WiFi VAP and enter in the below values. screenshot
      1. Quantity 1
      2. STA ID: 0
      3. SSID: android-test
    4. Click Apply.
      1. Note: we will keep this window open for creating the second VAP.
  3. Create the second VAP. screenshot
    1. Select wiphy1 from the port drop-down menu.
    2. Update the STA ID and SSID with the below values.
      1. STA ID: 1
      2. SSID: android-test2
    3. Click Apply and close the Create Port window.
  4. Set up a bridge for both VAPs.
    1. Go to the Status tab, and click the Netsmith button for the AP system (Resource 1 in this example). screenshot
    2. Right-click in the Netsmith window and select New Router. screenshot
      1. Click OK to accept the default values.
      2. Click Apply in Netsmith.
    3. Right-click in the Netsmith window and select New Bridge. Then set the below values. screenshot
      1. Quantity: 1
      2. Bridge Name: br0
      3. IP Address: 195.1.2.1/24
    4. Click Apply and close the Create Port window.
    5. Click Sync in Netsmith and the br0 interface should appear.
    6. Drag the br0 interface into the virtual router. The interface box should change from black to green. screenshot
    7. Right click br0 and select modify. screenshot
    8. Select DHCP and use the below values.
      1. DHCP Lease Time: 300
      2. DHCP DNS: 195.1.2.1
      3. DHCP Range Min: 195.1.2.10
      4. DHCP Range Max: 195.1.2.20
    9. Click OK.
    10. Right click br0 and select Modify Port. screenshot
      1. Enter vap0 and vap1 into the text box as shown above.
      2. Click Add Ports.
      3. Click Apply then Sync. The Current Ports column should now show vap0 and vap1. screenshot
      4. Click OK to close the window.
    11. Click Apply in Netsmith.
  5. Create a redirect-device inside the virtual router. The Android will connect to this port for management purposes.
    1. Right-click in the Netsmith window and select New Connection. screenshot
      1. Select the Skip checkbox for Port 1-B, WanLink, and Port 2-B.
      2. Click OK
    2. Click Apply in Netsmith.
    3. Drag one of the rdd interfaces into the virtual router (rddVR0 is used in this example). The interface box should change to green. screenshot
      1. Note: The other rdd (rddVR1 in this case) will not be used and can be ignored.
    4. Click Apply in Netsmith.
    5. Right click rddVR0 and select Modify Port. screenshot
      1. Set the IP Address to 195.1.1.1/24
      2. Click OK.
    6. Close Netsmith.
  6. Set up the Android device.
    1. Install LANforge Resource from the Google Play Store. screenshot
    2. Once installed, connect your device to android-test using Android's WiFi setup. screenshot
    3. Launch the LANforge Resource app and set the values below. screenshot
      1. Realm 195
      2. Manager IP:port: 195.1.1.1
      3. Resource ID: 2
    4. Push the Apply button to apply changes and start LANforge. After 20-30 seconds the LANforge system should see the Android device connect. screenshot
  7. Create and run a Layer-3 UDP connection.
    1. Go to the Status tab, and click the Netsmith button for the AP system (Resource 1 in this example). screenshot
    2. Create a redirect-device inside the virtual router.
      1. Right-click in the Netsmith window and select New Connection. screenshot
      2. Select the Skip checkbox for Port 1-B, WanLink, and Port 2-B.
      3. Click OK.
      4. Click Apply in Netsmith.
      5. Drag rddVR2 into the virtual router. The interface box should change to green. screenshot
      6. Click Apply in Netsmith.
      7. Right click rddVR2 and select Modify Port. screenshot
        1. Set the IP Address to 195.1.3.1/24
        2. Click OK.
      8. Right click rddVR3 and select Modify Port screenshot
        1. Set the IP Address to 195.1.3.2/24
        2. Set the Gateway IP to 195.1.3.1
        3. Click OK.
      9. Close Netsmith.
    3. Go to the Layer-3 tab, click Create. screenshot
    4. Set the below values. Note that Endpoint B Resource will differ depending on the Android device type. screenshot
      1. CX Name: android-udp
      2. Endpoint A Resource: brent-523
      3. Endpoint B Resource: Nexus
      4. Endpoint A Port: br0
      5. Endpoint B Port: wlan0
      6. Endpoint A Min Tx Rate: T1 (1.544 Mbps)
      7. Endpoint B Min Tx Rate: Zero (0 bps)
      8. Report Timer: fast (1 s)
      9. Click OK.
    5. Start running traffic. screenshot
      1. Select the android-udp connection.
      2. Click Start.
    6. Connect your Android device to android-test2. Traffic should start flowing again after about 20-30 seconds. screenshot

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog