Archive

‘Programmer’ 分类存档

Deploy TRex in Centos7.4

TRex based on DPDK, have high performance for traffics generator scenario. TRex has two deployment scenarios, one is Stateless mode, another is Server/client mode. How different for them? As follow pic. Btw, TRex has a GUI tool that can easy config traffic pattern, but that only support in Stateless mode. For Server/Client mode, only CLI (you can reference “Linux SRv6实战 (第三篇) 多云环境下Overlay(VPP) 和Underlay整合测试 ” that use Server/Client mode). For the article, only focus on stateless mode and GUI tool.

完整阅读

OpenR on NCS5500

For detail info, please refer to following  Akshat’s article, for my article only simply summary step to build openr on ncs5500. Thanks Akshat’s help for the openr set up 🙂

https://xrdocs.io/cisco-service-layer/blogs/2018-02-16-xr-s-journey-to-the-we-b-st-open-r-integration-with-ios-xr/

1. Set up the private insecure registry on your server

Refer as follow:

https://docs.docker.com/registry/deploying/ 

https://xrdocs.io/application-hosting/tutorials/2017-02-26-running-docker-containers-on-ios-xr-6-1-2/#private-insecure-registry

[root@nso ~]# nano /etc/yum.repos.d/docker.repo
[root@nso ~]# yum install docker-engine 
[root@nso ~]# systemctl start docker
[root@nso ~]# docker run -d -p 5000:5000 --restart=always --name registry registry:2
[root@nso ~]# docker pull akshshar/openr-xr
[root@nso ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
c4636568f48a        registry:2          "/entrypoint.sh /e..."   6 minutes ago       Up 6 minutes        0.0.0.0:5000->5000/tcp   registry

[root@nso ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
registry            2                   f32a97de94e1        13 days ago         25.8MB
akshshar/openr-xr   latest              b51c260b060e        2 months ago        1.76GB

[root@nso ~]# docker tag akshshar/openr-xr 10.75.58.72:5000/openr-xr
[root@nso ~]# docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
registry                    2                   f32a97de94e1        13 days ago         25.8MB
akshshar/openr-xr           latest              b51c260b060e        2 months ago        1.76GB
10.75.58.72:5000/openr-xr   latest              b51c260b060e        2 months ago        1.76GB
[root@nso ~]# docker push 10.75.58.72:5000/openr-xr
The push refers to a repository [10.75.58.72:5000/openr-xr]
Get https://10.75.58.72:5000/v1/_ping: http: server gave HTTP response to HTTPS client
[root@nso ~]# 

2. Add follow at “/etc/sysconfig/docker”

After changing the docker opts, please wait some seconds, docker will auto restart.

DOCKER_OPTS=" --insecure-registry 10.75.58.72:5000"

完整阅读

Install/Use Yangsuite by Docker

Cisco finally published the YangSuit at Devnet at Feb 2021, that can be downloaded and used by customer, and it is Free! I updated the installation section of the article to use the public version, other section should similar and not update.

Cisco YANG Suite provides a set of tools and plugins to learn, test, and adopt YANG programmable interfaces such as NETCONF, RESTCONF, gNMI and more.

YANG Suite will provides network operators with a common tool to interact with Cisco IOS XE, IOS XR, and the NX-OS Network Operating Systems as they look to modernize their network management and migrate from traditional network management tools.

https://developer.cisco.com/yangsuite/?utm_campaign=yang21&utm_source=social&utm_medium=dntwitter-yang-ww

Install

xxx:~ xxx$ git clone https://github.com/CiscoDevNet/yangsuite
xxx:~ xxx$ cd yangsuite/docker/ ; ./gen_test_certs.sh
xxx:docker xxx$ pwd
/Users/xxx/yangsuite/docker
xxx:docker xxx$ docker-compose up
Creating network "docker_default" with the default driver
Creating volume "docker_static-content" with default driver
Creating volume "docker_uwsgi" with default driver
Building yangsuite
……
完整阅读

在MacOS中部署Python虚拟开发环境

部署虚拟开发环境

虽然自己不是软件工程师,但有时候为了测试会写一些小程序,所以常常需要在自己电脑上设置开发环境。由于MacOS原生支持Python,所以我们可以不用那么麻烦的设置开发环境。但为了系统的稳定性,还是不要随便增加或变更自带的python,所以开发环境直接用虚拟环境就可以了,大概构架如下:

完整阅读

How to convert SPP into text2pcap readable format by python

Introduction

There are some internal tools that can decode SPP packets at former, but they are not work now. In some scenario, customer coudln’t do span on our asr9k, so we only need SPP, then will face to how to decode SPP result.

The article disscuss how to covert SPP original data to text2pcap readable format, then decode by text2pcap. You only do the script that can auto work. Btw, before do that, you need have python2.7 and text2pcap (integrate in wireshark). If you have python3.0 or newer, that maybe have some issue, because some function have a bit different, you need adjust them by yourself.

Solution

Original SPP data:

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.12.04 17:12:19 =~=~=~=~=~=~=~=~=~=~=~=
trace p stop
Tracing stopped with 666 outstanding...
spp-ui> trace print
Packet serial 861
port4/classify:
  length 148 phys_int_index 0 next_ctx 0xdeadbeef time 09:10:41.407
  00: 00 70 72 00 00 08 00 65 7a 00 00 00 ff ff 00 07 
  10: 80 30 00 00 00 00 0f 00 00 00 1f 00 00 00 00 00 
  20: 00 70 05 f2 42 fb 00 00 04 00 01 40 07 01 05 27 
  30: 06 03 0e 06 00 00 00 00 4c 00 00 00 00 00 58 00 
  40: 00 00 00 00 00 00 06 01 00 a1 13 41 92 60 00 b2 
  50: 64 41 8a 4c 08 00 45 c0 00 3e 00 00 00 00 fe 11 
  60: c8 25 12 ac 79 0d 34 df d0 01 02 86 02 86 00 2a 
  70: 75 5a 00 01 00 1e 3f da a4 0f 00 00 01 00 00 14 
  80: 00 00 00 00 04 00 00 04 00 5a c0 00 04 01 00 04 
  90: 3f da a4 0f 00 00 00 00 00 00 00 00 00 00 00 00 
  a0: 00 00 00 17 00 08 05 01 00 00 af c8 00 24 14 01 
  b0: 01 08 3f da d0 46 20 00 01 08 3f da d0 42 20 00 
  c0: 01 08 3f da d0 41 20 00 01 08 3f da d0 07 20 00 
  d0: 00 08 13 01 00 00 08 00 00 20 cf 07 00 00 07 16 
  e0: 4d 50 4c 53 2d 54 45 20 74 6f 20 76 61 72 30 31 
  f0: 2e 6b 6c 70 30 32 00 00 00 0c 0b 07 3f df 04 08 
--------------------------

完整阅读

blonde teen swallows load.xxx videos