-| | ...
-| | ... | \| Receive and verify router advertisement packet \
-| | ... | \| ${nodes['DUT1']} \| eth2 \| 08:00:27:cc:4f:54 \|
-| | ...
-| | [Arguments] | ${node} | ${rx_port} | ${src_mac} | ${interval}=${0}
-| | ...
-| | ${rx_port_name}= | Get interface name | ${node} | ${rx_port}
-| | ${args}= | Catenate | --rx_if ${rx_port_name} | --src_mac ${src_mac}
-| | ... | --interval ${interval}
-| | Run Traffic Script On Node | check_ra_packet.py | ${node} | ${args}
+| | ... | \| \${encr_alg}= \| Crypto Alg AES CBC 128 \|
+| | ... | \| \${auth_alg}= \| Integ Alg SHA1 96 \|
+| | ... | \| Send IPsec Packet and verify ESP encapsulation in received packet\
+| | ... | \| \${nodes['TG']} \| eth1 \| eth2 \
+| | ... | \| 52:54:00:d4:d8:22 \| 52:54:00:d4:d8:3e \| \${encr_alg} \
+| | ... | \| sixteenbytes_key \| ${auth_alg} \| twentybytessecretkey \
+| | ... | \| \${1001} \| \00} \| 192.168.3.3 \| 192.168.4.4 \
+| | ... | \| 192.168.100.2 \| 192.168.100.3 \|
+| |
+| | [Arguments] | ${node} | ${tx_interface} | ${rx_interface} | ${tx_dst_mac}
+| | ... | ${rx_src_mac} | ${crypto_alg} | ${crypto_key} | ${integ_alg}
+| | ... | ${integ_key} | ${l_spi} | ${r_spi} | ${l_ip} | ${r_ip}
+| | ... | ${l_tunnel}=${None} | ${r_tunnel}=${None}
+| |
+| | ${tx_src_mac}= | Get Interface Mac | ${node} | ${tx_interface}
+| | ${tx_if_name}= | Get Interface Name | ${node} | ${tx_interface}
+| | ${rx_dst_mac}= | Get Interface Mac | ${node} | ${rx_interface}
+| | ${rx_if_name}= | Get Interface Name | ${node} | ${rx_interface}
+| | ${args}= | Catenate | --rx_if ${rx_if_name} | --tx_if ${tx_if_name}
+| | ... | --tx_src_mac ${tx_src_mac} | --tx_dst_mac ${tx_dst_mac}
+| | ... | --rx_src_mac ${rx_src_mac} | --rx_dst_mac ${rx_dst_mac}
+| | ... | --src_ip ${l_ip} | --dst_ip ${r_ip}
+| | ${crypto_alg_str}= | Get Crypto Alg Scapy Name | ${crypto_alg}
+| | ${integ_alg_str}= | Get Integ Alg Scapy Name | ${integ_alg}
+| | ${args}= | Catenate | ${args} | --crypto_alg ${crypto_alg_str}
+| | ... | --crypto_key ${crypto_key} | --integ_alg ${integ_alg_str}
+| | ... | --integ_key ${integ_key} | --l_spi ${l_spi} | --r_spi ${r_spi}
+| | ${args}= | Set Variable If | "${l_tunnel}" == "${None}" | ${args}
+| | ... | ${args} --src_tun ${l_tunnel}
+| | ${args}= | Set Variable If | "${r_tunnel}" == "${None}" | ${args}
+| | ... | ${args} --dst_tun ${r_tunnel}
+| | Run Traffic Script On Node | ipsec_policy.py | ${node} | ${args}