以太網鏈路聚合實驗

一、實驗目的

掌握使用手動模式配置鏈路聚合的方法

掌握使用靜態 LACP 模式配置鏈路聚合的方法

掌握控制靜態 LACP 模式下活動鏈路的方法

掌握靜態 LACP 的部分特性的配置

二、實驗環境

安裝有eNSP模擬器的PC一臺,要求PC能聯網。

三、實驗拓撲

LSW1與LSW2均為S3700交換機。

LSW1 與 LSW2之間的多條鏈路無法同時處于數據轉發的狀態。為了充分利用這些鏈路的帶寬,需要在 LSW1 和 LSW2之間配置以太網鏈路聚合。

四、實驗背景

隨著網絡規模不斷擴大,用戶對骨干鏈路的帶寬和可靠性提出越來越高的要求。在傳統技術中,常用更換高速率的接口板或更換支持高速率接口板的設備的方式來增加帶寬,但這種方案需要付出高額的費用,而且不夠靈活。
采用鏈路聚合技術可以在不進行硬件升級的條件下,通過將多個物理接口捆綁為一個邏輯接口,達到增加鏈路帶寬的目的。

在實現增大帶寬目的的同時,鏈路聚合采用備份鏈路的機制,可以有效的提高設備之間鏈路的可靠性。鏈路聚合技術主要有以下三個優勢:

  • 增加帶寬:鏈路聚合接口的最大帶寬可以達到各成員接口帶寬之和。
  • 提高可靠性:當某條活動鏈路出現故障時,流量可以切換到其他可用的成員鏈路上,從而提高鏈路聚合接口的可靠性。
  • 負載分擔:在一個鏈路聚合組內,可以實現在各成員活動鏈路上的負載分擔。

本實驗將通過手工和 LACP 的方式配置以太網鏈路聚合,幫助了解以太網鏈路聚合技術的配置及原理。

五、實驗過程

實驗配置思路如下:

  • 配置手工模式鏈路聚合
  • 配置 LACP 模式鏈路聚合
  • 通過修改參數控制活動鏈路
  • 修改負載分擔方式

LSW1的初始配置

# 進入系統視圖
<Huawei>system-view # 為設備命名
[Huawei]sysname LSW1# 禁用信息中心
[LSW1]undo info-center enable 

LSW2的初始配置

# 進入系統視圖
<Huawei>system-view # 為設備命名
[Huawei]sysname LSW2# 禁用信息中心
[LSW2]undo info-center enable 

5.1 配置手工模式鏈路聚合

5.1.1 創建Eth-Trunk接口

(1)配置LSW1

# 創建Eth-Trunk接口
[LSW1]interface Eth-Trunk 1

注:interface eth-trunk命令用來進入已經存在的 Eth-Trunk接口,或創建并進入 Eth-Trunk 接口。數字“1”代表接口編號,編號范圍根據設備情況有所不同。

(2)配置LSW2

# 創建Eth-Trunk接口
[LSW2]interface Eth-Trunk 1

5.1.2 配置Eth-Trunk接口為聚合模式?? ?

# 配置Eth-Trunk接口為聚合模式	
[LSW1-Eth-Trunk1]mode manual load-balance # 退出接口配置視圖
[LSW1-Eth-Trunk1]quit

mode 命令用來配置 Eth-Trunk 的工作模式,Eth-Trunk 的工作模式包括 LACP 模式和手工負載分擔模式(手工模式)兩種。缺省情況下,Eth-Trunk 的工作模式為手工負載分擔模式。這里針對LSW1的模式配置僅為示范目的,實際操作時不需要。

5.1.3 將成員接口加入聚合組

(1)在LSW1設備中,分別對三個連接的接口進行配置,將它們分別加入到聚合組Eth-Trunk1中來。

# 進入e0/0/1接口
[LSW1]interface Eth 0/0/1# 將該接口加入到eth-trunk 1
[LSW1-Ethernet0/0/1]eth-trunk 1# 退出接口配置視圖
[LSW1-Ethernet0/0/1]quit# 進入e0/0/2接口
[LSW1]interface Eth 0/0/2# 將該接口加入到eth-trunk 1
[LSW1-Ethernet0/0/2]eth-trunk 1# 退出接口配置視圖
[LSW1-Ethernet0/0/2]quit# 進入e0/0/3接口
[LSW1]interface Eth 0/0/3# 將該接口加入到eth-trunk 1
[LSW1-Ethernet0/0/3]eth-trunk 1# 退出接口配置視圖
[LSW1-Ethernet0/0/3]quit

