You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/network-watcher/network-watcher-deep-packet-inspection.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: halkazwini
6
6
ms.author: halkazwini
7
7
ms.service: network-watcher
8
8
ms.topic: how-to
9
-
ms.date: 01/31/2024
9
+
ms.date: 02/07/2024
10
10
#CustomerIntent: As a network administrator, I want to inspect packets captured by Network Watcher to investigate network issues.
11
11
---
12
12
@@ -26,55 +26,55 @@ In this article, you learn how to open a packet capture file provided by Network
26
26
27
27
## Calculate network latency
28
28
29
-
In this scenario, we show how to view the initial Round Trip Time (RTT) of a Transmission Control Protocol (TCP) conversation occurring between two endpoints.
29
+
In this example, you learn how to view the initial Round Trip Time (RTT) of a Transmission Control Protocol (TCP) conversation between two endpoints.
30
30
31
-
When a TCP connection is established, the first three packets sent in the connection follow a pattern commonly referred to as the three-way handshake. By examining the first two packets sent in this handshake, an initial request from the client and a response from the server, we can calculate the latency when this connection was established. This latency is referred to as the Round Trip Time (RTT). For more information on the TCP protocol and the three-way handshake, see the following resource. [https://support.microsoft.com/en-us/help/172983/explanation-of-the-three-way-handshake-via-tcp-ip](https://support.microsoft.com/en-us/help/172983/explanation-of-the-three-way-handshake-via-tcp-ip)
31
+
When a TCP connection is established, the first three packets sent in the connection follow a pattern referred to as the three-way handshake. By examining the first two packets sent in this handshake, an initial request from the client and a response from the server, you can calculate the latency. This latency is referred to as the Round Trip Time (RTT). For more information on the TCP protocol and the three-way handshake, see [Explanation of thethree-wayhandshakevia TCP/IP](https://support.microsoft.com/en-us/help/172983/explanation-of-the-three-way-handshake-via-tcp-ip).
32
32
33
-
### Step 1
34
-
35
-
Launch WireShark
33
+
1. Launch WireShark.
36
34
37
-
### Step 2
35
+
1. Load the **.cap** file from your packet capture session.
38
36
39
-
Load the **.cap** file from your packet capture. This file can be found in the blob it was saved in our locally on the virtual machine, depending on how you configured it.
37
+
1. Select a [SYN] packet in your capture. This packet is the first packet sent by the client to initiate a TCP connection.
40
38
41
-
### Step 3
39
+
1. Right-click on the packet and select **Follow**, then select **TCP Stream**.
42
40
43
-
To view the initial Round Trip Time (RTT) in TCP conversations, we'll only be looking at the first two packets involved in the TCP handshake. We'll be using the first two packets in the three-way handshake, which are the [SYN], [SYN, ACK] packets. They're named for flags set in the TCP header. The last packet in the handshake, the [ACK] packet, won't be used in this scenario. The [SYN] packet is sent by the client. Once it's received, the server sends the [ACK]packet as an acknowledgment of receiving the SYN from the client. Leveraging the fact that the server’s response requires very little overhead, we calculate the RTT by subtracting the time the [SYN, ACK] packet was received by the client by the time [SYN] packet was sent by the client.
41
+
:::image type="content" source="./media/network-watcher-deep-packet-inspection/follow-tcp-stream.png" alt-text="Screenshot shows how to filter TCP stream packets in Wireshark." lightbox="./media/network-watcher-deep-packet-inspection/follow-tcp-stream.png":::
44
42
45
-
Using WireShark this value is calculated for us.
43
+
1. Expand the **Transmission Control Protocol** section of the [SYN] packet, and then the **Flags** section.
46
44
47
-
To more easily view the first two packets in the TCP three-way handshake, we'll utilize the filtering capability provided by WireShark.
45
+
1. Confirm that the **Syn** bit is set to 1, then right-click on it.
48
46
49
-
To apply the filter in WireShark, expand the “Transmission Control Protocol” Segment of a [SYN] packet in your capture and examine the flags set in the TCP header.
47
+
1. Select **Apply as Filter**, and then select **... and selected** to show the packets with **Syn** bit set to 1 within the TCP stream.
50
48
51
-
Since we're looking to filter on all [SYN] and [SYN, ACK] packets, under flags confirm that the Syn bit is set to 1, then right-select on the Syn bit -> Apply as Filter -> Selected.
49
+
The first two packets involved in the TCP handshake are the [SYN], [SYN, ACK] packets. You don't need the last packet in the handshake, which is the [ACK] packet. The [SYN] packet is sent by the client. Once it's received, the server sends the [ACK] packet as an acknowledgment of receiving the [SYN] from the client.
52
50
53
-
![figure 7][7]
51
+
:::image type="content" source="./media/network-watcher-deep-packet-inspection/syn-filter.png" alt-text="Screenshot shows how to apply a filter to see the [SYN] and and [SYN, ACK] packets in a TCP stream in Wireshark." lightbox="./media/network-watcher-deep-packet-inspection/syn-filter.png":::
54
52
55
-
### Step 4
53
+
1. Select the [SCK] packet.
56
54
57
-
Now that you've filtered the window to only see packets with the [SYN] bit set, you can easily select conversations you're interested in to view the initial RTT. A simple way to view the RTT in WireShark is to select the dropdown marked “SEQ/ACK” analysis. You'll then see the RTT displayed. In this case, the RTT was 0.0022114 seconds, or 2.211 ms.
55
+
1. Expand the **SEQ/ACK** section to see the iRTT in seconds.
58
56
59
-
![figure 8][8]
57
+
:::image type="content" source="./media/network-watcher-deep-packet-inspection/view-latency.png" alt-text="Screenshot shows how to see the latency represented as iRTT in seconds in Wireshark." lightbox="./media/network-watcher-deep-packet-inspection/view-latency.png":::
60
58
61
59
## Find unwanted protocols
62
60
63
-
You can have many applications running on a virtual machine instance you've deployed in Azure. Many of these applications communicate over the network, perhaps without your explicit permission. Using packet capture to store network communication, we can investigate how applications are talking on the network and look for any issues.
61
+
You can have many applications running on an Azure virtual machine. Many of these applications communicate over the network, sometimes without your explicit permission. Using packet capture to record network communication, you can investigate how applications communicate over the network, allowing you to identify and address any potential issues.
64
62
65
-
In this example, we review a previous ran packet capture for unwanted protocols that might indicate unauthorized communication from an application running on your machine.
63
+
In this example, you learn how to analyze a packet capture to find unwanted protocols that might indicate unauthorized communication from an application running on your virtual machine.
66
64
67
-
### Step 1
65
+
1. Launch WireShark.
66
+
67
+
1. Load the **.cap** file from your packet capture session.
68
68
69
-
Using the same capture in the previous scenario, select **Statistics** >**Protocol Hierarchy**.
69
+
1. Select **Statistics**, then select**Protocol Hierarchy**.
70
70
71
-
![protocol hierarchymenu][2]
71
+
:::image type="content" source="./media/network-watcher-deep-packet-inspection/protocol-hierarchy.png" alt-text="Screenshot shows how to get to Protocol Hierarchy from the Statistics menu in Wireshark." lightbox="./media/network-watcher-deep-packet-inspection/protocol-hierarchy.png":::
72
72
73
-
The protocol hierarchy window appears. This view provides a list of all the protocols that were in use during the capture session and the number of packets transmitted and received using the protocols. This view can be useful for finding unwanted network traffic on your virtual machines or network.
73
+
1. In the **Protocol Hierarchy Statistics** window, you can see a list of all the protocols that were in use during the capture session and the number of packets transmitted and received using each protocol. This view is useful for finding unwanted network traffic on your virtual machines or network.
74
74
75
-
![protocol hierarchy opened][3]
75
+
:::image type="content" source="./media/network-watcher-deep-packet-inspection/protocol-hierarchy-statistics.png" alt-text="Screenshot shows the Protocol Hierarchy Statistics window in Wireshark." lightbox="./media/network-watcher-deep-packet-inspection/protocol-hierarchy-statistics.png":::
76
76
77
-
As you can see in the following screen capture, there was traffic using the BitTorrent protocol, which is used for peer to peer file sharing. As an administratoryou don't expect to see BitTorrent traffic on this particular virtual machine. Now you aware of this traffic, you can remove the peer to peer software that installed on this virtual machine, or block the traffic using Network Security Groups or a Firewall. Additionally, you can elect to run packet captures on a schedule, so you can review the protocol use on your virtual machines regularly. For an example on how to automate network tasks in Azure, visit [Monitor network resources with Azure Automation](network-watcher-monitor-with-azure-automation.md).
77
+
In the example, you can see that there was traffic using the BitTorrent protocol, which is used for peer-to-peer file sharing. As an administrator, if you don't expect to see BitTorrent traffic on this particular virtual machine, then you can remove the peer-to-peer software that's installed on this virtual machine, or block the traffic using a network security group or a firewall.
0 commit comments