# pppd: pppoe: Determine connection speed

## schorsch_76

The last weekend a lightning (overvoltage) destroyed my providers router box under my desk. I took the opportunity to replace it with a open source (gentoo hardened) router. 

Now it runs all smooth and the connection speed is like it was before. 

--> BUT: The old box was able to tell me the pppoe connection speed. How can i determine this with pppd?

Obviously pppoe from the kernel is used:

```
lsmod | grep ppp

pppoe                   9840  2 

pppox                   2108  1 pppoe

ppp_generic            27660  6 pppoe,pppox

slhc                    5269  1 ppp_generic

```

Kernel:

```
Linux zerberus 3.18.9-hardened-router #1 SMP PREEMPT Sun Jun 28 20:47:44 CEST 2015 x86_64 AMD G-T40E Processor AuthenticAMD GNU/Linux

zcat /proc/config.gz | grep -i ppp

CONFIG_PPP=m

CONFIG_PPP_BSDCOMP=m

CONFIG_PPP_DEFLATE=m

CONFIG_PPP_FILTER=y

CONFIG_PPP_MPPE=m

CONFIG_PPP_MULTILINK=y

CONFIG_PPPOE=m

CONFIG_PPP_ASYNC=m

CONFIG_PPP_SYNC_TTY=m

```

I got ppp and rp-ppp installed and started it over /etc/conf.d/net

```
net-dialup/ppp-2.4.7::gentoo was built with the following:

USE="ipv6 pam -activefilter -atm -dhcp -eap-tls -gtk -radius"

```

```
net-dialup/rp-pppoe-3.8-r2::gentoo was built with the following:

USE="-X"

```

my pppd log shows me not much information about the speed of the pppoe

```

cat /var/log/pppd.log 

Jun 29 23:11:55 zerberus pppd[4335]: LCP terminated by peer

Jun 29 23:11:55 zerberus pppd[4335]: Connect time 1440.0 minutes.

Jun 29 23:11:55 zerberus pppd[4335]: Sent 210616132 bytes, received 3551854646 bytes.

Jun 29 23:11:58 zerberus pppd[4335]: Connection terminated.

Jun 29 23:11:58 zerberus pppd[4335]: Modem hangup

Jun 29 23:12:01 zerberus pppd[4335]: PPP session is 2223

Jun 29 23:12:01 zerberus pppd[4335]: Connected to ..... via interface eth2

Jun 29 23:12:01 zerberus pppd[4335]: Using interface ppp0

Jun 29 23:12:01 zerberus pppd[4335]: Connect: ppp0 <--> eth2

Jun 29 23:12:02 zerberus pppd[4335]: PAP authentication succeeded

Jun 29 23:12:02 zerberus pppd[4335]: peer from calling number ..... authorized

Jun 29 23:12:02 zerberus pppd[4335]: local  IP address aa.bb.cc.dd

Jun 29 23:12:02 zerberus pppd[4335]: remote IP address ee.ff.gg.hh

Jun 29 23:12:02 zerberus pppd[4335]: primary   DNS address ....

Jun 29 23:12:02 zerberus pppd[4335]: secondary DNS address ...

```

pppd comandline:

```
/usr/sbin/pppd plugin rp-pppoe.so unit 0 user myid@myprovider remotename ppp0 linkname ppp0 plugin passwordfd.so noauth defaultroute usepeerdns holdoff 3 child-timeout 60 lcp-echo-interval 15 lcp-echo-failure 3 noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp passwordfd 0 defaultmetric 4008 maxfail 0 persist connect true eth2
```

I read already the wiki https://wiki.gentoo.org/wiki/PPP

EDIT: ppp dokcumentation states: 

 *bzless /usr/share/doc/ppp-2.4.7/README.linux.bz2 wrote:*   

> Now in fact pppd doesn't know anything about how to get modems to dial
> 
> or what you have to say to the system at the far end to get it to talk
> 
> PPP.  That's handled by an external program such as chat, specified
> ...

 

Wth this in mind, the logic to know about the modem, would be in the rp-pppoe.so file from http://www.roaringpenguin.com. Lets grad the source ...

----------

## gerdesj

 *schorsch_76 wrote:*   

> The last weekend a lightning (overvoltage) destroyed my providers router box under my desk. I took the opportunity to replace it with a open source (gentoo hardened) router. 
> 
> Now it runs all smooth and the connection speed is like it was before. 
> 
> --> BUT: The old box was able to tell me the pppoe connection speed. How can i determine this with pppd?
> ...

 

