jjalcaraz-upct / network-slicing

Network slicing gym environment and a model-based RL agent with kernels
MIT License
36 stars 11 forks source link

Maybe a bug? #4

Open StupidI opened 1 year ago

StupidI commented 1 year ago

In function "location", it implies that the location of the base is (1/3, 0), which conflicts with "radius = 1/2", whether "distance = np.sqrt((x - 1/3)^2 + y^2)" should be changed to " distance = np.sqrt((x - 1/4)^2+ y^2)"

jjalcaraz-upct commented 1 year ago

You are right. Also, I have found another bug in the computation of theta. I have fixed them. Thanks.

From: StupidI @.> Reply-To: jjalcaraz-upct/network-slicing @.> Date: Tuesday, February 21, 2023 at 3:32 AM To: jjalcaraz-upct/network-slicing @.> Cc: Subscribed @.> Subject: Re: [jjalcaraz-upct/network-slicing] Maybe a bug? (Issue #4)

In function "location", it implies that the location of the base is (1/3, 0), which conflicts with "radius = 1/2", whether "distance = np.sqrt((x - 1/3)^2 + y^2)" should be changed to " distance = np.sqrt((x - 1/4)^2+ y^2)"

— Reply to this email directly, view it on GitHubhttps://github.com/jjalcaraz-upct/network-slicing/issues/4#issuecomment-1437776762, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN3EW2CEVETA2OU7D4BSVKTWYQSNDANCNFSM6AAAAAAVCPES4Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

StupidI commented 1 year ago

Thanks for your answer! Also, Can you explain the equation "FSPL = 20np.log10(R) + 20np.log10(2) + 93.45 + gamma10np.log10(R) " for me? I have looked up TS 36.942 and other things but still can't figure it out, especially the "93.45" and gamma=2.6 which are really unclear meaning.

StupidI commented 1 year ago

You are right. Also, I have found another bug in the computation of theta. I have fixed them. Thanks. From: StupidI @.> Reply-To: jjalcaraz-upct/network-slicing @.> Date: Tuesday, February 21, 2023 at 3:32 AM To: jjalcaraz-upct/network-slicing @.> Cc: Subscribed @.> Subject: Re: [jjalcaraz-upct/network-slicing] Maybe a bug? (Issue #4) In function "location", it implies that the location of the base is (1/3, 0), which conflicts with "radius = 1/2", whether "distance = np.sqrt((x - 1/3)^2 + y^2)" should be changed to " distance = np.sqrt((x - 1/4)^2+ y^2)" — Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN3EW2CEVETA2OU7D4BSVKTWYQSNDANCNFSM6AAAAAAVCPES4Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Maybe another bug, in "self.list_of_parameters", it seems that the parameters of 2GHz and 900MHz are placed wrong?

jjalcaraz-upct commented 1 year ago

The A,B parameters are now correctly placed. The FSPL (Free Space Path Loss) formula comes from the log-distance path-loss model (https://en.wikipedia.org/wiki/Log-distance_path_loss_model) where gamma is the pathless exponent. The 93.45 (in fact should be 92.45, now corrected) is the 20log10(2pi/c) constant of the free-space path loss formula (https://en.wikipedia.org/wiki/Free-space_path_loss) for distance in Km and frequency in GHz. Thank you for pointing out these bugs.

StupidI commented 1 year ago

The A,B parameters are now correctly placed. The FSPL (Free Space Path Loss) formula comes from the log-distance path-loss model (https://en.wikipedia.org/wiki/Log-distance_path_loss_model) where gamma is the pathless exponent. The 93.45 (in fact should be 92.45, now corrected) is the 20_log10(2_pi/c) constant of the free-space path loss formula (https://en.wikipedia.org/wiki/Free-space_path_loss) for distance in Km and frequency in GHz. Thank you for pointing out these bugs.

Got it, thanks for your explanation! Another question I'm curious about is "MCSCodeset compute_factors" part. Does the equation "rx_prob(x) = A *(snr - snr_ref) + B" haved referred anything, sorry I can't find the theory related to it or it's created by yourself? Also, why the default value of "sym_per_prb" in "ProportionalFair" should be 158 rather than 168?

StupidI commented 1 year ago

emmmm, it seems "sym_per_prb" should be 7*12 if the bandwidth is 20MHz in LTE? I'm confused about it, could you please explain it more? Thanks in advance!

jjalcaraz-upct commented 1 year ago

1) Regarding the rx probability calculation, it is based on [1]. The MCSCodeset factors are computed to approximate the snr-MI curves shown in Figure 7 of [1]. The model to generate rx probability from snr is based on Annex A of 3GPP TR 36.942. Figure A.4 shows the rate for each MCS vs the SNR. For each MCS, the model maps the rate to rx probability so that the rx prob is 0 for 0 rate and 1 for the max achievable rate of the MCS. 2) Regarding the sym_per_prb, note that the resource allocation is done in a subframe basis. A subframe contains two slots, each one with an RB of 7x12 symbols. Thus, what is called a PRB contains 2x7x12 = 168 symbols, and 10 are subtracted to account for overhead (PDCCH, reference signals...).

[1] Mezzavilla, Marco, et al. "A lightweight and accurate link abstraction model for the simulation of LTE networks in ns-3." Proceedings of the 15th ACM international conference on Modeling, analysis and simulation of wireless and mobile systems. 2012.

jjalcaraz-upct commented 1 year ago

Each scheduler runs independently on the frequency band of each slice: note that prb_i is an index to the snr list in the ue. This list contains the snr estimations for the prbs of the slice where the ue is in. This is updated in slice_l1.py with:

ue.estimate_snr(snr[self.prb_slice])

where self.prb_slice is, in fact, defined as a python slice for lists.

From: StupidI @.> Reply-To: jjalcaraz-upct/network-slicing @.> Date: Wednesday, March 8, 2023 at 9:37 AM To: jjalcaraz-upct/network-slicing @.> Cc: jjalcaraz-upct @.>, Comment @.***> Subject: Re: [jjalcaraz-upct/network-slicing] Maybe a bug? (Issue #4)

Also, the code under annotation "update ues" in "schedulers.py" seems to indicate that the allocated PRBs of every slice starts at the same frequency, and this seems impossible as all the slices share one section of bandwidth.

— Reply to this email directly, view it on GitHubhttps://github.com/jjalcaraz-upct/network-slicing/issues/4#issuecomment-1459740139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN3EW2GFR2N5E6DU54HITG3W3BAMFANCNFSM6AAAAAAVCPES4Q. You are receiving this because you commented.Message ID: @.***>

StupidI commented 1 year ago
  1. Regarding the rx probability calculation, it is based on [1]. The MCSCodeset factors are computed to approximate the snr-MI curves shown in Figure 7 of [1]. The model to generate rx probability from snr is based on Annex A of 3GPP TR 36.942. Figure A.4 shows the rate for each MCS vs the SNR. For each MCS, the model maps the rate to rx probability so that the rx prob is 0 for 0 rate and 1 for the max achievable rate of the MCS.
  2. Regarding the sym_per_prb, note that the resource allocation is done in a subframe basis. A subframe contains two slots, each one with an RB of 7x12 symbols. Thus, what is called a PRB contains 2x7x12 = 168 symbols, and 10 are subtracted to account for overhead (PDCCH, reference signals...).

[1] Mezzavilla, Marco, et al. "A lightweight and accurate link abstraction model for the simulation of LTE networks in ns-3." Proceedings of the 15th ACM international conference on Modeling, analysis and simulation of wireless and mobile systems. 2012.

Thank you, that helps me a lot! Also, the "allocate()" in "schedulers.py" may exist a bug. "ue_th[index] = self.a max(ue.th, 1) + self.b ue_bits[index] / self.slot_length" seems to be corrected to "ue_th[index] = self.a max(ue_th[index], 1) + self.b ue_bits[index] / self.slot_length"

jjalcaraz-upct commented 1 year ago

Corrected! Thank you.

From: StupidI @.> Reply-To: jjalcaraz-upct/network-slicing @.> Date: Thursday, March 16, 2023 at 3:52 AM To: jjalcaraz-upct/network-slicing @.> Cc: jjalcaraz-upct @.>, Comment @.***> Subject: Re: [jjalcaraz-upct/network-slicing] Maybe a bug? (Issue #4)

  1. Regarding the rx probability calculation, it is based on [1]. The MCSCodeset factors are computed to approximate the snr-MI curves shown in Figure 7 of [1]. The model to generate rx probability from snr is based on Annex A of 3GPP TR 36.942. Figure A.4 shows the rate for each MCS vs the SNR. For each MCS, the model maps the rate to rx probability so that the rx prob is 0 for 0 rate and 1 for the max achievable rate of the MCS.
  2. Regarding the sym_per_prb, note that the resource allocation is done in a subframe basis. A subframe contains two slots, each one with an RB of 7x12 symbols. Thus, what is called a PRB contains 2x7x12 = 168 symbols, and 10 are subtracted to account for overhead (PDCCH, reference signals...).

[1] Mezzavilla, Marco, et al. "A lightweight and accurate link abstraction model for the simulation of LTE networks in ns-3." Proceedings of the 15th ACM international conference on Modeling, analysis and simulation of wireless and mobile systems. 2012.

Thank you, that helps me a lot! Also, the "allocate()" in "schedulers.py" may exist a bug. "ue_th[index] = self.a max(ue.th, 1) + self.b ue_bits[index] / self.slot_length" seems to be corrected to "ue_th[index] = self.a max(ue_th[index], 1) + self.b ue_bits[index] / self.slot_length"

— Reply to this email directly, view it on GitHubhttps://github.com/jjalcaraz-upct/network-slicing/issues/4#issuecomment-1471204844, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AN3EW2GQQPMROLYTIERM3F3W4J55VANCNFSM6AAAAAAVCPES4Q. You are receiving this because you commented.Message ID: @.***>

StupidI commented 1 year ago
  1. Regarding the rx probability calculation, it is based on [1]. The MCSCodeset factors are computed to approximate the snr-MI curves shown in Figure 7 of [1]. The model to generate rx probability from snr is based on Annex A of 3GPP TR 36.942. Figure A.4 shows the rate for each MCS vs the SNR. For each MCS, the model maps the rate to rx probability so that the rx prob is 0 for 0 rate and 1 for the max achievable rate of the MCS.
  2. Regarding the sym_per_prb, note that the resource allocation is done in a subframe basis. A subframe contains two slots, each one with an RB of 7x12 symbols. Thus, what is called a PRB contains 2x7x12 = 168 symbols, and 10 are subtracted to account for overhead (PDCCH, reference signals...).

[1] Mezzavilla, Marco, et al. "A lightweight and accurate link abstraction model for the simulation of LTE networks in ns-3." Proceedings of the 15th ACM international conference on Modeling, analysis and simulation of wireless and mobile systems. 2012.

Sorry to bother you again. I've looked through the reference [1], but I can't find the Figure 7. Actually I can't figure out the why can you use the SNR and the MCS to get the rx_prob, because the Figure A.4 in Annex A of 3GPP TR 36.942 only shows the SNR, MCS and throughput, how can these get the rx probability? Can you explain it more, thank you! (plus: I want to know how you get the value of snr in mcs_codeset.csv?)