N3IWF - Downlink packets in GRE Tunnel are fragmented and are not complete

Hi,

I’m using my NWu simulator to establish a session with n3iwf in free5gc Core.
That is working.

What I noticed is that user packets above 1484 bytes are not being received.
I just send a ping with that size and it works. Above that size it does not work.

I did some internal traces and found the following:

Working scenario: user Ping with total size 1484 bytes:

The user packet Echo Request is encapsulated in GRE tunnel (10.0.0.1 to 10.0.0.7).

  • User packet = 1484 bytes
  • GRE header = 4 bytes
  • IP header = 20 bytes (length in header = 1508 bytes)
    Total = 1508 bytes.

This packet is seen in the trace in ESP, and after being decoded in the IPIP tunnel 10.0.0.1.
The packet is then encapsulated in GTP-U and sent to the destination.

Then i have the Echo Response encapsulated in GTP-U arriving in the N3IWF.
The next packets after this one, are two fragmented packets with the IPs 10.0.0.1 and 10.0.0.7, and the GRE header and payload with the user packet Echo Response.

The payload of these two packets should be the GRE header plus the user packet Echo Response.
The payload has 1488 bytes: 4 bytes GRE header + 1484 bytes, which is correct.


Non Working scenario: User Ping with total size above 1484 bytes (example with 1498 bytes):

The userpacket Echo Request is encapsulated in GRE tunnel (10.0.0.1 to 10.0.0.7).

  • User packet = 1498 bytes
  • GRE header = 4 bytes
  • IP header = 20 bytes (length in header = 1522)
    Total = 1522 bytes.

This packet is seen in the trace in ESP, and after being decoded in the IPIP tunnel 10.0.0.1
The packet is then encapsulated in GTP-U and sent to the destination.

Then i have the Echo Response encapsulated in GTP-U.
The next packets after this one, are two fragmented packets with the IPs 10.0.0.1 and 10.0.0.7, and the GRE header and payload with the user packet Echo Response.

The payload of these two packets should be the GRE header plus the user packet Echo Response (4 bytes + 1498 bytes = 1502 bytes).
But the payload has only 1488 bytes: 4 bytes GRE header + 1484 bytes, which is not correct since the Echo Response packet is 1498 bytes.
The IP header of the user packet has ip length field equal to 1498 as expected.

Wireshark triggers an error: “IPv4 total length exceeds packet length (1484 bytes)”

Then these two fragments are encrypted in IPsec (in two separated ESP packets), but when i receive these packets, and reassemble the payload, the user packet has only 1484 bytes and is not complete, and the ping fails.

Can you help? Why I’m having this limit of 1484 maximum packet size?

Hi installed the latest version of n3iwf, and now i get an error in n3iwf:

UE side:

root@ubuntu:/etc/freeradius/3.0# ping 10.10.62.29 -s 1456
PING 10.10.62.29 (10.10.62.29) 1456(1484) bytes of data.
1464 bytes from 10.10.62.29: icmp_seq=2 ttl=127 time=8.95 ms
1464 bytes from 10.10.62.29: icmp_seq=3 ttl=127 time=11.2 ms
^X^C

root@ubuntu:/etc/freeradius/3.0# ping 10.10.62.29 -s 1457
PING 10.10.62.29 (10.10.62.29) 1457(1485) bytes of data.
^X^C
— 10.10.62.29 ping statistics —
2 packets transmitted, 0 received, 100% packet loss, time 1002ms

root@ubuntu:/etc/freeradius/3.0#

N3IWF side:

