Majid Al-RaimiReference sheetالورقة المرجعية

COE 558Lecture 01المحاضرة 01Referenceالمرجع

Reference sheetالورقة المرجعية

Introduction compressed onto one page: the definitions, formulas and numbers to have in your head before a quiz or exam.محاضرة «مقدمة» مضغوطة في صفحة واحدة: التعريفات والمعادلات والأرقام التي يجب أن تكون حاضرة في ذهنك قبل الاختبار القصير أو الامتحان.

TCP/IP stackمكدس TCP/IP

Five layers, bottom-up PL, DLL, NL, TL, AL. Each payload is the PDU of the layer above. Part 03: TCP/IP stack

خمس طبقات، من الأسفل إلى الأعلى: PL، DLL، NL، TL، AL. حمولة (payload) كل طبقة هي الـ PDU الخاصة بالطبقة التي فوقها. الجزء 03: مكدس TCP/IP

LayerالطبقةPDUPDUPayloadالحمولة (payload)ProtocolsالبروتوكولاتConnectionالاتصالAddressالعنوان
ApplicationالتطبيقاتMessageرسالة (message)Application bytesبايتات التطبيقHTTP, SMTP, IMAPHTTP, SMTP, IMAPProcess to process, rides on E2Eمن عملية إلى عملية (process to process)، ويعتمد على E2ENoneلا يوجد
TransportالنقلSegment (TCP) or datagram (UDP)Segment مع TCP أو datagram مع UDPMessageرسالة (message)TCP, UDPTCP, UDPE2E, virtual, one per pathE2E، افتراضي (virtual)، واحد لكل مسارPort numberرقم المنفذ (port number)
NetworkالشبكةPacket (datagram)حزمة (packet, datagram)Segment or UDP datagramSegment أو UDP datagramIP, routing protocolsIP وبروتوكولات التوجيه (routing protocols)H2H, virtual, one per pathH2H، افتراضي (virtual)، واحد لكل مسارIP addressعنوان IP
Data linkربط البيانات (data link)Frameإطار (frame)Packetحزمة (packet)Ethernet, 802.11, PPPEthernet, 802.11, PPPP2P, physical, one per hopP2P، فيزيائي (physical)، واحد لكل قفزة (hop)MAC addressعنوان MAC
PhysicalالفيزيائيةBitsبتات (bits)Frame, as signalsإطار (frame) على شكل إشاراتSignal specs of Ethernet and Wi-Fiمواصفات الإشارة في Ethernet وWi-FiThe medium itselfالوسط نفسه (medium)Noneلا يوجد
Layer, PDU, payload, protocols, connection scope and addressالطبقة والـ PDU والحمولة والبروتوكولات ونطاق الاتصال والعنوان

Sockets, TCP and UDPالـ Sockets وTCP وUDP

socket=(IP,port)\text{socket} = (\text{IP}, \text{port}) names one endpoint. A connection is the pair of sockets, and a flow is the 5-tuple (src IP, dst IP, protocol, src port, dst port). Ports: 0 to 1023 system, 1024 to 49151 user, 49152 to 65535 dynamic. Part 05: Sockets and web apps

socket=(IP,port)\text{socket} = (\text{IP}, \text{port}) يسمّي طرفًا واحدًا (endpoint). الاتصال (connection) هو زوج من الـ sockets، والتدفق (flow) هو الـ 5-tuple (src IP، dst IP، البروتوكول، src port، dst port). نطاقات المنافذ: 0 to 1023 للنظام (system)، و1024 to 49151 للمستخدم (user)، و49152 to 65535 ديناميكية (dynamic). الجزء 05: الـ Sockets وتطبيقات الويب

