Skip to content

Commit 5677fa6

Browse files
committed
Ip2Nic: fix #302: forward packets that arrive at old gNB just after handover
Those packets were in-flight on the core network towards the old gNB when the handover occurred. They used to cause an error -- now they are forwarded to the new gNB over X2. New check detects that the UE is now served by a different gNB and forwards the packet via X2 instead of sending it to the local PDCP (where it would crash with destId set to a gNB ID).
1 parent 5cddc04 commit 5677fa6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/simu5g/stack/ip2nic/Ip2Nic.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ void Ip2Nic::fromIpBs(Packet *pkt)
294294
return;
295295
}
296296

297+
// if UE has moved to another gNB (e.g. late packet after handover), forward via X2
298+
MacNodeId servingNode = binder_->getServingNodeOrSelf(destId);
299+
if (servingNode != NODEID_NONE && servingNode != nodeId_) {
300+
EV << "Ip2Nic::fromIpBs - UE " << destId << " is served by gNB " << servingNode << ", forwarding via X2" << endl;
301+
sendTunneledPacketOnHandover(pkt, servingNode);
302+
return;
303+
}
304+
297305
toStackBs(pkt);
298306
}
299307

0 commit comments

Comments
 (0)