Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/lessons/networking/_order.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- routers
- wifi
- bluetooth
- cell-towers
- latency-and-bandwidth
- packet-switching
- tcp
Expand Down
72 changes: 72 additions & 0 deletions content/lessons/networking/cell-towers/ar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: 'أبراج الاتصالات: كيف ينقلك هاتفك من برج إلى آخر'
summary: >-
يسمع هاتفك عدة أبراج في وقت واحد، وحين تتحرك ينقل مكالمتك من برج إلى الذي
يليه، لكنه ينتظر حتى يصبح البرج الجديد أقوى بوضوح، فلا يتأرجح بين البرجين.
parameters:
d: d — بُعدك عن البرج A (البرج B على بُعد 6 km منه)
n: n — سرعة ضعف الإشارة (2 في الريف المفتوح، 4 في وسط المدينة)
H: H — هامش التسليم
variables:
- الإشارة التي يستقبلها هاتفك من برج، بوحدة dBm (من البرج A أو من البرج B)
- الإشارة على بُعد 1 km من البرج، وهي هنا −75 dBm
- سرعة ضعف الإشارة مع المسافة، 2 في الريف المفتوح وحتى 4 في وسط مدينة مزدحمة
- بُعدك عن البرج بالكيلومتر (عن البرج A أو عن البرج B)
- هامش التسليم، أي بكم يجب أن يزيد البرج B قوةً قبل أن ينتقل إليه الهاتف، بوحدة dB
---

## Try it

1. اسحب d من 0.2 نحو 6، فيمشي هاتفك في الطريق من البرج A إلى البرج B. ينزل المنحنى الأزرق ويصعد البرتقالي.
2. قف عند 3 km في المنتصف. البرجان متساويان في القوة، ومع ذلك يبقى الهاتف على البرج A. تابع المشي حتى يعبر خط التسليم المتقطع.
3. ارفع H فيبتعد خط التسليم عن المنتصف. وارفع n (مدينة أكثر ازدحامًا) فينزل المنحنيان أسرع، وتهبط إشارتك أكثر قبل الانتقال.

## Real-life examples

- **في الطريق إلى المدرسة.** على بُعد 1.5 km من البرج A في حي سكني، الإشارة نحو −80 dBm بأربعة أعمدة كاملة، والبرج B على بُعد 4.5 km لا يقترب منه.
- **في السيارة عبر الريف.** الأرض المفتوحة تُضعف الإشارة ببطء (n = 2.4). بعد المنتصف بقليل صار البرج B أقوى بـ 3.5 dB، أي أكثر من هامش 3 dB، فانتقلت المكالمة إليه دون أن تشعر.
- **في وسط المدينة، عالقًا على البرج القديم.** مدينة مزدحمة (n = 3.8) وهامش واسع قدره 10 dB. عند 3.8 km صار البرج B أقوى بـ 9 dB لا بـ 10، فيبقى الهاتف على البرج A عند نحو −97 dBm بعمودين فقط.

## Test yourself

1. امشِ مسافة تكفي لينقلك هاتفك إلى البرج B.
2. قف عند 3.5 km وابقَ على البرج A، مع أن البرج B صار أقوى هناك.
3. في مدينة مزدحمة (n يساوي 3.5 أو أكثر)، اجعل إشارتك تهبط دون −95 dBm قبل أن يترك الهاتف البرج A.

## Intuition

برج الاتصالات جهاز راديو ينادي في كل الاتجاهات. كلما ابتعدت عنه خفت صوته، والمباني تمتص منه أكثر. يسمع هاتفك كل الأبراج القريبة، ويقيس قوة كل واحد منها بوحدة dBm. في الرسم، المنحنى الأزرق هو البرج A والبرتقالي هو البرج B. اسحب d وراقب هاتفك يتحرك في الطريق بينهما.

في منتصف الطريق يتساوى البرجان. قد تتوقع أن يقفز الهاتف إلى البرج B هناك، لكنه ينتظر حتى يصبح B أقوى بوضوح، بمقدار H ديسيبل، وهذا هو هامش التسليم. لولا هذا الهامش لتأرجح هاتف واقف قرب المنتصف بين البرجين كل ثانية مع كل اهتزاز في الإشارة. لذلك يحدث الانتقال بعد المنتصف بقليل، عند الخط المتقطع. والخط العريض هو الإشارة التي يستعملها هاتفك فعلًا، فهي تهبط وأنت تبتعد عن A، ثم تقفز إلى أعلى حين تنتقل المكالمة إلى B.

## Formal

تضعف الإشارة مع المسافة وفق نموذج المسافة اللوغاريتمي، $P = P_1 - 10\,n\,\log_{10} d$ بوحدة dBm. هنا $P_1$ هي الإشارة على بُعد 1 km من البرج (−75 dBm في هذا الدرس)، و$d$ بالكيلومتر. الأس $n$ يساوي 2 في الهواء المفتوح، ويرتفع إلى 3 أو 4 في المدن، لأن المباني تحجب الموجات وتبعثرها. وكلما صارت المسافة عشرة أضعاف خسرت $10n$ ديسيبل.

اطرح إشارة برج من إشارة الآخر فيختفي الحدّ $P_1$، ويبقى $P_B - P_A = 10\,n\,\log_{10} (d_A / d_B)$. ينتقل الهاتف حين يتجاوز هذا الفرق الهامش $H$. وإذا مشيت من A إلى B على طريق طوله $D$ (هنا 6 km)، يحدث الانتقال عند $d_A = D\,r/(1+r)$، حيث $r = 10^{H/(10n)}$. هذه النقطة بعد المنتصف بقليل، وتبتعد عنه أكثر كلما كبر $H$ أو صغر $n$.

## Advanced

في شبكات LTE و5G يقيس هاتفك إشارة مرجعية من كل خلية قريبة (RSRP، وهي قراءة dBm التي تتابعها هنا)، ويرسل القياسات إلى الشبكة، والشبكة هي التي تقرر. القاعدة السابقة هي «الحدث A3» المعياري، أي أن تصبح خلية مجاورة أفضل من الخلية الحالية بهامش محدد، وأن يدوم ذلك مدة تسمى time-to-trigger، عادة بين 40 و640 ms. وهذا الشرط الزمني حارس ثانٍ ضد التأرجح، فلحظة قصيرة بين مبنيين لا تكفي للانتقال.

يحمل البرج عادة ثلاث لوحات، تغطي كل واحدة قطاعًا من 120°، فالبرج الواحد في الحقيقة ثلاث خلايا، وقد تنتقل بين قطاعاته وأنت تدور حوله. والهاتف الخامل يقوم بنسخة أخف تسمى إعادة اختيار الخلية (cell reselection) دون أن يسأل الشبكة، أما أثناء مكالمة أو جلسة بيانات فالشبكة هي التي توجّه الانتقال. ثم إن الخلية لا تحدّها الإشارة وحدها، فكل من فيها يتقاسم سعتها، ولهذا تضيف المدن خلايا أكثر وأصغر بدل أبراج أعلى صوتًا.

## Derivation

1. اكتب الصيغة نفسها لكل برج بمسافتك إليه، $d_A$ إلى البرج A و$d_B$ إلى البرج B.
2. اطرح إحداهما من الأخرى. يختفي $P_1$، ويصير الفرق بين لوغاريتمين لوغاريتمَ نسبة، فلا يهم إلا النسبة بين المسافتين.
3. لا ينتقل الهاتف لحظة يصبح B أقوى. ينتظر حتى يتجاوز الفرق الهامش $H$، وبهذا لا يتأرجح بين البرجين قرب المنتصف.

## Real world

### مكالمات تصمد على الطريق السريع
بسرعة 100 km/h تعبر كل خلية في المدينة في نحو دقيقة. وينقل التسليم مكالمتك من برج إلى آخر في بضع عشرات من أجزاء الألف من الثانية، فلا تسمع الانتقال أبدًا.

### أعمدة تختفي في المصعد
المصعد المعدني أو القبو يضيف عشرات الديسيبلات من الخسارة فوق خسارة المسافة. فإذا لم يسمع الهاتف برجًا أقوى من نحو −115 dBm كتب «لا توجد خدمة».

### خلايا صغيرة في المدن
في وسط المدينة تضعف الإشارة بسرعة، ويتقاسم آلاف الناس كل خلية. لذلك يضع المشغّلون خلايا صغيرة على أعمدة الإنارة وأسطح المباني، بين الواحدة والأخرى بضع مئات من الأمتار.

### الملاعب والمهرجانات
حين يجتمع خمسون ألف شخص في ملعب واحد، يجلب المشغّلون أبراجًا على شاحنات توقف بجانبه طوال اليوم، فيخدم كل برج عددًا أقل من الهواتف.
73 changes: 73 additions & 0 deletions content/lessons/networking/cell-towers/en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: 'Cell towers: how your phone hands you from one to the next'
summary: >-
Your phone hears several cell towers at once, and as you move it hands your call
from one to the next, waiting until the new one is clearly better so it never
flips back and forth.
parameters:
d: d — how far you are from tower A (tower B is 6 km away)
n: n — how fast the signal fades (2 open country, 4 dense city)
H: H — the handover margin
variables:
- the signal your phone receives from a tower, in dBm (from tower A or from tower B)
- the signal 1 km from a tower, here −75 dBm
- 'how fast the signal fades with distance: 2 in open country, up to 4 in a dense city'
- your distance from a tower, in km (to tower A or to tower B)
- 'the handover margin: how much stronger tower B must be before the phone switches, in dB'
---

## Try it

1. Drag d from 0.2 towards 6: your phone walks down the road from tower A to tower B. The blue curve falls and the orange one rises.
2. Stop at 3 km, the middle. Both towers are equally strong, yet the phone stays on tower A. Keep walking until it crosses the dashed handover line.
3. Raise H and the handover line moves further past the middle. Raise n (a denser city) and both curves sink faster, so your bars drop lower before the switch.

## Real-life examples

- **Walking to school in the suburbs.** 1.5 km from tower A in a suburb, the signal is about −80 dBm, four full bars, and tower B, 4.5 km away, is nowhere close.
- **Driving through the countryside.** Open land fades the signal slowly (n = 2.4). Just past the middle, tower B is already 3.5 dB stronger, more than the 3 dB margin, so the call has moved to it without you noticing.
- **Downtown, stuck on the old tower.** A dense city (n = 3.8) and a wide 10 dB margin. At 3.8 km tower B is 9 dB stronger, but not 10, so the phone stays on tower A at about −97 dBm, just two bars.

## Test yourself

1. Walk far enough that your phone hands you over to tower B.
2. Stand at 3.5 km and stay on tower A, even though tower B is already stronger there.
3. In a dense city (n of 3.5 or more), make your signal sink below −95 dBm before the phone lets go of tower A.

## Intuition

A cell tower is a radio that calls out in every direction. The further you walk, the fainter it sounds, and buildings soak up even more of it. Your phone hears every tower nearby and keeps score of each one in dBm. In the picture, the blue curve is tower A and the orange curve is tower B. Drag d and watch your phone move along the road between them.

Halfway along, the two towers sound equally strong. You might expect the phone to jump to tower B right there, but it waits until B is clearly better, by H decibels: the handover margin. Without it, a phone standing near the middle would flip between the towers every second as the signal flickers. So the switch happens a little past the middle, at the dashed line. The thick line is the signal your phone actually uses: it sags as you leave A, then jumps up when the call moves to B.

## Formal

Signal fades with distance following the log-distance model, $P = P_1 - 10\,n\,\log_{10} d$ in dBm. Here $P_1$ is the signal 1 km from the tower (−75 dBm in this lesson) and $d$ is in kilometres. The exponent $n$ is 2 in open air and grows to 3 or 4 in cities, where buildings block and scatter the waves. Every tenfold step in distance costs $10n$ decibels.

Subtract one tower's signal from the other's and the $P_1$ terms cancel, leaving $P_B - P_A = 10\,n\,\log_{10} (d_A / d_B)$. The phone hands over when this difference passes the margin $H$. Walking from A to B along a road of length $D$ (6 km here), that happens at $d_A = D\,r/(1+r)$, where $r = 10^{H/(10n)}$. That point is just past the middle, and further past it when $H$ is bigger or $n$ is smaller.

## Advanced

