Skip to content
Snippets Groups Projects
Commit f867fb66 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Merge branch 'feature/nat-540-twamp-light' into 'develop'

iptrunk_twamp

See merge request !138
parents 96cf4fed 0d461128
No related branches found
No related tags found
1 merge request!138iptrunk_twamp
Pipeline #86708 passed
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
- name: Juniper TWAMP client status - name: Juniper TWAMP client status
when: > when: >
local_side.iptrunk_side_node.vendor != remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "juniper" local_side.iptrunk_side_node.vendor == "juniper"
block: block:
- name: Get TWAMP client stats - name: Get TWAMP client stats
junipernetworks.junos.junos_command: junipernetworks.junos.junos_command:
commands: commands:
- show services rpm twamp client probe-results control-connection "{{ remote_side_short_name }}" test-session "{{ local_side_short_name }}--{{ remote_side_short_name }}" | except "Measurement|Samples" - show services rpm twamp client probe-results control-connection "{{ local_side_short_name }}--{{ remote_side_short_name }}" test-session "{{ local_side_short_name }}--{{ remote_side_short_name }}"
register: response register: response
- name: Show stats of TWAMP client - name: Show stats of TWAMP client
...@@ -18,7 +20,9 @@ ...@@ -18,7 +20,9 @@
msg: "{{ response.stdout_lines[0] }}" msg: "{{ response.stdout_lines[0] }}"
- name: Nokia TWAMP server status - name: Nokia TWAMP server status
when: > when: >-
local_side.iptrunk_side_node.vendor != remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "nokia" local_side.iptrunk_side_node.vendor == "nokia"
block: block:
- name: Get TWAMP server status - name: Get TWAMP server status
...@@ -28,11 +32,37 @@ ...@@ -28,11 +32,37 @@
content: | content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global"> <global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command> <md-cli-raw-command>
<md-cli-input-line>show test-oam twamp server prefix "{{ remote_side_address }}/32"</md-cli-input-line> <md-cli-input-line>show test-oam twamp server prefix "{{ subscription.iptrunk.iptrunk_ipv4_network }}"</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
register: out
- name: Show TWAMP server status
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
- name: Nokia TWAMP Light client status
when: >-
local_side.iptrunk_side_node.vendor == remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "nokia"
and
inventory_hostname == trunks[0].config.nodeB.name
block:
- name: Get TWAMP light stats from the client
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>show oam-pm statistics session "{{ local_side_short_name }}--{{ remote_side_short_name }}" twamp-light meas-interval raw</md-cli-input-line>
</md-cli-raw-command> </md-cli-raw-command>
</global-operations> </global-operations>
display: json display: json
register: out register: out
- name: Show ISIS status
- name: Show TWAMP Light stats from the client "{{ trunks[0].config.nodeB.name }}"
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}" msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
- name: Set short router names for local and remote sides - name: Set short router names for local and remote sides
ansible.builtin.set_fact: ansible.builtin.set_fact:
local_side_short_name: '{{ local_side.iptrunk_side_node.router_fqdn | replace(".lab.office.geant.net", "") }}' local_side_short_name: '{{ local_side.iptrunk_side_node.router_fqdn | replace(postfix_to_remove, "") }}'
remote_side_short_name: '{{ remote_side.iptrunk_side_node.router_fqdn | replace(".lab.office.geant.net", "") }}' remote_side_short_name: '{{ remote_side.iptrunk_side_node.router_fqdn | replace(postfix_to_remove, "") }}'
- name: Set Local and Remote side IPv4 addresses nodeA - name: Set Local and Remote side IPv4 addresses nodeA
ansible.builtin.set_fact: ansible.builtin.set_fact:
...@@ -55,15 +55,41 @@ ...@@ -55,15 +55,41 @@
remote_side_address: "{{ trunks[0].config.nodeA.ipv4_address }}" remote_side_address: "{{ trunks[0].config.nodeA.ipv4_address }}"
when: local_side.iptrunk_side_node.router_fqdn == trunks[0].config.nodeB.name when: local_side.iptrunk_side_node.router_fqdn == trunks[0].config.nodeB.name
- name: Set the "config_object" to "twamp_client" when trunks side is Juniper - name: Set the "config_object" to "twamp_client" when trunk is Juniper-Nokia and trunk side is Juniper
ansible.builtin.set_fact: ansible.builtin.set_fact:
config_object: "twamp_client" config_object: "twamp_client"
when: local_side.iptrunk_side_node.vendor == "juniper" when: >-
local_side.iptrunk_side_node.vendor != remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "juniper"
- name: Set the "config_object" to "twamp_server" when trunk side is Nokia - name: Set the "config_object" to "twamp_server" when trunk is Juniper-Nokia and trunk side is Nokia
ansible.builtin.set_fact: ansible.builtin.set_fact:
config_object: "twamp_server" config_object: "twamp_server"
when: local_side.iptrunk_side_node.vendor == "nokia" when: >-
local_side.iptrunk_side_node.vendor != remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "nokia"
- name: Set the "config_object" to "twamp_light_server" when trunk is Nokia-Nokia and node is nodeA
ansible.builtin.set_fact:
config_object: "twamp_light_server"
when: >-
local_side.iptrunk_side_node.vendor == remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "nokia"
and
inventory_hostname == trunks[0].config.nodeA.name
- name: Set the "config_object" to "twamp_light_client" when trunk is Nokia-Nokia and node is nodeB
ansible.builtin.set_fact:
config_object: "twamp_light_client"
when: >-
local_side.iptrunk_side_node.vendor == remote_side.iptrunk_side_node.vendor
and
local_side.iptrunk_side_node.vendor == "nokia"
and
inventory_hostname == trunks[0].config.nodeB.name
- name: Include compiling the template - name: Include compiling the template
ansible.builtin.include_tasks: compile_object.yaml ansible.builtin.include_tasks: compile_object.yaml
......
...@@ -2,7 +2,7 @@ services { ...@@ -2,7 +2,7 @@ services {
rpm { rpm {
twamp { twamp {
client { client {
replace: control-connection "{{ local_side_short_name }}--{{ remote_side_short_name }}" replace: control-connection "{{ local_side_short_name }}--{{ remote_side_short_name }}" {
destination-port {{ juniper_twamp_client.destination_port }}; destination-port {{ juniper_twamp_client.destination_port }};
history-size {{ juniper_twamp_client.history_size }}; history-size {{ juniper_twamp_client.history_size }};
target-address {{ remote_side_address }}; target-address {{ remote_side_address }};
......
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<oam-pm xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<bin-group>
<bin-group-id>{{ nokia_twamp_light.oam_pm_bin_group }}</bin-group-id>
<admin-state>enable</admin-state>
</bin-group>
<session alu:operation="replace">
<session-name>{{ local_side_short_name }}--{{ remote_side_short_name }}</session-name>
<bin-group>{{ nokia_twamp_light.oam_pm_bin_group }}</bin-group>
<ip>
<destination>{{ remote_side_address }}</destination>
<destination-udp-port>{{ nokia_twamp_light.udp_port}}</destination-udp-port>
<source>{{ local_side_address }}</source>
<twamp-light>
<admin-state>enable</admin-state>
<test-id>{{ nokia_twamp_light.test_id }}</test-id>
<interval>{{ nokia_twamp_light.interval }}</interval>
<pad-size>{{ nokia_twamp_light.pad_size }}</pad-size>
<record-stats>{{ nokia_twamp_light.record_stats }}</record-stats>
</twamp-light>
</ip>
</session>
</oam-pm>
</configure>
</config>
<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<router xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<router-name>Base</router-name>
<twamp-light>
<reflector>
<admin-state>enable</admin-state>
<udp-port>{{ nokia_twamp_light.udp_port }}</udp-port>
<prefix>
<ip-prefix>{{ nokia_twamp_light.trunks_subnet }}</ip-prefix>
</prefix>
</reflector>
</twamp-light>
</router>
</configure>
</config>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<server> <server>
<admin-state>enable</admin-state> <admin-state>enable</admin-state>
<prefix alu:operation="replace"> <prefix alu:operation="replace">
<ip-prefix>{{ remote_side_address }}/32</ip-prefix> <ip-prefix>{{ subscription.iptrunk.iptrunk_ipv4_network }}</ip-prefix>
<description>{{ remote_side_short_name }}</description> <description>{{ remote_side_short_name }}</description>
<max-connections>{{ nokia_twamp_server.max_conn }}</max-connections> <max-connections>{{ nokia_twamp_server.max_conn }}</max-connections>
<max-sessions>{{ nokia_twamp_server.max_sess }}</max-sessions> <max-sessions>{{ nokia_twamp_server.max_sess }}</max-sessions>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
dry_run: "True" dry_run: "True"
postfix_to_remove: ".dev.geant.private"
nokia_twamp_server: nokia_twamp_server:
max_conn: 1 max_conn: 1
max_sess: 1 max_sess: 1
...@@ -18,6 +20,16 @@ juniper_twamp_client: ...@@ -18,6 +20,16 @@ juniper_twamp_client:
probe_count: 500 probe_count: 500
probe_interval: 1 probe_interval: 1
nokia_twamp_light:
oam_pm_bin_group: 2
udp_port: 64364
test_id: 1
interval: 1000
pad_size: 10
record_stats: delay-and-loss
trunks_subnet: "10.101.1.0/24"
side_a_ipv4_address: "{{ subscription.iptrunk.iptrunk_ipv4_network | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('address') }}" side_a_ipv4_address: "{{ subscription.iptrunk.iptrunk_ipv4_network | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('address') }}"
side_b_ipv4_address: "{{ subscription.iptrunk.iptrunk_ipv4_network | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('1') | ansible.utils.ipaddr('address') }}" side_b_ipv4_address: "{{ subscription.iptrunk.iptrunk_ipv4_network | ansible.utils.ipaddr('net') | ansible.utils.ipaddr('1') | ansible.utils.ipaddr('address') }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment