MikroTik Multicast Routing []

25
MikroTik IPv4 Multicast Routing for Video Streaming Application Training for Trainers – Venice 2014 Faisal Reza. 2014 | [email protected]

Transcript of MikroTik Multicast Routing []

Page 1: MikroTik Multicast Routing []

MikroTik IPv4 Multicast Routing for

Video Streaming Application

Training for Trainers – Venice 2014

Faisal Reza. 2014 | [email protected]

Page 2: MikroTik Multicast Routing []

Update : Video Demo

- multicast routing 1 routerhttps://www.youtube.com/watch?v=nqUlUIB93Mg

- video multicast routing 2 router over wirelesshttps://www.youtube.com/watch?v=eYEocGYsGZ4

- VLC as multicast stream server https://www.youtube.com/watch?v=Z1lthcBSSrM

- VLC as multicast playerhttps://www.youtube.com/watch?v=s2uTs8NRQpY

Page 3: MikroTik Multicast Routing []

About me :

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Introduction

Faisal Reza. 2014 | [email protected]

Page 4: MikroTik Multicast Routing []

Objectives

• Introduction

• Multicast Concept

• Configuration Example

• Lab Task

• Conclusion

Faisal Reza. 2014 | [email protected]

Page 5: MikroTik Multicast Routing []

Company A is an ISP that want to expand their services to deliver Video Broadcast in existing MikroTik IP Networks.

To conserve bandwidth that flow on the network, you as a consultant recommended them to choose Multicast as tehcnique to deliver the traffic.

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Situation

Faisal Reza. 2014 | [email protected]

Page 6: MikroTik Multicast Routing []

IP Multicast is a technology that allows one-to-many and many-to-many distribution of data on the Internet.

Senders send their data to a multicast IP destination address, and receives express an interest in receiving traffic destined for such an address. The network then figures out how to get the data from senders to receivers.

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Why Multicast?

Faisal Reza. 2014 | [email protected]

Page 7: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

MULTICAST VS UNICAST

Faisal Reza. 2014 | [email protected]

Page 8: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

PROTOCOL INDEPENDENT MULTICAST

Protocol-Independent Multicast (PIM) is a family of multicast routing protocols for Internet Protocol (IP) networks that provide one-to-many and many-to-many distribution of data over a LAN, WAN or the Internet. It is termed protocol-independent because PIM does not include its own topology discovery mechanism, but instead uses routing information supplied by other routing protocols.

Faisal Reza. 2014 | [email protected]

Page 9: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

There are four variants of PIM:

• PIM Sparse Mode (PIM-SM) explicitly builds unidirectional shared trees rooted at a rendezvous point (RP) per group, and optionally creates shortest-path trees per source. PIM-SM generally scales fairly well for wide-area usage.

• PIM Dense Mode (PIM-DM) uses dense multicast routing. It implicitly builds shortest-path trees by flooding multicast traffic domain wide, and then pruning back branches of the tree where no receivers are present. PIM-DM is straightforward to implement but generally has poor scaling properties. The first multicast routing protocol, DVMRP used dense-mode multicast routing.

• Bidirectional PIM explicitly builds shared bi-directional trees. It never builds a shortest path tree, so may have longer end-to-end delays than PIM-SM, but scales well because it needs no source-specific state

• PIM Source-Specific Multicast (PIM-SSM) builds trees that are rooted in just one source, offering a more secure and scalable model for a limited amount of applications (mostly broadcasting of content).

Faisal Reza. 2014 | [email protected]

Page 10: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Multicast Addressing

For IPv4, 224.0.0.0 to 239.255.255.255.

Addresses within 232.0.0.0/8 are reserved for SSM usage.

Addresses in 239.0.0.0/8 are ASM (Any-source Multicast) addresses defined for varying sizes of limited scope.

Addresses within 224.0.0.0/24 are considered link-local and are forwarded between subnets.

IANA addressing for multicast :

• 224.0.0.1 - All systems on the subnet

