Is it possible to change the decoding priority when ports conflict?

asked Dec 25 '25

When parsing 4G and 5G packets, lots of 5G http2 messages will be sent from NF consumer. Normally such NF consumer will have a port scale as client, not only for http2 in 5G but also for like diameter in 4G.

For example, NF consumer client port scale is 60001~61000. As majority of such messages in 5G are http2, so we configured protocol http2 in Wireshark with port scale 60001~65535 for tcp, diameter port scale is 3867~3869 for tcp. When a packet source port is 60001, destination port is 3868, this shall be a diameter message. But wireshark will decode it as http2(though it will be displayed as tcp packet) other than diameter. So every time when we need analyze diameter packets we have to remove the configured tcp port scale from http2; while in analyzing http2 packets we need add them back.

Is it possible to make the diameter decoding prioritized over http2, so that when a packet matches port scale of both http2 and diameter, it will be decoded as diameter message. Or make it configurable on which is prioritized, diameter or http2.

Thanks!

Comments

You mention "port scale" several times, do you mean "port range"?

User 98587 ( Dec 25 '25 )

Can you update the question with the output of wireshark -v.

Are you running a current version of Wireshark?
Does your capture include the TCP handshake?
18044: TCP: Don't use client port for dissector selection

Related discussions:
19637: Decoding errors with TCP carrying SIP when source port is 2152 and destination port is 5060
9469: Patch: set dissector for a specific source+dest port combination

User 2763 ( Dec 26 '25 )

Hi, thanks for the comments.

(1) You mention "port scale" several times, do you mean "port range"? [Roger] Yes, I mean port range.

(2) Can you update the question with the output of wireshark -v.

c:\Program Files\Wireshark>"Wireshark.exe" -v

c:\Program Files\Wireshark>

Wireshark 4.6.2 (v4.6.2-0-g24d5e2b5a3dc).

Copyright 1998-2025 Gerald Combs <[email protected]> and contributors.
Licensed under the terms of the GNU General Public License (version 2 or later).
This is free software; see the file named COPYING in the distribution. There is
NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compile-time info:
 Bit width: 64-bit
  Compiler: Microsoft Visual Studio 2022 (VC++ 14.44, build 35221)
      GLib: 2.84.2
 With:
  +automatic updates          +nghttp2 1.65.0
  +brotli                     +nghttp3 1.8.0
  +Gcrypt 1.11.2-unknown      +PCRE2 10.45 2025-02-05
  +GnuTLS 3.8.11 and PKCS#11  +Qt 6.9.3
  +Kerberos (MIT)             +QtMultimedia
  +libpcap                    +Snappy 1.1.9
  +libsmi 0.5.0               +WinSparkle 0.8.0
  +libxml2 2.13.8             +xxhash 0.8.3
  +Lua 5.4.6 (UfW patched)    +zlib 1.3.1
  +LZ4 1.10.0                 +zlib-ng 2.2.3
  +MaxMind                    +Zstandard 1.5.7
  +Minizip-ng 4.0.9

Runtime info:
      OS: 64-bit Windows 11 (24H2), build 26100
     CPU: AMD Ryzen 5 PRO 7540U w/ Radeon 740M Graphics (with SSE4.2)
  Memory: 31401 MB of physical memory
    GLib: 2.84.2
  Locale: LC_TYPE=English_United States.utf8
 Plugins: supported, 0 loaded
 With:
  +brotli 1.2.0                +nghttp3 1.8.0
  +c-ares 1.34.5               +Npcap 1.83, libpcap 1.10.5
  +Gcrypt 1.11.2-unknown       +PCRE2 10.45 2025-02-05
  +GnuTLS 3.8.11               +Qt 6.9.3
  +LZ4 1.10.0                  +xxhash 803
  +nghttp2 1.65.0              +Zstandard 1.5.7
User 56210 ( Dec 27 '25 )

(3) Are you running a current version of Wireshark? (4) Does your capture include the TCP handshake?

User 56210 ( Dec 27 '25 )

Thanks - that is the current release version.
Is the TCP handshake captured?

User 2763 ( Dec 27 '25 )

Is it not possible to configure with the expected server source port? The current version of Wireshark prefers using the server port to determine which dissector to call (previously in the case of two possibilities both configured vis Decode As it would use the lower port number.)

User 82682 ( Dec 28 '25 )

Hi,

Sorry that I may misguide you here. I think I know what you mean. The port range 60001~61000 is used not only for client ports on NF consumer, but also for server ports though they are temporary as server ports. Let me explain the particularity of 3GPP 5G sessions. This port range is a kind of resource for this NF consumer. So either client ports or temporary server ports will use in this range. For example, NF consumer will randomly allocate one available port, like 60001 as client port to establish tcp connection to server fixed port, maybe 8080. And at the same time, it will tell the server "I" will listen on 60002 for the notification for this 5G session. There will be many http2/tcp connections established for one 5G session because there will be many servers needed. When this 5G session is down, then the sockets it used will be torn down. So for each port in this port range, some times it will be client port, sometimes it will server port, for http2.

Normally we won't have tcp handshake packets in the pcap file. One reason is the pcap file captured is for one or multiple 5G session(s), but many tcp connections are already established when the NF consumer is launched. The other reason is if we capture packets for one 5G session to do debug, it's done internally in applications. Or else on external switches or tcpdump on computes, you don't know which packets belongs to this 5G session and the number of 5G packets are huge. While in applications, there is no tcp handshake.

So wireshark may not recognize who is server or client.

User 56210 ( Dec 29 '25 )