Label Switching
MPLS shifts the paradigm from packet forwarding from the destination IP address to label switching. Normally, when a router receives a packet, it looks at the IP header, and makes a forwarding decision based on the destination IP address (the longest match in the routing table). On the contrary, in MPLS networks, a label is added between the Layer 2 and Layer 3 headers, and the router performs packet forwarding strictly based on that label. This allows end-to-end circuits across any type of transport medium, using any protocol.
Label-Switched Path (LSP)
- LSPs are predetermined unidirectional routes through the MPLS core.
- Routers define the LSPs by exchanging MPLS information before forwarding any packets.
- Contrary to LSPs, normal IP routing operates on a hop-by-hop basis, each router making routing decisions independently.
Label-Switching Router (LSR)
- LSR is a router configured with MPLS that participates in LSPs.
- LSRs can interpret MPLS headers and performs MPLS operations required to pass traffic through the network.
- There are diffrent types of LSRs: ingress LSR, "normal" LSR, and egress LSR.
- Ingress LSR is the entry point into the MPLS network. Native IPv4 packets are assigned MPLS label(s).
- "Normal" LSRs forward MPLS traffic along the LSP, using only the MPLS header to determine how the packet is routed.
- Egress LSR receives MPLS packets, strips off any labels, and performs a native IP route lookup.
Label Format
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| Label | Exp | S | TTL |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Label: label value (20 bits)
- Exp: experimental use, currently used for QoS (3 bits)
- S: Bottom of Stack (1 bit)
- TTL: Time To Live (8 bits)
- Multiple labels can be imposed in an MPLS header. The last label has the S bit set to 1.
- TTL has the same purpose as in IP.
Label Operations
- Push: Adds a new label on top of the packet.
- Swap: Replaces the top label of a label stack with a new label.
- Pop: Removes the top label of a label stack.
- Multiple Push: Adds multiple labels to the top of the label stack.
- Swap and Push: Replaces the top label with a new label and then pushes a new label to the top of the stack.
- Penultimate Hop Popping (PHP): Removing the top label at the second last router in the MPLS network. This prevents the egress LSR from performing an unnecessary MPLS lookup, only to realize that it needs to send the packet using native IP, and then refer to its routing table to make the actual forwarding decision.
Label Distribution Protocol (LDP)
- LDP is a method to dynamically build and maintain the LSPs between the LSRs.
- LSRs exchange label information using LDP.
- The label bindings received by LDP are stored in the LIB.
- The LIB in turns feeds the LFIB which defines the label operation (pop, swap, or push).
- LDP is automatically run on interfaces with mpls ip enabled (CEF and LDP globally must also be enabled).
- LDP sends Hellos to discover neighbors.
- LDP Hello messages are UDP (646) messages that are sent on the links to the “all routers on this subnet” multicast address 224.0.0.2.
- Default timers: Hello = 5 seconds, Hold = 15 seconds.
- LSRs that are running LDP have an LDP Identifier, or LDP ID.
- This LDP ID is a 6-byte field that consists of 4 bytes identifying the LSR uniquely and 2 bytes identifying the label space that the LSR is using.
- The first 4 bytes of the LDP ID are an IP address taken from an operational interface on the router.
- If loopback interfaces exist, the highest IP address of the loopback interfaces is taken for the LDP ID. If no loopback interfaces exist, the highest IP address of a regular interface is taken.
- The LDP ID needs to be present in the routing table of the LDP neighboring routers. If it is not, the LDP session is not formed.
- If there is no route for that IP address in the routing table, the LDP session is not established.
- If two LSRs have discovered each other by means of the LDP Hellos, they attempt to establish an LDP session between them. One LSR tries to open a TCP connection—to TCP port 646—to the other LSR.
- After the LDP session has been set up, it is maintained by either the receipt of LDP packets or a periodic keepalive message. Each time the LDP peer receives an LDP packet or a keepalive message, the keepalive timer is reset for that peer (default 180 seconds).
MPLS Ping
- IP ping is insufficient for verifying the correct MPLS oepration.
- IP ping verifies connectivity on the IP level but it does not verify whether the LSP is broken.
- If LDP is broken between two LSR, IP ping indicates that there is no problem.
- LSPs can break for any number of reasons, while the IP connectivity remains fine. For example:
- The LDP session is down.
- MPLS is not enabled on one LSR (or one interface).
- The LFIB has a wrong entry for the LSP (wrong in/out label or wrong out-going next-hop information).
- The software and hardware LFIB have a discrepancy.
- For some of these problems, the packets become unlabeled; others are label-switched, but in a
wrong way. - MPLS ping detects problems in the forwarding plane, but it also checks the control plane against the information in the data plane.
- MPLS ping is similar to IP ping in that it also uses an echo request and echo reply.
- That is where the similarities stop, though. MPLS ping has different packet formats altogether and returns more troubleshooting information.
- An MPLS echo request is a UDP packet with a destination port of 3503 and a source port chosen by the sender.
- It has a Router Alert option.
- To prevent the packet from switching any further as an IP packet if the LSP is broken but the IP path is still fine, the IP TTL of the packet is set to 1 and the destination IP address of the packet is from the range 127.0.0.0/8.
- An LSR never forwards such an IP packet if the LSP is broken.
- The destination of the packet and which label stack is pushed onto the packet is derived from the IP address that the user command or a software component provides.
MPLS Traceroute
- The goal of traceroute is to test the path, whereas the goal of ping is to test the connectivity.
- An MPLS traceroute is nothing more than an MPLS echo request.
- The difference with MPLS ping is that MPLS traceroute sends several MPLS echo request packets with increasing MPLS TTL.
- The first MPLS LSP traceroute probe has MPLS TTL 1, and for every subsequent probe, the TTL is increased by 1.
No comments:
Post a Comment