facebookarchive / augmented-traffic-control

Augmented Traffic Control: A tool to simulate network conditions
https://facebook.github.io/augmented-traffic-control
Other
4.33k stars 600 forks source link

hmm... it didnt work; #109

Closed kimjungyeon closed 9 years ago

kimjungyeon commented 9 years ago

now, i run atcd, ui on my linux! but it seem to be not work; i am testing it with my galaxy s3, galaxy note pro, galaxy note4 and galaxy s6 but the internet speed stay he's speed... now, i do not know hardly.... :-(

  1. This is my NIC ap1 ---------------------eth0 | eth1 ---------------------------- ap2 ------------ adsl-----outside (mobile use this) atcd (connect lan)

eth0 Link encap:Ethernet HWaddr 50:e5:49:c5:b8:a1
inet addr:100.100.100.1 Bcast:100.100.100.255 Mask:255.255.255.0 inet6 addr: fe80::52e5:49ff:fec5:b8a1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:201393 errors:0 dropped:0 overruns:0 frame:0 TX packets:127033 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:253012273 (253.0 MB) TX bytes:66468821 (66.4 MB)

eth1 Link encap:Ethernet HWaddr 00:26:66:49:bd:2b
inet addr:172.4.29.250 Bcast:172.4.29.255 Mask:255.255.255.0 inet6 addr: fe80::226:66ff:fe49:bd2b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:129530 errors:0 dropped:0 overruns:0 frame:0 TX packets:203506 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:68030587 (68.0 MB) TX bytes:253298652 (253.2 MB)

eth2 Link encap:Ethernet HWaddr 00:26:66:40:dc:1e
UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:1192 errors:0 dropped:0 overruns:0 frame:0 TX packets:1192 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:993299 (993.2 KB) TX bytes:993299 (993.2 KB)

  1. and this is iptables eth0 and eth1 is connected very well 201K 250M ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0
  2. when i use the command that "sudo atcd" , the log like this root@ahnlab3-Z68A-D3H-B3:/home/ahnlab3# atcd INFO:AtcdVService.AtcdNBServerTask:AtcdNBServerTask Server Started on 127.0.0.1:9090 INFO:AtcdVService.AtcdLinuxShaper:Calling initialize_shaping_system INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -F FORWARD INFO:AtcdVService.AtcdLinuxShaper:deleting root QDisc on eth1 INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on eth1 INFO:AtcdVService.AtcdLinuxShaper:deleting root QDisc on eth0 INFO:AtcdVService.AtcdLinuxShaper:setting root qdisc on eth0 INFO:AtcdVService.AtcdLinuxShaper:Restoring shaped connection from DB INFO:AtcdVService.AtcdLinuxShaper:Request startShaping TrafficControl(device=TrafficControlledDevice(controllingIP='100.100.100.10', controlledIP='100.100.100.10'), timeout=19691.920253753662, settings=TrafficControlSetting(down=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=20000, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)), up=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=20000, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)))) INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 100.100.100.10 on interface eth0 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth0, classid 1:2,parent 1:0, rate 20000kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth0, parent 1:2, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth0, classid 1:2, handle 2, rate: 20000kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -d 100.100.100.10 -i eth0 -j MARK --set-mark 2 INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 100.100.100.10 on interface eth1 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth1, classid 1:2,parent 1:0, rate 20000kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth1, parent 1:2, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth1, classid 1:2, handle 2, rate: 20000kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -s 100.100.100.10 -i eth1 -j MARK --set-mark 2 INFO:AtcdVService.AtcdLinuxShaper:Request startShaping TrafficControl(device=TrafficControlledDevice(controllingIP='127.0.0.1', controlledIP='127.0.0.1'), timeout=22972.738032579422, settings=TrafficControlSetting(down=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=20000, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)), up=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=20000, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)))) INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 127.0.0.1 on interface eth0 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth0, classid 1:3,parent 1:0, rate 20000kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth0, parent 1:3, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth0, classid 1:3, handle 3, rate: 20000kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -d 127.0.0.1 -i eth0 -j MARK --set-mark 3 INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 127.0.0.1 on interface eth1 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth1, classid 1:3,parent 1:0, rate 20000kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth1, parent 1:3, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth1, classid 1:3, handle 3, rate: 20000kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -s 127.0.0.1 -i eth1 -j MARK --set-mark 3 INFO:AtcdVService.AtcdLinuxShaper:Request startShaping TrafficControl(device=TrafficControlledDevice(controllingIP='100.100.100.1', controlledIP='100.100.100.1'), timeout=86346.52853989601, settings=TrafficControlSetting(down=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=0, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)), up=Shaping(loss=Loss(percentage=0.0, correlation=0.0), delay=Delay(delay=0, jitter=0, correlation=0.0), rate=0, iptables_options=[], corruption=Corruption(percentage=0.0, correlation=0.0), reorder=Reorder(percentage=0.0, correlation=0.0, gap=0)))) INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 100.100.100.1 on interface eth0 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth0, classid 1:4,parent 1:0, rate 4194303kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth0, parent 1:4, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth0, classid 1:4, handle 4, rate: 0kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -d 100.100.100.1 -i eth0 -j MARK --set-mark 4 INFO:AtcdVService.AtcdLinuxShaper:Shaping ip 100.100.100.1 on interface eth1 INFO:AtcdVService.AtcdLinuxShaper:create new HTB class on IFID eth1, classid 1:4,parent 1:0, rate 4194303kbits INFO:AtcdVService.AtcdLinuxShaper:create new Netem qdisc on IFID eth1, parent 1:4, loss 0.0%, delay 0 INFO:AtcdVService.AtcdLinuxShaper:create new FW filter on IFID eth1, classid 1:4, handle 4, rate: 0kbits INFO:AtcdVService.AtcdLinuxShaper:Running /sbin/iptables -t mangle -A FORWARD -s 100.100.100.1 -i eth1 -j MARK --set-mark 4 DEBUG:AtcdVService:All tasks started DEBUG:AtcdVService:VService Active. Awaiting graceful shutdown.
