MPLS & TE

PlAwAnSaI

Administrator
  • MPLS หรือชื่อเต็มๆ ว่า Multi Protocol Label Switching (ถ้าแปลตรงตัว ก็ เป็นตัว Switching โดยใช้ Label ที่สามารถใช้กับหลาย Protocol) เป็น Protocol ที่ IETF ได้กำหนดขึ้นมาสำหรับการทำงานรับส่งข้อมูลของ Router ที่มีการกำหนดเส้นทางไว้ให้ไปถึงจุดหมายได้เร็วขึ้น โดยปกตินั้นการทำงานของ Router จะกระทำภายใต้ IP Packet โดยมีส่วนหัวที่มี Address และข้อมูลอยู่ ซึ่งมีขนาดถึง 20 Byte อาจล่าช้าเกินไป ทำให้เสียเวลาในการรับส่ง เพื่อให้การทำงานของ Router เร็วขึ้น จึงนำเอา IP Packet ใส่ Label แปะหัวข้อมูลอีกครั้ง ทำให้ส่งข้อมูลไปในเส้นทางที่กำหนดไว้ได้เร็วกว่า
  • ข้อดี คือ Router ระหว่างทางไม่จำเป็นต้องนำข้อมูลของ Packet IP เดิมมาวิเคราะห์หรือตรวจสอบ จึงเป็นการประหยัดเวลา และ Switch ได้เร็วขึ้น การตัดสินใจในระดับต่อๆ ไป ก็จะดำเนินการได้อย่างต่อเนื่องและเป็นระบบมากขึ้น
  • MPLS Label Format / MPLS Header:
    mpls_headerlabel_01.gif
    • Label 20 bit จะเป็นค่าที่กำหนดใน Local เท่านั้น จะมี Label เปลี่ยนไปทุกๆ Hop
    • EXP 3 bit ใช้สำหรับกำหนด Class of Service (IP Precedence) ใช้กับ QoS
    • S 1 bit Bottom of Stack ใช้ในการกำหนดว่า Label นั้นเป็น Label สุดท้ายก่อน IP header หรือไม่
    • TTL ทำหน้าที่เหมือนกับ Field TTL ใน IP Header ที่จะมีค่าลดลงทุกครั้งที่ผ่านอุปกรณ์แต่ละ Hop ป้องกันไม่ให้ Packet วิ่งอยู่ในระบบนานจนเกินไป หรือวิ่งไม่หยุด (Routing Loop)
  • ตัวอย่าง MPLS Label Stack Format:
    fmq01.gif
    • Label แรกจะเป็น Label ที่กำหนดว่าปลายทางของ Frame นี้อยู่ที่ไหน (Destination)
    • สังเกต Label สุดท้าย S จะเท่ากับ 1
  • ตัวควบคุม/กำหนด การแปะ Label ที่ง่ายที่สุดคือ FEC (Forwoarding Equivalence Class) ซึ่ง Router แต่ละตัวจะเป็นอิสระต่อกัน (Packet หนึ่ง ไม่จำเป็นต้องมี Label เหมือนกันจนถึงปลายทางใน Router ทุกตัวที่ Packet นั้นผ่าน) โดยกลุ่มของ IP Packet ที่จะถูกส่งออกไปในลักษณะเดียวกัน บนเส้นทางเดียวกัน และรูปแบบ รวมทั้งทิศทางเดียวกัน จะให้ Label เหมือนกัน
  • Protocol นึงที่ใช้ในการแลกเปลี่ยน Label ระหว่าง LSR/Edge LSR ในเครือข่าย MPLS คือ LDP (Label Distribution Protocol) ถูกกำหนดโดย RFC 3036 และ 3037 จะแลกเปลี่ยน Label ในแต่ละ FEC ซึ่งจะกระทำต่อ Neighbor/Link/ปลายทาง ทำให้สามารถค้นหาปลายทาง a.b.c.d ด้วย Label x และใช้ในการค้นหา Neighbor ด้วย อยู่ในส่วนของ Control Plane โดยการสร้าง Session มี 2 ขั้นตอน:
    • ใช้ Hello Message ทำความรู้จักกัน จะเป็น UDP Packet ส่งไปยัง Router ทุกตัวภายใน Subnet โดยใช้ Multicast Address 224.0.0.2 (224.0.0.1 จะส่งไปทุก Host) Port 646 ภายในจะมี LDP ID อยู่ มีขนาด 6 Byte เกิดจาก Router-id 4 Byte + Label Space 2 Byte ตัวอย่าง LDP ID = 1.0.0.1:0 หมายความว่า มี Router-id = 1.0.0.1 และ Label Space = 0 (Per-Platform)
    • สถาปนาการสื่อสารระหว่าง Router โดยใช้ TCP port 646 ถ้า block port ดังกล่าวไป MPLS ก็จะไม่สามารถทำงานได้
  • LDP ถูกพัฒนามาจาก TDP (Tag Distribution Protocol) ใช้ใน Cisco Tag Switching ใช้ได้กับอุปกรณ์ของ Cisco เท่านั้น RFC จึงได้กำหนด LDP ขึ้นเพื่อเป็นมาตรฐานกลาง
  • Router ในมุมมองของ MPLS จะมีชื่อเรียกสองแบบ คือ LSR กับ Edge LSR:
    • LSR (Label Switch Router) คือ Router ที่สามารถทำการ Forward Labeled Packet ทำงานกับ Labeled Packet เท่านั้น ใน Data Plane จะไม่มี FIB
    • Edge LSR อยู่ที่ขอบของ MPLS Domain ทำการ Assign Label ให้กับ Packet และแกะ Label ออกจาก Labeled Packet ส่งออกไปเป็น Packet ธรรมดา
  • Tables used with MPLS:
    • RIB (Route Information Base) มันก็คือชื่อเรียกแบบเป็นทางการของ Routing Table อ่ะแหละ
    • FIB (Forwarding Information Base) เป็น Table ที่ไว้ใช้ Cache จาก Routing Table ใช้กับ Packet ที่เข้ามาเป็น IP Packet ถ้า Destination IP ออกไปทาง Interface ธรรมดา ก็จะแปะ L2 Header ที่ไม่มี Label เป็น IP Packet ธรรมดา แต่ถ้าส่งออกไปทาง Interface MPLS ก็จะแปะ Label ออกไป
    • LIB (Label Information Base) เป็น Table ที่ใช้ Map IP Prefix กับ Label (1 Entry/Route มี 1 Label) Assign โดย Local Router จะจัดเก็บ Label ทั้งหมดที่เกิดขึ้น รวมทั้งมีการเก็บ Label ที่ถูกส่งมาจาก Router เพื่อนบ้าน
    • LFIB (Label Forwarding Information Base) ใช้สำหรับ Switching Packet ใน MPLS Domain โดยที่ Packet นั้น แปะ Label แล้ว ซึ่ง MPLS จะใช้ Table นี้ Forward Packet
  • โครงสร้างของตัว Router ในเครือข่าย MPLS จะแบ่งการทำงานออกเป็น 2 ส่วน คือ Control Plane และ Data Plane:
    • Control Plane จะประกอบไปด้วยส่วนที่ทำหน้าที่เกี่ยวกับพวก Software เช่น การหาข้อมูลเกี่ยวกับ Routing ต่างๆ ส่วนประกอบที่สำคัญก็คือ Routing Protocol (BGP, OSPF, EIGRP, IS-IS)
    • Data Plane ทำหน้าที่เกี่ยวกับการ Forwarding Address และ Label การ forwarding Label จะทำงานแยกกับ Routing Protocol หรือ Label Exchange Protocol
    r3101.gif

  • การดำเนินการในระบบ MPLS นั้นเน้นเรื่องการลดขั้นตอนการประมวลผลของอุปกรณ์และเพิ่มประสิทธิภาพของระบบโดยรวม ดังนั้นอุปกรณ์ Router ที่เป็นตัวส่งข้อมูลจะทำการใส่ Label ไปในส่วนหัวของ Packet ข้อมูล (ระหว่าง Layer 3 กับ Layer 2) โดยการกำหนดชนิดของข้อมูล, ทิศทาง, Address ปลายทาง และลำดับความสำคัญของข้อมูลเอาไว้ ส่วนของ Label ที่ปะไว้ในส่วนหัวมีขนาด 32 Bit เรียกว่า MPLS Label ส่วนของ MPLS นี้ จะมีข้อมูลที่ทำให้อุปกรณ์ Router ตัดสินใจได้ว่า จะ Switch ข้อมูลแบบ Packet IP เดิม หรือแบบ MPLS ถ้าตรวจดูพบว่าเป็นแบบ MPLS ก็จะส่งต่อไปยังเส้นทางต่อไป โดยข้อมูลจะได้รับการส่งต่อจนถึงปลายทางในที่สุด หรือหากจะอธิบายให้เห็นภาพการทำงานของ MPLS ได้ง่ายขึ้นก็สามารถเปรียบเทียบการทำงานเหมือนกับการส่งพัสดุที่ทุกคนต้องการที่จะมั่นใจได้ว่าพัสดุนั้น ถึงที่หมายอย่างปลอดภัย ทันเวลา และอยู่ในสภาพที่ดีครบถ้วน เหมือนตอนที่ส่งไป ทั้งนี้โดยมากแล้วก็จะมีการติดป้ายหรือ Sticker ลงไปที่กล่องพัสดุว่า "ห้ามทับ", "ระวังแตก" หรือ "ห้ามโยน" ซึ่งจะบอกกับทุกคนว่าต้องทำอย่างไรกับสิ่งของเหล่านั้น
  • ก่อนที่จะไปไกลกว่านี้มีข้อให้จำไว้ข้อนึง คือ เส้นทางการไหลของข้อมูลจะสวนทางกับ เส้นทางของ Routing เสมอ: Data จะส่งจากต้นทางไปยังปลายทาง ส่วน Routing จะส่งจากปลายทางมาต้นทาง
  • MPLS เกิดจากการนำเอา 2 Technology มาผสมกัน คือ IP Routing ของ Router และ CEF ของ Switch จึงกล่าวได้ว่าอยู่ใน Layer 2.5
  • หลายๆ คนอาจจะเคยได้ยินแต่ MPLS VPNs แต่จริงๆ แล้วมันเป็นแค่ Application นึงของ MPLS แค่นั้น ช่วยสร้างความเป็น Private รองรับ Multicast, QoS, Telephony, ฯ
  • MPLS ยังสามารถทำประโยชน์อย่างอื่นได้อีก เช่น:
    • Unicast IP Routing ทดแทนการใช้ Routing Table โดยใช้ Label
    • Multicast IP Routing
    • Traffic Engineering ควบคุม Traffic Flow
    • Fast Re-route
    • VPNs Over Traffic Engineered Core
    • QoS สร้างระดับการให้บริการที่หลากหลาย
  • AToM ย่อมาจาก Any Transport over MPLS คือการเอาเครือข่ายหลายๆ แบบ เช่น Frame Relay, ATM, Ethernet มารวมกัน โดยให้มาวิ่งอยู่บน MPLS ประโยชน์ก็คือสร้างแค่เครือข่ายเดียว แต่ให้บริการได้ครอบคลุมทั้งหมด (อเนกประสงค์ว่างั้น) สามารถขายบริการใดๆ ก็ได้ เช่น Virtual Leased Circuit, Frame Relay, ATM, Transparent LAN Service หรือ IP VPN
  • MPLS Forwarding เป็นระบบ Connection-oriented
  • MPLS แบ่งเป็น 2 กลุ่ม:
    • Frame-mode MPLS แบบนี้ Label จะถูกแทรกเข้าไประหว่าง Layer 2 และ Layer 3 Header ถูกเรียกว่า Shim Header และมีได้มากกว่า 1 Label
    • Cell-mode MPLS ก็คือ Run MPLS บนเครือข่าย ATM จะแปลง ATM เป็น Router เลย ทำให้มันเข้าใจ MPLS Label จะใช้ Field ใน ATM Header เป็น Label
  • Packet ที่มี Label มากกว่า 1 จะถูกซ้อน Label กันเป็น Stack มี 2 แบบ:
    • Outer Label จะอยู่นอกสุด ใช้สำหรับ Switching Packet ในเครือข่าย MPLS เช่น Traffic Engineering
    • Inner Label อยู่ภายใน จะนำไปใช้ในการกำหนดบริการต่างๆ เช่น VPNs, Fast Re-route, Alternate Forwarding
    jkk01.gif

  • กระบวนการของ packet ที่อยู่ในเครือข่าย MPLS มี 3 ขั้นตอน:
    • Insert/Impose/Push แปะ Label เข้าไป ทำให้ Packet ธรรมดากลายเป็น Labeled Packet
    • Swap ถอด Label ของเพื่อนบ้านออก แล้วแปะอันใหม่ของตัวเองเข้าไป
    • Remove/Pop ถอด Label ออกให้กลายเป็น Packet ธรรมดา ออกไปนอกเครือข่าย MPLS
    Push/Pop จะกระทำบน Edge LSR
