Странное поведение шейпера (ip.up) на ипое и ппп

Shaper related questions
Post Reply
Cramac
Posts: 97
Joined: 05 Jan 2017, 11:53
Contact:

Странное поведение шейпера (ip.up) на ипое и ппп

Post by Cramac » 04 Dec 2017, 10:18

Приветствую.
Есть вот такой скрипт для нарезки:

Code: Select all

if [ -f /var/run/radattr.$1 ];
then
   DOWNSPEED=`/usr/bin/awk  '/Traffic-Shape-out/ {print $2}'  /var/run/radattr.$1 | tail -n 1`;
   UPSPEED=`/usr/bin/awk  '/Traffic-Shape-in/ {print $2}'  /var/run/radattr.$1 | tail -n 1`;
   FILTERS=`/usr/bin/awk  '/Filter-Id/ {print $2}'  /var/run/radattr.$1`;
   IPADRESS=`/usr/bin/awk '/Framed-IP-Address/ {print $2}' /var/run/radattr.$1 | tail -n 1`;

    /sbin/tc qdisc del dev $1 root
    /sbin/tc qdisc del dev $1 ingress


 ##### speed server->client 
   if [ "$UPSPEED" != "0" ] ; 
   then
   
let "UPSPEED = UPSPEED * 1024"
 
     #/sbin/tc qdisc add dev $1 root handle 1: htb default 20 r2q 1
     /sbin/tc qdisc add dev $1 root handle 1: htb default 20
     /sbin/tc class add dev $1 parent 1: classid 1:1 htb rate ${UPSPEED}kbit burst 4k
     /sbin/tc class add dev $1 parent 1:1 classid 1:10 htb rate ${UPSPEED}kbit burst 4k prio 1
     /sbin/tc class add dev $1 parent 1:1 classid 1:20 htb rate ${UPSPEED}kbit burst 4k prio 2
     /sbin/tc qdisc add dev $1 parent 1:10 handle 10: sfq perturb 10 quantum 1500
     /sbin/tc qdisc add dev $1 parent 1:20 handle 20: sfq perturb 10 quantum 1500
     /sbin/tc filter add dev $1 parent 1:0 protocol ip prio 10 u32 match ip tos 0x10 0xff flowid 1:10
     /sbin/tc filter add dev $1 parent 1:0 protocol ip prio 10 u32 match ip protocol 1 0xff flowid 1:10
     /sbin/tc filter add dev $1 parent 1: protocol ip prio 10 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowid 1:10


   fi 
 ##### speed client->server 
   if [ "$DOWNSPEED" != "0" ] ; 
   then 

let "DOWNSPEED = DOWNSPEED * 1024"

     /sbin/tc qdisc add dev $1 handle ffff: ingress 
     /sbin/tc filter add dev $1 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${DOWNSPEED}kbit burst 12k drop flowid :1 
   fi 
fi

Так вот странность, если клиент подключается по ppp, то все норм работает. Скорость как положено в обе стороны. Но вот если подключится по ipoe, то возникает проблема с исходящей скорости. Что может быть не то?
файлики с атрибутами не отличаются

dimka88
Posts: 464
Joined: 13 Oct 2014, 05:51
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by dimka88 » 04 Dec 2017, 13:21

У меня такая же схема на хотспоте реализована, там правда скоростя 5-10 Mbps, но проблем нет.
offloads выключены на сетевой?

Code: Select all

tc -s -d filter show dev ipoeXXX parent ffff:

Cramac
Posts: 97
Joined: 05 Jan 2017, 11:53
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by Cramac » 04 Dec 2017, 15:58

Code: Select all

# tc -s -d filter show dev ipoe57 parent ffff:
filter protocol ip pref 50 u32
filter protocol ip pref 50 u32 fh 800: ht divisor 1
filter protocol ip pref 50 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
  match 00000000/00000000 at 12
 police 0x8298d rate 51200Kbit burst 12Kb mtu 2Kb action drop overhead 0b linklayer ethernet
ref 1 bind 1

 Sent 67917367 bytes 807079 pkts (dropped 199, overlimits 199)
вот с ппп (был с утра на ипое, перевели на ппп)