In LTE and 5G your phone measures a reference signal from every nearby cell (RSRP, the dBm figure you are reading here) and reports it, and the network makes the decision. The rule above is the standard "A3 event": a neighbour better than the serving cell by an offset, for a set time-to-trigger, usually 40 to 640 ms. The time condition is a second guard against ping-pong, so a brief gap between two buildings is not enough to switch.

A tower usually carries three panels, each covering a 120° sector, so one mast is really three cells, and walking around it can hand you between its own sectors. An idle phone does a lighter version called cell reselection without asking the network; only during a call or a data session does the network steer the handover. And a cell is limited by more than signal: everyone in it shares its capacity, which is why cities add more, smaller cells rather than louder towers.

## Derivation

1. Write the same formula for each tower, using your distance to it: $d_A$ to tower A and $d_B$ to tower B.
2. Subtract one from the other. $P_1$ cancels, and a difference of two logarithms becomes the logarithm of a ratio, so only the ratio of the two distances matters.
3. The phone does not switch the moment B is stronger. It waits until the difference passes the margin $H$, so it does not bounce between the towers near the middle.

## Real world

### Calls that survive a motorway
At 100 km/h you cross each cell of a town in about a minute. Handover moves your call from tower to tower in a few tens of milliseconds, so you never hear the switch.

### Bars that vanish in a lift
A metal lift or a basement adds tens of decibels of loss on top of the distance. If the phone hears no tower stronger than about −115 dBm, it shows "No service".

### Small cells in cities
Downtown, signals fade fast and thousands of people share each cell, so carriers add small cells on lamp posts and rooftops a few hundred metres apart.

