devel:blueprints:consolidated-interface-table
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| devel:blueprints:consolidated-interface-table [2009/02/06 10:53] – created morten | devel:blueprints:consolidated-interface-table [2009/03/19 13:26] (current) – morten | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | A preliminary schema | + | ====== Rationale ====== |
| - | <code sql> | + | NAV has for many years had an artifical divide between switch ports and router interfaces, which are stored in each their table (//swport// and // |
| + | Conceptually, | ||
| + | NAV contains a lot of duplicate and/or complex code to work with both swports and gwports, since they are in separate tables. | ||
| + | |||
| + | |||
| + | ====== New schema ====== | ||
| + | A preliminary schema for a new interface table: | ||
| + | <code sql> | ||
| -- New consolidated interface table | -- New consolidated interface table | ||
| -- See MIB-II, IF-MIB, RFC 1229 | -- See MIB-II, IF-MIB, RFC 1229 | ||
| CREATE TABLE interface ( | CREATE TABLE interface ( | ||
| - | interfaceid SERIAL, | + | interfaceid SERIAL |
| - | netboxid INT4, | + | netboxid INT4 NOT NULL, |
| moduleid INT4, | moduleid INT4, | ||
| ifindex INT4 NOT NULL, | ifindex INT4 NOT NULL, | ||
| Line 14: | Line 21: | ||
| speed DOUBLE PRECISION, | speed DOUBLE PRECISION, | ||
| ifphysaddress MACADDR, | ifphysaddress MACADDR, | ||
| - | ifadminstatus INT4, | + | ifadminstatus INT4, -- 1=up, 2=down, 3=testing |
| - | ifoperstatus INT4, | + | ifoperstatus INT4, -- 1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, |
| iflastchange INT4, | iflastchange INT4, | ||
| ifconnectorpresent BOOLEAN, | ifconnectorpresent BOOLEAN, | ||
| Line 30: | Line 37: | ||
| to_interfaceid INT4, | to_interfaceid INT4, | ||
| + | gone_since TIMESTAMP, | ||
| | | ||
| CONSTRAINT interface_pkey PRIMARY KEY (interfaceid), | CONSTRAINT interface_pkey PRIMARY KEY (interfaceid), | ||
| Line 51: | Line 59: | ||
| | | ||
| ); | ); | ||
| + | |||
| </ | </ | ||
| + | |||
| + | The gwport table contains a field dubbed '' | ||
| + | |||
| + | <code sql> | ||
| + | -- Routing protocol attributes | ||
| + | CREATE TABLE rproto_attr ( | ||
| + | id SERIAL NOT NULL, | ||
| + | interfaceid INT4 NOT NULL, | ||
| + | protoname VARCHAR NOT NULL, -- bgp/ | ||
| + | metric INT4, | ||
| + | |||
| + | CONSTRAINT rproto_attr_pkey | ||
| + | | ||
| + | CONSTRAINT rproto_attr_interfaceid_fkey | ||
| + | | ||
| + | | ||
| + | ); | ||
| + | </ | ||
| + | |||
devel/blueprints/consolidated-interface-table.1233917623.txt.gz · Last modified: by morten
