当前位置:网站首页>IP 14th day notes
IP 14th day notes
2022-07-27 04:38:00 【It guy Ma】
LDP --- Label distribution agreement --- Mainly used in MPLS The control level of
MPLS The work to be completed at the control level To assign labels and pass labels . The premise of label assignment is local routing Labels must first exist in the table , The premise of transferring labels is also to have a routing foundation . therefore , LDP Want to work properly , Then want IGP As the foundation .

1, Assign tags
Assign tags Not all devices assign labels to all routing entries in their local routing table , It is I'm judging myself to be Arrive at the outbound station of a network segment LSR when , Will Take the initiative Assign tags .
Of course , Under construction To reach the target network segment LSP In the process , All the middle LSR Need to give the corresponding FEC Distribute Label is OK . Then other devices only receive the mapping relationship between the label and the target network segment , Will be passively allocated label . branch Check before labeling , Mainly check whether the local routing table of the target network segment can reach , And the next jump Is it the same as the announcer . Labels can be assigned if the inspection is passed , If it fails, the bid cannot be allocated sign .
LDP Of Label allocation :
1, In an orderly way --- Huawei equipment The default choice is to assign labels in an orderly way
2, Independent way --- There is no need to confirm that you are leaving LSR, You can also take the initiative to give the path in the routing table Objective branch Label .
2, Transfer label
Departure LSR After assigning labels , need Pass on to others LSR equipment , The prerequisite for transmission is between each other First LDP Yes Isobody Relationship . and LDP The prerequisite for establishing peer relationship is to establish LDP conversation .
Local LDP conversation --- A direct connection is established between two devices LDP conversation
long-range LDP conversation --- Between non directly connected devices , You can create remote LDP Meeting word .
LDP The agreement is to establish a local LDP conversation when , There is no need to manually specify the neighbor IP Address , Can be automatically Discovery adjacent Habitation relationship . Mainly because LDP First of all, there will always be multicast (224.0.0.2) Formal period of sex send out hello Bag to find neighbors .hello Package usage UDP 646 Port to complete .
Local LDP The session Establishment process :
1, stay LSR Activate on LDP after , First, periodically send hello Package to complete peer discovery do .

stay HELLO package You need to carry some parameters in , It contains the transmission address and LDP ID.
Transmission address : this The address is mainly established later TCP The address needed for the conversation , Default Under the circumstances , We will use the LSR ID As this address . So ask for ,LSR ID Must be can Usable and accessible IP Address .
LDP ID: All active LDP Agreed LSR Equipment requires Must have a LDP ID, This ID By 48 position Two Hexadecimal composition , Expression bit 32 position : 16 position , front 32 Bit usage is LSR ID, after 16 Bit use 0 To express . This is related to the label space , All device based tags are empty between , Its Values are 0.
hello The sending cycle of packets defaults to by 5s, The survival time is 3 times hello Time , Default 15 second
2, The two sides After the interaction hello After the package , Will get the other party's transmission address , According to this transmission Address to establish TCP Meeting word .
In establishment TCP Between sessions ,LDP There are also check actions , You need to confirm the received transmission destination first site , In the local Is it reachable in the routing table , Reachable can be established normally TCP conversation .
If both sides establish TCP conversation , Two two-way channels will be created , Waste of resources . be After receiving the right End hello After the transmission address in the packet , Compare with the local transmission address , Pass on Input address big a party , We call it the active party , The active party can take the initiative to establish TCP conversation , And passivity Fang does not establish .


branch District 7.5HCIP Center summer vacation Of the 2 page
3, complete TCP Session creation after , The party with a large delivery address will give priority to the initialization message , It contains Some negotiation participants Send the number to the passive party . If the other party confirms the parameters , Will reply keeplive The message goes into Line confirmation , At the same time, send your own local initialization message , Carry your own parameters . The active party will also respond to Parameters are confirmed recognize , If there is no problem, it will also be sent keeplive message . Received by both parties keeplive message , Zedai surface Parameter negotiation succeeded , LDP Session successfully established .

after , Also needed Send periodically keeplive Keep the message alive , The default sending cycle is 15S, Keep alive Between 3 Times the period Send time , The default is 45 second .
branch District 7.5HCIP Center summer vacation Of the 3 page
Up and down Travel relationship --- It is determined by the flow direction of data layer traffic , The data sender is upstream , The receiver is the next swim . From controlling From the perspective of layers , Then the direction of label transmission should be from downstream to upstream . After that swim The equipment will collect The label of the tour .
Label transfer method --- DU Pattern --- Downstream autonomous mode --- Huawei equipment adopts this mode by default , the Yes LSR After allocating the bid After signing , You can actively transfer labels to others LSR
--- If selected It is the downstream autonomous mode , Then the device passes the label , nothing Cannot judge upstream and downstream Relational , The label will be sent to all peer relationships . When the equipment receives the bid After signing , Then the upstream and downstream customs can be determined based on the routing table system . Huawei equipment , Only the upstream equipment will record the labels sent by the downstream equipment , Labels sent by upstream devices will not be saved .( There is also a kind of label preservation model The formula is upstream and downstream labels Is stored .)
DOD Pattern --- Downstream on-demand mold type --- Only the downstream equipment is connected with the upstream equipment After knowing , Will Send labels to upstream devices .
Data level Flow process
At the data level, traffic In the process of passing , Inbound LSR Equipment and battle LSR Both devices need to query two tables , a sheet FIB surface , a sheet LFIB The package can complete Forwarding process , Resulting in reduced efficiency , Need to optimize .
Optimization idea :
Inbound LSR --- Because the inbound packet does not contain labels , therefore , Must view FIB surface . Then you can directly Put the outbound label Add to FIB In the table , In this way, you will no longer need to view LFPB surface .
Departure LSR --- PHP --- Time Last hop pop-up mechanism ---- Departure LSR The equipment is giving FEC Assign labels directly With special standards sign 3( Implicit empty tag ) , after , Pass this tag to your upstream device , Upstream will Take this label as The outbound tag is recorded in LFIB In the table . When data comes to the device , matching LFIB They found The battle tag is 3, Then he will pop up this label directly . Then exit like this LSR The device will receive a Number without label According to package , Then he can directly check FIB Table to realize forwarding .
Huawei By default, the device enables the next last hop pop-up mechanism .
LDP Of To configure
1, First of all LSR Start the IGP agreement , Guarantee Routing basis
2, To configure MPLS Of LSR ID
[r1]mpls lsr-id 1.1.1.1
3, Activate MPLS and LDP
Global activation
[r1]mpls
Info: Mpls starting, please wait... OK!
[r1]mpls ldp
Pick up Mouth activation
[r1-GigabitEthernet0/0/0]mpls
[r1-GigabitEthernet0/0/0]mpls ldp
[r1]display mpls ldp peer --- see LDP Yes Isomorphic relationship
[r1]display mpls ldp session --- see LDP conversation
[r4]display mpls lsp --- see LFIB surface
Be careful : Huawei equipment By default, only /32 Host routing assignment label , because MPLS It is not mainly used in data transfer Send , If There are too many routing entries in the routing table , Will result in too many LSP, Waste of resources .
[r4-mpls]lsp-trigger all -- This command can be given by the device /32 Route assignment label outside the host route
MPLS Solve the routing black hole problem
[r2]route recursive-lookup tunnel --- It's going on When the route is searched recursively , If there is a tunnel, recursively enter tunnel Avenue
[r2]display fib verbose --- see FIB surface Details of
MPLS VPN technology
MPLS VPN It is provided by operators , A comprehensive solution to the security and bandwidth problems of virtual private lines .

Site --- It can be understood that an organization has different settings in different geographical locations IP The Internet .
PE --- Service provider boundary equipment --- Connection required CE( Boundary devices of customer network ) equipment , You need to accept customers' private Network routing Information . He also needs to transmit the routing information of the private network to the remote PE On the device . The transmission of this part of the route is mainly Use BGP Association Through negotiation . Then the middle P equipment ( Service provider's equipment ) , Only need to complete the high of routing information speed Forward it .
VRF --- Virtual routing forwarding --- VPN instance(VPN example ) --- We can put a real physical device To prepare smoke Like many virtual Proposed equipment . Every virtual device is called a VRF Space , Every VRF Space has its own Routing table , FIB surface , Dynamic routing protocol , And interface .

RD value --- Routing discrimination code --- from 64 Bit binary , The most common expression of Huawei equipment is AS:NN( front AS Representative's AS Number , Back NN Represents a custom value )


VPNV4 route --- IPV4 Add RD The value of , From the original 32 A into 96 position , Will change become VPNV4 route .
MP-BGP --- It can be targeted at a variety of Carry the routing information of the address group . If you need to deliver VPNV4 route , be need Use MP-BGP To deliver .
RT --- Routing target value --- VPN Target --- 32 Bit binary structure --- from BGP Community attributes to carry Departure RT value --- Export RT --- PE The equipment is different VRF Outbound with different space configurations RT, Issued by the society The group attribute carries , need And the far end PE Inbound on device RT Corresponding .
Inbound RT value --- Import RT --- PE The equipment is different VRF Inbound with different space configurations RT, According to the society Carried in attribute Compare the values of , Put it in the corresponding VRF In space
Data layer traffic --- Data layer traffic mainly arrives at the far end PE When on the device, you can't tell which one is added VRF Space in , therefore , You need to use double-layer labels to distinguish .---- Outer label ( Close to the second floor ) --- Public label --- from LDP Agreement to allocate , Its purpose is to In order to ensure that the data can pass normally MPLS Domain , Reach the far end PE.
---- Inner label ( Close to the third floor ) --- Private label --- from MP-BGP Agreement to allocate , Objective At the far end PE After the outer label pops up on the device , You can judge which one to reach according to the inner label VRF The flow of data The amount . Inner layer Labels need to be and VRF There is correspondence in space , This label is made up of MP-BGP After the distribution , Through community attributes, follow Route Deliver to the opposite end PE.
To configure :
establish VRF Space :
[r2]ip vpn-instance a --- Be careful , Huawei devices are case sensitive
[r2-vpn-instance-a]
[r2-vpn-instance-a]route-distinguisher 100:100 --- To configure RD value
[r2-vpn-instance-a-af-ipv4]
[r2-vpn-instance-a-af-ipv4]vpn-target 100:1 export-extcommunity --- Configure outbound RT EVT Assignment result:
Info: VPN-Target assignment is successful.
[r2-vpn-instance-a-af-ipv4]vpn-target 100:2 import-extcommunity --- Configure inbound RT IVT Assignment result:
Info: VPN-Target assignment is successful.
[r2-GigabitEthernet0/0/0]ip binding vpn-instance a --- Divide the interface into VRF Space Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[r2]display ip routing-table vpn-instance a --- see VRF Routing table in space [r2]ping -vpn-instance a 192.168.2.1 --- according to VRF Spatial routing information sends packets
[r2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1 --- Go to VRF Add static routes to the space
[r2-bgp]ipv4-family vpnv4 --- start-up MP-BGP
[r2-bgp-af-vpnv4]peer 4.4.4.4 enable
[r2-bgp]ipv4-family vpn-instance a ---- stay VPN Import routes into the space
[r2-bgp-a]import-route static
[r2-bgp-a]import-route direct
[r4]display bgp vpnv4 vpn-instance b routing-table --- see VRF In the space BGP surface
[r2]rip 1 vpn-instance a --- Start dynamic routing protocol in space
[r4]ospf 2 vpn-instance b router-id 4.4.4.4
边栏推荐
- Using JSON type to realize array function in MySQL
- JS modify the key value of the object array
- Oracle数据库字段date怎么才能走索引?
- 从零开始C语言精讲篇4:数组
- Ribbon load balancing strategy and configuration, lazy loading and hungry loading of ribbon
- 结构型模式-装饰者模式
- Elastic certification test: 30 day FastPass Study Guide
- [machine learning network] BP neural network and deep learning-6 deep neural networks (DNN)
- 管理信息系统期末复习
- Ribbon load balancing principle and some source codes
猜你喜欢
![[C language] recursively explain the tower of Hanoi problem](/img/a6/bbf1f19fc2a663df155cca53f2538a.png)
[C language] recursively explain the tower of Hanoi problem

The difference between ArrayList and LinkedList

Brightcove appoints Dan Freund as chief revenue Officer

e.target与e.currentTarget的区别

People don't talk much, engineers don't talk much
![Shell中的文本处理工具、cut [选项参数] filename 说明:默认分隔符是制表符、awk [选项参数] ‘/pattern1/{action1}filename 、awk 的内置变量](/img/ed/941276a15d1c4ab67d397fb3286022.png)
Shell中的文本处理工具、cut [选项参数] filename 说明:默认分隔符是制表符、awk [选项参数] ‘/pattern1/{action1}filename 、awk 的内置变量

匿名命名管道, 共享内存的进程间通信理解与使用

博云容器云、DevOps 平台斩获可信云“技术最佳实践奖”

微信小程序轮播图

好用的shell快捷键
随机推荐
BSN IPFs (interstellar file system) private network introduction, functions, architecture and characteristics, access instructions
题目:有一个已经按升序排好序的数组。现输入一个数,要求按原来的规律将它插入数组中。
Navicat exports Mysql to table structure and field description
Title: there is an array that has been sorted in ascending order. Now enter a number and ask to insert it into the array according to the original rule.
Effect Hook
Ref Hook
结构型模式-装饰者模式
负数的右移
BigDecimal pit summary & Best Practices
Understand kingbasees V9 in one picture
Standard C language 11
IIC 通信协议 (一)
F - Pre-order and In-order(Atcoder 255)
管理信息系统期末复习
使用kubesphere图形界面dashboard开启devops功能
Full revolutionary networks for semantic segmentation (FCN)
利用JSON类型在mysql中实现数组功能
好用的shell快捷键
els 兼容性DC、传递图片到窗口
Redis interview question (2022)