Skip to content

Instantly share code, notes, and snippets.

@nickkaranatsios
Created January 16, 2012 00:35
Show Gist options
  • Save nickkaranatsios/1618228 to your computer and use it in GitHub Desktop.
Save nickkaranatsios/1618228 to your computer and use it in GitHub Desktop.
sliceable_routing_switch
# What's this
This is a routing switch application with slicing and packet filter capabilities.
The slicing function allows us to create multiple Layer 2 domains (similar to port and MAC-based VLAN
Look at packet information to choose path and cache paths to minimize connection setup latency.
We are interesting in inter-domain routing policy for full end-to-end paths.
A host that wishes to be reachable by senders installs an entry in a lookup service.
The sliceable routing switch supports redirection of unauthorized users to a specified port? page.
A slice of a resource users extends this to describe resource provisioning.
## Tenant Information
To get information about all tenants perform a GET on the tenants URL.
GET /tenants HTTP/1.1
## Tenant creation
To create a new tenant perform a POST on the tenant id/description
A key challenge today is to develop practical policies for adaptive and reliable allocation of networked computing resources from a common pool.
Configure or tear down a logical resource unit which may invoke multiple physical resources.
Users would probably interact with a Web portal to configure slices view slices.
Currently the API is limited but it is our intention to extend it to support slice performance metrics to determine the workload and make intelligent
decisions to grow or shrink computing resources. refinement continues.
You can think of a slice as a partition of a physical resource.
* create a new slice
* delete a new slice
* list of the available slices
description is the name of the slice to create.
To retrieve a list of all slices use the listSlices method.
create network boundaries, create distinct networks within a slice
Link represents a communication path between two neighbors. When the link is "up" communication is possible b/n the two entities.
A path is a sequence of connected system and links between a source and a destination.
Basically provides CRUD operations over HTTP.
### Response Status
The HTTP status codes that occur when creating a tenant using a non-CDMI content type are
described in Table 11.
HTTP Status Description
201 A new tenant was created.
401 Bad Request Invalid parameter or field name in the request
409 Conflict The operation resulted in conflict either because another tenant with the same key exists or
Example
PUT /tenant/tenant-id
# Introduction
Cloud services are forecast to grow in the next years providing a range of features and cost benefits
to customers and service providers. Configuring and provisioning computing resources is a complex and time
consuming challenge.
This document describes in detail a RESTful API that provides a simplified way to provision and dynamically
control of virtual network infrastructure.
This clause illustrates the following content-type operations:
* creating a new tenant,
* listing the contents of all tenants,
* reading the contents of a tenant, and
* deleting a tenant
## Create a new tenant
EXAMPLE Perform a POST to the tenant URI.
POST /tenants
The following shows the response.
## List the contents of all tenants
EXAMPLE Perform a GET to the tenant URI.
## Read the contents of a tenant
EXAMPLE GET from the tenant object id URI.
The following shows the response
## Delete a tenant
EXAMPLE Perform a DELETE to the tenant object id URI.
The following shows the response.
curl -v http://127.0.0.1:8888/networks -X POST -d '{ "id": "net-1", "description": "finance department" }' -H "Content-type: application/json"
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> POST /networks HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
> Content-type: application/json
> Content-Length: 54
>
< HTTP/1.1 202 Accepted
< Date: Tue, 31 Jan 2012 05:24:13 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
{"id":"net-1","description":"finance department"}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
curl -v http://127.0.0.1:8888/networks
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /networks HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 31 Jan 2012 05:25:08 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
[{"id":"net-1","description":"finance department"}]
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
## BUGS #################################################################
curl -v http://127.0.0.1:8888/networks/net-1/ports/trema2-2/attachments
This returns an attachment object even if the trema2-2 port number doesn't exist.
curl -v http://127.0.0.1:8888/networks/net-1/ports/trema2-2/attachments
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /networks/net-1/ports/trema2-2/attachments HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 09 Feb 2012 02:43:52 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
[{"id":"trema0-0-attachment","mac":"11:22:33:44:55:66"}]
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
curl -v http://127.0.0.1:8888/networks/net-1/ports/trema0-1
This returns information other than trema0-1
curl -v http://127.0.0.1:8888/networks/net-1/ports/trema0-1
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /networks/net-1/ports/trema0-1 HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 09 Feb 2012 02:49:21 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
{"attachments":[{"id":"trema0-0-attachment","mac":"11:22:33:44:55:66"}],"config":{"vid":1024,"datapath_id":"1234","port":2}}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
Attempt to create an existing network object.
Failed to create a slice (duplicate slice id)
curl -v http://127.0.0.1:8888/networks -X POST -d '{ "id": "net-1", "description": "marketing department" }' -H "Content-type: application/json"
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> POST /networks HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
> Content-type: application/json
> Content-Length: 56
>
< HTTP/1.1 422 Unprocessable Entity
< Date: Tue, 31 Jan 2012 05:26:54 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=ISO-8859-1
<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
Failed to create a slice (duplicated slice id)
~/apps/sliceable_routing_switch/test/rest_if$ curl -v http://127.0.0.1:8888/networks/net-1
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /networks/net-1 HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 31 Jan 2012 05:39:42 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
{"bindings":[],"description":"finance department"}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
curl -v http://127.0.0.1:8888/networks/net-1/ports -X POST -d '{ "id": "port#1", "datapath_id" :"1234", "port":1, "vid":1024}' -H "Content-type: application/json"
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> POST /networks/net-1/ports HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
> Content-type: application/json
> Content-Length: 62
>
< HTTP/1.1 202 Accepted
< Date: Tue, 31 Jan 2012 08:09:17 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Vary: Accept-Encoding
< Content-Length: 0
< Content-Type: text/plain; charset=ISO-8859-1
<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
curl -v http://127.0.0.1:8888/networks/net-1/ports
* About to connect() to 127.0.0.1 port 8888 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET /networks/net-1/ports HTTP/1.1
> User-Agent: curl/7.21.3 (i686-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:8888
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 31 Jan 2012 08:10:33 GMT
< Server: Apache/2.2.17 (Ubuntu)
< Transfer-Encoding: chunked
< Content-Type: application/json
<
[{"vid":1024,"datapath_id":"1234","id":"port#1","port":1}]
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment