Weak network testing software routing Environment on routing software installation openwrt native system, and tc use a weak network simulation environment netem

This article documents a way to solve simulated blood and tears weak network environment in the soft route, spent a day to solve the various problems

For traffic to be analyzed, especially the weak network environments, such as the need to increase incremental delay, the quantitative loss of students to build environmental issues

Currently seen only in a virtual host environment or go on doing this, are analog, this time in a real network, deployed on a flexible routing equipment.

 

Let me talk about a few things right:

Soft route, is a small and specialize in routing host forwarding (you can also use a laptop when idle soft route), based on various linux systems. For example is the fire LEDE and IKUAI, understand routing software junior partner must know this

OpenWRT, a highly modular, highly automated embedded Linux systems, components and has a strong network scalability, is often used in industrial equipment, telephones, small robots, intelligent home, routers and VOIP equipment. And there are a lot of software support, you can automate the generation of many features packed into different customized version of the firmware.

LEDE is based on a branch of OpenWRT, famous koolshare forum, several big God is the center of LEDE-based software development, is very convenient.

tc, Linux kernel built a TC (Traffic Control) framework that can achieve rate limiting, traffic shaping, policy application (discard, NAT, etc.).

netem, is Network linux kernel emulation services provided, the delay can be used to simulate a wide area network, packet loss, duplication, disorder and damage problems. linux distributions after the 2.6 version of the netem have been enabled in the kernel.

tc can be used to control the operating mode netem, that is, you want to use netem, you need to open the netem kernel, and tc tool installed.

 

Why should I do this on the soft route:

Here is mainly because the project needs, there is need to study the effects of latency and packet loss of the great scenes of poor quality applications and quality of service, so the need for fixed quantitative data packet forwarding control

tc and netem can do, can be done to control for each card.

E.g:

qdisc add dev eth3 root netem loss 30%

Increase eth3 card random packet loss 30%, pingbaidu facie effect:

qdisc add dev eth3 root netem delay 100ms

Increase the eth3 card 100ms delay, pingbaidu facie effect:

 

 My soft brush before routing is LEDE firmware, then I think of ways that installed the version of the kernel kmod-netem, but once use will lead to a system crash the router reboot. This should be a crazy random change of the system firmware automatically detects the operating state, it has led to abnormal restart.

Then I brushed aside ikuai firmware up, ikuai pit too, and do not give into the background, after all, is the company's products, not open source. So there will be a demand for native openwrt installed, followed by relatively smooth, and above all stepped pit.

 

Native openwrt mounting system, and tc use netem:

Go download the official firmware, for everyone to address it http://archive.openwrt.org/releases/18.06.1/targets/x86/64/,

The first is written directly to the SSD, the second can be used to upgrade the old peach PE I write, the next is the second, in fact, can.

Then img file written to extract the old peach with soft route SSD, start, openwrt native system works even better.

Computer set a fixed ip192.168.1.2, subnet mask of 255.255.255.0 can access the control interface, 192.168.1.1, the initial password is admin

 

 In the network - local interface, configure their own look, soft routing even then achieved. When I met with a background can ping Baidu, but the situation is not on the computer outside the network, and then looked at is only set up IP, dns not manually set, I put ip and dns set to take the initiative to get on it .

Even more native openwrt good brush, the system - the management of places to set up ssh, you can use ssh 192.168.1.1 to access the router through the background.

I'm here to luci finished a bit, is this a finished web page. Is running in the background: opkg install luci-i18n-base-zh-cn, you may need to opkg update.

Tc installation and netem:

linux2.6都自带tc和netem,但是有些很轻量级的linux就没,比如这个原生的openwrt18.06.01

安装方法就非常简单了

直接 opkg install tc 就可以了,netem在本版本下是自带的内核模块。

不行的也可以opkg install kmod-netem 一下。

 

然后就大功告成了!真的很简单,给专门的运维人员来做,半小时就弄好了。

 

 

 

 

Guess you like

Origin www.cnblogs.com/CooperXia-847550730/p/11942812.html