Core Tunnel



GPRS Tunnelling Protocol (GTP) is a group of IP-based communications protocols used to carry general packet radio service (GPRS) within GSM, UMTS and LTE networks. In 3GPP architectures, GTP and Proxy Mobile IPv6 based interfaces are specified on various interface points.

Overview Core Tunnel is a missing tunnel manager, compatible with OpenSSH, automatic and intuitive. Carpal tunnel syndrome is caused by pressure on the median nerve. The carpal tunnel is a narrow passageway surrounded by bones and ligaments on the palm side of your hand. When the median nerve is compressed, the symptoms can include numbness, tingling and weakness in the hand and arm. Core Tunnel was added to AlternativeTo by on Apr 16, 2014 and this page was last updated May 23, 2018. Core Tunnel is sometimes referred to as SSH Tunnel, Codinn SSH Tunnel. Features Vote on or suggest new features. Tunnel Rush is a fast-paced dodging game inspired by Slope and Run 3. You are moving in a tunnel full of color at a blazing speed and need to avoid obstacles in different shapes. You need to be very agile and precise to see the position of the incoming obstacle and quickly shift your position away to avoid it. Stay focused and break your record!

GTP can be decomposed into separate protocols, GTP-C, GTP-U and GTP'.

What does Core Tunnel do? The missing ssh tunnel manager, compatible with OpenSSH, automatic and intuitive. Don't waste your time; be productive. ## Features OpenSSH Compatible. Everything in OpenSSH, local / remote / dynamic port forwarding types, agent forwarding, certificates, proxy jump, etc.

GTP-C is used within the GPRS core network for signaling between gateway GPRS support nodes (GGSN) and serving GPRS support nodes (SGSN). This allows the SGSN to activate a session on a user's behalf (PDP context activation), to deactivate the same session, to adjust quality of service parameters, or to update a session for a subscriber who has just arrived from another SGSN.

GTP-U is used for carrying user data within the GPRS core network and between the radio access network and the core network. The user data transported can be packets in any of IPv4, IPv6, or PPP formats.

GTP' (GTP prime) uses the same message structure as GTP-C and GTP-U, but has an independent function. It can be used for carrying charging data from the charging data function (CDF) of the GSM or UMTS network to the charging gateway function (CGF). In most cases, this should mean from many individual network elements such as the GGSNs to a centralized computer that delivers the charging data more conveniently to the network operator's billing center.

Different GTP variants are implemented by RNCs, SGSNs, GGSNs and CGFs within 3GPP networks. GPRS mobile stations (MSs) are connected to a SGSN without being aware of GTP.

GTP can be used with UDP or TCP. UDP is either recommended or mandatory, except for tunnelling X.25 in version 0. GTP version 1 is used only on UDP.

General features[edit]

All variants of GTP have certain features in common. The structure of the messages is the same, with a GTP header following the UDP/TCP header.

Header[edit]

GTP version 1[edit]

GTPv1 headers contain the following fields:[1]

+0-2345678-1516-2324-31
0VersionProtocol typeReservedExtension Header FlagSequence Number FlagN-PDU Number FlagMessage TypeMessage length
32TEID
64Sequence numberN-PDU numberNext extension header type
Version
It is a 3-bit field. For GTPv1, this has a value of 1.
Protocol Type (PT)
a 1-bit value that differentiates GTP (value 1) from GTP' (value 0).
Reserved
a 1-bit reserved field (must be 0).
Extension header flag (E)
a 1-bit value that states whether there is an extension header optional field.
Sequence number flag (S)
a 1-bit value that states whether there is a Sequence Number optional field.
N-PDU number flag (PN)
a 1-bit value that states whether there is a N-PDU number optional field.
Message Type
an 8-bit field that indicates the type of GTP message. Different types of messages are defined in 3GPP TS 29.060 section 7.1
Message Length
a 16-bit field that indicates the length of the payload in bytes (rest of the packet following the mandatory 8-byte GTP header). Includes the optional fields.
Tunnel endpoint identifier (TEID)
A 32-bit(4-octet) field used to multiplex different connections in the same GTP tunnel.
Sequence number
an (optional) 16-bit field. This field exists if any of the E, S, or PN bits are on. The field must be interpreted only if the S bit is on.
N-PDU number
an (optional) 8-bit field. This field exists if any of the E, S, or PN bits are on. The field must be interpreted only if the PN bit is on.
Next extension header type
an (optional) 8-bit field. This field exists if any of the E, S, or PN bits are on. The field must be interpreted only if the E bit is on.