cool.gif
 

seanmine

New member
สมมติถ้าได้ CCIP เเล้ว Provider จะอยากได้ตัวเรามากขึ้นปะคับ
 

PlAwAnSaI

Administrator
  • ยังสามารถใช้ Protocol อื่นในการแลกเปลี่ยน Label ได้อีก เช่น BGP สำหรับ MPLS Layer 3 VPN, Kompella สำหรับ MPLS Layer 2 VPN, RSVP สำหรับ MPLS TE, PIM สำหรับ Multicast IP Routing
  • Enabling MPLS:
    ip cef
    mpls label protocol ldp
    interface
    fa0/0
    mpls ip

    show mpls interface
    show mpls ldp discovery
    show mpls ldp bindings
    show mpls forwarding

  • Hiding the core routers from the customer side:
    no tag-switching ip propagate-ttl
MPLS TE (Traffic Engineering) คือการใช้งาน Link ที่มีอยู่ให้คุ้มค่า หรือการแชร์ Traffic ไปตาม Link ต่างๆ ไม่มาเต็มอยู่เส้นเดียว เป็นหนึ่งในการแก้ไขปัญหาความแออัดของ Link มีทั้งแบบ L2VPN และ L3VPN ผมจะพูดถึง L2VPN นะคับ การสร้างมีอยู่สองแบบ
- แบบที่ admin กำหนดเอง (Explicitly) มีวิธีทำดังนี้
+ Enable IP CEF switching (config)#ip cef
+ Enable MPLS TE tunnel ต้องทำบนอุปกรณ์ทุก
ตัวที่มี Traffic ผ่าน (config)#mpls traffic-eng tunnels
+ Enable ใน Routing ต้องทำบนอุปกรณ์ทุกตัวเช่นกัน
* IS-IS
(config-router)#mpls traffic-eng {level-1|level-2}
(config-router)#mpls traffic-eng router-id {interface}

