Extracting packet header info in LTE mac for uplink transmission

173 views
Skip to first unread message

Sab NT

unread,
Mar 11, 2016, 11:33:26 AM3/11/16
to ns-3-users
Hi everyone,

I want to intercept packets at the mac layer during LTE uplink transmission. I went through the ns3 LTE design document and understood the flow diagram for uplink transmission to some extent as follows: After the scheduler decides the MCS and hence the data size that can be transmitted through the uplink, the mac notifies the TxOpportunity with the specific size to the RLC . Then RLC compares this transmittable size with its buffer status size and does segmentation/concatenation as required to transmit PDU to MAC.  Now, I want to intercept the application packets associated with the MAC pdu before it transmits in DoTransmitPdu(). But since RLC does segmentation/concatenation, I don't know how to get the packets from the pdu.
I have the packet sequence number added in the application header of the packets. Can anyone please suggest how can I get the application packets from the mac pdu? 
Is there any option to disable the segmentation/concatenation at the RLC?  Any help will be greatly appreciated.
Thanks in advance.

Sab NT

unread,
Mar 11, 2016, 7:14:21 PM3/11/16
to ns-3-users
Hi,

After some more reading my thinking is that I have to remove upper layer headers from the mac PDU in order to get the application level header info.  But  I am not sure how many headers I need to decapsulate from the PDU received in enb-mac in order to reach the application layer hear info. In my setup, I have an end-to-end UDP communication between UE and remote host through LTE-EPC. I tried removing the following headers one by one from mac pdu : rlcHeader, pdcpHeader, rrcHeader, ipHeader and udpHeader to reach to application level info but getting some assert-error e.g. " assert failed. cond="(verIhl >> 4) == 4 " in ipv4-header.

Am I following right way of doing this? Is there any other header needs to be removed in the LTE protocol stack?  Can someone please advise.
Thank you very much in advance.

Tommaso Pecorella

unread,
Mar 12, 2016, 5:11:01 AM3/12/16
to ns-3-users
Hi,

enable packet printing and print the packet, you'll see all its headers.
About the approach, remember that not all the packets will have all the headers.

T.

Sab NT

unread,
Mar 12, 2016, 12:26:46 PM3/12/16
to ns-3-users
Hi Tommaso,

Thank you very much for your reply. Yes the assert was failing because some headers are missing in some of the packets. 
Now, I am using alternate approach using packet tag at the MAC layer. But I am facing some problem. I added a uint32_t field in the lte-radio-bearer-tag, I added/modified get, set, serialize, Deserialize methods; also changed the GetSerialized Size() to accommodate 4 more bytes (for 32 bit field). Till this point it is fine and I can add the field in the tag in function call. However, when I do a RemovePacketTag and read the field, it round offs the field as 8 bit size and I am getting back (field_value%255). I checked my GetField method and member variables, everything is set as uint32_t. Could you please advise if I am missing anything. 
Thanks in advance.

Sab NT

unread,
Mar 12, 2016, 12:36:19 PM3/12/16
to ns-3-users
Sorry, found my mistake while double checking. I had uint8_t variable in the Deserialize() method. After I changed, it is working fine.
Thanks for your help. 
Reply all
Reply to author
Forward
0 new messages