2
头图

Author: Sun Changhao (Fire Hot)

Quality assurance in a weak network environment has always been a recognized problem. In real life, everyone will encounter a weak network environment. For example, users in scenic subways, high-speed rails, elevators, and surrounding scenic spots will most likely encounter weak applications when using APP. Network scene. As a video content app, Youku’s network requirements are characterized by long duration and stable bandwidth, so it is particularly sensitive to weak network environments. In a weak network environment, users will encounter experience problems such as freezing and stopping playback. We can clearly see through the analysis of the buried point data that the error code types related to the network (weak network) account for more than half of the current online error codes. Therefore, in order to improve the online quality of the version and effectively simulate the online network environment, testing under a weak network environment is an indispensable part of offline testing.

Based on this, the Youku weak network platform starts from the actual pain points of the business, carries out standardized classification definitions for weak networks, accurately measures scenarios, accurately replays online backtracking data, and trains offline/online weak network model matching and training . Through a platform-based approach, it provides a unified use and access method, and continuously accumulates and precipitates clearer measurement indicators and reasonable standard judgments, so as to provide testers and developers with more effective weak network simulation models. This article will combine business scenarios to discuss the control principles, technical implementation and specific business usage of the Youku weak network test platform.

Weak network cognition and principle

Weak network awareness

Weak networks do not have strict indicators to define. In fact, it can be understood as a kind of somatosensory description that users have poor service experience due to signal fluctuations, network congestion and other reasons when they actually use personal services.

According to the user's actual scenario, there are generally two reasons for a weak network:

  1. Physical hardware causes: For example, too far away from the router, low signal strength, and large surrounding interference, resulting in high bit error rate, etc., will lead to a weak user network;
  2. IP network transmission performance is weak: such as network node performance overload, operator network restrictions, inter-network transmission and so on.

You can refer to the figure below for understanding

Through the above two scenarios, it can be seen that the overall network structure is relatively complex, and there are problems that are difficult to simulate and cannot be quantified, and it is impossible to formulate a unified standard. Therefore, we try to quantify in other ways. By referring to the RFC2544 document, we know that the way to measure network performance can be measured in four dimensions: throughput, packet loss rate, delay, and back-to-back to define standards. Because back-to-back mainly tests forwarding capabilities, most of them use the first three items to measure.

Principles of Weak Network Control

According to the TCP/IP protocol transmission process in the figure below, there are mainly two scenarios for weak network control: hardware control and software control.

1. Hardware control

It is mainly controlled by a signal attenuator and noise generator, and the increase in the bit error rate in the network is controlled by the attenuation of the signal and the size of the noise, which affects the delay, bandwidth and bit error of the received signal at the application layer. Currently, wifi performance The test project mainly uses this method, but this method can only be controlled qualitatively at present, and cannot be controlled quantitatively.

2. Software control

At present, the mainstream is only used for the flow control of the Linux kernel through the flow controller TC (Traffic Control) in the Linux operating system, mainly by establishing a queue at the output port to achieve flow control.

After the received packet comes in from the input interface, the data packet that does not meet the requirements is discarded after the flow limit, and the input demultiplexer judges and chooses: if the destination host of the received packet is this host, then the packet is sent to the upper layer for processing, otherwise it is required To forward, the received packet is handed over to the forwarding block (Forwarding Block) for processing. The forwarding block also receives packets generated by the upper layer (TCP, UDP, etc.) of the host, and determines the next hop of the processed packet by looking at the routing table. Then, arrange the packets to send them to the output interface. Generally, only the data packets sent by the network card can be restricted, and the data packets received by the network card can not be restricted, so the transmission rate can be controlled by changing the sending order. Linux flow control is mainly processed and realized when the output interface is arranged, as shown in the following figure:

Most routers and Raspberry Pis currently use this method. In addition, the equipment provided by some third-party equipment manufacturers is mostly based on this model, but more packaging is carried out on the upper layer. This method can achieve quantitative control but not qualitative control. Therefore, Youku weak network platform supports quantitative software control and qualitative hardware weak network control based on the actual user scenario.

Youku weak network platform technology implementation

Platform network topology

In order to allow each user to use the weak network platform conveniently, after many evaluations and discussions, the method of network proxy is finally adopted to intercept and control network traffic. This has the advantage of strong versatility, whether it is Android or Both iOS and Windows systems have their own network proxy function, so the user can directly set the network proxy on each end and use it without installing the application. The specific network topology is as follows:

