Repository navigation
Conversation
…arries GtpUser creates a new Packet for every GTP-U message and copies the data of the original packet into it with insertAtBack(peekData()). That copies the chunks, so the tags of a chunk survive, but the region tags of the Packet, which are not part of its chunks, were lost at each end of a tunnel: a CreationTimeTag or a ResidenceTimeTag set before the gNB or the UPF was gone after the other end. In INET the region tags of a packet travel with its data through every encapsulation. The three places that build a Packet from another one now copy the region tags of the data: the encapsulation of a packet of the traffic flow filter, the decapsulation of a GTP-U message, and the encapsulation of a packet into a downlink tunnel. The tests tag a frame of an Ethernet PDU session before it enters the tunnel, uplink and downlink, and a datagram that the UPF relays from the tunnel of one UE into the tunnel of another, and count the bytes that carry the tag where the packet has left the tunnel.
Member
|
The reported issue is a duplicate of Unipisa#309, and the fix (a different one from this) is present in branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On dev 764db6f, one commit. (Issues are disabled in this repository, so the problem is described here.)
Problem
A region tag that a packet carries before a gNB or a UPF tunnels it (
CreationTimeTag,ResidenceTimeTag,ElapsedTimeTag, ... added withPacket::addRegionTag) is gone after the other end of the GTP-U tunnel. This happens in an IP and in an Ethernet PDU session, uplink and downlink, and across the UPF's relay from one tunnel into another.Tags attached to a chunk survive (the chunk is shared), which hides the problem when a source tags the chunk it creates. Consumers lose their measurements: the end-to-end delay from
CreationTimeTag, the residence times of TSN bridging.Cause
src/simu5g/corenetwork/gtp/GtpUser.cc(dev 764db6f) builds a newPacketfor the GTP-U message and moves the data over withinsertAtBack(peekData()). That copies chunks only; the region tags of aPacketlive inPacket::regionTags, not in its chunks.INET's convention is that the region tags of a packet travel with its data through every encapsulation. INET's own tunnelling inserts the Ipv4/Udp/Ethernet headers into the same
Packet, andPacket::insertAt/removeAtshift the region tags. Where INET builds a secondPacketfrom the data of the first, it copies the region tags explicitly withPacket::copyRegionTags(EthernetCutthroughSource.cc:38,CutthroughSource.cc:38).Reproduction
Tag a frame with
addRegionTag<CreationTimeTag>()where it is about to enter the tunnel (for example asupf.ethBridge.ethernet.fcsInserterpushes it out, or as the gNB PDCP rx entity passes it up), and look for the tag where it has left the tunnel: no byte carries it. The two tests of this PR do this.Fix
GtpUsercreates a newPacketfor every GTP-U message and copies the data of the original packet into it withinsertAtBack(peekData()). That copies the chunks, so the tags of a chunk survive, but the region tags of thePacketwere lost at each end of a tunnel. The three places that build aPacketfrom another one now copy the region tags of the data withPacket::copyRegionTags, as INET does where it builds a secondPacket(EthernetCutthroughSource,CutthroughSource):Region tag offsets count from the start of the packet content, popped front bytes included. So the source offset is the front offset of the data, and the target offset is where the data starts in the new packet (after the GTP-U header, or 0 in the decapsulated packet).
copyRegionTagsclips the copy to the data, so tags over the popped GTP-U header or the removed Ethernet FCS do not leak.tunnelUplinkOverN6inserts its UDP and IP headers into the samePacketand needs no change.Not changed on purpose: the packet-level tags (
Packet::copyTags).GtpUsersets the ones it needs (PacketProtocolTag, QFI, session) itself; a blanket copy would carry stale ones such as the socket and interface tags of the outer packet.Tests (
tests/module)GtpRegionTags.test: Ethernet PDU session, both directions. A probe adds aCreationTimeTagover the whole frame where it is about to enter the tunnel (downlink:packetPushedOutofupf.ethBridge.ethernet.fcsInserter; uplink:sentPacketToUpperLayerof the gNB PDCP rx entity). It counts the tagged bytes where the frame has left the tunnel (downlink:receivedPacketFromUpperLayerof the gNB PDCP tx entity; uplink:packetPushedInofupf.ethBridge.ethernet.fcsChecker).GtpRegionTagsIp.test: IP session, two gNBs.ue[0]atgnbsends UDP toue[1]atgnb2, so the datagram is encapsulated atgnb, decapsulated and encapsulated again at the UPF (tunnelDownlink), and decapsulated atgnb2.GtpRegionTagsGtpRegionTagsGtpUserGtpRegionTagsIpEach of the three lines is needed: without site 1 or 2 both tests fail, and without site 3
GtpRegionTagsIpfails.Evidence
Simu5G dev 764db6f against INET 4.7.0, OMNeT++ 6.5.0, release, macOS arm64 (
./runtestintests/module; the build here also carries the macOSintval_tchange of #1, which this PR does not contain). The other module tests: 13 PASS + 1 EXPECTEDFAIL (TwoSessionsPerUe).EthernetSessionQosRuleFieldsfails with and without the fix on this INET (Object (inet::EthernetFcs) has no member named 'dest').Not run: debug build; the fingerprint, unit and physics suites (no region tag enters a fingerprint ingredient, not checked); INET master; Linux.