(2)在LSW2中,可同樣執行上面的命令完成將三個接口加入到Eth-Trunk1聚合組,也可以通過trunkport命令批量添加接口。兩種方式,任選其一即可。

# 進入聚合組接口的配置模式
[LSW2]interface Eth-Trunk 1# 批量將Eth 0/0/1、0/0/2和0/0/3添加聚合組中
[LSW2-Eth-Trunk1]trunkport eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW2-Eth-Trunk1]quit

注:將成員接口加入 Eth-Trunk 時,需要注意以下問題:

  • 每個 Eth-Trunk 接口下最多可以包含8個成員接口。
  • Eth-Trunk接口不能嵌套,即 Eth-Trunk接口的成員接口不能是 Eth-Trunk接口。
  • 一個以太網接口只能加入到一個 Eth-Trunk 接口,如果需要加入其它 Eth-Trunk 接口,必須先退出原來的 Eth-Trunk 接口。
  • 如果本地設備使用了 Eth-Trunk,與成員接口直連的對端接口也必須捆綁為 Eth-Trunk 接口,兩端才能正常通信。
  • Eth-Trunk 鏈路兩端相連的物理接口的數量、速率、雙工方式等必須一致。

5.1.4 查看 Eth-Trunk接囗狀態

在LSW1或者LSW2上執行【display eth-trunk 1】命令可以查看該聚合組中成員接口的狀態。

# 查看聚合組eth-trunk 1的接口狀態
[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
WorkingMode: NORMAL         Hash arithmetic: According to SIP-XOR-DIP         
Least Active-linknumber: 1  Max Bandwidth-affected-linknumber: 8              
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
PortName                      Status      Weight 
Ethernet0/0/1                 Up          1      
Ethernet0/0/2                 Up          1      
Ethernet0/0/3                 Up          1 

5.2 配置LACP模式的鏈路聚合

5.2.1 刪除現有的聚合組的成員接口

在LSW1上按順序分別執行以下命令,刪除?Eth-Trunk 1聚合組的成員接口。

# 進入聚合組的接口配置模式
[LSW1]interface Eth-Trunk 1# 批量刪除聚合組的成員接口
[LSW1-Eth-Trunk1]undo trunkport Eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW1-Eth-Trunk1]quit

在LSW2上,執行以上同樣的命令,刪除?Eth-Trunk 1聚合組的成員接口。

# 進入聚合組的接口配置模式
[LSW2]interface Eth-Trunk 1# 批量刪除聚合組的成員接口
[LSW2-Eth-Trunk1]undo trunkport Eth 0/0/1 to 0/0/3# 退出接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.2 修改聚合模式

(1)修改LSW1的聚合模式

# 創建并進入Eth-Trunk 1聚合接口
[LSW1]interface Eth-Trunk 1# 將聚合模式指定為lacp
[LSW1-Eth-Trunk1]mode lacp-static # 退出接口配置模式
[LSW1-Eth-Trunk1]quit

(2)修改LSW2的聚合模式

# 創建并進入Eth-Trunk 1聚合接口
[LSW2]interface Eth-Trunk 1# 將聚合模式指定為lacp
[LSW2-Eth-Trunk1]mode lacp-static # 退出接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.3 將成員接口加入聚合組

(1)為LSW1設備添加聚合組成員接口

# 進入Eth-Trunk 1聚合組的配置模式
[LSW1]interface Eth-Trunk 1# 批量添加聚合組的成員接口
[LSW1-Eth-Trunk1]trunkport Eth 0/0/1 to 0/0/3# 退出聚合組的配置模式
[LSW1-Eth-Trunk1]quit

(2)為LSW2設備添加聚合組成員接口

# 進入Eth-Trunk 1聚合組的配置模式
[LSW2]interface Eth-Trunk 1# 批量添加聚合組的成員接口
[LSW2-Eth-Trunk1]trunkport Eth 0/0/1 to 0/0/3# 退出聚合組的接口配置模式
[LSW2-Eth-Trunk1]quit

5.2.4 查看Eth-Trunk的接口狀態

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 32768      System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 1  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

5.2.5 配置轉發接口與備份接口