Next Extension Headers are as follows:

+Bits 0-78-2324-31
0Extension lengthContents
....
..ContentsNext extension header
Extension length
an 8-bit field. This field states the length of this extension header, including the length, the contents, and the next extension header field, in 4-octet units, so the length of the extension must always be a multiple of 4.
Contents
extension header contents.
Next extension header
an 8-bit field. It states the type of the next extension, or 0 if no next extension exists. This permits chaining several next extension headers.

GTP version 2[edit]

It is also known as evolved-GTP or eGTP. GTPv2-C headers contain the following fields:[2]

+Bit 0-2345-78-1516-2324-31
0VersionPiggybacking flag (P)TEID flag (T)SpareMessage TypeMessage length
32TEID (only present if T=1)
64 (32 if TEID not present)Sequence numberSpare

There is no GTPv2-U protocol, GTP-U in LTE also uses GTPv1-U.

Version
It is a 3-bit field. For GTPv2, this has a value of 2.
Piggybacking flag
If this bit is set to 1 then another GTP-C message with its own header shall be present at the end of the current message. There are restrictions as to what type of message can be piggybacked depending on what the toplevel GTP-C message is.
TEID flag
If this bit is set to 1 then the TEID field will be present between the message length and the sequence number. All messages except Echo and Echo reply require TEID to be present.
Message length
This field shall indicate the length of the message in octets excluding the mandatory of the GTP-C header (the first 4 octets). The TEID (if present) and the Sequence Number shall be included in the length count.

Connectivity mechanisms[edit]

Apart from the common message structure, there is also a common mechanism for verifying connectivity from one GSN to another GSN. This uses two messages.

  • echo request
  • echo response

As often as every 60 seconds, a GSN can send an echo request to every other GSN with which it has an active connection. If the other end does not respond it can be treated as down and the active connections to it will be deleted.

Apart from the two messages previously mentioned, there are no other messages common across all GTP variants[3] meaning that, for the most part, they effectively form three completely separate protocols.

GTP-C - GTP control[edit]

The GTP-C protocol is the control section of the GTP standard. When a subscriber requests a PDP context, the SGSN will send a create PDP context request GTP-C message to the GGSN giving details of the subscriber's request. The GGSN will then respond with a create PDP context response GTP-C message which will either give details of the PDP context actually activated or will indicate a failure and give a reason for that failure. This is a UDP message on port 2123.

The eGTP-C (or, GTPv2-C) protocol is responsible for creating, maintaining and deleting tunnels on multiple Sx interfaces. It is used for the control plane path management, tunnel management and mobility management. It also controls forwarding relocation messages; SRNS context and creating forward tunnels during inter LTE handovers.

GTP-U - GTP user data tunneling[edit]

GTP-U is, in effect a relatively simple IP based tunnelling protocol which permits many tunnels between each set of end points. When used in the UMTS, each subscriber will have one or more tunnel, one for each PDP context that they have active, as well as possibly having separate tunnels for specific connections with different quality of service requirements.

The separate tunnels are identified by a TEID (Tunnel Endpoint Identifier) in the GTP-U messages, which should be a dynamically allocated random number. If this random number is of cryptographic quality, then it will provide a measure of security against certain attacks. Even so, the requirement of the 3GPP standard is that all GTP traffic, including user data should be sent within secure private networks, not directly connected to the Internet. This happens on UDP port 2152.

The GTPv1-U protocol is used to exchange user data over GTP tunnels across the Sx interfaces. An IP packet for a UE (user endpoint) is encapsulated in an GTPv1-U packet and tunnelled between the P-GW and the eNodeB for transmission with respect to a UE over S1-U and S5/S8 interfaces.