* OSPF
(config-router)#mpls traffic-eng area [area-num]
(config-router)#mpls traffic-eng router-id [interface]

+ Enable ใน Interface ต้องทำบนทุก Interface ที่มี Traffic ผ่าน
(config-if)#mpls traffic-eng tunnels
(config-if)#ip rsvp bandwidth [interface-kbps [single-flow-kbps]]

+ สร้างเส้นทาง
(config)#ip explicit-path {name [word]|identifier [number]} [{enable|disable}]
(cfg-ip-expl-path)#next-address [ip-address]

+ สร้าง Tunnel
(config)#interface tunnel [number]
(config-if)#ip unnumbered [type number]
(config-if)#tunnel destination [ip-address]
(config-if)#tunnel mode mpls traffic-eng
(config-if)#tunnel mpls traffic-eng path-option [number] {dynamic|explicit {name [path-name]|[path-number]}} [lockdown]

+ สร้าง pw-class
pseudowire-class xxx
encapsulation mpls
preferred-path interface Tunnelxxx [disable-fallback(เวลา tunnel down ให้ xconnect down ด้วย ไม่วิ่ง IGP กัน traffic เต็ม)]

+ mpls traffic-eng reoptimize tunnel 800
 

PlAwAnSaI

Administrator
ถ้าได้ CCIP มาแบบไม่ท่องไปสอบ มีส่วนแน่นอนคับ