It's complicated ...

PPPoE is a form of tunnel and line speeds are really "lies to children".   I'll try to explain:  Your Gentoo router has an Ethernet (wired LAN) connection with a real line speed of 10/100/1000Mbs-1 to the cable or whatever modem.  The modem then connects at a lower level to the provider.  The speed there is the one you are interested in but it is dependent on a lot of factors - the distance, quality of cabling etc etc.  

Your home LAN is also dependent on many of these factors but Ethernet specs are such that you are unlikely to exceed things like distance between switches or cable quality, so when you want say 1Gbps-1, you specify CAT5E cable and keep distances less than 100m.  The specs for ADSL and the like - "broadband" - are designed for a much wider range of factors.

Anyway, after the connection to your ISP you have their gear and contention with other users to worry about.  The only line speed you should really worry about is the actual throughput you get and this is quite hard to measure. 

Your provider's router was able to report your "line speed" because it is both a router and modem (or similar).  What I mean is that it had access to both layer 1/2 and layer 3+.  Your Gentoo box doesn't - PPPoE is running over the Ethernet connection and doesn't care about line speed.  If you used pppd to connect to a modem then you could send AT commands to get the speed back but I don't think you can do this for broadband.

So what I'm getting around to is: what is your Gentoo box actually plugged into?

Cheers

Jon

PS If you are still getting the service you want then the above is all moot - crack on.

----------

## schorsch_76

My gentoo router box is connected to [1]. I have only access over the eth2 Interface to the modem. So i guess, from what you wrote + what i expierenced, it is unpossible except a download to distigish the connection Speed ...

[1] http://www.amazon.de/gp/product/B00582IGVK?psc=1&redirect=true&ref_=oh_aui_detailpage_o00_s00

----------

## Aiken

What are you trying to check? Your adsl sync? Your throughput? Assuming it has similar capabilities to any adsl modem I have used the current sync speed can be checked by going to the web pages on the modem. With my modem I have an expect script that telnets to the modem and gets the current sync for me. What thoughput I can expect is a competely differnent matter. Without checking I am confident in saying I am synced at 8160/384  and that sync speed has nothing to do with what rate I can download at. The time of day is a more reliable indicator of my download speed than my never changing sync. People now home from work and settling down for the evening my 8Mbit link currently has a download speed slower than that of a 1500kbit link.

The only time I have had a changing sync rate there was a line fault and I used my expect script to check the current sync rate for me. When I want to know the current possible throughput (which my sync rate will not tell me) I do speed tests.

If you want to know what downloads speeds have been reaching in recent times a couple of things that come to mind are ntop and ntopng. Have played with both of them and currently looking at using pmacct to generate some accounting data and feed that to rrdtool so I have some pretty graphs to look at telling download speeds over different time periods.

----------

## gerdesj

 *Aiken wrote:*   

> What are you trying to check? Your adsl sync? Your throughput? Assuming it has similar capabilities to any adsl modem I have used the current sync speed can be checked by going to the web pages on the modem. With my modem I have an expect script that telnets to the modem and gets the current sync for me. What thoughput I can expect is a competely differnent matter. Without checking I am confident in saying I am synced at 8160/384  and that sync speed has nothing to do with what rate I can download at. The time of day is a more reliable indicator of my download speed than my never changing sync. People now home from work and settling down for the evening my 8Mbit link currently has a download speed slower than that of a 1500kbit link.
> 
> The only time I have had a changing sync rate there was a line fault and I used my expect script to check the current sync rate for me. When I want to know the current possible throughput (which my sync rate will not tell me) I do speed tests.
> 
> If you want to know what downloads speeds have been reaching in recent times a couple of things that come to mind are ntop and ntopng. Have played with both of them and currently looking at using pmacct to generate some accounting data and feed that to rrdtool so I have some pretty graphs to look at telling download speeds over different time periods.

 

A agree with what the above says.  You could use something like mrtg for simple graphs with the output from an expect script or similar - it's not trivial I'm afraid.

Usually you can do a little ethernet subnet with the modem so that you can talk to it and then have another interface (virtual) that does the pppoe and gets an external IP address OR your modem is a full router, has its own IP and passes an IP down to your eth2.  Depends on the ISP and your setup.

Cheers

Jon

----------

## NeddySeagoon

schorsch_76,

Some 'modems' have a web interface with lots of useful info.  Some don't.

From the manual for you box, (which I can't read) there are no web interface illustrations, so its probably a dumb box.

----------