Code: Select all

 tc -s -d filter show dev ppp75 parent ffff:
filter protocol ip pref 50 u32
filter protocol ip pref 50 u32 fh 800: ht divisor 1
filter protocol ip pref 50 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
  match 00000000/00000000 at 12
 police 0x827ca rate 20480Kbit burst 12Kb mtu 2Kb action drop overhead 0b linklayer ethernet
ref 1 bind 1

 Sent 336227422 bytes 431238 pkts (dropped 6631, overlimits 6631)


dimka88
Posts: 464
Joined: 13 Oct 2014, 05:51
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by dimka88 » 04 Dec 2017, 16:14

А что за проблема с upload, можно подробнее?

Cramac
Posts: 97
Joined: 05 Jan 2017, 11:53
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by Cramac » 04 Dec 2017, 19:14

просто его нет. Т.е. вместо желаемых 20, спидтест кажет 1-2мбит, убил сессию, поднялась новая, стала 3-4мбит.
переводим на пптп, и вуаля, 20 и туда и от туда.

Cramac
Posts: 97
Joined: 05 Jan 2017, 11:53
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by Cramac » 18 Apr 2018, 13:46

Опять проблема с скоростью на ипое.

Code: Select all

# tc -s -d filter show dev ipoe146 parent ffff:
filter protocol ip pref 50 u32
filter protocol ip pref 50 u32 fh 800: ht divisor 1
filter protocol ip pref 50 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
  match 00000000/00000000 at 12
 police 0x36e4a rate 30720Kbit burst 12Kb mtu 2Kb action drop overhead 0b linklayer ethernet
ref 1 bind 1

 Sent 16379209 bytes 103043 pkts [b](dropped 1101, overlimits 1101)[/b]
смущает последняя строка. исходящая на 0

сетевая что смотрит в сеть:

Code: Select all

ifconfig ens6f0
ens6f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.10.1  netmask 255.255.255.0  broadcast 10.10.10.255
        inet6 fe80::92e2:baff:fe06:fe54  prefixlen 64  scopeid 0x20<link>
        ether 90:e2:ba:06:fe:54  txqueuelen 1000  (Ethernet)
        RX packets 111031258868  bytes 42382173666356 (42.3 TB)
        RX errors 0  dropped 6  overruns 64663  frame 0
        TX packets 184125889695  bytes 229694828712569 (229.6 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xb2420000-b243ffff 
        
ethtool ens6f0
Settings for ens6f0:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: on (auto)
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes
	
~# ethtool -k ens6f0
Features for ens6f0:
rx-checksumming: on
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: on
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: off [fixed]
	tx-tcp-mangleid-segmentation: off
	tx-tcp6-segmentation: on
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: on
tx-vlan-offload: on
ntuple-filters: off [fixed]
receive-hashing: on
highdma: on [fixed]
rx-vlan-filter: on [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: on
tx-gre-csum-segmentation: on
tx-ipxip4-segmentation: on
tx-ipxip6-segmentation: on
tx-udp_tnl-segmentation: on
tx-udp_tnl-csum-segmentation: on
tx-gso-partial: on
tx-sctp-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
busy-poll: off [fixed]
hw-tc-offload: off [fixed]
root@vpn:~# 
Без шейпера на исходящую или на пптп все норм.

Cramac
Posts: 97
Joined: 05 Jan 2017, 11:53
Contact:

Re: Странное поведение шейпера (ip.up) на ипое и ппп

Post by Cramac » 17 Aug 2018, 18:21

проблема так и наблюдается.
При чем наблюдается на одном сервер, на двух других, такого не наблюдается.

Очередной клиент:
tc -s -d filter show dev ipoe90 parent ffff:
filter protocol ip pref 50 u32
filter protocol ip pref 50 u32 fh 800: ht divisor 1
filter protocol ip pref 50 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1
match 00000000/00000000 at 12
police 0xc3572 rate 76800Kbit burst 12Kb mtu 2Kb action drop overhead 0b linklayer ethernet
ref 1 bind 1

Sent 869084447 bytes 3200828 pkts (dropped 4737, overlimits 4737)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest