Gateway Graph - How is this made?

General questions.
Post Reply
User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Gateway Graph - How is this made?

Post by trymes » December 4th, 2015, 4:56 pm

I have been noticing some odd behavior of our gateway graph (the first graph, marked "Link Quality", on the "Network (Other)" page. I am wondering what data is used to display this graph. Is it just a regular ping to the gateway address?

I am wondering, because we had been having some issues in one location, and while grasping at straws I noticed that this graph looked different there than in other locations on the same ISP. Specifically, for any of our Comcast Business connections, the gateway is literally on the outside interface of the cable modem, so this graph is almost always 1ms or less, with occasional jumps to 2ms. On this connection, it seems to start low like that, but quickly develops jumps to 3ms+ and seems to steadily increase over time.

Before I started relying on this graph as an indicator of a problem, I wanted to better understand just what I am seeing.

Thank you,

Tom

User avatar
FischerM
Community Developer
Community Developer
Posts: 1024
Joined: November 2nd, 2011, 12:28 pm

Re: Gateway Graph - How is this made?

Post by FischerM » December 6th, 2015, 8:00 pm

Hi,
trymes wrote: I am wondering what data is used to display this graph. Is it just a regular ping to the gateway address?
So did I some time ago.

For starters, if you look at the list under STATUS / CONNECTIONS, you might see one specific connection:
ICMP Source [RED ADRESS] Dest.IP: Port [Gateway-Address] ...

This might - or might not - be the address under SYSTEM / HOME "Gateway:" ...

It depends on your ISP configuration. For me, this is handled in '/etc/ppp/ip-up'.
If this gateway address answers to 'pings' it will be used, otherwise, 'ping.ipfire.org (178.63.73.246)' is used. And this is exactly the ICMP connection which I see under Connections / Status and was wondering for what this was good for. Furthermore, 178.63.73.246 took place in my '/etc/hosts' and I was sure that I wasn't responsible for this entry... ;)

Corresponding code in '/etc/ppp/ip-up' (line 59-79):

Code: Select all

...
#Check if gateway has answerd to ping, if not replace with ping.ipfire.org
TEST=`/usr/bin/ping -c 2 $5 2>/dev/null | tail -2 | head -1 | cut -d"," -f2`;

grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts

if [ "$TEST" == " 2 received" ]; then
	#ping the ppp-gateway
	echo "$5	gateway" >> /tmp/hosts
else
	#no answer
	HOST=`host ping.ipfire.org`;
	FIRE=`echo $HOST | cut -d" " -f4`;
	CHK=`echo $HOST | cut -d" " -f3`;
	if [ "$CHK" == "address" ]; then
	    #use ping.ipfire.org
	    echo "$FIRE	gateway" >> /tmp/hosts
	else
	    #DNS lookup failed use direct ip
	    echo "178.63.73.246	gateway" >> /tmp/hosts
	fi
fi
...
Next step would be to evaluate who is building the graphs...

HTH
Matthias

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » December 14th, 2015, 3:44 pm

Ihave not yet confirmed, but I am fairly certain that this same code is located in /etc/init.d/networking/red for those who do not use a PPP interface for red (ie: static IP and/or DHCP). The relevant code block is:

Code: Select all

                        echo -n "${DEVICE}" > /var/ipfire/red/iface
                        echo -n "${ADDRESS}"  > /var/ipfire/red/local-ipaddress
                        echo -n "${GATEWAY}" > /var/ipfire/red/remote-ipaddress
                        grep -v -E "\<gateway\>" /etc/hosts > /tmp/hosts
                       echo "$GATEWAY  gateway"  >> /tmp/hosts
                        mv /tmp/hosts /etc/hosts

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » December 14th, 2015, 5:15 pm

Another note: If you add a section to the ping plugin section of collectd.conf, you will get another graph in the WUI:

Code: Select all

<Plugin ping>
        Host 12.34.56.78
        interval 30
        timeout 10
        Host "gateway"
        interval 30
        timeout 10
</Plugin>
It would be a cool feature to be able to add hosts to ping in the WUI and either generate multiple graphs, or better yet, show them together like in the graph on this page at collectd.org.

Image

Tom

User avatar
MichaelTremer
Core Developer
Core Developer
Posts: 5796
Joined: August 11th, 2005, 9:02 am

Re: Gateway Graph - How is this made?

Post by MichaelTremer » December 15th, 2015, 2:42 pm

We do have something like that in IPFire 3 which uses collecty - our own data collection daemon. On there, we can ping multiple hosts. At the same time we would like to have a zero-configuration approach, because nobody likes to configure their processor temperature sensors. Adding own hosts seems to be infeasible.

Can anyone come up with a good solution that works on a global scale? At the moment we try to ping the default gateway. If that is not working, we ping "ping.ipfire.org" which points to our main server. This is a good solution for Europe, but not for the Americas, Australia, Asia and what not is far away from the server.

How could this be solved without letting the user pick the servers?

http://cgit.ipfire.org/collecty.git/tre ... ncy.py#n29

-Michael
Support the project with our Donation Challenge!

Get Commercial Support for IPFire and more from Lightning Wire Labs!

Image

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » December 15th, 2015, 3:02 pm

Michael,

I think the current solution is pretty good, though obviously not ideal. How common is it to not be able to ping the gateway anyhow?

I was actually referring to being able to add custom servers in addition to the gateway. Forexample, it's handy to ping our central office from each branch office, allowing us to have a history of latency and any connection drops. This is especially true for locations where the gateway is local and a dropped internet connection will not show up on the gateway graph. We could even technically add all of the branch offices to the central office to maintain a history of connectivity there, too.

This is currently possible if you manually edit collectd.conf. A new graph will then show up in the WUI, but adding multiple hosts results in multiple graphs and an alternate one like on the collectd site could be helpful. It's certainly not urgent by any standards.

Perhaps the current logic is OK, while allowing the user to specify a different/additional host if desired would be good? Is there a way to create a user conf file to ensure that my additional host entries do not get overwritten at upgrade time?

Tom

User avatar
Arne.F
Core Developer
Core Developer
Posts: 8519
Joined: May 7th, 2006, 8:57 am
Location: BS <-> NDH
Contact:

Re: Gateway Graph - How is this made?

Post by Arne.F » December 15th, 2015, 3:29 pm

How common is it to not be able to ping the gateway anyhow?
Very common in Germany. The PPPoE peers of German Telekom doesn't answer to pings.
If the peer not answer IPFire create a "gateway" hosts entry that points to ping.ipfire.org .
Arne

Support the project on the donation!

Image

Image

Image
PS: I will not answer support questions via email and ignore IPFire related messages on my non IPFire.org mail addresses.

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » December 15th, 2015, 3:39 pm

It's funny how different ISPs are around the world. Here in the US, Comcast business class cable connections place the gateway on the outside interface of the cable modem, so your gateway is inside the building and almost NEVER down, even if the connection itself is down.

This, of course reminds me of the discussion we had about WAN failover a while back and how the current dialup-only failover is of little use here in North America.

Tom

User avatar
MichaelTremer
Core Developer
Core Developer
Posts: 5796
Joined: August 11th, 2005, 9:02 am

Re: Gateway Graph - How is this made?

Post by MichaelTremer » December 15th, 2015, 7:46 pm

Arne.F wrote:
How common is it to not be able to ping the gateway anyhow?
Very common in Germany. The PPPoE peers of German Telekom doesn't answer to pings.
If the peer not answer IPFire create a "gateway" hosts entry that points to ping.ipfire.org .
We have a few thousand active ICMP connections on our main server open at any time. The timeout of an ICMP connection in the connection tracking table is 30 seconds. collectd pings once in 5 minutes, so we have about ~25000 hosts that constantly ping ping.ipfire.org.
trymes wrote:It's funny how different ISPs are around the world. Here in the US, Comcast business class cable connections place the gateway on the outside interface of the cable modem, so your gateway is inside the building and almost NEVER down, even if the connection itself is down.
This is indeed a problem because pinging a local router is pretty much useless. However finding out which one in the next hop after that is complicated.

We could automatically add the VPN gateways. So no configuration is required.

I am not sure if this is such a good idea to use these graphs as a monitoring solution for other services.

-Michael
Support the project with our Donation Challenge!

Get Commercial Support for IPFire and more from Lightning Wire Labs!

Image

Stosi
Posts: 251
Joined: July 20th, 2013, 8:47 pm

Re: Gateway Graph - How is this made?

Post by Stosi » December 15th, 2015, 10:09 pm

Hello!
MichaelTremer wrote: However finding out which one in the next hop after that is complicated.
Hmm... you see this:
viewtopic.php?f=6&t=15432

Maybe a solution or for thought?

User avatar
Deepcuts
Posts: 461
Joined: March 1st, 2016, 3:18 pm
Location: Romania

Re: Gateway Graph - How is this made?

Post by Deepcuts » June 9th, 2017, 7:54 pm

Sorry to resurrect an old thread, but regarding the gateway graph I have a weird situation.
I have a PPPoE FO connection and the gateway IP is 10.0.0.1
The weird part is that from a client behind IPFire I can ping the gateway, but from the IPFire machine itself, ping will timeout, thus IPFire will use ping.ipfire.org for the graph.
I did not yet have time to debug this. Maybe someone met such a situations and knows why would a PPPoE gateway timeout from the router itself while from a host behind it works?
Image
Image

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » June 10th, 2017, 11:52 am

Deepcuts wrote:Maybe someone met such a situations and knows why would a PPPoE gateway timeout from the router itself while from a host behind it works?
Sorry, I can't help. Seeing as your problem isn't really related to this thread, I'd suggest you will get better responses if you start a new thread.

User avatar
Deepcuts
Posts: 461
Joined: March 1st, 2016, 3:18 pm
Location: Romania

Re: Gateway Graph - How is this made?

Post by Deepcuts » June 10th, 2017, 12:10 pm

I always liked these kind of responses :)
My problems is regarding gateway graphs. You want one topic for each and every variation of the problem?
On point: ipfire cannot ping gateway IP, thus gateway graphs problems. (while computers behind ipfire can ping)
Image
Image