PropertyالخاصيةTCPTCPUDPUDP
POSIX typeنوع POSIXSOCK_STREAMSOCK_STREAMSOCK_DGRAMSOCK_DGRAM
SetupالإعدادThree-way handshake before dataمصافحة ثلاثية (three-way handshake) قبل إرسال البياناتNone, each datagram stands aloneلا يوجد، فكل datagram مستقل بذاته
DeliveryالتسليمLoss detected and retransmittedيُكتشف الفقد ويُعاد الإرسالNo delivery or duplicate guaranteeلا ضمان للتسليم ولا لعدم التكرار
OrderingالترتيبIn-order byte streamتدفق بايتات مرتّب (in-order byte stream)May arrive out of orderقد تصل بغير ترتيبها
BoundariesالحدودContinuous stream, no boundariesتدفق متصل بلا حدود بين الرسائلOne datagram is one messageكل datagram رسالة واحدة
Headerالترويسة20 bytes minimum plus connection state20 bytes على الأقل، إضافة إلى حالة الاتصال (connection state)8 bytes, no state8 bytes، بلا حالة
FitsيناسبWeb pages, file transfer, APIsصفحات الويب ونقل الملفات والـ APIsLive voice and video, DNS queries, QUICالصوت والفيديو المباشران، واستعلامات DNS، وQUIC
TCP socket versus UDP socketsocket من نوع TCP مقابل socket من نوع UDP

Decentralized versus distributedاللامركزي (decentralized) مقابل الموزَّع (distributed)

Two independent dimensions, not opposites. Bitcoin is both. Part 04: Network applications

بُعدان مستقلان، وليسا متضادين. Bitcoin لامركزي وموزَّع معًا. الجزء 04: تطبيقات الشبكة

AspectالجانبDecentralizedاللامركزي (decentralized)Distributedالموزَّع (distributed)
What is splitما الذي يُقسَّمThe application, into separate client and server programsالتطبيق، إلى برنامجين منفصلين للعميل والخادمThe computation and state, across client, server or many machinesالحوسبة والحالة (state)، على العميل أو الخادم أو على أجهزة كثيرة
Stressesما الذي يركّز عليهStructure: programs talking through a protocol and socketsالبنية: برامج تتحادث عبر بروتوكول وعبر socketsResources: where compute and state liveالموارد: أين توجد الحوسبة والحالة
Lecture exampleمثال المحاضرةBitTorrent, BitcoinBitTorrent وBitcoinGoogle CloudGoogle Cloud
Design-space axisمحور فضاء التصميمVertical: which layerرأسي: أي طبقةHorizontal: which compute or storage resourceأفقي: أي مورد حوسبة أو تخزين
The lecture's definitionsتعريفات المحاضرة

Edge-to-cloud layersطبقات الامتداد من الطرف إلى السحابة (edge-to-cloud)

Going outward, proximity falls and resources rise. Chain order: device, mist, near edge, far edge, fog, regional cloud, cloud. Part 08: Edge, fog and cloud

كلما اتجهنا إلى الخارج يقل القرب ويزداد حجم الموارد. ترتيب السلسلة: device، mist، near edge، far edge، fog، regional cloud، cloud. الجزء 08: Edge وfog وcloud

LayerالطبقةProximityالقربResourcesالمواردRoleالدورExamplesأمثلة
Mistالضباب الدقيق (mist)ClosestالأقربVery limitedمحدودة جدًاImmediate, local decisionsقرارات فورية ومحليةSensor chip, Raspberry Pi Picoشريحة مستشعر، Raspberry Pi Pico
Near edgeالطرف القريب (near edge)Very closeقريب جدًاLimited to moderateمحدودة إلى متوسطةLocal processingمعالجة محليةHome router, Raspberry Pi 4موجّه منزلي (home router)، Raspberry Pi 4
Far edgeالطرف البعيد (far edge)CloseقريبModerate to highمتوسطة إلى عاليةLow-latency applicationsتطبيقات منخفضة زمن التأخير (low-latency)Jetson Orin Nano, AWS Wavelength ZoneJetson Orin Nano، AWS Wavelength Zone
Fog or regionalالضباب (fog) أو الطبقة الإقليمية (regional)IntermediateمتوسطHighعاليةAggregation and coordinationالتجميع والتنسيقMetro micro data center, Azure Stack Edgeمركز بيانات مصغّر داخل المدينة (metro micro data center)، Azure Stack Edge
Cloudالسحابة (cloud)DistantبعيدVery highعالية جدًاLarge-scale computation and storageحوسبة وتخزين على نطاق واسعAWS Region and its availability zonesAWS Region ومناطق التوافر (availability zones) التابعة لها
E2C layersطبقات الامتداد من الطرف إلى السحابة (E2C)

