How to do it...
Perform the following steps:
- Start the OpenDaylight Karaf distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf
- Install the user facing feature responsible for pulling in all dependencies needed to connect an NETCONF device:
opendaylight-user@root>feature:install odl-usc-channel-ui
It might take a minute or so to complete the installation.
- Start the USC agent and the echo server using a TCP session.
Open two terminal windows accessing this VM, then start the USC agent:
$ java -jar UscAgent.jar -t true
Start the echo server:
$ java -jar EchoServer.jar -t true -p 2007
- Create the channel using the following request. You will need the IP address of your VM, ${VM_IP_ADDRESS}:
- Type: POST
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/operations/usc-channel:add-channel
- Payload:
{
"input":{
"channel":{
"hostname":"${VM_IP_ADDRESS}",
"port":2007,
"remote":false,
"tcp":true
}
}
}
If the request went fine, you will receive the following output:
{
"output": {
"result": "Succeed to connect device(${VM_IP_ADDRESS}:2007)!"
}
}
- View the created channel using either a REST call, or using the OpenDaylight DLUX component:
1. REST CALL: All the information written by the USC plugin is located under the usc topology, so we're reading the content contained in this topology:
- Type: POST
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/operations/usc-channel:view-channel
- Payload:
{
"input":{
"topology-id":"usc"
}
}
This will return, among other information, a payload containing channel information such as its ID, composed of the hostname running OpenDaylight (inocybe.local), the VM IP address (192.168.2.26), and the type of protocol used to established the session (TLS). It also contains data regarding the session; this is the first created session, and we have zero written or read bytes:
"channel": [
{
"channel-id": "Controller:inocybe.local
-Device:192.168.2.26-type:TLS",
"channel-type": "TLS",
--[cut]--
"session": [
{
"session-id": "1",
"bytes-in": 0,
"bytes-out": 0,
"termination-point": {
"termination-point-id": "2007"
},
}
],
"destination": {
"dest-node": "192.168.2.26"
}
--[cut]--
}
]
2. Navigate to http://localhost:8181/index.html:
Log in using admin/admin. On the right, click the USC tab:

- Send a message through the channel. For this you will require the IP address of the VM running the USC agent, the port behind which the echo server is running, whether or not you're using TCP, and the message content:
- Type: POST
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/operations/usc-channel:send-message
- Payload:
{
"input":{
"channel":{
"hostname":"192.168.2.26",
"port":"2007",
"tcp":"true",
"content":"This is a test message."
}
}
}
This request should return a message saying it worked. The return message here is going to be similar to the one sent, as we're using an echo server. Using your own device, you could define the return statement, and you could react as desired when receiving the message:
{
"output": {
"result": "Succeed to send request to device(192.168.2.26:2007),content is This is a test message."
}
}
- Look at the channel information again; we will now see the number of input and output bytes had increased. Use the same process as defined in step 5.
Here is the output for current session 1 for the channel. You can see the number of bytes has increased. It shows the bytes per session and for the whole channel:
"channel": [
{
"channel-id": "Controller:inocybe.local
-Device:192.168.2.26-type:TLS",
"source": {
"source-node": "inocybe.local"
},
"sessions": 1,
"channel-type": "TLS",
"call-home": "",
"channel-alarms": 0,
"session": [
{
"session-id": "1",
"bytes-in": 23,
"termination-point": {
"termination-point-id": "2007"
},
"session-alarms": 0,
"bytes-out": 23
}
],
"destination": {
"dest-node": "192.168.2.26"
},
"bytes-in": 23,
"bytes-out": 23
}
]
- Remove the session, cleaning up all the statistics:
- Type: POST
- Headers:
Authorization: Basic YWRtaW46YWRtaW4=
- URL: http://localhost:8181/restconf/operations/usc-channel:remove-channel
- Payload:
{
"input":{
"channel":{
"hostname":"192.168.2.26",
"port":"2007",
"tcp":"true"
}
}
}
This request will respond with a positive message saying the channel was successfully removed:
{
"output": {
"result": "Succeed to remove device(192.168.2.26:2007)!"
}
}
You can send the request seen at point 5; you will see the channel is still present, but the session was removed.
- Learning Microsoft Windows Server 2012 Dynamic Access Control
- Mastering AWS Lambda
- 深度學習經典案例解析:基于MATLAB
- R語言數據可視化之美:專業圖表繪制指南
- 深入實踐Spring Boot
- RTC程序設計:實時音視頻權威指南
- 零基礎學Java(第4版)
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- concrete5 Cookbook
- 網站構建技術
- PHP 7從零基礎到項目實戰
- 人工智能算法(卷1):基礎算法
- Learning Apache Thrift
- INSTANT Apache Maven Starter
- Flutter for Beginners