### Stadiums and festivals
When 50,000 people gather in one field, carriers bring cell towers on trucks and park them beside it for the day, so each tower serves fewer phones.
62 changes: 62 additions & 0 deletions content/lessons/networking/cell-towers/lesson.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
id: cell-towers
subject: networking
difficulty: high-school
equation: P = P_1 - 10\,n\,\log_{10} d
concepts:
- cellular-network
- handover
- path-loss
- signal-strength
prerequisites:
- wifi
related:
- dialer-codes
- latency-and-bandwidth
visualization:
type: cell-towers
visualization3d:
type: cell-towers
parameters:
d:
min: 0.2
max: 5.8
step: 0.1
value: 1.5
unit: km
n:
min: 2
max: 4
step: 0.1
value: 3
H:
min: 0
max: 10
step: 1
value: 3
unit: dB
variables:
- P
- P_1
- n
- d
- H
derivation:
- P_A = P_1 - 10\,n\,\log_{10} d_A \qquad P_B = P_1 - 10\,n\,\log_{10} d_B
- P_B - P_A = 10\,n\,\log_{10} \dfrac{d_A}{d_B}
- '\text{switch to B when } P_B - P_A > H'
charts: []
primary: d
presets:
- d: 1.5
n: 3
H: 3
- d: 3.5
n: 2.4
H: 3
- d: 3.8
n: 3.8
H: 10
challenges:
- check: 10*n*log10(d/(6-d)) > H
- check: abs(d - 3.5) < 0.05 and 10*n*log10(d/(6-d)) <= H
- check: 'n >= 3.5 and (10*n*log10(d/(6-d)) > H ? -75 - 10*n*log10(6-d) : -75 - 10*n*log10(d)) < -95'
2 changes: 2 additions & 0 deletions content/lessons/networking/dialer-codes/lesson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ related:
- packet-switching
visualization:
type: mmi-dialer
visualization3d:
type: mmi-dialer
parameters:
code:
min: 0
Expand Down
21 changes: 21 additions & 0 deletions content/ui/ar/cell-towers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
towers.hint: ▶ اسحب هاتفك على الطريق (أو منزلق d) وراقب أي برج يستعمل
towers.towerA: البرج A
towers.towerB: البرج B
towers.onA: على البرج A
towers.onB: على البرج B
towers.handover: التسليم
towers.middle: المنتصف
towers.fromA: من البرج A
towers.fromB: من البرج B
towers.uses: ما يستعمله هاتفك
towers.waits: B أقوى، والهاتف ينتظر
towers.bars: '{n|zero=لا أعمدة|one=عمود واحد|two=عمودان|few=# أعمدة|many=# عمودًا|other=# عمود}'
towers.noBars: لا توجد خدمة
towers.axisX: البُعد عن البرج A (km)
towers.axisY: الإشارة (dBm)
towers.caption: 'يسمع هاتفك البرجين طوال الوقت، ولا ينقل مكالمتك إلا حين يتفوق البرج الجديد على القديم بالهامش H'
towers.r.dA: إلى البرج A
towers.r.dB: إلى البرج B
towers.r.diff: B ناقص A (الهامش {h} dB)
towers.r.on: متصل بالبرج
towers.r.bars: الأعمدة
12 changes: 12 additions & 0 deletions content/ui/ar/cell-towers3d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
viz3d.towers.walk: ▶ امشِ إلى B
viz3d.towers.pause: ❚❚ توقف
viz3d.towers.restart: ↺ عُد إلى A
viz3d.towers.you: أنت
viz3d.towers.on: 'على البرج {t}'
viz3d.towers.weaker: 'البرج B أضعف بـ {db}'
viz3d.towers.waiting: 'البرج B أقوى بـ {db}، لكن ليس بهامش {h} بعد'
viz3d.towers.moved: 'تفوق البرج B على A بأكثر من {h}، فانتقلت المكالمة'
viz3d.towers.place0: ريف مفتوح
viz3d.towers.place1: ضاحية
viz3d.towers.place2: مدينة
viz3d.towers.place3: مدينة مزدحمة
27 changes: 27 additions & 0 deletions content/ui/ar/mmi-dialer3d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
viz3d.mmi.you: هاتفك
viz3d.mmi.tower: برج الاتصالات
viz3d.mmi.carrier: المشغّل
viz3d.mmi.other: الهاتف الآخر
viz3d.mmi.typing: تكتب الرمز…
viz3d.mmi.out: في طريقه إلى المشغّل
viz3d.mmi.back: الرد في طريقه إليك
viz3d.mmi.replied: 'وصل الرد بعد {ms}'
viz3d.mmi.local: يجيب الهاتف بنفسه، ولا يخرج منه شيء
viz3d.mmi.app: يسلّمه الهاتف إلى تطبيق فيه، ولا يخرج منه شيء
viz3d.mmi.calling: يصل المشغّل إلى الهاتف الآخر عبر البرج القريب منه
viz3d.mmi.ringing: الهاتف الآخر يرنّ
viz3d.mmi.zero: '{ms}، فلا رحلة أصلًا'
viz3d.mmi.slow: 'أبطأ من الحقيقة {k} مرة'
viz3d.mmi.scr.wait: جارٍ تشغيل الرمز…
viz3d.mmi.scr.call: جارٍ الاتصال…
viz3d.mmi.scr.cf: تحويل المكالمات
viz3d.mmi.scr.cf1: 'الصوت: لا تحويل'
viz3d.mmi.scr.ussd: حسابي
viz3d.mmi.scr.ussd1: 1 الرصيد
viz3d.mmi.scr.ussd2: 2 الباقات
viz3d.mmi.scr.ussd3: 3 الشحن
viz3d.mmi.scr.app: اختبار
viz3d.mmi.scr.app1: معلومات الهاتف
viz3d.mmi.scr.app2: إحصاءات الاستخدام
viz3d.mmi.scr.app3: معلومات Wi-Fi
viz3d.mmi.scr.ring: مكالمة واردة
21 changes: 21 additions & 0 deletions content/ui/en/cell-towers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
towers.hint: ▶ drag your phone along the road (or the d slider) and watch which tower it uses
towers.towerA: tower A
towers.towerB: tower B
towers.onA: on tower A
towers.onB: on tower B
towers.handover: handover
towers.middle: middle
towers.fromA: from tower A
towers.fromB: from tower B
towers.uses: what your phone uses
towers.waits: B stronger, phone still waits
towers.bars: '{n|one=# bar|other=# bars}'
towers.noBars: no service
towers.axisX: distance from tower A (km)
towers.axisY: signal (dBm)
towers.caption: 'your phone listens to both towers all the time; it moves your call only when the new one beats the old one by the margin H'
towers.r.dA: to tower A
towers.r.dB: to tower B
towers.r.diff: B minus A (margin {h} dB)
towers.r.on: connected to tower
towers.r.bars: bars
Loading
Loading