dpdk结合sriov测试vpp ipsec性能

news2024/9/23 13:27:52

目的

测试vpp ipsec转发性能,想当作openstack VPNaas的一种driver,提高ipsec网关的转发能力。

环境

测试资源很有限,没有测试仪,物理机之外的交换机不受控制。

只有两台物理机,各有一张测试网卡,网卡有两个10G口,可能确定的是两台物理机一个10G口之间联到同一个TOR交换机可能互通,另一对10G口之间测试不通。

想法就是vpp两个口,一个口当作网关,另一个口用来做tunnel。

vpp版本是master commit 6e39ff03a6fa28a2655d767454394413252a269d,早期版本ipsec有bug.

vpp用到了dpdk,需要先创建hugepage和网卡绑定igb_uio,不再特殊强调。

第一种方法

创建一对veth pair,一个放在namespace中,一个放在vpp上当host interface。

机器1上操作:

#服务器1配置
ip netns add ns0
ip link add vpp0 type veth peer name host_vpp0
ip link set vpp0 up


ip link set host_vpp0 netns ns0
ip netns exec ns0 ip link set lo up
ip netns exec ns0 ip link set host_vpp0 up
ip netns exec ns0 ip addr add 192.168.1.1/24 dev host_vpp0
ip netns exec ns0 ip route add default via 192.168.1.2 dev host_vpp0

#启动vpp
/home/huiwei/vpp/build-root/build-vpp-native/vpp/bin/vpp -c /home/huiwei/vsap/configs/startup.conf

#vpp1的配置
set interface state TenGigabitEthernet3/0/1 up
set interface ip address TenGigabitEthernet3/0/1 192.168.3.1/24
set interface promiscuous on TenGigabitEthernet3/0/1


create host-interface name vpp0  hw-addr fa:16:19:19:19:19
set interface state host-vpp0 up
set interface ip address host-vpp0  192.168.1.2/24


create ipip tunnel src 192.168.3.1 dst 192.168.3.2
ipsec sa add 10 spi 1000 esp crypto-key 4339314b55523947594d6d3547666b45 crypto-alg aes-cbc-128 integ-key 4339314b55523947594d6d3547666b45 integ-alg sha1-96
ipsec tunnel protect ipip0 sa-in 10 sa-out 10 192.168.3.2


ip route add 192.168.2.0/24 via 192.168.3.2  ipip0
set interface unnumbered ipip0 use TenGigabitEthernet3/0/1
set interface state ipip0 up

复制

机器2上操作:

#服务器2配置
ip netns add ns0
ip link add vpp0 type veth peer name host_vpp0
ip link set vpp0 up


ip link set host_vpp0 netns ns0
ip netns exec ns0 ip link set lo up
ip netns exec ns0 ip link set host_vpp0 up
ip netns exec ns0 ip addr add 192.168.2.1/24 dev host_vpp0
ip netns exec ns0 ip route add default via 192.168.2.2 dev host_vpp0

#启动vpp
/home/huiwei/vpp/build-root/build-vpp-native/vpp/bin/vpp -c /home/huiwei/vsap/configs/startup.conf

#vpp2的配置
set interface state TenGigabitEthernet3/0/1 up
set interface ip address TenGigabitEthernet3/0/1 192.168.3.2/24
set interface promiscuous on TenGigabitEthernet3/0/1

create host-interface name vpp0  hw-addr fa:16:29:29:29:29
set interface state host-vpp0 up
set interface ip address host-vpp0  192.168.2.2/24


create ipip tunnel src 192.168.3.2 dst 192.168.3.1
ipsec sa add 10 spi 1000 esp crypto-key 4339314b55523947594d6d3547666b45 crypto-alg aes-cbc-128 integ-key 4339314b55523947594d6d3547666b45 integ-alg sha1-96
ipsec tunnel protect ipip0 sa-in 10 sa-out 10 192.168.3.1


ip route add 192.168.1.0/24 via 192.168.3.1 ipip0
set interface unnumbered ipip0 use TenGigabitEthernet3/0/1
set interface state ipip0 up

复制

测试结果比较差,分析原因第一是vpp host interface收包时大量丢包,第二就是iperf3测试工具不好用。