00000000 00 09 |…|
2022-03-15T10:13:22Z [TRAC][N3IWF][GTP] QFI: 9, RQI: false
2022-03-15T10:13:22Z [TRAC][N3IWF][GTP] Forward NWu <- N3
2022-03-15T10:13:22Z [TRAC][N3IWF][GTP] Wrote 92 bytes
2022-03-15T10:13:28Z [TRAC][N3IWF][NWuUP] Read 1492 bytes
2022-03-15T10:13:28Z [TRAC][N3IWF][NWuUP] Forward NWu -> N3
2022-03-15T10:13:28Z [TRAC][N3IWF][NWuUP] Wrote 1500 bytes
2022-03-15T10:13:28Z [TRAC][N3IWF][GTP] Parsed Extension Header: Len=1, Next Type=0, Content Dump:
00000000 00 09 |…|
2022-03-15T10:13:28Z [TRAC][N3IWF][GTP] QFI: 9, RQI: false
2022-03-15T10:13:28Z [TRAC][N3IWF][GTP] Forward NWu <- N3
2022-03-15T10:13:28Z [TRAC][N3IWF][GTP] Wrote 1492 bytes
2022-03-15T10:13:29Z [TRAC][N3IWF][NWuUP] Read 1492 bytes
2022-03-15T10:13:29Z [TRAC][N3IWF][NWuUP] Forward NWu -> N3
2022-03-15T10:13:29Z [TRAC][N3IWF][NWuUP] Wrote 1500 bytes
2022-03-15T10:13:29Z [TRAC][N3IWF][GTP] Parsed Extension Header: Len=1, Next Type=0, Content Dump:
00000000 00 09 |…|
2022-03-15T10:13:29Z [TRAC][N3IWF][GTP] QFI: 9, RQI: false
2022-03-15T10:13:29Z [TRAC][N3IWF][GTP] Forward NWu <- N3
2022-03-15T10:13:29Z [TRAC][N3IWF][GTP] Wrote 1492 bytes
2022-03-15T10:13:30Z [TRAC][N3IWF][NWuUP] Read 1492 bytes
2022-03-15T10:13:30Z [TRAC][N3IWF][NWuUP] Forward NWu -> N3
2022-03-15T10:13:30Z [TRAC][N3IWF][NWuUP] Wrote 1500 bytes
2022-03-15T10:13:30Z [TRAC][N3IWF][GTP] Parsed Extension Header: Len=1, Next Type=0, Content Dump:
00000000 00 09 |…|
2022-03-15T10:13:30Z [TRAC][N3IWF][GTP] QFI: 9, RQI: false
2022-03-15T10:13:30Z [TRAC][N3IWF][GTP] Forward NWu <- N3
2022-03-15T10:13:30Z [TRAC][N3IWF][GTP] Wrote 1492 bytes
2022-03-15T10:13:32Z [TRAC][N3IWF][NWuUP] Read 1493 bytes
2022-03-15T10:13:32Z [TRAC][N3IWF][NWuUP] Forward NWu -> N3
2022-03-15T10:13:32Z [TRAC][N3IWF][NWuUP] Wrote 1501 bytes
panic: runtime error: slice bounds out of range [:1501] with capacity 1500

goroutine 97 [running]:
github.com/wmnsk/go-gtp/gtpv1/message.(*Header).UnmarshalBinary(0xc000269800, 0xc0005aa000, 0x5dc, 0x5dc, 0x0, 0xc00000e110)
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/message/header.go:169 +0x2b5
github.com/wmnsk/go-gtp/gtpv1/message.ParseHeader(0xc0005aa000, 0x5dc, 0x5dc, 0xc29d40, 0xd98301, 0xc00000e158)
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/message/header.go:115 +0x62
github.com/wmnsk/go-gtp/gtpv1/message.(*TPDU).UnmarshalBinary(0xc00000e158, 0xc0005aa000, 0x5dc, 0x5dc, 0x0, 0x0)
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/message/t-pdu.go:60 +0x43
github.com/wmnsk/go-gtp/gtpv1/message.Parse(0xc0005aa000, 0x5dc, 0x5dc, 0xd98360, 0xc00000e110, 0x0, 0x0)
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/message/message.go:204 +0xb4
github.com/wmnsk/go-gtp/gtpv1.(*UPlaneConn).serve.func2(0xc0000f1e30, 0xc0005aa000, 0x5dc, 0x5dc, 0x5dc, 0xd870a0, 0xc000493440)
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/u-conn.go:249 +0x44e
created by github.com/wmnsk/go-gtp/gtpv1.(*UPlaneConn).serve
/root/go/pkg/mod/github.com/wmnsk/[email protected]/gtpv1/u-conn.go:215 +0xef
2022-03-15T10:13:32Z [INFO][AMF][NGAP] Handle SCTP Notification[addr: ]
2022-03-15T10:13:32Z [INFO][AMF][NGAP][172.16.168.131/172.16.62.131/172.16.63.11/10.0.0.1:48468] SCTP_SHUTDOWN_EVENT notification, close the connection
2022-03-15T10:13:32Z [INFO][AMF][NGAP][172.16.168.131/172.16.62.131/172.16.63.11/10.0.0.1:48468] Remove RAN Context[ID: <PlmnID: {Mcc:208 Mnc:93}, N3IwfID: 0087>]
2022-03-15T10:13:32Z [INFO][AMF][NGAP] Handle SCTP Notification[addr: ]
2022-03-15T10:13:32Z [WARN][AMF][NGAP] RAN context has been removed[addr: ]

Hi,
Can you provide the NWu simulator that you use,so i can do the test.

Hi @fasferraz ,
since there haven’t been any replies from you, this topic is closed by admin.
If you have further questions about this topic, please create another topic or message the admin.
Thanks.

Admin