考慮到網絡流量情況,當網絡正常時,假定需求如下:

  • 只需要 Eth0/0/1?和Eth0/0/2接口處于轉發狀態,Eth0/0/3接口作為備份。
  • 但當活動接口數量少于2時,直接關閉整個Eth-Trunk接口。

為滿足上述需求,可做如下配置:

(1)配置LSW1的LACP優先級,使其成為主動端設備

[LSW1]lacp priority 100

使能了 LACP 模式鏈路聚合的兩端設備均會收發的 LACPDU 報文。

首先選舉主動端設備:

  • 比較系統優先級字段,如果對端的系統優先級高于本端的系統優先級(默認為 32768,越小越優),則確定對端為 LACP 主動端。
  • 如果系統優先級相同,比較兩端設備的 MAC地址,MAC地址小的一端為 LACP 主動端。

選出主動端后,兩端都會以主動端的接口優先級來選擇活動接口,接口優先級越小越優,默認為 32768。

(2)配置Eth-Trunk活動接口數下限閾值

[LSW1]interface Eth-Trunk 1# 指定聚合組活動接口數的最小值
[LSW1-Eth-Trunk1]least active-linknumber 2# 退出聚合組接口的配置模式
[LSW1-Eth-Trunk1]quit

在一個 Eth-Trunk 接口內,活動接口數可以影響到 Eth-Trunk接口的狀態和帶寬。Eth-Trunk接口的帶寬是所有處于 Up 狀態的成員接口帶寬之和。

為保證 Eth-Trunk接口的狀態和帶寬,可以設置以下兩個閾值,以減小成員鏈路狀態的變化帶來的影響。

  • 活動接口數下限閾值:當活動接口數小于配置的下限閾值時,Eth-Trunk 接口的狀態轉為Down。設置活動接口數下限閾值的目的是為了保證最小帶寬。least active-linknumber 命令用來配置鏈路聚合組活動接口數目的下限閾值。
  • 活動接口數上限閾值:當活動接口數達到上限閾值后,之后再發生成員鏈路狀態變為 Up都不會使 Eth-Trunk接口的帶寬增加。設置活動接口數上限閾值的目的是在保證了帶寬的情況下提高網絡的可靠性。max active-linknumber 命令用來配置鏈路聚合組活動接口數目的上限閾值。模擬器當前版本不支持配置活動接口數上限閾值。

(3)查看當前Eth-Trunk接口狀態

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

從上面的接口狀態可以看到,Eth-Trunk 1聚合組狀態(Operate status)為up,最小活動接口數為2。

(4)手工關閉LSW1設備上的Eth 0/0/1和Eth 0/0/2,模擬鏈路故障

[LSW1]interface Eth0/0/1# 關閉接口
[LSW1-Ethernet0/0/1]shutdown# 退出接口配置模式
[LSW1-Ethernet0/0/1]quit[LSW1]interface Eth0/0/2# 關閉接口
[LSW1-Ethernet0/0/2]shutdown# 退出接口配置模式
[LSW1-Ethernet0/0/2]quit

(5)再次查看Eth-Trunk接口狀態

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: down        Number Of Up Port In Trunk: 0                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Unselect 100M     32768   2      289     10100010  1     
Ethernet0/0/2          Unselect 100M     32768   3      289     10100010  1     
Ethernet0/0/3          Unselect 100M     32768   4      289     10100000  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          0        0000-0000-0000  0       0      0       10100011
Ethernet0/0/2          0        0000-0000-0000  0       0      0       10100011
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10110000

從上面的接口狀態可以看到,Eth-Trunk 1聚合組狀態(Operate status)為down。這是由于設置了 Eth-Trunk 的活動鏈路下限閾值為 2,關閉兩個接口后,聚合組中可用活動接口數量少于2 導致整個聚合組對應的接口將會被關閉。盡管此時 GE1/0/3 處于 UP 狀態,但是仍處于 Unselect狀態。

5.2.6 修改負載分擔模式

(1)開啟上一步中關閉的LSW1設備接口

[LSW1]interface eth 0/0/1[LSW1-Ethernet0/0/1]undo shutdown [LSW1-Ethernet0/0/1]quit[LSW1]interface eth 0/0/2[LSW1-Ethernet0/0/2]undo shutdown[LSW1-Ethernet0/0/2]quit

(2)修改Eth-Trunk接口的負載分擔模式為基于目的IP地址

