官术网_书友最值得收藏!

How to do it...

Perform the following steps:

  1. Get the packetcable-emulator JAR here: https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/packetcable/packetcable-emulator/1.4.2-Boron-SR2/packetcable-emulator-1.4.2-Boron-SR2.jar

If you want to look into the source code and build the emulator yourself, use the following command to clone the source code repository and assemble the JAR:

$ git clone --branch release/boron-sr2 https://git.opendaylight.org/gerrit/packetcable 
$ cd packetcable/packetcable-emulator/
$ mvn assembly:assembly

In the target folder will be the JARs. The one of interest ends with -jar-with-dependencies.jar.

  1. Create a configuration file in the YAML format containing the following values:
  • The CMTS communication port number:
port: 3918 
  • The maximum number of classifiers per gate this CMTS supports:
numberOfSupportedClassifiers: 4 
  • Configuration for the service class names:
serviceClassNames: 
- direction: UPSTREAM
names:
- extrm_up
- foo_up
- direction: DOWNSTREAM
names:
- extrm_dn
- foo_dn
  • Cable modem information:
cmStatuses: 
- host: 10.32.110.180
status: true
- host: 10.32.110.179
status: true
  1. Start the emulator using the JAR and the configuration file as follows:
$ java -cp packetcable-emulator-1.4.2-Boron-SR2-jar-with-dependencies.jar org.pcmm.rcd.impl.CMTS {path to yaml} 
22:00:02.966 [main] INFO org.pcmm.concurrent.IWorkerPool - Pool size :32
22:00:02.984 [main] INFO org.pcmm.rcd.impl.AbstractPCMMServer - Server started and listening on port :3918
  1. Start your OpenDaylight distribution using the karaf script. Using this script will give you access to the Karaf CLI:
$ ./bin/karaf 
  1. Install the user-facing feature responsible for pulling in all dependencies needed to enable user authentication:
opendaylight-user@root>feature:install odl-packetcable-policy-server

It might take a few minutes to complete the installation.

  1. Before setting any PCMM gates, we need to establish a persistent connection between OpenDaylight and a CTMS/Converged Cable Access Platform (CCAP) (add a CCAP 1 request from the Postman collection).

We're going to connect to one of the simulated devices configured and started previously (you could use your own device here). The request will require the IP address and the port of the device, along with the downstream and upstream service class name.

If you're using the emulator, you need to use the IP address of the host running it.

Finally, you will have to define the ${ID} for the new entry in both the URL and the payload (the ${ID} is a string):

  • Type: PUT
  • Headers:

Authorization: Basic YWRtaW46YWRtaW4=

  • URL: http://localhost:8181/restconf/config/packetcable:ccaps/ccap/${ID}
  • Payload:
{
"ccap": [{
"ccapId": "${ID}",
"amId": {
"am-tag": "0xcada",
"am-type": "1"
},
"connection": {
"ipAddress": "10.32.110.180",
"port": "3918"
},
"subscriber-subnets": [
"10.32.110.1/24"
],
"downstream-scns": [
"extrm_dn"
],
"upstream-scns": [
"extrm_up"
]
}]
}

If the connection to a CCAP succeeded, the HTTP request will return 200 OK. You will see a lot of activity in the command line where you started the emulator. The first message is the new connection:

[pool-2-thread-1] INFO  org.pcmm.rcd.impl.AbstractPCMMServer - Accepted a new connection from :192.168.2.11:49682 

Once the connection is established, a keep-alive mechanism is in place to ensure the connection is still up.

  1. Verify the status of the connection we just created (operational -Get All CCAPs).

For this request, we're going to use the operational datastore, providing operational data. It reflects current state of the device:

  • Type: GET
  • Headers:

Authorization: Basic YWRtaW46YWRtaW4=

  • URL: http://localhost:8181/restconf/operational/packetcable:ccaps/ccap/${ID}

This request returns the connection information for the device with ${ID}=1. Our device is currently connected:

{ 
"ccap": [
{
"ccapId": "1",
"connection": {
"connected": true
}
}
]
}
  1. Let's create a gate now. To do so, we will submit the following request:
Gate w/ classifier

We will use the first cable modem defined in the configuration file for our gate. You will have to define three variables for this request: the ${APPLICATION_CLASSIFIER}, the ${SUBSCRIBER_ID} and the ${GATE_ID}:

  • Type: PUT
  • Headers:

Authorization: Basic YWRtaW46YWRtaW4=

  • URL: http://localhost:8181//restconf/config/packetcable:qos/apps/app/${APPLICATION_CLASSIFIER}/subscribers/subscriber/${SUBSCRIBER_ID}/gates/gate/${GATE_ID}/
  • Payload:
{    
"gate":
{

"gateId": "${APPLICATION_CLASSIFIER}",
"classifiers":
{

"classifier-container":
[

{

"classifier-id": "1",

"classifier":
{

"srcIp": "10.10.10.0",

"dstIp": "10.32.110.178",

"protocol": "0",

"srcPort": "1234",

"dstPort": "4321",

"tos-byte": "0xa0",

"tos-mask": "0xe0"

}

}

]

},

"gate-spec":
{

"dscp-tos-overwrite": "0xa0",

"dscp-tos-mask": "0xff"

},

"traffic-profile":
{

"service-class-name": "extrm_up"

}

}
}

If the request went well, it will return 200 OK and you will see some activity in the terminal console, saying the gate was successfully processed:

[Thread-0] INFO  org.pcmm.rcd.impl.CmtsPepReqStateMan - Returning SUCCESS for gate request [extrm_up] direction [Upstream] for host - 10.32.110.180 
主站蜘蛛池模板: 洪泽县| 义马市| 黄龙县| 阿拉尔市| 保亭| 长沙县| 晋宁县| 亚东县| 高雄市| 忻州市| 尚志市| 富阳市| 富锦市| 象山县| 万安县| 郧西县| 宜昌市| 大洼县| 百色市| 饶平县| 西城区| 梅河口市| 木里| 吴堡县| 芒康县| 云南省| 乃东县| 邳州市| 宁夏| 宝清县| 高清| 白山市| 绵竹市| 高陵县| 景泰县| 尤溪县| 东兰县| 佳木斯市| 博乐市| 西畴县| 英山县|