project-lrp / LRP-Example-App

2 stars 0 forks source link

Can LRP be used in an embedded platform? #1

Open fjremnav opened 3 years ago

fjremnav commented 3 years ago

I have an embedded platform (running linux) and this platform has a 5G modem (Quectel) via USB connection. I am just wondering whether LRP can be used in this environment so it will help reducing uplink latency

Thanks, FC

ZhaoweiTan commented 3 years ago

Dear FC,

Thanks for the question. The LRP design works for 5G (tested on commercial 5G phones) and conceptually should be applicable to any embedded platform with a 5G modem. Unfortunately, our current implementation of LRP daemon and example LRP app both run on Android.

If you'd love to implement your own LRP in Linux, please refer to our paper. I believe writing a basic version shouldn't be too difficult. As the simplest version, if you have any periodic or predictable data packets in uplink, you can send a small dummy packet to any dst address 8ms before the real data packets. This time advance should adapt to different cell configurations, but 8ms works for a decent portion of commercial base stations (in US) from our trace collection. For complete features, you could check the paper.

We are more than happy to discuss with you any details of the LRP design or implementation. Let us know!

Best, Zhaowei

fjremnav commented 3 years ago

Zhaowei

Thanks for the response. I have read your paper and believe LRP algorithm can help reducing uplink latency. The thing I am not sure whether LRP needs any status information of modem to make it work. Our application is a standard UDP call and data modem is seen by our application as a network device in a linux system. Our application sends a UDP data packet at every 1ms. With this, do you think your algorithm in the paper can help uplink latency?

ZhaoweiTan commented 3 years ago

Dear FC,

Thanks for the clarification. LRP runs on application layer without modem information. However, if the UDP data packet is sent every 1ms, LRP won't provide significant improvements. LRP mainly works for those applications with longer periodicity. This is because 4G/5G modem spends quite some time to wake up and wait for scheduling before sending data packets to base stations; LRP helps reduce these latency components. If the data packet is as frequent as 1ms: 1) the modem won't enter sleep mode; 2) one mechanism (BSR) kicks in which results in small scheduling latency.

To conclude, if your application has such pattern, the radio access network latency (the focus of LRP) will already be very small without much room to improve. I suggest you investigate other directions, e.g., the latency caused by core network, mobility, or network failure. They are out of the scope of LRP.

Please let me know if this helps.

Thanks, Zhaowei

fjremnav commented 3 years ago

Thanks for clarifications and I also have reached the same conclusion. I have one question regarding retransmission mentioned in your paper. Do you know how much additional latency will incur if retransmission happens? I have seen latency spike occurred randomly (>100ms one way) compared with <60ms over 5 minute test. I also read LTE doc and it mentions retransmission can be avoided in unacknowledged mode. DO you have an experience of this mode?

Thanks, FC

ZhaoweiTan commented 3 years ago

4G has 2 retransmission mechanisms available. One is in MAC layer, where each retx happens 8ms after the previous attempt. The other is in RLC layer, it happens roughly tens of ms after the failed attempt. It is used when MAC retx fails to recover data. Based on our experience, MAC layer ACK/NACK is sometimes corrupted and has to rely on RLC retransmission. That's probably where you see spikes. You can check one of my earlier paper MobileVR in which I have already reported this latency component.

To the best of my knowledge, there's no good way to reduce this latency. One thing would help is to use UM mode as you mentioned (BTW, UM/AM mode is specific for RLC retx; you can never disable MAC retx). However, as far as I know, we cannot manually select UM mode. UM is reserved for some special services (VoLTE for example) and all normal data services that we observed use AM mode that has RLC retx.

Thanks, Zhaowei

fjremnav commented 3 years ago

This will be an issue for my application if UM is not accessible. I also notice you involve with mobileinsight development. Can I use mobileinsight with an android phone and tethers to my PC (running my application) to analyze retranmission latency?

Thanks,

ZhaoweiTan commented 3 years ago

Yes, please refer to this tutorial.

fjremnav commented 3 years ago

I don't have a phone to enable debugging port which are listed in the tutorial. Any recommendation for one to buy? Alternatively, can I run mobilesinsight on an android phone to gather log and run offline analysis on a PC? Is there a mobileinsight APK available to download on the web? Thanks, FC

ZhaoweiTan commented 3 years ago

Any recommendation for one to buy?

This page lists the phone models that work with MobileInsight. MobileInsight only has preliminary support for 5G, though.

Alternatively, can I run mobilesinsight on an android phone to gather log and run offline analysis on a PC?

Yes. That's actually one MobileInsight feature. See here.

Is there a mobileinsight APK available to download on the web?

Please find the APKs from this page.

Best, Zhaowei

fjremnav commented 3 years ago

In order to run mobileinsight on an android phone, the phone needs to be rooted. Is this correct?

Does a phone needs to be rooted if I use a debug port of a phone and run monitor/capture on a PC? FC

fjremnav commented 3 years ago

I am able to use monitor-example.py in mobileinsight to capture logs on my Quectel EC-25 LTE modem. However, python3 ./offline-analysis-example.py monitor-example.mi2log to parse it, I got the following output and it seems not right.

[INFO] [OfflineReplayer]: Enable LTE_RRC_OTA_Packet [INFO] [OfflineReplayer]: Enable LTE_RRC_Serv_Cell_Info [INFO] [OfflineReplayer]: Enable LTE_RRC_CDRX_Events_Info [INFO] [WcdmaRrcAnalyzer]: Initialing WcdmaRrcAnalyzer.. [INFO] [OfflineReplayer]: Enable WCDMA_RRC_OTA_Packet [INFO] [OfflineReplayer]: Enable WCDMA_RRC_Serv_Cell_Info [INFO] [OfflineReplayer]: Enable WCDMA_RRC_States [INFO] [OfflineReplayer]: Enable LTE_NAS_ESM_OTA_Incoming_Packet [INFO] [OfflineReplayer]: Enable LTE_NAS_ESM_OTA_Outgoing_Packet [INFO] [OfflineReplayer]: Enable LTE_NAS_EMM_OTA_Incoming_Packet [INFO] [OfflineReplayer]: Enable LTE_NAS_EMM_OTA_Outgoing_Packet [INFO] [OfflineReplayer]: Enable LTE_NAS_EMM_State [INFO] [OfflineReplayer]: Enable LTE_NAS_ESM_State [INFO] [UmtsNasAnalyzer]: Initialing UmtsNasAnalyzer.. [INFO] [OfflineReplayer]: Enable UMTS_NAS_OTA_Packet [INFO] [OfflineReplayer]: Enable UMTS_NAS_GMM_State [INFO] [OfflineReplayer]: Enable UMTS_NAS_MM_State [INFO] [OfflineReplayer]: Enable UMTS_NAS_MM_REG_State [INFO] [OfflineReplayer]: Enable LTE_PHY_PDSCH_Packet [INFO] [OfflineReplayer]: Enable LTE_PHY_PUSCH_CSF [INFO] [OfflineReplayer]: Enable LTE_MAC_UL_Tx_Statistics [INFO] [OfflineReplayer]: Enable LTE_PHY_PUCCH_Tx_Report [INFO] [OfflineReplayer]: Enable LTE_PHY_PUSCH_Tx_Report [INFO] [OfflineReplayer]: Enable LTE_MAC_UL_Buffer_Status_Internal [INFO] [OfflineReplayer]: Enable LTE_PHY_PDSCH_Stat_Indication [INFO] [OfflineReplayer]: STARTED: 1632789290.0979013 [INFO] [OfflineReplayer]: Loading ./offline_log_example.mi2log [INFO] [OfflineReplayer]: Loading: 1632789290.097962 [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_MM_State [INFO] [UmtsNasAnalyzer]: MmStatus MM.state=MM_IDLE MM.substate=MM_NO_CELL_AVAILABLE MM.update_status=UPDATED PLMN=unknown LAC=unknown R AC=unknown Network_operation_mode=unknown CS/PS_service_type=unknown [INFO] [UmtsNasAnalyzer]: MM State: MM_IDLE [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_GMM_State [INFO] [UmtsNasAnalyzer]: GMM State: GMM_DEREGISTERED [INFO] [LteNasAnalyzer]: EmmStatus EMM.state=EMM_DEREGISTERED EMM.substate=EMM_DEREGISTERED_ATTACH_NEEDED MCC=310 MNC=410 MMEGI=0x50ff M MEC=0x16 TMSI=0x77fd95c0 [INFO] [LteNasAnalyzer]: Call flow status: IDLE [INFO] [LteNasAnalyzer]: EMM state: EMM_DEREGISTERED [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_GMM_State [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_GMM_State [INFO] [LteRrcAnalyzer]: LteRrcStatus cellID=405 frequency=5780 TAC=34624 connected=False [INFO] [LteNasAnalyzer]: EmmStatus EMM.state=EMM_DEREGISTERED EMM.substate=EMM sub-state = 7 MCC=310 MNC=410 MMEGI=0x50ff MMEC=0x16 TMSI =0x77fd95c0 [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_GMM_State [INFO] [UmtsNasAnalyzer]: Find One UMTS_NAS_GMM_State [INFO] [LteNasAnalyzer]: EmmStatus EMM.state=EMM_REGISTERED_INITIATED EMM.substate=EMM_WAITING_FOR_NW_RESPONSE MCC=310 MNC=410 MMEGI=0x5 0ff MMEC=0x16 TMSI=0x77fd95c0 [INFO] [LteNasAnalyzer]: EMM state: EMM_REGISTERED_INITIATED [INFO] [LteNasAnalyzer]: CSFB Capbility: True [INFO] [LteNasAnalyzer]: EsmQos peak_tput=unknown mean_tput=unknown max_bitrate_ulink=unknown max_bitrate_dlink=unknown guaranteed_birat e_ulink=unknown guaranteed_birate_dlink=unknown max_bitrate_ulink_ext=unknown max_bitrate_dlink_ext=unknown guaranteed_birate_ulinkext=unknown guaranteed birate_dlink_ext=unknown [INFO] [LteNasAnalyzer]: EsmQos delivery_order=unknown traffic_class=unknown QCI=unknown delay_class=unknown transfer_delay=unknown resi dual_BER=unknown [INFO] [LtePhyAnalyzer]: PUSCH_TX_POWER: {'tx power': 22, 'timestamp': '2016-03-23 21:55:49.302584'} [INFO] [LtePhyAnalyzer]: PUCCH_TX_POWER: {'tx power': 1, 'timestamp': '2016-03-23 21:55:49.322533'} [INFO] [LtePhyAnalyzer]: PUSCH_TX_POWER: {'tx power': 13, 'timestamp': '2016-03-23 21:55:49.342538'} [INFO] [LtePhyAnalyzer]: PUCCH_TX_POWER: {'tx power': 1, 'timestamp': '2016-03-23 21:55:49.342538'} [INFO] [LtePhyAnalyzer]: SR_EVENT: {'timestamp': '2016-03-23 21:55:49.342538', 'fn and subfn': 5738} [INFO] [LtePhyAnalyzer]: PUSCH_CQI: {'WideBand CQI CW0': '10', 'WideBand CQI CW1': '0'} [INFO] [LtePhyAnalyzer]: PUSCH_TX_POWER: {'tx power': 16, 'timestamp': '2016-03-23 21:55:49.362534'} [INFO] [LtePhyAnalyzer]: PUSCH_TX_POWER: {'tx power': 17, 'timestamp': '2016-03-23 21:55:49.362534'} [INFO] [LtePhyAnalyzer]: PUCCH_TX_POWER: {'tx power': 1, 'timestamp': '2016-03-23 21:55:49.362534'} [INFO] [LtePhyAnalyzer]: PUCCH_TX_POWER: {'tx power': 1, 'timestamp': '2016-03-23 21:55:49.362534'} Init RRC Analyzer Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/MobileInsight-5.0.0-py3.8-linux-x86_64.egg/mobile_insight/monitor/offline_replayer.py", line 209, in run self.send(event) File "/usr/local/lib/python3.8/dist-packages/MobileInsight-5.0.0-py3.8-linux-x86_64.egg/mobile_insight/element.py", line 104, in send self.to_list[i].recv(self, event) File "/usr/local/lib/python3.8/dist-packages/MobileInsight-5.0.0-py3.8-linux-x86_64.egg/mobile_insight/analyzer/analyzer.py", line 234, in recv self.source_callbacki File "/usr/local/lib/python3.8/dist-packages/MobileInsight-5.0.0-py3.8-linux-x86_64.egg/mobile_insight/analyzer/lte_rrc_analyzer.py", line 249, in rrc_ filter self.__callback_sib_config(xml_msg) File "/usr/local/lib/python3.8/dist-packages/MobileInsight-5.0.0-py3.8-linux-x86_64.egg/mobile_insight/analyzer/lte_rrc_analyzer.py", line 451, in call back_sib_config int(field_val['lte-rrc.utra_q_RxLevMin']) * 2, TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

fjremnav commented 3 years ago

See the attachment for a captured-log file. monitor-example.zip

ZhaoweiTan commented 3 years ago

In order to run mobileinsight on an android phone, the phone needs to be rooted.

There could be other ways but I always use mobileinsight on rooted phones.

Does a phone needs to be rooted if I use a debug port of a phone and run monitor/capture on a PC?

I'm not sure as I rarely use mobileinsight with PC. I'm not in charge of MobileInsight low-level development, so please create an issue in the mobileinsight repo for more info.

However, python3 ./offline-analysis-example.py monitor-example.mi2log to parse it, I got the following output and it seems not right.

From my experience, it's likely your phone device generates some new messages that cannot be processed by the latest MobileInsight version. Please create an issue in the mobileinsight repo and the person in charge will add support if possible.

fjremnav commented 3 years ago

OK, I will create a ticket on mobileinsight and thanks for all helps.

FC

fjremnav commented 2 years ago

Hi, Zhaowei,

I am able to root google-pixel 3xl and use mobileinsight-mobile to do capturing in the google pixel. offline-latency-analysis-ul.py is able to analyze my captures. However, I don't understand the meaning of the following variables/statements in the code:

1)stats.cum_err_block: what is cum_err? 2)total_retx = 8 * stats.cum_err_block[0], what is the cum_err_block[0] and why does it need to multiply by 8 for total_retx?

Thanks, FC

On Mon, 27 Sept 2021 at 17:53, Zhaowei Tan @.***> wrote:

In order to run mobileinsight on an android phone, the phone needs to be rooted.

There could be other ways but I always use mobileinsight on rooted phones.

Does a phone needs to be rooted if I use a debug port of a phone and run monitor/capture on a PC?

I'm not sure as I rarely use mobileinsight with PC. I'm not in charge of MobileInsight low-level development, so please create an issue in the mobileinsight repo for more info.

However, python3 ./offline-analysis-example.py monitor-example.mi2log to parse it, I got the following output and it seems not right.

From my experience, it's likely your phone device generates some new messages that cannot be processed by the latest MobileInsight version. Please create an issue in the mobileinsight repo and the person in charge will add support if possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/project-lrp/LRP-Example-App/issues/1#issuecomment-928533904, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATIOODPVCIPI523L3RF7KF3UEEGXBANCNFSM5EVG3EZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.