当前位置:网站首页>The road to hcip MPLS
The road to hcip MPLS
2022-06-23 07:40:00 【Omniscient magical conch】
Fourteenth days
MPLS: Multiprotocol label switching
multi-protocol : Can be based on a variety of different 3 Layer protocol to generate 2.5 Label information of layer ;
Packet exchange — The packet is a network layer PDU, Therefore, packet switching is based on IP Address for data forwarding ; Is the routing behavior of the router ;
Original packet exchange : After the packet enters the router , The router needs to query the local routing table (RIB- Routing information database ), Based on the next jump or target ip Check the local ARP surface , To forward data ;
Fast packet switching : One route, multiple exchanges ; The first packet in each data stream will be forwarded based on the original packet exchange rules ; Generate cache list in the process , Record the whole communication process , The remaining packets of the data traffic can only query the cache records ;
Express packet exchange : No routing required , Direct exchange ; CEF-cisco Express exchange , by cisco Private technology ; Not cisco Manufacturer's equipment exists and cef The forwarding mechanism is the same technology ;
Routing table 、ARP – Convert to FIB( Forwarding information database ) surface Only query during traffic forwarding FIB Just watch ;
FIB Characteristics : During the conversion of router tables , Storage Recursive query results ; At the same time, bind the newly encapsulated layer-2 address ;
IP fast0/0 172.16.20.115(7)
( Recursive out interface ) 0 packets, 0 bytes
epoch 0
sourced in sev-epoch 357
Encap length 14
701CE7662A9768EFBD1D24C50800 New two-layer package
The goal is MAC Source MAC Type number
Label switching : The packet enters the MPLS After , In the fourth 2 Layer and the 3 Press in the label number in the middle of the layer ; Make the router in the domain forward the packet , be based on 2.5 The tag number of the layer only needs to query the local one LFIB surface ( Tag forwarding information database )
Initially, when packet switching only supports original switching , The meaning of tags is faster queries ; But as packet switching accelerates , Using label switching loses the advantage of fast table lookup ;
The present MPLS Meaning of existence :
1、 solve BGP The routing black hole of 2、MPLS VPN 3、MPLS TE Flow engineering
in addition : With the acceleration of packet switching , Make today's MPLS Technology is also beginning to be based on FIB Table work ; To improve the MPLS Work efficiency ;
- working process
Control level : Routing protocols work , Generate RIB, The direction of flow is the control flow ;
Data level : The device accesses the destination based on the routing table , Generate data traffic ; In the opposite direction of the control level ;
Control level :
1) In the absence of MPLS The control level only generates RIB( Routing table ) and FIB( Forwarding information database );FIB Is based on RIB Generate ;
2)MPLS The agreement will start TDP(cisco private ) or LDP( public ), Direct connect device A neighbor relationship will be established between ;
LDP-- be based on UDP and TCP Of 646 Port operation ; First use udp Send multicast hello The bag found a neighbor , Get neighbors ip Address , Then establish... With the direct neighbor TCP Conversation ; After the neighbor relationship is established ; For the stability of neighborhood relations , Generally, the loopback address of the device is used to establish tcp conversation ; It is recommended to set the loopback address to mpls Agreed route-id, The id The value will be carried in the multicast transceiver hello In the message , After that, it will automatically tcp Session creation ;
summary :MPLS The protocol needs to be used between direct neighbors router-id Address to carry out TCP Conversation ; Therefore, the prerequisite is ,route-id Must be for real use of the equipment ip Address , Suggested loopback address — Stable ; Must be unique Multicast hello Packets are sent and received on a directly connected physical interface , To get the opposite end router-id, Nature also requires router-id The route between values can reach ;
So normal is building LDP Between neighbors , The routing protocol has converged ,RIB and FIB Table has been generated ;
3)MPLS After building a neighborhood , Generate Neighborhood watch ;LDP The agreement is based on FIB The route entries learned in the table generate tag numbers ;
cisco The default device is based on FIB All learned routing entries in the table generate tag numbers , Huawei devices are only based on by default FIB In the table 32 Bit masked host routes generate tag numbers ; The reason is that normal 32 Bit host routing is ospf Learn the loopback interface , In normal engineering, there are only BGP and MPLS VPN Based on loopback communication , Use tags to forward ; Other ordinary traffic is based on express packet exchange ; take the reverse into consideration cisco Start up mpls in the future , All traffic will be forwarded based on tags , Reduces forwarding efficiency ( The premise is the default )
4) After the tag number is generated , Will be stored locally LIB surface - Label information database ;LIB The table will be shared among neighbors ;
LIB Load the label numbers distributed by local and neighbors for each route in the table ;
5) function MPLS Agreed devices , take LIB and FIB Combine , Map the relationship between the tag number and the best path to generate become LFIB surface ( Tag forwarding information database )
notes : Control level generated tables
RIB—》FIB---》LIB---》LFIB The first two tables are generated after the routing protocol works , The last two tables are MPLS Of LDP Protocol generation ;
Data level :
- No, MPLS agreement , be based on FIB The table can be forwarded normally
- Noun :MPLS domain – MPLS Working radius of
edge LSR(PE)-- Border label switching router Work mpls The edge of the field , Connect extraterritorial devices
LSR (P) -- Label switching router Overall work MPLS Intra domain
- When the flow enters the first pe Equipment time , Before there is no express exchange , The router is based on the target IP Address query local RIB;
After that, we'll have to LIB The corresponding in the table can determine whether the flow should be pressed into the label , A query that requires two tables ;
When there is express exchange , The flow enters the first pe when , Direct inquiry FIB surface , Associated tag number in the table , It will be directly determined whether to press the label ;
Flow to P Router , If there is a tag in the received traffic, it is based on LFIB Table forwarding , If there is no label, it is based on FIB Just watch ;
The flow leaves the last boundary MPLS The label will pop up ;
Flow with tag number , When entering the router , Enter the number that the label table should assign to the local router , The label is local downstream ( Next jump ) Tag number assigned to the device ; The upstream and downstream concepts are calibrated based on the data level ;
- Tag number
The label is pressed into 2 Layer and 3 Between layers , be called 2.5 layer

