Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port-channel (aggregate) support #100

Closed
netdisco-automation opened this issue Jul 9, 2007 · 21 comments
Closed

port-channel (aggregate) support #100

netdisco-automation opened this issue Jul 9, 2007 · 21 comments
Assignees

Comments

@netdisco-automation
Copy link

add support for CISCO-PAGP-MIB and IEEE8023-LAG-MIB

Reported by: arcanez

Original Ticket: snmp-info/patches/31

@netdisco-automation
Copy link
Author

SNMP-Info impementation

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

netdisco changes in store_interfaces,
-------------------------------------

my $i_lastchange = $device->i_lastchange();

+ my $agg_ports = $device->agg_ports();

insert_or_update('device_port', { 'ip' => $ip, 'port' => $store{port} },
%store );
+
+ if ($agg_ports->{$if})
+ {
+ %store = ();
+ $store{ip} = $ip;
+ $store{aggregate} = $interfaces->{$agg_ports->{$if}};
+ $store{port} = $interfaces->{$if};
+ $store{last_seen} = 'now';
+ insert_or_update('device_port_agg', { 'ip' => $ip, 'aggregate' => $store{aggregate}, 'port' => $store{port} },
+ %store );
+ }

table definition
-------------------------------------------------------
netdisco=> \d device_port_agg
Table "public.device_port_agg"
Column | Type | Modifiers
-----------+-----------------------------+---------------
ip | inet | not null
port | character varying(50) | not null
aggregate | character varying(50) | not null
creation | timestamp without time zone | default now()
last_seen | timestamp without time zone | default now()
Indexes:
"device_port_agg_pkey" PRIMARY KEY, btree (ip, port, "aggregate")
"idx_device_port_agg_ip_aggregate" btree (ip, "aggregate")
"idx_device_port_agg_last_seen_ip" btree (last_seen, ip)

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1466476
Originator: NO

I tried your patch today, but have some problems to see useful output. The discover didn't work from start...

SNMP::Info::AUTOLOAD(agg_ports) Attribute not found in this device class. at ./netdisco line 2388

...but I could solve this after changing C6500.pm. Now I get some more info.

SNMP::Info::_load_attr pagp_group_index : pagpGroupIfIndex
SNMP::Info::_load_attr agg_port_id : dot3adAggPortSelectedAggID
SNMP::Info::_load_attr agg_port_list : dot3adAggPortListPorts

But I don't see the channel information anywhere on the device view page. I guess there is more work to do?

Original comment by: ralfgross

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

this does not include any modifications to the netdisco web frontend. for our implementation, we only use the netdisco backend.

but, it should only entail joining device_port_agg against device_port on port & ip. 'aggregate' is the port-channel (etherchannel, etc) and 'port' is the member.

netdisco=> SELECT * FROM device_port_agg WHERE ip = 'xxx.xxx.xxx.xxx' AND aggregate = 'Port-channel1';
ip | port | aggregate | creation | last_seen
----------------+--------------------+---------------+----------------------------+----------------------------
xxx.xxx.xxx.xxx | GigabitEthernet9/4 | Port-channel1 | 2007-09-26 07:19:48.924829 | 2007-09-26 07:19:48.924829
xxx.xxx.xxx.xxx | GigabitEthernet9/2 | Port-channel1 | 2007-09-26 07:19:48.924829 | 2007-09-26 07:19:48.924829
xxx.xxx.xxx.xxx | GigabitEthernet9/1 | Port-channel1 | 2007-09-26 07:19:48.924829 | 2007-09-26 07:19:48.924829
xxx.xxx.xxx.xxx | GigabitEthernet9/3 | Port-channel1 | 2007-09-26 07:19:48.924829 | 2007-09-26 07:19:48.924829
(4 rows)

Original comment by: arcanez

@netdisco-automation
Copy link
Author

patch to put uplinks (CDP neighbors) on port-channels

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

here's a patch against current-cvs (3/3/2008) to put aggregates into CDP neighbors..

--- netdisco.cvs 2008-03-03 08:53:29.000000000 -0700
+++ netdisco 2008-03-01 16:34:25.000000000 -0700
@@ -1448,6 +1661,15 @@
insert_or_update('device_port', {'ip' => $ip , 'port' => $port },
%store);