Platform layered functional architecture diagram

The development of Youku's weak network platform adopts a layered implementation model, which is divided into three layers in general:

  • The bottom physical layer adopts the real machine and shielded box mode, which can directly control the weak network signal of the real machine of the shielded box;
  • The WIFI weak network control layer is controlled by the TC server;
  • The user front-end page provides equipment and scene management, status display and other functions.

Platform functions and business applications

The platform can support weak network test range

From the perspective of the app, the scope of weak network testing is very wide, and the optimization of the app is also very important. The following figure is a summary of some of the functions of the test items commonly used in weak networks. The current platform tests for these weak networks are all Can be supported.

Weak network classification standardized definition

Most developers describe the definition of a weak network in such a way as bad, good, bad, etc. This description is only a qualitative way. In view of many developments to solve the problem, it is only analyzed to this point, one sentence of network problems, later The problem is over. The Youku weak network platform can easily perform some performance comparisons through the hierarchical and quantitative definition of the weak network parameters, so that the development can be optimized.

The hierarchical quantification of the weak network is as follows:

The figure below is a comparison of the quantitative weak network data of different levels. It is easy to find the differences of the products:

Through the above picture, you can only use low-speed scenes and high-packet-loss scenes, and the Youku app can also provide product experience optimization.

Youku's weak network experience continues to be optimized

Youku’s business is mainly audio and video playback, which requires very high network stability. Therefore, some experience accumulated in the optimization of weak networks mainly starts from the collection of network data and collects according to the actual network conditions of users. At the weak network strategy layer, the collected network data is entered and exited in the weak network state to make strategic judgments. When the user is in the weak network state, the offline data strategy matching is used to match the actual scene of the online user. Finally, the effect of network optimization is achieved. For details, please refer to the following figure:

1. Definition of User Weak Network Scenarios

Youku weak network scenario: When users are watching Youku videos, at what time and place they encounter problems that cause the user to have too long loading time or unable to start the playback. This scene has regularity and certainty.

Based on the above Youku weak network scenario, we measure some characteristics of the weak network, and based on the measurement data, we simulate the real user scenario in the laboratory. The following figure is a part of the actual measurement simulation of the user scenario.

The following figure shows the waveform playback of the user scenario and the actual test effect:

2. Continuous optimization process of weak network

It is reproduced in the weak network laboratory that the user is playing loading or unable to start the broadcast. For example, it is also detected that the user will be playing and loading in the subway. According to the user's scene detection, various methods such as large buffer cache in advance before the subway or prompt user cache in advance can be carried out. Once the user has a weak network scenario, the strategy will be hit and optimized. The main flow chart is as follows:

Through user optimization and strategy matching in the specific scenarios of weak networks, the user experience in the playback of weak network scenarios has been continuously improved.

Real machine weak network

4G signal and WIFI signal, different signal sources have natural differences. Therefore, the weak network test in the case of 4G network requires a more complicated environment, a special shielded room is required, and the cost is higher. Youku weak network The platform adopts the shielding cabinet + real machine platform + attenuator to provide real weak network scenarios. On the real machine platform, users can perform real weak network simulation with one key.

The picture below is: a shielding cabinet that supports signal attenuation

The picture below is: signal attenuation scene

The following figure is: some relationship diagrams of download rate under different signal attenuation conditions:

Single-point access capability of the national network

In our actual business, due to various reasons such as operator network and CDN congestion, single-point network problems often occur. Youku weak network platform can quickly locate single-point problems and solve them efficiently by direct agents to cities across the country. .

Comparison of various weak network solutions

Summary and outlook

Youku's weak network simulation platform, through agency methods and platform-based services, greatly breaks through the environmental constraints required for weak network testing. At present, the weak network can be tested at any time, but 5G networks, IPV6 networks, and IOT equipment are deployed in large numbers , The network environment we face is more complicated, and the network topology is getting more and more complicated. How to simulate these networks in the laboratory is still a problem. In addition, how to automate the positioning and recovery of online networks is also a content that needs continuous research. Weak network platforms will make efforts in these directions in the future. I hope that more students who are interested in the Internet will grow into experts in the Internet together in the future.

, 3 mobile technology practices & dry goods for you to think about every week!


阿里巴巴终端技术
336 声望1.3k 粉丝

阿里巴巴移动&终端技术官方账号。