Package: simu5g.corenetwork.gtp
GtpUser
simple moduleImplements a simplified version of the user plane of the GPRS Tunneling Protocol (GTP). On one hand, this module encapsulates incoming IP datagrams into GTP packets and sends them to the tunnel destination endpoint (GTP operates on top of UDP). The destination endpoint is identified by utilizing information from the TrafficFlowFilter module. On the other hand, when this module receives GTP packets from a tunnel source endpoint, it decapsulates the included IP datagram and sends it out on userDataOut: at a base station into the cellular NIC (a base station does not IP-route the UEs' traffic), at a Upf or PgwStandard onto the data network, unless the destination is a UE of the same core network, whose base station the datagram is then tunneled on to. At a Upf or PgwStandard, userDataOut leads to the node's message dispatcher, and every packet carries the service it is for (DispatchProtocolReq): ipv4/ipv6 for the data network, ethernetmac for the EthernetSessionBridge, and icmpv6 for the Ipv6NdResponder, which gets the link-local traffic of the UEs' IPv6 sessions, each packet tagged with its session (the IP link of a session ends at its anchor, and its Neighbor Discovery must not leak onto the data network). Resides, with the TrafficFlowFilter, in the UserPlaneRelay of every node that ends GTP-U tunnels: eNodeB, gNodeB, PgwStandard and Upf (also as the UPF of a MecHost).
The tunnel a G-PDU arrives on names its session, and so what the T-PDU carries: the payload goes out as the protocol the session's type implies (an IP datagram, or the "unstructured" protocol), and a base station attaches the session, with its type, as a SessionTag. At an anchor UPF the uplink of an Unstructured session leaves on the session's N6 tunnel, in a UDP/IP datagram this module builds from the session's N6 address to the server (see UserPlaneNodeControl). The uplink of an Ethernet session goes to the UPF's EthernetSessionBridge, its FCS rebuilt (the 5GS does not carry it), tagged with its session; the downlink frames the traffic flow filter classified lose their FCS here, before they enter the session's tunnel.
Used in compound modules
| Name | Type | Description |
|---|---|---|
| UserPlaneRelay | compound module |
The user-plane relay of a node that ends GTP-U tunnels: the "relay" between the two protocol stacks in the user-plane stack diagrams of 3GPP (TS 23.401, 23.501, 38.300). At a base station it relays between the radio interface and the N3/S1-U tunnels, at a Upf or PgwStandard between the data network (N6/SGi) and the tunnels toward the base stations or other UPFs. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| binderModule | string | "binder" | |
| localPort | int | 31 | |
| tunnelPeerPort | int | 31 | |
| gateway | string | "" |
Optional |
Properties
| Name | Value | Description |
|---|---|---|
| display | i=block/tunnel |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| socketOut | output | ||
| socketIn | input | ||
| userDataIn | input |
The user data (T-PDUs) to tunnel, classified by the TrafficFlowFilter |
|
| userDataOut | output |
The user data out of the tunnels: to the cellular NIC at a base station, to the node's message dispatcher at a UPF or PGW |
Source code
// // Implements a simplified version of the user plane of the GPRS Tunneling // Protocol (GTP). On one hand, this module encapsulates incoming IP datagrams into GTP // packets and sends them to the tunnel destination endpoint (GTP operates on top of // UDP). The destination endpoint is identified by utilizing information from the // ~TrafficFlowFilter module. On the other hand, when this module receives GTP packets // from a tunnel source endpoint, it decapsulates the included IP datagram and sends it // out on userDataOut: at a base station into the cellular NIC (a base station does not // IP-route the UEs' traffic), at a ~Upf or ~PgwStandard onto the data network, unless // the destination is a UE of the same core network, whose base station the datagram // is then tunneled on to. At a ~Upf or ~PgwStandard, userDataOut leads to the node's // message dispatcher, and every packet carries the service it is for (DispatchProtocolReq): // ipv4/ipv6 for the data network, ethernetmac for the ~EthernetSessionBridge, and icmpv6 // for the ~Ipv6NdResponder, which gets the link-local traffic of the UEs' IPv6 sessions, // each packet tagged with its session (the IP link of a session ends at its anchor, and // its Neighbor Discovery must not leak onto the data network). // Resides, with the ~TrafficFlowFilter, in the ~UserPlaneRelay of every node that ends // GTP-U tunnels: ~eNodeB, ~gNodeB, ~PgwStandard and ~Upf (also as the UPF of a ~MecHost). // // The tunnel a G-PDU arrives on names its session, and so what the T-PDU carries: // the payload goes out as the protocol the session's type implies (an IP datagram, or // the "unstructured" protocol), and a base station attaches the session, with its // type, as a ~SessionTag. At an anchor UPF the uplink of an Unstructured session // leaves on the session's N6 tunnel, in a UDP/IP datagram this module builds from // the session's N6 address to the server (see ~UserPlaneNodeControl). The uplink of an // Ethernet session goes to the UPF's ~EthernetSessionBridge, its FCS rebuilt (the 5GS does not // carry it), tagged with its session; the downlink frames the traffic flow filter classified // lose their FCS here, before they enter the session's tunnel. // simple GtpUser { parameters: string binderModule = default("binder"); int localPort = default(31); int tunnelPeerPort = default(31); string gateway = default(""); // Optional @display("i=block/tunnel"); gates: output socketOut; input socketIn; input userDataIn; // The user data (T-PDUs) to tunnel, classified by the ~TrafficFlowFilter output userDataOut; // The user data out of the tunnels: to the cellular NIC at a base station, to the node's message dispatcher at a UPF or PGW }File: src/simu5g/corenetwork/gtp/GtpUser.ned