ip netns exec ns0 iperf3 -c 192.168.1.1 -u -l 64 -P 128 -t 5
#no ipsec
[SUM]   0.00-5.00   sec  64.5 MBytes   108 Mbits/sec  42.081 ms  554038/1056128 (52%)
#aesni_mb
[SUM]   0.00-5.00   sec  67.6 MBytes   113 Mbits/sec  26.476 ms  775537/1105258 (70%)
#openssl
[SUM]   0.00-5.00   sec  69.2 MBytes   116 Mbits/sec  11.179 ms  886194/1132434 (78%)

复制

第二种方法

既然veth pair不好用,那就用物理网卡,但卡又不够用,外面交换机又不受控制,突然想到了sriov,多虚出来几个物理网卡。iperf3用dpdk-ptkgen或者test-pmd替代。dpdk用一个vf作为host,vpp用另一个vf作为网关,这两个vf之间互通用网卡内嵌的switch。

PS:sriov有个问题就是网卡内嵌的switch只转发它自己的pf和vf的mac,不学习mac,所以openstack中sriov虚机和同host上virtio虚机或者dvr网关是通不了的。

vpp另一个网卡本来想直接用整个物理网卡,但是结果用着用着就莫名其妙NO-CARRIER了,提示没有接网线,原因不明,reboot物理机就好了,试着用vf就没再碰到这个问题

dpdk test-pmd只显示发包和收包个数,不能显示实时速率,采用low一点的手法,用手机秒表计时300s计算pps,不是非常精确。

#纯IP转发vpp1
set interface state VirtualFunctionEthernet3/10/1 up
set interface state VirtualFunctionEthernet3/10/0 up
set interface ip address VirtualFunctionEthernet3/10/1 192.168.3.1/24
set interface ip address VirtualFunctionEthernet3/10/0 192.168.1.2/24
ip route add 192.168.2.0/24 via 192.168.3.2 VirtualFunctionEthernet3/10/1
#纯IP转发vpp2
set interface state VirtualFunctionEthernet3/10/1 up
set interface state VirtualFunctionEthernet3/10/0 up
set interface ip address VirtualFunctionEthernet3/10/1 192.168.3.2/24
set interface ip address VirtualFunctionEthernet3/10/0 192.168.2.2/24
ip route add 192.168.1.0/24 via 192.168.3.1 VirtualFunctionEthernet3/10/1

#ipsec转发vpp1
set interface state VirtualFunctionEthernet3/10/1 up
set interface ip address VirtualFunctionEthernet3/10/1 192.168.3.1/24
set interface state VirtualFunctionEthernet3/10/0 up
set interface ip address VirtualFunctionEthernet3/10/0 192.168.1.2/24


create ipip tunnel src 192.168.3.1 dst 192.168.3.2
ipsec sa add 10 spi 1000 esp crypto-key 4339314b55523947594d6d3547666b45 crypto-alg aes-cbc-128 integ-key 4339314b55523947594d6d3547666b45 integ-alg sha1-96
ipsec tunnel protect ipip0 sa-in 10 sa-out 10 192.168.3.2


ip route add 192.168.2.0/24 via 192.168.3.2  ipip0
set interface unnumbered ipip0 use VirtualFunctionEthernet3/10/1
set interface state ipip0 up

ip neigh VirtualFunctionEthernet3/10/0 192.168.1.1 22:FA:5E:56:7C:5C static

#ipsec转发vpp2
set interface state VirtualFunctionEthernet3/10/1 up
set interface ip address VirtualFunctionEthernet3/10/1 192.168.3.2/24
set interface state VirtualFunctionEthernet3/10/0 up
set interface ip address VirtualFunctionEthernet3/10/0 192.168.2.2/24


create ipip tunnel src 192.168.3.2 dst 192.168.3.1
ipsec sa add 10 spi 1000 esp crypto-key 4339314b55523947594d6d3547666b45 crypto-alg aes-cbc-128 integ-key 4339314b55523947594d6d3547666b45 integ-alg sha1-96
ipsec tunnel protect ipip0 sa-in 10 sa-out 10 192.168.3.1


ip route add 192.168.1.0/24 via 192.168.3.1  ipip0
set interface unnumbered ipip0 use VirtualFunctionEthernet3/10/1
set interface state ipip0 up

(免费订阅,永久学习)学习地址: Dpdk/网络协议栈/vpp/OvS/DDos/NFV/虚拟化/高性能专家-学习视频教程-腾讯课堂