Latency formulasمعادلات زمن التأخير (latency)

One-way lower bound from geodesic distance at c ≈ 300,000 km/s: about 3.3 ms per 1,000 km. Fiber runs near 200,000 km/s, so about 1.5× the bound. Part 07: Latency

الحد الأدنى في اتجاه واحد من المسافة الجيوديسية عند c ≈ 300,000 km/s: حوالي 3.3 ms لكل 1,000 km. الإشارة في الألياف الضوئية (fiber) تسير بقرابة 200,000 km/s، أي حوالي 1.5× من هذا الحد. الجزء 07: زمن التأخير

LatencyLB=dgeodesicc,RTTLB=2 dgeodesicc\text{Latency}_{LB} = \dfrac{d_{\text{geodesic}}}{c},\qquad \text{RTT}_{LB} = \dfrac{2\,d_{\text{geodesic}}}{c}
Lower bound, one way and round tripالحد الأدنى في اتجاه واحد وفي رحلة الذهاب والعودة
dprop=dsdtrans=LRd_{\text{prop}} = \dfrac{d}{s}\qquad d_{\text{trans}} = \dfrac{L}{R}
d: link length, s: signal speed, L: bits, R: bits per secondd: طول الرابط، s: سرعة الإشارة، L: عدد البتات، R: بت في الثانية
dnodal=dproc+dqueue+dtrans+dpropd_{\text{nodal}} = d_{\text{proc}} + d_{\text{queue}} + d_{\text{trans}} + d_{\text{prop}}
Per node, summed over every hopلكل عقدة، مجموعًا على كل القفزات

Response time and budget. Part 09: Mapping tasks, Part 10: Latency budget

زمن الاستجابة (RT) والميزانية (τ). الجزء 09: توزيع المهام، الجزء 10: ميزانية زمن التأخير

RT=L1+PT+L2≤τRT = L_1 + PT + L_2 \le \tau
Out, processing, back, within the budget τالذهاب ثم المعالجة ثم العودة، ضمن الميزانية τ
RT=Lc→e+PT1+Le→f+PT2+Lf→e+PT3+Le→cRT = L_{c \to e} + PT_1 + L_{e \to f} + PT_2 + L_{f \to e} + PT_3 + L_{e \to c}
Mapping 4: every hop plus every taskالتوزيع 4: كل قفزة مضافًا إليها كل مهمة

The four delaysأنواع التأخير الأربعة

