I use free5gc n3iwf to link to our core, and use free5gc ue simulator TestNon3GPPUE in non3gpp_test.go, now the ue registration and pdu session establishment is passed, I will do icmp ping to remote DN.
Bu the ping is failed, I see that in TestNon3GPPUE, create gre tunnel 0 interface, and allocate the UE ip to it, and I follow the same method, but looks like invalid.
The ping gtp(icmp) not send out, since I have not capture the ping echo request, I do not know why. I chenged the non3gpp_test.go like this:
// Set GRE interface up
if err := netlink.LinkSetUp(linkGRE); err != nil {
t.Fatal(err)
}
// Add route
upRoute := &netlink.Route{
LinkIndex: linkGRE.Attrs().Index,
Dst: &net.IPNet{
IP: net.IPv4zero,
Mask: net.IPv4Mask(0, 0, 0, 0),
},
}
t.Logf("#### upRoute: %+v", upRoute)
if err := netlink.RouteAdd(upRoute); err != nil {
t.Fatal(err)
}
defer func() {
_ = netlink.LinkSetDown(linkGRE)
_ = netlink.LinkDel(linkGRE)
}()
// Ping remote, remote ip mask is configured in UPF???
pinger, err := ping.NewPinger("172.20.231.101")
if err != nil {
t.Fatal(err)
}
Hi,
please look at the pcap file captured in UEns and host, looks like that the icmp echo reqeust is not received in n3iwf Nwuup: I added some log in below function, but nothing printed out: ReadFrom retur nnothing. UEns.pcap (7.3 KB) default_ns.pcap (447.8 KB) upf.pcap (36.8 KB)
func listenAndServe(rawSocket *ipv4.RawConn) {
defer func() {
err := rawSocket.Close()
if err != nil {
nwuupLog.Errorf(“Error closing raw socket: %+v”, err)
}
}()
buffer := make([]byte, 65535)
for {
ipHeader, ipPayload, _, err := rawSocket.ReadFrom(buffer) //here read nothing from gre tunnel interface
nwuupLog.Tracef("Read %d bytes", len(ipPayload))
if err != nil {
nwuupLog.Errorf("Error read from raw socket: %+v", err)
return
}
forwardData := make([]byte, len(ipPayload[4:]))
copy(forwardData, ipPayload[4:])
go forward(ipHeader.Src.String(), forwardData)
}
here is my configuration in UEns and host, ip address and ip link and route:
please help to look at what is my problem: ip_address_ip_link_route_in_UEns_host.txt (9.0 KB)
another question: I see you use the gtp golang pkg to send the message, WriteToGTP, but not incude the gtp extension header, I want to contains the gtp extension header in gtpu message, since I want to contain the QFI in extension header, How can I change the code? can I change the golang gtp pkg?