更多DPDK相关学习资料有需要的可以自行报名学习,免费订阅,永久学习,或点击这里加qun免费
领取,关注我持续更新哦! !   

复制

两边test-pmd参数

./testpmd -l 1-2 -n 4 -b 0000:03:10.0 -b 0000:03:10.1 -- -i --nb-cores=1 --nb-ports=1 --burst=512 --max-pkt-len=64 --txq=4 --eth-peer=0,3a:54:11:3a:72:1f --tx-ip=192.168.2.1,192.168.1.1 --forward-mode=txonly

./testpmd -l 1-2 -n 4 -b 0000:03:10.0 -b 0000:03:10.1 -- -i --nb-cores=1 --nb-ports=1 --burst=512 --rxq=4 --forward-mode=rxonly

复制

试着收方向用没用test-pmd,tcpdump抓包看了一上没问题

[root@slb1 huiwei]# tcpdump -nn -e -i eth6 -c 10
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth6, link-type EN10MB (Ethernet), capture size 65535 bytes
17:25:01.265838 02:09:c0:8b:6c:68 > 22:fa:5e:56:7c:5c, ethertype IPv4 (0x0800), length 64: 192.168.2.1.9 > 192.168.1.1.9: UDP, length 22
17:25:01.265842 02:09:c0:8b:6c:68 > 22:fa:5e:56:7c:5c, ethertype IPv4 (0x0800), length 64: 192.168.2.1.9 > 192.168.1.1.9: UDP, length 22
17:25:01.265844 02:09:c0:8b:6c:68 > 22:fa:5e:56:7c:5c, ethertype IPv4 (0x0800), length 64: 192.168.2.1.9 > 192.168.1.1.9: UDP, length 22

复制

测试结果300s的数据,测试了vpp三层转发,用openssl的ipsec和用dpdk mb crypto的ipsec,分别是5Mpps,1.4Mpps和1.2Mpps。

[root@slb2 huiwei]#

======================================================================================
#dpdk sw pmd ipsec三层转发300s
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...

  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 13             RX-dropped: 0             RX-total: 13
  TX-packets: 1943715560     TX-dropped: 1             TX-total: 1943715561
  ----------------------------------------------------------------------------

  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 13             RX-dropped: 0             RX-total: 13
  TX-packets: 1943715560     TX-dropped: 1             TX-total: 1943715561
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Done.
vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
VirtualFunctionEthernet3/10/0     1      up          9000/0/0/0     rx packets             460111460
                                                                    rx bytes             29447134830
                                                                    drops                          5
                                                                    ip4                    460111460
VirtualFunctionEthernet3/10/1     2      up          9000/0/0/0     rx packets                   140
                                                                    rx bytes                   13194
                                                                    tx packets             460111455
                                                                    tx bytes             61654934970
                                                                    drops                        140
                                                                    ip4                           20
ipip0                             3      up          9000/0/0/0     tx packets             920222910
                                                                    tx bytes             87421176450
local0                            0     down          0/0/0/0
vpp# show error
   Count                    Node                  Reason
 460111455          dpdk-esp4-encrypt-tun         ESP pkts received
 460111455            dpdk-crypto-input           Crypto ops dequeued
         5               dpdk-input               no error
        17               dpdk-input               no error
       120                arp-reply               IP4 source address not local to subnet
         3                ip4-local               ip4 source lookup miss
vpp#

vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
VirtualFunctionEthernet3/10/0     1      up          9000/0/0/0     rx packets                   141
                                                                    rx bytes                    8460
                                                                    tx packets             364223104
                                                                    tx bytes             23310278656
                                                                    drops                        141
VirtualFunctionEthernet3/10/1     2      up          9000/0/0/0     rx packets             364223212
                                                                    rx bytes             48805906364
                                                                    drops                        108
                                                                    ip4                    364223120
ipip0                             3      up          9000/0/0/0     rx packets             728446208
                                                                    rx bytes             54633465600
                                                                    ip4                    728446208
local0                            0     down          0/0/0/0