DelayالتأخيرWhereأين يحدثDriven byما الذي يحددهFormula or factorالمعادلة أو العامل
Processingالمعالجة (processing)Inside each router, switch or hostداخل كل موجّه أو محوّل أو جهاز طرفي (host)Header and error checks, forwarding lookupفحص الترويسة والأخطاء، والبحث في جدول التمرير (forwarding lookup)Device speed, usually microsecondsسرعة الجهاز، وعادة يكون بالميكروثانية
Queueingالطابور (queueing)Router and server buffersالمخازن المؤقتة (buffers) في الموجّهات والخوادمCongestion ahead of your packetالازدحام الموجود أمام حزمتكTraffic intensity, zero to very largeشدة حركة المرور (traffic intensity)، من صفر إلى كبير جدًا
Transmissionالإرسال (transmission)Network interface pushing bits outواجهة الشبكة وهي تدفع البتات إلى الخارجPacket size and bandwidthحجم الحزمة وعرض النطاق (bandwidth)L / RL / R
Propagationالانتشار (propagation)The physical channelالقناة الفيزيائيةLink length and mediumطول الرابط ونوع الوسطd / sd / s
Where each delay happensأين يحدث كل نوع من التأخير
RegionالمنطقةGeodesicالمسافة الجيوديسيةBound one way / RTTالحد في اتجاه واحد / RTTMeasured RTTالـ RTT المقاسRatioالنسبة
Frankfurt (eu-central-1)فرانكفورت (eu-central-1)≈4,390 km≈4,390 km14.6 ms / 29.3 ms14.6 ms / 29.3 ms100 ms100 ms≈3.4×≈3.4×
Tokyo (ap-northeast-1)طوكيو (ap-northeast-1)≈8,300 km≈8,300 km27.7 ms / 55.3 ms27.7 ms / 55.3 ms163 ms163 ms≈2.9×≈2.9×
Oregon (us-west-2)أوريغون (us-west-2)≈11,900 km≈11,900 km39.7 ms / 79.4 ms39.7 ms / 79.4 ms243 ms243 ms≈3.1×≈3.1×
From Dammam: measured RTT is about 3× the round-trip boundمن الدمام: الـ RTT المقاس يقارب 3× الحد الأدنى ذهابًا وإيابًا

The four mappingsالتوزيعات الأربعة (mappings)

Pipeline T1 resize, T2 detect, T3 draw. Part 09: Mapping tasks

خط المعالجة (pipeline): T1 تغيير الحجم (resize)، T2 الكشف (detect)، T3 الرسم (draw). الجزء 09: توزيع المهام

MappingالتوزيعWhere T1, T2, T3 runأين تعمل T1 وT2 وT3Strengthsنقاط القوةWeaknessesنقاط الضعفExampleمثال
11All in the cloudكلها في السحابةConsistency, simple client, easy scalingالاتساق، وعميل بسيط، وسهولة التوسعLarge L1 and L2, unfit for AR or gamingL1 وL2 كبيران، فلا يناسب AR ولا الألعابPhoto tagging in a distant data centerوسم الصور (photo tagging) في مركز بيانات بعيد
22All on the deviceكلها على الجهازNo network, privacy, works offlineلا حاجة للشبكة، وخصوصية، ويعمل دون اتصالBattery, limited hardware, long PTالبطارية، والعتاد المحدود، وPT طويلSmartwatch activity recognitionالتعرف على النشاط في الساعة الذكية
33All at the edgeكلها على الطرف (edge)Low latency, data stays localزمن تأخير منخفض، والبيانات تبقى محليةLimited reach, limited scalabilityنطاق وصول محدود، وقابلية توسع محدودةRetail store analyticsتحليلات متاجر التجزئة
44T1 edge, T2 fog, T3 edgeT1 على edge، وT2 على fog، وT3 على edgeShared model, more compute, model updatesنموذج مشترك، وحوسبة أكثر، وتحديثات للنموذجExtra inter-layer hops and transfer costقفزات إضافية بين الطبقات وكلفة نقل البياناتSmart-city traffic camerasكاميرات المرور في المدينة الذكية
Strengths and weaknessesنقاط القوة ونقاط الضعف

New York client, California cloudعميل في نيويورك وسحابة في كاليفورنيا

Worked numbersأرقام محلولة

