Brief introduction of single-arm routing and three-layer switching technology


Single-arm routing and three-layer switching technology

How do we achieve communication between different VLANs:

  • Single-arm routing technology: Layer 2 switch + router
  • Layer 3 switching technology: Layer 3 switch

1. Single-arm routing technology

One-arm routing (router-on-a-stick) refers to the implementation of different VLANs (virtual LAN) interconnection and intercommunication.

Two, use cases

Insert picture description here

The code is as follows (example):

LSW5

The device is running!

<Huawei>undo terminal monitor 
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW5
[LSW5]vlan bat 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW5]int e0/0/1	
[LSW5-Ethernet0/0/1]port link-type trunk	
[LSW5-Ethernet0/0/1]port trunk allow-pass vlan all
[LSW5-Ethernet0/0/1]int e0/0/2
[LSW5-Ethernet0/0/2]port link-type access 
[LSW5-Ethernet0/0/2]port default vlan 2
[LSW5-Ethernet0/0/2]int e0/0/3
[LSW5-Ethernet0/0/3]port link-type access
[LSW5-Ethernet0/0/3]port default vlan 3

R2

The code is as follows (example):

The device is running!

<Huawei>undo terminal monitor 
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]int e0/0/0
[R2-Ethernet0/0/0]undo shutdown
Info: Interface Ethernet0/0/0 is not shutdown.
[R2-Ethernet0/0/0.2]int e0/0/0.1
[R2-Ethernet0/0/0.1]vlan-type dot1q 2 default
[R2-Ethernet0/0/0.1]ip add 192.168.2.1 24
[R2-Ethernet0/0/0.1]int e0/0/0.2
[R2-Ethernet0/0/0.2]vlan-type dot1q 3 default
[R2-Ethernet0/0/0.2]ip add 192.168.3.1 24
[R2-Ethernet0/0/0.1]q

Communication result:

PC>ping 192.168.3.10

Ping 192.168.3.10: 32 data bytes, Press Ctrl_C to break
From 192.168.3.10: bytes=32 seq=1 ttl=127 time=125 ms
From 192.168.3.10: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.3.10: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.3.10: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.3.10: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.3.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 78/87/125 ms
PC>ping 192.168.2.10

Ping 192.168.2.10: 32 data bytes, Press Ctrl_C to break
From 192.168.2.10: bytes=32 seq=1 ttl=127 time=78 ms
From 192.168.2.10: bytes=32 seq=2 ttl=127 time=94 ms
From 192.168.2.10: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.10: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.10: bytes=32 seq=5 ttl=127 time=94 ms

--- 192.168.2.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 78/84/94 ms

The url network request data used here.


Layer 2 and Layer 3 switching technology

Three-layer switching (also known as multi-layer switching technology, or IP switching technology) is proposed relative to the traditional switching concept. As we all know, traditional switching technology operates on the second layer of the OSI network standard model-the data link layer, while the three-layer switching technology implements high-speed forwarding of data packets on the third layer of the network model. Simply put, the three-layer switching technology is: two-layer switching technology + three-layer forwarding technology.

Use case

Insert picture description here
The code is as follows (example)

The device is running!

<Huawei>undo terminal monitor 
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW1
[LSW1]vlan bat 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]int g0/0/1	
[LSW1-GigabitEthernet0/0/1]port link-type access 	
[LSW1-GigabitEthernet0/0/1]port default vlan 2
[LSW1-GigabitEthernet0/0/1]int g0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access
[LSW1-GigabitEthernet0/0/2]port default vlan 3
[LSW1-GigabitEthernet0/0/2]q
[LSW1]int vlan 2
[LSW1-Vlanif2]ip add 192.168.2.1 24
[LSW1-Vlanif2]int vlan 3
[LSW1-Vlanif3]ip add 192.168.3.1 24
[LSW1-Vlanif3]q

Communication result:

PC>ping 192.168.3.10

Ping 192.168.3.10: 32 data bytes, Press Ctrl_C to break
From 192.168.3.10: bytes=32 seq=1 ttl=127 time=94 ms
From 192.168.3.10: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.3.10: bytes=32 seq=3 ttl=127 time=46 ms
From 192.168.3.10: bytes=32 seq=4 ttl=127 time=32 ms
From 192.168.3.10: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.3.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 32/53/94 ms
PC>ping 192.168.2.10

Ping 192.168.2.10: 32 data bytes, Press Ctrl_C to break
From 192.168.2.10: bytes=32 seq=1 ttl=127 time=31 ms
From 192.168.2.10: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.2.10: bytes=32 seq=3 ttl=127 time=47 ms
From 192.168.2.10: bytes=32 seq=4 ttl=127 time=46 ms
From 192.168.2.10: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.2.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/43/47 ms

to sum up

Single-arm routing technology: When there is only a two-layer switch and communication between different VLANs is required, single-arm routing technology is required.
Layer 3 switching technology: Layer 3 switches can be configured with vlanif interfaces, and ip addresses can be configured through the vlanif interfaces to become gateways corresponding to different VLANs, thereby realizing routing between different VLANs.
The emergence of Layer 3 switching solves the situation that after the network segment is divided in the LAN, the subnet in the network segment must be managed by the router, thereby alleviating the network bottleneck problem caused by the excessive burden of the router.

Guess you like

Origin blog.csdn.net/Lucien010230/article/details/111571336