vpp# show error
   Count                    Node                  Reason
       141                arp-reply               IP4 source address not local to subnet
 364223104         dpdk-esp4-decrypt-post         ESP post pkts
 364223104            dpdk-esp4-decrypt           ESP pkts received
 364223104            dpdk-crypto-input           Crypto ops dequeued
        14               dpdk-input               no error
        93                arp-reply               IP4 source address not local to subnet
 364223104               ipip4-input              packets decapsulated
 364223104            ipsec4-tun-input            good packets received
         2                ip4-local               ip4 source lookup miss



======================================================================================
#openssl ipsec三层转发300s
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...

  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 321            RX-dropped: 0             RX-total: 321
  TX-packets: 1652694742     TX-dropped: 0             TX-total: 1652694742
  ----------------------------------------------------------------------------

  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 321            RX-dropped: 0             RX-total: 321
  TX-packets: 1652694742     TX-dropped: 0             TX-total: 1652694742
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Done.
testpmd>

vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
VirtualFunctionEthernet3/10/0     1      up          9000/0/0/0     rx packets             460111460
                                                                    rx bytes             29447134830
                                                                    drops                          5
                                                                    ip4                    460111460
VirtualFunctionEthernet3/10/1     2      up          9000/0/0/0     rx packets                   140
                                                                    rx bytes                   13194
                                                                    tx packets             460111455
                                                                    tx bytes             61654934970
                                                                    drops                        140
                                                                    ip4                           20
ipip0                             3      up          9000/0/0/0     tx packets             920222910
                                                                    tx bytes             87421176450
local0                            0     down          0/0/0/0
vpp# show error
   Count                    Node                  Reason
 460111455          dpdk-esp4-encrypt-tun         ESP pkts received
 460111455            dpdk-crypto-input           Crypto ops dequeued
         5               dpdk-input               no error
        17               dpdk-input               no error
       120                arp-reply               IP4 source address not local to subnet
         3                ip4-local               ip4 source lookup miss
vpp#
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...

  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 364223212      RX-dropped: 0             RX-total: 364223212
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ----------------------------------------------------------------------------

  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 364223212      RX-dropped: 0             RX-total: 364223212
  TX-packets: 0              TX-dropped: 0             TX-total: 0
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Done.

===================================================================================================
#线三层转发300s
testpmd> stop
Telling cores to stop...
Waiting for lcores to finish...

  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 316            RX-dropped: 0             RX-total: 316
  TX-packets: 1648023286     TX-dropped: 0             TX-total: 1648023286
  ----------------------------------------------------------------------------

  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 316            RX-dropped: 0             RX-total: 316
  TX-packets: 1648023286     TX-dropped: 0             TX-total: 1648023286
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Done.
testpmd>

vpp#
vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
VirtualFunctionEthernet3/10/0     1      up          9000/0/0/0     rx packets            1644736479
                                                                    rx bytes            105263139660
                                                                    tx packets                   298
                                                                    tx bytes                   12516
                                                                    drops                         18
                                                                    ip4                   1644736479
VirtualFunctionEthernet3/10/1     2      up          9000/0/0/0     rx packets                   535
                                                                    rx bytes                   46936
                                                                    tx packets            1644736462
                                                                    tx bytes            105263133546
                                                                    drops                        535
                                                                    ip4                          328
local0                            0     down          0/0/0/0
vpp#

vpp# show int
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
VirtualFunctionEthernet3/10/0     1      up          9000/0/0/0     rx packets                   527
                                                                    rx bytes                   40858
                                                                    tx packets            1544198741
                                                                    tx bytes             98828718874
                                                                    drops                        201
                                                                    ip4                          310
VirtualFunctionEthernet3/10/1     2      up          9000/0/0/0     rx packets            1544219410
                                                                    rx bytes             98830046460
                                                                    tx packets                   307
                                                                    tx bytes                   28162
                                                                    drops                      20693
                                                                    ip4                   1544219219
local0                            0     down          0/0/0/0

复制

最后附vpp的配置文件示例

#startup.conf
unix {
  interactive
  log /var/log/vpp/vpp.log
  full-coredump
  cli-listen /run/vpp/cli.sock
}

api-trace {
  on
}


cpu {
	main-core 3
        corelist-workers 4-5
}


dpdk {
        socket-mem 20480,0
        dev 0000:03:10.1 {
        }
        dev 0000:03:10.0 {
        }
        #enable-cryptodev
        vdev cryptodev_aesni_mb_pmd,max_nb_queue_pairs=2,max_nb_sessions=1024,socket_id=0
        dev default {
            num-rx-queues 4
            num-tx-queues 4
            num-rx-desc 512
            num-tx-desc 512
        }
}