+ ### hack to put uplinks (CDP neighbors) on Port-channel interfaces
+ my $agg_port_local = sql_scalar('device_port_agg', ['aggregate'], { 'ip' => $ip, 'port' => $port});
+ my $agg_port_remote = sql_scalar('device_port_agg', ['aggregate'], { 'ip' => $remote_ip, 'port' => $remote_port});
+ if (defined $agg_port_local and defined $agg_port_remote)
+ {
+ $store{'remote_port'} = $agg_port_remote;
+ insert_or_update('device_port', {'ip' => $ip, 'port' => $agg_port_local},
+ %store);
+ }
my $ok_to_discover = 1;
if (defined $Discovered{$remote_ip}) {
$DEBUG and print "[$ip] $remote_ip already discovered.\n";

File Added: netdisco.patch

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

This checks the port-channel members for neighbors in walk_fwtable (called by macsuck) instead of falsifying neighbors onto port-channels.. perhaps some of the code should be moved further up to where $dbports is created ?

--- netdisco (revision 1692)
+++ netdisco (working copy)
@@ -3122,7 +3130,16 @@
#If we dont see the device in the db, but there is a neighbor, then we capture anyways,
# since we want all the macs at the other end.

- my $remote_ip = $dbports->{$port}->{remote_ip};
+ my $remote_ip;
+ my $is_agg_port = sql_scalar('device_port_agg', ['aggregate'], { 'ip' => $ip, 'port' => $port});
+ if (defined $is_agg_port) {
+ $remote_ip = sql_scalar('device_port',['DISTINCT(remote_ip)'],{
+ 'ip'=>$ip,
+ 'port'=>\"IN (SELECT port FROM device_port_agg WHERE ip = '$ip' AND aggregate = '$port')"});
+ } else {
+ $remote_ip = $dbports->{$port}->{remote_ip};
+ }
+
if (defined $remote_ip) {
if (defined $OldDevices->{$remote_ip} or defined $Aliases->{$remote_ip}) {
my $ip = $Aliases->{$remote_ip} || $remote_ip;

File Added: netdiso-20080304.patch

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

per ralf gross,

Index: netdisco

--- netdisco (revision 1692)
+++ netdisco (working copy)
@@ -3122,7 +3130,16 @@
#If we dont see the device in the db, but there is a neighbor, then we capture anyways,
# since we want all the macs at the other end.

- my $remote_ip = $dbports->{$port}->{remote_ip};
+ my $remote_ip;
+ my $is_agg_port = sql_scalar('device_port_agg', ['DISTINCT(aggregate)'], { 'ip' => $ip, 'aggregate' => $port});
+ if (defined $is_agg_port) {
+ $remote_ip = sql_scalar('device_port',['DISTINCT(remote_ip)'],{
+ 'ip'=>$ip,
+ 'port'=>\"IN (SELECT port FROM device_port_agg WHERE ip = '$ip' AND aggregate = '$port')"});
+ } else {
+ $remote_ip = $dbports->{$port}->{remote_ip};
+ }
+
if (defined $remote_ip) {
if (defined $OldDevices->{$remote_ip} or defined $Aliases->{$remote_ip}) {
my $ip = $Aliases->{$remote_ip} || $remote_ip;

Original comment by: arcanez

@netdisco-automation
Copy link
Author

This checks the port-channel members for neighbors in walk_fwtable

Original comment by: arcanez

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1368562
Originator: YES

File Added: netdiso-20080304.patch

Original comment by: arcanez

@netdisco-automation
Copy link
Author

  • milestone: --> 570244
  • assigned_to: nobody --> jeneric

Original comment by: jeneric-placeholder

@netdisco-automation
Copy link
Author

Logged In: YES
user_id=1135238
Originator: NO

Would like to implement this to transparently support the IEEE standard as well as proprietary implementations.

Original comment by: jeneric-placeholder

@netdisco-automation
Copy link
Author

Note that I believe there is no OID which reveals ports assigned (in configuration) to an aggregate but in the Down operational state. These MIBs only return ports currently active in an aggregate. This may not be what the user expects! Anyone managed to get all the ports in an aggregate regardless of oper state?

Original comment by: ollyg

@netdisco-automation
Copy link
Author

I'd like to see this patch applied but hesitate only because it's not yet supporting IEEE standards. However it's probably better to have something which works for some of the people...

Original comment by: ollyg

@netdisco-automation
Copy link
Author

  • milestone: 570244 --> feature
  • assigned_to: jeneric --> nobody

Original comment by: ollyg

@netdisco-automation
Copy link
Author

  • priority: 5 --> 7

Original comment by: ollyg

@netdisco-automation
Copy link
Author

olly_g: I can take care of the IEEE part; our HP switches implement the IEEE8023-LAG-MIB and we use LACP between HP's and between HP/Cisco in some parts of our network. We need this functionality ourselves so I can spend a bit of time implementing it in Netdisco.

btw, I'm not sure if using a separate table to mark aggregated ports is the best way to go, but it's a start.

Original comment by: JeroenvIS

@netdisco-automation
Copy link
Author

Since port-channel membership is done in different ways on different devices, I think we should have different functions (e.g., instead of one agg_ports() method that tests all of the possible methods, we can have:

  • agg_ports_pagp
    uses CISCO-PAGP-MIB

  • agg_ports_lag
    uses IEEE8023-LAG-MIB

  • agg_ports_ifstack
    uses IF-MIB's ifStackTable to find ports stacked under a lag

and an individual device class can call the right function for that class. (Or, e.g., Layer3::Cisco can combine the results of agg_ports_pagp and agg_ports_lag).

One concrete comment about the use of the IEEE8023-LAG-MIB: the port IDs in the bitmap should be mapped to ifIndex values via the dot1dBasePortTable and then mapped to interface names. The module.index math that's in here is only valid for one class of device, but the mapping should be valid for all devices.

I'm also curious why the code looks at dot3adAggPortListPorts as well as dot3adAggPortSelectedAggID. They are supposed to be two different views of the same data. Are there devices that support only one or the other?

(However, if we do want to use dot3adAggPortSelectedAggID, we should really be using dot3adAggPortAttachedAggID since it is possible that you have selected an aggregator that you can not attach to, in the case where the aggregator has a limit on the number of ports that it can have attached.)

Original comment by: fenner

@netdisco-automation
Copy link
Author

On Cisco:
dot3adAggActorOperKey and dot3adAggPortActorOperKey

On Brocade ICX:
http://www.brocade.com/downloads/documents/product_manuals/MIB/MIB_Sep2013_Reference.pdf
snMSTrunkTable 1.3.6.1.4.1.1991.1.1.3.6.2
snSwPortInfoTable 1.3.6.1.4.1.1991.1.1.3.3.1
(configured and inactive need testing)

On Arista:
ifStackStatus
(no IEEE8023-LAG-MIB?)
(but what about configured and inactive LAGs?)

Original comment by: ollyg

@netdisco-automation
Copy link
Author

  • status: open --> closed
  • assigned_to: Oliver Gorwits

Original comment by: jeneric-placeholder

@netdisco-automation
Copy link
Author

Implemented in this commit. Support for CISCO-PAGP-MIB will be added upon request and someone willing to test.

Original comment by: jeneric-placeholder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants