Under MPLS (Multi-protocol Label Switching)

MPLS architecture
Insert picture description here

  • When we understand the structure of MPLS, we generally introduce two planes, one is the control plane and the other is the forwarding plane.

  • Control plane: responsible for generating and maintaining routing information and label information.
    Routing Information Base (RIB) (Routing Information Base): generated by the IP Routing Protocol (IP Routing Protocol), used to select routes. Label Distribution Protocol (LDP): responsible for label distribution, establishment of label forwarding information table, establishment and removal of label exchange paths.
    Label Information Base (LIB): generated by the label distribution protocol, used to manage label information.

  • Forwarding plane: the data plane (Data Plane), which is responsible for forwarding ordinary IP packets and MPLS label packets.
    Forwarding Information Base (FIB): extracts the necessary routing information from the RIB, and is responsible for forwarding common IP packets.
    Label Forwarding Information Base (LFIB): Referred to as the label forwarding table, the label distribution protocol establishes LFIB on the LSR and is responsible for forwarding MPLS label packets.

  • These two gray areas can actually be regarded as a router, and this router has two planes at the same time to achieve the effect.
    · First, we run the routing protocol on the control plane, and form a routing table RIB between routers. The routing table can be used for data forwarding, which is Forwarding, so RIB and FIB are connected

  • Control plane: IP information table, there will be Ip forwading table in the forwarding plane. Therefore, in traditional IP forwarding, IGP is the job of the control plane. Once the IP forwarding table is formed, when the data comes, the IPFI (IP forwarding table) of the forwarding plane will be used.

  • Now the label is introduced. Due to the use of the label, the label distribution protocol is also required. For example, this router runs the label routing protocol and generates a label forwarding table. Therefore, distributing the label is what the control plane does to form the label forwarding table What the forwarding plane does, namely LFIB, label forwarding database

  • During the interview, there will be inquiries, the role of the control plane and the role of the forwarding plane. We need to know that the control plane is done by the protocol, such as IGP, forming the routing table, the label protocol forms the label table, etc .; the forwarding plane uses the formed table Perform data forwarding, such as the next hop outgoing interface, etc.

  • If an IP message is received now, then it will go to the FIB and then forward it out as an IP message or a tagged message

  • The same is true for LFIB. When a tagged message is received, it may be forwarded out as a normal IP message or a tagged message

  • You will find that there is a small arrow in FIB and LFIB time. This small arrow means: in fact, if MPLS is not enabled in the router, then there is no label information in the IP forwarding table or FIB. Once the router is used With MPLS, the label forwarding table will be generated, and the label information that meets the conditions will also be placed in the FIB table, that is, the label information will actually appear in the FIB table. In this case, the data forwarded by the FIB table There will be tag data.

  • MPLS is actually used in frame mode, there is also cell mode MPLS, which is actually the mode used in ATM. But since we don't use ATM network now, MPLS cell mode is basically not used.

MPLS data packet structure
Insert picture description here
Insert picture description here

  • Additional: MPLS label nesting-label stack (Lable Stack)
    Insert picture description here

  • In MPLS VPN, we will only use two MPLS headers, one is the outer label and the other is the inner label

  • In MPLS TE, we generally have 3 MPLS labels, namely the top label, the middle label and the bottom label.
    -If there is no MPLS, it is a pure IGP, if you want to use MPLS for switching, then a layer of labels

  • When communicating, in fact, the pure IP network connected by RTA gives RTA a pure IP data, then the RTA device has to check the FIB table, then tag it, and pass it to the RTB device.

  • Insert picture description here

  • NHLFE is composed of three parameters, the first is Nexthop, the second is Out-Interface, and the third is label Operation: Push stands for adding a label or removing a label
    Insert picture description here

  • Huawei equipment uses IP prefix to divide FEC.

  • MPLS label operation types:
    -①PUSH
    Insert picture description here
    -②Swap
    Insert picture description here
    -③Pop
    Insert picture description here
    LSP establishment method

  • LSP concept:

  • There are two ways to establish LSP: -①
    static LSP
    -② dynamic LSP:
    Insert picture description here

