Skip to content

Commit 4118654

Browse files
authored
Merge pull request #221286 from James-Green-Microsoft/packet-capture
Packet capture
2 parents a0bfa9e + 5ca93b8 commit 4118654

File tree

3 files changed

+74
-2
lines changed

3 files changed

+74
-2
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Perform data plane packet capture for a packet core instance
3+
titleSuffix: Azure Private 5G Core Preview
4+
description: In this how-to guide, you'll learn how to perform data plane packet capture for a packet core instance.
5+
author: James-Green-Microsoft
6+
ms.author: jamesgreen
7+
ms.service: private-5g-core
8+
ms.topic: conceptual
9+
ms.date: 12/13/2022
10+
ms.custom: template-how-to
11+
---
12+
13+
# Perform data plane packet capture for a packet core instance
14+
15+
Packet capture for data plane packets is performed using the **UPF Trace (UPFT)** tool. UPFT is similar to **tcpdump**, a data-network packet analyzer computer program that runs on a command line interface. You can use this tool to monitor and record packets on any user plane interface on the access network or data network on your device.
16+
17+
Data plane packet capture works by mirroring packets to a Linux kernel interface, which can then be monitored using tcpdump. In this how-to guide, you'll learn how to perform data plane packet capture for a packet core instance.
18+
19+
> [!IMPORTANT]
20+
> Performing packet capture will reduce the performance of your system and the throughput of your data plane. It is therefore only recommended to use this tool at low scale during initial testing.
21+
22+
## Prerequisites
23+
24+
- Identify the **Kubernetes - Azure Arc** resource representing the Azure Arc-enabled Kubernetes cluster on which your packet core instance is running.
25+
- Ensure you have [Contributor](../role-based-access-control/built-in-roles.md#contributor) role assignment on the Azure subscription containing the **Kubernetes - Azure Arc** resource.
26+
- Ensure your local machine has core kubectl access to the Azure Arc-enabled Kubernetes cluster. This requires a core kubeconfig file. <!-- TODO: See <link> for instructions on how to obtain this. -->
27+
28+
## Performing packet capture
29+
30+
1. In a command line with kubectl access to the Azure Arc-enabled Kubernetes cluster, enter the UPF-PP troubleshooter pod:
31+
32+
`kubectl exec -it -n core core-upf-pp-0 -c troubleshooter -- bash`.
33+
34+
1. View the list of interfaces that can be monitored:
35+
36+
`upft list`.
37+
38+
1. Either:
39+
- Run `upftdump` with any parameters that you would usually pass to tcpdump. In particular, `-i` to specify the interface, and `-w` to specify where to write to. Close the UPFT tool when done by pressing <kbd>Ctrl + C</kbd>.
40+
- Or if you wish to enable packet capture and run tcpdump separately:
41+
1. Enable packet capture by running `upft start <interface> <duration>`, where
42+
- \<interface\> specifies the interface or interfaces to enable capture on. You can specify `any` to enable packet capture on all possible interfaces.
43+
- \<duration\> specifies the time in seconds before packet capture automatically disables.
44+
1. Type *yes* when prompted and then press <kbd>Enter</kbd> to continue.
45+
1. Run `tcpdump` on the interface.
46+
1. Once complete, run `upft stop <interface>` to disable packet capture if the timer has not expired.
47+
1. Leave the container:
48+
49+
`exit`
50+
51+
1. Copy the output files:
52+
53+
`kubectl cp -n core core-upf-pp-0: <path to output file> <location to copy to> -c troubleshooter`.
54+
55+
The `tcpdump` may have been stopped in the middle of writing a packet, which can cause this step to produce an error stating `unexpected EOF`. However, your file should have copied successfully, but you can check your target output file to confirm.
56+
57+
1. Remove the output files:
58+
59+
`kubectl exec -it -n core core-upf-pp-0 -c troubleshooter – bash rm`
60+
61+
## Next steps
62+
63+
For more options to monitor your deployment and view analytics:
64+
65+
- [Learn more about enabling log analytics Azure Private 5G Core](enable-log-analytics-for-private-5g-core.md)
66+
- [Learn more about monitoring Azure Private 5G Core using Log Analytics](monitor-private-5g-core-with-log-analytics.md)

articles/private-5g-core/index.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,13 @@ landingContent:
130130
- text: Enable Log Analytics for Azure Private 5G Core
131131
url: enable-log-analytics-for-private-5g-core.md
132132
- text: Create an overview Log Analytics dashboard
133-
url: create-overview-dashboard.md
133+
url: create-overview-dashboard.md
134+
- text: Perform data plane packet capture for a packet core instance
135+
url: data-plane-packet-capture.md
134136
- text: Enable Azure Active Directory
135137
url: enable-azure-active-directory.md
136138
- text: Modify a site's local access configuration
137-
url: modify-local-access-configuration.md
139+
url: modify-local-access-configuration.md
138140
- text: Export, upload and share traces for diagnostics
139141
url: distributed-tracing-share-traces.md
140142
- text: Gather diagnostics

articles/private-5g-core/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ items:
118118
href: enable-log-analytics-for-private-5g-core.md
119119
- name: Create an overview Log Analytics dashboard - ARM template
120120
href: create-overview-dashboard.md
121+
- name: Packet capture
122+
items:
123+
- name: Perform data plane packet capture for a packet core instance
124+
href: data-plane-packet-capture.md
121125
- name: Local monitoring tools
122126
items:
123127
- name: Enable Azure Active Directory

0 commit comments

Comments
 (0)