Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ISP throttling on the PPP interface.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Thu May 15, 2014 5:27 am    Post subject: ISP throttling on the PPP interface. Reply with quote

I was wondering how the PPP interface works.

Suppose, the ISP provides the Internet connection via PPP; Linux spawns a PPP interface to get access to the connection and the speed of the connection is limited not to the medium (like Ethernet, wireless etc...), but by the ISP at it's point of presence.

In case the rate of incoming packets (from the Internet) or outgoing packets is higher than the speed the ISP limits, where will the input/output packet queue be placed? On the PPP interface or on the ISP's end?
_________________
My blog
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Thu May 15, 2014 2:20 pm    Post subject: Reply with quote

dE_logics,

There won't be a queue. If your ISP, or a carrier does throttling, its by dropping your outgoing packets so they do not receive responses any faster than they can//want to deliver them to you.
This avoids them discarding data that has already travelled (uselessly) over their network

Its interesting that you mention PPP. The MTU for PPPoE is 1492, as the PPP header (eight bytes) has to fit into a standard Ethernet packet.
This means that all your interfaces that originate packets that may travel over a PPPoE link should use a MTU of 1492, not the default 1500.
This avoids packet fragmentation and reassembly which will have a significant impact on your data rate when the system is trying to send packets >1492 bytes.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3491

PostPosted: Thu May 15, 2014 2:21 pm    Post subject: Reply with quote

if it's ISP that limits speed (and usualy it is), he limits it on his end. He can't even access your end, can he? At least he shouldn't.
Anyway, check out HTB for details (hieracial token bucket) - ofcourse it's not the only way, but the idea behind it will be pretty much the same regardless of particualr implementation.

Also, some ISPs only care for how fast you can download and don't even bother with throtling your upload speed, so they only need the easy part with outgoing packets (From their point of view - those you will se as incoming). Limiting speed of incoming packets seems to be a bit more tricky and might require looping them over virtual network interface so you can limit them in outgoing queue as well.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Thu May 15, 2014 5:45 pm    Post subject: Reply with quote

NeddySeagoon wrote:
dE_logics,

There won't be a queue. If your ISP, or a carrier does throttling, its by dropping your outgoing packets so they do not receive responses any faster than they can//want to deliver them to you.
This avoids them discarding data that has already travelled (uselessly) over their network

Its interesting that you mention PPP. The MTU for PPPoE is 1492, as the PPP header (eight bytes) has to fit into a standard Ethernet packet.
This means that all your interfaces that originate packets that may travel over a PPPoE link should use a MTU of 1492, not the default 1500.
This avoids packet fragmentation and reassembly which will have a significant impact on your data rate when the system is trying to send packets >1492 bytes.


Same for packets which are sent (from the client)?

What I was originally wondering about the PPP protocol, is that the protocol checks if the line is free; to throttle the traffic, the ISP claims the the line is not free queuing up the packet on the client's end. If the client forces a packet thought, the connection is dropped.

I'm glad that you reminded me of the MTU. There is a PPP modem which negotiates the actually PPP connection. My local LAN has MTU of 1500, that mean the router must be fragmenting the packet to get it fit into 1492?
_________________
My blog
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Thu May 15, 2014 5:54 pm    Post subject: Reply with quote

szatox wrote:
if it's ISP that limits speed (and usualy it is), he limits it on his end. He can't even access your end, can he? At least he shouldn't.
Anyway, check out HTB for details (hieracial token bucket) - ofcourse it's not the only way, but the idea behind it will be pretty much the same regardless of particualr implementation.

Also, some ISPs only care for how fast you can download and don't even bother with throtling your upload speed, so they only need the easy part with outgoing packets (From their point of view - those you will se as incoming). Limiting speed of incoming packets seems to be a bit more tricky and might require looping them over virtual network interface so you can limit them in outgoing queue as well.


I'm trying to QoS, so I was analyzing if something can be done on my end.

If the queue is not in my control (or there's no queue at all), I'll throttle the connection on my end -- that way I decide which packets to go first and ensure nothing is dropped.
_________________
My blog
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Thu May 15, 2014 9:00 pm    Post subject: Reply with quote

dE_logics,

Your downlink cannot be throttled - there is nothing special about PPP there.
There is no queue either.

To avoid the need for queueing, the uplink is controlled by dropping packets so that data does not arrive at network boundary faster than it can be delivered to you.
This makes your network resend the packets that get dropped.

Your router will be splitting packets bigger that 1492 bytes into two that you send and reassembling any fragments that it receives from the outside world.
However, there is a process called link MTU discovery, which if it works will set the MTU actually used to the minimum MTU supported along the route, so no fragmentation occurs anywhere.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Fri May 16, 2014 3:19 am    Post subject: Reply with quote

NeddySeagoon wrote:
dE_logics,

Your downlink cannot be throttled - there is nothing special about PPP there.
There is no queue either.

To avoid the need for queueing, the uplink is controlled by dropping packets so that data does not arrive at network boundary faster than it can be delivered to you.
This makes your network resend the packets that get dropped.

Your router will be splitting packets bigger that 1492 bytes into two that you send and reassembling any fragments that it receives from the outside world.
However, there is a process called link MTU discovery, which if it works will set the MTU actually used to the minimum MTU supported along the route, so no fragmentation occurs anywhere.


Apparently MTU discovery is not working, my MTU is set at 1500.
_________________
My blog
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri May 16, 2014 12:26 pm    Post subject: Reply with quote

dE_logics wrote:
Apparently MTU discovery is not working, my MTU is set at 1500.

Than you should fix it.
Look at what a bad MTU will gave you : https://forums.gentoo.org/viewtopic-t-935256.html
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Fri May 16, 2014 1:16 pm    Post subject: Reply with quote

dE_logics,

You can discover the link MTU with ping.
Send various size packets with the 'do not fragment' bit set. The largest packet that gets a non error response in the link MTU.

Whatever you discover is a good MTU setting.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri May 16, 2014 6:36 pm    Post subject: Reply with quote

There's no real need to make any MTU discovery for PPP, the size standard is set to 1492.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Sat May 17, 2014 4:29 am    Post subject: Reply with quote

It's 1440 here.
_________________
My blog
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Sat May 17, 2014 11:06 am    Post subject: Reply with quote

dE_logics,

1440 means that somewhere along the route you tested is a node with a MTU of 1440.
Thats a good value to set for all of the interfaces on your network.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Sun May 18, 2014 8:30 am    Post subject: Reply with quote

Thanks for clarifying all of this.
_________________
My blog
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun May 18, 2014 8:36 am    Post subject: Reply with quote

Well, you better ask your ISP about it.
If it disable MTU discovery and use non standard size, there's something wrong then.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54805
Location: 56N 3W

PostPosted: Sun May 18, 2014 12:27 pm    Post subject: Reply with quote

krinn,

That's a whole new nest of vipers.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum