[stools] Some tunnel MIB support for stools
Hi,
I added a new 'show tunnel' command which prints tunnelIfTable in a readable format. It was tested against UCD-SNMP 4.2 with Frank Strauss' tunnel MIB implementation.
The patch can be found at: http://www.ibr.cs.tu-bs.de/~wellnitz/stools-0.1.12-tunnel.diff.gz
I know little about C and virtually nothing about SNMP, so any comments or improvements are welcome.
Oliver -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Hi!
Oliver> I added a new 'show tunnel' command which prints tunnelIfTable Oliver> in a readable format. It was tested against UCD-SNMP 4.2 with Oliver> Frank Strauss' tunnel MIB implementation.
Oliver> The patch can be found at: Oliver> http://www.ibr.cs.tu-bs.de/~wellnitz/stools-0.1.12-tunnel.diff.gz
Oliver> I know little about C and virtually nothing about SNMP, so any Oliver> comments or improvements are welcome.
Cool! Just a few quick comments (I did not look at the code)...
o I suggest to register the command as `show interface tunnel' instead of `show tunnel'.
o stools want to be as friendly to the user as possible, hence I suggest to represent the interface column not by the ifIndex number but by the interface `name'.
o For HopLimit (TTL) values of zero print `CP' just as for -1 in the TOS field.
o Do you print `TC' (traffic conditioner) for TOS values of -2?
o Print words in table headers with uppercase first letters as in other tables like tcp connections or system storage.
-frank -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Frank Strauss writes:
Frank> o I suggest to register the command as `show interface Frank> tunnel' instead of `show tunnel'.
Yes, I think that makes more sense (even though I recognize the tunnel MIB is just for IPv4 tunnels and we probably must make the command even more specific at some point in time).
/js -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Hi,
On Thu, Mar 08, 2001 at 12:45:38AM +0100, Frank Strauss wrote:
o I suggest to register the command as `show interface tunnel' instead of `show tunnel'.
Ok, I already was unhappy about 'show tunnel' but wasn't sure where to put it.
o stools want to be as friendly to the user as possible, hence I suggest to represent the interface column not by the ifIndex number but by the interface `name'.
I thought about it, but did not want to mix different mibs. If this is okay, I would also prefer the interface name.
o For HopLimit (TTL) values of zero print `CP' just as for -1 in the TOS field.
Yes, good point.
o Do you print `TC' (traffic conditioner) for TOS values of -2?
Yes.
Oliver -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Oliver Wellnitz writes:
o stools want to be as friendly to the user as possible, hence I suggest to represent the interface column not by the ifIndex number but by the interface `name'.
Oliver> I thought about it, but did not want to mix different mibs. If Oliver> this is okay, I would also prefer the interface name.
Mixing MIBs is just fine. The general idea is to output information in a format that is easy to understand and use by humans and to organize the commands in a logical way. MIBs are just internal interfaces which networks operators should not really care about.
I have merged your patch into the CVS now. Some observations:
You wrote code to output magic TOS values (CP and TC). The comment says that the values -1 and -2 are the magic numbers to test while your code actually did test against 255 and 254. This is of course wrong. The right thing to do is to test agains -1 and -2 and to tell Frank to fix his implementation of the tunnel MIB. :-)
Another issue: Frank's tunnel MIB implementation seems to report tunnels for every interface. This is not really correct. In fact, you should only report tunnelIfEntrys for interfaces of type "tunnel". So to get this right, you probably need to dive into the interface table implementation itself...
Frank, still listenting? I could only run a single test before the tunnel MIB agent on our router blew up...
/js
-- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Hi!
Juergen> You wrote code to output magic TOS values (CP and TC). The comment Juergen> says that the values -1 and -2 are the magic numbers to test while Juergen> your code actually did test against 255 and 254. This is of course Juergen> wrong. The right thing to do is to test agains -1 and -2 and to tell Juergen> Frank to fix his implementation of the tunnel MIB. :-)
TOS == -1 is returned correctly by the agent. -2 is not implemented. I had some doubts about how information from the kernel ioctls could be mapped. tunnel->tos = (parm->iph.tos & 1) ? -1 : parm->iph.tos; /* XXX: adjust tos mapping (kernel <-> TUNNEL-MIB::tunnelIfTOS) */
Juergen> Another issue: Frank's tunnel MIB implementation seems to report Juergen> tunnels for every interface. This is not really correct. In fact, you Juergen> should only report tunnelIfEntrys for interfaces of type "tunnel". So Juergen> to get this right, you probably need to dive into the interface table Juergen> implementation itself...
I did exactly this. The tunnel table is implemented as a sparse augmentation of the interfaces table (exactly those interfaces that are of type==131) corona has really 9 tunnel interfaces (IPv6 sit tunnels, tunnels to Berlin, home breweries). ;-)
Juergen> Frank, still listenting? I could only run a single test before the Juergen> tunnel MIB agent on our router blew up...
Yes. The agent is really broken. show tunnels is ok, but upon show interface info this happens. :-( Could you please run ssh root@corona /etc/init.d/local.snmpd restart in this situation? I'll take a look at the agent some time soon.
-frank -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Frank Strauss writes:
Frank> TOS == -1 is returned correctly by the agent. -2 is not Frank> implemented.
I am really sorry. I trusted the gxsnmp code - which was a mistake. I have fixed the sign bug in the stools snmp library now.
/js -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
Oliver Wellnitz writes:
Oliver> I added a new 'show tunnel' command which prints tunnelIfTable Oliver> in a readable format. It was tested against UCD-SNMP 4.2 with Oliver> Frank Strauss' tunnel MIB implementation.
Oliver> The patch can be found at: Oliver> http://www.ibr.cs.tu-bs.de/~wellnitz/stools-0.1.12-tunnel.diff.gz
Oliver> I know little about C and virtually nothing about SNMP, so any Oliver> comments or improvements are welcome.
I will put the patch into the CVS tree in a few minutes. We can then easily improve it until everybody is happy. I will take Frank's suggestion to register the command below `show interface' and I will move the command implementation into the interface.c module.
/js -- !! This message is brought to you via the `stools' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to stools-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/stools/ for more information.
participants (3)
-
Frank Strauss
-
Juergen Schoenwaelder
-
Oliver Wellnitz