LDP neighbor discovery
Insert picture description here

  • LDP (Label Distribution Protocol): The industry standard label distribution protocol. Different manufacturers have different standards. For example, Cisco also has a corresponding distribution protocol, that is, Cisco's TDP, which also distributes labels, but can only be sent on Cisco devices. Since different manufacturers have different standards, we use one LDP Unite
  • When establishing LDP neighbors, you must enable LDP on the devices that need to be neighbors. Similar to how we want to forward routing information, we must also enable ospf on the router.
    Insert picture description here
  • After the neighbors are created, labels are assigned based on FEC. Huawei devices use prefixes for analysis by default.
  • In general, LDP is a protocol used to establish LDP sessions between LSRs and exchange Label / FEC mapping information.
  • There are actually two types of LDP discovery mechanisms:
    -① The basic LDP discovery mechanism discovers LSR neighbors directly connected on the same link, which are actually LDP neighbors on their own directly connected links, similar to the establishment of OSPF neighbor relationships, then in OSPF We establish a neighbor relationship to send hello packets using multicast. In fact, for the basic discovery mechanism of LDP, multicast is also used, which is 224.0.0.2
    -② The LDP extended discovery mechanism discovers non-directly connected LSR neighbors. For example, if we use Layer 2 VPNs, etc. These applications need to establish remote LDP sessions across multiple devices, so the basic discovery mechanism cannot be solved, and an extended discovery mechanism needs to be used. At this time, unicast is not used for multicast.
  • In the basic discovery mechanism, discovering neighbors is very simple. After sending hello packets to each other, a TCP connection is established, that is, a TCP three-way handshake.
  • Hello features of the basic discovery mechanism:
    ① The message is encapsulated in UDP
    ② The source and destination port number is 646
    ③ The destination IP address of the message is the multicast address, 224.0.0.2
  • If you want to create a TCP connection after the hello interaction is completed, the TCP destination port number is 646.
  • Then this TCP connection is initiated by the Transport Address, which is used to establish a TCP connection

LDP neighbor establishment

  • LDP message types: (The following are just types, not real protocol messages)
    ①Discovery message announces and maintains the existence of an LSR in the network
    ②Session message establishes, maintains and terminates LDP sessions between LDP peers
    ③Advertisemnet message generates, changes and deletes FEC Label mapping
    ④Notification message announces warning and error messages (much like in BGP, it is used for reporting when there is a problem)
  • Huawei LDP notification principles:
    ① By default, the device only assigns labels to / 32 host prefixes.
    ② After the device generates a certain prefix label, it will be sent to all neighbors.
    ③ Label generation:
    1. All / 32 networks on this device will generate
    2. The label will be received through the next-hop router in the destination network segment in the routing table, then this time we will send the label

Penultimate Hop Popping
Insert picture description here

  • Before using PHP, that is, before the next hop pops up, RTA sends the data packet to 100.1.1.1/32. The data forwarding process is
    ①: RTA checks its own LIB table and forwards the data packet according to the parameters in the LIB, then The packet will be labeled with an MPLS label of 1027.
    ②: When RTB receives a labeled packet from RTA, it does not need to pass FIB and then directly query through LFIB, knowing the in and out of the label, so Will change 1027 to 1026, perform the operation as swap, and then send this packet to RTC. After sending it to RTC, in the absence of PHP, actually a swap operation will be performed. Then for RTD, first need Go to LFIB and see that the out Label value is null, so you need to remove this label, and then check it through your FIB to find out how to get to your destination, so it adds some resource consumption to the RTD. [That is, the resources consumed by the RTD device are higher than other devices, which easily causes MPLS to reach the bottleneck]
  • In order to cope with this situation, the role of PHP has appeared. After introducing PHP technology, the RTC in the penultimate hop of this network will receive a label with a value of 3 (reserved) from the router RTD of the last hop, called Implicit label. This implicit label is given to the next-hop router, so that an out label = 3 item will appear in its LFIB table. In this case, it knows that if the data is to be sent, the label needs to be removed and removed. After that, RTD only needs to check its FIB table to transfer the packet to 100.1.1.1/32

[Note]: If you want to use QoS based on MPLS, you need to consider an issue, that is, our labels actually need to exist. In this case, we need to use explicit labels (0)

Published 28 original articles · won 15 · views 872

Guess you like

Origin blog.csdn.net/weixin_45948002/article/details/105183410