Share your MPLS Experience
www.iptut.com/spcore-642-887/share-your-spcore-experience#comments

MPLS Traffic Engineering (TE) on IOS XR Configuration:

  • Enabling MPLS TE on a Node:
    mpls traffic-eng
    rsvp

  • Enabling MPLS TE on an Interface:
    mpls traffic-eng
    interface POS0/3/0/0
  • Defining a TE Tunnel Interface:
    interface tunnel-te0
    ipv4 unnumbered Loopback0
    destination
    172.16.255.5
    path-option 10 dynamic
  • Link Information Distribution:
    router isis DEFAULT
    address-family ipv4 unicast
    mpls traffic-eng level
    2
    mpls traffic-eng router-id Loopback0
  • Configuring Link Attributes:
    rsvp
    interface POS0/3/0/0
  • show mpls interfaces
    show mpls ldp neighbor
    show mpls ldp neighbor brief
    show rsvp interface
    show mpls traffic-eng topology brief
    show rsvp session

    show mpls traffic-eng link-management advertisements
    show mpls traffic-eng topology

  • สร้างเส้นทาง:
    explicit-path name [name]

    index 1 next-address strict ipv4 unicast [ip-address]

    index 2 next-address strict ipv4 unicast [ip-address]

  • สร้าง pw-class:
    pseudowire-class xxx

    encapsulation mpls

    preferred-path interface Tunnelxxx [disable-fallback(เวลา tunnel down ให้ xconnect down ด้วย ไม่วิ่ง IGP กัน traffic เต็ม)]
  • www.skillshare.com/classes/technology/MPLS-Fundamentals-Cisco-CCNP-Real-World/227448853
MPLS L2VPN Frame:

l2vpn.png

Traffic Engineering (TE)—Fast Reroute (FRR) Link Protection:

  • explicit-path name NO_MAIN
    index 1 exclude-address ipv4 unicast

  • interface tunnel-te43001
    description FRR link 1
    ipv4 unnumbered Loopback0
    priority
    4 4
    destination 10.x.47.1
    record-route
    path-option 10 explicit name NO_MAIN
  • mpls traffic-eng
    interface
    *
    backup-path tunnel-te 43001
  • show mpls traffic-eng fast-reroute database
    show mpls traffic-eng tunnels protection
 
Top