共用方式為


如何收集資料以診斷 NCSI 問題

針對 NCSI (網路連線狀態指示器) 問題進行疑難排解,但當與封包流量相關時,NCSI 事件記錄檔也可能是一個有用的工具。 本指南旨在幫助使用者如何在常見的案例中診斷 NCSI 問題。

使用 [事件檢視器] 檢視 NCSI 資料

  1. 若要開啟 [事件檢視器],請以滑鼠右鍵按一下 [開始]>[事件檢視器]
    或者,按下 Win+R 並輸入 eventviewer.exe,以開啟 [執行] 提示字元。 Screenshot of the Start button context menu with Event Viewer highlighted.

  2. 展開 [應用程式及服務記錄檔]>[Microsoft]>[Windows]>[NCSI]Screenshot of the Event Viewer with expanded Applications and Service Logs, Microsoft, Windows, and NCSI highlighted.

  3. 以滑鼠右鍵按一下 [NCSI],選取 [檢視]>[顯示分析與偵錯記錄檔]Screenshot of the Event Viewer with NCSI highlighted with Show Analytic and Debug Logs enabled.

  4. 以滑鼠右鍵按一下 [NCSI] 資料夾下的 [Analytic],選取 [啟用記錄檔]
    即會出現一個對話方塊告知您說:啟用記錄時,您可能會遺失分析與偵錯記錄檔事件。 選取 [確定] 繼續。Screenshot of the Event Viewer with the NCSI Analytic event logging enabled.

使用 [事件檢視器] 擷取 NCSI 資料

執行上述動作有助於資料擷取。 為了更容易分析,請將產生的記錄檔轉換成文字格式。 在 [事件檢視器] 中,請遵循下列步驟執行:

  1. 展開 [應用程式及服務記錄檔]>[Microsoft]>[Windows]>[NCSI]

  2. 以滑鼠右鍵按一下 [Analytic],選取 [將所有事件另存為]Screenshot of the Event Viewer with the NCSI Analytic event with save all events being enabled.

  3. [另存新檔] 對話方塊隨即開啟。 將 [存檔類型] 設為 text (*.txt),為您的檔案命名,然後選取您的位置。 選取 [儲存]。 Screenshot of the save as dialog window with NCSI logs being saved to the documents folder.

以下是成功的連線輸出範例:

Information    4/26/2023 12:17:46 PM    Microsoft-Windows-NCSI    4013    Internet Connectivity Detection    Active Internet Probe started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information    4/26/2023 12:17:46 PM    Microsoft-Windows-NCSI    4017    Internet Connectivity Detection    Active Internet Probe (HTTP) started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information    4/26/2023 12:17:48 PM    Microsoft-Windows-NCSI    4005    Wait for Internet Connectivity     Entered State: Internet Connectivity Interface Luid: 0x6008001000000
Information    4/26/2023 12:18:07 PM    Microsoft-Windows-NCSI    4018    Internet Connectivity Detection    Active Internet Probe (HTTP) finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information    4/26/2023 12:18:07 PM    Microsoft-Windows-NCSI    4014    Internet Connectivity Detection    Active Internet Probe finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d} (false)

以下是失敗的連線輸出範例:

Information    4/26/2023 12:01:02 PM    Microsoft-Windows-NCSI    4013    Internet Connectivity Detection    Active Internet Probe started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information    4/26/2023 12:01:02 PM    Microsoft-Windows-NCSI    4017    Internet Connectivity Detection    Active Internet Probe (HTTP) started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information    4/26/2023 12:01:04 PM    Microsoft-Windows-NCSI    4005    Wait for Internet Connectivity     Entered State: Local Connectivity Interface Luid: 0x6008001000000
Information    4/26/2023 12:03:23 PM    Microsoft-Windows-NCSI    4018    Internet Connectivity Detection    Active Internet Probe (HTTP) finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Warning        4/26/2023 12:03:23 PM    Microsoft-Windows-NCSI    4051    None                               Active probe result code on interface {611346db-8fbb-473d-808b-6c7573b3ef4d} (0x6008001000000 Family: V4) = 12007

AnalyticOperational NCSI 事件與封包擷取時間戳記相關聯,以確定主動探查是否已引發、是否完成以及失敗的原因。 若要深入瞭解 Winhttp 錯誤碼,請參閱錯誤訊息 (Winhttp.h)

如何重現問題的情境

您可以透過強制執行主動探查來排解問題,以查看它是否完成。 最簡單的方法是引發網路變更事件。 以下是在有線和無線連線上執行此動作的示範:

有線

  1. 中斷乙太網路纜線的連線。 (或者,您也可以在 [進階網路設定] 中停用該網路介面卡)。
  2. 使用封包擷取軟體 (例如 wireshark),並等候 30 秒來收集資料。
  3. 重新連接乙太網路纜線。 (或者,在 [進階網路設定] 中啟用該網路介面卡 (如果之前已停用的話))。
  4. 等候 60 秒,再停止擷取,以確保有足夠的時間來嘗試執行主動探測。

無線

  1. 在連線之前啟動封包擷取。
  2. 連接到無線網路。
  3. 等候 60 秒,以確保主動探查活動已完全發生。
  4. 停止網路擷取。

其他參考