User avatar
trymes
Posts: 663
Joined: February 9th, 2011, 4:10 pm
Location: New England, USA

Re: Gateway Graph - How is this made?

Post by trymes » June 10th, 2017, 1:06 pm

Deepcuts wrote:I always liked these kind of responses :)
My problems is regarding gateway graphs. You want one topic for each and every variation of the problem?
On point: ipfire cannot ping gateway IP, thus gateway graphs problems. (while computers behind ipfire can ping)
Not to be argumentative, but your problem with gateway graphs is not a problem, it is a symptom. You have a problem with network connectivity, namely that you cannot ping your gateway from your router.

While you clearly didn't see it as such, my post was meant to be helpful. I suggested that you post a new topic specific to your issue because you will likely get more and better answers if you do.

This is because those who can help you might skip this topic because they have seen it before, or because they don't care about graphs. More importantly, they will need to read through this entire thread to get to your question, meaning more work for them and more likelihood they will not bother. Feel free to disagree if you like, but posting to an old thread is a great way to reduce the likelihood that anyone will answer your question, and this is why literally every forum out there frowns upon resurrecting old threads. If you think an older thread is relevant, then put a link to it in your new thread.

Good luck,

Tom

TimF
Posts: 83
Joined: June 10th, 2017, 7:27 pm

Re: Gateway Graph - How is this made?

Post by TimF » June 10th, 2017, 7:31 pm

Could you do a trace route to ipfire.org and use the first address that responds, but not immediately? Not exactly trivial, but shouldn't be too hard either.

I'm not suggesting doing this every time , but maybe once a day.

Post Reply