Termsالمكوّنات
L1 = 70 ms, PT = 30 ms, L2 = 70 msL1 = 70 ms, PT = 30 ms, L2 = 70 ms
Response timeزمن الاستجابة
70 + 30 + 70 = 170 ms
Computation shareحصة الحوسبة
30 / 170 ≈ 17.6%, network 140 / 170 ≈ 82%30 / 170 ≈ 17.6%، والشبكة 140 / 170 ≈ 82%
Server 2x fasterخادم أسرع بمرتين
70 + 15 + 70 = 155 ms, speedup 170 / 155 ≈ 1.097x (about 9%)70 + 15 + 70 = 155 ms، والتسريع (speedup) 170 / 155 ≈ 1.097x (حوالي 9%)
Infinitely fast serverخادم لا نهائي السرعة
70 + 0 + 70 = 140 ms, ceiling 170 / 140 ≈ 1.21x70 + 0 + 70 = 140 ms، والسقف 170 / 140 ≈ 1.21x
Amdahl checkالتحقق بقانون Amdahl
f = 30/170, k = 2: 1 / (0.8235 + 0.0882) ≈ 1.097
S=1(1−f)+f/kS = \frac{1}{(1 - f) + f/k}
Amdahl: the unimproved network caps the speedupAmdahl: الشبكة غير المحسَّنة تحد من التسريع

Design exercise methodطريقة حل تمرين التصميم

Same four steps for smart glasses, warehouse AR and VR. Part 10: Latency budget

الخطوات الأربع نفسها للنظارات الذكية (smart glasses) وAR في المستودعات وVR. الجزء 10: ميزانية زمن التأخير

Four stepsأربع خطوات

1. List the tasks1. اسرد المهام
Break the app into its pipeline: capture, compress, detect or recognize, render, store, retrain.قسّم التطبيق إلى خط المعالجة (pipeline) الخاص به: الالتقاط، والضغط، والكشف أو التعرّف، والتصيير (render)، والتخزين، وإعادة التدريب.
2. Set τ per task2. حدد τ لكل مهمة
Cite published budgets: 20 ms motion-to-photon for XR (RFC 9699), 370 to 1000 ms face recognition, 150 ms one-way voice (G.114). Storage and training have no deadline.استشهد بميزانيات منشورة: 20 ms من الحركة إلى الصورة (motion-to-photon) في XR (RFC 9699)، و370 to 1000 ms للتعرّف على الوجه، و150 ms في اتجاه واحد للصوت (G.114). أما التخزين والتدريب فليس لهما موعد نهائي.
3. Place each task3. ضع كل مهمة في مكانها
Rendering and tracking on the device (mist), heavy inference offloaded to a nearby edge, storage and training in the cloud.التصيير والتتبّع على الجهاز (mist)، والاستدلال الثقيل (inference) يُنقل إلى edge قريب، والتخزين والتدريب في السحابة.
4. Check RT and trade-offs4. تحقق من RT والمفاضلات
Write RT = out + PT + back with numbers against τ per task, then weigh battery, heat, privacy, cost and scale.اكتب RT = out + PT + back بالأرقام مقابل τ لكل مهمة، ثم وازن بين البطارية والحرارة والخصوصية والكلفة وقابلية التوسع.
  • Worked check at τ = 100 ms: fog 20 + 70 + 20 = 110 ms fails, edge 5 + 70 + 5 = 80 ms passes.تحقق محلول عند τ = 100 ms: الـ fog يعطي 20 + 70 + 20 = 110 ms فيفشل، والـ edge يعطي 5 + 70 + 5 = 80 ms فينجح.
  • Check budgets at a percentile, not the mean. A faster CPU only shrinks PT.تحقق من الميزانيات عند نسبة مئوية (percentile)، لا عند المتوسط. المعالج (CPU) الأسرع يقلّص PT فقط.

Slide errataأخطاء الشرائح

Answer with the corrected fact, and name the slide version if a question depends on it. Part 01: Course map

أجب بالمعلومة المصحَّحة، واذكر نسخة الشريحة إذا كان السؤال يعتمد عليها. الجزء 01: خريطة المقرر

What the slides get wrongما تخطئ فيه الشرائح