• 224.0.0.2 - All routers on the subnet

• 224.0.0.9 - For RIPv2

• 224.0.0.14 - For VRRP

• 224.0.1.1 - Network time protocol (NTP)

• The internet assigned numbers authority (IANA) allocates ethernet addresses from 01:00:5E:00:00:00 through 01:00:5E:7F:FF:FF for multicasting, therefore leaving only 23 bits available for the multicast group ID.

Faisal Reza. 2014 | [email protected]

Page 11: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

IGMP Proxy

Internet Group Management Protocol (IGMP) proxy can be used to implement multicast routing. It is forwarding IGMP frames and commonly is used when there is no need for more advanced protocol like PIM.

IGMP proxy features:

• The simplest way how to do multicast routing;

• Can be used in topologies where PIM-SM is not suitable for some reason;

• Takes slightly less resources than PIM-SM;

• Ease of configuration.

• On the other hand, IGMP proxy is not well suited for complicated multicast routing setups. Compared to PIM based solutions, IGMP proxy does not support more than one upstream interface and routing loops are not detected or avoided.

• MikroTik RouterOS IGMP proxy supports IGMP version 2 (RFC 2236).

Faisal Reza. 2014 | [email protected]

Page 12: MikroTik Multicast Routing []

#1: Enable Multicast on RouterOS

Multicast package is not installed by default

Step to install multicast :

1. Go to www.mikrotik.com/download

2. Choose your RouterOS architecture

3. Download the All Packages (zip file)

4. Extract it and copy multicast.npk to RouterOS File

Use only multicast packages with same version with your existing routeros

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 1| Conclusion

Faisal Reza. 2014 | [email protected]

Page 13: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 1 | Conclusion

#2 : Copy multicast package to File List

Use multicast package with the same version check using /system resources. Then reboot your router to finished packages installation

Faisal Reza. 2014 | [email protected]

Page 14: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 1| Conclusion

#3: Multicast Installed

IGMP Proxy and PIM wil appear in Routing Menu

Faisal Reza. 2014 | [email protected]

Page 15: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Multicast single router

R1 : /routing pim interfaceadd interface=ether3add interface=ether4

STATIC ROUTE on Multicast Sender :>route add 224.3.2.1 mask 255.255.255.255 192.168.3.254>route add 239.3.2.1 mask 255.255.255.255 192.168.3.254

VLC Open Network Stream :rtp://@224.3.2.1:5005rtp://@239.3.2.1:5004

Faisal Reza. 2014 | [email protected]

R1/ip address add address=192.168.3.254 interface=ether3/ip address add address=192.168.4.254 interface=ether4

Page 16: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

[admin@R1-T4T-FREZA] > routing pim interface print Flags: X - disabled, I - inactive, D - dynamic, R - designated-router , v1 - IGMPv1, v2 - IGMPv2, v3 - IGMPv3 # INTERFACE PROTOCOLS 0 Rv2 ether3 pim igmp 1 Rv2 ether4 pim igmp 2 DR register pim

[admin@R1-T4T-FREZA] > routing pim igmp-group print Flags: v1 - IGMPv1, v2 - IGMPv2, v3 - IGMPv3, I - include, E - exclude, F - forward, D - don't forward

INTERFACE GROUP SOURCE TIMEOUT v2E ether3 224.0.0.2 0.0.0.0 2m30s v2E ether3 224.0.0.13 0.0.0.0 2m31s v2E ether3 224.0.0.22 0.0.0.0 2m30s v2E ether3 239.255.255.250 0.0.0.0 2m24s v2E ether4 224.0.0.2 0.0.0.0 2m36s v2E ether4 224.0.0.13 0.0.0.0 2m36s v2E ether4 224.0.0.22 0.0.0.0 2m35s v2E ether4 224.3.2.1 0.0.0.0 2m33s v2E ether4 239.3.2.1 0.0.0.0 2m30s v2E ether4 239.255.255.250 0.0.0.0 2m37s

PIM Status

Faisal Reza. 2014 | [email protected]