chantra commented 9 years ago

@kimjungyeon eth0 is your lan interface, eth1 is your wan interface. Did you override --atcd-wan and --atcd-lan as explained in https://github.com/facebook/augmented-traffic-control/tree/master/atc/atcd

In your case, you should run something like:

atcd --atcd-lan eth0 --atcd-wan eth1
kimjungyeon commented 9 years ago

@chantra i am always appreciate you for your concern chantra! now, i am trying to see some positive result, but atc is not still work on wifi speed test app, im check the speed but it's same speed...regardless ATC... ㅠ_ㅠ how can i check ATC's working?? first, plz let me know correct way sorry to bother you...

chantra commented 9 years ago

@kimjungyeon I see that you have shaped 100.100.100.1 (ATC LAN IP) and 127.0.0.1 (ATC localhost IP) Are you initiating thew shaping from the ATC host? You must connect to ATC UI and trigger the shaping from the device you want to shape the traffic from. If you are using a proxy, make sure X_FORWARDED_FOR is set.

What is the ip of the device you are trying to shape the traffic from? What speed? The log show that you are shaping at 20Mbits for 100.100.100.10 and 127.0.0.1 and not shaping at all for 100.100.100.1.

chantra commented 9 years ago

@kimjungyeon Can you grab https://raw.githubusercontent.com/facebook/augmented-traffic-control/master/utils/dump_system_info.sh and run it on your ATC device. Then paste that into gist: https://gist.github.com/

Tks

kimjungyeon commented 9 years ago

@chantra i'll post the result!

kimjungyeon commented 9 years ago

@chantra i did it! well... first i set the thrift on localhost, and run atcd, and finally connect atc ui with my devices!!!! the command like this $sudo atcd --thrift-host 127.0.0.1 --atcd-lan eth0 --atcd-wan eth1 $sudo python manage.py runserver 100.100.100.1:8000 (this is phase of devices) and i am controlling atc in my phone browser.... it worked!

kimjungyeon commented 9 years ago

my dear @chantra!! i have a question, why i have to connect ui with my phone??? i just change atcui address 127.0.0.1 -> 100.100.100.1 but it worked!! why...? i am not programmer so everthing is too hard...:-(

zealws commented 9 years ago

@kimjungyeon Glad it's working! :)

By default, ATC uses the device that is connected to it for all it's shaping rules. This means that if you want to shape your phone, you have to connect to ATC with your phone.

There is a way to do remote shaping (shaping your phone from your desktop) in API v1, but the functionality is not exposed in the UI (#116, #117), so if you want to do this, you need to use an HTTP client like curl.

The details on how to do this are described here.

I'm closing this since you got it working. Please reopen if you have any other issues.

kimjungyeon commented 9 years ago

@zfjagann thank you so~~much! i was tried atc about 2 month... yesterday is the day of happiness!! again, i thank you for your help and kindness zfjagann and chantra got bless you buddies!