Slide 5الشريحة 5
Deployment models (public, private, hybrid, multi-cloud) differ from NIST: private, community, public, hybrid.نماذج النشر (عامة public، خاصة private، هجينة hybrid، متعددة السحابات multi-cloud) تختلف عن تعريف NIST: خاصة، ومجتمعية (community)، وعامة، وهجينة.
Slide 18الشريحة 18
100 W x 10 h = 1,000 Wh = 1 kWh, an energy, not 1,000 watts.100 W x 10 h = 1,000 Wh = 1 kWh، وهذه طاقة، وليست 1,000 watts.
Slide 25الشريحة 25
Email is an application (SMTP, IMAP), and MAC addresses are an addressing scheme, not protocols.البريد الإلكتروني تطبيق (SMTP، IMAP)، وعناوين MAC نظام عنونة، وليست بروتوكولات.
Slide 26الشريحة 26
Point-to-Point means one hop between adjacent interfaces, not PPP or peer-to-peer.Point-to-Point تعني قفزة واحدة بين واجهتين متجاورتين، وليست PPP ولا peer-to-peer.
Slide 28الشريحة 28
IP plus port names one socket. A connection needs both endpoints plus protocol (the 5-tuple).عنوان IP مع رقم المنفذ يسمّيان socket واحدًا. أما الاتصال فيحتاج الطرفين معًا إضافة إلى البروتوكول (الـ 5-tuple).
Slide 37الشريحة 37
The socket is the endpoint. TCP establishes the connection; UDP never does.الـ socket هو الطرف (endpoint). TCP ينشئ الاتصال، وUDP لا ينشئه أبدًا.
Slide 42الشريحة 42
TCP data can be lost in the network; TCP detects and retransmits. More than two socket types exist.بيانات TCP قد تُفقد في الشبكة، وTCP يكتشف ذلك ويعيد الإرسال. وتوجد أنواع من الـ sockets أكثر من نوعين.
Slide 45الشريحة 45
"Font-end" means Front-end. server.route is the hapi framework on Node.js."Font-end" المقصود بها Front-end. وserver.route هو إطار hapi على Node.js.
Slide 48الشريحة 48
"Layer 1, 2, 3" are path tiers. Switching is layer 2, routing layer 3."Layer 1, 2, 3" هي مستويات للمسار (path tiers). التبديل (switching) في الطبقة 2، والتوجيه (routing) في الطبقة 3.
Slide 49الشريحة 49
The 1 / 5 / 15 ns figures are a ranking only; main memory is about 90 ns.أرقام 1 / 5 / 15 ns للترتيب فقط، والذاكرة الرئيسية تحتاج حوالي 90 ns.
Slide 54الشريحة 54
Use geodesic, not planar, distance. Oregon is about 11,900 km, so 39.7 ms, not 37 ms.استخدم المسافة الجيوديسية (geodesic) لا المستوية (planar). أوريغون على بعد حوالي 11,900 km، فالنتيجة 39.7 ms لا 37 ms.
Slides 60, 71الشريحتان 60 و71
The pictured board is a Raspberry Pi 4 single-board computer, not a microcontroller board.اللوحة المصوّرة حاسوب أحادي اللوحة (single-board computer) من نوع Raspberry Pi 4، وليست لوحة متحكّم دقيق (microcontroller).
Slide 72الشريحة 72
Compare RT, not latency, with τ.قارن RT مع τ، لا زمن التأخير (latency).
Slide 76الشريحة 76
Captions skip the device layer, which must run tracking for a 20 ms XR budget.التعليقات التوضيحية تتجاهل طبقة الجهاز، وهي الطبقة التي يجب أن تشغّل التتبّع لتحقيق ميزانية XR البالغة 20 ms.
Slide 77الشريحة 77
RT = f(Latency, PT) means the sum of every hop plus every task's PT.RT = f(Latency, PT) تعني مجموع كل القفزات إضافة إلى PT لكل مهمة.