原文链接:https://cloud.tencent.com/developer/article/1792341 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/32591.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

分布式存储之 etcd 的集群管理

在分布式文件存储中,我们通常会面临集群选主,配置共享和节点状态监控的问题。通过 etcd(基于 Raft 协议))可以实现超大规模集群的管理,以及多节点的服务可靠性。今天,我们就聊聊 etcd 在分布式存储中的具体…

作业-11.24

1、多线程并发服务器 #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/ip.h> #include <string.h> #include <pthread.h> #include <stdlib.h> #include <…

MCE | 间歇性禁食增强抗癌疗效

越来越多的研究表明&#xff0c;“禁食”不仅与免疫系统调控 、血糖调节有关&#xff0c;还对多种疾病的治疗有改善效果&#xff0c;如心血管疾病和癌症等。这里的“禁食”与节食不同&#xff0c;一般指的是间歇性禁食&#xff0c;包括多种方案&#xff0c;例如 FMD (Fasting-m…

LeetCode135. 分发糖果(贪心算法)

1 题目描述 n 个孩子站成一排。给你一个整数数组 ratings 表示每个孩子的评分。 你需要按照以下要求&#xff0c;给这些孩子分发糖果&#xff1a; 每个孩子至少分配到 1 个糖果。相邻两个孩子评分更高的孩子会获得更多的糖果。 请你给每个孩子分发糖果&#xff0c;计算并返回…

pyinstaller打包教程(pycharm)

PyInstaller简介 PyInstaller是一个跨平台的Python应用打包工具&#xff0c;支持 Windows/Linux/MacOS三大主流平台&#xff0c;能够把 Python 脚本及其所在的 Python 解释器打包成可执行文件&#xff0c;从而允许最终用户在无需安装 Python 的情况下执行应用程序。 PyInstalle…

IOS安全测试学习-DVIA-v2

前言 为学习IOS知识并加深理解&#xff0c;故通过IOS漏洞靶场来直接体现IOS环境中的常见漏洞。 环境准备 iPhone X ios 13.4.1 已越狱 MacOS Big Sur 11.0 Bate 虚拟机 DVIA-v2 IOS 漏洞靶场app grapefruit、objection #pip3 install frida、pip3 install frida-tools、sudo …

【App自动化测试】(五)移动端自动化常用的元素定位工具——Uiautomatorviewer、 ATX WEditor、Appium Inspector

目录1. uiautomatorviewer1.1 uiautomatorviewer 的安装1.2 uiautomatorviewer 工具功能介绍1.3 uiautomatorviewer 的使用方法2. ATX WEditor2.1 ATX WEditor的安装2.2 ATX WEditor 功能介绍2.3 ATX WEditor 的使用3. Appium Inspector3.1 Appium Inspector安装与运行3.2 Appi…

【AWS系列】第八讲:AWS Serverless之S3

目录 序言 1.基础介绍 1.1 概念介绍 1.2 原理介绍 1.3 应用场景 1.3.1 构建数据湖 1.3.2 备份和还原关键数据 1.3.3 以最低成本存档数据 1.3.4 运行云原生应用程序 1.4 S3 的功能 1.4.1 存储类 1.4.2 存储管理 1.4.3 访问管理 2 使用方法 2.1 创建存储桶 ​2.2…

用DIV+CSS技术设计的网页与实现制作【体育文化】dreamweaver学生网页设计

&#x1f389;精彩专栏推荐 &#x1f4ad;文末获取联系 ✍️ 作者简介: 一个热爱把逻辑思维转变为代码的技术博主 &#x1f482; 作者主页: 【主页——&#x1f680;获取更多优质源码】 &#x1f393; web前端期末大作业&#xff1a; 【&#x1f4da;毕设项目精品实战案例 (10…

day074:XML、XML的解析

目录 一、XML 1.什么是XML 2.XML作用 3.XML语法规则 4.XML文件代码示例 二、解析XML文件 1.解析XML 2.常用的解析思想 &#xff08;1&#xff09;DOM思想 &#xff08;2&#xff09;图解 3.XML解析工具 一、XML 1.什么是XML XML&#xff08;EXtensible Markup Lan…