Tunnelcore Double Wall Plastic

GTP' - charging transfer[edit]

The GTP' protocol is used to transfer charging data to the Charging Gateway Function. GTP' uses TCP/UDP port 3386.

Within the GPRS core network[edit]

GTP is the primary protocol used in the GPRS core network. It is the protocol which allows end users of a GSM or UMTS network to move from place to place whilst continuing to connect to the Internet as if from one location at the GGSN. It does this by carrying the subscriber's data from the subscriber's current SGSN to the GGSN which is handling the subscriber's session. Three forms of GTP are used by the GPRS core network.

  • GTP-U for transfer of user data in separated tunnels for each PDP context
  • GTP-C for control reasons including:
    • setup and deletion of PDP contexts
    • verification of GSN reachability
    • updates; e.g., as subscribers move from one SGSN to another.
  • GTP' for transfer of charging data from GSNs to the charging function.
Bunnings tunnelcore

GGSNs and SGSNs (collectively known as GSNs) listen for GTP-C messages on UDP port 2123 and for GTP-U messages on port 2152. This communication happens within a single network or may, in the case of international roaming, happen internationally, probably across a GPRS roaming exchange (GRX).

The Charging Gateway Function (CGF) listens to GTP' messages sent from the GSNs on TCP/UDP port 3386. The core network sends charging information to the CGF, typically including PDP context activation times and the quantity of data which the end user has transferred. However, this communication which occurs within one network is less standardized and may, depending on the vendor and configuration options, use proprietary encoding or even an entirely proprietary system.

Use on the IuPS interface[edit]

Crystal viewer activex. GTP-U is used on the IuPS between the GPRS core network and the RAN, however the GTP-C protocol is not used. In this case, RANAP is used as a control protocol and establishes GTP-U tunnels between the SGSN and the radio network controller (RNC).

Protocol Stack[edit]

Application Protocols
IP (user)
GTP
UDP
IP
Layer 2 (e.g., WAN or Ethernet)

GTP-U protocol stack

GTP can be used with UDP or TCP. Free mac soft. GTP version 1 is used only on UDP.

As of 2018 there are three versions defined, versions 0, 1 and 2. Version 0 and version 1 differ considerably in structure. In version 0, the signalling protocol (the protocol which sets up the tunnels by activating the PDP context) is combined with the tunnelling protocol on one port. Versions 1 and 2 are each effectively two protocols, one for control (called GTP-C) and one for user data tunneling (called GTP-U). GTP version 2 is different to version 1 only in GTP-C. This is due to 3GPP defining enhancements to GTP-C for EPS in version 2 to improve bearer handling.

GTP-U is also used to transport user data from the RNC to the SGSN in UMTS networks. However, in this case signalling is done using RANAP instead of GTP-C.

Historical GTP versions[edit]

The original version of GTP (version 0) had considerable differences from the current versions (versions 1,2): Torrent program download.

Core Tunnel Mac

Core Tunnel
  • the tunnel identification was non-random;
  • options were provided for transporting X.25;
  • the fixed port number 3386 was used for all functions (not just charging as in GTPv1);
  • TCP was allowed as a transport option instead of UDP, but support for this was optional;
  • subscription-related fields such as quality of service were more limited.

The non-random TEID in version 0 represented a security problem if an attacker had access to any roaming partner's network, or could find some other way to remotely send packets to the GPRS backbone. Version 0 is going out of use and being replaced by version 1 in almost all networks. Fortunately, however the use of different port numbers allows easy blocking of version 0 through simple IP access lists.

GTP standardization[edit]

GTP was originally standardized within ETSI (GSM standard 09.60). With the creation of the UMTS standards this was moved over to the 3GPP which, as of 2005 maintains it as 3GPP standard 29.060. GTP' uses the same message format, but its special uses are covered in standard 32.295 along with the standardized formats for the charging data it transfers.

Later versions of TS 29.060 deprecate GTPv1/v0 interworking such that there is no fallback in the event that the GSN does not support the higher version.

