Facebook Network Simulation Tool ATC deployment and use

Source: Internet
Author: User

Nonsense quote:

Facebook has previously open source to enhance the network traffic Control tool ATC, to use WiFi network to simulate a variety of mobile networks, testing the performance of smartphones and apps in different countries and application environments. ATC is capable of simulating 2G, 2.5G (Edge), 3G, and lte4g network environments, and test engineers can quickly switch between different analog network environments.

ATC can simulate the user experience in a real-world network environment, and the purpose of the ATC is to ensure that more people, especially in developing countries, have the best app experience.

Previous media reports Zuckerberg asked Facebook employees to use low-end smartphones to feel the experience of the real users of low-and remote-area users.

To get a real-world network test environment, Facebook initially tried to deploy a 2G network at the company campus, but was dropped because the 2G base station, which could run open source software, was difficult to procure. Finally, Facebook chose to use WiFi network traffic control to simulate data communication for 2G low-speed cellular networks in Brazil, India, Nigeria and the Philippines.

Body:

ATC has two of the most attractive features:

    1. You can switch between different network environments at any time via the Web interface on your phone.
    2. Multiple phones can be connected to the same WiFi, the network environment between the simulation of each other does not affect.

You can imagine this scenario: a Bunch of program apes and test monkeys in full swing in the office, when there is a hot spot called ATC WiFi, anyone can connect the phone up, through the Web interface to switch to a variety of different network environment for debugging and testing ...

How to do it online:

ATC can only run on Linux, so it's a little cumbersome to build a deployment. There have been some deployment methods on the Internet to explain how to build an ATC environment in a virtual machine. Here are a few steps:

    1. VMware installed Ubuntu System.
    2. Unless your machine has a wireless card, find a USB wireless card to set up a WiFi hotspot.
    3. Deploy ATC

The WiFi hotspot feature is set in Ubuntu and can be opened directly in the system's own tool. However, because it is Ad-hoc mode, the Android phone can't find the signal at all. So you have to set up AP mode to get the Android phone to search. Reference: http://my.oschina.net/eechen/blog/227230, according to the general setting is OK.

My method:

But I tried the above method and failed on two computers, so I didn't use the virtual machine method. I use a dual-system approach, roughly the following steps:

    1. The WINDOW7 base is fitted with a dual system deepin-linux.
    2. Deepin can identify the network card well, need the wireless network card to support AP mode, and then install Kde-nm-connection-editor, set up a wireless WiFi hotspot.
    3. Deploy ATC.

Installing the Deepin-linux dual system:

System Download: http://www.deepin.org/download.html

make USB drive Boot disk: Deepin boot made link: Http://pan.baidu.com/s/1pJVTvOR Password: a93q

Additional installation steps refer to: http://jingyan.baidu.com/article/359911f557e77a57fe030613.html

Note: A Linux installation requires 4 disks://home/boot Swap

To see if the NIC supports AP mode:

sudo apt-get install Iwsudo IW list

  

  

To install Kde-nm-connection-editor, set up a wireless WiFi hotspot:

Installation:

sudo apt-get install plasma-nm

Configuration-Terminal input:

sudo kde5-nm-connection-editor

Click Add and select Wireless (Shared).

The SSID is the wireless name, like mine is Tiankonguse.

Mode Select Access Point.

can go to Wireless Security set a password, WPA & WPA2 Personal that one. (Password must be greater than 8 bits)

  

Then click OK to save, select the new network in the network list, then click Connect, after the connection is successful, you can use the mobile phone to search for WiFi connection.

  

Deploy ATC:

Take a look at the official document Https://github.com/facebook/augmented-traffic-control steps are written clearly.

1. Install Python, pip

2. The Django components required to install ATC via PIP

Pip install atc_thrift atcd django-atc-api django-atc-demo-ui django-atc-profile-storage

3. Create a Django project to use the ATC server app

Django-admin Startproject Atcuicd Atcui

4, enter the Atcui directory, note that there are two levels of directories, edit settings.py, in Installed_apps add the following content

    ' Django_static_jquery ',    ' bootstrap_themes ',    ' Atc_api ',    ' atc_demo_ui ',    ' atc_profile_storage ',    ' Rest_framework ',

5, edit urls.py, add the following content

From Django.views.generic import redirectviewadmin.autodiscover () Urlpatterns = Patterns (    "',    url (r ' ^admin/') , include (Admin.site.urls)),    URL (r ' ^api/v1/', include (' Atc_api.urls ')),    URL (r ' ^api/v1/profiles/', include (' Atc_profile_storage.urls '),    url (r ' ^$ ', Redirectview.as_view (url= '/atc_demo_ui/', Permanent=false)),    URL (r ' ^atc_demo_ui/', include (' Atc_demo_ui.urls ')),) Urlpatterns + = static (settings. Static_url, Document_root=settings. Static_root)

  The above 4\5 two steps can be used ATC download source package in the/augmented-traffic-control-master/docker/atcui_tpl/inside the settings.py, urls.py, directly covered The file in the Atcui directory is OK.

6. Update the database

Python manage.py Migrate

7. Start ATC Service

sudo atcd--atcd-lan wlan0--atcd-wan eth0

8. Start the Django Project

sudo python manage.py runserver 0.0.0.0:8080

  

9, mobile phone connected to the ATC WiFi, access to http://192.168.0.1:8080 IP address to the actual WiFi address is subject to

will be able to access the ATC Network simulation page on the phone, in addition to Android Pro-son mobile phone access is normal, other mobile browser access to the UI is a bit abnormal. You can use it on the line.

this is probably because other ROMs don't have a Google service framework, and trying to install chrome on other phones doesn't start.

  

However, such a page is not configured, in order to increase the configuration, we have to continue the following operation.

10. Add the configuration of common network configured for us in Facebook project

git clone https://github.com/facebook/augmented-traffic-control.git

After downloading the code, enter the project file and execute the following command:

Utils/restore-profiles.sh localhost:8080

Then refresh the page on the phone, there are some common network simulation options.

To toggle the configuration: Just click on the "Select" button next to the configuration and click on the "Update Shaping" button above

  

In the mobile phone interface, you can set the network upstream downlink, the main parameters are: network bandwidth (bandwidth) delay (latency) packet loss (packet loss) error rate (corrupted packets) disorder Rate (packets or Dering) by setting the above parameters, you can simulate a variety of commonly used network environment, such as: 2g,3g,4g,wifi and so on, but also can simulate some anomalies, such as poor signal, delay is very large, the case of high packet loss rate.

  

Actual network usage can be viewed on the phone using the network detection Tool speedtest.

Facebook Network Simulation Tool ATC deployment and use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.