The format of the label ---32 position ,4 Bytes
![]()
front 20 Bit is tag number ,2^20 A tag number ; among 1-15 No. reserved , As a special number ;
The first 21-23 position exp,3 position 8 Number , For priority , be used for QOS Strategy use ;
The first 24 Bit is the bottom of the stack , This bit is 1 Identify the label as the last label ;MPLS It can be encapsulated in one packet at most 3 Secondary label ;
ordinary MPLS A layer of labels MPLS VPN Two layers of MPLS TE 3 layer
TTL Time to live When the label is pressed in for the first time , The... In the current packet 3 layer TTL Copy to label ; Then query the tag once TTL Minus one , When the tag pops up on the last hop device 2.5 Layer of TTL Copied to the 3 In the layer header ;
Ping
Tracer
Ping lsp
Tracer lsp
- MPLS The last jump – Penultimate jump Default execution
The border LSR(pe) Pass the local direct network segment to MPLS After the neighbors in the domain ,LDP The assigned tag number is 3, Tell the penultimate hop device its identity ; Cause the penultimate hop device to query LFIB After the table , On the premise that the forwarding path is known Pop up labels in advance , So that the last hop router only needs to query FIB surface ; Otherwise, the last hop router is querying LFIB After the table , The pop-up tag also needs to query FIB;
- MPLS Configuration of
- IP Can be up to --- Using routing protocol, the whole network can reach
- To configure MPLS – LDP
[r2]mpls lsr-id 2.2.2.2 Must be defined first mpls Of router-id, For the real of the local device ip Address , And neighbors can reach , because
This address will be used to establish TCP conversation , A loopback address is recommended
[r2]mpls And open mpls agreement
[r2-mpls]mpls ldp Reactivate LDP agreement
[r2-mpls-ldp]q
After that, you need to open the protocol on the interface through which all tags pass
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]mpls First open MPLS
[r2-GigabitEthernet0/0/1]mpls ldp Reactivate LDP agreement
When the boot configuration is complete , Use between neighbors UDP Message multicast sending and receiving hello package ; Then based on hello In bag router-id address TCP The establishment of conversation ;
[r3]display tcp status
TCPCB Tid/Soid Local Add:port Foreign Add:port VPNID State
b4cf3d64 167/6 3.3.3.3:646 4.4.4.4:50858 0 Established
b4cf3adc 167/3 3.3.3.3:50806 2.2.2.2:646 0 Established
When tcp After the session is established , Neighbors are based on TCP The conversation then establishes a neighbor relationship , Generate Neighborhood watch :
[r3]display mpls ldp peer
And then based on local FIB surface , Default Huawei only for 32 position Generate tag number for host routing ; Store in LIB In the table , Then neighbors share LIB surface ;
[r3]display fib see FIB surface
[r4]display mpls ldp lsp see LIB surface , Load the label number assigned by the local and neighbor for each route
Finally, the router will LIB and FIB aggregate , Generate label forwarding rules for the best path —LFIB
[r4]display mpls lsp see LFIB surface
notes : By default, Huawei is only for 32 Bit host routing assignment label
[r3]mpls
[r3-mpls]lsp-trigger all Turn on the function , Will target fib Label numbers are assigned to all routes in the table
[r2]tracert -v -a 2.2.2.2 56.1.1.2
- Use mpls solve BGP The routing black hole of
MPLS The agreement will not be passed BGP The routing entries of protocol learning are assigned tag numbers ;
Turn on bgp Distribution of labels
[Huawei]mpls
[Huawei-mpls]lsp-trigger bgp-label-route
But visiting these BGP When routing the target network segment , When the traffic is pushed in, it reaches these network segments BGP Tag number of the next hop device address ;
example :R2 from BGP neighbor 5.5.5.5 Learning to 6.6.6.0 Route of network segment ;R2 During a visit to 6.6.6.0 when , Will be pushed in the packet to arrive 5.5.5.5ip Tag number of the address , To cross the middle without running BGP Agreed devices ; Break the routing black hole ;
notes : Huawei equipment is not... By default BGP The protocol implements the next hop label mechanism ,cisco Default execution ;
Huawei equipment needs to be turned on route recursive-lookup tunnel The route is recursively searched based on the tunnel
- MPLS VPN
- CE Pass private route to PE End
- PE The end receives different CE When sending the same network segment route , Use RD Value to distinguish --- Format X:X 32 position
- PE The end will be attached with RD The private route of cannot be directly loaded into the local public route table , It needs to be placed in the corresponding VRF vpn example ( Virtual routing forwarding ) In space ; Then pay RT value , Used to pass to the opposite end PE equipment , Peer discrimination information ;
VPNV4 route = Ordinary IPV4 route +RD+RT
- VPNV4 Routing needs MP-BGP To deliver ; The opposite end is based on RT value , Load the route to the corresponding VRF In space , Then share it with the corresponding CE;
- After the control level work is completed , The data level needs to be based on MPLS Come to work , Because the data layer cannot carry RD/RT value ;
so mpls Two layers of labels will be pressed into the packet , The outer label is used to go beyond the intermediate equipment , break BGP Routing black holes ;
The inner label is used to correspond to VRF Space ;
To configure :
- ISP part
- IGP route
- MPLS Domain
- To configure MPLS VPN
[r2]ip vpn-instance a Create a a Of vrf Space
[r2-vpn-instance-a]ipv4-family Get into IPV4 In configuration mode
[r2-vpn-instance-a-af-ipv4]route-distinguisher 1:1 RD value
[r2-vpn-instance-a-af-ipv4]vpn-target 1:1 RT value Must be end-to-end PE End consistent
[r2]interface GigabitEthernet 0/0/0 Go to the link CE The interface of the end
[r2-GigabitEthernet0/0/0]ip binding vpn-instance a Related to vrf Space
[r2-GigabitEthernet0/0/0]ip address 192.168.2.2 24 Configuration private ip Address
notes : In relation to vrf Interface cannot be configured before space ip, Otherwise, the direct route of the address will enter the public route table ;
[r2]display ip routing-table vpn-instance a View the private routing table in the space
[r2]ping -vpn-instance a 192.168.2.1 The normal test will query the records in the public routing table ; This command is based on VRF Space
a Perform routing query
- PE And PE To establish MP-BPG Neighborhood
[r2]bgp 2
[r2-bgp]router-id 2.2.2.2
Establish a normal connection with the opposite end first BGP Neighborhood , It can be used to deliver normal public network routing
[r2-bgp]pe 4.4.4.4 as-number 2
[r2-bgp]pe 4.4.4.4 connect-interface LoopBack 0
[r2-bgp]pe 4.4.4.4 next-hop-local
At the same time, it needs to be in IPV4 In the family model , Establish a... With the opposite end VPNV4 The relationship between , Used to convey VPNV4 route
[r2-bgp]ipv4-family vpnv4
[r2-bgp-af-vpnv4]peer 4.4.4.4 enable
[r2-bgp]display bgp vpnv4 all peer see mp-bgp Neighborhood
- CE End and PE End to end interactive routing
static state
CE You can write a static route directly at the end ;
PE The end editor writes VRF Static routing in space
[r2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1
Will local vrf Static and direct routes in the space are republished to BGP The protocol is passed to the peer PE
[r2]bgp 2
[r2-bgp]ipv4 vpn-instance a
[r2-bgp-a]import-route direct
[r2-bgp-a]import-route static
<r4>display bgp vpnv4 vpn-instance a routing-table see mp-bpg Of BGP surface
OSPF
CE The terminal starts normally OSPF that will do
PE End , start-up VPNV4 A dedicated ospf agreement
[r4]ospf 2 vpn-instance a
[r4-ospf-2]area 0
[r4-ospf-2-area-0.0.0.0]network 192.168.3.1 0.0.0.0
Then use two-way republishing , Realize routing sharing
[r4]bgp 2
[r4-bgp]ipv4-family vpn-instance a
[r4-bgp-a]import-route ospf 2
[r4]ospf 2 vpn-instance a
[r4-ospf-2]import-route bgp
[r4]display mpls lsp vpn-instance a Check the inner label number of the double-layer mark
Force the next jump pbr
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 4.4.4.4 0
[r1]traffic classifier next
[r1-classifier-next]if-match acl 2000
[r1-classifier-next]quit
[r1]traffic behavior pbp
[r1-behavior-pbp]redirect ip-nexthop 12.1.1.2
[r1-trafficpolicy-xx]classifier next behavior pbp
[r1]interface g0/0/2
[r1-GigabitEthernet0/0/2]traffic-policy xx inbound
边栏推荐
- 在kubernetes中部署kubersphere
- Ntu-rgbd data set download and data format analysis
- [AI practice] xgb Xgbregression multioutputregressor parameter 2 (GPU training model)
- 职场必备的30套报表模板,满足95%的报表需求,一键套用无需代码
- [AI practice] data normalization and standardization of machine learning data processing
- SSM integration
- Akamai-1.75 version-_ Abck parameter generation JS reverse analysis
- [pyqt5 series] modify the counter to realize control
- How flannel works
- G++ compilation command use
猜你喜欢

Hcip Road

Akamai-1.75 version-_ Abck parameter generation JS reverse analysis

Heuristic search strategy

CIRIUM(睿思誉)逐渐成为航空公司二氧化碳排放报告的标准

How flannel works

How bootstrap clears floating styles

The original cloud landed in deep water, and the cloud product family of Boyun container released four values

职场必备的30套报表模板,满足95%的报表需求,一键套用无需代码

Eureka服务注册与发现
![[interface automation] software testing the core skills of salary increase to increase salary by 200%](/img/22/be8c5c922307225c34f6205f189c33.png)
[interface automation] software testing the core skills of salary increase to increase salary by 200%
随机推荐
Here comes the dry goods | PAAS collection to see first ~
【博弈论】基础知识
HCIP之路
基于51单片机的温度检测监测报警系统设计
RFID data security experiment: C # visual realization of parity check, CRC redundancy check and Hamming code check
[AI practice] xgbgressor model accelerates training and uses GPU to train xgbgressor in seconds
Ntu-rgbd data set download and data format analysis
作为思摩尔应对气候变化紧急事件的一项举措,FEELM加入碳披露项目
2.概率论-概率论公理
Use of Lombok
The original cloud landed in deep water, and the cloud product family of Boyun container released four values
Difference between char and varchar
NFS special attention to permissions
30 sets of report templates necessary for the workplace, meeting 95% of the report needs, and no code is required for one click application
左乘右乘矩阵问题
Tp6+redis+think-queue+supervisor implements the process resident message queue /job task
Make a record of glib2.14 upgrading glib2.18 and the principle of the steps
What is customer experience automation?
The Sandbox 与《足球小将》达成合作,将流行的足球漫画及动画带入元宇宙
Judge black production based on CDN and client slow log characteristics