GTPv2 (for evolved packet services) went into draft in early 2008 and was released in December of that year. GTPv2 offers fallback to GTPv1 via the earlier 'Version Not Supported' mechanism but explicitly offers no support for fallback to GTPv0.

See also[edit]

Notes[edit]

  1. ^3GPP TS 29.060 section 6
  2. ^3GPP TS 29.274 section 5
  3. ^3GPP TS 29.060 section 7

References[edit]

  • GSM standard 09.60, ETSI, 1996–98, this standard covers the original version 0 of GTP.
  • 3GPP TS 29.060 V6.9.0 (2005-06), 3rd Generation Partnership Project, 650 Route des Lucioles - Sophia Antipolis, Valbonne - FRANCE, 2005-06. This is the primary standard defining all of the GTP variants for GTP version 1.
  • 3GPP TS 32.295 V6.1.0 (2005-06), 3rd Generation Partnership Project, 650 Route des Lucioles - Sophia Antipolis, Valbonne - FRANCE, 2005-06. This standard covers using GTP for charging.
  • 3GPP TS 29.274 V8.1.0 (2009-03), 3rd Generation Partnership Project, 650 Route des Lucioles - Sophia Antipolis, Valbonne - FRANCE, 2009-03. GTPv2 for evolved GPRS.

External links[edit]

Retrieved from 'https://en.wikipedia.org/w/index.php?title=GPRS_Tunnelling_Protocol&oldid=990171597'

During the development of a web application, you may find yourself in a situation where you may need to access your local development web server from the public web. The most common scenario where this happens is when you need to test and debug webhooks since these need to be accessed from another system on the internet.

For situations like these, you can use ngrok, which is tunnelling, reverse proxy software that establishes a tunnel from a public endpoint to your local web server. Let’s look at how this works and how you can configure ngrok to work with an ASP.NET Core application.

Installing ngrok

To install ngrok, head over to their download page and download the correct version of ngrok for your operating system. Once you have downloaded the ZIP file, you can extract it to a directory on your computer. I took the extra step to add the directory where I extracted ngrok to my PATH so that I can run it from anywhere.

Before you can start using ngrok, you will need to connect your ngrok account. Log in to your ngrok account (or register for an account if you don’t have one yet) and go the Auth section of the dashboard. Here you will see your tunnel authentication token listed:

Use that token to authenticate the ngrok CLI

Create the tunnel

Now that ngrok is installed and authenticated, you can create a tunnel. First, you need to start your ASP.NET Core application and take note of the port that it is using, specifically the HTTPS port, which is 5001 in the sample below.

Start an HTTP tunnel by running the command ngrok http and passing the port, for example:

In the status, ngrok will list the public URLs you can use to access your application. We’re interested in the HTTPS URL, so in our case, this is https://2dc5d7f4.ngrok.io

Core Tunnel 2

Bad gateway error

When I go to that URL, I am greeted with an error 502 Bad Gateway.

Searching the web, this seems to be a common problem when using ngrok with ASP.NET Core. Thankfully, among the many suggestions listed in that StackOverflow issue, there is a correct solution.

Stop ngrok and run it again with the following parameters:

ngrok will start again but take note that it gives you a different public URL each time you restart it:

Head to this new URL, and this time you can see the application running correctly.

Core Tunnel Helper

Get a consistent URL

Having the public URL change every time you restart ngrok can be a bit of a nuisance. You can get custom, reserved subdomains by upgrading to their Basic plan. You can even use your own (white label) domain by upgrading to the Pro plan. This will save you the hassle of having the public URL change on you every time.

Core Tunnel

Conclusion

ngrok provides a convenient way of exposing your local development web server to other devices on the public internet. This can be useful in scenarios like testing and debugging webhooks.

Bunnings Tunnelcore

BTW, there is an alternative way to do this, and that is with a Visual Studio extension called Conveyor. Be sure to check out my follow-up blog post describing how to use Conveyor to access your IIS Express app over the internet.





Comments are closed.