Skip to content

Note

文件更新時間: 20230130

How To: Azure Public IP 選用指南

Microsoft Routing Preference 的 2 種類型

  • 熱馬鈴薯路由 (Hot-potato Routing):

    • Routing via the Internet with transit ISP network
    • 一般的 Public IP 都是 Hot-potato Routing,希望能越快的將封包傳遞給其他 AS 處理,減少留在自家的時間

  • 冷馬鈴薯路由 (Cold-potato Routing):

    • Routing via the premium Microsoft global network
    • 希望將封包留在自家網路久一點,可以減少封包在網路上的跳躍次數,減少延遲

Performance

官方提供數據如下

但現實是不一定,可以參考之前我錄製的影片 Latency Measurement of Azure Backbone Network投影片 - 20221220 Azure Public IP 路由偏好教戰手冊

Sample Code Block

Using Terraform

採用 Terraform 撰寫時,控制 Routing Preference 的選項是用 ip_tags 來表示,在預設沒做任何設定狀況下,RoutingPreference 會採用 Microsoft

pip-routing-preferences.tf
resource "azurerm_public_ip" "pip-msbb-centralus" {
  name                = "pip-msbb-centralus" # (1)
  location            = "centralus"
  resource_group_name = var.lab-rg
  allocation_method   = "Static"
  sku                 = "Standard"
  sku_tier            = "Regional"
  idle_timeout_in_minutes = 4
  zones               = ["1", "2", "3"]

  # ip_tags = {
  #   RoutingPreference  = "Microsoft" # (2)
  # }
}

resource "azurerm_public_ip" "pip-internet-centralus" {
  name                = "pip-internet-centralus"
  location            = "centralus"
  resource_group_name = var.lab-rg
  allocation_method   = "Static"
  sku                 = "Standard"
  sku_tier            = "Regional"
  idle_timeout_in_minutes = 4
  zones               = ["1", "2", "3"]
  ip_tags = {
    RoutingPreference  = "Internet"
  }
}
  1. MSBB: Microsoft BackBone
  2. DO NOT use ip_tags for RoutingPreference = "Microsoft", the setting is default
  3. Need to use ip_tags and set value Internet

檢測方式

My TraceRoute

command
mtr -z -b <Public IP>
output
rhel8-wsl$ mtr -z -b microsoft.com

rhel8 (172.29.1.64)
2023-01-30T18:38:25+0800
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                                                                  Packets               Pings
 Host                                                                           Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. AS???    _gateway (172.29.0.1)                                               0.0%     9    0.7   0.5   0.3   0.7   0.2
 2. AS???    192.168.100.254 (192.168.100.254)                                   0.0%     9    2.8   3.0   2.6   3.3   0.3
 3. AS3462   h254.s198.ts.hinet.net (168.95.198.254)                             0.0%     9   17.0  17.1  13.4  22.8   3.1
 4. AS3462   tpdb-3332.hinet.net (168.95.83.102)                                 0.0%     9   13.3  12.4  11.6  13.3   0.5
 5. AS???    220-128-1-30.hinet-ip.hinet.net (220.128.1.30)                      0.0%     9   11.5  12.3  11.0  15.3   1.4
 6. ???
 7. AS???    pcpd-4101.hinet.net (220.128.12.37)                                 0.0%     9   12.8  12.9  10.7  25.1   4.6
 8. AS???    pcpd-4001.hinet.net (220.128.6.137)                                 0.0%     9   12.1  12.7  11.5  15.1   1.3
 9. AS3491   63-218-56-101.static.pccwglobal.net (63.218.56.101)                 0.0%     9   35.2  34.3  33.7  35.2   0.5
1.  AS3491   BE42.br04.hkg12.pccwbtn.net (63.218.174.134)                        0.0%     9   34.0  34.5  33.8  36.4   0.8
2.  AS3491   63-216-176-146.static.pccwglobal.net (63.216.176.146)               0.0%     9   29.7  30.4  28.8  32.4   1.2
3.  AS8075   ae26-0.icr02.hkg20.ntwk.msn.net (104.44.236.221)                    0.0%     9   38.3  32.2  28.8  40.7   4.2
4.  AS8075   be-102-0.ibr01.hkg20.ntwk.msn.net (104.44.11.131)                   0.0%     9  158.6 158.7 158.0 160.1   0.7
5.  AS8075   be-1-0.ibr01.hkg31.ntwk.msn.net (104.44.7.253)                      0.0%     9  158.4 158.4 157.9 159.2   0.4
6.  AS8075   be-11-0.ibr01.tyo79.ntwk.msn.net (104.44.17.134)                   11.1%     9  157.7 158.2 157.0 160.9   1.2
7.  AS8075   be-7-0.ibr01.pdx30.ntwk.msn.net (104.44.18.167)                     0.0%     9  157.8 158.6 157.1 164.8   2.4
8.  AS8075   be-2-0.ibr01.pdx31.ntwk.msn.net (104.44.7.101)                      0.0%     9  158.3 158.9 157.5 166.0   2.7
9.  AS8075   be-5-0.ibr01.mwh01.ntwk.msn.net (104.44.30.65)                     11.1%     9  158.1 158.5 158.1 159.1   0.3
10. AS8075   ae102-0.icr02.mwh01.ntwk.msn.net (104.44.21.142)                   11.1%     9  160.3 163.0 157.0 168.4   4.2
11. ???

Costs for Internet Egress

根據 Azure Bandwidth pricing,routed via Microsoft Premium Global Network 成本會大於 Routed via Routing preference transit ISP network

ASNs for Microsoft

  • ASN 12076

    • 透過 Azure ExpressRoute 連線的 ASN
  • ASN 8075

    • 預設狀況下,Microsoft 大多數對外服務的 ASN,例如 Windows Update、Office 365 等

References