首页 > 其他分享 >第四章:冗余链路的配置与管理

第四章:冗余链路的配置与管理

时间:2025-01-16 20:31:36浏览次数:3  
标签:vlan SWA SWB range Switch 冗余 链路 config 第四章

一、生成树

1、背景

2、生成树——冗余链路带来的问题

3、生成树原理

4、STP算法

5、STP端口状态 

二、以太通道

 1、LACP协议

2、PAGP协议

3、配置注意点

三、生成树的配置

1、任务

两台交换机分别通过Fa0/1和Fa0/2端口连接起来作为冗余链路,账务部和销售部分别属于VLAN10和VLAN20,在三层交换机上VLAN10的地址为192.168.10.1,VLAN20的地址为192.168.20.1,配置三层交换机SWA为VLAN10,VLAN20的根网桥,SWB为VLAN10,VLAN20的备份根网桥。

2、拓扑图

3、代码
(1)SWA配置
Switch>en
Switch#vlanda
Switch#vlan da
Switch#vlan database 
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
Switch(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SWA
SWA(config)#int range f0/1-2
SWA(config-if-range)#switchport trunk encapsulation dot1q 
SWA(config-if-range)#switchport mode trunk 
SWA(config-if-range)#switchport trunk all vlan all
SWA(config-if-range)#exit
SWA(config)#int f0/3
SWA(config-if)#switchport mode access 
SWA(config-if)#switchport access vlan 20
SWA(config-if)#no shut
SWA(config-if)#exit
SWA(config)#int vlan 10
SWA(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

SWA(config-if)#ip add 192.168.10.1 255.255.255.0
SWA(config-if)#exit
SWA(config)#int vlan 20
SWA(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

SWA(config-if)#ip add 192.168.20.1 255.255.255.0
SWA(config-if)#exit
SWA(config)#ip routing                                      //开启路由转发功能
SWA(config)#spanning-tree vlan 10 root primary              //SWA配置为跟交换机
SWA(config)#spanning-tree vlan 20 root primary 
SWA(config)#
(2)SWB配置
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SWB
SWB(config)#vlan 10
SWB(config-vlan)#exit
SWB(config)#vlan 20
SWB(config-vlan)#exit
SWB(config)#int range f0/1-2
SWB(config-if-range)#switchport mode trunk 


SWB(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

SWB(config-if-range)#switchport trunk all vlan all
SWB(config-if-range)#no shut
SWB(config-if-range)#exit
SWB(config)#int f0/3
SWB(config-if)#switchport mode access 
SWB(config-if)#switchport access vlan 10
SWB(config-if)#no shut
SWB(config-if)#exit
SWB(config)#spanning-tree vlan 10 root secondary                //SWB上配置为备份根交换机
SWB(config)#spanning-tree vlan 20 root secondary 
(3)测试

SWA

SWA#show spanning-tree                   //查看生成树信息
VLAN0001                                 //VLAN1的生成树信息,每个VLAN都有一棵生成树
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0090.0C34.7E78
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0090.0C34.7E78
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/1            Desg FWD 19        128.1    P2p

VLAN0010                                 //VLAN10生成树信息
  Spanning tree enabled protocol ieee
  Root ID    Priority    24586           //根交换机的优先级值
             Address     0090.0C34.7E78
             This bridge is the root     //这是根交换机
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)   //配置root primary生成的优先级值
             Address     0090.0C34.7E78
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p                //转发状态
Fa0/1            Desg FWD 19        128.1    P2p                //转发状态

VLAN0020                                   //VLAN20生成树信息
  Spanning tree enabled protocol ieee      
  Root ID    Priority    24596             //根交换机的优先级值
             Address     0090.0C34.7E78
             This bridge is the root       //这是根交换机
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24596  (priority 24576 sys-id-ext 20)   //配置root primary生成的
             Address     0090.0C34.7E78
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p                //连接PC的端口转发状态
Fa0/1            Desg FWD 19        128.1    P2p                //连接PC的端口转发状态
Fa0/3            Desg FWD 19        128.3    P2p                //连接PC的端口转发状态
SWA#show spanning-tree summary               //查看生成树摘要信息
Switch is in pvst mode                       //生成树模式为pvst
Root bridge for: default VLAN0010 VLAN0020   //vlan10和vlan20的根网桥
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is disabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001                     0         0        0          2          2
VLAN0010                     0         0        0          2          2
VLAN0020                     0         0        0          3          3

---------------------- -------- --------- -------- ---------- ----------
3 vlans                      0         0        0          7          7

SWB

SWB#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0090.0C34.7E78
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     00D0.9785.722E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Altn BLK 19        128.2    P2p
Fa0/1            Root FWD 19        128.1    P2p

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    24586
             Address     0090.0C34.7E78
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28682  (priority 28672 sys-id-ext 10)
             Address     00D0.9785.722E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Altn BLK 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/1            Root FWD 19        128.1    P2p

VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    24596
             Address     0090.0C34.7E78
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28692  (priority 28672 sys-id-ext 20)
             Address     00D0.9785.722E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Altn BLK 19        128.2    P2p     //阻塞状态
Fa0/1            Root FWD 19        128.1    P2p     //转发状态
SWB#show spanning-tree summary 
Switch is in pvst mode                           //生成树模式为pvst
Root bridge for:
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is disabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001                     1         0        0          1          2
VLAN0010                     1         0        0          2          3
VLAN0020                     1         0        0          1          2

---------------------- -------- --------- -------- ---------- ----------
3 vlans                      3         0        0          4          7

从以上信息可以看出,SWA为根交换机,SWB为备份交换机,虽然有两条链路,但是实际生效的只有交换机SWA端口f0/1与SWB端口F0/2之间的链路。

大家在配置完之后,可以将主链路F0/1关掉,然后等待几分钟,看两台pc之间是否能进行通信

(4)快速生成树

SWA

SWA(config)#spanning-tree mode rapid-pvst 

SWB

SWB(config)#spanning-tree mode rapid-pvst 

查看SWA生成树摘要信息有什么变化

SWA#show spanning-tree summary 
Switch is in rapid-pvst mode                 //生成模式为RSTP
Root bridge for: default VLAN0010 VLAN0020   //vlan10和vlan20的根网桥
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is disabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0001                     1         0        0          2          3
VLAN0010                     1         0        0          2          3
VLAN0020                     0         0        0          3          3

---------------------- -------- --------- -------- ---------- ----------
3 vlans                      2         0        0          7          9

这里就不查看SWB的摘要信息了,大家可以去看看变化。

快速生成树协议RSTP在生成树协议的基础上增加了两种角色,替换端口和备份端口,冗余端口不需要等待50秒的收敛时间,可以直接切换到备份端口或替换端口,实现快速收敛。

四、二层以太通道配置

1、任务

某公司建立了一个小型局域网,使用两台三层核心交换机部署以太通道,提高链路带宽和可靠性,增大转发速率。物理链路间采用基于目的IP地址的负载均衡。

两台交换机通过两个GE端口连接起来,聚合成一条逻辑链路。

2、拓扑图

3、代码
(1)SWA以太通道配置
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SWA
SWA(config)#int range g0/1-2
SWA(config-if-range)#switchport trunk encapsulation dot1q 
SWA(config-if-range)#switchport mode trunk 


SWA(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

SWA(config-if-range)#switchport trunk all vlan all
SWA(config-if-range)#no shut
SWA(config-if-range)#channel-group 1 mode on             //端口绑定在通道组1
SWA(config-if-range)#
Creating a port-channel interface Port-channel 1

%LINK-5-CHANGED: Interface Port-channel1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up

SWA(config-if-range)#exit
SWA(config)#port-channel load-balance dst-ip             //端口通道的负载均衡方式
(2)SWB以太通道配置
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int range f0/1-2
Switch(config-if-range)#switchport trunk encapsulation dot1q 
Switch(config-if-range)#switchport mode trunk 
Switch(config-if-range)#switchport trunk all vlan all
Switch(config-if-range)#channel-group 1 mode on
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1

Switch(config-if-range)#exit
Switch(config)#port-channel load-balance dst-ip 
4、测试

SWA

SWA#show etherchannel summary                 //查看交换机上的通道汇总信息
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(SU)           -      Gig0/1(P) Gig0/2(P)      //SU代表以太通道在二层
SWA#show etherchannel port-channel          //查看交换机上的通道包含的端口
                Channel-group listing:
                ----------------------

Group: 1
----------
                Port-channels in the group:
                ---------------------------

Port-channel: Po1
------------

Age of the Port-channel   = 00d:00h:15m:18s
Logical slot/port   = 2/1       Number of ports = 2
GC                  = 0x00000000      HotStandBy port = null
Port state          = Port-channel          //端口的状态
Protocol            =   PAGP                //使用的协议
Port Security       = Disabled

Ports in the Port-channel:                  //通道包含的端口

Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
  0     00     Gig0/1   On                 0
  0     00     Gig0/2   On                 0
Time since last port bundled:    00d:00h:15m:18s    Gig0/2

SWB

Switch#show etherchannel load-balance         //查看交换机上的通道负载均衡
EtherChannel Load-Balancing Configuration:
        dst-ip

EtherChannel Load-Balancing Addresses Used Per-Protocol:
Non-IP: Destination MAC address
  IPv4: Destination IP address
  IPv6: Destination IP address

有想法的可以连接两台PC试试通信情况,进入以太通道的其中一个端口,然后关闭这个端口,看看会不会影响PC之间的通信

五、三层以太通道配置

1、任务

某公司建立了一个小型局域网,分为人事部和行政部两个部门,使用两台三层核心交换机部署以太通道,提高链路带宽和可靠性,增大转发速率。

两台交换机通过两个GE端口连接起来,聚合成一条逻辑链路,配置为三层以太通道,通道两端的地址如图所示。人事部和行政部分别属于VLAN10和VLAN20。

2、拓扑图

3、代码
(1)SWA
Switch>en
Switch#vlan database                //配置vlan
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SWA

以太通道配置
SWA(config)#int range g0/1-2
SWA(config-if-range)#no switchport             //关闭二层功能
SWA(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

SWA(config-if-range)#channel-group 1 mode on
SWA(config-if-range)#
Creating a port-channel interface Port-channel 1

%LINK-5-CHANGED: Interface Port-channel1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up

SWA(config-if-range)#exit
SWA(config)#int port-channel 1
SWA(config-if)#ip add 10.1.1.1 255.255.255.0
SWA(config-if)#no shut
SWA(config-if)#exit

vlan地址配置
SWA(config)#int vlan 10
SWA(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

SWA(config-if)#ip add 192.168.10.1 255.255.255.0
SWA(config-if)#exit
SWA(config)#ip routing                           //开启路由功能

ACCESS端口配置
SWA(config)#int f0/1
SWA(config-if)#switchport mode access
SWA(config-if)#switchport access vlan 10
SWA(config-if)#no shut
SWA(config-if)#exit

配置路由使全网互通
SWA(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
(2)SWB
Switch>en
Switch#vlan database                 //创建vlan
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SWB

以太通道配置
SWB(config)#int range g0/1-2
SWB(config-if-range)#no switchport           //关闭二层功能
SWB(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

SWB(config-if-range)#channel-group 1 mode on
SWB(config-if-range)#
Creating a port-channel interface Port-channel 1

%LINK-5-CHANGED: Interface Port-channel1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up

SWB(config-if-range)#exit
SWB(config)#int port-channel 1
SWB(config-if)#ip add 10.1.1.2 255.255.255.0
SWB(config-if)#no shut
SWB(config-if)#exit

vlan地址配置
SWB(config)#int vlan 20
SWB(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

SWB(config-if)#ip add 192.168.20.1 255.255.255.0
SWB(config-if)#exit
SWB(config)#ip routing                  //开启路由功能


ACCESS端口配置
SWB(config)#int f0/1
SWB(config-if)#switchport mode access 
SWB(config-if)#switchport access vlan 20
SWB(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

SWB(config-if)#no shut
SWB(config-if)#exit

配置路由协议使全网互通
SWB(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
4、测试
SWA#show etherchannel summary               //查看以太通道汇总信息
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(RU)           -      Gig0/1(P) Gig0/2(P)    //RU代表以太通道在三层

测试两台PC之间可以进行通信,如果将一个以太端口关闭(模拟物理链路故障),并不影响通信,更不会影响整个三层的路由转发

六、综合测试

1、目标
  • 为了提高网络可靠性,使用两台核心交换机组网,同时为了避免二层环路,运行STP,设置SWA为VLAN10的根交换机、VLAN20的备份根交换机,SWB为VLAN10备份根交换机、VLAN20的根交换机。

  • SWA和SWB之间实施链路捆绑及网关冗余提高网络可靠性。

  • 测试STP、网关冗余是否生效,观察STP端口的状态切换。

  • 掌握STP的选举过程,包括根网桥、根端口、阻塞端口、指定端口。

2、拓扑图

大家可以自行尝试,有问题的同学可以在评论区评论出来,我会一一解答,需要代码的同学可以在评论区扣1

欢迎大家积极提问噢! 

标签:vlan,SWA,SWB,range,Switch,冗余,链路,config,第四章
From: https://blog.csdn.net/2301_76341691/article/details/145166547

相关文章

  • ▲2ASK调制解调通信链路matlab误码率仿真
    目录1.2ASK调制原理2.2ASK解调原理3.MATLAB程序4.仿真结果5.完整程序下载1.2ASK调制原理    幅度键控(Amplitude-ShiftKeying,ASK)是一种数字调制方案,用于将数字信号转换为适合在模拟通信信道中传输的信号。ASK信号的产生原理基于幅度偏移键控,其中二进制数据......
  • 链路层
    网络层规划出了端系统到端系统的路径,并且实现了路由器的转发。因此,网络层的下一个层级链路层(LinkLayer)要实现的是:对于网络层规划的某条通信信道(不包含转发,也即从端系统到最近的路由器的某条信道或路由器到相邻路由器的某条信道),这样相邻的通信信道就称为链路(Link)。链路层协议......
  • 第四章 链路聚合与生成树配置
    想做一个自己学习的有关的csdn账号,努力奋斗......会更新我计算机网络实验课程的所有内容,还有其他的学习知识^_^,为自己巩固一下所学知识,下次更新路由器基本配置与应用。我是一个萌新小白,有误地方请大家指正,谢谢^_^文章目录目录前言一、实验原理1.为什么使用链路聚合技......
  • 【架构师从入门到进阶】第四章:前端优化思路——第三节:前置资源和缓存
    【架构师从入门到进阶】第四章:前端优化思路——第三节:前置资源和缓存前置资源缓存http缓存什么是http缓存http缓存如何做缓存风险更改文件名使用后端验证缓存的有效性基于资源最后修改时间验证基于资源版本号的验证方式客户端缓存各种客户端缓存风险本篇文章我们......
  • 一个实例用全创建型模式-优化(冗余消除)
       上一篇:一个实例用全创建型模式-CSDN博客目录:《一个实例讲完23种设计模式》当前:单件+抽象工厂+创建者+工厂方法+优化需求:坦克大战创建两种坦克坦克类型   射程   速度b70   70米   时/70公里b50   50米   时/50公里设计说明1.抽......
  • 西门子S7-400H冗余PLC与S7-200Smart建立S7通讯
    文章目录前言一、组态从站二、编写程序1.判断主、备CPU运行状态2.编写PUT/GET程序总结前言由于S7-400H是冗余CPU,与S7-200SmartPLC通讯,只能在400PLC程序中编写S7通讯程序。本文主要阐述如何通过Step7软件编写S7通讯程序,关于如何使用博图软件编写S7通讯程序,请参考......
  • 代码随想录算法训练营第五十六天|KM108.冗余连接|KM109.冗余连接Ⅱ
    108.冗余连接本题光看题目没理解具体什么意思;看了题解有点明白了;(个人觉得还是力扣的题目描述比较容易理解)题目意思:大概就是加一条边使树结构有环,然后再环中去掉一条边(如果环中多条边可取,则去掉最后一条边),仍然变成一颗树结构;思路:观察两个节点是否再一个集合,如果不在,也可以将......
  • 链路诊断最佳实践:1 分钟定位错慢根因
    作者:涯海线上应用风险主要分为“错”、“慢”两大类。其中“错”的原因通常是程序运行不符合预期,比如 JVM 加载了错误版本的类实例,代码运行进入异常分支,环境配置错误等。而“慢”的原因通常是资源不足,比如突发流量导致 CPU 飙升,数据库大查询导致连接池打满,内存泄漏导致持续 ......
  • 第四章 保护模式入门
    第四章保护模式入门本文是对《操作系统真象还原》第四章学习的笔记,欢迎大家一起交流。知识部分为什么要有保护模式?实模式下安全问题:实模式下操作系统和用户程序属于同一特权级,平起平坐,没有区别对待;用户程序所引用的地址都是指向真实的物理地址,也就是说逻辑地址等于物理地......
  • 第四章、连上 Internet
    4.1Linux连上Internet前的注意事项由前面几章的数据我们知道,想要连上Internet你得要设定一组合法的IP参数才可以,主要是IP,Netmask,Gateway,DNSIP以及主机名等。那我们也知道,其实整个主机最重要的设定,就是『先要驱动网络卡』,否则主机连网络卡都捉不到时,怎么设......