Page 17: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

PIM Status

Faisal Reza. 2014 | [email protected]

Page 18: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Rendevous Point

Rendezvous point (RP) is a distribution point for multicast group, source provides its data to it, and if there are any subscribers, then RP will provide data to client. Note, that RP will always receive data stream if that exists.

MRIB routes are used for reverse path forwarding check. In a way, they perform opposite function that FIB (Forwarding Information Base) routes: FIB is used to find the right By default, MRIB is populated by FIB routes. Use "multicast" routing filter chain to control that or set specific parameters for imported FIB routes (e.g. you can change the distance of the route). In addition, you can specify static MRIB routes.

This is useful only if you are using multihoming and multicast packet flow will be different from unicast packet flow.

Active MRIB entries that are imported from FIB are shown with "dynamic" flag.

MRIB

Faisal Reza. 2014 | [email protected]

Page 19: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 2 | Conclusion

Multicast Routing across Router (Wifi)

R1/routing pim interface add/routing pim rpadd address=192.168.6.254

STATIC route on Multicast sender :route add 192.168.6.0/24 mask 255.255.255.0 192.168.1.254route add 192.168.2.0/24 mask 255.255.255.0 192.168.1.254route add 224.3.1.1 mask 255.255.255.255 192.168.1.254route add 239.3.2.1 mask 255.255.255.255 192.168.1.254

R2/routing pim interfaceadd/routing pim rpadd address=192.168.6.254

VLC Stream Config ::sout=#rtp{dst=224.3.2.1,port=5005,mux=ts} :sout-all :sout-keep:sout=#rtp{dst=239.3.2.1,port=5004,mux=ts} :sout-all :sout-keep

VLC Open Network Stream :rtp://@224.3.2.1:5005rtp://@239.3.2.1:5004

Faisal Reza. 2014 | [email protected]

Page 20: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 2 | Conclusion

Wifi AP Configuration

/interface wireless security-profilesset [ find default=yes ] supplicant-identity=MikroTikadd authentication-types=wpa-psk,wpa2-psk eap-methods="" man

allowed mode=dynamic-keys name=profile1 supplicant-identwpa-pre-shared-key=mikrotik1234 wpa2-pre-shared-key=mikrotik

/interface wirelessset [ find default-name=wlan1 ] band=2ghz-b/g/n comment="RENDEVOUS POINT”

country=indonesia disabled=no frequency=2452 frequency-mregulatory-domain ht-rxchains=0 ht-txchains=0 l2mtu=2290multicast-helper=full name=wlan1-rp radio-name=951G-FREZsecurity-profile=profile1 ssid=FREZA-T4T wireless-protocwmm-support=enabled

/interface wireless manual-tx-power-tableset wlan1-rp comment="RENDEVOUS POINT"/interface wireless nstremeset wlan1-rp comment="RENDEVOUS POINT"

IMPORTANT!enable multicast helper = full

Faisal Reza. 2014 | [email protected]

Page 21: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 2 | Conclusion

R1 PIM STATUS

Faisal Reza. 2014 | [email protected]

Page 22: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 2 | Conclusion

R1 PIM STATUS (2)

Faisal Reza. 2014 | [email protected]

Page 23: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task : Lab 2 | Conclusion

R1 PIM STATUS (3)

Faisal Reza. 2014 | [email protected]

Page 24: MikroTik Multicast Routing []

http://wiki.mikrotik.com/wiki/Manual:Routing/Multicast#Rendezvous_point

http://wiki.mikrotik.com/wiki/Manual:Multicast_detailed_example

http://forum.mikrotik.com/viewtopic.php?f=14&t=34851

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Further Readings

Faisal Reza. 2014 | [email protected]

Page 25: MikroTik Multicast Routing []

Introduction | Multicast Concept | Configuration Example | Lab Task | Conclusion

Thank You

Faisal Reza. 2014. MikroTik Training for Trainers, Venice – Italy.

Faisal Reza. 2014 | [email protected]