# 進入聚合組接口配置模式
[LSW1]interface Eth-Trunk 1# 指定負載分擔模式為基于目的IP
[LSW1-Eth-Trunk1]load-balance dst-ip# 退出聚合組接口配置模式
[LSW1-Eth-Trunk1]quit

當需要將 Eth-Trunk 接口的流量分散到不同的鏈路上,最后能到達統一目的地時,使用 load-balance 命令配置 Eth-Trunk 接口負載分擔模式,以確保出方向的流量在各物理鏈路間進行合理的負載分擔,避免鏈路阻塞。

(3)查看LSW1的Eth-Trunk接口狀態

[LSW1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to DIP                 
System Priority: 100        System ID: 4c1f-cc2b-1fe8                         
Least Active-linknumber: 2  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          32768    4c1f-cc8b-6bdb  32768   2      289     10111100
Ethernet0/0/2          32768    4c1f-cc8b-6bdb  32768   3      289     10111100
Ethernet0/0/3          32768    4c1f-cc8b-6bdb  32768   4      289     10111100

從接口狀態中的Hash arithmetic可知,此時LSW1的Eth-Trunk 1基于目的 IP 地址進行負載分擔。

(4)查看LSW2的Eth-Trunk接口狀態

[LSW2]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: STATIC                               
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP         
System Priority: 32768      System ID: 4c1f-cc8b-6bdb                         
Least Active-linknumber: 1  Max Active-linknumber: 8                          
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
Ethernet0/0/1          Selected 100M     32768   2      289     10111100  1     
Ethernet0/0/2          Selected 100M     32768   3      289     10111100  1     
Ethernet0/0/3          Selected 100M     32768   4      289     10111100  1     Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
Ethernet0/0/1          100      4c1f-cc2b-1fe8  32768   2      289     10111100
Ethernet0/0/2          100      4c1f-cc2b-1fe8  32768   3      289     10111100
Ethernet0/0/3          100      4c1f-cc2b-1fe8  32768   4      289     10111100

從接口狀態中的Hash arithmetic可知,此時LSW2的Eth-Trunk 1負載分擔模式為根據?源IP地址(SIP)?和目的IP地址(DIP)?進行異或運算。

由于負載分擔只對出方向的流量有效,因此鏈路兩端接口的負載分擔模式可以不一致,兩端互不影響。

5.3 參考配置

完成上述配置后,LSW1和LSW2的配置詳情如下。

5.3.1 LSW1的配置

[LSW1]display current-configuration 
#
sysname LSW1
#
undo info-center enable
#
lacp priority 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk1mode lacp-staticleast active-linknumber 2load-balance dst-ip
#
interface Ethernet0/0/1eth-trunk 1
#
interface Ethernet0/0/2eth-trunk 1
#
interface Ethernet0/0/3eth-trunk 1
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet0/0/8
#
interface Ethernet0/0/9
#
interface Ethernet0/0/10
#
interface Ethernet0/0/11
#
interface Ethernet0/0/12
#
interface Ethernet0/0/13
#
interface Ethernet0/0/14
#
interface Ethernet0/0/15
#
interface Ethernet0/0/16
#
interface Ethernet0/0/17
#
interface Ethernet0/0/18
#
interface Ethernet0/0/19
#
interface Ethernet0/0/20
#
interface Ethernet0/0/21
#
interface Ethernet0/0/22
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return

5.3.2 LSW2的配置

[LSW2]display current-configuration 
#
sysname LSW2
#
undo info-center enable
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaaauthentication-scheme defaultauthorization-scheme defaultaccounting-scheme defaultdomain defaultdomain default_adminlocal-user admin password simple adminlocal-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk1mode lacp-static
#
interface Ethernet0/0/1eth-trunk 1
#
interface Ethernet0/0/2eth-trunk 1
#
interface Ethernet0/0/3eth-trunk 1
#
interface Ethernet0/0/4
#
interface Ethernet0/0/5
#
interface Ethernet0/0/6
#
interface Ethernet0/0/7
#
interface Ethernet0/0/8
#
interface Ethernet0/0/9
#
interface Ethernet0/0/10
#
interface Ethernet0/0/11
#
interface Ethernet0/0/12
#
interface Ethernet0/0/13
#
interface Ethernet0/0/14
#
interface Ethernet0/0/15
#
interface Ethernet0/0/16
#
interface Ethernet0/0/17
#
interface Ethernet0/0/18
#
interface Ethernet0/0/19
#
interface Ethernet0/0/20
#
interface Ethernet0/0/21
#
interface Ethernet0/0/22
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
user-interface vty 0 4
#
return

思考題

配置 least active-linknumber 和 max active-linknumber 時,對兩個參數大小有什么要求?

答案:Least active-linknumber 需要小于或等于 max active-linknumber。

參考文獻

華為HCIA-Datacom V1.0 實驗手冊 (eNSP Pro)

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/97007.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/97007.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/97007.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

autMan安裝教程

一、安裝命令 如果你系統沒安裝docker&#xff0c;請看往期教程 以下為通用命令 docker run -d --name autman --restart always -p 8080:8080 -p 8081:8081 -v /root/autman:/autMan --log-opt max-size10m --log-opt max-file3 hdbjlizhe/autman:latest解釋一下以上命令&…

【無人機】自檢arming參數調整選項

檢查項目 (英文名)中文含義檢查內容四旋翼建議 (新手 → 老手)理由說明All所有檢查啟用下面所有的檢查項目。? 強烈建議勾選這是最安全的設置&#xff0c;確保所有關鍵系統正常。Barometer氣壓計檢查氣壓計是否健康、數據是否穩定。? 必須勾選用于定高模式&#xff0c;數據異…

數字圖像處理(1)OpenCV C++ Opencv Python顯示圖像和視頻

Open CV C顯示圖像#include <iostream> #include <opencv2/opencv.hpp> using namespace cv;//包含cv命名空間 int main() {//imread(path)&#xff1a;從給定路徑讀取一張圖片&#xff0c;儲存為Mat變量對象Mat img imread("images/love.jpg");//named…

【芯片設計-信號完整性 SI 學習 1.2.2 -- 時序裕量(Margin)】

文章目錄1. 什么是時序裕量&#xff08;Margin&#xff09;1. 背景&#xff1a;為什么需要數字接口時序分析2. 時鐘周期方程3. Setup 裕量 (tMARGIN_SETUP)4. Hold 裕量 (tMARGIN_HOLD)5. 設計注意事項6. 實際應用場景2. 時序裕量的來源3. 測試方法(1) 眼圖測試 (Eye Diagram)(…

AOP 切面日志詳細

在業務方法上打注解package com.lib.service;Service public class BookService {LogExecution(description "查詢圖書")public Book query(int id) {return repo.findById(id);}LogExecution(description "借閱圖書")public void borrow(int id) {// 模…

使用paddlepaddle-Gpu庫時的一個小bug!

起初安裝的是 paddlepaddle 2.6.1版本。 用的是Taskflow的快速分詞以及ner快速識別&#xff1a;???????seg_accurate Taskflow("word_segmentation", mode"fast") ner Taskflow("ner", mode"fast")但是使用不了Gpu。想使用Gp…

量子能量泵:一種基于并聯電池與電容陣的動態直接升壓架構

量子能量泵&#xff1a;一種基于并聯電池與電容陣的動態直接升壓架構 摘要 本文提出了一種革命性的高效電源解決方案&#xff0c;通過創新性地采用并聯電池組與串聯高壓電容陣相結合的架構&#xff0c;徹底解決了低電壓、大功率應用中的升壓效率瓶頸與電池一致性難題。該方案摒…

【Linux網絡】網絡基礎概念——帶你打開網絡的大門

1. 計算機網絡背景 文章目錄1. 計算機網絡背景網絡發展2. 初識協議2.1 協議分層軟件分層的好處2.2 OSI七層模型2.3 TCP/IP五層(或四層)模型網絡發展 獨立模式 獨立模式是計算機網絡發展的最初階段&#xff0c;主要特點如下&#xff1a; 單機工作環境&#xff1a; 每臺計算機完…

簡單介紹一下Clickhouse及其引擎

一、ClickHouse 的優缺點一、ClickHouse 的優點 ? 1. 極致的查詢性能 列式存儲&#xff1a;只讀取查詢涉及的列&#xff0c;大幅減少 IO。數據壓縮&#xff1a;常見壓縮率 5~10 倍&#xff0c;減少存儲和帶寬消耗。向量化執行&#xff1a;按批次&#xff08;block&#xff09;…

【卷積神經網絡詳解與實例】8——經典CNN之VGG

1 開發背景 VGGNet是牛津大學視覺幾何組(Visual Geometry Group)提出的模型&#xff0c;該模型在2014ImageNet圖像分類與定位挑戰賽 ILSVRC-2014中取得在分類任務第二&#xff0c;定位任務第一的優異成績。其核心貢獻在于系統性地探索了網絡深度對性能的影響&#xff0c;并證明…

【分享】中小學教材課本 PDF 資源獲取指南

很多人都不知道&#xff0c;其實官方提供的中小學教材課本 PDF 文檔是完全免費且正版的&#xff0c;無需使用掃描版&#xff0c;清晰度和質量都非常高。 這些資源就藏在國家中小學智慧教育平臺&#xff08;basic.smartedu.cn&#xff09;上。這個平臺涵蓋了從小學到高中的各個…

js趣味游戲 貪吃蛇

以下是關于JavaScript趣味游戲的系統性整理&#xff0c;涵蓋經典案例、開發工具、教程資源及創意方向&#xff0c;助您快速掌握JS游戲開發的核心邏輯&#xff1a;一、經典JS趣味游戲案例貪吃蛇&#xff08;Snake Game&#xff09;核心機制&#xff1a;鍵盤控制蛇的移動方向&…

【Redis#11】Redis 在 C++ 客戶端下的安裝使用流程(一條龍服務)

一、安裝使用 --Ubuntu 下啟用 1. 前置依賴 - hiredis hiredis 是一個用 C 語言實現的 Redis 客戶端庫&#xff0c;redis-plus-plus 庫基于 hiredis 實現。在開始之前&#xff0c;請確保已安裝 libhiredis-dev&#xff0c;可以通過以下命令安裝&#xff1a; sudo apt install l…

kibana+elasticsearch console查詢示例

kibana console查詢入口如下 http://localhost:5601/app/dev_tools#/console/shell 1 整體查詢 獲取index為newbook的所有數據 GET newbook/_search 2 通用查詢 獲取index為newbook的數據中&#xff0c;bookname包含“西游”的所有數據。 GET newbook/_search { "query&q…

軟考系統架構設計師之軟件風格篇

一、軟件架構風格-數據流風格 數據-》第1步處理-》數據-》第2步處理-》數據-》第N步處理 【分步處理】 優點&#xff1a; 1、松耦合【高內聚-低耦合】 2、良好的重用性/可維護性; 3、可擴展性【標準接口適配】 4、良好的隱蔽性; 5、支持并行。 缺點 1、交互性較差; 2、復雜性較…

初始QML

由于項目原因&#xff0c;最近要進行qml相關開發&#xff0c;我之前也沒有搞過qml&#xff0c;因此開一個qml系列的專欄&#xff0c;記錄自己關于qml的相關學習新建第一個qml工程按如下圖所示方法新建一個最簡單的qml工程&#xff1a;編譯運行可以看到是一個標題為“hello word…

Coze源碼分析-資源庫-創建知識庫-基礎設施/存儲/安全

6. 基礎設施層 基礎設施層為知識庫創建功能提供底層技術支撐&#xff0c;包括數據存儲、緩存、消息隊列、文檔處理、向量化等核心服務。 6.1 數據存儲服務 6.1.1 MySQL數據庫 文件位置: backend/infra/rdb/mysql.go // MySQLConfig MySQL配置 type MySQLConfig struct {Host …

【iOS】設計模式復習

目錄 觀察者模式 通知機制 基本使用 注冊觀察者 創建一個通知 發送通知 通知與多線程 使用異步發送通知 NSNotificationQueue通知隊列 在子線程中運行觀察者函數 實現原理 named表 nameless表 wildcard表 添加觀察者 發送通知 移除通知? KVO機制 基本使用 …

RK3568 NPU :RKNN-ToolKit2環境搭建

1. 安裝Miniconda3 下載 Linux 64 位 Miniconda 最新版安裝腳本 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh安裝 Miniconda bash Miniconda3-latest-Linux-x86_64.sh -u安裝完成后會自動設置環境變量。打開新的終端&#xff0c;發現用戶名前…

Ubuntu 24.04 Server 版系統安裝及配置

Ubuntu 24.04 Server 版安裝及配置 文章目錄Ubuntu 24.04 Server 版安裝及配置一、獲取安裝文件二、虛擬機配置三、安裝界面四、配置網絡五、擴容根分區 一、獲取安裝文件二、虛擬機配置三、安裝界面 選擇English&#xff08;US&#xff09;問是否升級內核配置鍵盤手動配置ipv4…