【已解决】CentOS7等linux系统时区时间不对显示误差8小时

文章目录问题解决处理时区问题date查看时间、时区timedatectl查看时间、时区查看localtime设置时区处理时间问题问题 中国使用的是东八区上海时间&#xff0c;而linux服务器&#xff0c;一般默认是0时区UTC&#xff0c;所以需要将时区改为东八区CST将时区改为东八区后&#xf…

机器学习-决策树算法

机器学习-基础知识 机器学习-线性回归 机器学习-逻辑回归 机器学习-聚类算法 机器学习-决策树算法 机器学习-集成算法 机器学习-SVM算法 文章目录1. 决策树算法1.1. 什么是决策树/判定树1.2. 决策树归纳算法1.3. 熵概念1.4. 具体算法1.5. 决策树剪枝1.6. 连续值与缺失值处理1.6…

MCE | 正确认识阿尔茨海默病

什么是阿尔茨海默病 (Alzheimer Disease, AD)&#xff1f; 1907 年德国神经病理学家阿尔茨海默 (Alois Alzheimer) 仔细描述了一名具有进行性痴呆表现的 51 岁妇女 (Auguste Deter) 的症状&#xff1a; “她的记忆力严重受损。如果向她显示了对象&#xff0c;她会正确地命名它…

还在调API写所谓的AI“女友”,唠了唠了,教你基于python咱们“new”一个(深度学习)

文章目录前言停用词闲聊语料基础知识词的表示表达one-hot编码词嵌入大致原理实现简单版复杂版如何训练转换后的形状RNN循环网络RNNRNN投影图RNN是三维立体的LSTM&GRU构建数据配置数据集准备分词划分数据集加载模型搭建基本概念Encoder搭建DecoderAttention机制decoder与bea…

赫夫曼树赫夫曼编码的创建

目录基础知识点最优二叉树如何构造赫夫曼树赫夫曼编码编码与压缩文件代码结构体设计创建赫夫曼树创建构建赫夫曼编码基础知识点 赫夫曼树又称为最优树&#xff0c;是一种带权路径长短最短的树&#xff0c;有着广泛的应用。 最优二叉树 我们给出路径和路径长度的概念。从树的…

盘点面试常见的设计类算法问题

设计问题也是一种很重要的考察类型&#xff0c;特征是整体难度不大&#xff0c;但是要求结构合理、复用性好、考虑周全&#xff0c;代码规范等等。有些面试官不喜欢烧脑的动态规划等问题&#xff0c;就喜欢设计题&#xff0c;笔者曾经在面试微博和猿辅导都遇到过类似的问题。这…

【操作系统】2.1 进程与线程总结

2.1.1 操作系统之进程的定义、特征、组成、组织 2.1.1 操作系统之进程的定义、特征、组成、组织_StudyWinter的博客-CSDN博客 进程由程序段、数据段、进程控制块&#xff08;PCB&#xff09;三部分组成。 进程是进程实体的运行过程&#xff0c;是系统进行资源分配和资源调度的…

隆化的大米排之首 国稻种芯·中国水稻节:河北承德十大特产

隆化的大米排之首 国稻种芯中国水稻节&#xff1a;河北承德十大特产 中新网河北新闻10月8日电 (张桂芹 王思明) 新闻中国采编网 中国新闻采编网 谋定研究中国智库网 中国农民丰收节国际贸易促进会 国稻种芯中国水稻节 中国三农智库网-功能性农业农业大健康大会报道&#xf…

python基础项目实战-俄罗斯方块

一、俄罗斯方块游戏设计分析: 俄罗斯方块是一款风靡全球,从一开始到现在都一直经久不衰的电脑、手机、掌上游戏机产品,是一款游戏规则简单,但又不缺乏乐趣的简单经典小游戏,上手容易,适用范围广泛,人所共知。俄罗斯方块游戏基本规则是油4个小方块组成的7种不同的规则图形…

DevOps持续部署的关键要素

当有版本通过持续集成流水线进行构建之后&#xff0c;就可以将其部署至某个具体的环境&#xff0c;这就需要自动化部署技术&#xff0c;将这个自动化部署和持续集成流水线连接起来&#xff0c;就可实现持续部署。如图1所示&#xff0c;实现持续部署的前提是至少拥有一条完整的自…