UCPrimer
  • UCprimer
  • About

Enabling Media Bypass for Teams Direct Routing

11/30/2019

2 Comments

 
Picture
In the previous blog post a Ribbon SBC1000 was configured for Teams Direct Routing using SIP Trunk from Masergy and tests calls made using the new Poly CCX Native Teams phones. That setup was configured with the default non media-bypass where media always flowed between the SBC and Microsoft Office365 Teams media processors or relays. As a follow up to that, this blog posts walks through the configuration of media bypass in the same lab setup, allowing media to flow directly between the Teams phones and the SBC, thereby simplifying the media flow allowing for potentially better call quality. Since it is fairly straightforward to configure media bypass, this post also provides wireshark packet capture on the SBC to show the media flow between non media-bypass and media-bypass calls
The mechanics of Teams Direct Routing media bypss is already well explained in the Microsoft documentation here and there's no need to dive into the details in this post. Just to summarize, when in non media-bypass, both signaling and media traffic will flow between the SBC and the Microsoft Phone System as shown below:
Picture
With media bypass enabled, signalling will still flow between the SBC and Microsoft Phone System but media will be able to flow directly between the Teams phones and the SBC, thereby eliminating the hop out to the internet as shown below:
Picture
Before going into the configuration and network packet captures, its worth calling out a few important points as mentioned in the Microsoft Docs. These include
  • Media bypass leverages protocols called Interactive Connectivity Establishment (ICE) on the Teams client and ICE Lite on the SBC. Hence we need to enable ICE Lite on our Ribbon SBC1000 which was possible from verion 8.0.2 of the SBC firwmare
  • For internal networks, the Teams client must be able to access the public IP of the SBC from the internal network to leverage media bypass. This is the recommended solution when a user is in the same network as the SBC.
  • For external networks, the Teams client can either access the SBC public IP directly for media bypass, otherwise if it cannot then the client will communicate to SBC via Transport Relays. For media optimization purposes, Microsoft recommends only allowing transport relays to access the SBC public IP. However just for testing purposes to show the media bypass flows, we will allow the Teams phones to reach the public IP of the SB in our setup.
  • Media Processors are always in the path for end user non-bypassed calls, but never in the path for bypassed calls. Media Processors are always in the path for all voice applications such as Call Park, Organizational Auto Attendant, and Call Queues

To begin configuring for media bypass, we first make sure that ICE Lite is enabled on the SBC1000 Sigaling Group Table for the Teams Direct Routing connection as shown below:

Picture
For Media Bypass, the following firewall ports are required on the SBC1000:

Inbound Public (Internet to SBC):
  • Media for SBC 1000: UDP 17586-21186 (default)
  • Media for SBC 2000: UDP 19386-28386 (default)

Outbound Public (SBC to Internet):
  • Media: UDP 50000-50019
  • If the device that handles the NAT between the Teams Client and SBC Public IP is performing PAT (Port Address Translation), verify that this device has the source port range of the Teams Client media or open all the ports from 1024 to 65535.

Before enabling Media Bypass, lets first do a packet capture of the Teams phone making a call to PSTN without media bypass. As can be seen in the wireshark screenshot below, all media traffic is flowing between the Teams media processor and the SBC, and between the SBC and the SIP trunk. Hence the media traffic on the phone is always going to the O365 cloud:
Picture
To enable media bypass on our tenant Phone System we simply use the Skype online powershell and set the PSTN gateway to enable media bypass using the Set-CSOnlinePSTNGateway cmdlet as shown below. We'll want to wait a few minutes for the settings to take effect:
Picture
Now we are ready to leverage media bypass place calls from the Poly CCX Teams phone to PSTN and start packet captures on the SBC. Our phone is behind a firewall with NAT and thus the phone's IP as seen by SBC is the public NAT'ed IP. ​As can be seen in the wireshark screenshot below, all media traffic is now flowing directly between the phone and the SBC, and between the SBC and the SIP trunk. Hence the media traffic on the phone is no longer going via the O365 cloud:

Picture
As mentioned earlier, this direct media flow between the phone and the SBC is only possible because the phone can reach the public IP of the SBC. If we follow Microsoft's recommendation of only allowing Teams Transport Relays to communicate with the SBC, then the media from the phone will first reach the Transport relay before hitting the SBC. There should not be any noticeable delay as the transport relays are located in many geographical locations and the nearest available one will always be used for the media path.

In conclusion, media bypass enables Teams clients to shorten the path of media traffic and reduce the number of hops in transit for better performance. With media bypass, media is kept between the Session Border Controller (SBC) and the client instead of sending it via the Microsoft Phone System and this hopefully this blog posts serves as a reference on the configuration of SBC and also showing the actual network packet trace of both media-bypass and non media-bypass scenarios.
2 Comments
srinivas
9/25/2020 12:59:29 am

How to reach out to you ?

Reply
Ashley
11/26/2020 09:20:38 am

Does old Poly Trio 8800 support Local Media Optimization?

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    UCPrimer

    Picture
    Picture
    Picture
    View my profile on LinkedIn

    Important Links

    Microsoft Teams Docs
    Microsoft Learn

    ​Microsoft MVP Blogs

    Michael Tressler’s Blog
    Michael’s MTR Quick Tip Videos
    Jimmy Vaughan’s Blog
    Jeff Schertz
    Adam Jacobs
    James Cussen
    ​Damien Margaritis

    Archives

    March 2025
    February 2025
    January 2025
    December 2024
    November 2024
    October 2024
    August 2024
    July 2024
    May 2024
    April 2024
    March 2024
    February 2024
    December 2023
    November 2023
    October 2023
    September 2023
    July 2023
    March 2023
    February 2023
    January 2023
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    June 2021
    April 2021
    March 2021
    December 2020
    October 2020
    September 2020
    August 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    March 2019
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    August 2017
    July 2017
    April 2017
    March 2017
    February 2017
    January 2017
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    January 2016
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    September 2012
    August 2012

    Categories

    All
    Edge
    Exchange 2013
    Hybrid
    Lpe
    Lync 2010
    Lync 2013
    Mobility
    Oauth
    Office365
    Polycom
    Ucs

    RSS Feed

    This website uses marketing and tracking technologies. Opting out of this will opt you out of all cookies, except for those needed to run the website. Note that some products may not work as well without tracking cookies.

    Opt Out of Cookies