Open-source implementation of the NSI protocol with support for different backends
NORDUnet, updated
🕥
2022-10-06 13:19:05

OpenNSA
OpenNSA is an implementation of the Network Service Interface (NSI).
NSI (Network Service Interface) is a technology agnostic protocol for
provisioning network circuits. For more information on NSI, see project page at
OGF: https://redmine.ogf.org/projects/nsi-wg
OpenNSA is currently in a state of heavy development, and many features are
only partially implemented.
OpenNSA features
- Open-source NSI implementation
- Pluggable backends to support different equipment
- Support: Junox MX, Force10 switch (etherscale), Dell Powerconnect
- DUD backend for easy testing
- Any custom Python backend
- Easy development of new backends
- Easy creation of NML topology from short-hand topology specification
- Topology aggregation and path finding to do multi-domain circuit creation
- PostgreSQL for database
- Includes command line tool for basic operations
Documentation
Full and detailed documentation available here
License
NORDUnet License (3-clause BSD). See LICENSE for more details.
Contact
- Johannes Garm Houen - jgh @ nordu.net
- Samir Faci - samir @ es.net
Copyright
NORDUnet (2011-2015)
Issues
opened on 2022-05-04 16:18:03 by jmacauley
This one is pretty simple. The query operation filters reservations based on the requester's nsaId so an NSA only sees reservation created by itself, however, OpenNSA does not restrict the terminate operation on NSA to terminate a second NSA's reservation.
opened on 2021-09-29 16:53:06 by jmacauley
Look like onsa command line has issues handling SOAP faults returned from service providers. The following error was generated when a SOAP fault was received for invalid message contents.
```
[email protected]:~$ onsa reserveprovision -s calit2.optiputer.net:2020:prism-core:k8s-gen4-01#vlan=1779 -d calit2.optiputer.net:2020:prism-core:k8s-gen4-02#vlan=1779 -y
Site (TLS) starting on 7080
Starting factory
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 501, in errback
self._startRunCallbacks(fail)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
self._runCallbacks()
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
current.result = callback(current.result, args, kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
inlineCallbacks(r, g, status)
--- ---
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/bin/onsa", line 196, in doMain
yield commands.reserveprovision(client, nsi_header, source_stp, dest_stp, start_time, end_time, bandwidth, ero, connection_id, global_id, notification_wait)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/local/lib/python3.7/dist-packages/opennsa/cli/commands.py", line 147, in reserveprovision
connection_id, ,_, criteria = yield client.reserve(nsi_header, connection_id, global_id, 'Test Connection', crt)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
current.result = callback(current.result, args, **kw)
File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/requesterclient.py", line 135, in _handleAck
header, ack = helper.parseRequest(soap_data)
File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/helper.py", line 154, in parseRequest
body = nsiconnection.parseElement(bodies[0])
File "/usr/local/lib/python3.7/dist-packages/opennsa/protocols/nsi2/bindings/nsiconnection.py", line 962, in parseElement
raise ValueError('No type mapping for tag %s' % element.tag)
builtins.ValueError: No type mapping for tag {http://schemas.xmlsoap.org/soap/envelope/}Fault
(TLS Port 7080 Closed)
Stopping factory
[email protected]:~$
```
Here is the SOAP Fault generated by the Safnari NSI provider:
```
application/vnd.ogf.nsi.cs.v2.provider+soap
urn:uuid:e91395de-2143-11ec-aafc-ce184112601b
urn:ogf:network:calit2.optiputer.net:2020:onsa-cli
urn:ogf:network:es.net:2013:nsa:nsi-aggr-west
soapenv:Server
Parameter provided contains an unsupported value that MUST be processed
urn:ogf:network:es.net:2013:nsa:nsi-aggr-west
00102
Parameter provided contains an unsupported value that MUST be processed
urn:ogf:network:calit2.optiputer.net:2020:nsa
```
opened on 2021-09-28 14:26:05 by jmacauley
Title says it all. Would like OpenNSA to support the ifModifiedSince query functionality as per NSI CS 2.1 specification.
opened on 2021-08-10 21:27:42 by marcosfsch
Running the OpenNSA (master) docker with TLS, I always get a fatal error on twisted.
opennsa_1 | 2021-08-10 21:20:14Z [-] Loading opennsa.tac...
opennsa_1 | 2021-08-10 21:20:14Z [-] Loaded.
opennsa_1 | 2021-08-10 21:20:14Z [-] twistd 21.7.0 (/usr/bin/python3 3.7.3) starting up.
opennsa_1 | 2021-08-10 21:20:14Z [-] reactor class: twisted.internet.epollreactor.EPollReactor.
opennsa_1 | 2021-08-10 21:20:14Z [-] OpenNSA service initializing
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'OISTE WISeKey Global Root GB CA'
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'Baltimore CyberTrust Root'
opennsa_1 | 2021-08-10 21:20:14Z [opennsaTlsContext] Loaded CA certificate commonName b'Certum Trusted Network CA 2'
opennsa_1 | 2021-08-10 21:20:14Z [-] Traceback (most recent call last):
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/internet/_sslverify.py", line 324, in getattr
opennsa_1 | 2021-08-10 21:20:14Z [-] return self[_x509names[attr]]
opennsa_1 | 2021-08-10 21:20:14Z [-] KeyError: 'commonName'
opennsa_1 | 2021-08-10 21:20:14Z [-]
opennsa_1 | 2021-08-10 21:20:14Z [-] During handling of the above exception, another exception occurred:
opennsa_1 | 2021-08-10 21:20:14Z [-]
opennsa_1 | 2021-08-10 21:20:14Z [-] Traceback (most recent call last):
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/bin/twistd", line 10, in
opennsa_1 | 2021-08-10 21:20:14Z [-] sys.exit(run())
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/twistd.py", line 36, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] app.run(runApp, ServerOptions)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 676, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] runApp(config)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/twistd.py", line 30, in runApp
opennsa_1 | 2021-08-10 21:20:14Z [-] runner.run()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 376, in run
opennsa_1 | 2021-08-10 21:20:14Z [-] self.postApplication()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/_twistd_unix.py", line 255, in postApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] self.startApplication(self.application)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/scripts/_twistd_unix.py", line 456, in startApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] app.startApplication(application, not self.config["no_save"])
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/app.py", line 691, in startApplication
opennsa_1 | 2021-08-10 21:20:14Z [-] service.IService(application).startService()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/application/service.py", line 276, in startService
opennsa_1 | 2021-08-10 21:20:14Z [-] service.startService()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 331, in startService
opennsa_1 | 2021-08-10 21:20:14Z [-] factory, ctx_factory = self.setupServiceFactory()
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 184, in setupServiceFactory
opennsa_1 | 2021-08-10 21:20:14Z [-] ctx_factory = setupTLSContext(vc) # May be None
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/setup.py", line 107, in setupTLSContext
opennsa_1 | 2021-08-10 21:20:14Z [-] ctx_factory = opennsa2WayTlsContext(vc[config.KEY], vc[config.CERTIFICATE], vc[config.CERTIFICATE_DIR], vc[config.VERIFY_CERT])
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 116, in init
opennsa_1 | 2021-08-10 21:20:14Z [-] opennsaTlsContext.init(self, certificate_dir, verify)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 30, in init
opennsa_1 | 2021-08-10 21:20:14Z [-] self._trustRoot = self._createTrustRootFromCADirectory(certificate_dir)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/home/opennsa/opennsa/opennsa/opennsaTlsContext.py", line 49, in _createTrustRootFromCADirectory
opennsa_1 | 2021-08-10 21:20:14Z [-] log.msg('Loaded CA certificate commonName %s' % (str(CACertificates[-1].getSubject().commonName)), system = LOG_SYSTEM)
opennsa_1 | 2021-08-10 21:20:14Z [-] File "/usr/local/lib/python3.7/dist-packages/twisted/internet/_sslverify.py", line 326, in getattr
opennsa_1 | 2021-08-10 21:20:14Z [-] raise AttributeError(attr)
opennsa_1 | 2021-08-10 21:20:14Z [-] AttributeError: commonName
opened on 2020-11-06 18:20:42 by jmacauley
This issue relates to state transitions in the reservationState machine. Using the following reserveTimeout message for illustration:
```
2020-09-24 06:38:24,764 [ConnectionService] reserveTimeout for {
providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
correlationId = urn:uuid:3846121e-fe6b-11ea-af4e-525400c57fcf,
connectionId = LS-cd202541ea,
notificationId = 46,
timeStamp = 2020-09-24T13:38:24.723135Z,
originatingNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
originatingConnectionId = JUNOS-711498,
timeoutValue = 120
}
```
I received this timeout message for reservation”LS-cd202541ea“ and transition my internal reservationState machine to “ReserveTimeout” which is a stable state in the machine. However, the next time I queried this reservation I got the following:
```
2020-09-24 06:39:05,970 [QuerySummary] incoming providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa, QuerySummaryResultType:
LS-cd202541ea
urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:switch:EVTS.A-GOLE:conn+66c1950a-4bcf-464c-ad8c-559cc20a0edb:resource+links-connection_1:vlan+3601
deltaId+c7544ad5-7d9f-49f2-90e2-9baddecddbe6:uuid+950bc160-7fa3-4fba-8be1-daf8f9e71ff5
2021-09-24T13:36:24.224000Z
http://services.ogf.org/nsi/2013/07/descriptions/EVTS.A-GOLE
10000
Bidirectional
false
urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:snvl2-pw-sw-1?vlan=3601
urn:ogf:network:lsanca.pacificwave.net:2016:pw-losa2-1:ultralight?vlan=3601
urn:ogf:network:lsanca.pacificwave.net:2016:sense:pw-losa2-1
ReserveHeld
Released
Created
false
0
false
1089211
0
```
It seems that even though the reservation timed out it remains in the “ReserveHeld” state. This presents a problem in that it is not a valid transition (ie. it should be in the ReserveTimeout state), and I still see my reservation in a ReserveHeld state but cannot commit it.
In the NSI CS 2.1 protocol the aggregator also models the reserve timeout state two provide a consistent view of the reservation throughout the connection hierarchy.
opened on 2020-11-06 18:17:36 by jmacauley
When the reservation reserveTimeout event is return by an aggregator OpenNSA on PacificWave I get the following content:
reserveTimeout {
providerNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
correlationId = urn:uuid:3846121e-fe6b-11ea-af4e-525400c57fcf,
connectionId = LS-cd202541ea,
notificationId = 46,
timeStamp = 2020-09-24T13:38:24.723135Z,
originatingNSA = urn:ogf:network:lsanca.pacificwave.net:2016:nsa,
originatingConnectionId = JUNOS-711498,
timeoutValue = 120
}
In this case the “originatingConnectionId” should be set to “LS-cd202541ea” since this NSA is the originating NSA of the timeout. If the aggregator had exposed the underlying uPA then the “originatingNSA” field would have been set to that uPA, and then “originatingConnectionId” as the connectionId in the context of the uPA. However, since there is no visibility of an NSA other than “urn:ogf:network:lsanca.pacificwave.net:2016:nsa” we need it set to “LS-cd202541ea” since this is the uPA reservation in the context of NSI.
Releases
3.0.2 2021-11-26 07:43:26
What's Changed
- Support configuration for any backend by @bjpbakker in https://github.com/NORDUnet/opennsa/pull/5
- Adding json content-type by @mkrogh in https://github.com/NORDUnet/opennsa/pull/6
- Change bandwidth to capacity by @mkrogh in https://github.com/NORDUnet/opennsa/pull/7
- Update rest interface documentation by @mkrogh in https://github.com/NORDUnet/opennsa/pull/8
- Use the same names as GET for start_time and end_time by @mkrogh in https://github.com/NORDUnet/opennsa/pull/9
- Bump twisted from 15.2.1 to 19.7.0 by @dependabot in https://github.com/NORDUnet/opennsa/pull/10
- build docker container with opennsa v3 and python3 by @hanstrompert in https://github.com/NORDUnet/opennsa/pull/13
- New twisted client TLS context with correct peer verification and SNI support by @hanstrompert in https://github.com/NORDUnet/opennsa/pull/18
- not all certificates have a common name by @hanstrompert in https://github.com/NORDUnet/opennsa/pull/22
- Removed necessity for --squash by @marcosfsch in https://github.com/NORDUnet/opennsa/pull/21
- Docker Overall Improvement and workflow changes by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/23
- Updated oess.py to python3 by @marcosfsch in https://github.com/NORDUnet/opennsa/pull/20
- Introduce Admin access to querySummary by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/29
- Adding CI/CD by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/30
- Adding instructions for local CI/CD exec by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/32
- Proxied setup support by @hanstrompert in https://github.com/NORDUnet/opennsa/pull/31
- [TechDebt] Adding a CI health badge by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/34
- [TechDebt] Adding automatic docker publishing. by @safaci2000 in https://github.com/NORDUnet/opennsa/pull/35
- an http request should return bytes by @hanstrompert in https://github.com/NORDUnet/opennsa/pull/33
New Contributors
- @bjpbakker made their first contribution in https://github.com/NORDUnet/opennsa/pull/5
- @mkrogh made their first contribution in https://github.com/NORDUnet/opennsa/pull/6
- @dependabot made their first contribution in https://github.com/NORDUnet/opennsa/pull/10
- @hanstrompert made their first contribution in https://github.com/NORDUnet/opennsa/pull/13
- @marcosfsch made their first contribution in https://github.com/NORDUnet/opennsa/pull/21
- @safaci2000 made their first contribution in https://github.com/NORDUnet/opennsa/pull/23
Full Changelog: https://github.com/NORDUnet/opennsa/commits/3.0.2
OpenNSA 3.0.1 2020-06-11 06:33:29
- Partial port of the the brocade backend to Python 3
- Updated docker buildfile for Python 3 (kindly provided by Hans Trompert, SURFnet)
- Some initial tests with multi-NSA setups
- Fix issue with nml network displaying the wrong network names
- Some slight clarification around OpenNSA 3 migration.
- Fix issue with remote network being omitted in nml topology
- Better error message if the cerficate directory is not a directory
- Fix issue with the object id being listed in the discovery.xml (and not nsa id)
- Improved logging (missing system variables / better explanations, linkvector)
- Some spelling/grammar fixes on the documentation
- Fix issue with undefined variable being used in httpclient
- Improve parsing of peers url list
- Better documentation around having multiple peers
- Several fixes regarding byte/string in all of the code base
- Updated requirements to specify twistar 2.0
Special thanks to John Hess for a lot of feedback and patches for this release.
OpenNSA 3.0.0 2020-01-22 12:43:18
- Port to Python 3
- Support for multiple backends
- More tests added
- Better pathfinder and pathfinding in general
- Better logging in several odd error cases
- Lots of small fixes
This release requires some small changes to configuration file.
See docs/migration for details.