Majid Al-RaimiFull guideالشرح الكامل

COE 558Lecture 01المحاضرة 01Full guideالشرح الكامل

Introductionمقدمة

The whole lecture on one page, taught concept by concept. Work through the parts in order, mark each concept once you understand it, and open the slide chips when you want the original slides.المحاضرة كاملة في صفحة واحدة، مشروحة مفهومًا مفهومًا. امشِ على الأجزاء بالترتيب، وعلّم كل مفهوم بعد أن تفهمه، وافتح أزرار الشرائح عندما تريد الرجوع إلى الشرائح الأصلية.

Partsالأجزاء
10
Conceptsالمفاهيم
45
Slidesالشرائح
77
Readingمدة القراءة
270 min270 دقيقة
Understoodما فهمته
0/45 conceptsمفاهيم

Part 01: Course map and syllabusخريطة المقرر والخطة الدراسية

What the course covers, how it is graded, and how to plan the research project from week one.ما يغطيه المقرر، وكيف يُقيَّم، وكيف تخطط للمشروع البحثي من الأسبوع الأول.

3 concepts3 مفاهيم, ، slides 1-7الشرائح 1-7

Why this part mattersلماذا يهمّ هذا الجزء

This course is graded mostly on work you do outside the exam hall. The research project alone is worth 35%. The opening logistics are really a plan: which topics form the foundation, when the Week 8 midterm arrives, and how paper critiques turn into the research question behind your final study. Understand the plan well and you start the project in week one, not week twelve. The topic list is also a map of the skills you need to design a real edge and cloud service, from packaging it in containers to deciding where each step runs.

معظم درجة هذا المقرر تأتي من عمل تنجزه خارج قاعة الامتحان. المشروع البحثي وحده يساوي 35%. أمور التنظيم في بداية المقرر هي في الحقيقة خطة: أي المواضيع تشكّل الأساس، ومتى يأتي امتحان منتصف الفصل في الأسبوع 8، وكيف تتحول المراجعات النقدية للأوراق إلى السؤال البحثي الذي تقوم عليه دراستك النهائية. إذا فهمت الخطة جيدًا فستبدأ المشروع في الأسبوع الأول لا في الأسبوع الثاني عشر. وقائمة المواضيع هي أيضًا خريطة للمهارات التي تحتاجها لتصميم خدمة حقيقية على الحافة (edge) والسحابة (cloud)، من تغليفها في حاويات (containers) إلى تحديد أين تعمل كل خطوة.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why Lecture 01 climbs from system models and networking to latency before it can answer where a task should run.تشرح لماذا تتدرج المحاضرة 01 من نماذج الأنظمة والشبكات إلى زمن الاستجابة (latency) قبل أن تستطيع الإجابة عن مكان تشغيل كل مهمة.
  2. Separate the Internet from the Web, and place each lecture topic in the chain that leads to the latency budget.تفرّق بين الإنترنت (Internet) والويب (Web)، وتضع كل موضوع في المحاضرة في موقعه من السلسلة التي تقود إلى ميزانية زمن الاستجابة (latency budget).
  3. Group the nine course topics into a foundations block and a build-and-operate block, and define image, container, registry, elasticity and the NIST models.تقسّم مواضيع المقرر التسعة إلى كتلة أساسيات وكتلة بناء وتشغيل، وتعرّف image وcontainer وregistry وelasticity ونماذج NIST.
  4. Compute how the 100% splits between coursework and exams, and within the 35% research project.تحسب كيف تتوزع نسبة 100% بين الأعمال الفصلية والامتحانات، وكيف تتوزع نسبة 35% داخل المشروع البحثي.
  5. Plan the project as a pipeline: three-pass paper reading, critiques that end in a research question, and office hours to agree scope early.تخطط للمشروع كخط متتابع (pipeline): قراءة الأوراق على ثلاث مراحل، ومراجعات نقدية تنتهي بسؤال بحثي، وساعات مكتبية للاتفاق على النطاق مبكرًا.

Start from the question this lecture ends on. A client sends images to a pipeline that resizes each image, detects objects and draws bounding boxes. Where should each step run: on the client device, on a nearby edge box, on a fog node or in a distant cloud data center? And which latency number backs that choice? The last part of this lecture builds exactly that answer, and every idea before it supplies one piece.

ابدأ من السؤال الذي تنتهي به هذه المحاضرة. يرسل عميل صورًا إلى خط معالجة (pipeline) يغيّر حجم كل صورة، ويكتشف الأجسام فيها، ثم يرسم حولها مربعات تحديد (bounding boxes). أين يجب أن تعمل كل خطوة: على جهاز العميل، أم على جهاز حافة (edge) قريب، أم على عقدة ضباب (fog)، أم في مركز بيانات سحابي بعيد؟ وما رقم زمن الاستجابة (latency) الذي يبرر هذا الاختيار؟ الجزء الأخير من المحاضرة يبني هذه الإجابة بالضبط، وكل فكرة قبله تقدّم قطعة منها.

The outline looks like a list, but read it as a chain in which each item answers a question the previous one raises. Take the running example of the lecture, a lamp you switch on from a web browser. To build it you first need a model of the system: which parts exist and who talks to whom. That model immediately asks how bytes move between machines, which is the job of the TCP/IP stack. Moving bytes is not enough; the browser and the lamp need a shared language for asking something to happen, and that language is HTTP. Your code then needs a programming interface for sending and receiving over the network, the socket. With those in place you can write an actual application, with a frontend in the browser and a backend on a server.

تبدو خطة المحاضرة كقائمة، لكن اقرأها كسلسلة يجيب فيها كل بند عن سؤال يطرحه البند الذي قبله. خذ المثال الذي ترافقنا به المحاضرة: مصباح تشغّله من متصفح الويب. لكي تبنيه تحتاج أولًا إلى نموذج للنظام: ما الأجزاء الموجودة ومن يتواصل مع من. هذا النموذج يطرح فورًا سؤال كيف تنتقل البايتات بين الأجهزة، وهذه مهمة TCP/IP stack. لكن نقل البايتات لا يكفي، فالمتصفح والمصباح يحتاجان إلى لغة مشتركة لطلب تنفيذ شيء ما، وهذه اللغة هي HTTP. بعد ذلك يحتاج الكود إلى واجهة برمجية للإرسال والاستقبال عبر الشبكة، وهي socket. وعندما تتوفر هذه كلها يمكنك كتابة تطبيق فعلي، له واجهة أمامية frontend في المتصفح وواجهة خلفية backend على خادم.

Only now can you ask the question the course is named after: where should that server run? The range of places between a device and the cloud where computation can live is the edge-to-cloud (E2C) continuum. The tool for choosing a place on it is the latency budget, the ceiling τ that a request's end-to-end response time must stay under. Placement is a latency decision, and latency comes from the network, which is why the lecture cannot skip the networking material to get to the interesting part faster.

الآن فقط يمكنك أن تسأل السؤال الذي سُمّي المقرر باسمه: أين يجب أن يعمل هذا الخادم؟ المدى الممتد من الجهاز إلى السحابة، بكل الأماكن التي يمكن أن تجري فيها الحوسبة، هو edge-to-cloud (E2C) continuum (متصل الحافة إلى السحابة). والأداة التي نختار بها مكانًا عليه هي latency budget (ميزانية زمن الاستجابة)، أي الحد الأعلى τ الذي يجب أن يبقى زمن الاستجابة الكلي للطلب من طرف إلى طرف دونه. اختيار المكان قرار يتعلق بزمن الاستجابة، وزمن الاستجابة مصدره الشبكة، ولهذا لا تستطيع المحاضرة أن تتخطى مادة الشبكات لتصل أسرع إلى الجزء المثير.

Outline itemبند الخطةSite partالجزء في الموقعSlidesالشرائح
Course syllabusتوصيف المقرر (syllabus)Part 1الجزء 11 to 7من 1 إلى 7
Motivationالدافع (Motivation)Part 2الجزء 28 to 21من 8 إلى 21
The Internet (TCP/IP stack)الإنترنت (TCP/IP stack)Part 3الجزء 322 to 29من 22 إلى 29
The Web (HTTP), network applications (sockets) and web developmentالويب (HTTP)، وتطبيقات الشبكة (sockets)، وتطوير الويبParts 4 and 5الجزآن 4 و530 to 45من 30 إلى 45
The E2C continuumمتصل E2C (E2C continuum)Parts 6 to 9الأجزاء من 6 إلى 946 to 71من 46 إلى 71
Latency budget and example E2C applicationsميزانية زمن الاستجابة (latency budget) وأمثلة على تطبيقات E2CPart 10الجزء 1072 to 77من 72 إلى 77
Where each outline item is taught on this siteأين يُشرح كل بند من خطة المحاضرة في هذا الموقع

Recall

Why does the lecture reach the TCP/IP stack before the E2C continuum?لماذا تصل المحاضرة إلى TCP/IP stack قبل E2C continuum؟

You cannot decide where a server should run until you understand how a request travels and what adds delay along the way. Placement on the continuum is a latency decision, and latency comes from the network.
لا يمكنك أن تقرر أين يجب أن يعمل الخادم قبل أن تفهم كيف ينتقل الطلب وما الذي يضيف تأخيرًا على طول الطريق. اختيار المكان على المتصل (continuum) قرار يتعلق بزمن الاستجابة، وزمن الاستجابة مصدره الشبكة.

A syllabus is a contract about scope: it tells you what can appear in exams and what counts as fair ground for your research project. COE 558 has two versions of that contract, and knowing both saves you from picking a project topic that is too narrow.

توصيف المقرر (syllabus) عقد حول النطاق: يخبرك بما يمكن أن يأتي في الامتحانات، وبما يُعدّ مجالًا مقبولًا لمشروعك البحثي. لمقرر COE 558 نسختان من هذا العقد، ومعرفة الاثنتين تحميك من اختيار موضوع مشروع ضيق أكثر من اللازم.

The slides describe what is taught this term. The official KFUPM catalog entry is the formal scope: it lists COE 558 as 3-0-3 (three lecture hours, no lab, three credits) with Graduate Standing as the prerequisite, and its description is broader than the nine topics taught in class.

الشرائح تصف ما يُدرَّس في هذا الفصل. أما مدخل المقرر في الدليل الرسمي لجامعة KFUPM فهو النطاق الرسمي: يذكر COE 558 بصيغة 3-0-3 (ثلاث ساعات محاضرة، بلا معمل، ثلاث ساعات معتمدة)، ومتطلبه السابق هو القيد في الدراسات العليا (Graduate Standing)، ووصفه أوسع من المواضيع التسعة التي تُدرَّس في الصف.

The practical rule: study the taught topics for exams, but when you pick a research topic, anything in either list is in scope. Storage models and big-data frameworks get only one short line in class, yet they are rich research areas.

القاعدة العملية: ذاكر المواضيع المُدرَّسة للامتحانات، لكن عندما تختار موضوعًا بحثيًا فأي شيء في أي من القائمتين داخل النطاق. نماذج التخزين وأطر البيانات الضخمة لا تأخذ في الصف إلا سطرًا قصيرًا واحدًا، ومع ذلك فهي مجالات بحثية غنية.

Nine topics as a stack: the bottom three are the foundations the rest build on.المواضيع التسعة على شكل طبقات: الثلاثة السفلى هي الأساسيات التي يُبنى عليها الباقي.

The foundations: three questions about the same applicationالأساسيات: ثلاثة أسئلة عن التطبيق نفسه

The nine topics split into two blocks. The first three are the foundations, and they read as three questions about the lamp application from the lecture arc.

تنقسم المواضيع التسعة إلى كتلتين. الثلاثة الأولى هي الأساسيات، ويمكن قراءتها كثلاثة أسئلة عن تطبيق المصباح الذي رأيناه في تسلسل المحاضرة.

  1. How do things communicate? Topic 1, this lecture: the TCP/IP stack, client and server roles, sockets, frontend and backend, and how latency shapes a web service on the edge-to-cloud continuum.كيف تتواصل الأشياء؟ الموضوع 1، وهو هذه المحاضرة: TCP/IP stack، ودورا العميل client والخادم server، وsockets، والواجهة الأمامية frontend والخلفية backend، وكيف يؤثر زمن الاستجابة latency في خدمة ويب على edge-to-cloud continuum.
  2. Where can it run, and how is it packaged? Topic 2: system thinking applied to the edge, fog and cloud layers, then virtualization: virtual machines, hypervisors and Docker containers.أين يمكن أن يعمل، وكيف يُغلَّف؟ الموضوع 2: التفكير المنظومي system thinking مطبقًا على طبقات الحافة edge والضباب fog والسحابة cloud، ثم الافتراضية (virtualization): الأجهزة الافتراضية (virtual machines) ومراقبات الأجهزة الافتراضية (hypervisors) وحاويات Docker.
  3. Where should it run? Topic 3: what makes something a cloud, what edge computing adds, and when to combine both.أين يجب أن يعمل؟ الموضوع 3: ما الذي يجعل الشيء سحابة، وما الذي تضيفه حوسبة الحافة (edge computing)، ومتى نجمع بينهما.

Packaging is the first place the course gets concrete. Docker's own documentation gives three short definitions worth memorizing now. An image is a read-only template with instructions for creating a container. A container is a runnable instance of an image. A registry stores images, and Docker Hub is a public registry. A virtual machine, by contrast, runs a whole guest operating system on virtualized hardware managed by a hypervisor, which is why containers are said to deploy faster. Treat that claim as a simplification. Docker says a container is relatively well isolated by default, but containers share the host kernel while each VM runs its own, so faster startup comes with weaker isolation than a VM, a trade-off you will study in topic 2.

التغليف هو أول موضع يصبح فيه المقرر ملموسًا. توثيق Docker نفسه يعطي ثلاثة تعريفات قصيرة تستحق الحفظ من الآن. الصورة (image) قالب للقراءة فقط يحتوي تعليمات إنشاء حاوية. والحاوية (container) نسخة قابلة للتشغيل من صورة. والسجل (registry) يخزّن الصور، وDocker Hub سجل عام. أما الجهاز الافتراضي (VM) فيشغّل نظام تشغيل ضيفًا كاملًا على عتاد افتراضي يديره hypervisor، ولهذا يقال إن الحاويات أسرع في النشر. تعامل مع هذا الادعاء على أنه تبسيط. يقول Docker إن الحاوية معزولة بشكل جيد نسبيًا افتراضيًا، لكن الحاويات تتشارك نواة (kernel) المضيف بينما يشغّل كل VM نواته الخاصة، لذلك يأتي الإقلاع الأسرع مع عزل أضعف من عزل الجهاز الافتراضي، وهذه مقايضة ستدرسها في الموضوع 2.

Once something is packaged, the next question is what it means to run it in a cloud. The standard definition comes from NIST Special Publication 800-145. It names five essential characteristics: on-demand self-service, broad network access, resource pooling, rapid elasticity and measured service. The course emphasizes self-service, scalability and elasticity. NIST describes rapid elasticity as capabilities that can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand.

بعد أن يُغلَّف الشيء، يأتي السؤال التالي: ماذا يعني أن تشغّله في سحابة؟ التعريف المعياري مأخوذ من منشور NIST الخاص رقم 800-145. يذكر خمس خصائص أساسية: الخدمة الذاتية عند الطلب (on-demand self-service)، والوصول الواسع عبر الشبكة (broad network access)، وتجميع الموارد (resource pooling)، والمرونة السريعة (rapid elasticity)، والخدمة المقاسة (measured service). المقرر يركز على الخدمة الذاتية وقابلية التوسع (scalability) والمرونة (elasticity). وتصف NIST المرونة السريعة بأنها قدرات يمكن توفيرها وتحريرها بمرونة، وتلقائيًا في بعض الحالات، لتتوسع بسرعة إلى الخارج وتنكمش إلى الداخل بما يتناسب مع الطلب.

Quick checkاختبار سريع

Which NIST characteristic means capacity scales outward and inward to match demand?أي خاصية من خصائص NIST تعني أن السعة تتوسع إلى الخارج وتنكمش إلى الداخل بما يتناسب مع الطلب؟

Recall

Image, container, registry: one line each.عرّف image وcontainer وregistry في سطر واحد لكل منها.

An image is a read-only template for creating containers. A container is a runnable instance of an image. A registry is a store of images, such as Docker Hub.
الصورة (image) قالب للقراءة فقط لإنشاء الحاويات. والحاوية (container) نسخة قابلة للتشغيل من صورة. والسجل (registry) مخزن للصور، مثل Docker Hub.

Build and operate: the remaining six topicsالبناء والتشغيل: المواضيع الستة الباقية

With the foundations in place, the other six topics move from understanding to building and operating real services. In order: what you rent from a provider (service and deployment models), a real open-source cloud you can run yourself (OpenStack), how services talk to each other (HTTP, REST and JSON through a Web API), how to run them at scale (containers, orchestration, monitoring), how to handle data at Internet scale, and how to keep all of it secure.

بعد أن تستقر الأساسيات، تنتقل المواضيع الستة الأخرى من الفهم إلى بناء خدمات حقيقية وتشغيلها. وهي بالترتيب: ما الذي تستأجره من المزوّد (نماذج الخدمة ونماذج النشر)، وسحابة حقيقية مفتوحة المصدر يمكنك تشغيلها بنفسك (OpenStack)، وكيف تتواصل الخدمات مع بعضها (HTTP وREST وJSON عبر web API)، وكيف تُشغَّل على نطاق واسع (الحاويات والتنسيق orchestration والمراقبة monitoring)، وكيف تُعالَج البيانات على نطاق الإنترنت، وكيف يُحافَظ على أمان ذلك كله.

The thread running through them is the service. Service-oriented architecture builds an application from separate services that talk over the network. Microservices push that idea further: many small services, each deployed on its own. REST (REpresentational State Transfer, capitalized to spell out the acronym) is the usual way those services expose a web API: each thing is a resource with a URL, and clients act on it with standard HTTP methods such as GET and POST.

الخيط الذي يجمعها هو الخدمة. المعمارية الموجهة بالخدمات (service-oriented architecture) تبني التطبيق من خدمات منفصلة تتواصل عبر الشبكة. والخدمات المصغّرة (microservices) تدفع الفكرة أبعد: خدمات صغيرة كثيرة، تُنشر كل منها مستقلة. وREST (REpresentational State Transfer، والأحرف الكبيرة فيها تكوّن الاختصار) هي الطريقة المعتادة التي تعرض بها هذه الخدمات web API: كل شيء مورد (resource) له URL، ويتعامل معه العملاء بطرق HTTP القياسية مثل GET وPOST.

What you rent determines how much of that service stack is yours to manage. NIST defines three service models. With Infrastructure as a Service you rent virtual machines, storage and networks and manage everything above them. With Platform as a Service you deploy your code onto a managed runtime. With Software as a Service you simply use a finished application. NIST also defines four deployment models, which describe who the cloud is for: private, community, public and hybrid.

ما تستأجره يحدد مقدار ما يقع عليك إدارته من طبقات الخدمة. تعرّف NIST ثلاثة نماذج خدمة. في البنية التحتية كخدمة (Infrastructure as a Service) تستأجر أجهزة افتراضية وتخزينًا وشبكات وتدير كل ما فوقها. وفي المنصة كخدمة (Platform as a Service) تنشر كودك على بيئة تشغيل مُدارة. وفي البرمجيات كخدمة (Software as a Service) تستخدم تطبيقًا جاهزًا فحسب. وتعرّف NIST أيضًا أربعة نماذج نشر تصف لمن تكون السحابة: خاصة (private)، ومجتمعية (community)، وعامة (public)، وهجينة (hybrid).

OpenStack makes those models tangible: it is an open-source platform for building your own cloud, assembled from separate services that talk to each other through APIs. In other words, it is itself a service-oriented system. The course names four of its services, and the official documentation describes each in one line.

يجعل OpenStack هذه النماذج ملموسة: هو منصة مفتوحة المصدر لبناء سحابتك الخاصة، مركّبة من خدمات منفصلة تتواصل فيما بينها عبر APIs. بعبارة أخرى، هو نفسه نظام موجّه بالخدمات. يذكر المقرر أربعًا من خدماته، والتوثيق الرسمي يصف كل واحدة منها في سطر.

ServiceالخدمةRoleالدورSourceالمصدر
NovaNovaProvisions compute instances (virtual servers)توفير مثيلات الحوسبة (خوادم افتراضية)OpenStack Nova docsتوثيق OpenStack Nova
KeystoneKeystoneAPI client authentication, service discovery and multi-tenant authorizationمصادقة عملاء الـ API، واكتشاف الخدمات، والتفويض متعدد المستأجرينOpenStack Keystone docsتوثيق OpenStack Keystone
HorizonHorizonThe dashboard: a web-based user interface to the other servicesلوحة التحكم: واجهة مستخدم على الويب للوصول إلى الخدمات الأخرىOpenStack Horizon docsتوثيق OpenStack Horizon
NeutronNeutronNetwork connectivity as a service between interface devicesاتصال شبكي كخدمة بين أجهزة الواجهاتOpenStack Neutron docsتوثيق OpenStack Neutron
Four core OpenStack servicesأربع خدمات أساسية في OpenStack

Quick checkاختبار سريع

Which pairing of OpenStack service and its role is correct?أي ربط بين خدمة من خدمات OpenStack ودورها صحيح؟

Recall

Name the four NIST deployment models.اذكر نماذج النشر الأربعة عند NIST.

Private, community, public and hybrid. Multi-cloud is industry usage, not a NIST model.
خاصة (private)، ومجتمعية (community)، وعامة (public)، وهجينة (hybrid). أما multi-cloud فاستخدام صناعي وليس نموذجًا من نماذج NIST.

Where the scope meets your projectحيث يلتقي نطاق المقرر بمشروعك

Two of the build-and-operate items connect straight back to the placement problem at the end of this lecture. Client-service interaction for cloud and edge deployments is about requests crossing the continuum, and end-to-end processing pipelines are chains of steps that can each run in a different place (a service pipeline). Deciding which step runs on the edge and which in the cloud, under a latency limit, is a natural research direction, for example latency-aware task placement. Start a list of candidate topics now; the next concept explains why that list needs to exist in week one.

بندان من بنود البناء والتشغيل يرتبطان مباشرة بمشكلة اختيار المكان في نهاية هذه المحاضرة. التفاعل بين العميل والخدمة في عمليات النشر على السحابة والحافة يدور حول طلبات تعبر المتصل (continuum)، وخطوط المعالجة من طرف إلى طرف هي سلاسل من الخطوات يمكن أن تعمل كل منها في مكان مختلف (service pipeline). تحديد أي خطوة تعمل على الحافة edge وأيها في السحابة cloud، تحت حد لزمن الاستجابة، اتجاه بحثي طبيعي، مثل توزيع المهام مع مراعاة زمن الاستجابة (latency-aware task placement). ابدأ الآن قائمة بالمواضيع المرشحة، فالمفهوم التالي يشرح لماذا يجب أن تكون هذه القائمة موجودة في الأسبوع الأول.

Start with the numbers, because they decide how you should spend your semester. The course has five assessments, and the research project inside them is split into three components.

ابدأ بالأرقام، لأنها تحدد كيف يجب أن تقضي فصلك الدراسي. في المقرر خمسة تقييمات، والمشروع البحثي من بينها مقسّم إلى ثلاثة مكونات.

Worked exampleمثال محلول

Where the 100% comes fromمن أين تأتي نسبة 100%

  1. Coursework versus examsالأعمال الفصلية مقابل الامتحانات

    Coursework is 10% + 10% + 35% = 55% (assignments, quizzes, project). Exams are 20% + 25% = 45% (midterm, final). More than half the grade is decided outside exam halls.
    الأعمال الفصلية تساوي 10% + 10% + 35% = 55% (الواجبات، والاختبارات القصيرة، والمشروع). والامتحانات تساوي 20% + 25% = 45% (منتصف الفصل، والنهائي). أي أن أكثر من نصف الدرجة يُحسم خارج قاعات الامتحان.
  2. Inside the projectداخل المشروع

    Reviews, seminar and final study give 8% + 7% + 20% = 35%. That makes the project the single largest assessment, bigger than the final exam at 25%.
    المراجعات والسمينار والدراسة النهائية تعطي 8% + 7% + 20% = 35%. وهذا يجعل المشروع أكبر تقييم منفرد، أكبر من الامتحان النهائي الذي يساوي 25%.
  3. One component against one examمكوّن واحد مقابل امتحان واحد

    The final research study alone (20%) weighs exactly as much as the midterm (20%).
    الدراسة البحثية النهائية وحدها (20%) تزن تمامًا ما يزنه امتحان منتصف الفصل (20%).
  4. Resultالنتيجة

    The project, not the exams, is the thing to plan the semester around. The tables add up: 10 + 10 + 35 + 20 + 25 = 100 and 8 + 7 + 20 = 35.
    المشروع، لا الامتحانات، هو ما يجب أن تبني خطة فصلك حوله. والجداول متسقة في مجموعها: 10 + 10 + 35 + 20 + 25 = 100 و8 + 7 + 20 = 35.
Research project: 35 of 100, split inside into reviews 8, seminar 7 and study 20.المشروع البحثي: 35 من 100، مقسّمة داخليًا إلى مراجعات 8 وسمينار 7 ودراسة 20.

Read the rubric as a pipelineاقرأ معايير التقييم كخط متتابع

The three project components are graded separately, but they work best as stages of one pipeline, much like the image pipeline this lecture ends on: each stage consumes the output of the one before it.

تُقيَّم مكونات المشروع الثلاثة كلٌّ على حدة، لكنها تنجح أكثر عندما تعمل كمراحل في خط واحد (pipeline)، يشبه خط معالجة الصور الذي تنتهي به هذه المحاضرة: كل مرحلة تستهلك مخرجات المرحلة التي قبلها.

  • Reviews and critiques (8%). Critical reading, identifying a research gap (a question or setting existing papers leave open), analysing the methodology, weighing strengths and weaknesses, and finally proposing an initial research question. The question is the output of this stage.المراجعات والنقد (8%). القراءة النقدية، وتحديد فجوة بحثية (سؤال أو بيئة تتركها الأوراق الموجودة مفتوحة)، وتحليل المنهجية، ووزن نقاط القوة والضعف، ثم أخيرًا اقتراح سؤال بحثي أولي. السؤال هو مخرج هذه المرحلة.
  • Seminar (7%). Technical understanding, presentation quality, critical discussion and Q&A. You are graded on whether you can defend a paper under questions, not only summarize it, so present a paper close to your research question.السمينار (7%). الفهم التقني، وجودة العرض، والنقاش النقدي، والأسئلة والأجوبة. تُقيَّم على قدرتك على الدفاع عن ورقة تحت الأسئلة، لا على تلخيصها فقط، لذلك اعرض ورقة قريبة من سؤالك البحثي.
  • Final research study (20%). Problem formulation, literature review, proposed methodology, implementation or simulation, results and the final report. That is months of work, not the last two weeks.الدراسة البحثية النهائية (20%). صياغة المشكلة، ومراجعة الأدبيات، والمنهجية المقترحة، والتنفيذ أو المحاكاة، والنتائج، والتقرير النهائي. هذا عمل شهور، لا عمل الأسبوعين الأخيرين.

Quick checkاختبار سريع

Which research project component weighs the same as the midterm exam?أي مكوّن من مكونات المشروع البحثي يزن ما يزنه امتحان منتصف الفصل؟

Quick checkاختبار سريع

According to the grading rubric, what should a paper critique end by proposing?وفق معايير التقييم، بماذا يجب أن تنتهي المراجعة النقدية للورقة؟

Feeding the pipeline: reading papers in three passesتغذية الخط: قراءة الأوراق على ثلاث مراحل

The first stage only works if you can read many papers without drowning in them. S. Keshav's widely used method reads a paper in up to three passes, each deeper than the last, so you spend real time only on the papers that earn it. The first pass takes about 5 to 10 minutes: title, abstract, introduction, section headings and conclusions. It should let you answer the five Cs: category, context, correctness, contributions and clarity. The second pass takes up to an hour: read carefully, skip proofs, study the figures and mark references you have not read.

المرحلة الأولى لا تنجح إلا إذا استطعت قراءة أوراق كثيرة دون أن تغرق فيها. طريقة S. Keshav واسعة الانتشار تقرأ الورقة على ثلاث مراحل (passes) كحد أقصى، كل منها أعمق من سابقتها، فلا تنفق وقتًا حقيقيًا إلا على الأوراق التي تستحقه. المرحلة الأولى تستغرق نحو 5 إلى 10 دقائق: العنوان، والملخص، والمقدمة، وعناوين الأقسام، والخلاصة. ويجب أن تمكّنك من الإجابة عن الأسئلة الخمسة (five Cs): الفئة (category)، والسياق (context)، والصحة (correctness)، والإسهامات (contributions)، والوضوح (clarity). والمرحلة الثانية تستغرق حتى ساعة: اقرأ بعناية، وتخطَّ البراهين، وادرس الأشكال، وعلّم المراجع التي لم تقرأها.

The third pass means virtually re-implementing the paper, making the same assumptions and recreating the work in your head. Keshav estimates about four or five hours for beginners and about an hour for an experienced reader. By the end you can name implicit assumptions and weak points, which is exactly what the critique rubric asks for. For a literature survey he suggests finding three to five recent papers, reading their related-work sections, then following the citations and venues they share.

المرحلة الثالثة تعني إعادة تنفيذ الورقة افتراضيًا: تأخذ الافتراضات نفسها وتعيد بناء العمل في ذهنك. يقدّر Keshav أنها تستغرق نحو أربع أو خمس ساعات للمبتدئ، ونحو ساعة للقارئ المتمرس. في نهايتها تستطيع تسمية الافتراضات الضمنية ونقاط الضعف، وهذا بالضبط ما تطلبه معايير تقييم المراجعة النقدية. ولمسح الأدبيات (literature survey) يقترح أن تجد ثلاث إلى خمس أوراق حديثة، وتقرأ أقسام الأعمال ذات الصلة (related work) فيها، ثم تتبع الاستشهادات وأماكن النشر المشتركة بينها.

Critiques produce the research question the final study builds on. Only the Week 8 midterm has a fixed date.المراجعات النقدية تنتج السؤال البحثي الذي تقوم عليه الدراسة النهائية. وحده امتحان منتصف الفصل في الأسبوع 8 له موعد محدد.

Protecting the pipeline: office hoursحماية الخط: الساعات المكتبية

A pipeline is only as good as its earliest decisions, and in a research project the expensive ones are scope and method. A concept you did not follow can be re-read here. A research question that is too broad, or a methodology the instructor considers infeasible, costs weeks if you discover it at the seminar. That is what office hours are for.

جودة أي خط متتابع تتوقف على قراراته الأولى، وفي المشروع البحثي القرارات المكلفة هي النطاق والمنهج. المفهوم الذي لم تفهمه يمكنك أن تعيد قراءته هنا. أما سؤال بحثي واسع أكثر من اللازم، أو منهجية يراها المحاضر غير قابلة للتنفيذ، فيكلفك أسابيع إذا اكتشفته في السمينار. لهذا وُجدت الساعات المكتبية.

Section, schedule and contact detailsالشعبة والجدول وبيانات التواصل

Sectionالشعبة
558-2558-2
Class timeوقت المحاضرة
Monday and Wednesday, 6:45 PM to 8:00 PMالاثنين والأربعاء، 6:45 PM to 8:00 PM
Venueالقاعة
Building 24, Room 244المبنى 24، الغرفة 244
Instructorالمحاضر
Dr. Muhammad Afaq, muhammad.afaq@kfupm.edu.saد. محمد آفاق (Dr. Muhammad Afaq)، muhammad.afaq@kfupm.edu.sa
Officeالمكتب
22-21622-216
Office hoursالساعات المكتبية
Monday and Wednesday, 3:00 PM to 4:00 PM, or by appointment via email or Teamsالاثنين والأربعاء، 3:00 PM to 4:00 PM، أو بموعد مسبق عبر البريد الإلكتروني أو Teams

The venue is written as Building #24 244, which reads as Building 24, Room 244. If you are unsure on the first day, check the room number on the registrar schedule.

القاعة مكتوبة بصيغة Building #24 244، وتُقرأ: المبنى 24، الغرفة 244. إذا لم تكن متأكدًا في اليوم الأول، فتحقق من رقم الغرفة في جدول عمادة القبول والتسجيل.

Quick checkاختبار سريع

Which assessment carries the largest share of the course grade?أي تقييم يحمل الحصة الأكبر من درجة المقرر؟

Recall

List the three research project components with their weights, and say what each one produces.اذكر مكونات المشروع البحثي الثلاثة مع أوزانها، وقل ماذا ينتج كل منها.

Reviews and critiques (8%) produce an initial research question. The seminar (7%) demonstrates technical understanding under Q&A. The final study (20%) produces the problem formulation, literature review, methodology, implementation or simulation, results and a report.
المراجعات والنقد (8%) تنتج سؤالًا بحثيًا أوليًا. والسمينار (7%) يُظهر الفهم التقني تحت الأسئلة والأجوبة. والدراسة النهائية (20%) تنتج صياغة المشكلة، ومراجعة الأدبيات، والمنهجية، والتنفيذ أو المحاكاة، والنتائج، وتقريرًا.

Recall

What are Keshav's three passes, and roughly how long does each take?ما مراحل القراءة الثلاث عند Keshav، وكم تستغرق كل منها تقريبًا؟

First, a bird's-eye scan in 5 to 10 minutes. Second, a careful read that skips proofs, up to an hour. Third, a virtual re-implementation, about four or five hours for a beginner.
الأولى: مسح سريع شامل في 5 إلى 10 دقائق. الثانية: قراءة متأنية تتخطى البراهين، حتى ساعة. الثالثة: إعادة تنفيذ افتراضية للورقة، نحو أربع أو خمس ساعات للمبتدئ.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • Lecture 01 is a chain: system model, TCP/IP, HTTP, sockets, web apps, then latency and where each task should run on the edge-to-cloud continuum.المحاضرة 01 سلسلة: نموذج النظام، ثم TCP/IP، ثم HTTP، ثم sockets، ثم تطبيقات الويب، ثم زمن الاستجابة وأين يجب أن تعمل كل مهمة على edge-to-cloud continuum.
  • Topics 1 to 3 are the foundations (communication, virtualization, cloud and edge). Topics 4 to 9 cover building, running and securing cloud services. The catalog scope is broader and all of it is fair ground for research.المواضيع 1 إلى 3 هي الأساسيات (التواصل، والافتراضية، والسحابة والحافة). والمواضيع 4 إلى 9 تغطي بناء الخدمات السحابية وتشغيلها وتأمينها. نطاق الدليل الرسمي أوسع، وكله مجال مقبول للبحث.
  • Docker: an image is a read-only template, a container is a running instance, a registry stores images. OpenStack: Nova compute, Keystone identity, Horizon dashboard, Neutron networking.في Docker: الصورة (image) قالب للقراءة فقط، والحاوية (container) نسخة قيد التشغيل، والسجل (registry) يخزّن الصور. وفي OpenStack: Nova للحوسبة، وKeystone للهوية، وHorizon للوحة التحكم، وNeutron للشبكات.
  • NIST has five cloud characteristics, three service models and four deployment models (private, community, public, hybrid). The course lists public, private, hybrid and multi-cloud.عند NIST خمس خصائص للسحابة، وثلاثة نماذج خدمة، وأربعة نماذج نشر (private وcommunity وpublic وhybrid). أما المقرر فيذكر public وprivate وhybrid وmulti-cloud.
  • Grades: assignments 10, quizzes 10, project 35, midterm 20 (Week 8), final 25. Coursework is 55 and exams are 45.الدرجات: الواجبات 10، والاختبارات القصيرة 10، والمشروع 35، ومنتصف الفصل 20 (الأسبوع 8)، والنهائي 25. الأعمال الفصلية 55 والامتحانات 45.
  • Project: reviews 8, seminar 7, final study 20, read as a pipeline. The review stage ends in an initial research question.المشروع: المراجعات 8، والسمينار 7، والدراسة النهائية 20، ويُقرأ كخط متتابع. مرحلة المراجعة تنتهي بسؤال بحثي أولي.
  • Read papers in three passes, review each lecture one to two weeks later, and use office hours to agree project scope.اقرأ الأوراق على ثلاث مراحل، وراجع كل محاضرة بعد أسبوع إلى أسبوعين، واستخدم الساعات المكتبية للاتفاق على نطاق المشروع.

Sourcesالمصادر

Part 02: Designing systems with mental modelsتصميم الأنظمة بالنماذج الذهنية

Ad-hoc versus structured design, and the four questions that turn a lamp in a browser into a system: system, components, relationships, layers.التصميم العشوائي (ad-hoc) مقابل التصميم المنظم، والأسئلة الأربعة التي تحوّل مصباحًا يُدار من المتصفح إلى نظام: النظام، والمكونات، والعلاقات، والطبقات.

6 concepts6 مفاهيم, ، slides 8-21الشرائح 8-21

Why this part mattersلماذا يهمّ هذا الجزء

Every exam question about where a service should run, and every research project architecture, starts the same way: someone draws a system as boxes, arrows and layers. This part gives you a four-question checklist for drawing that picture, the vocabulary to name each arrow precisely (protocol versus interface, safe versus idempotent), and the idea the whole course is built on: the server layer can live in the cloud, in the fog or at the edge.

كل سؤال اختبار عن المكان الذي ينبغي أن تعمل فيه خدمة ما، وكل معمارية لمشروع بحثي، يبدأ بالطريقة نفسها: يرسم أحدهم النظام على شكل صناديق وأسهم وطبقات. يعطيك هذا الجزء قائمة تحقق من أربعة أسئلة لرسم تلك الصورة، والمفردات التي تسمي بها كل سهم بدقة (البروتوكول مقابل الواجهة، والآمن safe مقابل متساوي الأثر idempotent)، والفكرة التي يُبنى عليها المقرر كله: طبقة الخادم يمكن أن توجد في السحابة cloud أو في الضباب fog أو عند الحافة edge.

One running story carries the part. You want to switch a lamp on from Chrome and see how much energy it has used. Each concept adds one layer of precision to that story, until the lamp becomes a small but complete system whose server could run anywhere on the continuum.

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

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why design reasons through a mental model, and why ad-hoc design fails to scale or integrate.أن تشرح لماذا يمر التصميم عبر نموذج ذهني، ولماذا يفشل التصميم المرتجل (ad hoc) في التوسع أو التكامل.
  2. Decompose a system with the four design questions into client, server and device, and justify offloading.أن تفكك نظامًا باستخدام أسئلة التصميم الأربعة إلى عميل (client) وخادم (server) وجهاز (device)، وأن تبرر نقل المعالجة (offloading).
  3. Define a relationship as protocol plus interface and keep lower-level relationships out of scope on purpose.أن تعرّف العلاقة بأنها بروتوكول مع واجهة، وأن تُبقي العلاقات ذات المستوى الأدنى خارج النطاق عن قصد.
  4. Specify interactions as request and reply pairs and compute energy in kWh without confusing power and energy.أن تحدد التفاعلات كأزواج من طلب ورد، وأن تحسب الطاقة بوحدة kWh دون الخلط بين القدرة والطاقة.
  5. Map interactions onto HTTP and justify GET as safe and PUT as idempotent, including retry behavior.أن تربط التفاعلات بـ HTTP وتبرر أن GET آمن (safe) وأن PUT متساوي الأثر (idempotent)، بما في ذلك سلوك إعادة المحاولة.
  6. Distinguish the server component from the server layer and connect the layer to cloud, fog and edge.أن تميز بين مكون الخادم وطبقة الخادم، وأن تربط هذه الطبقة بالسحابة (cloud) والضباب (fog) والحافة (edge).

Before you wire anything for a lamp you want to control from a browser, you already carry a picture in your head: the browser talks to something, and that something talks to the lamp. That picture is a mental model, and the first claim of this part is that good design starts there, not with code and not with hardware.

قبل أن توصّل أي سلك لمصباح تريد التحكم فيه من المتصفح، تحمل في ذهنك صورة جاهزة: المتصفح يتحدث مع شيء ما، وذلك الشيء يتحدث مع المصباح. هذه الصورة هي mental model (نموذج ذهني)، والادعاء الأول في هذا الجزء أن التصميم الجيد يبدأ من هنا، لا من الكود ولا من العتاد.

The claim is really about order. You do not jump from the problem straight to a solution; you first build a simplified representation of how the system works, and then derive the solution from it. The tool for building that representation is system thinking: describe the problem as parts, the connections between them, and the levels they sit on. A system seen this way is made of components, each one box with a job, and layers, each one a grouping of things that sit at the same level of abstraction.

الادعاء في حقيقته يتعلق بالترتيب. لا تقفز من المشكلة مباشرة إلى الحل، بل تبني أولًا تمثيلًا مبسطًا لطريقة عمل النظام، ثم تستنتج الحل منه. أداة بناء هذا التمثيل هي system thinking (التفكير النظمي): أن تصف المشكلة على شكل أجزاء، والروابط بينها، والمستويات التي تقع عليها. وsystem (النظام) بهذه النظرة يتكون من components (مكونات)، كل منها صندوق له وظيفة، ومن layers (طبقات)، كل منها تجميع لأشياء تقع على المستوى نفسه من التجريد.

Problem→Mental model→Solution\text{Problem} \rightarrow \text{Mental model} \rightarrow \text{Solution}
Design reasons through a modelالتصميم يستدل عبر نموذج

The problem: a lamp, a browser, and a mysterious arrowالمشكلة: مصباح ومتصفح وسهم غامض

Now make it concrete. Draw Chrome on one side, a light bulb on the other, and one double-headed arrow between them. The browser is the client you already know. The lamp is the device. The arrow is where everything interesting hides. A browser tab cannot switch mains power; it can only send and receive messages over a network. So something must sit between the tab and the bulb, receive those messages, and turn them into electricity flowing or not flowing. The rest of this part is an answer to one question: what is inside that arrow?

لنجعل الأمر ملموسًا. ارسم Chrome في جهة، ومصباحًا في الجهة الأخرى، وسهمًا واحدًا مزدوج الاتجاه بينهما. المتصفح هو client (العميل) الذي تعرفه. والمصباح هو device (الجهاز). والسهم هو المكان الذي يختبئ فيه كل ما هو مثير. تبويب المتصفح لا يستطيع أن يفتح أو يقطع كهرباء الشبكة العامة، بل يستطيع فقط أن يرسل الرسائل ويستقبلها عبر شبكة. إذن لا بد من شيء يقع بين التبويب والمصباح، يستقبل تلك الرسائل ويحولها إلى كهرباء تسري أو لا تسري. باقي هذا الجزء هو إجابة عن سؤال واحد: ماذا يوجد داخل ذلك السهم؟

The tempting answer: ad hocالإجابة المغرية: الارتجال ad hoc

The first answer most people give is a part: "use a sensor", "buy a smart plug", "write a script". That is ad-hoc design, a component chosen before anyone has asked what the system actually is. The phrase comes from Latin ad (to) and hoc (this): for this specific purpose, a sense recorded in English from 1879. An ad-hoc design answers the immediate situation without previous planning.

أول إجابة يعطيها معظم الناس هي قطعة: "استخدم حساسًا"، "اشترِ مقبسًا ذكيًا"، "اكتب سكربتًا". هذا هو ad-hoc design (التصميم المرتجل)، أي مكوّن يُختار قبل أن يسأل أحد ما هو النظام فعلًا. أصل العبارة لاتيني: ad (إلى، لـ) وhoc (هذا)، أي لهذا الغرض المحدد، وهو معنى مسجل في الإنجليزية منذ 1879. التصميم المرتجل يجيب عن الموقف العاجل دون تخطيط مسبق.

For one lamp in one room, that can work. Now scale it: 50 lamps, a phone app next to the browser, a monthly energy report. With no named components and no agreed interfaces, each addition is another one-off wire or script, and nothing fits together. Ad-hoc designs may work for small isolated tasks, but they fail to scale or to integrate with larger systems.

لمصباح واحد في غرفة واحدة، قد ينجح ذلك. والآن وسّع الأمر: 50 مصباحًا، وتطبيق جوال بجانب المتصفح، وتقرير شهري عن الطاقة. من دون مكونات مسماة ومن دون واجهات متفق عليها، تصبح كل إضافة سلكًا أو سكربتًا آخر لمرة واحدة، ولا يتلاءم شيء مع شيء. قد تنجح التصاميم المرتجلة في المهام الصغيرة المعزولة، لكنها تفشل في التوسع أو في التكامل مع أنظمة أكبر.

The better answer: structured designالإجابة الأفضل: التصميم المنظم

Structured design takes the same lamp but fixes the order of work: questions first, components second, code last. Design becomes a process, not a random walk. Notice what comes out of that process. It is not a sensor, a script or a board: it is a system, a named set of parts with defined connections. Named parts are what let a phone app or a second lamp plug in later without rework, and that is why structured design holds up under complexity, scalability and integration.

Structured design (التصميم المنظم) يأخذ المصباح نفسه لكنه يثبّت ترتيب العمل: الأسئلة أولًا، ثم المكونات، والكود أخيرًا. يصبح التصميم عملية، لا مشيًا عشوائيًا. لاحظ ما الذي يخرج من هذه العملية: ليس حساسًا ولا سكربتًا ولا لوحة، بل نظامًا، أي مجموعة مسماة من الأجزاء بروابط محددة. الأجزاء المسماة هي ما يسمح لتطبيق جوال أو مصباح ثانٍ بأن يُوصل لاحقًا دون إعادة عمل، ولهذا يصمد التصميم المنظم أمام التعقيد والتوسع والتكامل.

Problemالمشكلة

Control a lamp over the Web

التحكم في مصباح عبر الويب

Structured processالعملية المنظمة

Answer the four design questions in order

أجب عن أسئلة التصميم الأربعة بالترتيب

Systemالنظام

Client, server and device with defined relationships

عميل وخادم وجهاز تربطها علاقات محددة

Structured design turns a problem into a systemالتصميم المنظم يحول المشكلة إلى نظام
AspectالجانبAd hocالمرتجلStructuredالمنظم
PlanningالتخطيطNoneلا يوجدUp frontمسبقًا
Works forيصلح لـOne small taskمهمة صغيرة واحدةGrowing systemsالأنظمة النامية
Adding a featureإضافة ميزةReworkإعادة عملPlug into a named interfaceتوصيل بواجهة مسماة
IntegrationالتكاملHardصعبDefined by relationshipsتحدده العلاقات
Ad hoc versus structured, for the lampالمرتجل مقابل المنظم، في حالة المصباح

Quick checkاختبار سريع

What is the main weakness of an ad-hoc design?ما نقطة الضعف الرئيسية في التصميم المرتجل (ad hoc)؟

The structured process in this lecture is not mysterious. It is four questions, asked in a fixed order, and their highlighted words are the whole vocabulary of system thinking.

العملية المنظمة في هذه المحاضرة ليست غامضة. إنها أربعة أسئلة تُطرح بترتيب ثابت، والكلمات المميزة فيها هي كل مفردات التفكير النظمي.

The order is forced by dependency. You cannot name relationships before you have components to relate, and you cannot group things into layers before you know what the things are. Treat the list as a reusable checklist: your research project architecture section must answer exactly these questions, and so must any exam answer that asks you to design or critique a system. This concept answers the first two for the lamp; the rest of the part answers the other two.

الترتيب تفرضه الاعتمادية. لا يمكنك تسمية العلاقات قبل أن تكون لديك مكونات تربط بينها، ولا يمكنك تجميع الأشياء في طبقات قبل أن تعرف ما هي هذه الأشياء. تعامل مع القائمة كقائمة تحقق قابلة لإعادة الاستخدام: قسم المعمارية في مشروعك البحثي يجب أن يجيب عن هذه الأسئلة بالضبط، وكذلك أي إجابة في الاختبار تطلب منك تصميم نظام أو نقده. هذا المفهوم يجيب عن السؤالين الأولين للمصباح، وباقي الجزء يجيب عن السؤالين الآخرين.

Recall

What four questions turn a design problem into a system?ما الأسئلة الأربعة التي تحول مشكلة تصميم إلى نظام؟

What is the system, what are its components, what is the relationship between the components, and what are the layers.
ما هو النظام، وما هي مكوناته، وما هي العلاقة بين المكونات، وما هي الطبقات.

Question one: what is a system?السؤال الأول: ما هو النظام؟

For the lamp, the boundary is the room plus the network, the parts are the browser and the lamp, and the things that happen between them are "switch on" and "how much energy have you used?". Generalize that and you get the definition: a system is an environment in which interactions occur between components. Three ingredients, each one necessary. The environment draws the boundary. The components are the boxes inside it. Each interaction is an arrow.

في حالة المصباح، الحد هو الغرفة مع الشبكة، والأجزاء هي المتصفح والمصباح، وما يحدث بينهما هو "شغّل المصباح" و"كم استهلكت من الطاقة؟". عمّم ذلك تحصل على التعريف: النظام بيئة تحدث فيها تفاعلات بين المكونات. ثلاثة عناصر، كل منها ضروري. البيئة ترسم الحد. والمكونات هي الصناديق داخله. وكل interaction (تفاعل) هو سهم.

System=environment+components+interactions\text{System} = \text{environment} + \text{components} + \text{interactions}
System ingredientsمكونات النظام

Question two: what are the components?السؤال الثاني: ما هي المكونات؟

The lamp is decomposed in two refinement steps, and each step adds one idea. First, separate software from thing: browser and bulb become Application and Device, where the application is everything that is software and the device is the physical lamp. Second, split the application in two. The client is the user-facing interface, the part you touch. The server processes client requests and communicates with the device. That second component is the answer to the mystery of the arrow: it is the thing that sits between the tab and the bulb.

يُفكَّك المصباح في خطوتي تنقيح، وكل خطوة تضيف فكرة واحدة. أولًا، افصل البرمجيات عن الشيء المادي: يصبح المتصفح والمصباح تطبيقًا (Application) وجهازًا (Device)، حيث التطبيق هو كل ما هو برمجي، والجهاز هو المصباح المادي. ثانيًا، قسّم التطبيق إلى قسمين. العميل هو الواجهة المواجهة للمستخدم، أي الجزء الذي تلمسه. وserver (الخادم) يعالج طلبات العميل ويتواصل مع الجهاز. هذا المكون الثاني هو حل لغز السهم: إنه الشيء الذي يقع بين التبويب والمصباح.

Client
browser

User-facing interface

Server

Processes requests, talks to the device

يعالج الطلبات ويتواصل مع الجهاز

Device

The lamp

The lamp system decomposed into three componentsنظام المصباح مفككًا إلى ثلاثة مكونات
A click travels client, server, device, and the lamp lightsالنقرة تنتقل من العميل إلى الخادم إلى الجهاز، فيضيء المصباح

Read the visual left to right: the click starts at the client, the server relays it, and only when the path reaches the device does the lamp glow. No box can be skipped.

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

Why split the application: offloadingلماذا نقسم التطبيق: نقل المعالجة offloading

Why not let the browser do everything? Because a browser tab is a poor place to keep things. It is not running while the tab is closed, so it cannot record energy readings around the clock, and a phone and a laptop would each hold their own copy of the lamp state. The server is always on and shared, so it can do both.

لماذا لا ندع المتصفح يفعل كل شيء؟ لأن تبويب المتصفح مكان سيئ لحفظ الأشياء. فهو لا يعمل حين يكون التبويب مغلقًا، لذلك لا يستطيع تسجيل قراءات الطاقة على مدار الساعة، كما أن الجوال والحاسوب المحمول سيحتفظ كل منهما بنسخته الخاصة من حالة المصباح. أما الخادم فهو يعمل دائمًا ومشترك، لذلك يستطيع القيام بالأمرين.

That is offloading: the client hands functions it cannot or should not perform to the server, because the server has the processing and storage. The server hosts those functions as services, such as "set the lamp state" and "read energy use", and the client simply calls them. Deciding what to offload, and to where, is exactly what the task mapping later in the lecture varies: a task can run on the device, at the edge, in the fog or in the cloud.

هذا هو offloading (نقل المعالجة): يسلّم العميل الوظائف التي لا يستطيع أو لا ينبغي أن يؤديها إلى الخادم، لأن الخادم يملك المعالجة والتخزين. يستضيف الخادم تلك الوظائف كخدمات، مثل "اضبط حالة المصباح" و"اقرأ استهلاك الطاقة"، والعميل يستدعيها فقط. وتحديد ما الذي يُنقل وإلى أين هو بالضبط ما يتغير في توزيع المهام (task mapping) لاحقًا في المحاضرة: يمكن أن تعمل المهمة على الجهاز، أو عند الحافة، أو في الضباب، أو في السحابة.

Recall

Define a system in one sentence, then name the three lamp components.عرّف النظام في جملة واحدة، ثم سمِّ مكونات المصباح الثلاثة.

An environment in which interactions occur between components. The lamp system has a client, a server and a device.
بيئة تحدث فيها تفاعلات بين المكونات. نظام المصباح له عميل وخادم وجهاز.

Question three asks what connects the components. Start concrete: between client and server the lamp needs at least two exchanges, "set the state" and "read the energy".

السؤال الثالث يسأل عما يربط المكونات. ابدأ بشيء ملموس: بين العميل والخادم يحتاج المصباح إلى تبادلين على الأقل، "اضبط الحالة" و"اقرأ الطاقة".

Each exchange is one interaction, and the relationship is the whole set of them. In set notation, an interaction d is an element of a relationship R. That framing is useful because it tells you how to specify a relationship: list its interactions, and then say what every one of them has in common.

كل تبادل هو تفاعل واحد، والعلاقة هي مجموعتها كلها. بلغة المجموعات، التفاعل d عنصر في العلاقة R. هذه الصياغة مفيدة لأنها تخبرك كيف تحدد علاقة: اذكر تفاعلاتها، ثم قل ما المشترك بينها جميعًا.

d∈Rd \in R
An interaction is an element of a relationshipالتفاعل عنصر من عناصر العلاقة

What they have in common splits into two halves. The protocol is the grammar both sides agree on: message format, order and meaning. For the Web that is HTTP, with its message format, methods, headers and status codes. The interface is the list of operations the server offers: the endpoints, each a method plus a path, that a client may call. Neither half is enough on its own. A shared language with nothing to ask for is useless, and a menu of operations nobody can phrase is equally useless.

ما تشترك فيه ينقسم إلى نصفين. protocol (البروتوكول) هو القواعد اللغوية التي يتفق عليها الطرفان: صيغة الرسالة وترتيبها ومعناها. في الويب هذا هو HTTP، بصيغة رسائله وطرقه (methods) وترويساته (headers) ورموز حالته (status codes). وinterface (الواجهة) هي قائمة العمليات التي يقدمها الخادم: نقاط النهاية (endpoints)، كل منها طريقة مع مسار، التي يحق للعميل استدعاؤها. ولا يكفي أي نصف وحده. لغة مشتركة بلا شيء تطلبه عديمة الفائدة، وقائمة عمليات لا يستطيع أحد صياغة طلبها عديمة الفائدة بالقدر نفسه.

Relationship=Protocol+Interface\text{Relationship} = \text{Protocol} + \text{Interface}
The two halves of a relationshipنصفا العلاقة
PartالجزءQuestion it answersالسؤال الذي يجيب عنهLamp exampleمثال المصباح
Protocolالبروتوكول (protocol)How do we talk?كيف نتحدث؟HTTPHTTP
Interfaceالواجهة (interface)What can I ask for?ماذا يمكنني أن أطلب؟/lamp/state and /lamp/energy/lamp/state و/lamp/energy
Protocol and interface for the lamp (paths are illustrative)البروتوكول والواجهة في حالة المصباح (المسارات للتوضيح فقط)

The relationship we deliberately ignoreالعلاقة التي نتجاهلها عن قصد

There is a second arrow in the lamp system, between server and device, and the lecture is blunt about it: it is not our concern. That is a design decision, not laziness. You may assume the server runs on a microcontroller board wired to the lamp. Inside that board, the program calls a hardware library; the library switches a pin; the pin drives a relay; the relay switches the lamp. That chain is a separate, lower-level relationship with its own protocol and its own interface.

يوجد سهم ثانٍ في نظام المصباح، بين الخادم والجهاز، والمحاضرة صريحة بشأنه: إنه ليس من شأننا. وهذا قرار تصميمي، لا كسل. يمكنك أن تفترض أن الخادم يعمل على لوحة متحكم دقيق (microcontroller) موصولة بالمصباح. داخل تلك اللوحة، يستدعي البرنامج مكتبة عتاد، والمكتبة تبدّل طرفًا (pin)، والطرف يشغّل مرحّلًا (relay)، والمرحّل يشغّل المصباح أو يطفئه. هذه السلسلة علاقة منفصلة ذات مستوى أدنى، لها بروتوكولها الخاص وواجهتها الخاصة.

The web client never sees any of it. It sees only the interface the server exposes. This is the payoff of defining a relationship by protocol and interface: each side can ignore the other side's internals, which is abstraction doing its job. Swap the relay for a smart bulb and the client does not change at all.

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

Quick checkاختبار سريع

The lamp server offers GET /lamp/energy. In system-thinking terms, what is that endpoint?يقدم خادم المصباح GET /lamp/energy. بمصطلحات التفكير النظمي، ما هي نقطة النهاية هذه؟

A relationship is a set of interactions, so the next step in specifying the lamp is to write that set down. It has two members, and each is a pair: a request from the client and a reply from the server. The client always speaks first.

العلاقة مجموعة من التفاعلات، لذا فالخطوة التالية في تحديد المصباح هي كتابة تلك المجموعة. لها عنصران، وكل منهما زوج: طلب من العميل ورد من الخادم. العميل يتكلم أولًا دائمًا.

InteractionالتفاعلRequest carriesما يحمله الطلبReplyالرد
Set_on_offSet_on_offThe target state (on or off)الحالة المستهدفة (تشغيل أو إطفاء)okok
read_energy_usageread_energy_usageNothing extraلا شيء إضافيAn energy value in kWhقيمة طاقة بوحدة kWh
The two lamp interactionsتفاعلا المصباح
Requests go out, replies come back, and the energy reading arrivesالطلبات تخرج، والردود تعود، وتصل قراءة الطاقة

In the visual, each interaction is a request drawn toward the server followed by a reply drawn back to the client, and the meter inside the server fills once the kilowatt-hour reply lands. The device sits behind the server, never talking to the client directly, exactly as the previous concept required.

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

One design detail matters more than it looks. Set_on_off should carry the value you want (on, or off), not mean "toggle". If the network drops the reply and the client sends the request again, a toggle flips the lamp back, while "set on" twice still leaves it on. Hold on to that thought: the next concept gives the property a name and shows that HTTP builds it into its methods.

تفصيل تصميمي واحد أهم مما يبدو. ينبغي أن يحمل Set_on_off القيمة التي تريدها (تشغيل أو إطفاء)، لا أن يعني "اقلب الحالة" (toggle). إذا أسقطت الشبكة الرد وأرسل العميل الطلب مرة أخرى، فإن القلب يعيد المصباح إلى حالته السابقة، بينما "شغّل" مرتين يُبقيه مشتغلًا. احتفظ بهذه الفكرة: المفهوم التالي يعطي هذه الخاصية اسمًا ويبين أن HTTP يبنيها في طرقه.

What the energy reply actually meansماذا يعني رد الطاقة فعلًا

The read interaction returns energy, and that is where many students slip. A watt measures power, which is a rate: how fast energy is being used. A watt-hour measures energy: power kept up for a length of time. A kilowatt-hour is 1 kW (1,000 W) used for one hour, and the usual appliance formula is wattage times hours, divided by 1000.

تفاعل القراءة يعيد طاقة، وهنا يخطئ كثير من الطلاب. الواط يقيس القدرة، وهي معدل: مدى سرعة استهلاك الطاقة. والواط ساعة يقيس الطاقة: قدرة مستمرة لمدة من الزمن. والكيلوواط ساعة هو 1 kW (1,000 W) مستهلكة لمدة ساعة واحدة، والمعادلة المعتادة للأجهزة هي القدرة بالواط مضروبة في عدد الساعات، مقسومة على 1000.

E=P×tE = P \times t
Energy is power times timeالطاقة تساوي القدرة مضروبة في الزمن

Worked exampleمثال محلول

Energy of the lampطاقة المصباح

  1. Powerالقدرة

    100 W
    100 W
  2. Timeالزمن

    10 h
    10 h
  3. Multiplyالضرب

    100 W × 10 h = 1,000 Wh
    100 W × 10 h = 1,000 Wh
  4. Convertالتحويل

    1,000 Wh ÷ 1000 = 1 kWh
    1,000 Wh ÷ 1000 = 1 kWh
  5. Resultالنتيجة

    read_energy_usage returns 1 kWh.
    يعيد read_energy_usage القيمة 1 kWh.

Quick checkاختبار سريع

A 60 W lamp stays on for 5 h. What should read_energy_usage return?مصباح قدرته 60 W يبقى مشتغلًا لمدة 5 h. ما القيمة التي ينبغي أن يعيدها read_energy_usage؟

Recall

A 2 kW heater runs for 3 h. What energy, in what unit?سخان قدرته 2 kW يعمل لمدة 3 h. كم الطاقة، وبأي وحدة؟

6 kWh, which is energy. Not 6 kW, which would be power.
6 kWh، وهي طاقة. وليست 6 kW، فهذه ستكون قدرة.

So far the interactions are abstract. On the Web they become concrete: set becomes HTTP PUT, and read becomes HTTP GET. The arrows carrying them are the protocol, HTTP, and the set and read operations exposed on the server edge are the interface, a Web API. The formula from earlier now has a real instance.

حتى الآن التفاعلات مجردة. على الويب تصبح ملموسة: الضبط يصبح HTTP PUT، والقراءة تصبح HTTP GET. الأسهم التي تحملها هي البروتوكول، HTTP، وعمليتا الضبط والقراءة المعروضتان على حافة الخادم هما الواجهة، أي Web API. المعادلة السابقة صار لها الآن مثال حقيقي.

Protocol lines seat into interface sockets on the server wallخطوط البروتوكول تستقر في مقابس الواجهة على جدار الخادم

In the visual, the PUT and GET lines are the protocol, and the two sockets they seat into, set and read, are the interface. Only when both halves meet does the relationship work.

في الشكل، خطا PUT وGET هما البروتوكول، والمقبسان اللذان يستقران فيهما، الضبط والقراءة، هما الواجهة. لا تعمل العلاقة إلا حين يلتقي النصفان.

The actual messagesالرسائل الفعلية

Here is what the two interactions could look like on the wire. Host and paths are illustrative.

هكذا يمكن أن يبدو التفاعلان على السلك. المضيف (Host) والمسارات للتوضيح فقط.

Set: PUT request and responseالضبط: طلب PUT ورده

Request lineسطر الطلب
PUT /lamp/state HTTP/1.1PUT /lamp/state HTTP/1.1
Host
lamp.example.comlamp.example.com
Content-Type
application/jsonapplication/json
Bodyجسم الرسالة
{"on": true}{"on": true}
Response statusحالة الرد
HTTP/1.1 204 No ContentHTTP/1.1 204 No Content

Read: GET request and responseالقراءة: طلب GET ورده

Request lineسطر الطلب
GET /lamp/energy HTTP/1.1GET /lamp/energy HTTP/1.1
Host
lamp.example.comlamp.example.com
Response statusحالة الرد
HTTP/1.1 200 OKHTTP/1.1 200 OK
Bodyجسم الرسالة
{"kWh": 1.0}{"kWh": 1.0}

The 204 No Content reply is the HTTP form of the abstract ok: RFC 9110 defines it as the server having fulfilled the request with no additional content to send.

الرد 204 No Content هو صيغة HTTP للـ ok المجرد: يعرّفه RFC 9110 بأن الخادم نفّذ الطلب ولا يوجد محتوى إضافي ليرسله.

Why GET fits read: safeلماذا يناسب GET القراءة: آمن safe

RFC 9110 calls a method safe when its semantics are essentially read-only: the client does not request, and does not expect, any state change on the server. Reading energy changes nothing, so GET is the natural fit. RFC 9205 adds a practical reason: implementations can and do retry GET requests that fail, so GET handling should not change application state.

يسمي RFC 9110 الطريقة آمنة (safe) حين تكون دلالتها للقراءة فقط في جوهرها: العميل لا يطلب، ولا يتوقع، أي تغيير في حالة الخادم. قراءة الطاقة لا تغير شيئًا، لذا فإن GET هو الخيار الطبيعي. ويضيف RFC 9205 سببًا عمليًا: التطبيقات تستطيع أن تعيد، وهي تعيد فعلًا، طلبات GET التي تفشل، لذا لا ينبغي أن تغير معالجة GET حالة التطبيق.

Why PUT fits set: idempotentلماذا يناسب PUT الضبط: متساوي الأثر idempotent

Recall the toggle problem from the interaction list. HTTP has a name for the property that solves it. A method is idempotent when the intended effect of several identical requests is the same as the effect of one. PUT, DELETE and the safe methods are idempotent. PUT asks for the target resource to be created or replaced with the state enclosed in the request, so sending {"on": true} twice still leaves the lamp on.

تذكّر مشكلة القلب (toggle) من قائمة التفاعلات. لدى HTTP اسم للخاصية التي تحلها. تكون الطريقة متساوية الأثر (idempotent) حين يكون الأثر المقصود لعدة طلبات متطابقة هو نفس أثر طلب واحد. PUT وDELETE والطرق الآمنة كلها متساوية الأثر. يطلب PUT أن يُنشأ المورد المستهدف أو يُستبدل بالحالة المرفقة في الطلب، لذا فإن إرسال {"on": true} مرتين يُبقي المصباح مشتغلًا.

This matters on real links. RFC 9110 says an idempotent request can be repeated automatically if the connection fails before the client reads the response, while a client should not automatically retry a non-idempotent request unless it knows the request is actually idempotent, or that the original request was never applied. Edge devices often sit on flaky wireless links, so this choice decides whether a retry is harmless or a bug.

هذا مهم على الروابط الحقيقية. يقول RFC 9110 إن الطلب متساوي الأثر يمكن تكراره تلقائيًا إذا فشل الاتصال قبل أن يقرأ العميل الرد، بينما لا ينبغي للعميل أن يعيد تلقائيًا طلبًا غير متساوي الأثر إلا إذا كان يعلم أن الطلب متساوي الأثر فعلًا، أو أن الطلب الأصلي لم يُطبَّق أبدًا. أجهزة الحافة كثيرًا ما تكون على روابط لاسلكية غير مستقرة، لذا فهذا الاختيار يحدد ما إذا كانت إعادة المحاولة غير ضارة أم خطأً برمجيًا.

MethodالطريقةInteractionالتفاعلSafeآمنIdempotentمتساوي الأثرChanges lampيغير المصباح
GETGETReadالقراءةYesنعمYesنعمNoلا
PUTPUTSetالضبطNoلاYesنعمYesنعم
POSTPOSTNone (for contrast)لا شيء (للمقارنة)NoلاNoلاDependsيعتمد
HTTP methods for the lampطرق HTTP في حالة المصباح

Quick checkاختبار سريع

The client sends PUT /lamp/state with on true, and the connection drops before any reply. What should it do?يرسل العميل PUT /lamp/state بالقيمة on true، وينقطع الاتصال قبل وصول أي رد. ماذا ينبغي أن يفعل؟

Recall

Why is PUT a better fit than a toggle for setting the lamp?لماذا يناسب PUT ضبط المصباح أكثر من القلب (toggle)؟

PUT carries the target state and is idempotent (RFC 9110 section 9.2.2), so a client can retry after a dropped connection and the lamp ends in the same state. A toggle would flip twice.
PUT يحمل الحالة المستهدفة وهو متساوي الأثر (RFC 9110 القسم 9.2.2)، لذا يستطيع العميل إعادة المحاولة بعد انقطاع الاتصال وينتهي المصباح بالحالة نفسها. أما القلب فسيقلب الحالة مرتين.

Recall

Relationship equals what? Give the lamp example of each part.العلاقة تساوي ماذا؟ أعطِ مثال المصباح لكل جزء.

Protocol plus interface. Protocol: HTTP. Interface: the Web API endpoints for setting the state and reading the energy.
بروتوكول مع واجهة. البروتوكول: HTTP. الواجهة: نقاط نهاية Web API لضبط الحالة وقراءة الطاقة.

Question four asks for the layers. For this system the answer is a single layer, the one where processing and storage happen: the server layer. Answering it forces you to notice that the word "server" has been doing two jobs.

السؤال الرابع يطلب الطبقات. في هذا النظام الإجابة طبقة واحدة، هي التي تحدث فيها المعالجة والتخزين: server layer (طبقة الخادم). والإجابة عنه تجبرك على ملاحظة أن كلمة "خادم" (server) كانت تؤدي وظيفتين.

The server component is the program, for example the Python or C code that answers requests for the lamp state. The server layer is that program together with everything it needs to run: the processor executing it, the network carrying requests, the memory holding the current state, and the disk keeping energy history. The component is what you write; the layer is what you must provision.

مكون الخادم هو البرنامج، مثلًا كود Python أو C الذي يجيب عن طلبات حالة المصباح. وطبقة الخادم هي ذلك البرنامج مع كل ما يحتاجه ليعمل: المعالج الذي ينفذه، والشبكة التي تحمل الطلبات، والذاكرة التي تحفظ الحالة الحالية، والقرص الذي يحتفظ بسجل الطاقة. المكون هو ما تكتبه، والطبقة هي ما يجب أن توفّره.

Server component=Program\text{Server component} = \text{Program}
Server layer=Program+Processor+Network+Memory+Disk\text{Server layer} = \text{Program} + \text{Processor} + \text{Network} + \text{Memory} + \text{Disk}

What each part of the server layer does for the lampما يقدمه كل جزء من طبقة الخادم للمصباح

Programالبرنامج
Handles the HTTP requestsيعالج طلبات HTTP
Processorالمعالج
Runs the programينفذ البرنامج
Networkالشبكة
Carries requests and repliesتحمل الطلبات والردود
Memoryالذاكرة
Holds the current lamp stateتحفظ حالة المصباح الحالية
Diskالقرص
Stores the energy historyيخزن سجل الطاقة
Lifting the lid: the program sits on processor, network, memory and diskرفع الغطاء: البرنامج يقوم على المعالج والشبكة والذاكرة والقرص

The visual starts with just the program lit, which is the component. The resources rise beneath it and the outline closes around all five: that outline is the layer.

يبدأ الشكل والبرنامج وحده مضاء، وهو المكون. ثم ترتفع الموارد تحته ويُغلق الإطار حول العناصر الخمسة كلها: ذلك الإطار هو الطبقة.

The modern names for the server layerالأسماء الحديثة لطبقة الخادم

Now the question the whole course answers: what do we call this layer today? Cloud, fog or edge, depending on where it is placed. Close the lamp story with that in mind. If the program runs on a board next to the lamp, the layer sits on the device side of the continuum (mist, or edge on a nearby gateway). If it runs in a distant data center, it is the cloud.

والآن السؤال الذي يجيب عنه المقرر كله: ماذا نسمي هذه الطبقة اليوم؟ Cloud (سحابة) أو fog (ضباب) أو edge (حافة)، بحسب المكان الذي توضع فيه. اختم قصة المصباح بهذه الفكرة. إذا كان البرنامج يعمل على لوحة بجانب المصباح، فالطبقة تقع في جهة الجهاز من الامتداد (mist، أو الحافة إن كانت على بوابة قريبة gateway). وإذا كان يعمل في مركز بيانات بعيد، فهي السحابة.

The standard definitions line up with the layer you just built. NIST defines cloud computing as on-demand network access to a shared pool of configurable computing resources, such as networks, servers, storage, applications and services, that can be rapidly provisioned and released: the same resources as the server layer, pooled at scale. NIST also describes fog computing as a layered model for access to a shared continuum of scalable computing resources, built from fog nodes that sit between smart end devices and centralized cloud services. Cloud, fog and edge together form the edge-to-cloud (E2C) continuum that the rest of the lecture studies.

التعريفات المعيارية تتطابق مع الطبقة التي بنيتها للتو. يعرّف NIST الحوسبة السحابية بأنها وصول عبر الشبكة عند الطلب إلى مجمّع مشترك من موارد الحوسبة القابلة للتهيئة، مثل الشبكات والخوادم والتخزين والتطبيقات والخدمات، يمكن توفيرها وتحريرها بسرعة: أي الموارد نفسها التي في طبقة الخادم، مجمّعة على نطاق واسع. ويصف NIST أيضًا حوسبة الضباب بأنها نموذج طبقي للوصول إلى امتداد مشترك من موارد الحوسبة القابلة للتوسع، مبني من عُقد ضباب (fog nodes) تقع بين الأجهزة الطرفية الذكية وخدمات السحابة المركزية. السحابة والضباب والحافة معًا تشكل edge-to-cloud (E2C) continuum (امتداد الحافة إلى السحابة) الذي يدرسه باقي المحاضرة.

Quick checkاختبار سريع

Besides the server program, what does the server layer contain?إلى جانب برنامج الخادم، ماذا تحتوي طبقة الخادم؟

Recall

How is the server component different from the server layer?كيف يختلف مكون الخادم عن طبقة الخادم؟

The component is the program. The layer is the program plus processor, network, memory and disk, and today it is called cloud, fog or edge depending on where it runs.
المكون هو البرنامج. والطبقة هي البرنامج مع المعالج والشبكة والذاكرة والقرص، وتُسمى اليوم سحابة أو ضبابًا أو حافة بحسب المكان الذي تعمل فيه.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • A mental model built with system thinking sits between the problem and the solution.النموذج الذهني المبني بالتفكير النظمي (system thinking) يقع بين المشكلة والحل.
  • Ad-hoc design is for one immediate situation; structured design handles complexity, scale and integration.التصميم المرتجل (ad hoc) يخدم موقفًا واحدًا عاجلًا، أما التصميم المنظم (structured) فيتعامل مع التعقيد والتوسع والتكامل.
  • The four questions, in order: system, components, relationships, layers.الأسئلة الأربعة بالترتيب: النظام، المكونات، العلاقات، الطبقات.
  • A system is an environment where components interact. The lamp system is client, server and device.النظام بيئة تتفاعل فيها المكونات. نظام المصباح يتكون من عميل وخادم وجهاز.
  • The client offloads processing and storage to the server, which hosts services.ينقل العميل (offloads) المعالجة والتخزين إلى الخادم، والخادم يستضيف الخدمات.
  • A relationship is the set of interactions (d ∈ R), defined by a protocol plus an interface.العلاقة هي مجموعة التفاعلات (d ∈ R)، وتُعرَّف ببروتوكول مع واجهة.
  • GET is safe and idempotent; PUT changes state but is idempotent, so it can be retried after a failure.طلب GET آمن ومتساوي الأثر، وطلب PUT يغير الحالة لكنه متساوي الأثر، لذلك يمكن إعادة إرساله بعد الفشل.
  • 100 W for 10 h is 1,000 Wh = 1 kWh (energy), not 1,000 W (power).قدرة 100 W لمدة 10 h تساوي 1,000 Wh = 1 kWh (طاقة)، وليست 1,000 W (قدرة).
  • Server component = program. Server layer = program, processor, network, memory, disk, today called cloud, fog or edge.مكون الخادم = البرنامج. طبقة الخادم = البرنامج والمعالج والشبكة والذاكرة والقرص، وتُسمى اليوم سحابة أو ضبابًا أو حافة.

Sourcesالمصادر

Part 03: The Internet and the TCP/IP stackالإنترنت وحزمة TCP/IP

Why connectivity is split into five layers, what each layer sends and addresses, and where each layer lives inside a computer.لماذا تُقسَّم مشكلة الاتصال إلى خمس طبقات، وماذا ترسل كل طبقة وكيف تعنون، وأين تقع كل طبقة داخل الحاسوب.

5 concepts5 مفاهيم, ، slides 22-29الشرائح 22-29

Why this part mattersلماذا يهمّ هذا الجزء

Every idea later in this lecture assumes you can say exactly what crosses the network: which header each hop reads, and which address identifies what. Latency budgets, sockets, containers and the mapping of tasks onto device, edge, fog and cloud all rest on this vocabulary.

كل فكرة لاحقة في هذه المحاضرة تفترض أنك تستطيع أن تقول بدقة ما الذي يعبر الشبكة: أي ترويسة (header) تقرؤها كل قفزة، وأي عنوان يحدد ماذا. ميزانيات زمن التأخير (latency)، والـ sockets، والحاويات (containers)، وتوزيع المهام على الجهاز (device) والحافة (edge) والضباب (fog) والسحابة (cloud) كلها تقوم على هذه المفردات.

This part turns the TCP/IP stack from a list to memorize into a working mental picture. We follow one real request from the lamp system in part 02 as it is wrapped, addressed, forwarded and delivered, and then we open up the computer to see where each step physically happens. The layer table and the address-per-scope table are classic exam questions, and the same vocabulary is what your research project uses to describe where sensing, processing and storage sit.

هذا الجزء يحوّل حزمة TCP/IP من قائمة تُحفظ إلى صورة ذهنية عملية. نتتبع طلبًا حقيقيًا واحدًا من نظام المصباح في الجزء 02 وهو يُغلَّف، ويُعنوَن، ويُمرَّر، ثم يُسلَّم، وبعد ذلك نفتح الحاسوب لنرى أين تحدث كل خطوة فعليًا. جدول الطبقات وجدول العنوان لكل نطاق من أسئلة الاختبارات الكلاسيكية، والمفردات نفسها هي ما يستخدمه مشروعك البحثي ليصف أين يقع الاستشعار والمعالجة والتخزين.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why connectivity is split into five layers, and name each layer with one protocol.اشرح لماذا تُقسَّم الاتصالية إلى خمس طبقات، وسمِّ كل طبقة مع بروتوكول واحد لها.
  2. Trace encapsulation from message to bits, stating each PDU and the payload it carries.تتبّع التغليف (encapsulation) من الرسالة حتى البتات، مع ذكر الـ PDU لكل طبقة والحمولة (payload) التي يحملها.
  3. Match the E2E, H2H and P2P scopes to port, IP and MAC addresses, and say which change per hop.اربط نطاقات E2E وH2H وP2P بعناوين المنفذ (port) وIP وMAC، وحدّد أيها يتغير عند كل قفزة (hop).
  4. Tell a socket, a connection and a flow apart, and write out the 5-tuple.فرّق بين الـ socket والاتصال (connection) والتدفق (flow)، واكتب الـ 5-tuple كاملًا.
  5. Place each layer in application space, the OS kernel or the NIC, and name the seams between them.ضع كل طبقة في مكانها: فضاء التطبيق، أو نواة نظام التشغيل (kernel)، أو بطاقة الشبكة (NIC)، وسمِّ الحدود الفاصلة بينها.

In part 02 a browser controlled a lamp with HTTP requests: PUT /lamp/state to switch it and GET /lamp/energy to read its energy. Each request started on a laptop on KFUPM Wi-Fi and had to reach a server that might sit in a data center on another continent. Neither program knew the path in between, and neither needed to. That is the whole point of the TCP/IP stack.

في الجزء 02 تحكّم متصفح في مصباح عبر طلبات HTTP: الطلب PUT /lamp/state لتشغيله أو إطفائه، والطلب GET /lamp/energy لقراءة استهلاكه من الطاقة. كل طلب بدأ من حاسوب محمول متصل بشبكة Wi-Fi في جامعة KFUPM، وكان عليه أن يصل إلى خادم قد يكون في مركز بيانات في قارة أخرى. لا أحد من البرنامجين يعرف المسار بينهما، ولا يحتاج أن يعرفه. وهذا بالضبط هو جوهر TCP/IP stack.

Every host runs the same set of layers, so a client and a server can exchange bytes as if a private pipe joined them. The stack has a single purpose: connectivity. A program should only have to say who it wants to talk to and what it wants to send. Everything else in this part (layers, PDUs, addresses, sockets) is simply how that one job gets done.

كل مضيف (host) يشغّل مجموعة الطبقات نفسها، لذلك يستطيع client وserver تبادل البايتات وكأن أنبوبًا خاصًا يصل بينهما. للحزمة هدف واحد فقط: الاتصالية (connectivity). يجب أن يكفي البرنامج أن يقول مع من يريد أن يتحدث وماذا يريد أن يرسل. وكل ما تبقى في هذا الجزء (الطبقات، ووحدات PDU، والعناوين، والـ sockets) هو ببساطة طريقة إنجاز هذه المهمة الواحدة.

Why split connectivity into layersلماذا نقسّم الاتصالية إلى طبقات

Hiding the path is a large job, far too large for one piece of software. Think about an air journey. You buy a ticket, check a bag, pass a gate, the plane takes off from a runway and air traffic control routes it. Each step relies on the step below it and offers a service to the step above. Kurose and Ross use exactly this example to motivate network layering.

إخفاء المسار مهمة كبيرة، أكبر بكثير من أن يتولاها برنامج واحد. فكّر في رحلة جوية: تشتري تذكرة، وتسلّم حقيبتك، وتعبر البوابة، ثم تقلع الطائرة من المدرج ويوجّهها مراقبو الحركة الجوية. كل خطوة تعتمد على الخطوة التي تحتها وتقدّم خدمة للخطوة التي فوقها. يستخدم Kurose وRoss هذا المثال بالضبط لتبرير تقسيم الشبكات إلى طبقات.

The Internet divides connectivity the same way. The stack has five layers, and each layer provides one well-defined service using its own protocols. The payoff is explicit structure and modularity: a layer can change how it works internally without the rest of the system noticing. Wi-Fi can be swapped for 5G, and HTTP does not change a single byte.

الإنترنت يقسّم الاتصالية بالطريقة نفسها. للحزمة خمس طبقات، وكل طبقة (layer) تقدّم خدمة واحدة محددة بوضوح باستخدام بروتوكولاتها (protocols) الخاصة. المكسب هو بنية صريحة ونمطية (modularity): تستطيع طبقة أن تغيّر طريقة عملها الداخلية دون أن يلاحظ بقية النظام. يمكن استبدال Wi-Fi بشبكة 5G، ولا يتغير في HTTP بايت واحد.

Connectivity=PL+DLL+NL+TL+AL\text{Connectivity} = \text{PL} + \text{DLL} + \text{NL} + \text{TL} + \text{AL}
Composition, not a sumتركيب، وليس مجموعًا

Read the plus signs as composition, not arithmetic. No single layer delivers a web page. Connectivity emerges only when all five cooperate, the same way no single airport worker delivers you to another city.

اقرأ علامات الجمع على أنها تركيب (composition) لا عملية حسابية. لا توجد طبقة واحدة تسلّم صفحة ويب بمفردها. الاتصالية تنشأ فقط عندما تتعاون الطبقات الخمس، تمامًا كما أنه لا يوجد موظف واحد في المطار يوصلك إلى مدينة أخرى بمفرده.

LayerالطبقةAbbreviationالاختصارOne-line jobمهمتها في سطر واحدExample protocolsأمثلة على البروتوكولات
Applicationالتطبيق (Application)ALALSupports network applicationsتدعم تطبيقات الشبكةHTTP, SMTP, IMAPHTTP, SMTP, IMAP
Transportالنقل (Transport)TLTLProcess-to-process data transferنقل البيانات من عملية إلى عمليةTCP, UDPTCP, UDP
Networkالشبكة (Network)NLNLRoutes datagrams from source host to destination hostتوجّه الـ datagrams من المضيف المصدر إلى المضيف الوجهةIP, routing protocolsIP، وبروتوكولات التوجيه
Data linkربط البيانات (Data link)DLLDLLMoves data between neighboring network elementsتنقل البيانات بين عناصر الشبكة المتجاورةEthernet, 802.11, PPPEthernet, 802.11, PPP
Physicalالفيزيائية (Physical)PLPLPuts bits on the wire or into the airتضع البتات على السلك أو في الهواءSignal encodings of Ethernet and Wi-Fiترميزات الإشارة في Ethernet وWi-Fi
The five layers, top to bottomالطبقات الخمس، من الأعلى إلى الأسفل

Five layers versus sevenخمس طبقات مقابل سبع

Part 02 used OSI as its example of a layered system, so it is worth lining the two models up. The OSI reference model (ITU-T X.200) defines seven layers. The Internet stack has no separate session or presentation layer. RFC 1122 says the Internet application layer essentially combines OSI presentation and application, and Kurose and Ross note that any such services must be implemented by the application itself.

استخدم الجزء 02 نموذج OSI مثالًا على نظام ذي طبقات، لذلك من المفيد أن نضع النموذجين جنبًا إلى جنب. النموذج المرجعي OSI (ITU-T X.200) يعرّف سبع طبقات. أما حزمة الإنترنت فليس فيها طبقة جلسة (session) ولا طبقة عرض (presentation) مستقلتان. يقول RFC 1122 إن طبقة التطبيق في الإنترنت تجمع أساسًا بين طبقتي العرض والتطبيق في OSI، ويشير Kurose وRoss إلى أن أي خدمات من هذا النوع يجب أن ينفذها التطبيق بنفسه.

OSI layerطبقة OSITCP/IP layerطبقة TCP/IP
7 Application7 التطبيق (Application)Applicationالتطبيق (Application)
6 Presentation6 العرض (Presentation)Folded into the applicationمدمجة في التطبيق
5 Session5 الجلسة (Session)Folded into the applicationمدمجة في التطبيق
4 Transport4 النقل (Transport)Transportالنقل (Transport)
3 Network3 الشبكة (Network)Networkالشبكة (Network)
2 Data link2 ربط البيانات (Data link)Data linkربط البيانات (Data link)
1 Physical1 الفيزيائية (Physical)Physicalالفيزيائية (Physical)
TCP/IP five layers vs OSI seven layersطبقات TCP/IP الخمس مقابل طبقات OSI السبع

Recall

Which two OSI layers have no separate layer in the TCP/IP stack, and where do their functions go?ما طبقتا OSI اللتان ليس لهما طبقة مستقلة في حزمة TCP/IP، وإلى أين تذهب وظائفهما؟

Session and presentation. If an application needs those functions, it implements them itself.
الجلسة (session) والعرض (presentation). إذا احتاج تطبيق إلى هذه الوظائف، فإنه ينفذها بنفسه.

The stack as the band between people and the physical worldالحزمة بوصفها الشريط الواصل بين الناس والعالم الفيزيائي

Now zoom out to a whole system. Picture a distance sensor such as the HC-SR04 wired to a Raspberry Pi Pico. The Pico reads a distance, a Wi-Fi-capable board sends it across the network, and a dashboard in a control room shows it to a person. A command can travel the other way, down to an actuator.

لنبتعد الآن ونرى نظامًا كاملًا. تخيّل حساس مسافة مثل HC-SR04 موصولًا بلوحة Raspberry Pi Pico. تقرأ الـ Pico المسافة، وترسلها لوحة تدعم Wi-Fi عبر الشبكة، ثم تعرضها لوحة متابعة (dashboard) في غرفة تحكم لشخص ما. ويمكن أن ينتقل أمر في الاتجاه المعاكس، نزولًا إلى مُشغِّل (actuator).

The five layers form a band in the middle of that picture. Users sit above it and the physical world of sensing and actuation sits below it. The dashboard does not need to know how bits cross the air, and the device does not need to know how the dashboard draws its charts. This is modularity again, now at the scale of an entire system.

الطبقات الخمس تشكّل شريطًا في منتصف هذه الصورة. المستخدمون فوقه، والعالم الفيزيائي للاستشعار والتشغيل تحته. لوحة المتابعة لا تحتاج أن تعرف كيف تعبر البتات الهواء، والـ device لا يحتاج أن يعرف كيف ترسم لوحة المتابعة رسومها البيانية. هذه هي النمطية (modularity) مرة أخرى، لكن على مستوى نظام كامل.

Users
dashboards, control rooms

Read sensor values and send commands.

يقرؤون قيم المستشعرات ويرسلون الأوامر.

both ways
TCP/IP
AL, TL, NL, DLL, PLAL، TL، NL، DLL، PL

Five layers that give the two ends connectivity.

خمس طبقات توفر الاتصال بين الطرفين.

both ways
Sensing and actuation
HC-SR04, actuator, Pico

Measure the world and act on it.

تقيس العالم الحقيقي وتؤثر فيه.

Users and the physical world connected by the TCP/IP bandالمستخدمون والعالم الفيزيائي يربطهم شريط TCP/IP

This is the same shape as the lamp system from part 02, and it is also the shape of your research project. In parts 08 to 10 the same pipeline is stretched across the edge to cloud continuum, and the question becomes where along it each piece of processing should run.

هذا هو الشكل نفسه لـ system المصباح من الجزء 02، وهو أيضًا شكل مشروعك البحثي. في الأجزاء من 08 إلى 10 يمتد خط المعالجة نفسه عبر سلسلة الحافة إلى السحابة (edge to cloud continuum)، ويصبح السؤال: في أي نقطة على هذا الخط يجب أن تُنفَّذ كل مرحلة من مراحل المعالجة؟

Layers cooperate by handing data to each other, and the way they do it is the single most useful mechanism in this part. Take a simple read request, GET /lamp HTTP/1.1. The application layer hands it down as a message. Transport puts a TCP header in front and it becomes a segment. Network adds an IP header and it becomes a packet. Data link adds a MAC header in front and a frame check sequence (a CRC) trailer behind, making a frame. Physical sends that frame as bits.

تتعاون الطبقات بتسليم البيانات بعضها إلى بعض، وطريقة ذلك هي أهم آلية مفيدة في هذا الجزء. خذ طلب قراءة بسيطًا: GET /lamp HTTP/1.1. طبقة application تسلّمه إلى الأسفل على شكل رسالة (message). طبقة Transport تضع ترويسة TCP في مقدمته فيصبح مقطعًا (segment). طبقة Network تضيف ترويسة IP فيصبح حزمة (packet). طبقة Data link تضيف ترويسة MAC في المقدمة وذيلًا (trailer) في النهاية هو تسلسل فحص الإطار (frame check sequence، أي CRC)، فيصبح إطارًا (frame). ثم ترسل طبقة Physical هذا الإطار على شكل بتات.

Each layer's unit of data is its protocol data unit (PDU). The process of wrapping is encapsulation, and it follows one rule: a PDU is this layer's header plus a payload, and the payload is the entire PDU of the layer above. On the receiving host the steps run in reverse. Each layer reads and removes its own header, then passes the payload up. Step through it yourself before reading on.

وحدة البيانات في كل طبقة تسمى وحدة بيانات البروتوكول (protocol data unit, PDU). وعملية التغليف تسمى encapsulation، وهي تتبع قاعدة واحدة: الـ PDU هو ترويسة هذه الطبقة مع حمولة (payload)، والحمولة هي الـ PDU الكامل للطبقة التي فوقها. على المضيف المستقبِل تجري الخطوات بالعكس: كل طبقة تقرأ ترويستها وتزيلها، ثم تمرر الحمولة إلى الأعلى. جرّب الخطوات بنفسك قبل أن تكمل القراءة.

Stepperخطوة بخطوةEncapsulation, layer by layerالتغليف (encapsulation)، طبقة بطبقة
Message
GET /lamp HTTP/1.1
Layerالطبقة
Applicationالتطبيقات (Application)
PDU
Messageرسالة (Message)
Addressالعنوان
None: the app just writes dataلا يوجد: التطبيق يكتب البيانات فقط
Addsيضيف
The HTTP request itselfطلب HTTP نفسه
Requestالطلب
GET /lamp HTTP/1.1
1 / 5
A request sinks through the layers, gains a header at transport, network and link, then leaves as bitsطلب ينزل عبر الطبقات، ويكتسب ترويسة عند طبقات النقل والشبكة والربط، ثم يخرج على شكل بتات
LayerالطبقةPDUPDUPayloadالحمولة (Payload)Example protocolsأمثلة على البروتوكولاتAddressالعنوان
Applicationالتطبيق (Application)Messageرسالة (Message)Application bytesبايتات التطبيقHTTPHTTPNoneلا يوجد
Transportالنقل (Transport)Segment (TCP) or datagram (UDP)مقطع (segment) في TCP أو datagram في UDPMessageالرسالة (Message)TCP, UDPTCP, UDPPort numberرقم المنفذ (port number)
Networkالشبكة (Network)Packet (also called datagram)حزمة (packet)، وتسمى أيضًا datagramSegment or UDP datagramمقطع (segment) أو UDP datagramIPIPIP addressعنوان IP
Data linkربط البيانات (Data link)Frameإطار (Frame)Packetحزمة (Packet)Ethernet, 802.11, PPPEthernet, 802.11, PPPMAC addressعنوان MAC
Physicalالفيزيائية (Physical)Bitsبتات (Bits)Frame, as signalsالإطار، على شكل إشاراتPhysical specs of Ethernet and Wi-Fiالمواصفات الفيزيائية لـ Ethernet وWi-FiNoneلا يوجد
Layers, PDUs and payloadsالطبقات ووحدات PDU والحمولات

Who reads which headerمن يقرأ أي ترويسة

Encapsulation is also what lets the middle of the network stay simple. Kurose and Ross label the headers Ht (transport), Hn (network) and Hl (link). A switch processes only the link and physical layers. A router processes network, link and physical. Only the two end hosts open the transport header and the application message. The IP header even carries a Protocol field that names the next-level protocol in its data (RFC 791, section 3.1), which is how the receiver knows whether to hand the payload to TCP or UDP.

التغليف هو أيضًا ما يسمح لوسط الشبكة أن يبقى بسيطًا. يرمز Kurose وRoss للترويسات بـ Ht (النقل) وHn (الشبكة) وHl (الربط). المبدّل (switch) يعالج طبقتي الربط والفيزيائية فقط. والموجّه (router) يعالج الشبكة والربط والفيزيائية. المضيفان الطرفيان وحدهما يفتحان ترويسة النقل ورسالة التطبيق. بل إن ترويسة IP تحمل حقلًا اسمه Protocol يسمّي بروتوكول المستوى التالي الموجود في بياناتها (RFC 791، القسم 3.1)، وبه يعرف المستقبِل هل يسلّم الحمولة إلى TCP أم إلى UDP.

Minimum header sizesأصغر أحجام الترويسات

IPv4 headerترويسة IPv4
20 bytes20 bytes
TCP header (no options)ترويسة TCP (بدون خيارات)
20 bytes20 bytes
UDP headerترويسة UDP
8 bytes8 bytes

These sizes come from RFC 791, RFC 9293 and RFC 768, and together they are the 40 bytes of layering overhead mentioned earlier. They also reveal a division of labor: IP has no acknowledgments, no retransmissions and no flow control (RFC 791, section 1.4). Reliability is added one layer up, by TCP, and only at the end hosts.

هذه الأحجام مأخوذة من RFC 791 وRFC 9293 وRFC 768، ومجموعها هو الـ 40 bytes من تكلفة الطبقات التي ذكرناها سابقًا. وهي تكشف أيضًا تقسيمًا للعمل: بروتوكول IP ليس فيه إشعارات استلام (acknowledgments)، ولا إعادة إرسال (retransmissions)، ولا تحكم في التدفق (flow control) (RFC 791، القسم 1.4). الموثوقية تُضاف في الطبقة التي فوقه بواسطة TCP، وعند المضيفين الطرفيين فقط.

Quick checkاختبار سريع

In the TCP/IP stack, what does a network-layer packet carry as its payload?في حزمة TCP/IP، ما الذي تحمله الحزمة (packet) في طبقة الشبكة على أنه حمولتها (payload)؟

Recall

What is the payload of a data-link frame, and what is the payload of that payload?ما حمولة إطار طبقة ربط البيانات (data-link frame)، وما حمولة تلك الحمولة؟

The frame's payload is a network-layer packet. The packet's payload is a transport-layer segment (TCP) or datagram (UDP).
حمولة الإطار هي حزمة (packet) من طبقة الشبكة. وحمولة الحزمة هي مقطع (segment) من طبقة النقل في حالة TCP، أو datagram في حالة UDP.

The header table ended with an address column, and that column is not decoration. Each header names something different because each layer connects something different. Your laptop on campus loads a page from a cloud server. The path goes over one Wi-Fi hop to the access point, through several routers, and finally over a data-center link to the server. Along that path there is one conversation between two programs, one route between two machines, and many separate links.

انتهى جدول الترويسات بعمود للعناوين، وهذا العمود ليس للزينة. كل ترويسة تسمّي شيئًا مختلفًا لأن كل طبقة تربط شيئًا مختلفًا. حاسوبك المحمول في الحرم الجامعي يحمّل صفحة من خادم سحابي. يمر المسار عبر قفزة Wi-Fi واحدة إلى نقطة الوصول (access point)، ثم عبر عدة موجّهات، وأخيرًا عبر وصلة داخل مركز البيانات إلى الخادم. على طول هذا المسار توجد محادثة واحدة بين برنامجين، ومسار واحد بين جهازين، ووصلات (links) كثيرة منفصلة.

These are the three connection scopes. The transport layer provides an end-to-end (E2E) connection between two application processes. The network layer provides a host-to-host (H2H) path between two machines, however many routers lie between them. The data link layer handles point-to-point (P2P) transfer across a single hop between two directly attached interfaces.

هذه هي نطاقات الاتصال الثلاثة. transport layer توفّر اتصالًا من طرف إلى طرف (end-to-end, E2E) بين عمليتين من عمليات التطبيقات. network layer توفّر مسارًا من مضيف إلى مضيف (host-to-host, H2H) بين جهازين، مهما كان عدد الموجّهات بينهما. data link layer تتولى النقل من نقطة إلى نقطة (point-to-point, P2P) عبر قفزة واحدة بين واجهتين متصلتين مباشرة.

One E2E connection over one H2H path over four P2P hopsاتصال E2E واحد فوق مسار H2H واحد فوق أربع قفزات P2P
ScopeالنطاقBetweenبينVirtual or physicalافتراضي أم فيزيائيCount along one pathالعدد على مسار واحد
E2E (transport)E2E (النقل)Two application processesعمليتين من عمليات التطبيقاتVirtualافتراضيOneواحد
H2H (network)H2H (الشبكة)Two hosts, across routersمضيفين، عبر الموجّهاتVirtualافتراضيOneواحد
P2P (data link)P2P (ربط البيانات)Two adjacent interfacesواجهتين متجاورتينPhysical linkوصلة فيزيائيةOne per hopواحد لكل قفزة
Three connection scopes on one pathثلاثة نطاقات اتصال على مسار واحد

The rule to take away: the higher the layer, the wider its scope and the more virtual its connection. Only the P2P links are real cables or radio channels. The E2E connection is not a wire at all. It is state held in the two end hosts: RFC 9293 (section 3.3.1) describes the TCP control block that stores the local and remote IP addresses and ports. TCP creates that state with the three-way handshake (section 3.5), while IP itself is connectionless. UDP keeps no connection state at all, yet its datagrams are still delivered process to process.

القاعدة التي يجب أن تخرج بها: كلما ارتفعت الطبقة اتسع نطاقها وصار اتصالها أكثر افتراضية. وصلات P2P وحدها هي كابلات حقيقية أو قنوات راديو. أما اتصال E2E فليس سلكًا على الإطلاق، بل هو حالة (state) محفوظة في المضيفين الطرفيين: يصف RFC 9293 (القسم 3.3.1) كتلة تحكم TCP (TCP control block) التي تخزّن عناوين IP والمنافذ المحلية والبعيدة. يُنشئ TCP هذه الحالة عبر المصافحة الثلاثية (three-way handshake) (القسم 3.5)، بينما IP نفسه عديم الاتصال (connectionless). أما UDP فلا يحتفظ بأي حالة اتصال إطلاقًا، ومع ذلك تُسلَّم رسائله (datagrams) من عملية إلى عملية.

Quick checkاختبار سريع

Which connection scope exists between two application processes rather than two machines?أي نطاق اتصال يوجد بين عمليتين من عمليات التطبيقات وليس بين جهازين؟

Recall

How many E2E, H2H and P2P connections exist when your laptop reaches a server through four routers? (Treat the Wi-Fi access point as part of the first link.)كم عدد اتصالات E2E وH2H وP2P الموجودة عندما يصل حاسوبك المحمول إلى خادم عبر أربعة موجّهات؟ (اعتبر نقطة الوصول Wi-Fi جزءًا من الوصلة الأولى.)

One E2E (process to process), one H2H (host to host), and five P2P links: laptop to router 1, router 1 to router 2, router 2 to router 3, router 3 to router 4, and router 4 to the server.
اتصال E2E واحد (من عملية إلى عملية)، واتصال H2H واحد (من مضيف إلى مضيف)، وخمس وصلات P2P: من الحاسوب المحمول إلى الموجّه 1، ومن الموجّه 1 إلى الموجّه 2، ومن الموجّه 2 إلى الموجّه 3، ومن الموجّه 3 إلى الموجّه 4، ومن الموجّه 4 إلى الخادم.

One address per scopeعنوان واحد لكل نطاق

If each scope connects a different kind of thing, each needs its own way to name that thing. Look back at the encapsulation stepper. The server is 3.120.0.10, the service on it is port 443, and the next hop's interface is f4:8c:50:2b:e1:04. Three addresses, one per scope.

إذا كان كل نطاق يربط نوعًا مختلفًا من الأشياء، فكل نطاق يحتاج طريقته الخاصة لتسمية هذا الشيء. ارجع إلى محاكي التغليف: الخادم هو 3.120.0.10، والخدمة عليه هي المنفذ 443، وواجهة القفزة التالية هي f4:8c:50:2b:e1:04. ثلاثة عناوين، عنوان لكل نطاق.

E2E names a process with a port number. H2H names a machine with an IP address. P2P names a network interface on the local link with a MAC address. (The course materials write "Mac"; the standard spelling is MAC, for Media Access Control.)

نطاق E2E يسمّي العملية (process) بـ port number. ونطاق H2H يسمّي الجهاز بـ IP address. ونطاق P2P يسمّي واجهة الشبكة على الوصلة المحلية بـ MAC address. (مواد المقرر تكتب "Mac"، والكتابة القياسية هي MAC، اختصارًا لـ Media Access Control.)

Address sizesأحجام العناوين

Port numberرقم المنفذ (port number)
16 bits, values 0 to 6553516 bits، وقيمه من 0 إلى 65535
IPv4 addressعنوان IPv4
32 bits (four octets)32 bits (أربعة أثمان أو octets)
MAC addressعنوان MAC
48 bits (EUI-48, six octets)48 bits (EUI-48، ستة أثمان أو octets)

Ports are 16-bit fields in both TCP (RFC 9293) and UDP (RFC 768). IPv4 addresses are a fixed four octets (RFC 791, section 2.3). MAC addresses are 48 bits, burned into the NIC but sometimes settable in software, written like 1A-2F-BB-76-09-AD.

المنافذ حقول بطول 16-bit في كل من TCP (RFC 9293) وUDP (RFC 768). عناوين IPv4 طولها ثابت وهو أربعة أثمان (octets) (RFC 791، القسم 2.3). عناوين MAC طولها 48 بت، وهي محفورة في بطاقة الشبكة (NIC) لكن يمكن أحيانًا ضبطها برمجيًا، وتُكتب بالشكل 1A-2F-BB-76-09-AD.

RangeالنطاقNameالاسمExampleمثال
0 to 10230 to 1023System portsمنافذ النظام (System ports)HTTPS on 443HTTPS على المنفذ 443
1024 to 491511024 to 49151User portsمنافذ المستخدم (User ports)Registered application servicesخدمات تطبيقات مسجّلة
49152 to 6553549152 to 65535Dynamic portsالمنافذ الديناميكية (Dynamic ports)Client source port 51514منفذ المصدر لدى العميل 51514
Port ranges (RFC 6335, section 6)نطاقات المنافذ (RFC 6335، القسم 6)

What changes at each hopما الذي يتغير عند كل قفزة

Putting scopes and addresses together gives the most useful insight of this concept. Along the whole path, ignoring NAT, the source and destination IP addresses and ports stay the same, because their scopes span the whole path. The MAC addresses are replaced at every hop, because their scope is one link: each router strips the old frame and builds a new one for the next link. To build it, the router uses ARP (RFC 826) to map the next hop's IP address to its 48-bit Ethernet address.

جمع النطاقات والعناوين معًا يعطي أهم فكرة في هذا المفهوم. على طول المسار كاملًا، وبتجاهل NAT، تبقى عناوين IP والمنافذ للمصدر والوجهة كما هي، لأن نطاقاتها تمتد على المسار كله. أما عناوين MAC فتُستبدل عند كل قفزة، لأن نطاقها وصلة واحدة: كل موجّه ينزع الإطار القديم ويبني إطارًا جديدًا للوصلة التالية. ولبنائه يستخدم الموجّه بروتوكول ARP (RFC 826) ليحوّل عنوان IP للقفزة التالية إلى عنوان Ethernet الخاص بها بطول 48-bit.

Quick checkاختبار سريع

A router forwards your packet toward a cloud server. Ignoring NAT, which address does it replace for the next hop?موجّه (router) يمرّر حزمتك نحو خادم سحابي. بتجاهل NAT، أي عنوان يستبدله من أجل القفزة التالية؟

Recall

Along a path from your laptop to a cloud server, which addresses stay the same and which change at every hop?على طول المسار من حاسوبك المحمول إلى خادم سحابي، أي العناوين تبقى كما هي وأيها يتغير عند كل قفزة؟

Ignoring NAT, the source and destination IP addresses and ports stay the same. The MAC addresses are replaced at every hop, because each P2P link has its own pair of interfaces.
بتجاهل NAT، تبقى عناوين IP والمنافذ للمصدر والوجهة كما هي. أما عناوين MAC فتُستبدل عند كل قفزة، لأن لكل وصلة P2P زوجها الخاص من الواجهات.

Addresses name endpoints, but a conversation needs more than one name. Open two browser tabs to the same server. Both tabs run on one laptop with one IP address, and both talk to one server port. Yet every reply lands in the right tab. Something must tell the two conversations apart.

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

Worked exampleمثال محلول

Two tabs, one serverتبويبان، خادم واحد

  1. Server socketالـ socket الخاص بالخادم

    3.120.0.10:443
    3.120.0.10:443
  2. Tab A socketالـ socket الخاص بالتبويب A

    10.0.0.7:51514
    10.0.0.7:51514
  3. Tab B socketالـ socket الخاص بالتبويب B

    10.0.0.7:51515
    10.0.0.7:51515
  4. Only the source port differsمنفذ المصدر وحده هو المختلف

    Both flows are TCP from 10.0.0.7 to 3.120.0.10:443. Only the source ports 51514 and 51515 differ, so the OS delivers each reply to the right tab.
    كلا التدفقين TCP من 10.0.0.7 إلى 3.120.0.10:443. لا يختلف بينهما إلا منفذا المصدر 51514 و51515، لذلك يسلّم نظام التشغيل كل رد إلى التبويب الصحيح.

The general rule builds up in three steps. A socket is one endpoint, an IP address plus a port number. A connection is a pair of sockets, one at each end, which is exactly how RFC 9293 defines it. When networks need to tell flows apart, they add the protocol and use the 5-tuple, which RFC 6437 (section 3) lists as destination address, source address, protocol, destination port and source port. The protocol field is what separates a TCP flow from a UDP flow that happens to share the same addresses and ports.

القاعدة العامة تُبنى في ثلاث خطوات. الـ socket نقطة نهاية واحدة، أي IP address مع port number. والاتصال (connection) زوج من الـ sockets، واحد عند كل طرف، وهذا بالضبط تعريف RFC 9293 له. وعندما تحتاج الشبكات إلى التمييز بين التدفقات (flows)، تضيف البروتوكول وتستخدم الـ 5-tuple، الذي يذكره RFC 6437 (القسم 3) على أنه: عنوان الوجهة، وعنوان المصدر، والبروتوكول، ومنفذ الوجهة، ومنفذ المصدر. حقل البروتوكول هو ما يفصل تدفق TCP عن تدفق UDP يصادف أنه يشترك معه في العناوين والمنافذ نفسها.

socket=(IP,port)\text{socket} = (\text{IP}, \text{port})
One endpointنقطة طرفية واحدة
flow=(src IP,dst IP,proto,src port,dst port)\text{flow} = (\text{src IP}, \text{dst IP}, \text{proto}, \text{src port}, \text{dst port})
The 5-tupleالخماسية (5-tuple)
Two sockets join into one connection, identified by five fieldsاثنان من الـ sockets يجتمعان في اتصال واحد، يُعرَّف بخمسة حقول

Notice how this ties back to the scopes. The 5-tuple uses only the E2E and H2H addresses, the ones that survive the whole path. The MAC address plays no part in identifying a connection, because it covers only one hop and would change before the reply ever came back.

لاحظ كيف يرتبط هذا بالنطاقات. الـ 5-tuple يستخدم فقط عناوين E2E وH2H، أي العناوين التي تبقى على طول المسار كله. أما MAC address فلا دور له في تعريف الاتصال، لأنه يغطي قفزة واحدة فقط وسيتغير قبل أن يعود الرد أصلًا.

Quick checkاختبار سريع

Two browser tabs on one laptop connect to the same server on port 443. What lets the operating system tell the two connections apart?تبويبان في متصفح على حاسوب محمول واحد يتصلان بالخادم نفسه على المنفذ 443. ما الذي يجعل نظام التشغيل قادرًا على التمييز بين الاتصالين؟

Recall

What identifies a socket, and what identifies a flow?ما الذي يعرّف الـ socket، وما الذي يعرّف التدفق (flow)؟

A socket is an IP address plus a port number. A flow (or connection) is identified by the 5-tuple: source IP, destination IP, protocol, source port and destination port.
الـ socket هو عنوان IP مع رقم منفذ. والتدفق (أو الاتصال) يُعرَّف بالـ 5-tuple: عنوان IP المصدر، وعنوان IP الوجهة، والبروتوكول، ومنفذ المصدر، ومنفذ الوجهة.

So far the layers have been abstractions. The last step is to find them inside a real computer. A Node.js server asks the operating system for a socket and gets back a file descriptor. It writes bytes to that descriptor. Inside the kernel, TCP and IP headers are added. A driver hands the finished frame to the network card, which turns it into electrical or radio signals.

حتى الآن كانت الطبقات مفاهيم مجردة. الخطوة الأخيرة هي أن نجدها داخل حاسوب حقيقي. خادم Node.js يطلب من نظام التشغيل socket فيحصل على واصف ملف (file descriptor). ثم يكتب البايتات في هذا الواصف. داخل النواة (kernel) تُضاف ترويستا TCP وIP. ثم يسلّم برنامج التشغيل (driver) الإطار المكتمل إلى بطاقة الشبكة، التي تحوّله إلى إشارات كهربائية أو راديوية.

That story maps the layers onto three parts of one machine. The application layer lives in application space: the browser or server process, including its HTTP library. The transport layer and network layer live in the operating system kernel. The data link layer and physical layer live in the network interface and its driver.

هذه القصة توزّع الطبقات على ثلاثة أجزاء من جهاز واحد. application layer تعيش في فضاء التطبيق: عملية المتصفح أو الخادم، بما فيها مكتبة HTTP الخاصة بها. transport layer وnetwork layer تعيشان في نواة نظام التشغيل. data link layer وphysical layer تعيشان في واجهة الشبكة وبرنامج تشغيلها.

Two seams separate these spaces. The socket API is the door between application and OS, which is why the socket of the previous concept is also a programming object. The Linux socket(7) manual calls sockets the uniform interface between the user process and the network protocol stacks in the kernel. Drivers are the door between OS and hardware. For the Web, the concrete stack reads: browser or server, HTTP, socket API, TCP, IP, Ethernet, then wired or wireless media.

حدّان فاصلان يفصلان هذه الفضاءات. socket API هو الباب بين التطبيق ونظام التشغيل، ولهذا فإن الـ socket في المفهوم السابق هو أيضًا كائن برمجي. دليل socket(7) في Linux يصف الـ sockets بأنها الواجهة الموحدة بين عملية المستخدم وحزم بروتوكولات الشبكة في النواة. أما برامج التشغيل (drivers) فهي الباب بين نظام التشغيل والعتاد. بالنسبة للويب، تُقرأ الحزمة الفعلية هكذا: المتصفح أو الخادم، ثم HTTP، ثم الـ socket API، ثم TCP، ثم IP، ثم Ethernet، ثم الوسط السلكي أو اللاسلكي.

A request drops through application, kernel and hardware, crossing two seamsطلب ينزل عبر التطبيق والنواة والعتاد، عابرًا حدّين فاصلين
SpaceالفضاءLayersالطبقاتExampleمثال
Application spaceفضاء التطبيق (Application space)ALALBrowser or Node.js server with its HTTP codeالمتصفح أو خادم Node.js مع شيفرة HTTP الخاصة به
Operating system kernelنواة نظام التشغيل (kernel)TL, NLTL, NLTCP and IP implementations, reached through socketsتطبيقات TCP وIP، ويُوصَل إليها عبر الـ sockets
Hardware (NIC and driver)العتاد (بطاقة الشبكة NIC وبرنامج تشغيلها)DLL, PLDLL, PLEthernet or Wi-Fi chip, firmware and driverشريحة Ethernet أو Wi-Fi، والبرمجيات الثابتة (firmware) وبرنامج التشغيل (driver)
Where each layer runsأين تعمل كل طبقة

The seams are also boundaries of privilege. An application cannot forge TCP state directly; it has to go through the socket API. This matters later in the course. Latency is added at every crossing, and virtual machines and containers in lecture 2 virtualize exactly these seams.

هذه الحدود الفاصلة هي أيضًا حدود صلاحيات (privilege). لا يستطيع التطبيق أن يزوّر حالة TCP مباشرة، بل يجب أن يمر عبر الـ socket API. وهذا مهم لاحقًا في المقرر: يُضاف Latency عند كل عبور، والأجهزة الافتراضية (virtual machines) والحاويات (containers) في المحاضرة 2 تعمل على محاكاة هذه الحدود بالذات افتراضيًا.

Quick checkاختبار سريع

On a laptop browsing the Web, where does the TCP implementation normally run?على حاسوب محمول يتصفح الويب، أين يعمل تطبيق TCP عادةً؟

Recall

Where do TCP and IP normally run in a computer, and what is the interface an application uses to reach them?أين يعمل TCP وIP عادة داخل الحاسوب، وما الواجهة التي يستخدمها التطبيق للوصول إليهما؟

In the operating system kernel. Applications reach them through the socket API, which hands the program a file descriptor.
في نواة نظام التشغيل (kernel). تصل التطبيقات إليهما عبر الـ socket API، الذي يعطي البرنامج واصف ملف (file descriptor).

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • The TCP/IP stack exists to give a client and a server connectivity, and connectivity emerges from all five layers working together.توجد حزمة TCP/IP لتمنح العميل (client) والخادم (server) الاتصالية، والاتصالية تنشأ من عمل الطبقات الخمس معًا.
  • OSI has seven layers, and TCP/IP folds session and presentation into the application.نموذج OSI فيه سبع طبقات، أما TCP/IP فيدمج طبقتي الجلسة (session) والعرض (presentation) داخل طبقة التطبيق.
  • The PDUs are message, segment, packet (datagram), frame and bits, and each payload is the PDU of the layer above.وحدات الـ PDU هي: الرسالة (message)، والمقطع (segment)، والحزمة (packet أو datagram)، والإطار (frame)، والبتات (bits)، وحمولة كل طبقة هي الـ PDU الخاص بالطبقة التي فوقها.
  • Routers process only the network, link and physical layers. Only end hosts read transport headers and application messages.الموجّهات (routers) تعالج طبقات الشبكة والربط والطبقة الفيزيائية فقط. المضيفان الطرفيان وحدهما يقرآن ترويسات النقل ورسائل التطبيق.
  • Transport connects processes end to end using 16-bit ports.طبقة النقل (transport) تربط العمليات (processes) من طرف إلى طرف باستخدام منافذ (ports) بطول 16 بت.
  • Network connects hosts using 32-bit IPv4 addresses.طبقة الشبكة (network) تربط المضيفين (hosts) باستخدام عناوين IPv4 بطول 32 بت.
  • Data link connects adjacent interfaces using 48-bit MAC addresses, which are rewritten at every hop.طبقة ربط البيانات (data link) تربط الواجهات المتجاورة باستخدام عناوين MAC بطول 48 بت، وهذه العناوين يُعاد كتابتها عند كل قفزة.
  • A socket is an IP address plus a port, a connection is a pair of sockets, and a flow is identified by the 5-tuple.الـ socket هو عنوان IP مع منفذ، والاتصال (connection) هو زوج من الـ sockets، والتدفق (flow) يُعرَّف بالـ 5-tuple.
  • Applications live in user space, TCP and IP in the kernel behind the socket API, and link and physical in the NIC and its driver.التطبيقات تعيش في فضاء المستخدم (user space)، وTCP وIP في النواة (kernel) خلف الـ socket API، وطبقتا الربط والفيزيائية في بطاقة الشبكة (NIC) وبرنامج تشغيلها (driver).

Sourcesالمصادر

Part 04: The Web and network applicationsالويب وتطبيقات الشبكة

The Web as one network application, decentralized versus distributed designs, the two-dimensional design space, and the request-response loop.الويب بوصفه تطبيق شبكة واحدًا، والتصاميم اللامركزية مقابل الموزعة، وفضاء التصميم ثنائي الأبعاد، وحلقة الطلب والاستجابة (request-response).

5 concepts5 مفاهيم, ، slides 30-39الشرائح 30-39

Why this part mattersلماذا يهمّ هذا الجزء

Part 03 described the Internet as plumbing: a stack of layers that moves bytes between machines. This part climbs to the top of that stack and asks what people actually build on it.

Every edge or cloud system you will study or design for your research is a network application whose server side has been cut into components. The story here runs in one line: an application uses the Internet, its server side is really several components, each component can be placed on a different layer and resource, and every request a client sends makes those components spend compute, storage and communication. The central question, which component goes on which layer and why, is the core question of edge computing research and a very likely exam question.

وصف الجزء 03 الإنترنت بأنها شبكة أنابيب: مكدّس من الطبقات ينقل البايتات بين الأجهزة. أما هذا الجزء فيصعد إلى قمة ذلك المكدّس ويسأل: ما الذي يبنيه الناس فعلًا فوقه؟

كل نظام edge أو cloud ستدرسه أو تصمّمه في بحثك هو تطبيق شبكي network application قُسِّم جانب الخادم فيه إلى مكوّنات. والقصة هنا تُختصر في سطر واحد: التطبيق يستخدم الإنترنت، وجانب الخادم فيه هو في الحقيقة عدة مكوّنات، وكل مكوّن يمكن وضعه على طبقة ومورد مختلفين، وكل طلب يرسله العميل يجعل هذه المكوّنات تستهلك حوسبة وتخزينًا واتصالًا. والسؤال المحوري، أي مكوّن يوضع على أي طبقة ولماذا، هو السؤال الجوهري في أبحاث الـ edge computing، ومن المرجّح جدًا أن يأتي في الامتحان.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why the Web is one network application on the Internet, and sort any app by the protocol it speaks.أن تشرح لماذا يُعدّ الويب تطبيقًا شبكيًا واحدًا يعمل فوق الإنترنت، وأن تصنّف أي تطبيق حسب البروتوكول الذي يتكلّمه.
  2. Use the lecture's definitions of decentralized and distributed correctly, and name your definition when papers disagree.أن تستخدم تعريفَي المحاضرة لـ decentralized (لامركزي) و distributed (موزّع) بشكل صحيح، وأن تصرّح بالتعريف الذي تعتمده عندما تختلف الأوراق البحثية.
  3. Break a server side into components and place each one in the design space as a layer choice plus a resource instance.أن تقسّم جانب الخادم إلى مكوّنات، وأن تضع كل مكوّن في فضاء التصميم design space على أنه اختيار لطبقة مع نسخة instance من مورد.
  4. Justify a placement with latency, compute, storage, cost, privacy, sharing and availability.أن تبرّر قرار وضع المكوّن بمعايير latency والحوسبة والتخزين والتكلفة والخصوصية والمشاركة والتوافرية availability.
  5. Separate the logical HTTP conversation from the physical path of bytes through sockets and the TCP/IP stack.أن تفصل بين محادثة HTTP المنطقية والمسار الفعلي للبايتات عبر الـ sockets ومكدّس TCP/IP.
  6. State who starts the request-response loop and what each response costs the server.أن تذكر من يبدأ حلقة الطلب والاستجابة request-response loop، وما الذي تكلّفه كل استجابة للخادم.

Picture two things you do before lunch. You open a KFUPM page in a browser. Then your mail program hands a message to the KFUPM mail server over SMTP. Both need the Internet. Only the first one is the Web. Getting this distinction right is the first step to thinking clearly about applications.

تخيّل أمرين تفعلهما قبل الغداء. تفتح صفحة لجامعة KFUPM في المتصفح. ثم يسلّم برنامج البريد رسالة إلى خادم البريد في KFUPM عبر بروتوكول SMTP. كلاهما يحتاج الإنترنت، لكن الأول فقط هو الويب. فهم هذا الفرق بشكل صحيح هو الخطوة الأولى للتفكير بوضوح في التطبيقات.

Infrastructure and the services built on itالبنية التحتية والخدمات المبنية فوقها

The Internet is the infrastructure: the TCP/IP stack, the routers and the providers that carry packets. The World Wide Web (WWW) is one application built on top of that infrastructure. What makes something "the Web" is that it fetches linked resources using HTTP. MDN puts it plainly: "The Internet is an infrastructure, whereas the Web is a service built on top of the infrastructure."

الإنترنت هي البنية التحتية: TCP/IP stack والموجّهات (routers) ومزوّدو الخدمة الذين ينقلون الحزم. أما World Wide Web (WWW) فهو تطبيق واحد مبني فوق هذه البنية التحتية. وما يجعل الشيء "ويبًا" هو أنه يجلب موارد مترابطة بالروابط باستخدام HTTP. وتقولها MDN بوضوح: "الإنترنت بنية تحتية، بينما الويب خدمة مبنية فوق هذه البنية التحتية".

History makes the order of events obvious. The Internet was carrying remote logins, email and file transfers for years before anyone had heard of a web page.

التاريخ يجعل ترتيب الأحداث واضحًا: كانت الإنترنت تنقل جلسات الدخول عن بُعد والبريد الإلكتروني ونقل الملفات لسنوات قبل أن يسمع أحد بشيء اسمه صفحة ويب.

What counts as a network applicationما الذي يُعدّ تطبيقًا شبكيًا

Once the Web is seen as one application among many, the natural next question is what the whole family looks like. Open HungerStation on your phone and order dinner. The app on your phone (the Client) sends the order across the Internet to the company's backend (the Server), which passes it to the restaurant and a courier. Without the network the app is just a menu picture.

بمجرد أن نرى الويب تطبيقًا واحدًا بين تطبيقات كثيرة، يصبح السؤال الطبيعي التالي: كيف تبدو العائلة كلها؟ افتح تطبيق HungerStation على جوالك واطلب العشاء. التطبيق الذي على جوالك (الـ client) يرسل الطلب عبر الإنترنت إلى الأنظمة الخلفية للشركة (الـ server)، والتي تمرّره إلى المطعم وإلى المندوب. ومن دون الشبكة يصبح التطبيق مجرد صورة لقائمة طعام.

The lecture's definition of a Network application is broad on purpose: any application that uses the Internet as its transport medium. That phrase has a precise meaning in the stack you met in part 03. The application hands its messages to the Transport layer through the Socket API, and everything below that line is someone else's job. What the messages mean is decided by the application.

تعريف المحاضرة لـ network application واسع عن قصد: أي تطبيق يستخدم الإنترنت وسيطًا لنقل بياناته. ولهذه العبارة معنى دقيق في المكدّس الذي تعرّفت عليه في الجزء 03: التطبيق يسلّم رسائله إلى transport layer عبر socket API، وكل ما تحت هذا الخط مسؤولية جهة أخرى. أما معنى الرسائل فيقرّره التطبيق نفسه.

Familiar apps hide an interesting mix. Some run inside a browser, some are native programs, and one exchanges its files with other users instead of a company server. Try sorting them yourself before reading the table.

التطبيقات المألوفة تخفي خليطًا مثيرًا للاهتمام: بعضها يعمل داخل المتصفح، وبعضها برامج أصلية (native)، وواحد منها يتبادل ملفاته مع مستخدمين آخرين بدلًا من خادم شركة. جرّب أن تصنّفها بنفسك قبل قراءة الجدول.

AppالتطبيقRuns inيعمل فيTalks toيتواصل معArchitectureالمعمارية
Chrome (opening a site)Chrome (فتح موقع)A browserمتصفحWeb servers over HTTPخوادم الويب عبر HTTPWeb, client-serverويب، عميل وخادم client-server
Gmail in a browser tabGmail في تبويب المتصفحA browserمتصفحGoogle's mail servers over HTTPخوادم البريد لدى Google عبر HTTPWeb, client-serverويب، عميل وخادم client-server
Outlook desktopOutlook على الجهاز المكتبيA native programبرنامج أصلي nativeA mail server (over SMTP or IMAP)خادم بريد (عبر SMTP أو IMAP)Client-server, mail protocolsعميل وخادم client-server، وبروتوكولات البريد
Netflix or HungerStation appتطبيق Netflix أو HungerStationA native phone appتطبيق جوال أصلي nativeThe company's backend serversالخوادم الخلفية للشركةClient-server, HTTP APIsعميل وخادم client-server، وHTTP APIs
uTorrentuTorrentA native programبرنامج أصلي nativeA tracker to find peers, then other BitTorrent peers directlytracker للعثور على النظراء، ثم نظراء BitTorrent آخرون مباشرةPeer-to-peerنظير إلى نظير peer-to-peer
Five familiar apps, sorted by how they use the networkخمسة تطبيقات مألوفة، مصنّفة حسب طريقة استخدامها للشبكة

uTorrent is the odd one out. It speaks the BitTorrent protocol, where the specification says that when many people download the same file at once, "the downloaders upload to each other". Each copy of the program acts as a client and a server at the same time. This arrangement is called peer-to-peer, and it returns in the next concept when we ask what decentralized means.

تطبيق uTorrent هو الاستثناء. فهو يتكلّم بروتوكول BitTorrent، الذي تنص مواصفته على أنه عندما يحمّل أشخاص كثيرون الملف نفسه في الوقت نفسه، "يرفع المحمِّلون الملف بعضهم لبعض". فكل نسخة من البرنامج تعمل عميلًا وخادمًا في آن واحد. هذا الترتيب يُسمّى نظير إلى نظير (peer-to-peer)، وسيعود في المفهوم التالي عندما نسأل ما معنى "لامركزي".

The protocol decides the circleالبروتوكول هو الذي يحدّد الدائرة

A useful picture, adapted from Connolly and Hoar's Fundamentals of Web Development, draws the Internet as a large circle with several smaller circles inside it: the Web, email, online gaming and FTP.

صورة مفيدة، مقتبسة من كتاب Fundamentals of Web Development لـ Connolly وHoar، ترسم الإنترنت دائرةً كبيرة بداخلها عدة دوائر أصغر: الويب، والبريد الإلكتروني، والألعاب عبر الإنترنت، وFTP.

The Internet carries many applications. The Web is one circle inside it, not the whole.الإنترنت تحمل تطبيقات كثيرة. الويب دائرة واحدة بداخلها، وليس الإنترنت كلها.

The rule for deciding which circle an application belongs to is its Application layer Protocol. If it speaks HTTP to fetch web resources, it is in the Web circle. If it speaks SMTP to move mail between servers, FTP to move files, or a custom game protocol, it sits in a sibling circle. Siblings share the Internet but not the Web. The circle sizes are illustrative only; they make no claim about traffic shares.

القاعدة التي تحدّد إلى أي دائرة ينتمي التطبيق هي protocol الخاص به في application layer. فإذا كان يتكلّم HTTP لجلب موارد الويب، فهو في دائرة الويب. وإذا كان يتكلّم SMTP لنقل البريد بين الخوادم، أو FTP لنقل الملفات، أو بروتوكول ألعاب خاصًا، فهو في دائرة شقيقة. الدوائر الشقيقة تتشارك الإنترنت لكنها لا تتشارك الويب. وأحجام الدوائر توضيحية فقط، ولا تدّعي شيئًا عن حصص حركة البيانات.

Email is a good exam trap. When you read Gmail in a browser tab, your browser talks HTTP to Google, which is the Web. When Google then delivers your message to a KFUPM mail server, the two mail servers speak SMTP, which is not the Web. One everyday "email" experience touches two circles.

البريد الإلكتروني فخّ امتحاني جيد. عندما تقرأ Gmail في تبويب المتصفح، فإن متصفحك يتكلّم HTTP مع Google، وهذا هو الويب. وعندما تسلّم Google رسالتك بعد ذلك إلى خادم بريد في KFUPM، فإن خادمَي البريد يتكلّمان SMTP، وهذا ليس الويب. فتجربة "بريد إلكتروني" يومية واحدة تلمس دائرتين.

Recall

Name two network applications that are not part of the Web, and say what protocol makes them not Web.اذكر تطبيقين شبكيين ليسا جزءًا من الويب، وبيّن أي بروتوكول يجعلهما خارج الويب.

Email transfer between mail servers (SMTP) and file transfer (FTP), or an online game with its own protocol. The Web is the application that uses HTTP. The others share the Internet but not HTTP.
نقل البريد بين خوادم البريد (SMTP) ونقل الملفات (FTP)، أو لعبة عبر الإنترنت لها بروتوكولها الخاص. الويب هو التطبيق الذي يستخدم HTTP، أما البقية فتتشارك الإنترنت لكنها لا تستخدم HTTP.

Quick checkاختبار سريع

Which statement correctly describes how the Internet and the Web relate?أي عبارة تصف بشكل صحيح العلاقة بين الإنترنت والويب؟

Take one calculator and build it three ways. First, a desktop calculator: one program on one machine. Second, a browser page that sends "2+3" over HTTP to a separate server program, which sends back 5. Third, the same service, but the server's work and data are spread over several machines, with addition on one node and the history database on another.

خذ آلة حاسبة واحدة وابنِها بثلاث طرق. الأولى: آلة حاسبة مكتبية، برنامج واحد على جهاز واحد. الثانية: صفحة في المتصفح ترسل "2+3" عبر HTTP إلى برنامج خادم منفصل، فيعيد 5. الثالثة: الخدمة نفسها، لكن عمل الخادم وبياناته موزّعة على عدة أجهزة، فالجمع على عقدة (node) وقاعدة بيانات السجلّ على عقدة أخرى.

By the lecture's definitions, the first build is neither decentralized nor distributed. The second is a Decentralized application: the application is split into two standalone components (Client and Server), usually on different machines, that talk through a Protocol using sockets. It is also a Distributed application in the lecture's sense, because computation is shared between client and server and state lives on both. The third build pushes distribution further: the server's own computation and data are spread over several machines.

بحسب تعريفات المحاضرة، النسخة الأولى ليست لامركزية ولا موزّعة. والثانية decentralized application: فالتطبيق مقسوم إلى components مستقلَّين اثنين (client وserver)، عادةً على جهازين مختلفين، يتواصلان عبر protocol باستخدام sockets. وهي أيضًا distributed application بمعنى المحاضرة، لأن الحوسبة مقسّمة بين العميل والخادم، والحالة (state) موجودة على الطرفين. أما النسخة الثالثة فتدفع التوزيع أبعد: حوسبة الخادم نفسه وبياناته موزّعة على عدة أجهزة.

Keep these two questions apart, because they become the two axes of the design space in the next concept: decentralization is the vertical axis, distribution the horizontal one.

أبقِ هذين السؤالين منفصلين، لأنهما يصبحان محورَي فضاء التصميم في المفهوم التالي: اللامركزية هي المحور العمودي، والتوزيع هو المحور الأفقي.

AspectالجانبDecentralized (lecture)لامركزي decentralized (المحاضرة)Distributed (lecture)موزّع distributed (المحاضرة)
What is splitما الذي يُقسَّمThe application itself, into separate client and server programsالتطبيق نفسه، إلى برنامجَي عميل وخادم منفصلينThe computation and state, between client and server or across several machinesالحوسبة والحالة، بين العميل والخادم أو عبر عدة أجهزة
What the definition stressesما الذي يركّز عليه التعريفStructure: separate programs that talk through a protocol and socketsالبنية: برامج منفصلة تتواصل عبر بروتوكول وsocketsResources: where computation and state physically liveالموارد: أين توجد الحوسبة والحالة فعليًا
Lecture exampleمثال المحاضرةBitTorrent, BitcoinBitTorrent، BitcoinGoogle CloudGoogle Cloud
Design-space axisمحور فضاء التصميمVertical: which layer a component sits onعمودي: على أي طبقة يقع المكوّنHorizontal: which compute or storage resource it usesأفقي: أي مورد حوسبة أو تخزين يستخدمه
The two lecture definitions side by sideتعريفا المحاضرة جنبًا إلى جنب

The lecture's examples fit. BitTorrent and Bitcoin have no single controlling center: the Bitcoin paper opens with the goal of sending payments "directly from one party to another without going through a financial institution". Google Cloud is one provider that spreads computation and state across its own machines in many regions and zones around the world.

أمثلة المحاضرة تنطبق على ذلك. فـ BitTorrent وBitcoin ليس لهما مركز تحكّم واحد: ورقة Bitcoin تبدأ بهدف إرسال المدفوعات "مباشرة من طرف إلى آخر دون المرور بمؤسسة مالية". أما Google Cloud فهو مزوّد واحد يوزّع الحوسبة والحالة على أجهزته الخاصة في مناطق (regions) ونطاقات (zones) كثيرة حول العالم.

Recall

Using the lecture's definitions, what makes an application decentralized, and what makes it distributed? Give the lecture's example of each.باستخدام تعريفات المحاضرة، ما الذي يجعل التطبيق لامركزيًا، وما الذي يجعله موزّعًا؟ اذكر مثال المحاضرة لكل منهما.

Decentralized: the app is split into separate client and server programs, usually on different machines, communicating through a protocol and sockets (BitTorrent, Bitcoin). Distributed: computation does not happen on a single machine, it is distributed between client and server, and state (memory/data) is distributed too (Google Cloud).
اللامركزي: التطبيق مقسوم إلى برنامجَي عميل وخادم منفصلين، عادةً على أجهزة مختلفة، يتواصلان عبر بروتوكول وsockets (BitTorrent، Bitcoin). الموزّع: الحوسبة لا تتم على جهاز واحد، بل تتوزّع بين العميل والخادم، والحالة (الذاكرة/البيانات) موزّعة أيضًا (Google Cloud).

Quick checkاختبار سريع

Using the lecture's own definitions, which example is labelled a distributed application?باستخدام تعريفات المحاضرة نفسها، أي مثال يوصف بأنه تطبيق موزّع distributed application؟

So far "the server" has been a single word. Look inside the calculator's server side and it turns out to be several separate pieces, and that discovery is what makes edge computing possible: separate pieces can live in separate places.

حتى الآن كان "الخادم" كلمة واحدة. لكن انظر داخل جانب الخادم في الآلة الحاسبة وستجده عدة قطع منفصلة، وهذا الاكتشاف هو ما يجعل الـ edge computing ممكنًا: القطع المنفصلة يمكن أن تعيش في أماكن منفصلة.

The server side is a set of componentsجانب الخادم مجموعة من المكوّنات

Follow one request. The Client sends "multiply 6 by 7". It does not know or care how the server side is organized. It simply knocks on one door. That door is the API gateway, a single entry point that receives every client request and routes it to the right service. AWS describes its own gateway product as a "front door" for applications to reach backend services. Behind it sit four operation services (Add, Sub, Mul, Div), each exposing its own Interface, like a small Web API, and each able to read or write a Database.

تتبّع طلبًا واحدًا. يرسل الـ client "اضرب 6 في 7". وهو لا يعرف ولا يهمّه كيف نُظِّم جانب الخادم، بل يطرق بابًا واحدًا فقط. هذا الباب هو API Gateway، نقطة دخول واحدة تستقبل كل طلبات العملاء وتوجّه كل طلب إلى الخدمة المناسبة. وتصف AWS منتج البوابة الخاص بها بأنه "الباب الأمامي" الذي تصل منه التطبيقات إلى الخدمات الخلفية. وخلفه تقف أربع خدمات للعمليات (Add، Sub، Mul، Div)، كل منها يعرض interface خاصة به، مثل web API صغيرة، وكل منها يستطيع القراءة من قاعدة البيانات (Database) أو الكتابة فيها.

Client
browser or app

Sends one request and waits.

يرسل طلبًا واحدًا وينتظر.

HTTP request
API Gateway
entry point

Reads the operation and picks a service.

يقرأ العملية المطلوبة ويختار الخدمة المناسبة.

route
Add, Sub, Mul, DivAdd، Sub، Mul، Div
operation servicesخدمات العمليات

Each does one kind of arithmetic.

كل خدمة تنفذ نوعًا واحدًا من العمليات الحسابية.

read/write
Database
storage

Keeps results and history.

تحفظ النتائج والسجل.

One gateway, four operation services, one databaseبوابة واحدة، وأربع خدمات للعمليات، وقاعدة بيانات واحدة

Worked exampleمثال محلول

One multiply request, step by stepطلب ضرب واحد، خطوة بخطوة

  1. Client sendsالعميل يرسل

    The client sends an HTTP request asking for 6 × 7 to the gateway's address.
    يرسل العميل طلب HTTP يطلب فيه 6 × 7 إلى عنوان البوابة.
  2. Gateway routesالبوابة توجّه

    The API Gateway sees the operation is multiply and forwards it to Mul.
    ترى API Gateway أن العملية ضرب، فتمرّر الطلب إلى Mul.
  3. Service computesالخدمة تحسب

    Mul computes 42 and writes a history record to the Database.
    تحسب Mul الناتج 42 وتكتب سجلًّا في قاعدة البيانات (Database).
  4. Answer returnsالجواب يعود

    Mul replies to the gateway, which returns the response to the client.
    تردّ Mul على البوابة، والبوابة تعيد الاستجابة إلى العميل.
  5. Resultالنتيجة

    One client request touched three server components (gateway, Mul, Database). The client saw only one door.
    طلب واحد من العميل لمس ثلاثة مكوّنات في الخادم (البوابة، وMul، وقاعدة البيانات). أما العميل فلم يرَ إلا بابًا واحدًا.

Everything except the client forms the Server layer, typically hosted in the Cloud. But nothing forces those components to live together. Because each one is a separate program with its own interface, Mul could run close to the user while the Database stays in a large data center. The question becomes: can we assign server components to different layers, and if so, how do we describe and justify the assignment?

كل شيء ما عدا العميل يشكّل server layer، والتي تُستضاف عادةً في الـ cloud. لكن لا شيء يُجبر هذه المكوّنات على العيش معًا. فلأن كل مكوّن برنامج منفصل له واجهته الخاصة، يمكن أن تعمل Mul قريبًا من المستخدم بينما تبقى قاعدة البيانات في مركز بيانات كبير. فيصبح السؤال: هل يمكننا إسناد مكوّنات الخادم إلى layers مختلفة، وإن أمكن، فكيف نصف هذا الإسناد ونبرّره؟

Two coordinates for every componentإحداثيان لكل مكوّن

The answer is a grid that works like a seating chart. "Mul sits on Layer 1 using Compute 1." "The Database sits on Layer 3 using Compute 2 plus Storage." Every component gets two coordinates.

الجواب شبكة (grid) تعمل مثل مخطط توزيع المقاعد. "Mul تجلس على Layer 1 وتستخدم Compute 1". "قاعدة البيانات تجلس على Layer 3 وتستخدم Compute 2 مع Storage". فكل مكوّن يحصل على إحداثيين.

All six components start crowded in one row, then slide to their seats. Vertical picks the layer, horizontal picks the resource.تبدأ المكوّنات الستة مزدحمة في صف واحد، ثم تنزلق إلى مقاعدها. المحور العمودي يختار الطبقة، والمحور الأفقي يختار المورد.

The two-dimensional design space separates two independent decisions about each Component, and they are exactly the two questions from the previous concept. Moving a box up or down changes its Layer: that is the decentralization axis, how far the server side is split across layers. Moving a box left or right changes the resource it uses on that layer: Compute 1, or Compute 2, which can also offer storage (only the Database uses it). That is the distribution axis, how computation and state are spread across resources.

يفصل two-dimensional design space (فضاء التصميم ثنائي الأبعاد) بين قرارين مستقلين بشأن كل component، وهما بالضبط السؤالان من المفهوم السابق. تحريك المربع لأعلى أو لأسفل يغيّر layer الخاصة به: وهذا هو محور اللامركزية، أي إلى أي مدى قُسِّم جانب الخادم عبر الطبقات. وتحريك المربع يمينًا أو يسارًا يغيّر المورد الذي يستخدمه على تلك الطبقة: Compute 1 أو Compute 2، والذي يمكنه أن يوفّر تخزينًا أيضًا (قاعدة البيانات وحدها تستخدمه). وهذا هو محور التوزيع، أي كيف تتوزّع الحوسبة والحالة على الموارد.

A column is a type, each layer has its own instanceالعمود نوع، ولكل طبقة نسختها الخاصة

One subtlety makes the grid precise. A column names a resource type, not a machine. Each layer has its own copies of those types, and the lecture marks them with suffixes: Compute 2_a + Storage_a on the Database, Compute 1_b on Add, and Compute 2_b on Sub. The letter tells you which layer's copy: _a belongs to Layer 3 and _b belongs to Layer 2. So Add and Sub share a layer, but run on two different instances.

تفصيلة دقيقة واحدة تجعل الشبكة محكمة: العمود يسمّي نوع مورد، لا جهازًا بعينه. فلكل طبقة نسخها الخاصة من هذه الأنواع، والمحاضرة تميّزها بلواحق: Compute 2_a + Storage_a على قاعدة البيانات، وCompute 1_b على Add، وCompute 2_b على Sub. الحرف يخبرك بنسخة أي طبقة: _a تنتمي إلى Layer 3، و_b تنتمي إلى Layer 2. إذن Add وSub تتشاركان طبقة واحدة، لكنهما تعملان على نسختين مختلفتين.

This is what makes the application a Distributed application in practice: the same kind of resource exists as several instances in different places, and the application's computation and state are spread across them. "Compute 2" could be a virtual machine type in a Cloud region, a server in a Fog micro data center, or a box at the Edge.

هذا ما يجعل التطبيق distributed application في الواقع العملي: النوع نفسه من المورد موجود في صورة عدة نسخ في أماكن مختلفة، وحوسبة التطبيق وحالته موزّعة عليها. فـ "Compute 2" قد يكون نوع آلة افتراضية (virtual machine) في منطقة من مناطق الـ cloud، أو خادمًا في مركز بيانات صغير من نوع fog، أو جهازًا على الـ edge.

Worked exampleمثال محلول

Name the instance for every boxسمِّ النسخة لكل مربع

  1. Database (Layer 3, column 2)قاعدة البيانات (Layer 3، العمود 2)

    Compute 2_a + Storage_a, given in the lecture.
    Compute 2_a + Storage_a، كما وردت في المحاضرة.
  2. Add (Layer 2, column 1)Add (Layer 2، العمود 1)

    Compute 1_b, given in the lecture.
    Compute 1_b، كما وردت في المحاضرة.
  3. Sub (Layer 2, column 2)Sub (Layer 2، العمود 2)

    Compute 2_b, given in the lecture.
    Compute 2_b، كما وردت في المحاضرة.
  4. API Gateway (Layer 3, column 1)API Gateway (Layer 3، العمود 1)

    Following the pattern, Compute 1_a.
    باتباع النمط نفسه، Compute 1_a.
  5. Mul (Layer 1, column 1)Mul (Layer 1، العمود 1)

    Following the pattern, Compute 1_c.
    باتباع النمط نفسه، Compute 1_c.
  6. Div (Layer 1, column 2)Div (Layer 1، العمود 2)

    Following the pattern, Compute 2_c.
    باتباع النمط نفسه، Compute 2_c.
  7. Resultالنتيجة

    Six boxes, six separate instances. Two boxes share a letter only when they share a layer, and share a number only when they use the same resource type.
    ستة مربعات، وست نسخ منفصلة. لا يتشارك مربعان الحرف نفسه إلا إذا كانا على الطبقة نفسها، ولا يتشاركان الرقم نفسه إلا إذا استخدما نوع المورد نفسه.

Criteria for assigning components to layersمعايير إسناد المكوّنات إلى الطبقات

The grid tells you how to write a placement down. It does not tell you which placement is good. For that the lecture asks: what criteria decide which layer a component goes on? There is no single right answer, only trade-offs. Each criterion pushes a component in a direction.

الشبكة تخبرك كيف تكتب قرار الوضع، لكنها لا تخبرك أي قرار هو الجيد. ولهذا تسأل المحاضرة: ما المعايير التي تحدّد على أي طبقة يوضع المكوّن؟ لا توجد إجابة صحيحة واحدة، بل مقايضات (trade-offs). وكل معيار يدفع المكوّن في اتجاه ما.

CriterionالمعيارPushes component towardيدفع المكوّن نحوCalculator exampleمثال من الآلة الحاسبةSourceالمصدر
LatencyLatency (زمن التأخير)Lower layers, close to the clientالطبقات الأدنى، قرب العميلA live result preview that must update as you typeمعاينة حيّة للنتيجة يجب أن تتحدّث أثناء الكتابةSatyanarayanan 2017; NIST SP 500-325Satyanarayanan 2017؛ NIST SP 500-325
Compute demandالطلب على الحوسبةHigher layers, where capacity existsالطبقات الأعلى، حيث توجد السعةA heavy matrix-inversion service added to the calculatorخدمة ثقيلة لعكس المصفوفات تُضاف إلى الآلة الحاسبةSatyanarayanan 2017Satyanarayanan 2017
Storage and stateالتخزين والحالةA well-provisioned layer with durable storageطبقة مجهّزة جيدًا ذات تخزين دائمThe Database holding every user's historyقاعدة البيانات Database التي تحفظ سجلّ كل مستخدمLecture design spaceفضاء التصميم في المحاضرة
Cost (bandwidth)التكلفة (bandwidth)Lower layers, near where data is producedالطبقات الأدنى، قرب مكان إنتاج البياناتSummarize raw sensor input locally, send only results upتلخيص قراءات المستشعرات الخام محليًا، وإرسال النتائج فقط إلى الأعلىSatyanarayanan 2017Satyanarayanan 2017
Privacy and residencyالخصوصية وإقامة البياناتLower layers, or a region inside the right bordersالطبقات الأدنى، أو منطقة داخل الحدود المناسبةStrip personal data before anything leaves the siteإزالة البيانات الشخصية قبل أن يغادر أي شيء الموقعSatyanarayanan 2017; Google Cloud locationsSatyanarayanan 2017؛ Google Cloud locations
Sharing across usersالمشاركة بين المستخدمينA layer every client can reachطبقة يستطيع كل عميل الوصول إليهاThe API Gateway, the single entry point for everyoneAPI Gateway، نقطة الدخول الوحيدة للجميعAWS API Gateway guideAWS API Gateway guide
Availabilityالتوافرية availabilityAdd a nearby fallback below the cloudإضافة بديل احتياطي قريب تحت السحابةKeep basic Add working during a short cloud outageإبقاء عملية Add الأساسية تعمل أثناء انقطاع قصير في السحابةSatyanarayanan 2017Satyanarayanan 2017
Placement criteria, where they push a component, and a calculator exampleمعايير الوضع، والاتجاه الذي تدفع إليه المكوّن، ومثال من الآلة الحاسبة

The evidence behind the table comes from the edge computing literature. Satyanarayanan writes that "reliance on a cloud datacenter is not advisable for applications that require end-to-end delays to be tightly controlled to less than a few tens of milliseconds." NIST adds that Fog computing "minimizes the request-response time" by working close to end devices. So a time-critical component moves toward the Edge, lowering Latency and Response time (RT).

الأدلة وراء الجدول تأتي من أدبيات الـ edge computing. يكتب Satyanarayanan أن "الاعتماد على مركز بيانات سحابي غير مستحسن للتطبيقات التي تتطلب ضبط زمن التأخير من طرف إلى طرف بإحكام ليبقى أقل من بضع عشرات من الميلي ثانية". وتضيف NIST أن حوسبة الـ fog "تقلّل زمن الطلب والاستجابة" لأنها تعمل قريبًا من الأجهزة الطرفية. إذن المكوّن الحساس للوقت يتحرك نحو الـ edge، فيقلّ latency وresponse time.

The pull goes the other way too. Heavy computation and durable, shared data need resources that shrink as you go down the layers, which is why the Database sits on the top layer. Satyanarayanan also notes that analyzing raw data near its source cuts the bandwidth sent to the cloud, that a nearby cloudlet "can enforce the privacy policies of its owner prior to release of the data to the cloud", and that local resources give the "ability to mask transient cloud outages". Google Cloud, for its part, sells regions partly so data can stay resident inside a country's borders.

والشدّ يعمل في الاتجاه المعاكس أيضًا. فالحوسبة الثقيلة والبيانات الدائمة المشتركة تحتاج موارد تتقلّص كلما نزلت عبر الطبقات، ولهذا تجلس قاعدة البيانات على الطبقة العليا. ويذكر Satyanarayanan أيضًا أن تحليل البيانات الخام قرب مصدرها يقلّل حجم البيانات (bandwidth) المرسلة إلى السحابة، وأن الـ cloudlet القريب "يستطيع فرض سياسات الخصوصية الخاصة بمالكه قبل إطلاق البيانات إلى السحابة"، وأن الموارد المحلية تمنح "القدرة على إخفاء انقطاعات السحابة المؤقتة". أما Google Cloud فهي تبيع المناطق (regions) جزئيًا لكي تبقى البيانات مقيمة داخل حدود الدولة.

Quick checkاختبار سريع

In the lecture's two-dimensional design space, what does moving a component up the vertical axis change?في فضاء التصميم ثنائي الأبعاد في المحاضرة، ما الذي يغيّره تحريك المكوّن لأعلى على المحور العمودي؟

Quick checkاختبار سريع

A face-blurring component must process camera frames before any raw video leaves the building. Which criterion mainly pushes it to a lower layer?مكوّن لطمس الوجوه يجب أن يعالج إطارات الكاميرا قبل أن يغادر أي فيديو خام المبنى. أي معيار يدفعه أساسًا إلى طبقة أدنى؟

Recall

List five criteria for assigning a server component to a layer, each with a one-line reason.اذكر خمسة معايير لإسناد مكوّن من مكوّنات الخادم إلى طبقة، مع سبب من سطر واحد لكل معيار.

Latency: time-critical components go near the client. Compute: heavy work goes where capacity is. Storage and state: durable, consistent data goes to well-provisioned layers. Cost: processing near the data saves bandwidth. Privacy: sensitive raw data is filtered before it leaves the local layer. Sharing and availability are also valid answers.
Latency: المكوّنات الحساسة للوقت توضع قرب العميل. الحوسبة: العمل الثقيل يذهب إلى حيث توجد السعة. التخزين والحالة: البيانات الدائمة المتسقة تذهب إلى طبقات مجهّزة جيدًا. التكلفة: المعالجة قرب البيانات توفّر الـ bandwidth. الخصوصية: البيانات الخام الحساسة تُرشَّح قبل أن تغادر الطبقة المحلية. والمشاركة والتوافرية إجابتان صحيحتان أيضًا.

Placing components on layers only works because they can talk to each other across a network. So zoom in on one conversation. Open the calculator in a browser and press equals. The front-end JavaScript sends GET /add?a=2&b=3. A Node.js back-end reads that request from its socket, computes 5, and writes the response back. Along the way the bytes travel through routers you will never see.

وضع المكوّنات على الطبقات لا ينجح إلا لأنها تستطيع التحدث بعضها مع بعض عبر الشبكة. فلنقترب من محادثة واحدة. افتح الآلة الحاسبة في المتصفح واضغط على علامة المساواة. يرسل كود JavaScript في الواجهة الأمامية GET /add?a=2&b=3. ثم يقرأ خادم خلفي مبني على Node.js هذا الطلب من الـ socket الخاص به، ويحسب 5، ويكتب الاستجابة عائدًا. وفي الطريق تمرّ البايتات عبر موجّهات (routers) لن تراها أبدًا.

Three levels in one conversationثلاثة مستويات في محادثة واحدة

At the top is the application conversation: an HTTP request and response. In the middle are the endpoints, the sockets. At the bottom is the network path through the Internet. The Frontend runs in the browser, and the Backend runs in Node.js.

في القمة محادثة التطبيق: طلب HTTP واستجابته. وفي الوسط نقاط النهاية (endpoints)، أي الـ sockets. وفي القاع مسار الشبكة عبر الإنترنت. الـ front-end يعمل في المتصفح، والـ back-end يعمل في Node.js.

Browser
front-end, the client

Builds the request and renders the answer.

يبني الطلب ويعرض الإجابة.

HTTP request
Node.js
back-end, the server

Reads the request, computes, replies.

يقرأ الطلب، ويحسب، ثم يرد.

HTTP response
Browser
front-end again

Shows the result to the user.

يعرض النتيجة للمستخدم.

The HTTP conversation between front-end and back-endمحادثة HTTP بين الواجهة الأمامية front-end والخلفية back-end

RFC 9110, the HTTP standard, defines the roles by behavior. A Client "is a program that establishes a connection to a server for the purpose of sending one or more HTTP requests". A Server "is a program that accepts connections in order to service HTTP requests by sending HTTP responses". And HTTP itself "is a stateless request/response protocol for exchanging messages across a connection".

يعرّف RFC 9110، وهو معيار HTTP، الأدوار بحسب السلوك. فالـ client "برنامج ينشئ اتصالًا بخادم بغرض إرسال طلب HTTP واحد أو أكثر". والـ server "برنامج يقبل الاتصالات لكي يخدم طلبات HTTP بإرسال استجابات HTTP". وHTTP نفسه "بروتوكول طلب/استجابة عديم الحالة (stateless) لتبادل الرسائل عبر اتصال".

Sockets are endpoints, connections are pairsالـ sockets نقاط نهاية، والاتصالات أزواج

A socket is named by an IP address plus a Port number. The connection is the pair of sockets, one at each end, as in this example using documentation addresses:

يُسمّى الـ socket بـ IP address مع port number. والاتصال هو زوج الـ sockets، واحد في كل طرف، كما في هذا المثال الذي يستخدم عناوين مخصّصة للتوثيق:

One HTTPS connection seen as a socket pairاتصال HTTPS واحد منظورًا إليه كزوج من الـ sockets

Client socketsocket العميل
192.0.2.10:52814192.0.2.10:52814
Server socketsocket الخادم
198.51.100.7:443198.51.100.7:443
Transport protocolبروتوكول النقل
TCPTCP
Connectionالاتصال
Identified by both sockets together, set up by TCP after the client calls connect()يُعرَّف بالـ socketين معًا، وينشئه TCP بعد أن يستدعي العميل connect()

The HTTP arrow is logical, the bytes move verticallyسهم HTTP منطقي، والبايتات تتحرك عموديًا

Protocol pictures usually draw a dashed arrow between the two HTTP boxes, as if browser and server talked to each other directly. They do, but only logically. No HTTP byte ever travels sideways along that arrow.

رسوم البروتوكولات عادةً ترسم سهمًا متقطعًا بين مربعَي HTTP، كأن المتصفح والخادم يتحدثان مباشرة. وهما يتحدثان فعلًا، لكن منطقيًا فقط. فلا يوجد بايت HTTP واحد يسافر أفقيًا على امتداد ذلك السهم.

HTTP talks sideways only in logic. The real bytes dive through the socket, cross the network, and climb back up.HTTP يتحدث أفقيًا في المنطق فقط. البايتات الحقيقية تغوص عبر الـ socket، وتعبر الشبكة، ثم تصعد من جديد.

The real journey is vertical. The browser writes an HTTP message. It goes down through TCP on the client and the Socket, into the TCP/IP network (the "pipe"), and back up through TCP on the server until Node.js reads it. This is Encapsulation from part 03: each layer wraps the data on the way down and unwraps it on the way up. Peer layers "talk" to each other only through that round trip.

الرحلة الحقيقية عمودية. يكتب المتصفح رسالة HTTP، فتنزل عبر TCP على جهاز العميل وعبر الـ socket، إلى شبكة TCP/IP ("الأنبوب")، ثم تصعد من جديد عبر TCP على الخادم حتى يقرأها Node.js. هذا هو encapsulation (التغليف) من الجزء 03: كل طبقة تغلّف البيانات في طريق النزول وتفكّ غلافها في طريق الصعود. والطبقات النظيرة "تتحدث" بعضها مع بعض فقط عبر هذه الرحلة ذهابًا وإيابًا.

The same picture also shows who owns what. The Application layer (AL) is the web application, written by developers: HTML, CSS and JavaScript in the Frontend, and Node.js in the Backend. The Transport layer (TL), Network layer (NL), Data link layer (DLL) and Physical layer (PL) are infrastructure, provided by the operating system, network cards, cables and routers. That split is the same line that defined a network application in the first concept: the app owns meaning, the infrastructure owns delivery.

الصورة نفسها تبيّن أيضًا من يملك ماذا. فـ application layer (AL) هي تطبيق الويب الذي يكتبه المطوّرون: HTML وCSS وJavaScript في الـ front-end، وNode.js في الـ back-end. أما transport layer (TL) وnetwork layer (NL) وdata link layer (DLL) وphysical layer (PL) فهي بنية تحتية يوفّرها نظام التشغيل وبطاقات الشبكة والكابلات والموجّهات. وهذا الفصل هو الخط نفسه الذي عرّف التطبيق الشبكي في المفهوم الأول: التطبيق يملك المعنى، والبنية التحتية تملك التوصيل.

Recall

Why is the HTTP arrow between browser and server drawn dashed, and what path do the bytes really take?لماذا يُرسم سهم HTTP بين المتصفح والخادم متقطعًا، وما المسار الذي تسلكه البايتات فعلًا؟

It is a logical peer conversation. The real bytes go down through TCP and the socket, across the TCP/IP network, and back up the server's stack.
لأنه محادثة منطقية بين طبقتين نظيرتين. أما البايتات الحقيقية فتنزل عبر TCP والـ socket، وتعبر شبكة TCP/IP، ثم تصعد في مكدّس الخادم.

Step back from a single message to the rhythm of the whole exchange. Your browser asks the calculator for a result. The server wakes up, spends processor time computing it, reads and writes the history, and sends bytes back. Then it waits for the next request. It never phones you first.

تراجع خطوة عن الرسالة الواحدة وانظر إلى إيقاع التبادل كله. يطلب متصفحك من الآلة الحاسبة نتيجة. فيستيقظ الخادم، ويستهلك وقت المعالج في حسابها، ويقرأ السجلّ ويكتب فيه، ويرسل البايتات عائدة. ثم ينتظر الطلب التالي. ولا يتصل بك هو أولًا أبدًا.

The client starts the loop. While the server prepares the answer, compute, storage and communication fill up. Then the response closes the loop.العميل يبدأ الحلقة. وبينما يجهّز الخادم الإجابة، تمتلئ الحوسبة والتخزين والاتصال. ثم تُغلق الاستجابة الحلقة.

That cycle is the Request-response loop. The Client initiates, and the Server only responds. RFC 9110 builds HTTP around exactly this pattern: a client sends a request message, and a server answers it with a response message.

هذه الدورة هي request-response loop. فالـ client يبادر، والـ server يستجيب فقط. ويبني RFC 9110 بروتوكول HTTP حول هذا النمط بالضبط: العميل يرسل رسالة طلب، والخادم يجيب عنها برسالة استجابة.

Every response has a priceلكل استجابة ثمن

This is where the part comes full circle. Preparing each response costs the server three resources. Compute is the processor time, which you will later measure as Processing time (PT). Storage is reading and writing data. Communication is sending the response back over the network. For one user that is trivial. Multiply it by, say, 10,000 users pressing equals at once, and those three costs decide where each component in the design space should live.

هنا يكتمل الجزء دورته. تجهيز كل استجابة يكلّف الخادم ثلاثة موارد. الحوسبة هي وقت المعالج، والذي ستقيسه لاحقًا على أنه processing time. والتخزين هو قراءة البيانات وكتابتها. والاتصال هو إرسال الاستجابة عائدة عبر الشبكة. لمستخدم واحد هذا أمر تافه. لكن اضربه في 10,000 مستخدم مثلًا يضغطون على علامة المساواة في اللحظة نفسها، وستجد أن هذه التكاليف الثلاث هي التي تقرّر أين يجب أن يعيش كل مكوّن في فضاء التصميم.

It is also why placement matters to users. The time a user waits, the Response time (RT), is the trip to the server, the processing, and the trip back. NIST describes Fog computing as a way to minimize the request-response time. Moving the right component closer shortens the loop.

وهذا أيضًا سبب أهمية قرار الوضع للمستخدمين. فالوقت الذي ينتظره المستخدم، أي response time، هو رحلة الذهاب إلى الخادم، والمعالجة، ورحلة العودة. وتصف NIST حوسبة الـ fog بأنها وسيلة لتقليل زمن الطلب والاستجابة. فتقريب المكوّن المناسب يقصّر الحلقة.

Quick checkاختبار سريع

Who initiates communication in the request-response loop between browser and server?من يبادر بالاتصال في حلقة الطلب والاستجابة بين المتصفح والخادم؟

Recall

In the request-response loop, who initiates, and which three server resources does each response consume?في حلقة الطلب والاستجابة، من يبادر، وما الموارد الثلاثة في الخادم التي تستهلكها كل استجابة؟

The client initiates. The response consumes compute, storage and communication.
العميل هو من يبادر. والاستجابة تستهلك الحوسبة والتخزين والاتصال.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • The Internet is the infrastructure. The Web is one network application on it, using HTTP.الإنترنت هي البنية التحتية. والويب تطبيق شبكي واحد يعمل فوقها باستخدام HTTP.
  • A network application is any app that uses the Internet as its transport medium: web, email, streaming, peer-to-peer.التطبيق الشبكي هو أي تطبيق يستخدم الإنترنت وسيطًا لنقل بياناته: الويب، والبريد الإلكتروني، والبث، ونظير إلى نظير peer-to-peer.
  • Lecture definition: decentralized means split into separate client and server programs that talk through a protocol and sockets (BitTorrent, Bitcoin).تعريف المحاضرة: اللامركزي decentralized يعني أن التطبيق مقسوم إلى برنامجَي عميل وخادم منفصلين يتواصلان عبر بروتوكول و sockets (BitTorrent، Bitcoin).
  • Lecture definition: distributed means computation is not on a single machine but spread between client and server, and state is distributed too (Google Cloud).تعريف المحاضرة: الموزّع distributed يعني أن الحوسبة ليست على جهاز واحد بل موزّعة بين العميل والخادم، والحالة state موزّعة أيضًا (Google Cloud).
  • The server side of an app is several components (an API gateway, services, a database), and each can be placed separately.جانب الخادم في التطبيق يتكوّن من عدة مكوّنات (API gateway، وخدمات، وقاعدة بيانات)، ويمكن وضع كل منها بشكل منفصل.
  • Design space: the vertical axis picks the layer (decentralization). The horizontal axis picks the compute or storage resource type (distribution); the layer's copy of that type is the instance.فضاء التصميم: المحور العمودي يختار الطبقة (اللامركزية). والمحور الأفقي يختار نوع مورد الحوسبة أو التخزين (التوزيع)؛ ونسخة الطبقة من ذلك النوع هي الـ instance.
  • Placement criteria: latency, compute demand, storage and state, cost, privacy, sharing and availability.معايير الوضع: latency، والطلب على الحوسبة، والتخزين والحالة، والتكلفة، والخصوصية، والمشاركة، والتوافرية.
  • A socket is an endpoint. HTTP talks logically between application layers, while the bytes move through the TCP/IP stack.الـ socket نقطة نهاية. و HTTP يتحدث منطقيًا بين طبقات التطبيق، بينما تتحرك البايتات عبر مكدّس TCP/IP.
  • The client initiates. Each response costs the server compute, storage and communication.العميل هو من يبادر. وكل استجابة تكلّف الخادم حوسبة وتخزينًا واتصالًا.

Sourcesالمصادر

Part 05: Sockets and web app architectureالمقابس (Sockets) ومعمارية تطبيقات الويب

The socket API between your program and the transport layer, TCP versus UDP sockets, and the frontend and backend of a web application.واجهة Socket API بين برنامجك وطبقة النقل، ومقابس TCP مقابل مقابس UDP، والواجهة الأمامية (frontend) والخلفية (backend) لتطبيق الويب.

4 concepts4 مفاهيم, ، slides 40-45الشرائح 40-45

Why this part mattersلماذا يهمّ هذا الجزء

Every service you will place on the edge-to-cloud continuum, whether a camera pipeline, an IoT gateway or a cloud API, ends up as processes talking through sockets. The socket type decides what happens to a lost or late packet. The split between frontend and backend decides which parts can move to the edge and which must stay near the database.

Exams ask for the socket call sequence and for a justified choice between TCP and UDP. Your research project needs the same reasoning to explain where latency comes from. This part builds both, climbing from the point where a program first touches the network up to a complete web application.

كل خدمة ستضعها على سلسلة الـ edge-to-cloud continuum، سواء كانت خط معالجة لكاميرا أو بوابة IoT أو API سحابية، تنتهي في الواقع إلى عمليات (processes) تتحدث مع بعضها عبر الـ sockets. نوع الـ socket هو الذي يقرر ما يحدث لحزمة مفقودة أو متأخرة. والتقسيم بين الـ frontend والـ backend هو الذي يقرر أي الأجزاء يمكن نقلها إلى الـ edge وأيها يجب أن يبقى قريبًا من قاعدة البيانات.

الاختبارات تطلب تسلسل استدعاءات الـ socket، واختيارًا مبرَّرًا بين TCP وUDP. ومشروعك البحثي يحتاج إلى طريقة التفكير نفسها ليشرح من أين يأتي الـ latency. هذا الجزء يبني الأمرين معًا، صاعدًا من النقطة التي يلمس فيها البرنامج الشبكة لأول مرة حتى تطبيق ويب كامل.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain a socket as a file descriptor, addressed by IP and port, that the socket API createsتشرح الـ socket على أنه file descriptor تنشئه الـ socket API، ويُعنوَن بعنوان IP ورقم port
  2. Order the socket calls a TCP server and client make, and say what accept returnsترتّب استدعاءات الـ socket التي يقوم بها خادم TCP وعميله، وتذكر ماذا تُرجع accept
  3. Choose TCP or UDP for a workload by what a lost or late unit of data costsتختار بين TCP وUDP لحِمل عمل معيّن بحسب كلفة فقدان وحدة بيانات واحدة أو تأخرها
  4. Split a web application into browser client, server and database, and trace a saved formتقسّم تطبيق الويب إلى عميل هو المتصفح وخادم وقاعدة بيانات، وتتتبّع مسار نموذج يتم حفظه
  5. Read a backend route as method plus path plus handler and trace one HTTP requestتقرأ الـ route في الـ backend على أنه method زائد path زائد handler، وتتتبّع طلب HTTP واحدًا

Think about what your browser does when you open the KFUPM portal. It cannot put signals on the Wi-Fi radio or build TCP segments by itself. Instead it makes a few requests to the operating system: open a connection to this address and port, send these bytes, give me whatever comes back. The operating system does everything below that. Understanding exactly what that request looks like is the foundation for everything else in this part.

فكّر فيما يفعله متصفحك عندما تفتح بوابة KFUPM. هو لا يستطيع أن يضع إشارات على راديو الـ Wi-Fi أو أن يبني مقاطع TCP (segments) بنفسه. بدلًا من ذلك يقدّم بضعة طلبات إلى نظام التشغيل: افتح اتصالًا إلى هذا العنوان وهذا الـ port، أرسل هذه البايتات، وأعطني ما يعود منها. ونظام التشغيل يتولى كل ما هو تحت ذلك. فهم الشكل الدقيق لهذا الطلب هو الأساس لكل ما يأتي بعده في هذا الجزء.

An API is a menu, and the socket API is the networking menuالـ API قائمة طعام، والـ socket API هي قائمة الشبكات

The set of operations one piece of software offers to another is an Application Programming Interface, or API. Earlier in this lecture you saw that a relationship between components is a protocol plus an Interface. Here the interface sits between the Application layer (your program) and the Transport layer (TCP and UDP inside the operating system). For networking, that interface is the Socket API.

مجموعة العمليات التي يقدّمها برنامج لبرنامج آخر تُسمّى واجهة برمجة التطبيقات (Application Programming Interface)، أو اختصارًا API. رأيت سابقًا في هذه المحاضرة أن العلاقة بين المكوّنات هي protocol زائد interface. هنا تقع الواجهة بين application layer (برنامجك) وtransport layer (TCP وUDP داخل نظام التشغيل). وفي مجال الشبكات، هذه الواجهة هي الـ socket API.

Kurose and Ross describe the socket as the door between the application process and TCP. As a developer you control everything on the application side of that door, and you have very little control over the transport side. The rest of this concept opens the door and looks at what is actually there.

يصف Kurose وRoss الـ socket بأنه الباب بين عملية التطبيق (application process) وTCP. بصفتك مطوّرًا، أنت تتحكم في كل شيء على جهة التطبيق من هذا الباب، ولديك تحكم ضئيل جدًا في جهة النقل (transport). بقية هذا المفهوم تفتح هذا الباب وتنظر إلى ما يوجد خلفه فعلًا.

What a program actually holds: a file descriptorما الذي يمسكه البرنامج فعلًا: file descriptor

Make it concrete. In C, calling socket() returns a small integer, for example 3. From then on the program writes write(3, ...) exactly as it would for an open file. POSIX states that when the descriptor refers to a socket, write() is equivalent to send() with no flags, and the Linux manual says the only difference between recv() and read() is the flags argument.

لنجعل الأمر ملموسًا. في لغة C، استدعاء socket() يُرجع عددًا صحيحًا صغيرًا، مثلًا 3. ومن تلك اللحظة يكتب البرنامج write(3, ...) تمامًا كما يفعل مع ملف مفتوح. ينص POSIX على أنه عندما يشير الـ descriptor إلى socket، فإن write() يكافئ send() بدون أي flags، ويقول دليل Linux إن الفرق الوحيد بين recv() وread() هو وسيط الـ flags.

So to a program, a Socket is an operating system object that it reads and writes like a file. The kernel takes the bytes you write and turns them into TCP segments or UDP datagrams, which is why the application never needs to know how either protocol works. Be careful with the words: the socket API is the interface, and a socket is the endpoint that the API creates and names.

إذن، بالنسبة إلى البرنامج، الـ socket هو كائن من كائنات نظام التشغيل يقرأ منه ويكتب فيه كأنه ملف. الـ kernel يأخذ البايتات التي تكتبها ويحوّلها إلى مقاطع TCP (segments) أو إلى datagrams من نوع UDP، ولهذا لا يحتاج التطبيق أبدًا إلى معرفة كيف يعمل أي من البروتوكولين. انتبه للمصطلحات: الـ socket API هي الواجهة (interface)، أما الـ socket فهو نقطة الطرف (endpoint) التي تنشئها هذه الـ API وتسمّيها.

Each process writes into its socket; the transport layers carry the bytes both waysكل عملية تكتب في الـ socket الخاص بها، وطبقتا النقل تحملان البايتات في الاتجاهين

Naming the endpoint: the socket addressتسمية نقطة الطرف: عنوان الـ socket

A file on disk has a path; a socket has an address: an IP address plus a Port number, for example 10.0.0.5:443. The IP address finds the host and the port finds the process on that host, the same two-level addressing you met with the TCP/IP stack. RFC 9293 identifies a TCP connection by a pair of sockets, one at each end, so a connection is really four numbers: client IP and port, server IP and port.

الملف على القرص له مسار، والـ socket له عنوان: وهو IP address زائد port number، مثلًا 10.0.0.5:443. عنوان الـ IP يحدد الجهاز (host)، والـ port يحدد العملية على ذلك الجهاز، وهي نفس العنونة على مستويين التي قابلتها مع حزمة TCP/IP. تعرّف RFC 9293 اتصال TCP بزوج من الـ sockets، واحد في كل طرف، لذا فالاتصال في الحقيقة أربعة أرقام: IP العميل وport العميل، وIP الخادم وport الخادم.

One more ingredient completes the name. The protocol is fixed when the socket is created, so TCP port 53 and UDP port 53 are different endpoints even on the same host. DNS, as RFC 1035 specifies, listens on both.

هناك عنصر إضافي يكمل الاسم. البروتوكول يُحدَّد لحظة إنشاء الـ socket، ولذلك فإن port 53 في TCP وport 53 في UDP هما نقطتا طرف مختلفتان حتى على الجهاز نفسه. والـ DNS، كما تنص RFC 1035، يستمع على الاثنين.

The lifecycle of a connectionدورة حياة الاتصال

A Server and a Client play different roles, so they use different calls. The server must be findable before anyone arrives: it creates a socket, binds it to a well-known address, marks it as listening, then accepts connections one by one. The client already knows where to go, so it only creates a socket and connects. Once connected, both sides send and receive, then close.

الـ server والـ client يلعبان دورين مختلفين، ولذلك يستخدمان استدعاءات مختلفة. الخادم يجب أن يكون قابلًا للعثور عليه قبل أن يصل أي أحد: ينشئ socket، ويربطه (bind) بعنوان معروف، ويعلّمه على أنه في وضع الاستماع (listening)، ثم يقبل الاتصالات واحدًا تلو الآخر. أما العميل فيعرف مسبقًا إلى أين يذهب، فهو فقط ينشئ socket ويتصل (connect). وبعد الاتصال يرسل الطرفان ويستقبلان، ثم يُغلقان.

Socket lifecycle, in call orderدورة حياة الـ socket، بترتيب الاستدعاءات

socket()
Both sides. Creates an endpoint and returns a file descriptor such as 3. It has no address yet.الطرفان. ينشئ نقطة طرف (endpoint) ويُرجع file descriptor مثل 3. ولا يكون له عنوان بعد.
bind()
Server. Attaches a local IP address and port, for example 0.0.0.0:443. The Linux manual calls this assigning a name to a socket, so clients know where to knock.الخادم. يربط عنوان IP محليًا ورقم port، مثلًا 0.0.0.0:443. ويسمّي دليل Linux هذا إعطاء اسم للـ socket، حتى يعرف العملاء أين يطرقون.
listen()
Server. Marks the socket as passive, ready to accept connections. The backlog argument caps the queue of pending connections. Connection-oriented sockets only (SOCK_STREAM or SOCK_SEQPACKET).الخادم. يعلّم الـ socket على أنه سلبي (passive)، جاهز لقبول الاتصالات. والوسيط backlog يحدد الحد الأقصى لطابور الاتصالات المنتظرة. يعمل فقط مع الـ sockets الموجّهة بالاتصال (SOCK_STREAM أو SOCK_SEQPACKET).
connect()
Client. For TCP it starts the connection, which runs the three-way handshake. For UDP it only records a default destination.العميل. في TCP يبدأ الاتصال، فتجري المصافحة الثلاثية (three-way handshake). وفي UDP يكتفي بتسجيل وجهة افتراضية.
accept()
Server. Takes the first pending connection and returns a new connected socket with a new descriptor, for example 4. The listening socket is unaffected and keeps waiting.الخادم. يأخذ أول اتصال منتظر ويُرجع socket متصلًا جديدًا له descriptor جديد، مثلًا 4. والـ listening socket لا يتأثر ويستمر في الانتظار.
send() / recv()
Both sides. Move bytes. On a socket, write() is send() with no flags, and read() is recv() with no flags.الطرفان. ينقلان البايتات. على الـ socket، فإن write() هو send() بدون flags، وread() هو recv() بدون flags.
close()
Both sides. Releases the descriptor and ends that side of the connection.الطرفان. يحرّر الـ descriptor وينهي جهة هذا الطرف من الاتصال.
One listening socket; accept opens a new connection socket per clientsocket واحد للاستماع، وaccept تفتح connection socket جديدًا لكل عميل

Worked exampleمثال محلول

One HTTPS request through the socket callsطلب HTTPS واحد عبر استدعاءات الـ socket

  1. Server preparesالخادم يستعد

    The server calls socket() and gets descriptor 3, calls bind() to 0.0.0.0:443, then listen().
    يستدعي الخادم socket() فيحصل على الـ descriptor رقم 3، ثم يستدعي bind() على 0.0.0.0:443، ثم listen().
  2. Client connectsالعميل يتصل

    The browser calls socket() and connect() to the server address. The TCP three-way handshake runs.
    يستدعي المتصفح socket() ثم connect() إلى عنوان الخادم. وتجري مصافحة TCP الثلاثية (three-way handshake).
  3. Server acceptsالخادم يقبل

    accept() returns descriptor 4, a socket dedicated to this client. Descriptor 3 keeps listening.
    تُرجع accept() الـ descriptor رقم 4، وهو socket مخصص لهذا العميل. ويبقى الـ descriptor رقم 3 في وضع الاستماع.
  4. TLS handshakeمصافحة TLS

    Both sides exchange TLS handshake messages with send() and recv() on the connected sockets. From here on the bytes on the wire are encrypted.
    يتبادل الطرفان رسائل مصافحة TLS باستخدام send() وrecv() على الـ sockets المتصلة. ومن هذه النقطة فصاعدًا تكون البايتات على السلك مشفّرة.
  5. Requestالطلب

    The client calls send() with the encrypted request bytes. The server calls recv() on descriptor 4.
    يستدعي العميل send() ببايتات الطلب المشفّرة. ويستدعي الخادم recv() على الـ descriptor رقم 4.
  6. Responseالاستجابة

    The server calls send() on descriptor 4; the client calls recv().
    يستدعي الخادم send() على الـ descriptor رقم 4، ويستدعي العميل recv().
  7. Finishالإنهاء

    Both sides call close() on their connected sockets.
    يستدعي الطرفان close() على الـ sockets المتصلة الخاصة بهما.
  8. Resultالنتيجة

    The server held two sockets for this exchange: descriptor 3 listening and descriptor 4 connected.
    أمسك الخادم اثنين من الـ sockets في هذا التبادل: الـ descriptor رقم 3 للاستماع، والـ descriptor رقم 4 المتصل.

Recall

What does a program actually hold when it has a socket, and which ordinary calls can it use on it?ما الذي يمسكه البرنامج فعلًا عندما يكون لديه socket، وما الاستدعاءات العادية التي يمكنه استخدامها عليه؟

A file descriptor, a small non-negative integer from the operating system. It can read and write it like a file: write() on a socket equals send() with no flags, and recv() with no flags behaves like read().
يمسك file descriptor، وهو عدد صحيح صغير غير سالب يعطيه إياه نظام التشغيل. ويمكنه أن يقرأ منه ويكتب فيه كأنه ملف: write() على socket يساوي send() بدون flags، وrecv() بدون flags يتصرف مثل read().

Recall

List the server-side calls in order. What does accept return, and what happens to the listening socket?اذكر استدعاءات جهة الخادم بالترتيب. ماذا تُرجع accept، وماذا يحدث للـ listening socket؟

socket(), bind(), listen(), accept(), then recv() and send(), then close(). accept() returns a new connected socket with its own descriptor for that one client. The listening socket is unaffected and keeps waiting.
socket()، ثم bind()، ثم listen()، ثم accept()، ثم recv() وsend()، ثم close(). تُرجع accept() socket متصلًا جديدًا له descriptor خاص به لذلك العميل وحده. والـ listening socket لا يتأثر ويستمر في الانتظار.

Quick checkاختبار سريع

An HTTPS server process has 1000 clients connected on port 443. Counting the listening socket, how many TCP sockets does it hold?عملية خادم HTTPS متصل بها 1000 عميل على port 443. مع احتساب الـ listening socket، كم TCP socket تمسك؟

Once you know a program holds a socket, the next decision is which kind. Take two jobs. First, downloading a 2 GB dataset for your project: one missing byte corrupts the file, so every byte must arrive, in order. Second, a live video call: a voice frame that arrives 1 s late is useless, so waiting for it to be resent makes the call worse, not better. These two jobs need different sockets, and the difference is fixed the moment socket() is called.

بعد أن عرفت أن البرنامج يمسك socket، فالقرار التالي هو: أي نوع منه؟ خذ مهمتين. الأولى: تنزيل مجموعة بيانات حجمها 2 GB لمشروعك. بايت واحد مفقود يفسد الملف، لذا يجب أن يصل كل بايت، وبالترتيب. الثانية: مكالمة فيديو مباشرة. إطار صوتي يصل متأخرًا 1 s لا فائدة منه، لذا فانتظار إعادة إرساله يجعل المكالمة أسوأ لا أفضل. هاتان المهمتان تحتاجان إلى نوعين مختلفين من الـ sockets، وهذا الفرق يُحدَّد في اللحظة التي يُستدعى فيها socket().

Two services behind the same APIخدمتان خلف الـ API نفسها

A TCP socket is a stream socket. RFC 9293 describes TCP as a reliable, in-order, byte-stream service. It sets up a connection with a three-way handshake, numbers every byte, checks it with a checksum and retransmits what is lost. That reliability costs setup time and state on both hosts, which is exactly the connection that listen(), connect() and accept() manage.

الـ socket من نوع TCP هو stream socket. تصف RFC 9293 بروتوكول TCP بأنه خدمة موثوقة، تحافظ على الترتيب، وتنقل تيارًا من البايتات (byte stream). يُنشئ اتصالًا عبر مصافحة ثلاثية (three-way handshake)، ويرقّم كل بايت، ويتحقق منه بـ checksum، ويعيد إرسال ما يُفقد. هذه الموثوقية تكلّف وقتًا للإعداد وحالة (state) محفوظة على الجهازين، وهذا بالضبط هو الاتصال الذي تديره listen() وconnect() وaccept().

A UDP socket is a datagram socket. RFC 768 says UDP offers a minimum of protocol mechanism: delivery and duplicate protection are not guaranteed, and the header is just four 16-bit fields (source Port number, destination port, length, checksum), 8 bytes in total. There is no listen or accept: each datagram stands alone. POSIX names the two kinds SOCK_STREAM and SOCK_DGRAM.

الـ socket من نوع UDP هو datagram socket. تقول RFC 768 إن UDP يقدّم الحد الأدنى من آليات البروتوكول: التسليم والحماية من التكرار غير مضمونين، والـ header مجرد أربعة حقول كل منها 16 بت (port المصدر، وport الوجهة، والطول، والـ checksum)، أي 8 بايتات إجمالًا. لا يوجد listen ولا accept: كل datagram قائم بذاته. ويسمّي POSIX النوعين SOCK_STREAM وSOCK_DGRAM.

PropertyالخاصيةTCP socketTCP socketUDP socketUDP socket
POSIX typeنوع POSIXSOCK_STREAMSOCK_STREAMSOCK_DGRAMSOCK_DGRAM
Connection setupإنشاء الاتصالThree-way handshake before any dataمصافحة ثلاثية (three-way handshake) قبل أي بياناتNone, each datagram stands aloneلا يوجد، كل datagram قائم بذاته
DeliveryالتسليمLost segments detected and retransmittedالمقاطع (segments) المفقودة تُكتشف ويُعاد إرسالهاNo delivery or duplicate guaranteeلا ضمان للتسليم ولا لعدم التكرار
OrderingالترتيبBytes reach the application in orderالبايتات تصل إلى التطبيق بالترتيبDatagrams may arrive out of orderقد تصل الـ datagrams بغير ترتيبها
Message boundariesحدود الرسائلA continuous byte stream, no boundariesتيار بايتات متصل، بلا حدود بين الرسائلEach datagram is one whole messageكل datagram رسالة واحدة كاملة
Header overheadكلفة الـ header20 bytes minimum, plus connection state20 بايتًا كحد أدنى، إضافة إلى حالة الاتصال8 bytes, four 16-bit fields8 بايتات، أربعة حقول بطول 16 بت
Typical usesاستخدامات نموذجيةWeb pages, file transfer, emailصفحات الويب، ونقل الملفات، والبريد الإلكترونيDNS queries, voice and video callsاستعلامات DNS، ومكالمات الصوت والفيديو
TCP socket versus UDP socketTCP socket مقابل UDP socket
TCP recovers a late box 3 and delivers in order; UDP drops box 3 and swaps boxes 2 and 4TCP يسترجع الصندوق 3 المتأخر ويسلّم بالترتيب، أما UDP فيُسقط الصندوق 3 ويبدّل ترتيب الصندوقين 2 و4

Choosing a socket for a workloadاختيار الـ socket المناسب لحِمل العمل

The right question is not which is faster. Ask what happens to your application when one unit of data is lost or late. If it must be recovered, use TCP. If late data is worthless, or the exchange is tiny and easy to retry, UDP avoids overhead that buys you nothing. For interactive media this is really about Latency: a retransmitted frame arrives after its moment has passed.

السؤال الصحيح ليس: أيهما أسرع؟ اسأل: ماذا يحدث لتطبيقك عندما تُفقد وحدة بيانات واحدة أو تتأخر؟ إذا كان لا بد من استرجاعها، فاستخدم TCP. وإذا كانت البيانات المتأخرة بلا قيمة، أو كان التبادل صغيرًا وسهل الإعادة، فإن UDP يجنّبك كلفة إضافية لا تكسب منها شيئًا. وفي الوسائط التفاعلية، المسألة في حقيقتها مسألة latency: الإطار المعاد إرساله يصل بعد أن فات وقته.

Workloadحِمل العملSocketالـ socketWhyالسبب
Web page over HTTP/1.1 or HTTP/2صفحة ويب عبر HTTP/1.1 أو HTTP/2TCPTCPEvery byte of HTML and script must arrive intact. Default ports 80 and 443.كل بايت من الـ HTML والـ script يجب أن يصل سليمًا. الـ ports الافتراضية 80 و443.
File transfer (FTP) and emailنقل الملفات (FTP) والبريد الإلكترونيTCPTCPOne missing byte corrupts the file or message.بايت واحد مفقود يفسد الملف أو الرسالة.
DNS queryاستعلام DNSUDPUDPA small single exchange that can simply be retried. Port 53, with TCP 53 for zone transfers and long answers.تبادل واحد صغير يمكن ببساطة إعادته. Port 53، مع TCP 53 لنقل المناطق (zone transfers) والإجابات الطويلة.
Video call (WebRTC)مكالمة فيديو (WebRTC)UDPUDPA late frame is useless, so retransmission only hurts. TCP through a relay is a fallback.الإطار المتأخر لا فائدة منه، لذا فإعادة الإرسال تضر فقط. وTCP عبر relay هو خيار احتياطي.
Web page over HTTP/3صفحة ويب عبر HTTP/3UDP (carrying QUIC)UDP (يحمل QUIC)QUIC adds reliable streams and encryption on top of UDP.QUIC يضيف تيارات موثوقة (reliable streams) وتشفيرًا فوق UDP.
Which socket for which workloadأي socket لأي حِمل عمل

The last row of that table shows that the choice is not always binary. RFC 9114 defines HTTP/3 as the same HTTP semantics over a new transport, QUIC, and RFC 9000 says QUIC packets are carried in UDP datagrams. QUIC rebuilds reliable streams, flow control and encryption in user space on top of UDP. So choosing UDP does not always mean giving up reliability. It means a protocol or library above UDP decides how much reliability to add, and when.

الصف الأخير في ذلك الجدول يبيّن أن الاختيار ليس ثنائيًا دائمًا. تعرّف RFC 9114 بروتوكول HTTP/3 بأنه دلالات (semantics) HTTP نفسها فوق طبقة نقل جديدة هي QUIC، وتقول RFC 9000 إن حزم QUIC تُحمل داخل UDP datagrams. يعيد QUIC بناء التيارات الموثوقة (reliable streams) والتحكم في التدفق (flow control) والتشفير في user space فوق UDP. إذن اختيار UDP لا يعني دائمًا التخلي عن الموثوقية. بل يعني أن بروتوكولًا أو مكتبة فوق UDP هي التي تقرر كم من الموثوقية تضيف، ومتى.

Quick checkاختبار سريع

A video call plays 50 voice frames per second and playback never pauses to wait. Which socket fits best, and why?مكالمة فيديو تشغّل 50 إطارًا صوتيًا في الثانية، والتشغيل لا يتوقف أبدًا للانتظار. أي socket هو الأنسب، ولماذا؟

Quick checkاختبار سريع

HTTP/3 keeps the same HTTP semantics but changes the transport underneath. What does it run on?يحتفظ HTTP/3 بدلالات HTTP نفسها لكنه يغيّر طبقة النقل تحتها. على ماذا يعمل؟

Recall

Why do DNS queries use UDP while file transfers use TCP, and where does HTTP/3 fit?لماذا تستخدم استعلامات DNS بروتوكول UDP بينما يستخدم نقل الملفات TCP، وأين يقع HTTP/3 من ذلك؟

A DNS query is a small single exchange that can simply be retried, so datagrams have less overhead (RFC 1035 prefers them for queries). A file needs every byte in order, so it uses TCP. HTTP/3 uses QUIC, which runs over UDP and adds its own reliability and streams.
استعلام DNS تبادل واحد صغير يمكن ببساطة إعادته، لذا فالـ datagrams أقل كلفة (وRFC 1035 تفضّلها للاستعلامات). أما الملف فيحتاج إلى كل بايت وبالترتيب، لذا يستخدم TCP. ويستخدم HTTP/3 بروتوكول QUIC، الذي يعمل فوق UDP ويضيف موثوقيته وتياراته الخاصة.

Now bring sockets to the web. You type https://uni.majid.app and press Enter. The browser resolves the name, asks the operating system to open a TCP connection to port 443 (or QUIC over UDP for HTTP/3), sends the HTTP request, reads the response, and may reuse the same connection for the next requests. The page code only calls fetch("/api/...") and never sees a Socket.

الآن لننقل الـ sockets إلى الويب. تكتب https://uni.majid.app وتضغط Enter. يحلّ المتصفح الاسم، ثم يطلب من نظام التشغيل فتح اتصال TCP إلى port 443 (أو QUIC فوق UDP في حالة HTTP/3)، ويرسل طلب HTTP، ويقرأ الاستجابة، وقد يعيد استخدام الاتصال نفسه للطلبات التالية. أما كود الصفحة فلا يفعل إلا استدعاء fetch("/api/...")، ولا يرى أي socket أبدًا.

The browser owns the client socketالمتصفح هو من يملك الـ client socket

A web application is a Network application in which the browser is the Client program and owns the client socket: when to open it, reuse it and close it. MDN puts it simply: browsers communicate with web servers using HTTP, by sending a request to the server. Every socket call from the lifecycle above is still happening, just inside the browser and inside the server runtime.

تطبيق الويب هو network application يكون فيه المتصفح هو برنامج الـ client، ويملك الـ client socket: متى يفتحه، ومتى يعيد استخدامه، ومتى يغلقه. تقولها MDN ببساطة: المتصفحات تتواصل مع خوادم الويب باستخدام HTTP، عن طريق إرسال طلب إلى الخادم. كل استدعاءات الـ socket من دورة الحياة السابقة ما زالت تحدث، لكنها تحدث داخل المتصفح وداخل بيئة تشغيل الخادم (server runtime).

This changes the level at which you work. Frontend code for the World Wide Web is written in terms of HTTP requests, and backend code is written in terms of routes that answer them. The socket becomes infrastructure you rely on rather than an object you manage.

هذا يغيّر المستوى الذي تعمل عليه. كود الـ frontend في World Wide Web يُكتب بلغة طلبات HTTP، وكود الـ backend يُكتب بلغة الـ routes التي تجيب عنها. ويصبح الـ socket بنية تحتية تعتمد عليها، لا كائنًا تديره بنفسك.

Recall

In a web application, who manages the client socket, and at what level does the frontend code work?في تطبيق الويب، من يدير الـ client socket، وعلى أي مستوى يعمل كود الـ frontend؟

The browser opens, reuses and closes the connection (TCP, or QUIC over UDP for HTTP/3). Frontend code works at the HTTP level, for example with fetch, and never touches the socket.
المتصفح هو من يفتح الاتصال ويعيد استخدامه ويغلقه (TCP، أو QUIC فوق UDP في حالة HTTP/3). وكود الـ frontend يعمل على مستوى HTTP، مثلًا باستخدام fetch، ولا يلمس الـ socket أبدًا.

Three components: client, server, databaseثلاثة مكوّنات: العميل، والخادم، وقاعدة البيانات

So what is on the other end of that connection? Picture a course portal. You submit a homework answer. The browser sends a request over the Internet. The server checks it and writes a row to the database. When you reopen the page later, the server reads that row and sends it back in a response.

إذن ما الذي يوجد في الطرف الآخر من ذلك الاتصال؟ تخيّل بوابة مقرر دراسي. أنت ترسل إجابة واجب. يرسل المتصفح طلبًا عبر الإنترنت. يتحقق الخادم منه ويكتب صفًا (row) في قاعدة البيانات. وعندما تعيد فتح الصفحة لاحقًا، يقرأ الخادم ذلك الصف ويعيده إليك في استجابة.

The pieces have names. The Frontend is one Component: the client. The Backend is two components: the Server and the database. The client talks only to the server, never directly to the database. MDN describes the same flow: on a request, the server fetches data from the database and builds the response. This is the Request-response loop you met with network applications, and the client always starts it.

لهذه الأجزاء أسماء. الـ frontend هو component واحد: العميل. والـ backend مكوّنان: الـ server وقاعدة البيانات. العميل يتحدث مع الخادم فقط، ولا يتحدث مع قاعدة البيانات مباشرة أبدًا. وتصف MDN التدفق نفسه: عند وصول طلب، يجلب الخادم البيانات من قاعدة البيانات ويبني الاستجابة. هذه هي request-response loop التي قابلتها مع تطبيقات الشبكة، والعميل هو من يبدؤها دائمًا.

Client
Frontend

Browser: HTML, CSS, JavaScript

المتصفح: HTML وCSS وJavaScript

HTTP request and responseطلب HTTP واستجابته
Server
Backend

Checks requests, runs the logic, builds responses

يتحقق من الطلبات، وينفذ المنطق، ويبني الاستجابات

database protocol over its own socketبروتوكول قاعدة البيانات عبر socket خاص به
Database
Backend

Stores data that must survive between requests

تخزن البيانات التي يجب أن تبقى بين الطلبات

Frontend and backend of a web applicationالـ frontend والـ backend في تطبيق الويب

Look at the server to database link closely, because it reuses everything from the first concept. It is itself a client-server connection over sockets, with the web server acting as the database client. Writes flow from server to database and reads flow back. A web application is therefore a chain of socket conversations, each with its own client and server role.

انظر بدقة إلى الرابط بين الخادم وقاعدة البيانات، لأنه يعيد استخدام كل شيء من المفهوم الأول. فهو بحد ذاته اتصال client-server عبر sockets، يكون فيه خادم الويب هو عميل قاعدة البيانات. عمليات الكتابة تتدفق من الخادم إلى قاعدة البيانات، وعمليات القراءة تعود في الاتجاه المعاكس. إذن تطبيق الويب سلسلة من المحادثات عبر الـ sockets، لكل منها دور العميل ودور الخادم الخاصان بها.

Request, write, read, response: the client only ever talks to the serverطلب، ثم كتابة، ثم قراءة، ثم استجابة: العميل لا يتحدث إلا مع الخادم

Why server and database often live apartلماذا يعيش الخادم وقاعدة البيانات غالبًا منفصلين

  • They scale separately: many identical server instances can share one carefully managed database.يتوسّعان بشكل مستقل: يمكن لعدد كبير من نسخ الخادم المتطابقة أن تتشارك قاعدة بيانات واحدة تُدار بعناية.
  • Their resource needs differ: the server wants CPU, the database wants disk and memory.احتياجاتهما من الموارد مختلفة: الخادم يحتاج إلى CPU، وقاعدة البيانات تحتاج إلى القرص والذاكرة.
  • The database can be kept off the public Internet, reachable only from the servers.يمكن إبقاء قاعدة البيانات بعيدًا عن الإنترنت العام، بحيث لا يصل إليها إلا الخوادم.

This is the first placement decision on the edge-to-cloud continuum. Later parts ask where the server and the database should each live, and every placement has a cost: each read or write between separate machines adds its own network Round-trip time (RTT), which later feeds into Response time (RT).

هذا هو أول قرار توزيع (placement) على سلسلة الـ edge-to-cloud continuum. الأجزاء اللاحقة تسأل أين يجب أن يعيش كل من الخادم وقاعدة البيانات، ولكل توزيع ثمن: كل عملية قراءة أو كتابة بين جهازين منفصلين تضيف RTT شبكيًا خاصًا بها، وهذا يدخل لاحقًا في response time.

Quick checkاختبار سريع

A user saves a form on a web app and the data must persist. Which path does it take?يحفظ مستخدم نموذجًا في تطبيق ويب، ويجب أن تبقى البيانات محفوظة. ما المسار الذي تسلكه؟

Recall

Name the two backend components of a web application, and give one reason they often run on different machines.سمِّ مكوّني الـ backend في تطبيق الويب، واذكر سببًا واحدًا لكونهما يعملان غالبًا على جهازين مختلفين.

The server and the database. They scale independently, their resource needs differ (CPU versus storage and memory), and the database can stay off the public Internet. The cost is an extra network round trip per read or write.
الخادم وقاعدة البيانات. يتوسّعان بشكل مستقل، واحتياجاتهما من الموارد مختلفة (CPU مقابل التخزين والذاكرة)، ويمكن إبقاء قاعدة البيانات بعيدًا عن الإنترنت العام. والثمن رحلة ذهاب وإياب إضافية عبر الشبكة لكل عملية قراءة أو كتابة.

The architecture becomes real when you read the code on each side. Consider a calculator running in the browser and the backend that serves it. Walk one request through: the user opens the About view, and the frontend sends GET /calculadora/about.

تصبح البنية حقيقية عندما تقرأ الكود في كل جهة. خذ آلة حاسبة تعمل في المتصفح، والـ backend الذي يخدمها. تتبّع طلبًا واحدًا: المستخدم يفتح صفحة About، فيرسل الـ frontend الطلب GET /calculadora/about.

From request to handler to responseمن الطلب إلى الـ handler إلى الاستجابة

On the Backend, the framework compares the request method and path against its routes. It finds the route with method GET and path /calculadora/about and calls its handler, handler(request, h). The handler builds an object with a message field and returns it. In hapi, a returned plain object becomes the response payload, serialized as JSON. The browser receives that JSON in the HTTP response body and the Frontend renders it.

في الـ backend، يقارن الـ framework الـ method والـ path في الطلب بالـ routes المسجلة لديه. فيجد الـ route الذي الـ method فيه GET والـ path فيه /calculadora/about، ويستدعي الـ handler الخاص به، handler(request, h). يبني الـ handler كائنًا (object) فيه حقل message ويُرجعه. في hapi، الكائن العادي الذي يُرجَع يصبح هو محتوى الاستجابة (payload)، مُحوَّلًا إلى JSON. يستقبل المتصفح هذا الـ JSON في جسم استجابة الـ HTTP، ويعرضه الـ frontend.

The general rule: a route is a method plus a path plus a handler. The set of routes a backend exposes is its Web API, the Interface the frontend programs against, while HTTP is the Protocol carried between them. Protocol plus interface again, one level higher than the socket API. Underneath, the Node.js runtime owns a listening socket and one connection socket per Client, exactly the welcoming door picture from the first concept.

القاعدة العامة: الـ route هو method زائد path زائد handler. ومجموعة الـ routes التي يكشفها الـ backend هي الـ Web API الخاصة به، أي الـ interface التي يبرمج الـ frontend بالاعتماد عليها، بينما HTTP هو الـ protocol المنقول بينهما. مرة أخرى protocol زائد interface، لكن في مستوى أعلى بدرجة من الـ socket API. وتحت ذلك كله، تملك بيئة تشغيل Node.js listening socket واحدًا وconnection socket واحدًا لكل client، وهي بالضبط صورة باب الاستقبال من المفهوم الأول.

Worked exampleمثال محلول

Tracing GET /calculadora/aboutتتبّع الطلب GET /calculadora/about

  1. Requestالطلب

    The browser sends GET /calculadora/about over its connection to the server.
    يرسل المتصفح GET /calculadora/about عبر اتصاله بالخادم.
  2. Route matchمطابقة الـ route

    The framework matches method GET and path /calculadora/about to the registered route.
    يطابق الـ framework الـ method GET والـ path /calculadora/about مع الـ route المسجّل.
  3. Handlerالـ handler

    handler(request, h) runs and returns an object with a message field.
    يعمل handler(request, h) ويُرجع كائنًا فيه حقل message.
  4. Serializeالتحويل إلى JSON

    The framework turns the object into a JSON response body.
    يحوّل الـ framework الكائن إلى جسم استجابة بصيغة JSON.
  5. Responseالاستجابة

    The response travels back over the same connection, closing the Request-response loop.
    تعود الاستجابة عبر الاتصال نفسه، فتُغلق الـ request-response loop.
  6. Resultالنتيجة

    What the handler returns is exactly what the browser receives, as JSON.
    ما يُرجعه الـ handler هو بالضبط ما يستقبله المتصفح، بصيغة JSON.

Same language, different machinesاللغة نفسها، وأجهزة مختلفة

Notice the languages. The frontend uses HTML for structure, CSS for presentation and JavaScript for behaviour, all inside the browser. The backend also runs JavaScript, but in the Node.js runtime on the Server. Same language, different processes on different machines, joined only by HTTP over a socket.

لاحظ اللغات. الـ frontend يستخدم HTML للبنية، وCSS للعرض، وJavaScript للسلوك، وكلها داخل المتصفح. والـ backend يشغّل JavaScript أيضًا، لكن داخل بيئة تشغيل Node.js على الـ server. اللغة نفسها، لكن في عمليات مختلفة على أجهزة مختلفة، لا يربطها إلا HTTP فوق socket.

SideالجهةRuns whereأين يعملWritten inمكتوب بـRoleالدور
Frontendالـ FrontendInside the browser on the user machineداخل المتصفح على جهاز المستخدمHTML, CSS, JavaScriptHTML وCSS وJavaScriptDraws the calculator and sends HTTP requestsيرسم الآلة الحاسبة ويرسل طلبات HTTP
Backendالـ BackendIn the Node.js runtime on a serverداخل بيئة تشغيل Node.js على خادمJavaScript (hapi on Node.js)JavaScript (hapi فوق Node.js)Matches routes and returns data in responsesيطابق الـ routes ويُرجع البيانات في الاستجابات
The two halves of the calculator appنصفا تطبيق الآلة الحاسبة

Recall

What three things make up a backend route, and what does the client receive when the route is hit?ما الأشياء الثلاثة التي يتكون منها الـ route في الـ backend، وماذا يستقبل العميل عندما يُستدعى هذا الـ route؟

A method, a path and a handler. The framework matches the request method and path, calls the handler, and sends what the handler returns (here, an object serialized as JSON) back in the HTTP response.
method وpath وhandler. يطابق الـ framework الـ method والـ path في الطلب، ويستدعي الـ handler، ثم يرسل ما يُرجعه الـ handler (هنا كائن محوَّل إلى JSON) في استجابة الـ HTTP.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • An API is how software asks other software for a service. The socket API is the door from the application layer to the transport layer.الـ API هي الطريقة التي يطلب بها برنامج خدمة من برنامج آخر. والـ socket API هي الباب من طبقة التطبيق إلى طبقة النقل.
  • A socket is a file descriptor. Programs read and write it like a file, and it is addressed by IP address plus port.الـ socket هو file descriptor. البرامج تقرأ منه وتكتب فيه كأنه ملف، ويُعنوَن بعنوان IP زائد رقم port.
  • Servers call socket, bind, listen and accept. Clients call socket and connect. accept returns a new socket per client.الخوادم تستدعي socket وbind وlisten وaccept. والعملاء يستدعون socket وconnect. وتُرجع accept socket جديدًا لكل عميل.
  • TCP sockets give a reliable, ordered byte stream with connection overhead. UDP sockets send independent datagrams with minimal overhead.الـ TCP sockets تعطي تيار بايتات موثوقًا ومرتبًا مع كلفة إنشاء الاتصال. والـ UDP sockets ترسل datagrams مستقلة بأقل كلفة ممكنة.
  • Choose by what a lost or late unit costs: files and web pages use TCP, DNS queries and video calls use UDP, and HTTP/3 runs on QUIC over UDP.اختر بحسب كلفة فقدان وحدة بيانات أو تأخرها: الملفات وصفحات الويب تستخدم TCP، واستعلامات DNS ومكالمات الفيديو تستخدم UDP، وHTTP/3 يعمل على QUIC فوق UDP.
  • In a web app the browser manages the client socket. The backend is a server plus a database that may run on different machines.في تطبيق الويب، المتصفح يدير الـ client socket. والـ backend هو خادم زائد قاعدة بيانات، وقد يعملان على جهازين مختلفين.
  • A backend route is method plus path plus handler, and what the handler returns becomes the HTTP response.الـ route في الـ backend هو method زائد path زائد handler، وما يُرجعه الـ handler يصبح استجابة الـ HTTP.

Sourcesالمصادر

Part 06: Why layering: the continuum ideaلماذا الطبقات: فكرة السلسلة المتصلة (continuum)

What a continuum is, and how networks and the memory hierarchy already use layers to trade distance and speed.ما معنى السلسلة المتصلة (continuum)، وكيف تستخدم الشبكات وتسلسل الذاكرة الهرمي الطبقات أصلًا للموازنة بين المسافة والسرعة.

4 concepts4 مفاهيم, ، slides 46-50الشرائح 46-50

Why this part mattersلماذا يهمّ هذا الجزء

Every design decision in COE 558 is a placement decision. Does this task run on the device, at the edge, on a fog node or in the cloud? Before the physics of latency (Part 07) and the named tiers (Part 08), you need the pattern underneath all of them.

Computing has already solved this problem twice. Networks split a long path into segments, each built for its own span. Processors stack registers, caches and RAM so that urgent data sits close to the CPU. Edge computing applies the same trade, nearness against capacity, to the whole Internet. For your research project, this analogy is the cleanest way to justify putting a component at the edge.

كل قرار تصميمي في مقرر COE 558 هو في جوهره قرار تحديد مكان: هل تعمل هذه المهمة على الجهاز نفسه، أم على الـ edge، أم على عقدة fog، أم في الـ cloud؟ قبل أن ندخل في فيزياء الـ latency (الجزء 07) والمستويات المسمّاة (الجزء 08)، تحتاج أن تفهم النمط الذي تقوم عليه كلها.

لقد حلّت الحوسبة هذه المشكلة مرتين من قبل. الشبكات تقسّم المسار الطويل إلى مقاطع، كل مقطع مبنيّ ليناسب امتداده الخاص. والمعالجات ترتّب الـ registers والـ caches والـ RAM فوق بعضها بحيث تبقى البيانات العاجلة قريبة من الـ CPU. والـ edge computing يطبّق المقايضة نفسها، القرب مقابل السعة، على الإنترنت كلها. وفي مشروعك البحثي، هذا التشبيه هو أوضح طريقة لتبرير وضع أحد المكوّنات على الـ edge.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why the space between client and server is a continuum of candidate locations, and why edge and cloud are regions of one range rather than separate worlds.أن تشرح لماذا تُعدّ المسافة بين العميل والخادم سلسلة متصلة من المواقع المرشّحة، ولماذا يُعدّ الـ edge والـ cloud منطقتين من نطاق واحد لا عالمين منفصلين.
  2. Explain why a user-to-printer path is split into LAN switching and WAN routing tiers, and never confuse tier positions with protocol stack layers.أن تشرح لماذا يُقسَّم المسار من المستخدم إلى الطابعة إلى مستويات تبديل LAN switching ومستويات توجيه WAN routing، وألّا تخلط أبدًا بين مواقع المستويات على المسار وطبقات حزمة البروتوكولات.
  3. Explain the memory hierarchy as a placement policy driven by urgency and locality, and say why a small fast layer is enough.أن تشرح هرمية الذاكرة memory hierarchy بوصفها سياسة لتحديد مكان البيانات تقودها درجة الإلحاح ومبدأ المحلية locality، وأن تقول لماذا تكفي طبقة صغيرة وسريعة.
  4. Use T = S/B + L with measured bandwidth and latency to say when latency dominates, and justify the analogy that CPU cache is to RAM as edge is to cloud.أن تستخدم المعادلة T = S/B + L مع قيم bandwidth و latency المقاسة لتحدد متى يكون الـ latency هو العامل الحاسم، وأن تبرّر التشبيه: الـ CPU cache بالنسبة إلى الـ RAM مثل الـ edge بالنسبة إلى الـ cloud.

Part 05 ended with a simple picture: a web app is a Client talking to a Server. The natural next question is where that server should actually sit, and the answer turns out to be "not in one place, but anywhere along a range".

انتهى الجزء 05 بصورة بسيطة: تطبيق الويب هو client يتحدث مع server. والسؤال الطبيعي التالي هو: أين يجب أن يقع هذا الخادم فعلًا؟ ويتبيّن أن الجواب هو "ليس في مكان واحد، بل في أي نقطة على امتداد نطاق كامل".

The path is not an empty wireالمسار ليس مجرد سلك فارغ

Picture a student in Dhahran opening a web app whose only server is in a data center on another continent. Every click travels the full distance out as a request and the full distance back as a response. Now add three stops along the way: one in the campus building, one in the city, one in the region. Each stop is closer to the client than the far server is, so any work that can run at a nearer stop comes back sooner.

تخيّل طالبًا في الظهران يفتح تطبيق ويب خادمه الوحيد موجود في مركز بيانات في قارة أخرى. كل نقرة تقطع المسافة كاملة ذهابًا على شكل طلب request، وتقطعها كاملة عودةً على شكل استجابة response. أضف الآن ثلاث محطات على الطريق: واحدة في مبنى الجامعة، وواحدة في المدينة، وواحدة في المنطقة. كل محطة أقرب إلى العميل من الخادم البعيد، لذلك أي عمل يمكن تنفيذه في محطة أقرب ستعود نتيجته أسرع.

Seen this way, the space between client and server is a range of places where compute and storage can live. Latency grows as you move away from the client, and so does capacity, because far sites are larger. Placing layers along that range lets each request be answered by the nearest layer that is powerful enough to handle it.

بهذه النظرة، تصبح المسافة بين العميل والخادم نطاقًا من الأماكن التي يمكن أن توجد فيها قدرات الحوسبة والتخزين. يزداد الـ latency كلما ابتعدت عن العميل، وتزداد السعة أيضًا لأن المواقع البعيدة أكبر حجمًا. ووضع layers (طبقات) على امتداد هذا النطاق يسمح بأن يُجاب كل طلب من أقرب طبقة تملك القدرة الكافية للتعامل معه.

Client
Dhahran

Starts every request

few ms
Layer 1
building

Nearest, smallest

Layer 2
city

Farther, larger

Layer 3
region

Farther still

highest total latency
Server
distant data center

Largest capacity

Three layers placed between a client and a distant serverثلاث طبقات موضوعة بين العميل وخادم بعيد

This is not an invented teaching device. NIST describes fog computing as a layered model for accessing a shared continuum of computing resources, with nodes organized by their latency and distance to the end devices, and with different layers providing different services while working together as a continuum (NIST SP 500-325).

هذه ليست أداة تعليمية مخترعة. فالمعهد NIST يصف الـ fog computing بأنه نموذج طبقي للوصول إلى سلسلة متصلة مشتركة من موارد الحوسبة، تُنظَّم فيها العقد بحسب الـ latency والمسافة بينها وبين الأجهزة الطرفية، وتقدّم فيها الطبقات المختلفة خدمات مختلفة بينما تعمل معًا كسلسلة متصلة (NIST SP 500-325).

What makes a range a continuumما الذي يجعل النطاق سلسلة متصلة

The word Continuum is doing real work here, so pin it down with the clearest example there is: visible light. Walk along the spectrum from 400 nm to 700 nm. Move one nanometer and the color does not visibly change. There is no single nanometer where blue stops and green starts. Yet 400 nm (violet) and 700 nm (red) are obviously different colors. That is the whole definition in one picture: neighboring points barely differ, while the two ends differ a lot. The Britannica Dictionary and Wiktionary put it the same way: a continuous series where no part is noticeably different from its neighbors, although the ends are very different from each other.

كلمة continuum (السلسلة المتصلة) تؤدي هنا دورًا حقيقيًا، فلنحدد معناها بأوضح مثال ممكن: الضوء المرئي. امشِ على الطيف من 400 nm إلى 700 nm. إذا تحركت نانومترًا واحدًا فلن يتغيّر اللون تغيّرًا مرئيًا. ولا يوجد نانومتر واحد بعينه ينتهي عنده الأزرق ويبدأ الأخضر. ومع ذلك فإن 400 nm (البنفسجي) و700 nm (الأحمر) لونان مختلفان بوضوح. هذا هو التعريف كله في صورة واحدة: النقاط المتجاورة تكاد لا تختلف، بينما يختلف الطرفان اختلافًا كبيرًا. ويصوغه قاموس Britannica وموقع Wiktionary بالطريقة نفسها: سلسلة متصلة لا يختلف فيها أي جزء اختلافًا ملحوظًا عن جيرانه، مع أن الطرفين مختلفان جدًا أحدهما عن الآخر.

The familiar names on the wider electromagnetic spectrum (gamma, X-ray, UV, infrared, microwaves, radio) are labels people put on that smooth range because labels are useful. They are not walls that nature built.

الأسماء المألوفة على الطيف الكهرومغناطيسي الأوسع (gamma، وX-ray، وUV، وinfrared، والموجات الدقيقة microwaves، وradio) هي تسميات وضعها الناس على هذا النطاق الناعم لأن التسميات مفيدة. إنها ليست جدرانًا بنتها الطبيعة.

One smooth range from device to cloud. The band names are soft labels, not walls.نطاق واحد ناعم من الجهاز إلى الـ cloud. أسماء النطاقات تسميات مرنة، وليست جدرانًا.

Now map it back to computing. In the Edge-to-cloud (E2C) continuum, the two endpoints are "computing on the device itself" and "computing in a hyperscale cloud region". Everything between them is a candidate location for the layers above. The names you will meet in Part 08, Mist, Edge, Fog and Cloud, work exactly like UV and infrared: convenient labels on one range, where latency to the client and available capacity both grow as you move away from the device.

لنُعِد هذا الآن إلى الحوسبة. في edge-to-cloud continuum، يكون الطرفان هما "الحوسبة على الجهاز نفسه" و"الحوسبة في منطقة cloud ضخمة من نوع hyperscale". وكل ما بينهما موقع مرشّح للطبقات التي تحدثنا عنها. والأسماء التي ستقابلها في الجزء 08، وهي mist وedge وfog وcloud، تعمل تمامًا مثل UV وinfrared: تسميات مريحة على نطاق واحد، يزداد فيه كلٌّ من الـ latency إلى العميل والسعة المتاحة كلما ابتعدت عن الجهاز.

Recall

As you move from the client toward a distant server, what grows, and why would you add layers in between?كلما تحركت من العميل نحو خادم بعيد، ما الذي يزداد، ولماذا تضيف طبقات بينهما؟

Latency grows with distance from the client, and so does capacity, since far sites are larger. Adding layers puts resources closer to the client, so requests that a smaller site can handle are answered sooner.
يزداد الـ latency مع المسافة عن العميل، وتزداد السعة أيضًا لأن المواقع البعيدة أكبر. إضافة طبقات تضع الموارد أقرب إلى العميل، فالطلبات التي يستطيع موقع أصغر التعامل معها يُجاب عنها أسرع.

Recall

In your own words, what makes something a continuum rather than a set of separate categories?بكلماتك الخاصة، ما الذي يجعل شيئًا ما سلسلة متصلة لا مجموعة من الفئات المنفصلة؟

Neighboring points differ only slightly and there is no sharp boundary, yet the two ends are very different. Names like UV and infrared, or edge and fog, are labels on the range, not walls.
النقاط المتجاورة تختلف اختلافًا طفيفًا فقط ولا توجد حدود حادة، ومع ذلك يكون الطرفان مختلفين جدًا. أسماء مثل UV وinfrared، أو edge وfog، هي تسميات على النطاق، وليست جدرانًا.

Quick checkاختبار سريع

What best describes a continuum, as used for the edge-to-cloud continuum?ما الوصف الأدق للسلسلة المتصلة continuum، بالمعنى المستخدم في الـ edge-to-cloud continuum؟

Layering along a distance is not new. The network you use every day already splits one long path into segments, each built with the technology that suits its span.

ترتيب الطبقات على امتداد مسافة ليس أمرًا جديدًا. فالشبكة التي تستخدمها كل يوم تقسّم أصلًا المسار الطويل الواحد إلى مقاطع، كل مقطع مبنيّ بالتقنية التي تناسب امتداده.

Make it concrete. A student sits in a KFUPM lab and sends a print job to a partner office in Riyadh. The first hop is the lab's Ethernet switch. The middle of the journey crosses routers in a wide area network. The last hop is the office's own switch, which delivers the job to the printer. Three segments, three tiers along the distance.

لنجعل الأمر ملموسًا. طالب يجلس في معمل في KFUPM ويرسل مهمة طباعة إلى مكتب شريك في الرياض. القفزة الأولى هي الـ Ethernet switch الخاص بالمعمل. ومنتصف الرحلة يعبر أجهزة routers في شبكة واسعة WAN. والقفزة الأخيرة هي الـ switch الخاص بالمكتب، الذي يوصل المهمة إلى الطابعة. ثلاثة مقاطع، أي ثلاثة مستويات tiers على امتداد المسافة.

A job travels user to printer, switching technology at each segment: switch, router, switch.تنتقل مهمة الطباعة من المستخدم إلى الطابعة، وتتغيّر التقنية في كل مقطع: switch ثم router ثم switch.

Why one technology cannot run end to endلماذا لا تستطيع تقنية واحدة أن تغطي المسار من أوله إلى آخره

A switch works at the Data link layer and forwards frames by MAC address. It fills its forwarding table by flooding and learning, which is cheap and automatic inside one building but does not scale to the whole world: flooding every unknown frame to every port of every network on Earth would be absurd. A router works at the Network layer and forwards by IP address, using tables computed by routing algorithms over hierarchical address blocks, which is exactly what scales across many networks (Kurose and Ross, Chapter 6). Each technology is excellent inside its own range and poor outside it, so the path is built from pieces that each fit a stretch of it.

يعمل الـ switch في data link layer ويمرّر الإطارات frames بحسب MAC address. وهو يملأ جدول التمرير الخاص به عن طريق الإغراق flooding والتعلّم learning، وهذا رخيص وتلقائي داخل مبنى واحد لكنه لا يتوسّع ليشمل العالم كله: فإغراق كل إطار مجهول الوجهة إلى كل منفذ في كل شبكة على الأرض أمر عبثي. أما الـ router فيعمل في network layer ويمرّر بحسب IP address، مستخدمًا جداول تحسبها خوارزميات التوجيه على كتل عناوين هرمية، وهذا بالضبط ما يتوسّع عبر شبكات كثيرة (Kurose وRoss، الفصل 6). كل تقنية ممتازة داخل نطاقها وضعيفة خارجه، لذلك يُبنى المسار من قطع تناسب كل واحدة منها جزءًا منه.

SegmentالمقطعSpanالامتدادDeviceالجهازAddresses usedالعناوين المستخدمةStack layerطبقة الحزمة
LAN 1 (tier 1)LAN 1 (tier 1)One building or campusمبنى واحد أو حرم جامعيSwitchSwitchMACMACLinkالربط (Link)
WAN (tier 2)WAN (tier 2)Between citiesبين المدنRouterRouterIPIPNetworkالشبكة (Network)
LAN 2 (tier 3)LAN 2 (tier 3)One building or officeمبنى واحد أو مكتبSwitchSwitchMACMACLinkالربط (Link)
The three segments of the user-to-printer pathالمقاطع الثلاثة للمسار من المستخدم إلى الطابعة

This is the networking Continuum: distance grows along the path, and connectivity is assembled from tiers that each serve one stretch. Keep the shape in mind, because the edge-to-cloud continuum does the same with compute instead of connectivity, and the memory hierarchy, next, does it with time instead of distance.

هذه هي الـ continuum في الشبكات: المسافة تزداد على امتداد المسار، والاتصال يُركَّب من مستويات يخدم كل منها جزءًا واحدًا. احتفظ بهذا الشكل في ذهنك، لأن الـ edge-to-cloud continuum يفعل الشيء نفسه بقدرة الحوسبة بدلًا من الاتصال، وهرمية الذاكرة، وهي موضوعنا التالي، تفعله بالزمن بدلًا من المسافة.

Recall

In the user-to-printer example, which device handles each segment, and why doesn't one technology run end to end?في مثال المستخدم والطابعة، أي جهاز يتولى كل مقطع، ولماذا لا تغطي تقنية واحدة المسار كله؟

Switches handle the two LANs, and routers handle the WAN in the middle. Switches learn MAC addresses by flooding, which only suits a local network. Routers compute tables over IP addresses with routing algorithms, which scales across networks.
الـ switches تتولى شبكتي الـ LAN، والـ routers تتولى الـ WAN في المنتصف. الـ switches تتعلّم عناوين MAC عن طريق الإغراق flooding، وهذا لا يناسب إلا شبكة محلية. أما الـ routers فتحسب جداولها على عناوين IP باستخدام خوارزميات التوجيه، وهذا يتوسّع عبر الشبكات.

Quick checkاختبار سريع

In the user-to-printer path, which standard stack layer does the first LAN's switching operate at?في المسار من المستخدم إلى الطابعة، في أي طبقة من طبقات الحزمة القياسية يعمل التبديل switching في شبكة الـ LAN الأولى؟

The second place layering already exists is inside every computer. Here the axis is not kilometers but time: how long it takes the CPU to reach a piece of data.

المكان الثاني الذي توجد فيه الطبقات أصلًا هو داخل كل حاسوب. وهنا لا يكون المحور هو الكيلومترات بل الزمن: كم يستغرق الـ CPU ليصل إلى قطعة من البيانات.

Imagine a loop that sums a large array. The running total is touched on every instruction, so it lives in a register, right inside the processor. The chunk of the array being read right now is touched thousands of times a second, so it lives in cache. The rest of the dataset sits in RAM, and the file it came from sits on disk. Each step outward is slower to reach, but holds more.

تخيّل حلقة loop تجمع عناصر مصفوفة كبيرة. المجموع الجاري يُستخدم في كل تعليمة، لذلك يعيش في register داخل المعالج نفسه. والجزء من المصفوفة الذي يُقرأ الآن يُستخدم آلاف المرات في الثانية، لذلك يعيش في الـ cache. وبقية البيانات موجودة في الـ RAM، والملف الذي جاءت منه موجود على القرص disk. كل خطوة إلى الخارج أبطأ في الوصول إليها، لكنها تتسع لأكثر.

This arrangement is the Memory hierarchy, a Continuum of access times. The rule is simple: the more urgently and frequently data is needed, the closer to the CPU it lives. Hennessy and Patterson describe the same picture: as you move away from the processor, each level is slower and larger, with times ranging from picoseconds up to milliseconds for magnetic disks. Notice the match with the network path: near tiers are small and fast, far tiers are large and slow.

هذا الترتيب هو memory hierarchy (هرمية الذاكرة)، وهو continuum من أزمنة الوصول. والقاعدة بسيطة: كلما كانت البيانات مطلوبة بإلحاح وتكرار أكبر، عاشت أقرب إلى الـ CPU. ويصف Hennessy وPatterson الصورة نفسها: كلما ابتعدت عن المعالج، يصبح كل level (مستوى) أبطأ وأكبر، وتمتد الأزمنة من picoseconds إلى milliseconds في الأقراص المغناطيسية. لاحظ التطابق مع مسار الشبكة: المستويات القريبة صغيرة وسريعة، والمستويات البعيدة كبيرة وبطيئة.

Why a small fast layer is enoughلماذا تكفي طبقة صغيرة وسريعة

If fast memory holds only a tiny fraction of the data, why does it help at all? Because of locality. Programs tend to reuse data they touched recently (temporal locality) and data stored near it (spatial locality). So a small, fast layer that keeps those items can answer most requests. Denning notes that this one principle shapes processor caches, disk caches, storage hierarchies and edge caches for the Web. That last item is the bridge to this course: an edge site works for the same reason a CPU cache does.

إذا كانت الذاكرة السريعة لا تحمل إلا جزءًا ضئيلًا من البيانات، فلماذا تفيد أصلًا؟ بسبب مبدأ المحلية locality. البرامج تميل إلى إعادة استخدام البيانات التي لمستها مؤخرًا (المحلية الزمنية temporal locality) والبيانات المخزّنة بالقرب منها (المحلية المكانية spatial locality). لذلك تستطيع طبقة صغيرة وسريعة تحتفظ بهذه العناصر أن تجيب عن معظم الطلبات. ويشير Denning إلى أن هذا المبدأ الواحد يشكّل الـ caches في المعالجات، والـ caches للأقراص، وهرميات التخزين، والـ edge caches للويب. والعنصر الأخير هو الجسر إلى هذا المقرر: موقع الـ edge ينجح للسبب نفسه الذي ينجح به الـ CPU cache.

Recall

What decides which level of the memory hierarchy a piece of data lives in, and why can a small cache serve most reads?ما الذي يحدد المستوى الذي تعيش فيه قطعة من البيانات في هرمية الذاكرة، ولماذا يستطيع cache صغير أن يخدم معظم عمليات القراءة؟

How urgently and how often it is needed: data for the current instruction sits in registers, frequently used data in cache. Locality means programs keep reusing recent and nearby data, so a small fast layer answers most reads.
يحدده مدى إلحاح الحاجة إليها ومدى تكرارها: بيانات التعليمة الحالية تكون في الـ registers، والبيانات المستخدمة كثيرًا تكون في الـ cache. ومبدأ الـ locality يعني أن البرامج تعيد استخدام البيانات الحديثة والقريبة باستمرار، لذلك تجيب طبقة صغيرة وسريعة عن معظم عمليات القراءة.

Quick checkاختبار سريع

Why can a small CPU cache serve most of the memory reads a program makes?لماذا يستطيع CPU cache صغير أن يخدم معظم عمليات قراءة الذاكرة التي يقوم بها البرنامج؟

A ranking tells you the order of the levels; measurements tell you how much each step costs. To measure a level you need two quantities: bandwidth (how much data per second it can move) and latency (the fixed access delay paid on every fetch). Storage is simply the size of each level.

الترتيب يخبرك بتسلسل المستويات؛ أما القياسات فتخبرك بكلفة كل خطوة. ولقياس أي مستوى تحتاج إلى كميتين: الـ bandwidth (كمية البيانات التي يستطيع نقلها في الثانية) والـ latency (تأخير الوصول الثابت الذي يُدفع في كل عملية جلب). أما التخزين storage فهو ببساطة حجم كل مستوى.

Start with a video editing workstation. The frame on screen right now sits in cache or registers, because it is touched constantly. Today's raw clips are pulled from the SSD into RAM so they can be processed quickly. Last year's projects stay on slow archive storage and are fetched only when you open them. That is the Memory hierarchy used as a placement policy, and the question is how big the gaps between levels really are.

ابدأ بمحطة عمل لتحرير الفيديو. الإطار الظاهر على الشاشة الآن موجود في الـ cache أو الـ registers، لأنه يُستخدم باستمرار. ومقاطع اليوم الخام تُسحب من الـ SSD إلى الـ RAM لكي تُعالج بسرعة. ومشاريع العام الماضي تبقى على تخزين أرشيفي بطيء ولا تُجلب إلا عندما تفتحها. هذه هي memory hierarchy مستخدمة كسياسة لتحديد مكان البيانات، والسؤال هو: ما حجم الفجوات بين المستويات فعلًا؟

The measured hierarchyالهرمية المقاسة

The Cornell Virtual Workshop publishes figures measured on Intel Skylake server processors. Reading outward, bandwidth is roughly cut in half at each level while latency roughly quadruples. The real steps vary, so read this as a rule of thumb.

ينشر Cornell Virtual Workshop أرقامًا مقاسة على معالجات خوادم Intel Skylake. وإذا قرأتها من الداخل إلى الخارج، فإن الـ bandwidth ينخفض تقريبًا إلى النصف في كل مستوى، بينما يتضاعف الـ latency تقريبًا أربع مرات. والخطوات الحقيقية تتفاوت، لذلك اقرأ هذا على أنه قاعدة تقريبية.

LevelالمستوىSize per socketالحجم لكل مقبس socketRead bandwidthread bandwidthLatencyالـ latency
L1 cacheL1 cache768 KB768 KB~84 GB/s~84 GB/s2 ns2 ns
L2 cacheL2 cache24 MB24 MB~60 GB/s~60 GB/s7 ns7 ns
L3 cache (shared by cores)L3 cache (مشترك بين الأنوية)33 MB33 MB~30 GB/s~30 GB/s26 ns26 ns
Main memoryالذاكرة الرئيسية96 GB96 GB~10 GB/s~10 GB/s90 ns90 ns
Measured levels on an Intel Skylake server (Cornell Virtual Workshop)المستويات المقاسة على خادم Intel Skylake (Cornell Virtual Workshop)
Rungs widen away from the CPU while read bandwidth falls and latency grows.تتسع درجات السلّم كلما ابتعدت عن الـ CPU، بينما ينخفض read bandwidth ويزداد الـ latency.

The bandwidth figures come from a Sandia National Laboratories evaluation of Skylake (Hammond, Vaughan and Hughes, 2018), and the latencies were measured on a closely related Xeon model. Latency is also quoted in clock cycles, such as "4 cyc." and "14 cyc.". 2 ns in 4 cycles implies about 0.5 ns per cycle, a clock of roughly 2 GHz (our own arithmetic, not a published figure).

أرقام الـ bandwidth مأخوذة من تقييم أجرته Sandia National Laboratories لمعالج Skylake (Hammond وVaughan وHughes، 2018)، أما أرقام الـ latency فقد قيست على طراز Xeon قريب جدًا منه. ويُذكر الـ latency أيضًا بعدد دورات الساعة، مثل "4 cyc." و"14 cyc.". فإذا كانت 2 ns تساوي 4 دورات، فهذا يعني نحو 0.5 ns لكل دورة، أي تردد ساعة يقارب 2 GHz (هذا حسابنا الخاص، وليس رقمًا منشورًا).

Turning two resources into one timeتحويل موردين إلى زمن واحد

Bandwidth and latency only become useful for decisions once you combine them into the time a fetch actually takes. Cornell gives a simple model for any level:

لا يصبح الـ bandwidth والـ latency مفيدين لاتخاذ القرارات إلا عندما تجمعهما في الزمن الذي تستغرقه عملية الجلب فعلًا. ويقدّم Cornell نموذجًا بسيطًا لأي مستوى:

T=SB+LT = \frac{S}{B} + L
Retrieval time: size over bandwidth, plus latency (Cornell Virtual Workshop)زمن الاسترجاع: الحجم مقسومًا على عرض النطاق، مضافًا إليه زمن الانتقال (Cornell Virtual Workshop)

Here T is time, S is the size of the data, B is bandwidth and L is latency. For a tiny fetch, S/B is close to zero, so latency decides everything. For a huge transfer, the S/B term dominates and bandwidth decides.

هنا T هو الزمن، وS هو حجم البيانات، وB هو الـ bandwidth، وL هو الـ latency. في عملية جلب صغيرة جدًا يكون S/B قريبًا من الصفر، فيحسم الـ latency كل شيء. وفي نقل ضخم يهيمن الحد S/B، فيكون الـ bandwidth هو الحاسم.

Worked exampleمثال محلول

Fetching from L1 cache vs main memoryالجلب من L1 cache مقارنةً بالذاكرة الرئيسية

  1. A 16 KB fetch from L1جلب 16 KB من L1

    Treat 16 KB as 1.6 × 10⁻⁵ GB. S/B = 1.6 × 10⁻⁵ / 84 s ≈ 190 ns, plus 2 ns latency, so about 192 ns. Latency is about 1 percent.
    اعتبر 16 KB تساوي 1.6 × 10⁻⁵ GB. إذن S/B = 1.6 × 10⁻⁵ / 84 s ≈ 190 ns، يُضاف إليها 2 ns من الـ latency، فيكون المجموع نحو 192 ns. أي أن الـ latency يمثّل نحو 1 بالمئة فقط.
  2. The same 16 KB from main memoryالـ 16 KB نفسها من الذاكرة الرئيسية

    S/B = 1.6 × 10⁻⁵ / 10 s = 1.6 µs, plus 90 ns, so about 1.69 µs. Bandwidth sets the cost.
    S/B = 1.6 × 10⁻⁵ / 10 s = 1.6 µs، يُضاف إليها 90 ns، فيكون المجموع نحو 1.69 µs. هنا الـ bandwidth هو الذي يحدد الكلفة.
  3. A 64-byte fetchجلب 64 بايت

    64 bytes ≈ 6.4 × 10⁻⁸ GB. From L1: S/B ≈ 0.76 ns against 2 ns latency. From main memory: S/B = 6.4 ns against 90 ns latency. Now latency is most of the time.
    64 bytes ≈ 6.4 × 10⁻⁸ GB. من L1: S/B ≈ 0.76 ns مقابل 2 ns من الـ latency. ومن الذاكرة الرئيسية: S/B = 6.4 ns مقابل 90 ns من الـ latency. الآن أصبح الـ latency يشكّل معظم الزمن.
  4. Resultالنتيجة

    Small fetches are latency-bound; large ones are bandwidth-bound. (Our arithmetic from the Cornell figures.)
    عمليات الجلب الصغيرة يحكمها الـ latency (latency-bound)؛ والكبيرة يحكمها الـ bandwidth (bandwidth-bound). (هذا حسابنا انطلاقًا من أرقام Cornell.)

The analogy the course is built onالتشبيه الذي بُني عليه المقرر

Now every piece is in place. CPU cache is to RAM as Edge is to Cloud. Both put a small, fast, nearby tier in front of a large, slower, distant one. Both answer most requests from the near tier because of locality, and both fall back to the far tier on a miss. Interactive requests are small, so by T = S/B + L they are latency-bound and benefit most from a nearer tier. Bulk analytics is not interactive, so a few extra milliseconds of latency cost it little, and it needs far more compute than an edge site has. That is why Offloading it to the cloud, where capacity is, makes sense, as long as the data can be moved there or already lives there.

الآن اكتملت كل القطع. الـ CPU cache بالنسبة إلى الـ RAM مثل edge بالنسبة إلى cloud. كلاهما يضع مستوى صغيرًا وسريعًا وقريبًا أمام مستوى كبير وأبطأ وبعيد. وكلاهما يجيب عن معظم الطلبات من المستوى القريب بفضل الـ locality، ويرجع كلاهما إلى المستوى البعيد عند حدوث إخفاق miss. الطلبات التفاعلية صغيرة، لذلك وفقًا لـ T = S/B + L يحكمها الـ latency وتستفيد أكثر من غيرها من مستوى أقرب. أما التحليلات الضخمة bulk analytics فليست تفاعلية، لذلك لا تكلّفها بضع milliseconds إضافية من الـ latency إلا القليل، وهي تحتاج قدرة حوسبة أكبر بكثير مما يملكه موقع edge. ولهذا يكون offloading لها إلى الـ cloud، حيث توجد السعة، أمرًا منطقيًا، بشرط أن يمكن نقل البيانات إلى هناك أو أن تكون موجودة هناك أصلًا.

The same shape twice: a near tier answers hits, and misses fall back to the far tier.الشكل نفسه مرتين: المستوى القريب يجيب عن حالات الإصابة hits، وحالات الإخفاق misses ترجع إلى المستوى البعيد.

Recall

From the Cornell Skylake measurements, how do bandwidth and latency change from L1 out to main memory, and what are the end values?من قياسات Cornell على Skylake، كيف يتغيّر الـ bandwidth والـ latency من L1 إلى الذاكرة الرئيسية، وما القيم عند الطرفين؟

Cornell summarizes it as bandwidth roughly halving and latency roughly quadrupling at each step (the real steps vary: 84 to 60 to 30 to 10 GB/s, and 2 to 7 to 26 to 90 ns). L1 is about 84 GB/s and 2 ns; main memory is about 10 GB/s and 90 ns.
يلخّصها Cornell بأن الـ bandwidth ينخفض تقريبًا إلى النصف ويتضاعف الـ latency تقريبًا أربع مرات في كل خطوة (والخطوات الحقيقية تتفاوت: من 84 إلى 60 إلى 30 إلى 10 GB/s، ومن 2 إلى 7 إلى 26 إلى 90 ns). الـ L1 عند نحو 84 GB/s و2 ns؛ والذاكرة الرئيسية عند نحو 10 GB/s و90 ns.

Recall

Using T = S/B + L, why does latency matter more than bandwidth for a small interactive request?باستخدام T = S/B + L، لماذا يهمّ الـ latency أكثر من الـ bandwidth في طلب تفاعلي صغير؟

When S is tiny, S/B is close to zero, so T is roughly L. Only the fixed per-fetch delay is left, and that delay is lower on nearer, faster tiers (cache in a CPU, an edge site in a network).
عندما يكون S صغيرًا جدًا، يكون S/B قريبًا من الصفر، فيصبح T مساويًا تقريبًا لـ L. لا يبقى إلا التأخير الثابت لكل عملية جلب، وهذا التأخير أقل في المستويات الأقرب والأسرع (الـ cache داخل الـ CPU، وموقع الـ edge داخل الشبكة).

Recall

Complete and justify: CPU cache is to RAM as ___ is to ___.أكمل وبرّر: الـ CPU cache بالنسبة إلى الـ RAM مثل ___ بالنسبة إلى ___.

Edge is to cloud. In both, a small, fast, nearby tier sits in front of a large, slow, distant one. Locality lets the near tier answer most requests, and misses fall back to the far tier.
الـ edge بالنسبة إلى الـ cloud. في الحالتين يقف مستوى صغير وسريع وقريب أمام مستوى كبير وبطيء وبعيد. ومبدأ الـ locality يسمح للمستوى القريب بأن يجيب عن معظم الطلبات، وحالات الإخفاق misses ترجع إلى المستوى البعيد.

Quick checkاختبار سريع

Per the Cornell Skylake data, what happens at each step outward from L1 cache toward main memory?بحسب بيانات Cornell على Skylake، ماذا يحدث في كل خطوة نحو الخارج من L1 cache باتجاه الذاكرة الرئيسية؟

Quick checkاختبار سريع

Using T = S/B + L, what dominates retrieval time for a tiny, interactive request?باستخدام T = S/B + L، ما الذي يهيمن على زمن الجلب في طلب تفاعلي صغير جدًا؟

Quick checkاختبار سريع

In the cache and edge analogy, what does a cache miss correspond to?في تشبيه الـ cache والـ edge، ما الذي يقابل حالة الإخفاق cache miss؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • A continuum is a range whose neighbors barely differ but whose ends differ greatly. Device, mist, edge, fog and cloud are labels on one range.السلسلة المتصلة continuum نطاقٌ تكاد نقاطه المتجاورة لا تختلف، لكن طرفيه يختلفان كثيرًا. والـ device والـ mist والـ edge والـ fog والـ cloud تسميات على نطاق واحد.
  • Layering places resources at points along the path, so each request is served by the nearest layer with enough capacity.ترتيب الطبقات layering يضع الموارد في نقاط على امتداد المسار، بحيث يُخدم كل طلب من أقرب طبقة تملك سعة كافية.
  • Networks already do this: switches serve LANs by MAC address, routers serve the WAN by IP address. Tier positions 1, 2, 3 are not stack layers.الشبكات تفعل هذا أصلًا: الـ switches تخدم شبكات الـ LAN بحسب MAC address، والـ routers تخدم الـ WAN بحسب IP address. ومواقع المستويات 1 و2 و3 ليست طبقات في حزمة البروتوكولات.
  • The memory hierarchy trades capacity for nearness, and locality lets a small fast layer serve most reads.هرمية الذاكرة memory hierarchy تقايض السعة بالقرب، ومبدأ الـ locality يسمح لطبقة صغيرة وسريعة بأن تخدم معظم عمليات القراءة.
  • On Skylake: L1 about 84 GB/s and 2 ns, L2 60 GB/s and 7 ns, L3 30 GB/s and 26 ns, RAM 10 GB/s and 90 ns.على Skylake: الـ L1 نحو 84 GB/s و2 ns، والـ L2 نحو 60 GB/s و7 ns، والـ L3 نحو 30 GB/s و26 ns، والـ RAM نحو 10 GB/s و90 ns.
  • Retrieval time is about S/B + L. Small interactive fetches are latency-bound, so nearness matters most.زمن الجلب يساوي تقريبًا S/B + L. عمليات الجلب التفاعلية الصغيرة يحكمها الـ latency، لذلك يكون القرب هو الأهم.
  • CPU cache is to RAM as edge is to cloud: a small, fast, near tier in front of a large, slow, far one, justified by locality.الـ CPU cache بالنسبة إلى الـ RAM مثل الـ edge بالنسبة إلى الـ cloud: مستوى صغير وسريع وقريب أمام مستوى كبير وبطيء وبعيد، ومبرّر ذلك هو مبدأ الـ locality.

Sourcesالمصادر

Part 07: The physics of latencyفيزياء زمن الاستجابة (Latency)

Latency to the cloud, the speed-of-light lower bound, geodesic distance, real measurements from Dammam, and the four delays that add up.زمن الاستجابة إلى السحابة، والحد الأدنى الذي تفرضه سرعة الضوء، والمسافة الجيوديسية، وقياسات حقيقية من الدمام، والتأخيرات الأربعة التي تتراكم معًا.

4 concepts4 مفاهيم, ، slides 51-55الشرائح 51-55

Why this part mattersلماذا يهمّ هذا الجزء

Today’s default is to put the server in the cloud. This part prices that default in milliseconds. You will learn to turn a distance into the smallest delay physics allows, compare that floor with real measurements from Dammam, and break the gap into the four delays every packet pays.

The ideas build on each other. First, what latency is and the hard floor under it. Second, how to measure the distance that floor depends on. Third, how far above the floor real networks sit. Fourth, the four delays that explain the difference. For the exams, expect calculations: distance to bound, one way versus round trip, and the formulas L/R and d/s. For the research project and for real edge and cloud design, remember one thing above all: the d/s term is the one cost that no amount of cloud capacity removes. That is the physical argument for the edge, fog and cloud continuum in the next part.

الخيار الافتراضي اليوم هو وضع الخادم في السحابة. وهذا الجزء يحسب ثمن هذا الخيار بالميلي ثانية. ستتعلم كيف تحوّل المسافة إلى أصغر تأخير تسمح به الفيزياء، وكيف تقارن هذا الحد الأدنى بقياسات حقيقية من الدمام، وكيف تقسّم الفجوة إلى التأخيرات الأربعة التي تدفعها كل حزمة.

الأفكار مبنية بعضها على بعض. أولا، ما هو زمن الانتقال وما الحد الأدنى الصلب الذي يقع تحته. ثانيا، كيف نقيس المسافة التي يعتمد عليها هذا الحد. ثالثا، كم تبعد الشبكات الحقيقية فوق هذا الحد. رابعا، التأخيرات الأربعة التي تفسّر الفرق. في الاختبارات توقّع مسائل حسابية: من المسافة إلى الحد الأدنى، واتجاه واحد مقابل رحلة الذهاب والإياب، والمعادلتين L/R وd/s. أما في المشروع البحثي وفي التصميم الحقيقي للحافة والسحابة فتذكّر شيئا واحدا قبل كل شيء: الحد d/s هو التكلفة الوحيدة التي لا تزيلها أي سعة سحابية مهما كبرت. وهذه هي الحجة الفيزيائية لسلسلة الحافة والضباب والسحابة (edge, fog, cloud) في الجزء التالي.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Define latency as transit time, and explain why a request-response exchange pays it twice.تعريف زمن الانتقال (latency) بأنه زمن العبور، وتوضيح لماذا يدفعه تبادل الطلب والاستجابة مرتين.
  2. Compute the one-way and round-trip latency lower bound from a geodesic distance, and the fiber floor above it.حساب الحد الأدنى لزمن الانتقال في اتجاه واحد وفي رحلة الذهاب والإياب (RTT) انطلاقا من المسافة الجيوديسية، وحساب حد الألياف الضوئية الذي يقع فوقه.
  3. Explain why latency must use geodesic rather than planar distance.توضيح لماذا يجب أن يُحسب زمن الانتقال بالمسافة الجيوديسية لا بالمسافة المستوية.
  4. Compare a measured RTT with the right bound, and account for the roughly threefold gap.مقارنة RTT مقيس بالحد الأدنى المناسب، وتفسير الفجوة التي تبلغ نحو ثلاثة أضعاف.
  5. Name the four packet delays, apply transmission = L/R and propagation = d/s, and predict which one dominates.تسمية التأخيرات الأربعة للحزمة، وتطبيق transmission = L/R و propagation = d/s، والتنبؤ بأيها يهيمن.

Picture a student in Dhahran opening an app whose backend runs in the AWS Frankfurt region. His phone sends a request that must physically cross about 4,400 km of Earth, and the answer must cross it again on the way back. Nothing useful can happen on his screen until both trips are done.

تخيّل طالبا في الظهران يفتح تطبيقا تعمل خلفيته في منطقة AWS في فرانكفورت. يرسل هاتفه طلبا يجب أن يقطع فعليا نحو 4,400 km من سطح الأرض، ويجب أن يقطعها الرد مرة أخرى في طريق العودة. ولا يمكن أن يحدث شيء مفيد على شاشته حتى تكتمل الرحلتان.

Latency is transit time, paid in both directionsزمن الانتقال هو زمن العبور، ويُدفع في الاتجاهين

That travel time is Latency: the time data spends in transit between two points. In the Request-response loop you met earlier, the Client always starts, so every exchange pays latency twice: once from client to Server, once from server back to client. Total network latency is the sum of the two one-way figures. They are often close, but they need not be equal, because Internet routes are not always the same in both directions.

زمن الرحلة هذا هو latency (زمن الانتقال): الوقت الذي تقضيه البيانات في العبور بين نقطتين. في request-response loop (حلقة الطلب والاستجابة) التي رأيتها سابقا، يبدأ client (العميل) دائما، لذلك يدفع كل تبادل زمن الانتقال مرتين: مرة من العميل إلى server (الخادم)، ومرة من الخادم عائدا إلى العميل. زمن الانتقال الكلي في الشبكة هو مجموع القيمتين في الاتجاه الواحد. وكثيرا ما تكونان متقاربتين، لكن لا يلزم أن تتساويا، لأن مسارات الإنترنت ليست دائما واحدة في الاتجاهين.

Client
Dhahran

Sends the request and waits.

يرسل الطلب وينتظر.

request
Server
AWS region, Frankfurt

Does its work. That time is processing, not latency.

ينجز عمله. هذا الوقت زمن معالجة، وليس زمن انتقال latency.

response
Client
Dhahran

Receives the answer after both transits.

يتلقى الإجابة بعد رحلتي الذهاب والعودة.

One request-response exchange pays latency in both directionsتبادل واحد للطلب والاستجابة يدفع زمن الانتقال في الاتجاهين
Latencytotal=Latencyclient→server+Latencyserver→client\text{Latency}_{\text{total}} = \text{Latency}_{\text{client}\to\text{server}} + \text{Latency}_{\text{server}\to\text{client}}
Total network latency of one exchangeإجمالي زمن انتقال الشبكة لتبادل واحد

Putting the server in the Cloud is the default because it is convenient, elastic and cheap to operate. The natural next question is how much time that choice costs at the very least, before any engineering detail enters the picture.

وضع الخادم في cloud (السحابة) هو الخيار الافتراضي لأنه مريح ومرن ورخيص في التشغيل. والسؤال الطبيعي التالي هو: كم من الوقت يكلّف هذا الخيار في أقل تقدير، قبل أن تدخل أي تفاصيل هندسية في الصورة؟

The smallest latency physics allowsأصغر زمن انتقال تسمح به الفيزياء

Start with a number. A server 3,000 km away, reached at the speed of light, needs 3,000 ÷ 300,000 = 0.01 s, which is 10 ms one way. So every 1,000 km costs at least 3.3 ms one way, or 6.7 ms for a round trip.

ابدأ برقم. خادم على بعد 3,000 km، يُوصَل إليه بسرعة الضوء، يحتاج إلى 3,000 ÷ 300,000 = 0.01 s، أي 10 ms في اتجاه واحد. إذن كل 1,000 km تكلّف على الأقل 3.3 ms في اتجاه واحد، أو 6.7 ms لرحلة الذهاب والإياب.

Generalising this gives the Latency lower bound: divide the Geodesic distance by the speed of light cc. It is a lower bound for three reasons that stack. Nothing carries information faster than light. No cable between two cities can be shorter than the shortest path along the Earth. And the formula ignores every other delay a real packet meets. Because each simplification can only make the true figure larger, the result is a floor that no provider, protocol or hardware upgrade can break.

تعميم ذلك يعطينا latency lower bound (الحد الأدنى لزمن الانتقال): اقسم geodesic distance (المسافة الجيوديسية) على سرعة الضوء cc. وهو حد أدنى لثلاثة أسباب تتراكم. لا شيء ينقل المعلومات أسرع من الضوء. ولا يمكن لأي كابل بين مدينتين أن يكون أقصر من أقصر مسار على سطح الأرض. والمعادلة تتجاهل كل تأخير آخر تواجهه الحزمة الحقيقية. ولأن كل تبسيط من هذه لا يمكنه إلا أن يجعل القيمة الحقيقية أكبر، فالنتيجة حد أدنى لا يستطيع أي مزوّد أو بروتوكول أو ترقية عتاد أن يكسره.

LatencyLB=dgeodesicc,c≈3×105 km/s\text{Latency}_{LB} = \dfrac{d_{\text{geodesic}}}{c},\quad c \approx 3\times10^{5}\ \text{km/s}
One-way lower boundالحد الأدنى في اتجاه واحد
RTTLB=2 dgeodesicc\text{RTT}_{LB} = \dfrac{2\,d_{\text{geodesic}}}{c}
Round-trip lower boundالحد الأدنى لرحلة الذهاب والعودة
Dammam to Frankfurt: the signal crosses the geodesic and returns, so the round trip is at least 29.3 msمن الدمام إلى فرانكفورت: تعبر الإشارة المسار الجيوديسي ثم تعود، لذلك لا تقل رحلة الذهاب والإياب عن 29.3 ms

Real glass is slower than vacuumالزجاج الحقيقي أبطأ من الفراغ

“Speed of light” in the bound means light in a vacuum. Real links carry light through glass fiber with a refractive index of about 1.5, so the signal moves at roughly 200,000 km/s, about two thirds of cc (Grigorik, High Performance Browser Networking). Even a perfectly straight fiber therefore needs about 1.5× the bound. ITU-T G.114 plans 5 µs/km for optical fibre systems, which is 5 ms per 1,000 km, against 3.3 ms per 1,000 km at cc. Keep both numbers in mind: the vacuum bound is the absolute floor, and the fiber floor is the realistic best case for a cabled network.

"سرعة الضوء" في الحد الأدنى تعني الضوء في الفراغ. أما الروابط الحقيقية فتحمل الضوء عبر ألياف زجاجية معامل انكسارها نحو 1.5، فتتحرك الإشارة بنحو 200,000 km/s، أي نحو ثلثي cc (Grigorik، High Performance Browser Networking). لذلك حتى الليف المستقيم تماما يحتاج إلى نحو 1.5× الحد الأدنى. وتعتمد التوصية ITU-T G.114 قيمة 5 µs/km لأنظمة الألياف الضوئية، أي 5 ms لكل 1,000 km، مقابل 3.3 ms لكل 1,000 km عند cc. احفظ الرقمين: الحد في الفراغ هو الأرضية المطلقة، وحد الألياف هو أفضل حالة واقعية لشبكة مكوّنة من كابلات.

tfiber=dc/n≈1.5 dc(n≈1.5)t_{\text{fiber}} = \dfrac{d}{c/n} \approx 1.5\,\dfrac{d}{c}\quad (n \approx 1.5)
The fiber floor: the same distance divided by the slower speed in glassحد الألياف الضوئية: المسافة نفسها مقسومة على السرعة الأبطأ داخل الزجاج

Try the simulator. Pick the Frankfurt preset and read the one-way bound, then read the round-trip value to see the number doubled. The presets use the distances implied by the lecture’s own figures (for example 11,100 km for Oregon), a choice examined closely when we compare bounds with measurements below.

جرّب المحاكي. اختر الإعداد المسبق لفرانكفورت واقرأ الحد الأدنى في اتجاه واحد، ثم اقرأ قيمة رحلة الذهاب والإياب لترى الرقم مضاعفا. تستخدم الإعدادات المسبقة المسافات التي تدل عليها أرقام المحاضرة نفسها (مثلا 11,100 km لأوريغون)، وهو اختيار سندرسه عن قرب عندما نقارن الحدود الدنيا بالقياسات أدناه.

SimulatorمحاكيSpeed of light latencyزمن الانتقال بسرعة الضوء
km
clientround trip, slowed 50×ذهاب وإياب، مبطّأ 50×server
One way, lower boundاتجاه واحد، الحد الأدنى14.7msdistance ÷ 300,000 km/sالمسافة ÷ 300,000 km/s
Round trip, lower boundذهاب وإياب، الحد الأدنى29.5msthere and backذهابًا ثم عودة
Real Internet, illustrativeالإنترنت الفعلي، للتوضيح58.9 to 295ms2× to 10× the boundمن 2× إلى 10× الحد الأدنى

Light in fibre is slower than in vacuum, cables do not follow the geodesic, and routers add processing, queueing and transmission delay. The band above is only an illustration. Slide 55 notes real latency can reach up to 100× the lower bound.الضوء في الألياف الضوئية أبطأ منه في الفراغ، والكابلات لا تتبع المسار الجيوديسي، والموجّهات (routers) تضيف تأخير المعالجة والانتظار في الطابور (queueing) والإرسال (transmission). النطاق أعلاه للتوضيح فقط. تذكر الشريحة 55 أن زمن الانتقال الفعلي قد يصل إلى 100× الحد الأدنى.

Recall

What does the lower-bound formula leave out, and why is it still useful?ما الذي تُغفله معادلة الحد الأدنى، ولماذا تبقى مفيدة رغم ذلك؟

It leaves out the slower speed of light in fiber, cable routes longer than the geodesic, and the processing, queueing and transmission delays. It is still useful because no real network can beat it: if the bound alone already breaks your latency target, the only fix is to move the server closer.

تُغفل السرعة الأبطأ للضوء في الألياف، ومسارات الكابلات الأطول من المسار الجيوديسي، وتأخيرات المعالجة والانتظار في الطابور والإرسال. وتبقى مفيدة لأنه لا توجد شبكة حقيقية تستطيع أن تتجاوزها: إذا كان الحد الأدنى وحده يكسر هدف زمن الانتقال لديك، فالحل الوحيد هو تقريب الخادم.

The bound is only as good as the distance you feed it, so which distance is the right one? Stretch a string tight between London and Singapore on a real globe. It does not run across Arabia the way a ruler on a flat map suggests. It runs north, over Eastern Europe and Central Asia. Now flatten that globe into a rectangle: the string that was the shortest path turns into a curve.

الحد الأدنى لا يكون جيدا إلا بقدر جودة المسافة التي تُدخلها فيه، فأي مسافة هي الصحيحة؟ شُدّ خيطا مشدودا بين لندن وسنغافورة على كرة أرضية حقيقية. لن يمر عبر الجزيرة العربية كما توحي المسطرة على خريطة مسطحة، بل يتجه شمالا فوق أوروبا الشرقية وآسيا الوسطى. والآن افرد هذه الكرة إلى مستطيل: الخيط الذي كان أقصر مسار يتحول إلى منحنى.

Those are the two candidates. A straight line drawn on the flat map gives the planar distance. The curve that the string traces gives the Geodesic distance between the same two endpoints. Esri’s documentation defines planar distance as straight-line Euclidean distance in a 2D Cartesian coordinate system, and geodesic distance as distance across the curved surface of the world in 3D. Signals travel over the real Earth, not over a map, so latency lives in the second definition.

هذان هما المرشحان. الخط المستقيم المرسوم على الخريطة المسطحة يعطي المسافة المستوية (planar). أما المنحنى الذي يرسمه الخيط فيعطي geodesic distance (المسافة الجيوديسية) بين النقطتين نفسيهما. وتعرّف وثائق Esri المسافة المستوية بأنها المسافة الإقليدية في خط مستقيم ضمن نظام إحداثيات ديكارتي ثنائي الأبعاد، والمسافة الجيوديسية بأنها المسافة عبر سطح العالم المنحني في ثلاثة أبعاد. والإشارات تنتقل فوق الأرض الحقيقية لا فوق خريطة، لذلك ينتمي زمن الانتقال إلى التعريف الثاني.

The same two cities on a flat map and on a globe: the path that looks curved on the map is the shorter oneالمدينتان نفسهما على خريطة مسطحة وعلى كرة أرضية: المسار الذي يبدو منحنيا على الخريطة هو الأقصر

Map projections stretch the Earth, and the stretch grows with latitude and with the size of the area. Over a city block the two distances agree. Over continents they can disagree a lot, and near the equator they can be surprisingly close: Esri notes that for Singapore to Nairobi, about 7,440 km, the Web Mercator planar result is less than a metre longer. Because you cannot know in advance which case you are in, always use the geodesic when you compute a Latency lower bound. Using a planar distance that happens to be too short would even produce a “bound” that is not a bound at all.

إسقاطات الخرائط تمطّ الأرض، ويزداد هذا المطّ مع خط العرض ومع اتساع المنطقة. على مستوى حيّ في مدينة تتفق المسافتان. وعبر القارات قد تختلفان كثيرا، وقرب خط الاستواء قد تتقاربان على نحو مفاجئ: تذكر Esri أن المسافة من سنغافورة إلى نيروبي، نحو 7,440 km، تكون نتيجتها المستوية في إسقاط Web Mercator أطول بأقل من متر واحد. ولأنك لا تستطيع أن تعرف مسبقا في أي حالة أنت، استخدم دائما المسافة الجيوديسية عندما تحسب latency lower bound. بل إن استخدام مسافة مستوية تصادف أنها أقصر من اللازم سينتج "حدا أدنى" ليس حدا أدنى أصلا.

AspectالجانبPlanar distanceالمسافة المستويةGeodesic distanceالمسافة الجيوديسية
Computed inتُحسب فيA flat 2D Cartesian plane (a projected map)مستوى ديكارتي مسطح ثنائي الأبعاد (خريطة مُسقَطة)3D space, across the curved surface of the Earthفضاء ثلاثي الأبعاد، عبر سطح الأرض المنحني
Looks like on a flat mapشكلها على خريطة مسطحةA straight lineخط مستقيمUsually a curve bending toward the poleمنحنى في الغالب ينحني نحو القطب
Accuracy over long rangeالدقة على المسافات الطويلةError grows with distance and latitudeيكبر الخطأ مع المسافة ومع خط العرضCorrect by definition (shortest surface path)صحيحة بحكم التعريف (أقصر مسار على السطح)
Use for latencyاستخدامها لزمن الانتقالNo, except for tiny local areasلا، إلا في المناطق المحلية الصغيرة جداYes, always for intercity or intercontinental linksنعم، دائما للروابط بين المدن أو بين القارات
Planar versus geodesic distanceالمسافة المستوية مقابل المسافة الجيوديسية

Quick checkاختبار سريع

On a flat map, the straight London to Singapore line looks shorter than the curved one. Which path is shorter on the real Earth?على خريطة مسطحة يبدو الخط المستقيم من لندن إلى سنغافورة أقصر من الخط المنحني. أي المسارين أقصر على الأرض الحقيقية؟

Recall

Why does the curved line on a flat map represent the shorter path?لماذا يمثّل الخط المنحني على الخريطة المسطحة المسار الأقصر؟

The map projection distorts the sphere. The geodesic is the shortest path along the curved surface, and it only looks curved after the globe is flattened into a map.

إسقاط الخريطة يشوّه الكرة. المسار الجيوديسي هو أقصر مسار على السطح المنحني، ولا يبدو منحنيا إلا بعد أن تُفرد الكرة إلى خريطة.

With the right distance and the right formula in hand, the bound can finally meet reality. Put the client in Dammam and the server in three AWS regions: US West (Oregon, us-west-2), Europe (Frankfurt, eu-central-1) and Asia Pacific (Tokyo, ap-northeast-1). For each, compute the one-way Latency lower bound, then compare it with the Round-trip time (RTT) measured with aws-latency-test.com.

بعد أن صارت لدينا المسافة الصحيحة والمعادلة الصحيحة، يمكن أخيرا أن يلتقي الحد الأدنى بالواقع. ضع العميل في الدمام والخادم في ثلاث مناطق من AWS: غرب الولايات المتحدة (أوريغون، us-west-2)، وأوروبا (فرانكفورت، eu-central-1)، وآسيا والمحيط الهادئ (طوكيو، ap-northeast-1). لكل منطقة احسب latency lower bound في اتجاه واحد، ثم قارنه بـ RTT المقيس باستخدام aws-latency-test.com.

Worked exampleمثال محلول

Dammam to Frankfurt: bound against measurementمن الدمام إلى فرانكفورت: الحد الأدنى مقابل القياس

  1. Get the distanceاحصل على المسافة

    The geodesic from Dammam to Frankfurt is about 4,390 km. The lecture’s 14.7 ms implies about 4,410 km, which agrees.

    المسافة الجيوديسية من الدمام إلى فرانكفورت نحو 4,390 km. وقيمة المحاضرة 14.7 ms تدل على نحو 4,410 km، وهذا متوافق.

  2. One-way boundالحد الأدنى في اتجاه واحد

    4,390 ÷ 300,000 = 0.01463 s ≈ 14.6 ms.

    4,390 ÷ 300,000 = 0.01463 s ≈ 14.6 ms.

  3. Round-trip boundالحد الأدنى لرحلة الذهاب والإياب

    2 × 14.6 ≈ 29.3 ms. This is the number to compare with an RTT.

    2 × 14.6 ≈ 29.3 ms. هذا هو الرقم الذي يُقارن بـ RTT.

  4. Fiber floorحد الألياف

    At 200,000 km/s the same path takes 21.9 ms one way and 43.9 ms round trip, even on a perfect cable laid exactly along the geodesic.

    بسرعة 200,000 km/s يستغرق المسار نفسه 21.9 ms في اتجاه واحد و43.9 ms ذهابا وإيابا، حتى على كابل مثالي ممدود تماما على المسار الجيوديسي.

  5. Compareقارن

    Measured RTT 100 ms ÷ 29.3 ms ≈ 3.4× the vacuum bound, and about 2.3× the fiber floor.

    RTT المقيس 100 ms ÷ 29.3 ms ≈ 3.4× الحد الأدنى في الفراغ، ونحو 2.3× حد الألياف.

  6. Resultالنتيجة

    Physics sets a floor of about 29 ms (vacuum) or 44 ms (fiber). The remaining ≈56 ms comes from longer cable routes, routers and queues. No provider can ever push this RTT below 29.3 ms.
    تضع الفيزياء أرضية بنحو 29 ms (في الفراغ) أو 44 ms (في الألياف). والـ ≈56 ms المتبقية تأتي من مسارات كابلات أطول والموجّهات والطوابير. ولن يستطيع أي مزوّد أبدا أن ينزل بهذا الـ RTT تحت 29.3 ms.

The rule behind the example: compare like with like. An RTT is a round trip, so compare it with twice the one-way bound, never with the one-way figure itself. Doing that for all three regions tells the same story each time: the measurements sit about 2.9× to 3.4× above the vacuum round-trip bound. A ratio that stable across very different distances is a hint that the extra cost is systematic, not bad luck on one path.

القاعدة وراء المثال: قارن الشيء بنظيره. الـ RTT رحلة ذهاب وإياب، فقارنه بضعف الحد الأدنى في اتجاه واحد، ولا تقارنه أبدا بقيمة الاتجاه الواحد نفسها. وعند فعل ذلك للمناطق الثلاث تتكرر القصة نفسها كل مرة: القياسات تقع فوق الحد الأدنى لرحلة الذهاب والإياب في الفراغ بنحو 2.9× إلى 3.4×. ونسبة بهذا الثبات عبر مسافات مختلفة جدا تلمّح إلى أن التكلفة الإضافية منهجية، لا مجرد سوء حظ على مسار واحد.

RegionالمنطقةGeodesicالمسافة الجيوديسيةBound, one way / RTTالحد الأدنى، اتجاه واحد / RTTFiber RTT floorحد RTT في الأليافMeasured RTTRTT المقيسMeasured ÷ RTT boundRTT المقيس ÷ حد RTT
Frankfurt (eu-central-1)فرانكفورت (eu-central-1)≈4,390 km≈4,390 km14.6 ms / 29.3 ms14.6 ms / 29.3 ms43.9 ms43.9 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 ms83.0 ms83.0 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 ms119 ms119 ms243 ms243 ms≈3.1×≈3.1×
Dammam to three AWS regions. Distances are great-circle estimates on a sphere; measured RTTs are the lecture’s values.من الدمام إلى ثلاث مناطق في AWS. المسافات تقديرات للدائرة العظمى على كرة، وقيم RTT المقيسة هي قيم المحاضرة.
For each region: the vacuum RTT bound, the extra from slower fiber, and the measured RTT on topلكل منطقة: الحد الأدنى لـ RTT في الفراغ، والزيادة الناتجة عن بطء الألياف، ثم RTT المقيس فوقهما

Where the factor of three comes fromمن أين يأتي معامل الثلاثة

  • About 1.5× comes from glass alone, because light in fiber moves at about two thirds of cc.نحو 1.5× يأتي من الزجاج وحده، لأن الضوء في الألياف يتحرك بنحو ثلثي cc.
  • Cables do not follow the geodesic. They follow coastlines and seabeds, land at a few stations, and backhaul over land to data centers.الكابلات لا تتبع المسار الجيوديسي. إنها تتبع السواحل وقيعان البحار، وترسو في عدد قليل من المحطات، ثم تُنقل برّا (backhaul) إلى مراكز البيانات.
  • Each router on the way adds processing and queueing time, two of the four delays in the next concept.كل موجّه (router) في الطريق يضيف زمن معالجة وزمن انتظار في الطابور، وهما اثنان من التأخيرات الأربعة في المفهوم التالي.

Research agrees with this breakdown. Singla and colleagues measured Internet paths worldwide and found router paths about 2.3× the speed-of-light latency at the median. After removing the 1.5× fiber factor, path detours alone still leave about 1.53×.

والأبحاث تتفق مع هذا التقسيم. فقد قاس Singla وزملاؤه مسارات الإنترنت حول العالم ووجدوا أن مسارات الموجّهات تبلغ نحو 2.3× زمن الانتقال بسرعة الضوء عند الوسيط. وبعد إزالة معامل الألياف 1.5×، تظل انحرافات المسار وحدها تترك نحو 1.53×.

Quick checkاختبار سريع

Dammam to Singapore is about 6,370 km along the geodesic. What is the round-trip lower bound at the speed of light in vacuum?المسافة من الدمام إلى سنغافورة نحو 6,370 km على المسار الجيوديسي. ما الحد الأدنى لرحلة الذهاب والإياب بسرعة الضوء في الفراغ؟

Quick checkاختبار سريع

The measured Dammam to Frankfurt RTT is 100 ms, about three times the 29 ms vacuum bound. What best explains the gap?RTT المقيس من الدمام إلى فرانكفورت هو 100 ms، أي نحو ثلاثة أضعاف الحد الأدنى في الفراغ البالغ 29 ms. ما أفضل تفسير لهذه الفجوة؟

Recall

Dammam to London is about 5,020 km. Give the vacuum RTT bound and the fiber RTT floor.المسافة من الدمام إلى لندن نحو 5,020 km. أعطِ الحد الأدنى لـ RTT في الفراغ وحد RTT في الألياف.

5,020 ÷ 300,000 ≈ 16.7 ms one way, so 33.5 ms RTT. In fiber at 200,000 km/s it is 25.1 ms one way and 50.2 ms RTT.

5,020 ÷ 300,000 ≈ 16.7 ms في اتجاه واحد، إذن 33.5 ms لـ RTT. وفي الألياف بسرعة 200,000 km/s يكون 25.1 ms في اتجاه واحد و50.2 ms لـ RTT.

Recall

The measured Dammam to Tokyo RTT is 163 ms. How much is left after perfect fiber along the geodesic?RTT المقيس من الدمام إلى طوكيو هو 163 ms. كم يتبقى بعد احتساب ألياف مثالية على المسار الجيوديسي؟

About 83 ms is the fiber RTT floor, so roughly 80 ms comes from longer routes, router processing and queueing.

نحو 83 ms هي حد RTT في الألياف، إذن نحو 80 ms تأتي من مسارات أطول ومعالجة الموجّهات والانتظار في الطوابير.

The factor of three needs a precise vocabulary. Follow one 1,500-byte packet across one router onto a 4,390 km fiber link running at 1 Gbps. Pushing its 12,000 bits onto the wire takes 12,000 ÷ 10⁹ s = 12 µs. Travelling the fiber takes about 22 ms. The router’s own work takes microseconds. Waiting behind other packets takes anything from nothing to a very long time. Now slow the link to 10 Mbps: pushing the bits out now takes 1.2 ms, and the fiber trip is still 22 ms.

معامل الثلاثة يحتاج إلى مفردات دقيقة. تتبّع حزمة واحدة حجمها 1,500-byte تعبر موجّها واحدا إلى رابط ألياف طوله 4,390 km ويعمل بسرعة 1 Gbps. دفع بتاتها البالغة 12,000 إلى السلك يستغرق 12,000 ÷ 10⁹ s = 12 µs. والسفر عبر الألياف يستغرق نحو 22 ms. وعمل الموجّه نفسه يستغرق ميكروثواني. أما الانتظار خلف الحزم الأخرى فيستغرق أي مدة من لا شيء إلى وقت طويل جدا. والآن أبطئ الرابط إلى 10 Mbps: دفع البتات يستغرق الآن 1.2 ms، ورحلة الألياف ما زالت 22 ms.

Those four pieces are the four packet delays, and Kurose and Ross (section 1.4) add them up at every node a packet crosses. Processing delay happens inside switches and routers. Queueing delay happens in buffers when traffic piles up. Transmission delay happens at the network interface and depends on bandwidth. Propagation delay happens on the physical channel and depends on distance. Only the last one is the physics behind the lower bound; the other three are what real equipment and real traffic add on top.

هذه القطع الأربع هي التأخيرات الأربعة للحزمة، ويجمعها Kurose وRoss (القسم 1.4) عند كل عقدة تعبرها الحزمة. processing delay (تأخير المعالجة) يحدث داخل المبدّلات والموجّهات. queueing delay (تأخير الانتظار في الطابور) يحدث في المخازن المؤقتة عندما تتكدس حركة المرور. transmission delay (تأخير الإرسال) يحدث عند واجهة الشبكة ويعتمد على عرض النطاق. propagation delay (تأخير الانتشار) يحدث على القناة الفيزيائية ويعتمد على المسافة. والأخير وحده هو الفيزياء التي وراء الحد الأدنى، أما الثلاثة الأخرى فهي ما تضيفه المعدات الحقيقية وحركة المرور الحقيقية فوقه.

dnodal=dproc+dqueue+dtrans+dpropd_{\text{nodal}} = d_{\text{proc}} + d_{\text{queue}} + d_{\text{trans}} + d_{\text{prop}}
Delay at one node (Kurose and Ross, section 1.4)التأخير عند عقدة واحدة (Kurose and Ross، القسم 1.4)
dtrans=LRd_{\text{trans}} = \dfrac{L}{R}
L: packet length in bits, R: link rate in bits per secondL: طول الحزمة بالبت، R: معدل الرابط بالبت في الثانية
dprop=dsd_{\text{prop}} = \dfrac{d}{s}
d: link length, s: propagation speed, about 200,000 km/s in fiberd: طول الرابط، s: سرعة الانتشار، نحو 200,000 km/s في الألياف

End to end, you add the nodal delay over every hop on the path, and an RTT adds it again for the return direction. That sum is exactly the measured RTT from Dammam, which is why it sits so far above 2d/c. Hold on to the contrast that exams love: transmission depends on packet size and bandwidth and has nothing to do with distance, while propagation depends on distance and the medium and has nothing to do with bandwidth.

من الطرف إلى الطرف تجمع التأخير العُقدي على كل قفزة في المسار، ويضيفه RTT مرة أخرى لاتجاه العودة. وهذا المجموع هو بالضبط RTT المقيس من الدمام، ولهذا يقع بعيدا جدا فوق 2d/c. وتمسّك بالمقابلة التي تحبها الاختبارات: الإرسال يعتمد على حجم الحزمة وعرض النطاق ولا علاقة له بالمسافة، بينما الانتشار يعتمد على المسافة والوسط ولا علاقة له بعرض النطاق.

One packet’s delay as four charges (not to scale); on a 10 Mbps link only the transmission charge growsتأخير حزمة واحدة على شكل أربع رسوم (ليست بمقياس رسم)؛ على رابط 10 Mbps لا يكبر إلا رسم الإرسال
DelayالتأخيرWhere it happensأين يحدثDriven byما الذي يحددهFormula or key factorالمعادلة أو العامل الأساسيShrinks whenيتقلص عندما
ProcessingالمعالجةInside each router, switch or hostداخل كل موجّه أو مبدّل أو مضيفHeader checks, bit-error checks, forwarding lookupفحص الترويسة، وفحص أخطاء البتات، والبحث في جدول التوجيهDevice speed (usually microseconds)سرعة الجهاز (عادة ميكروثوانٍ)Faster hardware, fewer hopsعتاد أسرع، وقفزات أقل
Queueingالانتظار في الطابورIn router and server buffersفي المخازن المؤقتة للموجّهات والخوادمCongestion: how many packets arrived ahead of yoursالازدحام: عدد الحزم التي وصلت قبل حزمتكTraffic intensity, from zero to very largeشدة حركة المرور، من الصفر إلى قيم كبيرة جداLess traffic, more capacity, fewer hopsحركة مرور أقل، وسعة أكبر، وقفزات أقل
TransmissionالإرسالAt the network interface pushing bits onto the linkعند واجهة الشبكة التي تدفع البتات إلى الرابطPacket size and link bandwidthحجم الحزمة وعرض نطاق الرابطL / RL / RBandwidth goes up or packets get smallerعندما يرتفع عرض النطاق أو تصغر الحزم
PropagationالانتشارAlong the physical channel (fiber, copper, radio)على طول القناة الفيزيائية (ألياف، نحاس، راديو)Link length and the mediumطول الرابط والوسطd / sd / sThe endpoints move closerعندما يقترب الطرفان أحدهما من الآخر
The four delays at a glanceالتأخيرات الأربعة في لمحة

Can it really be 100 times the bound?هل يمكن حقا أن يبلغ 100 ضعف الحد الأدنى؟

The lecture claims Internet latency can reach 100× the Latency lower bound. For whole page loads, measurements support this. Singla and colleagues found that fetching just the HTML of popular web pages took 34× the round-trip speed-of-light latency at the median and 169× at the 90th percentile. Those fetches include more than the four per-hop delays: a DNS lookup, the TCP handshake and TCP’s slow start all add round trips. The lecture’s example of a 15 ms theoretical latency turning into 1,500 ms is best read the same way: an illustration of network delays stacked with protocol and application effects, not four delays on a single link.

تقول المحاضرة إن زمن الانتقال في الإنترنت قد يبلغ 100× latency lower bound. وبالنسبة لتحميل صفحات كاملة، تدعم القياسات ذلك. فقد وجد Singla وزملاؤه أن جلب ملف HTML وحده لصفحات ويب شائعة استغرق 34× زمن الانتقال بسرعة الضوء لرحلة الذهاب والإياب عند الوسيط، و169× عند المئين 90th. وهذه العمليات تشمل أكثر من التأخيرات الأربعة لكل قفزة: استعلام DNS، ومصافحة TCP، وبدء TCP البطيء (slow start)، وكلها تضيف رحلات ذهاب وإياب. ومثال المحاضرة عن زمن انتقال نظري 15 ms يتحول إلى 1,500 ms يُفهم أفضل بالطريقة نفسها: توضيح لتأخيرات الشبكة متراكمة مع تأثيرات البروتوكولات والتطبيقات، لا أربعة تأخيرات على رابط واحد.

Quick checkاختبار سريع

A file server moves from a 1 Gbps link to a 10 Mbps link on the same cable route. Which delay grows for every packet?ينتقل خادم ملفات من رابط بسرعة 1 Gbps إلى رابط بسرعة 10 Mbps على مسار الكابل نفسه. أي تأخير يكبر لكل حزمة؟

Recall

Which delay depends on bandwidth, and which on distance? Give both formulas.أي تأخير يعتمد على عرض النطاق، وأيها يعتمد على المسافة؟ اكتب المعادلتين.

Transmission, dtrans=L/Rd_{\text{trans}} = L/R, depends on packet size and link rate. Propagation, dprop=d/sd_{\text{prop}} = d/s, depends on link length and the signal speed in the medium.

الإرسال، dtrans=L/Rd_{\text{trans}} = L/R، يعتمد على حجم الحزمة ومعدل الرابط. والانتشار، dprop=d/sd_{\text{prop}} = d/s، يعتمد على طول الرابط وسرعة الإشارة في الوسط.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • Latency is time in transit. A request-response exchange pays it in both directions.زمن الانتقال هو الوقت الذي تقضيه البيانات في العبور. وتبادل الطلب والاستجابة يدفعه في الاتجاهين.
  • Latency_LB = geodesic distance ÷ c (about 300,000 km/s). Double it for RTT. No network can beat it.Latency_LB = المسافة الجيوديسية ÷ c (نحو 300,000 km/s). ضاعفه لتحصل على RTT. ولا توجد شبكة تستطيع أن تتجاوزه نزولا.
  • Measure distance along the curved Earth (geodesic), not as a straight line on a flat map.قِس المسافة على سطح الأرض المنحني (المسافة الجيوديسية)، لا كخط مستقيم على خريطة مسطحة.
  • Light in fiber travels at about 2/3 c, so even a perfect cable is about 1.5× the bound (about 5 ms per 1,000 km).ينتقل الضوء في الألياف بنحو 2/3 c، لذلك حتى الكابل المثالي يبلغ نحو 1.5× الحد الأدنى (نحو 5 ms لكل 1,000 km).
  • Measured RTTs from Dammam (100, 163 and 243 ms) are about 3× the round-trip bound, because of slower fiber, cable detours, routers and queues.قيم RTT المقيسة من الدمام (100 و163 و243 ms) تبلغ نحو 3× الحد الأدنى لرحلة الذهاب والإياب، بسبب بطء الألياف وانحرافات مسارات الكابلات والموجّهات والطوابير.
  • Total delay = processing + queueing + transmission (L/R) + propagation (d/s). Bandwidth shrinks only transmission. Only moving closer shrinks propagation.التأخير الكلي = المعالجة + الانتظار في الطابور + الإرسال (L/R) + الانتشار (d/s). زيادة عرض النطاق تقلّص الإرسال فقط. ولا يقلّص الانتشار إلا الاقتراب.
  • Full page fetches can be tens to over a hundred times the bound (Singla et al.: 34× median, 169× at the 90th percentile). This is why edge placement matters.قد يبلغ جلب صفحة كاملة عشرات الأضعاف إلى أكثر من مئة ضعف الحد الأدنى (Singla وزملاؤه: 34× عند الوسيط، و169× عند المئين التسعين). ولهذا يهمّ وضع الحوسبة على الحافة.

Sourcesالمصادر

Part 08: Edge, fog and cloudالحافة والضباب والسحابة (Edge, Fog, Cloud)

The layers of the E2C continuum from mist to regional cloud, their latency, resources and typical roles.طبقات سلسلة E2C من الضباب الخفيف (mist) إلى السحابة الإقليمية، وزمن استجابتها، ومواردها، وأدوارها المعتادة.

4 concepts4 مفاهيم, ، slides 56-60الشرائح 56-60

Why this part mattersلماذا يهمّ هذا الجزء

Every system you design in this course, and the research project itself, starts with one question: where does each piece of work run? This part gives you the map. It is a chain of places from the device in your hand to a hyperscale data center. Each step outward buys processing power and storage, and each step costs latency. Exam questions on placement, and the mapping problems in the next part, both assume you can read this map fluently.

كل نظام تصممه في هذا المقرر، وكذلك مشروع البحث نفسه، يبدأ بسؤال واحد: أين يعمل كل جزء من العمل؟ هذا الجزء يعطيك الخريطة. إنها سلسلة من المواقع تمتد من الجهاز الذي في يدك حتى مركز بيانات ضخم (hyperscale). كل خطوة للخارج تمنحك قدرة معالجة وتخزينًا أكبر، وكل خطوة تكلّفك زمن استجابة. أسئلة الامتحان عن التوزيع، ومسائل الربط في الجزء التالي، كلها تفترض أنك تقرأ هذه الخريطة بطلاقة.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain why the server side of a system is a continuum of possible locations, and why the location a user is served from sets the latency they feel.تشرح لماذا يمثّل جانب الخادم في أي نظام سلسلة متصلة من المواقع الممكنة، ولماذا يحدد الموقع الذي يُخدَم منه المستخدم زمن الاستجابة الذي يشعر به.
  2. Name the three layers of the E2C continuum and its seven stages in order from device to cloud, with a real product or board for each.تسمّي الطبقات الثلاث لسلسلة E2C ومراحلها السبع بالترتيب من الجهاز إلى السحابة، مع منتج أو لوحة حقيقية لكل مرحلة.
  3. Explain the core trade of the continuum: resources and coverage grow outward while proximity falls, and argue it with propagation, hops and real millisecond thresholds.تشرح المقايضة الأساسية في السلسلة: الموارد والتغطية تزداد كلما ابتعدنا للخارج بينما يقل القرب، وتدافع عن ذلك بالانتشار وعدد القفزات وعتبات حقيقية بالمللي ثانية.
  4. Apply the placement rule, and justify a placement with latency, processing and storage needs, and cost.تطبّق قاعدة التوزيع، وتبرّر اختيار موقع المهمة بمتطلبات زمن الاستجابة والمعالجة والتخزين والتكلفة.
  5. Spot ambiguous terminology, such as near versus far edge, and a mislabelled microcontroller board.تكتشف المصطلحات الملتبسة، مثل الحافة القريبة مقابل الحافة البعيدة، ولوحة متحكم دقيق مسمّاة خطأً.

Start with something you do every week. When you press play on Netflix in Dhahran, the video bytes do not cross an ocean from a data center in the United States. Netflix runs its own delivery network, Open Connect, and places caching appliances inside the networks of internet service providers and at Internet Exchange Points. The first bytes of your episode travel a few kilometres and a few router hops, not thousands of kilometres and dozens of hops.

ابدأ بشيء تفعله كل أسبوع. عندما تضغط تشغيل على Netflix في الظهران، لا تعبر بايتات الفيديو محيطًا قادمة من مركز بيانات في الولايات المتحدة. تشغّل Netflix شبكة توصيل خاصة بها اسمها Open Connect، وتضع أجهزة تخزين مؤقت (caching appliances) داخل شبكات مزوّدي خدمة الإنترنت وفي نقاط تبادل الإنترنت (Internet Exchange Points). أول بايتات الحلقة التي تشاهدها تقطع بضعة كيلومترات وبضع قفزات بين الموجّهات (router hops)، لا آلاف الكيلومترات وعشرات القفزات.

In the client-server model of the earlier parts, the Server looked like one box at the far end of the line. The Netflix example shows why that picture is too simple. Between the Client and the origin data center there are several stops, and each stop is a possible home for code or data. Moving work from one stop to another moves you along a continuum of latencies. A stop closer to the client means a shorter path, so less Propagation delay and fewer routers where a packet can wait in a queue.

في نموذج العميل والخادم من الأجزاء السابقة، بدا server كأنه صندوق واحد في الطرف البعيد من الخط. مثال Netflix يوضح لماذا هذه الصورة مبسّطة أكثر من اللازم. بين client ومركز البيانات الأصلي توجد عدة محطات، وكل محطة مكان محتمل لتشغيل الكود أو حفظ البيانات. نقل العمل من محطة إلى أخرى يحرّكك على سلسلة متصلة من أزمنة الاستجابة (latencies). المحطة الأقرب إلى العميل تعني مسارًا أقصر، وبالتالي propagation delay أقل وعددًا أقل من الموجّهات التي قد تنتظر فيها الحزمة في طابور.

The consequence for users is striking. The same service, running the same code, can make one user happy and another angry, and the only difference is where the service runs relative to each of them. A viewer served from a cache in their own city sees the video start at once; a viewer served from another continent watches a spinner. Placement is therefore not an operations detail. It is part of the design of the application.

النتيجة بالنسبة للمستخدمين لافتة. الخدمة نفسها، بالكود نفسه، قد تُسعد مستخدمًا وتُغضب آخر، والفرق الوحيد هو مكان تشغيل الخدمة بالنسبة لكل منهما. المشاهد الذي يُخدَم من ذاكرة مؤقتة في مدينته يرى الفيديو يبدأ فورًا، أما المشاهد الذي يُخدَم من قارة أخرى فيظل يحدّق في أيقونة التحميل. لذلك فإن اختيار المكان ليس تفصيلًا تشغيليًا، بل هو جزء من تصميم التطبيق نفسه.

The idea is older than cloud computing. Mahadev Satyanarayanan traces edge computing back to content delivery networks (CDNs) such as Akamai in the late 1990s: a CDN uses nodes close to users to prefetch and cache web content. Edge computing generalises that idea. Instead of only caching bytes near users, you run arbitrary code there. The rest of this part names the stops on the line and the trade each one offers; the course as a whole is about deciding what to put at each one, which is the heart of the Edge-to-cloud (E2C) continuum.

الفكرة أقدم من الحوسبة السحابية. يعيد Mahadev Satyanarayanan أصل الحوسبة الطرفية (edge computing) إلى شبكات توصيل المحتوى (CDNs) مثل Akamai في أواخر 1990s: شبكة CDN تستخدم عُقدًا قريبة من المستخدمين لجلب محتوى الويب مسبقًا وتخزينه مؤقتًا. الحوسبة الطرفية تعمّم هذه الفكرة: بدل الاكتفاء بتخزين البايتات قرب المستخدمين، تشغّل هناك أي كود تريده. بقية هذا الجزء تسمّي المحطات على الخط والمقايضة التي تقدمها كل محطة، والمقرر كله يدور حول تحديد ما تضعه في كل محطة، وهذا هو جوهر E2C continuum.

Recall

Why does Netflix place Open Connect appliances inside ISP networks instead of serving every stream from a central data center?لماذا تضع Netflix أجهزة Open Connect داخل شبكات مزوّدي الإنترنت بدل خدمة كل بث من مركز بيانات مركزي؟

It shortens the path to the viewer: fewer kilometres, so less propagation delay, and fewer hops, so less queueing. Playback starts quickly and does not buffer.
لأن ذلك يقصّر المسار إلى المشاهد: كيلومترات أقل تعني تأخير انتشار أقل، وقفزات أقل تعني انتظارًا أقل في الطوابير (queueing). فيبدأ التشغيل بسرعة ولا يتوقف للتحميل المؤقت (buffering).

Quick checkاختبار سريع

Why does caching a video at Layer 1 near the viewer reduce buffering?لماذا يقلّل تخزين الفيديو مؤقتًا في الطبقة 1 قرب المشاهد من التوقف للتحميل المؤقت (buffering)؟

To reason about placement you need names for the stops. Follow one request from a smart doorbell outward. The doorbell's own small chip decides that the button was pressed. The event goes to your home Wi-Fi router. From there it reaches a site run by your mobile or broadband operator nearby, for example an AWS Wavelength Zone, which places AWS compute and storage at the edge of a carrier's 5G network. Next it may reach a metro micro data center that collects events from many homes. Finally it lands in an AWS Region, inside one of its Availability Zones.

لكي تفكر في التوزيع تحتاج أسماءً للمحطات. تتبّع طلبًا واحدًا من جرس باب ذكي إلى الخارج. الشريحة الصغيرة داخل الجرس نفسه تقرر أن الزر قد ضُغط. ينتقل الحدث إلى موجّه Wi-Fi في بيتك. ومن هناك يصل إلى موقع قريب يشغّله مشغّل شبكة الجوال أو النطاق العريض، مثل AWS Wavelength Zone، التي تضع حوسبة وتخزين AWS على حافة شبكة 5G الخاصة بشركة الاتصالات. بعد ذلك قد يصل إلى مركز بيانات مصغّر على مستوى المدينة يجمع الأحداث من بيوت كثيرة. وأخيرًا يستقر في AWS Region، داخل إحدى مناطق التوافر (Availability Zones) فيها.

Those stops group into three coarse layers. The Cloud is farthest from the client. The Fog is the middle: mini data centers or intermediate nodes that process data partially. The Edge is closest to the client. Each Layer then splits into sublayers, which gives a seven-stage chain:

هذه المحطات تتجمّع في ثلاث طبقات عامة. cloud (السحابة) هي الأبعد عن العميل. fog (الضباب) في الوسط: مراكز بيانات مصغّرة أو عُقد وسيطة تعالج البيانات جزئيًا. edge (الحافة) هي الأقرب إلى العميل. ثم تنقسم كل layer إلى طبقات فرعية، فتنتج سلسلة من سبع مراحل:

  1. Device: the phone, sensor or doorbell itself.Device (الجهاز): الهاتف أو المستشعر أو جرس الباب نفسه.
  2. Mist: tiny compute on or right beside the device.Mist (الضباب الخفيف): حوسبة صغيرة جدًا على الجهاز أو بجانبه مباشرة.
  3. Near edge: the home router or on-premises gateway.الحافة القريبة (Near edge): موجّه البيت أو بوابة داخل المنشأة (on-premises gateway).
  4. Far edge: a nearby telco data center or carrier site.الحافة البعيدة (Far edge): مركز بيانات قريب لشركة اتصالات أو موقع تابع للمشغّل.
  5. Fog: metro nodes, micro data centers and aggregation nodes.الضباب (Fog): عُقد حضرية ومراكز بيانات مصغّرة وعُقد تجميع (aggregation nodes).
  6. Regional cloud: a cloud region close to the user's country.السحابة الإقليمية (Regional cloud): منطقة سحابية قريبة من بلد المستخدم.
  7. Cloud: the full hyperscale infrastructure of availability zones and regions.السحابة (Cloud): البنية التحتية الضخمة الكاملة (hyperscale) من مناطق التوافر والمناطق.
Seven stages light up outward from the device, then fold into three layers: edge, fog and cloud.سبع مراحل تضيء واحدة تلو الأخرى من الجهاز إلى الخارج، ثم تنطوي في ثلاث طبقات: الحافة والضباب والسحابة.

The chain is a spectrum, not a set of sealed boxes, which is exactly why it is called a continuum. Each stage is simply one more Server layer where you could run part of your application, and the boundaries between neighbouring stages are soft.

السلسلة طيف متدرّج، وليست مجموعة صناديق مغلقة، ولهذا بالضبط تُسمّى سلسلة متصلة (continuum). كل مرحلة هي ببساطة server layer إضافية يمكنك أن تشغّل عليها جزءًا من تطبيقك، والحدود بين المراحل المتجاورة مرنة وغير حادة.

The standards agree on the shape and admit the edges are fuzzy. The term fog comes from Bonomi and colleagues at Cisco in 2012, who wrote that fog computing extends the cloud paradigm to the edge of the network. NIST SP 500-325 later formalised it: fog nodes sit between smart end devices and centralised cloud services, and can be physical (gateways, switches, routers, servers) or virtual (virtual switches, virtual machines, cloudlets). It describes mist as a lightweight, rudimentary form of fog computing that uses microcomputers and microcontrollers to feed fog nodes, and it does not treat mist as a mandatory layer.

المعايير تتفق على الشكل العام وتعترف بأن الحدود ضبابية. مصطلح fog جاء من Bonomi وزملائه في Cisco عام 2012، إذ كتبوا أن حوسبة الضباب تمدّ نموذج السحابة إلى حافة الشبكة. ثم صاغته وثيقة NIST SP 500-325 رسميًا: عُقد الضباب تقع بين الأجهزة الطرفية الذكية وخدمات السحابة المركزية، ويمكن أن تكون مادية (بوابات، مبدّلات، موجّهات، خوادم) أو افتراضية (مبدّلات افتراضية، أجهزة افتراضية، cloudlets). وتصف الوثيقة mist بأنه شكل خفيف وبدائي من حوسبة الضباب يستخدم حواسيب صغيرة (microcomputers) ومتحكمات دقيقة (microcontrollers) لتغذية عُقد الضباب، ولا تعدّه طبقة إلزامية.

The cloud sublayers, preciselyالطبقات الفرعية للسحابة بدقة

Unlike fog and mist, the cloud's own sublayers have exact definitions from the providers. Learn them from AWS, since the terms are used across the industry.

على عكس fog وmist، للطبقات الفرعية للسحابة تعريفات دقيقة من مزوّدي الخدمة. تعلّمها من AWS، لأن هذه المصطلحات مستخدمة في الصناعة كلها.

Cloud sublayers as AWS defines themالطبقات الفرعية للسحابة كما تعرّفها AWS

Regionالمنطقة (Region)
A separate geographic area that contains several isolated availability zones.منطقة جغرافية منفصلة تضم عدة مناطق توافر (availability zones) معزولة.
Availability Zone (AZ)منطقة التوافر (AZ)
One or more discrete data centers with redundant power, networking and connectivity inside a Region.مركز بيانات منفصل واحد أو أكثر، بطاقة وشبكات واتصال احتياطية (redundant)، داخل Region.
Distance between AZsالمسافة بين مناطق التوافر
Within 100 km (60 miles) of each other in the same Region.ضمن 100 km (60 miles) من بعضها داخل Region نفسها.
Global footprintالانتشار العالمي
124 AZs in 39 Regions at the time of writing. This count grows over time.124 منطقة توافر في 39 منطقة (Region) وقت كتابة هذا النص. وهذا العدد يزداد مع الوقت.

Real products at each layerمنتجات حقيقية في كل طبقة

Commercial offerings make the stages concrete. Notice that the far edge alone has two flavours: sites inside a carrier's network, and sites in metro data centers near large populations.

العروض التجارية تجعل المراحل ملموسة. لاحظ أن الحافة البعيدة وحدها لها نوعان: مواقع داخل شبكة شركة الاتصالات، ومواقع في مراكز بيانات حضرية قرب التجمعات السكانية الكبيرة.

LayerالطبقةProduct or standardالمنتج أو المعيارWhat it isما هو
Far edge, telcoالحافة البعيدة، شركة اتصالاتAWS WavelengthAWS WavelengthAWS compute and storage deployed at the edge of carriers' 5G networks, managed from the parent Region.حوسبة وتخزين من AWS منشورة على حافة شبكات 5G لشركات الاتصالات، وتُدار من المنطقة الأم (parent Region).
Far edge, metroالحافة البعيدة، حضريةAWS Local ZonesAWS Local ZonesAWS resources placed close to large population and industry centres for low-latency applications such as real-time gaming, live streaming and AR/VR.موارد AWS موضوعة قرب التجمعات السكانية والصناعية الكبيرة لتطبيقات منخفضة زمن الاستجابة، مثل الألعاب اللحظية والبث المباشر وAR/VR.
Far edge, metroالحافة البعيدة، حضريةCloudflare WorkersCloudflare WorkersCode runs in lightweight isolates across 348 cities; about 95% of the connected population is within 50 ms of a Cloudflare data center.يعمل الكود داخل isolates خفيفة موزعة على 348 مدينة، ونحو 95% من السكان المتصلين بالإنترنت يقعون ضمن 50 ms من أحد مراكز بيانات Cloudflare.
On-premises edge or fogحافة داخل المنشأة أو ضبابAzure Stack EdgeAzure Stack Edge1U rack appliances with 1 to 2 NVIDIA T4 GPUs, used in Azure private multi-access edge compute (MEC, the architecture standardised by ETSI).أجهزة بحجم 1U في الرف، فيها من 1 إلى 2 وحدة NVIDIA T4 GPU، تُستخدم في Azure private multi-access edge compute (MEC، وهي البنية التي وحّدت معاييرها ETSI).
CloudالسحابةAWS Regions and AZsAWS Regions and AZsFull data centers, 124 AZs worldwide, for pooled compute and long-term storage.مراكز بيانات كاملة، 124 منطقة توافر حول العالم، للحوسبة المجمّعة والتخزين طويل الأمد.
Where commercial edge and cloud offerings sit on the chainأين تقع عروض الحافة والسحابة التجارية على السلسلة

Recall

List the seven stages of the E2C chain in order from the user outward, and name the sublayers of the cloud.اذكر المراحل السبع لسلسلة E2C بالترتيب من المستخدم إلى الخارج، وسمِّ الطبقات الفرعية للسحابة.

Device, mist, near edge, far edge, fog, regional cloud, cloud. The cloud is divided into regions, and each region into availability zones.
Device, mist, near edge, far edge, fog, regional cloud, cloud. السحابة مقسّمة إلى مناطق (regions)، وكل منطقة مقسّمة إلى مناطق توافر (availability zones).

Quick checkاختبار سريع

On the lecture's seven-stage chain, which example belongs to the far edge?في سلسلة المراحل السبع في المحاضرة، أي مثال ينتمي إلى الحافة البعيدة؟

Names alone do not tell you where to run anything. What makes the continuum useful is that every stage offers a different bargain, and the bargain changes steadily as you move outward. Put a real part at each layer and the bargain becomes concrete. A Raspberry Pi Pico can decide "button pressed, turn on the light" instantly, and not much more; an AWS Region pools entire data centers. The steps between them fill in the gradient.

الأسماء وحدها لا تخبرك أين تشغّل أي شيء. ما يجعل السلسلة المتصلة مفيدة هو أن كل مرحلة تقدّم صفقة مختلفة، وأن هذه الصفقة تتغير بانتظام كلما تحركت للخارج. ضع قطعة حقيقية في كل طبقة فتصبح الصفقة ملموسة. لوحة Raspberry Pi Pico تستطيع أن تقرر «الزر ضُغط، أشعل الضوء» فورًا، ولا أكثر من ذلك بكثير، بينما AWS Region تجمع مراكز بيانات كاملة. والخطوات بينهما تملأ هذا التدرّج.

LocationالموقعProximityالقربResourcesالمواردTypical roleالدور المعتادExample hardwareمثال على العتادVerified specمواصفات موثّقة
MistMistClosestالأقربVery limitedمحدودة جدًاImmediate, local decisionsقرارات محلية فوريةRaspberry Pi Pico (RP2040)Raspberry Pi Pico (RP2040)133 MHz, 264 kB SRAM, 2 MB flash133 MHz، و264 kB من SRAM، و2 MB من ذاكرة flash
Near edgeالحافة القريبةVery closeقريبة جدًاLimited to moderateمحدودة إلى متوسطةLocal processingمعالجة محليةRaspberry Pi 4 Model BRaspberry Pi 4 Model B4 cores at 1.8 GHz, 1 to 8 GB RAM4 أنوية بتردد 1.8 GHz، ومن 1 إلى 8 GB من RAM
Far edgeالحافة البعيدةCloseقريبةModerate to highمتوسطة إلى عاليةLow-latency applicationsتطبيقات منخفضة زمن الاستجابةJetson Orin Nano Super, or a Wavelength Zone instanceJetson Orin Nano Super، أو خادم في Wavelength Zone67 TOPS, 8 GB RAM, 7 to 25 W67 TOPS، و8 GB من RAM، ومن 7 إلى 25 W
Fog or regionalالضباب أو الإقليميةIntermediateمتوسطةHighعاليةAggregation and coordinationالتجميع والتنسيقMetro micro data center, or an on-premises Azure Stack Edge appliance at a large siteمركز بيانات مصغّر في المدينة، أو جهاز Azure Stack Edge داخل منشأة كبيرة1U with 1 to 2 NVIDIA T4 GPUs1U مع 1 إلى 2 وحدة NVIDIA T4 GPU
CloudالسحابةDistantبعيدةVery highعالية جدًاLarge-scale computation and storageحوسبة وتخزين واسعا النطاقAWS RegionAWS Region124 AZs, each one or more data centers124 منطقة توافر، كل منها مركز بيانات واحد أو أكثر
The layers compared, with real hardwareمقارنة الطبقات بعتاد حقيقي

Two gradients running in opposite directionsتدرّجان في اتجاهين متعاكسين

Read the table top to bottom and two things change together. Proximity falls and resources rise. Each step outward serves more users over a wider area with bigger hardware, but sits further away. Bonomi and colleagues put it in one line: the higher the tier, the wider the geographical coverage and the longer the time scale.

اقرأ الجدول من الأعلى إلى الأسفل وستجد أمرين يتغيران معًا: القرب يقل والموارد تزيد. كل خطوة للخارج تخدم عددًا أكبر من المستخدمين على مساحة أوسع بأجهزة أكبر، لكنها أبعد. لخّص Bonomi وزملاؤه ذلك في سطر واحد: كلما ارتفعت الطبقة (tier) اتسعت التغطية الجغرافية وطال المقياس الزمني.

Resources rise from mist to cloud while proximity falls. The two guide lines slope in opposite directions: each step outward trades proximity for resources.الموارد ترتفع من mist إلى السحابة بينما يقل القرب. الخطّان الإرشاديان يميلان في اتجاهين متعاكسين: كل خطوة للخارج تبادل القرب بالموارد.

The role column follows from the resources column. An immediate decision needs no network at all, so it can live on a tiny chip. Aggregation needs a view of many sources, so it lives where many streams meet. Large-scale computation needs pooled capacity, so it lives in a data center. In Bonomi's smart grid example, the first tier runs control loops that react in milliseconds to sub-seconds, higher tiers run real-time analytics over seconds to minutes and transactional analytics over days, and the cloud keeps the data that must last.

عمود الدور ينتج من عمود الموارد. القرار الفوري لا يحتاج إلى شبكة إطلاقًا، لذلك يمكن أن يعيش على شريحة صغيرة. التجميع (aggregation) يحتاج رؤية لمصادر كثيرة، لذلك يعيش حيث تلتقي تدفقات كثيرة. والحوسبة واسعة النطاق تحتاج سعة مجمّعة، لذلك تعيش في مركز بيانات. في مثال الشبكة الكهربائية الذكية عند Bonomi، الطبقة الأولى تشغّل حلقات تحكم (control loops) تستجيب خلال مللي ثوانٍ إلى أجزاء من الثانية، والطبقات الأعلى تشغّل تحليلات لحظية على مدى ثوانٍ إلى دقائق وتحليلات معاملاتية على مدى أيام، والسحابة تحفظ البيانات التي يجب أن تدوم.

Why the latency side of the trade is physicsلماذا يحكم الفيزياء جانبَ زمن الاستجابة في المقايضة

The cost of moving outward is latency, and a head-tracked virtual reality headset shows how hard that cost can bite. Satyanarayanan reports that the display must respond to head movement in under 16 ms to feel stable. Citing Ang Li and colleagues, he gives an average round-trip time of 74 ms from 260 vantage points to their best Amazon EC2 data center, before the wireless first hop is even added. A VR application that renders in a distant cloud region therefore cannot meet its target, whatever the server does. The same application rendering on a cloudlet or far edge site one or two hops away can.

ثمن التحرك للخارج هو زمن الاستجابة، ونظارة واقع افتراضي تتبع حركة الرأس توضح كم يمكن أن يكون هذا الثمن قاسيًا. يذكر Satyanarayanan أن الشاشة يجب أن تستجيب لحركة الرأس في أقل من 16 ms لتبدو مستقرة. ونقلًا عن Ang Li وزملائه، يذكر متوسط زمن ذهاب وإياب (RTT) قدره 74 ms من 260 نقطة قياس إلى أفضل مركز بيانات Amazon EC2 لكل منها، وذلك قبل إضافة القفزة اللاسلكية الأولى أصلًا. لذلك فإن تطبيق واقع افتراضي يرسم الصور في منطقة سحابية بعيدة لا يمكنه بلوغ هدفه مهما فعل الخادم. أما التطبيق نفسه إذا رسم على cloudlet أو موقع حافة بعيدة على بعد قفزة أو قفزتين فيستطيع ذلك.

The reason comes straight from the previous part. The one-way latency to a layer can never be lower than the Latency lower bound, the distance divided by the speed of light. On top of that, every router on the way adds Queueing delay and processing. The Edge is one or a few hops away, the Fog is a metro away, and the Cloud may be a continent away. So latency, like resources, grows as you move outward: small at the edge, medium in the fog, large in the cloud.

السبب يأتي مباشرة من الجزء السابق. زمن الاستجابة باتجاه واحد إلى أي طبقة لا يمكن أبدًا أن يكون أقل من latency lower bound، أي المسافة مقسومة على سرعة الضوء. وفوق ذلك، كل موجّه على الطريق يضيف queueing delay ووقت معالجة. edge على بعد قفزة أو قفزات قليلة، وfog على بعد مدينة، وcloud قد تكون على بعد قارة. لذلك فإن زمن الاستجابة، مثل الموارد، يزداد كلما تحركت للخارج: صغير على الحافة، ومتوسط في الضباب، وكبير في السحابة.

Three rays leave the client together. The edge ray arrives first and the cloud ray last. Labels show one-way propagation in fibre to a nearby edge, a metro fog node and a distant cloud region.ثلاثة أشعة تنطلق من العميل معًا. شعاع الحافة يصل أولًا وشعاع السحابة أخيرًا. التسميات تُظهر زمن الانتشار باتجاه واحد في الألياف الضوئية إلى حافة قريبة، وعقدة ضباب في المدينة، ومنطقة سحابية بعيدة.

Worked exampleمثال محلول

Propagation delay to each layer, in fibreتأخير الانتشار إلى كل طبقة عبر الألياف الضوئية

  1. Pick the speedاختر السرعة

    Light in optical fibre travels at about 200,000 km/s, roughly two thirds of its speed in vacuum. The glossary's lower bound uses 300,000 km/s for vacuum; this example uses fibre because real links are fibre.
    ينتقل الضوء في الألياف الضوئية بسرعة تقارب 200,000 km/s، أي نحو ثلثي سرعته في الفراغ. الحد الأدنى في المسرد يستخدم 300,000 km/s للفراغ، أما هذا المثال فيستخدم الألياف لأن الروابط الحقيقية من الألياف.
  2. Apply the formulaطبّق القانون

    dprop=distancespeedd_{prop} = \dfrac{\text{distance}}{\text{speed}}
    One-way propagation delayتأخير الانتشار في اتجاه واحد
    dprop=distancespeedd_{prop} = \dfrac{\text{distance}}{\text{speed}}
    One-way propagation delayتأخير الانتشار في اتجاه واحد
  3. Edge and fogالحافة والضباب

    An edge node 1 km away gives about 0.005 ms. A fog node in the same metro, 50 km away, gives 0.25 ms.
    عقدة حافة على بعد 1 km تعطي نحو 0.005 ms. وعقدة ضباب في المدينة نفسها، على بعد 50 km، تعطي 0.25 ms.
  4. Cloudالسحابة

    Assume a Gulf cloud region about 1,000 km of fibre away: 5 ms. Assume a US east coast region about 13,000 km of cable away (the straight-line distance is about 10,900 km, and cables do not follow straight lines): 65 ms one way, about 130 ms there and back.
    افترض منطقة سحابية خليجية على بعد نحو 1,000 km من الألياف: 5 ms. وافترض منطقة على الساحل الشرقي للولايات المتحدة على بعد نحو 13,000 km من الكابلات (المسافة بخط مستقيم نحو 10,900 km، والكابلات لا تسير في خطوط مستقيمة): 65 ms باتجاه واحد، أي نحو 130 ms ذهابًا وإيابًا.
  5. Resultالنتيجة

    Propagation alone spans more than four orders of magnitude across the continuum. Queueing and processing at every hop come on top, and there are more hops to the cloud, so the real gap is usually even wider.
    الانتشار وحده يمتد عبر أكثر من أربع رتب عشرية (orders of magnitude) على طول السلسلة. ويُضاف فوقه الانتظار في الطوابير والمعالجة عند كل قفزة، والقفزات إلى السحابة أكثر، لذلك تكون الفجوة الحقيقية عادة أوسع.

How low is low enough? Human perception gives useful targets. Satyanarayanan cites that people take about 370 to 620 ms to recognise a face and 300 to 450 ms to recognise speech, but only about 4 ms to tell that a sound is a human voice. He concludes that an end-to-end latency of a few tens of milliseconds is a safe but achievable goal. That is what a far edge footprint buys: Cloudflare reports that 95% of the connected population is within 50 ms of one of its data centers, and most are within 20 ms.

ما مدى الانخفاض الكافي؟ الإدراك البشري يعطي أهدافًا مفيدة. ينقل Satyanarayanan أن الإنسان يحتاج نحو 370 إلى 620 ms للتعرف على وجه، و300 إلى 450 ms للتعرف على الكلام، لكنه يحتاج نحو 4 ms فقط ليعرف أن صوتًا ما صوت إنسان. ويستنتج أن زمن استجابة من طرف إلى طرف يبلغ بضع عشرات من المللي ثانية هدف آمن وقابل للتحقيق. وهذا ما يشتريه انتشار الحافة البعيدة: تذكر Cloudflare أن 95% من السكان المتصلين بالإنترنت يقعون ضمن 50 ms من أحد مراكز بياناتها، وأن معظمهم ضمن 20 ms.

One nuance matters at PhD level. "Close" is about the network, not just the map. Satyanarayanan defines logical proximity by low latency, low jitter and high bandwidth, and warns that the question "how close is physically close enough?" has no abstract answer. A fog node behind a congested link can respond more slowly than a well-connected cloud availability zone, so the small, medium and large ordering is typical, not guaranteed.

هناك دقيقة مهمة على مستوى الدكتوراه. «القرب» يتعلق بالشبكة، لا بالخريطة فقط. يعرّف Satyanarayanan القرب المنطقي (logical proximity) بزمن استجابة منخفض وتذبذب منخفض (jitter) وعرض نطاق مرتفع، ويحذّر من أن سؤال «ما مدى القرب المادي الكافي؟» ليس له جواب مجرد. عقدة ضباب خلف رابط مزدحم قد تستجيب أبطأ من منطقة توافر سحابية متصلة جيدًا، لذلك فإن ترتيب صغير ثم متوسط ثم كبير هو الحالة المعتادة، وليس مضمونًا.

Recall

As you move from mist to cloud, what happens to proximity, resources, latency and the typical role?عندما تنتقل من mist إلى السحابة، ماذا يحدث للقرب والموارد وزمن الاستجابة والدور المعتاد؟

Proximity falls from closest to distant, so latency rises. Resources rise from very limited to very high. The role shifts from immediate local decisions, to local processing, to low-latency applications, to aggregation and coordination, to large-scale computation and storage.
القرب يقل من الأقرب إلى البعيد، فيزداد زمن الاستجابة. والموارد تزيد من محدودة جدًا إلى عالية جدًا. والدور ينتقل من القرارات المحلية الفورية، إلى المعالجة المحلية، إلى التطبيقات منخفضة زمن الاستجابة، إلى التجميع والتنسيق، إلى الحوسبة والتخزين واسعَي النطاق.

Recall

Why can a head-tracked VR application not rely on a distant cloud region?لماذا لا يستطيع تطبيق واقع افتراضي يتتبع حركة الرأس الاعتماد على منطقة سحابية بعيدة؟

It needs under 16 ms for perceptual stability. The average round trip to the best EC2 data center, measured from 260 vantage points, was 74 ms, before the wireless hop. Propagation delay cannot be engineered away, so the rendering must move closer to the user.
لأنه يحتاج أقل من 16 ms للاستقرار الإدراكي. متوسط زمن الذهاب والإياب إلى أفضل مركز بيانات EC2، مقاسًا من 260 نقطة قياس، كان 74 ms، وذلك قبل القفزة اللاسلكية. وتأخير الانتشار لا يمكن إزالته بالهندسة، لذلك يجب نقل الرسم (rendering) إلى مكان أقرب من المستخدم.

Quick checkاختبار سريع

Which ordering lists layers from the fewest resources to the most?أي ترتيب يسرد الطبقات من الأقل موارد إلى الأكثر؟

Quick checkاختبار سريع

A factory robot arm must stop within milliseconds when a person steps into its path. Where should the stop decision run?ذراع روبوت في مصنع يجب أن يتوقف خلال مللي ثوانٍ عندما يدخل شخص مساره. أين يجب أن يعمل قرار الإيقاف؟

You now have both halves of the trade: processing power and storage increase from edge to fog to cloud, in the same direction as latency. Every step toward the cloud buys capacity and costs latency. That turns placement into a real decision, and the decision has three inputs: the latency requirement of the task, its processing and storage needs, and cost.

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

Picture a neighbourhood of smart doorbell cameras. Each camera, at the Edge, compares consecutive frames to detect motion, which is cheap arithmetic, and sends nothing while nothing moves. A fog node in the neighbourhood combines motion events from 200 cameras and door sensors to spot a pattern across streets, which is sensor data processing. The Cloud trains and hosts the large recognition model and keeps months of clips. One application, three layers, each doing the part it is equipped for.

تخيّل حيًّا مليئًا بكاميرات أجراس أبواب ذكية. كل كاميرا، على edge، تقارن الإطارات المتتالية لاكتشاف الحركة، وهذه عمليات حسابية رخيصة، ولا ترسل شيئًا طالما لا شيء يتحرك. عقدة ضباب (fog node) في الحي تجمع أحداث الحركة من 200 كاميرا ومستشعر أبواب لتكتشف نمطًا عبر الشوارع، وهذه معالجة لبيانات المستشعرات. وcloud تدرّب نموذج التعرّف الكبير وتستضيفه وتحتفظ بمقاطع شهور. تطبيق واحد، ثلاث طبقات، كل منها تنفذ الجزء المجهّزة له.

Each task drops into hardware that can carry it: motion detection on a board, aggregation in a mini data center, AI in a data center.كل مهمة تستقر في عتاد قادر على حملها: اكتشاف الحركة على لوحة، والتجميع في مركز بيانات مصغّر، والذكاء الاصطناعي في مركز بيانات.

The pattern generalises into a rule of thumb: put each task on the layer closest to the client that still has enough resources for it, and push data outward only when you need more compute, more storage or a wider view. Bonomi and colleagues describe the fog tier doing exactly this, filtering data to be consumed locally and sending the rest to higher tiers. Filtering early also saves bandwidth, since raw video is expensive to ship; Satyanarayanan lists scalability through edge analytics as a key benefit of cloudlets. Splitting one Service pipeline across layers like this is what the next part calls a Mapping.

هذا النمط يتعمّم إلى قاعدة عملية: ضع كل مهمة على الطبقة الأقرب إلى العميل التي ما زالت تملك موارد كافية لها، وادفع البيانات للخارج فقط عندما تحتاج حوسبة أكثر أو تخزينًا أكثر أو رؤية أوسع. يصف Bonomi وزملاؤه طبقة الضباب وهي تفعل هذا بالضبط: تصفّي البيانات ليُستهلك بعضها محليًا وترسل الباقي إلى الطبقات الأعلى. والتصفية المبكرة توفّر عرض النطاق أيضًا، لأن نقل الفيديو الخام مكلف، ويذكر Satyanarayanan قابلية التوسع عبر التحليلات على الحافة (edge analytics) كفائدة رئيسية لـcloudlets. وتقسيم pipeline واحد عبر الطبقات بهذه الطريقة هو ما يسميه الجزء التالي mapping.

TaskالمهمةLayerالطبقةWhy hereلماذا هنا
Detect motion in each frameاكتشاف الحركة في كل إطارEdge (on the camera)الحافة (على الكاميرا)Must react instantly, needs little compute, avoids sending idle video.يجب أن تستجيب فورًا، وتحتاج حوسبة قليلة، وتتجنب إرسال فيديو خامل.
Correlate events from many homesربط الأحداث القادمة من بيوت كثيرةFog (neighbourhood node)الضباب (عقدة الحي)Needs a view of many sources and moderate compute, still close enough for timely alerts.تحتاج رؤية لمصادر كثيرة وحوسبة متوسطة، وما زالت قريبة بما يكفي لتنبيهات في الوقت المناسب.
Train and host the recognition model, archive clipsتدريب نموذج التعرّف واستضافته، وأرشفة المقاطعCloudالسحابةNeeds pooled compute and very large storage; latency is not critical.تحتاج حوسبة مجمّعة وتخزينًا كبيرًا جدًا، وزمن الاستجابة ليس حرجًا.
The doorbell pipeline, placed by the ruleخط معالجة جرس الباب، موزّعًا حسب القاعدة

Treat the typical roles (motion at the edge, sensor processing in the fog, AI in the cloud) as tendencies, not rules. Training and very large models belong in the cloud, but inference increasingly runs at the edge: a Jetson Orin Nano Super delivers 67 TOPS within 7 to 25 W. Edge platforms are not unlimited either. A Cloudflare Worker gets 128 MB of memory per isolate and, on the free plan, 10 ms of CPU time per request.

تعامل مع الأدوار المعتادة (الحركة على الحافة، ومعالجة المستشعرات في الضباب، والذكاء الاصطناعي في السحابة) على أنها ميول، لا قواعد. التدريب والنماذج الكبيرة جدًا مكانها السحابة، لكن الاستدلال (inference) يعمل على الحافة بشكل متزايد: لوحة Jetson Orin Nano Super تقدّم 67 TOPS ضمن 7 إلى 25 W. ومنصات الحافة ليست بلا حدود أيضًا: Cloudflare Worker يحصل على 128 MB من الذاكرة لكل isolate، وعلى الخطة المجانية 10 ms من وقت المعالج لكل طلب.

Cost is the third axis. AWS states that Local Zone resources are priced differently from the same resources in their parent Region. Red Hat describes the move toward the edge as an increase in the number of distributed locations but a decrease in each location's size, which means many small sites to buy, power and manage.

التكلفة هي المحور الثالث. تذكر AWS أن موارد Local Zone تُسعَّر بشكل مختلف عن الموارد نفسها في المنطقة الأم (parent Region). وتصف Red Hat التحرك نحو الحافة بأنه زيادة في عدد المواقع الموزعة مع نقص في حجم كل موقع، أي مواقع صغيرة كثيرة يجب شراؤها وتزويدها بالطاقة وإدارتها.

SimulatorمحاكيMap a pipeline onto the continuumوزّع خط معالجة على السلسلة المتصلة (continuum)
  1. T1Image resizeتصغير الصورةPT 8 ms
  2. T2Object detectionاكتشاف الأجسامPT 40 ms
  3. T3Draw boxesرسم المربعاتPT 8 ms
150 ms
Networkالشبكة40ms
Response timeزمن الاستجابة96ms
Within budgetضمن الميزانية RT ≤ 150 ms
τ
networkالشبكة 40 ms · 42%processingالمعالجة 56 ms · 58%

Formulaالمعادلة

RT = Σ one-way hops + Σ PT

RT = (5 + 15 + 15 + 5) + (8 + 40 + 8) = 96 ms

Client→Edge 5 · Edge→Fog 15 · Fog→Edge 15 · Edge→Client 5

Each hop costs the difference between the one-way latencies of the two layers: Device 0, Edge 5, Fog 20, Cloud 70 ms from the client.تكلفة كل قفزة (hop) هي الفرق بين زمني الانتقال أحادي الاتجاه للطبقتين: الجهاز (Device) 0، والحافة (Edge) 5، والضباب (Fog) 20، والسحابة (Cloud) 70 ms من العميل.

Recall

What three factors decide where a task is placed, and what is the placement rule?ما العوامل الثلاثة التي تحدد مكان وضع المهمة، وما قاعدة التوزيع؟

Latency requirement, processing and storage need, and cost. Place each task on the layer closest to the client that still has enough resources, and forward only what needs more.
متطلب زمن الاستجابة، والحاجة إلى المعالجة والتخزين، والتكلفة. ضع كل مهمة على الطبقة الأقرب إلى العميل التي ما زالت تملك موارد كافية، ومرّر فقط ما يحتاج أكثر من ذلك.

Quick checkاختبار سريع

The lecture places 'running AI models' in the cloud. What is the strongest reason for that placement?تضع المحاضرة «تشغيل نماذج الذكاء الاصطناعي» في السحابة. ما أقوى سبب لهذا الاختيار؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • The server side is a continuum: device, mist, near edge, far edge, fog, regional cloud, cloud.جانب الخادم سلسلة متصلة: الجهاز، الضباب الخفيف (mist)، الحافة القريبة، الحافة البعيدة، الضباب (fog)، السحابة الإقليمية، السحابة.
  • Three coarse layers: cloud splits into regions and availability zones, fog into metro nodes and micro data centers, edge into mist, near and far.ثلاث طبقات عامة: السحابة تنقسم إلى مناطق (regions) ومناطق توافر (availability zones)، والضباب إلى عُقد حضرية ومراكز بيانات مصغّرة، والحافة إلى mist وقريبة وبعيدة.
  • Proximity and resources pull in opposite directions: the closer the layer, the lower the latency and the smaller the hardware.القرب والموارد يتجهان في اتجاهين متعاكسين: كلما اقتربت الطبقة قلّ زمن الاستجابة وصغرت الأجهزة.
  • Latency to the cloud is bounded by physics. Only moving work closer removes propagation delay.زمن الاستجابة إلى السحابة تحدّه الفيزياء. نقل العمل إلى مكان أقرب هو الطريقة الوحيدة لإزالة تأخير الانتشار.
  • Place each task on the closest layer that has enough resources, and forward only what needs more.ضع كل مهمة على أقرب طبقة تملك موارد كافية لها، ومرّر للخارج فقط ما يحتاج أكثر من ذلك.
  • Real anchors: AWS Wavelength and Local Zones, Cloudflare Workers and Azure Stack Edge (ETSI MEC) at the edge; AWS Regions and availability zones in the cloud.أمثلة حقيقية: AWS Wavelength و Local Zones و Cloudflare Workers و Azure Stack Edge (ETSI MEC) على الحافة، ومناطق AWS ومناطق التوافر فيها على السحابة.
  • Near and far edge are relative terms. Check the viewpoint.الحافة القريبة والبعيدة مصطلحان نسبيان. تحقّق من زاوية النظر.

Sourcesالمصادر

Part 09: Mapping tasks and response timeتوزيع المهام وزمن الاستجابة

Four ways to place an object-detection pipeline on the continuum, how response time is computed, and why faster servers are not enough.أربع طرق لوضع خط معالجة لاكتشاف الأجسام (object detection) على السلسلة، وكيف يُحسب زمن الاستجابة (response time)، ولماذا لا تكفي الخوادم الأسرع وحدها.

6 concepts6 مفاهيم, ، slides 61-71الشرائح 61-71

Why this part mattersلماذا يهمّ هذا الجزء

Every edge versus cloud argument in this course, and every placement choice in your research project, reduces to one question: which layer runs which task, and what does that do to the time the user waits?

The last two parts gave you the layers of the continuum and the four delays that make up latency. This part puts them together. You get a small vocabulary (mapping, processing time, response time), one formula you will reuse in exams and papers, and four reference designs that show the same pipeline paying very different prices depending on where it runs.

كل نقاش بين الحافة والسحابة في هذا المقرر، وكل قرار عن مكان التشغيل في مشروعك البحثي، يعود إلى سؤال واحد: أي طبقة تشغّل أي مهمة، وما أثر ذلك على الوقت الذي ينتظره المستخدم؟

الجزءان السابقان أعطياك طبقات الاستمرارية والتأخيرات الأربعة التي يتكون منها زمن التأخير (latency). هذا الجزء يجمعهما معًا. ستحصل على مفردات قليلة (mapping وprocessing timeوresponse time)، ومعادلة واحدة ستعيد استخدامها في الاختبارات والأوراق البحثية، وأربعة تصاميم مرجعية تُظهر كيف يدفع خط المعالجة نفسه أثمانًا مختلفة جدًا بحسب مكان تشغيله.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Treat a mapping as a design decision that places each pipeline task on device, edge, fog or cloud.أن تتعامل مع التعيين (mapping) كقرار تصميمي يضع كل مهمة من مهام خط المعالجة على الجهاز أو الحافة أو الضباب أو السحابة.
  2. Compute response time as L1 + PT + L2 and read off how much of it is computation.أن تحسب زمن الاستجابة على أنه L1 + PT + L2 وتستخرج منه نسبة ما يذهب إلى الحوسبة.
  3. Argue with Amdahl's reasoning why a faster server barely helps a distant client, and what does help.أن تبرهن باستدلال Amdahl لماذا لا يفيد الخادم الأسرع العميل البعيد إلا قليلًا، وما الذي يفيد فعلًا.
  4. Weigh the four mappings against each other on latency, privacy, reach, scalability and transfer cost.أن توازن بين التعيينات الأربعة من حيث زمن التأخير والخصوصية ونطاق التغطية وقابلية التوسع وتكلفة نقل البيانات.
  5. Justify why most real systems pair edge with cloud and treat fog as an optional tier.أن تعلل لماذا تجمع معظم الأنظمة الحقيقية بين الحافة والسحابة وتعامل الضباب كطبقة اختيارية.

Picture a phone camera taking a street photo. Three things must happen before the user sees a useful result: the photo is shrunk to the size the model expects (T1, image resize), a model finds the cars and people in it (T2, object detection), and a box is drawn around each one (T3, drawing the bounding box).

تخيّل كاميرا هاتف تلتقط صورة لشارع. قبل أن يرى المستخدم نتيجة مفيدة يجب أن تحدث ثلاثة أشياء: تُصغَّر الصورة إلى الحجم الذي يتوقعه النموذج (T1، تغيير حجم الصورة)، ثم يكتشف نموذج السيارات والأشخاص فيها (T2، اكتشاف الأجسام)، ثم يُرسم مربع حول كل واحد منها (T3، رسم مربع الإحاطة).

Those three ordered steps form a service pipeline. The pipeline says what must happen and in what order. It says nothing about where. The edge-to-cloud continuum offers device, edge, fog and cloud, and each task can land on any of them. Choosing a Layer for every task is called a Mapping, and the rest of this part compares four such choices for the same three tasks.

هذه الخطوات الثلاث المرتبة تشكّل خط معالجة الخدمة (service pipeline). يحدد خط المعالجة ما يجب أن يحدث وبأي ترتيب، لكنه لا يقول شيئًا عن المكان. الاستمرارية من الحافة إلى السحابة (edge-to-cloud continuum) توفر الجهاز والحافة والضباب والسحابة، ويمكن أن تقع كل مهمة على أي منها. اختيار طبقة (layer) لكل مهمة يسمى تعيينًا (mapping)، وبقية هذا الجزء تقارن أربعة اختيارات من هذا النوع للمهام الثلاث نفسها.

The baseline: everything on one cloud serverخط الأساس: كل شيء على خادم سحابي واحد

The simplest mapping puts all three tasks on one Server in a distant Cloud data center. The Client only sends the photo and receives the finished image. Call this Mapping 1; it is the yardstick the other three are measured against.

أبسط تعيين يضع المهام الثلاث كلها على server واحد في مركز بيانات cloud بعيد. العميل (client) يرسل الصورة فقط ويستقبل الصورة النهائية. سنسمي هذا التعيين 1، وهو المقياس الذي تُقارَن به التعيينات الثلاثة الأخرى.

Client
Device

Sends the photo, shows the result

يرسل الصورة ويعرض النتيجة

Latency 1
Server
Cloud layer

T1 resize, then T2 detect, then T3 draw

T1 تغيير الحجم، ثم T2 الكشف، ثم T3 الرسم

Latency 2
Client
Device

Receives the boxed image

يتلقى الصورة مع المربعات المحيطة

Mapping 1: the client sends a photo to a cloud server that runs the whole pipelineالتعيين 1: يرسل العميل صورة إلى خادم سحابي يشغّل خط المعالجة بالكامل

Measuring what the user feelsقياس ما يشعر به المستخدم

To compare mappings you need one number that captures the user's experience. Start a stopwatch when the photo leaves the phone and stop it when the boxed image arrives back. That total is the Response time (RT), and it splits into three stretches: the request travels to the server (Latency 1), the server runs T1, T2 and T3 (the Processing time (PT)), and the result travels back (Latency 2).

لكي تقارن بين التعيينات تحتاج إلى رقم واحد يعبّر عن تجربة المستخدم. شغّل ساعة إيقاف عندما تغادر الصورة الهاتف، وأوقفها عندما تصل الصورة المؤطَّرة بالمربعات. هذا المجموع هو زمن الاستجابة (response time)، وينقسم إلى ثلاثة مقاطع: انتقال الطلب إلى الخادم (Latency 1)، وتشغيل الخادم للمهام T1 وT2 وT3 (زمن المعالجة (processing time))، ثم عودة النتيجة (Latency 2).

RT=L1+PT+L2RT = L_1 + PT + L_2
Response time seen by the clientزمن الاستجابة كما يراه العميل

Neither latency term is a single number from nature. From Part 7 you know each Latency is the sum of Propagation delay, Transmission delay, Queueing delay and Processing delay along every link and router on the path (Kurose and Ross). L1 plus L2 is roughly the round-trip time you would measure with ping, and PT is extra time inserted in the middle.

لا يوجد حدّ من حدود زمن التأخير هو رقم ثابت من الطبيعة. تعرف من الجزء 7 أن كل latency هو مجموع تأخير الانتشار (propagation delay) وتأخير الإرسال (transmission delay) وتأخير الانتظار في الطابور (queueing delay) وتأخير المعالجة (processing delay) على كل وصلة وموجّه في المسار (Kurose and Ross). مجموع L1 وL2 يساوي تقريبًا زمن الذهاب والإياب (round-trip time) الذي تقيسه بأمر ping، وPT وقت إضافي يُدرج في المنتصف.

The examples here treat L1 and L2 as equal only for simplicity. In practice they can differ: the request is often a small upload while the response is a large annotated image, and transmission delay grows with the number of bits pushed onto a link. Every mapping below is just a different way of making these terms bigger or smaller, which is why the formula is the lens for the whole part.

الأمثلة هنا تعامل L1 وL2 على أنهما متساويان للتبسيط فقط. في الواقع قد يختلفان: الطلب غالبًا رفع صغير بينما الاستجابة صورة كبيرة عليها تعليقات، وتأخير الإرسال يزداد مع عدد البتات المدفوعة على الوصلة. كل تعيين في الأقسام التالية هو ببساطة طريقة مختلفة لتكبير هذه الحدود أو تصغيرها، ولهذا فالمعادلة هي العدسة التي ننظر بها إلى الجزء كله.

SimulatorمحاكيMap a pipeline onto the continuumوزّع خط معالجة على السلسلة المتصلة (continuum)
  1. T1Image resizeتصغير الصورةPT 8 ms
  2. T2Object detectionاكتشاف الأجسامPT 40 ms
  3. T3Draw boxesرسم المربعاتPT 8 ms
150 ms
Networkالشبكة40ms
Response timeزمن الاستجابة96ms
Within budgetضمن الميزانية RT ≤ 150 ms
τ
networkالشبكة 40 ms · 42%processingالمعالجة 56 ms · 58%

Formulaالمعادلة

RT = Σ one-way hops + Σ PT

RT = (5 + 15 + 15 + 5) + (8 + 40 + 8) = 96 ms

Client→Edge 5 · Edge→Fog 15 · Fog→Edge 15 · Edge→Client 5

Each hop costs the difference between the one-way latencies of the two layers: Device 0, Edge 5, Fog 20, Cloud 70 ms from the client.تكلفة كل قفزة (hop) هي الفرق بين زمني الانتقال أحادي الاتجاه للطبقتين: الجهاز (Device) 0، والحافة (Edge) 5، والضباب (Fog) 20، والسحابة (Cloud) 70 ms من العميل.

Recall

Write the response time formula for Mapping 1 and say which terms the client cannot shorten by buying faster server hardware.اكتب معادلة زمن الاستجابة للتعيين 1، وبيّن أي الحدود لا يستطيع العميل تقصيرها بشراء عتاد خادم أسرع.

RT = L1 + PT + L2. A faster server only shrinks PT. L1 and L2 are network delays, bounded by distance and the speed of light, so server hardware does not touch them.
RT = L1 + PT + L2. الخادم الأسرع يقلّص PT فقط. أما L1 وL2 فهما تأخيرات شبكة تحدّها المسافة وسرعة الضوء، لذلك لا يؤثر فيهما عتاد الخادم.

The formula becomes a design argument once you put numbers in it. A client sits in New York and the server sits in a cloud data center in California. The request takes 70 ms to cross the country, the server works for 30 ms, and the reply takes another 70 ms.

تتحول المعادلة إلى حجة تصميمية عندما تضع فيها أرقامًا. عميل موجود في نيويورك والخادم في مركز بيانات سحابي في كاليفورنيا. يستغرق الطلب 70 ms لعبور البلاد، ويعمل الخادم لمدة 30 ms، ويستغرق الرد 70 ms أخرى.

Worked exampleمثال محلول

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

  1. Add the three termsاجمع الحدود الثلاثة

    70 + 30 + 70 = 170 ms. This is the response time the user feels.
    70 + 30 + 70 = 170 ms. هذا هو زمن الاستجابة الذي يشعر به المستخدم.
  2. Computation shareحصة الحوسبة

    30 / 170 ≈ 17.6%. The other 140 / 170 ≈ 82% is spent on the two network trips.
    30 / 170 ≈ 17.6%. أما الباقي 140 / 170 ≈ 82% فيُستهلك في رحلتي الشبكة.
  3. Double the server speedضاعف سرعة الخادم

    PT halves from 30 ms to 15 ms, so RT becomes 70 + 15 + 70 = 155 ms.
    ينخفض PT إلى النصف من 30 ms إلى 15 ms، فيصبح RT مساويًا 70 + 15 + 70 = 155 ms.
  4. Find the ceilingأوجد السقف

    Even an infinitely fast server leaves 70 + 0 + 70 = 140 ms, a best-case speedup of only 170 / 140 ≈ 1.21x.
    حتى الخادم ذو السرعة اللانهائية يترك 70 + 0 + 70 = 140 ms، أي أن أفضل تسريع ممكن هو 170 / 140 ≈ 1.21x فقط.
  5. Resultالنتيجة

    About 9% faster (170 / 155 ≈ 1.097x) for twice the compute.
    أسرع بنحو 9% فقط (170 / 155 ≈ 1.097x) مقابل مضاعفة الحوسبة.
Network trips fill most of the 170 ms bar. Halving PT only moves the end from 170 ms to 155 ms, close to the 140 ms floor.رحلات الشبكة تملأ معظم شريط الـ 170 ms. تنصيف PT ينقل النهاية فقط من 170 ms إلى 155 ms، قريبًا من الحد الأدنى 140 ms.

Amdahl's argument, moved onto the networkحجة Amdahl منقولة إلى الشبكة

The disappointing result is not a quirk of these numbers. In 1967 Gene Amdahl pointed out that the part of a job you do not speed up places an upper limit on the overall gain, so effort on one part "is wasted unless it is accompanied by achievements" of similar size in the rest (Amdahl, 1967). Amdahl wrote no equation; the usual textbook form is below, where f is the fraction of time you improve and k is how much faster that part becomes.

هذه النتيجة المخيبة ليست مصادفة خاصة بهذه الأرقام. في عام 1967 أشار Gene Amdahl إلى أن الجزء الذي لا تسرّعه من العمل يضع حدًا أعلى للمكسب الكلي، لذلك فإن الجهد المبذول على جزء واحد "is wasted unless it is accompanied by achievements" (يضيع ما لم تصحبه إنجازات) بحجم مماثل في البقية (Amdahl, 1967). لم يكتب Amdahl معادلة، والصيغة المعتادة في الكتب أدناه، حيث f هي نسبة الوقت الذي تحسّنه وk هو مقدار تسريع ذلك الجزء.

S=1(1−f)+f/kS = \frac{1}{(1 - f) + f/k}
Amdahl's law: overall speedup when a fraction f is made k times fasterقانون Amdahl: التسريع الكلي عندما يُسرَّع جزء f بمقدار k مرة

With f = 30/170 and k = 2, the formula gives 1 / (0.8235 + 0.0882) ≈ 1.097, the same answer as the worked example. As k grows without bound the speedup approaches 1 / (1 - f), which is the 1.21x ceiling.

عندما f = 30/170 وk = 2 تعطي المعادلة 1 / (0.8235 + 0.0882) ≈ 1.097، وهي الإجابة نفسها في المثال المحلول. وكلما كبرت k بلا حد اقترب التسريع من 1 / (1 - f)، وهو سقف 1.21x.

In Mapping 1 the part you cannot improve is the network. Physics bounds L1 and L2, and Satyanarayanan notes that "the speed of light is an obvious physical limit on latency". The only large lever left is shortening the distance, which is exactly what Edge computing does. He concludes that relying on a distant data center is not advisable for applications that need end-to-end delays tightly controlled below a few tens of milliseconds (Satyanarayanan, 2017).

في التعيين 1 الجزء الذي لا تستطيع تحسينه هو الشبكة. الفيزياء تحدّ L1 وL2، ويلاحظ Satyanarayanan أن "the speed of light is an obvious physical limit on latency" (سرعة الضوء حد فيزيائي واضح لزمن التأخير). الرافعة الكبيرة الوحيدة المتبقية هي تقصير المسافة، وهذا بالضبط ما تفعله حوسبة الحافة (edge). ويخلص إلى أن الاعتماد على مركز بيانات بعيد غير مستحسن للتطبيقات التي تحتاج إلى تأخير طرفي إلى طرفي مضبوط بإحكام تحت بضع عشرات من الملي ثانية (Satyanarayanan, 2017).

Quick checkاختبار سريع

A client sees 40 ms, 40 ms and 40 ms for L1, PT and L2. The server becomes twice as fast. What is the new response time?عميل يرى 40 ms و40 ms و40 ms لكل من L1 وPT وL2. أصبح الخادم أسرع بمرتين. ما زمن الاستجابة الجديد؟

So is Mapping 1 a bad design?إذن هل التعيين 1 تصميم سيئ؟

No. The same centralization that makes it slow for far clients is what makes it attractive. With one model in one Cloud deployment, every user gets the same model version, and an update is a single deploy. The client stays thin, since it only captures and displays. Satyanarayanan describes the benefit: "centralization exploits economies of scale to lower the marginal cost of system administration and operations" (Satyanarayanan, 2017). When demand grows, you rent more machines in the same region.

لا. المركزية نفسها التي تجعله بطيئًا للعملاء البعيدين هي ما يجعله جذابًا. مع نموذج واحد في نشر واحد على cloud، يحصل كل مستخدم على نسخة النموذج نفسها، والتحديث عملية نشر واحدة. ويبقى العميل خفيفًا لأنه يلتقط ويعرض فقط. يصف Satyanarayanan الفائدة: "centralization exploits economies of scale to lower the marginal cost of system administration and operations" (المركزية تستغل وفورات الحجم لخفض التكلفة الحدية لإدارة النظام وتشغيله) (Satyanarayanan, 2017). وعندما يزداد الطلب تستأجر أجهزة أكثر في المنطقة نفسها.

Whether distance is a problem depends on the service. For photo tagging, a few hundred milliseconds are fine and Mapping 1 is often the right call. For augmented reality or a multiplayer game, where a frame must react within milliseconds, every request paying the full Latency both ways is not acceptable.

كون المسافة مشكلة أم لا يعتمد على الخدمة. في وسم الصور (photo tagging) بضع مئات من الملي ثانية مقبولة، وغالبًا ما يكون التعيين 1 هو الخيار الصحيح. أما في الواقع المعزز أو لعبة جماعية عبر الشبكة، حيث يجب أن يستجيب الإطار خلال ملي ثوانٍ، فإن دفع كل طلب لكامل latency في الاتجاهين غير مقبول.

Strengthsنقاط القوةWeaknessesنقاط الضعف
Every user gets the same model versionكل مستخدم يحصل على نسخة النموذج نفسهاFar clients pay a large L1 and L2 on every requestالعملاء البعيدون يدفعون L1 وL2 كبيرين في كل طلب
The client only sends and receives, so it stays simpleالعميل يرسل ويستقبل فقط، فيبقى بسيطًاReal-time AR and gaming miss their deadlinesتطبيقات الواقع المعزز والألعاب في الزمن الحقيقي تفوّت مواعيدها النهائية
Scaling means adding cloud machines, not touching clientsالتوسع يعني إضافة أجهزة سحابية دون المساس بالعملاءAdding machines does not shorten the pathإضافة الأجهزة لا تقصّر المسار
Mapping 1 at a glanceالتعيين 1 في لمحة

Quick checkاختبار سريع

A multiplayer game studio serves players worldwide from one cloud region. Which Mapping 1 weakness hurts it most?استوديو ألعاب جماعية يخدم اللاعبين حول العالم من منطقة سحابية واحدة. أي نقاط ضعف التعيين 1 يضرّه أكثر؟

Recall

In the New York to California example, what is the lowest RT possible if the server became infinitely fast, and what is the best possible speedup?في مثال نيويورك إلى كاليفورنيا، ما أقل RT ممكن لو أصبح الخادم لانهائي السرعة، وما أفضل تسريع ممكن؟

140 ms (70 + 0 + 70). The best possible speedup is 170 / 140, about 1.21x.
140 ms (70 + 0 + 70). وأفضل تسريع ممكن هو 170 / 140، أي نحو 1.21x.

If the network dominates, the most radical fix is to delete it. Mapping 2 runs the whole photo pipeline on the phone. Nothing is uploaded, so there is no L1 and no L2, and the response time collapses to the processing time alone.

إذا كانت الشبكة هي المهيمنة، فأكثر الحلول جذرية هو حذفها. التعيين 2 يشغّل خط معالجة الصور كله على الهاتف. لا يُرفع شيء، فلا يوجد L1 ولا L2، وينكمش زمن الاستجابة إلى زمن المعالجة وحده.

RT≈PTdeviceRT \approx PT_{device}
Mapping 2: no network terms, all cost moves into processingالتوزيع 2: لا حدود للشبكة، وتنتقل كل الكلفة إلى المعالجة

That sounds ideal until you look at what PT now means. The Client Device has a small battery-powered chip, not a data center accelerator. Resize (T1) and drawing (T3) are cheap, but object detection (T2) is heavy. On weak hardware it takes far longer, and the whole time the processor draws power from the battery. In the lecture's layer model this is the Device stage at the very start of the continuum, before Mist, with no edge, fog or cloud involved, and it is the case with no Offloading at all: the weakest component keeps all the work.

يبدو هذا مثاليًا حتى تنظر إلى ما يعنيه PT الآن. جهاز (device) العميل (client) فيه شريحة صغيرة تعمل بالبطارية، وليس مسرّعًا من مسرّعات مراكز البيانات. تغيير الحجم (T1) والرسم (T3) رخيصان، لكن اكتشاف الأجسام (T2) ثقيل. على عتاد ضعيف يستغرق وقتًا أطول بكثير، وطوال هذا الوقت يسحب المعالج الطاقة من البطارية. في نموذج الطبقات في المحاضرة هذه هي مرحلة الجهاز (Device) في بداية الاستمرارية تمامًا، قبل الضباب الخفيف (mist)، دون أي حافة أو ضباب أو سحابة، وهي الحالة التي لا يوجد فيها تفريغ للحمل (offloading) إطلاقًا: أضعف مكوّن يحتفظ بالعمل كله.

The simulator makes the trade visible. Its all-device preset shows 0 ms of network but 440 ms of processing, while the all-cloud preset shows 159 ms in total. Removing two terms from a sum does not help if the remaining term grows past what you removed.

المحاكي يجعل هذه المقايضة مرئية. إعداده المسبق «كل شيء على الجهاز» يُظهر 0 ms للشبكة لكن 440 ms للمعالجة، بينما إعداد «كل شيء في السحابة» يُظهر 159 ms إجمالًا. حذف حدّين من مجموع لا يفيد إذا كبر الحد المتبقي أكثر مما حذفت.

What the user gains is not speed but independence. With no dependency on the network, the service keeps working with no signal. The raw data never leaves the device, which reduces privacy concerns.

ما يكسبه المستخدم ليس السرعة بل الاستقلالية. بدون اعتماد على الشبكة تستمر الخدمة في العمل حتى بلا إشارة. والبيانات الخام لا تغادر الجهاز أبدًا، مما يقلل مخاوف الخصوصية.

Where it shows up: the smartwatchأين يظهر: الساعة الذكية

A smartwatch that notices you have started running is Mapping 2 in a product you can buy. The motion sensors stream data constantly, and the watch must decide on the spot. Apple's documentation, for example, says that for walking, running, swimming and other workouts "your Apple Watch senses when you're moving and alerts you to start the Workout app" (Apple Support). The page does not say where the detection runs, so treat it as an example of the feature, not as proof of an on-watch model. The general point stands: running the classifier on the Device keeps raw motion data private and works without a phone nearby, but it is bounded by battery life and a small processor.

الساعة الذكية التي تلاحظ أنك بدأت الجري هي التعيين 2 في منتج يمكنك شراؤه. حساسات الحركة تبث البيانات باستمرار، ويجب على الساعة أن تقرر في الحال. توثيق Apple مثلًا يقول إنه في المشي والجري والسباحة وتمارين أخرى "your Apple Watch senses when you're moving and alerts you to start the Workout app" (تستشعر ساعتك أنك تتحرك وتنبهك لبدء تطبيق التمرين) (Apple Support). الصفحة لا تذكر أين يجري الاكتشاف، فاعتبرها مثالًا على الميزة لا دليلًا على نموذج يعمل داخل الساعة. لكن الفكرة العامة صحيحة: تشغيل المصنِّف على device يحفظ خصوصية بيانات الحركة الخام ويعمل دون وجود هاتف قريب، لكنه محدود بعمر البطارية ومعالج صغير.

Toolkits exist precisely for this. Google's LiteRT (formerly TensorFlow Lite) runs trained models on phones and embedded boards and advertises "low latency and high privacy on billions of devices" (Google for Developers). The typical recipe is to train a large model in the cloud, then compress it until it fits the device, which attacks PT directly since it is the only term left.

توجد أدوات مصممة لهذا تحديدًا. LiteRT من Google (سابقًا TensorFlow Lite) يشغّل النماذج المدرَّبة على الهواتف واللوحات المدمجة ويَعِد بـ "low latency and high privacy on billions of devices" (زمن تأخير منخفض وخصوصية عالية على مليارات الأجهزة) (Google for Developers). الوصفة المعتادة هي تدريب نموذج كبير في السحابة، ثم ضغطه حتى يناسب الجهاز، وهذا يهاجم PT مباشرة لأنه الحد الوحيد المتبقي.

  • Choose Mapping 2 when connectivity cannot be assumed: a run in the mountains, a flight, a basement.اختر التعيين 2 عندما لا يمكن افتراض وجود اتصال: جري في الجبال، أو رحلة طيران، أو قبو.
  • Choose it when raw data is sensitive and should not leave the device, such as health signals.اختره عندما تكون البيانات الخام حساسة ولا ينبغي أن تغادر الجهاز، مثل الإشارات الصحية.
  • Choose it only when the model is small enough that PT and battery drain stay acceptable.اختره فقط عندما يكون النموذج صغيرًا بما يكفي ليبقى PT واستنزاف البطارية مقبولين.

Quick checkاختبار سريع

What cost does a smartwatch pay under Mapping 2 that it avoids under Mapping 1?ما التكلفة التي تدفعها الساعة الذكية في التعيين 2 وتتجنبها في التعيين 1؟

Recall

Name two impacts of Mapping 2 on the device itself, and one benefit.اذكر أثرين للتعيين 2 على الجهاز نفسه، وفائدة واحدة.

It consumes the device's processing power and its battery. Benefits: no network dependency, and better privacy because data is processed locally.
يستهلك القدرة المعالجة للجهاز وبطاريته. الفوائد: لا اعتماد على الشبكة، وخصوصية أفضل لأن البيانات تُعالج محليًا.

Mappings 1 and 2 sit at the two extremes: a strong server far away, or a weak processor with no network. Mapping 3 looks for the middle. It keeps a real server but moves it close, into the same building or a nearby telecom site, which runs all three tasks and sends the result back.

التعيينان 1 و2 يقعان في الطرفين: خادم قوي بعيد، أو معالج ضعيف بلا شبكة. التعيين 3 يبحث عن الوسط. يبقي على خادم حقيقي لكنه يقرّبه، إلى المبنى نفسه أو موقع اتصالات قريب، وهذا الخادم يشغّل المهام الثلاث ويعيد النتيجة.

Both halves of the formula improve at once. Because the Server is close, L1 and L2 are small. Because it is a real server rather than a phone, PT is moderate. The simulator's all-edge preset shows 10 ms of network and 136 ms of processing, so 146 ms in total. Satyanarayanan's cloudlet idea is this design: a small data center near users that "can run arbitrary code just as in cloud computing", where "proximity of cloudlets to end users is crucial" (Satyanarayanan, 2017). The work is still offloaded from the device, but to a nearby point on the continuum instead of the far end.

يتحسن نصفا المعادلة معًا. لأن server قريب، يكون L1 وL2 صغيرين. ولأنه خادم حقيقي وليس هاتفًا، يكون PT معتدلًا. إعداد المحاكي «كل شيء على الحافة» يُظهر 10 ms للشبكة و136 ms للمعالجة، أي 146 ms إجمالًا. فكرة cloudlet لدى Satyanarayanan هي هذا التصميم: مركز بيانات صغير قرب المستخدمين "can run arbitrary code just as in cloud computing" (يستطيع تشغيل أي كود كما في الحوسبة السحابية)، حيث "proximity of cloudlets to end users is crucial" (قرب هذه المراكز من المستخدمين أمر حاسم) (Satyanarayanan, 2017). العمل لا يزال مُفرَّغًا (offloaded) من الجهاز، لكن إلى نقطة قريبة على الاستمرارية (continuum) بدلًا من طرفها البعيد.

An edge site serves the users inside its coverage area. Users outside the rings cannot benefit from its low latency.موقع الحافة يخدم المستخدمين داخل منطقة تغطيته. المستخدمون خارج الحلقات لا يستفيدون من زمن تأخيره المنخفض.

Proximity has two prices, and both follow from the same fact that made the latency low. First, limited geographic reach: an Edge site is close to some users precisely because it is far from everyone else, who either get no service or a long trip. Second, limited scalability: an edge site is small, a few servers in a closet or a cabinet, so it cannot absorb a large workload the way a cloud region can. Covering a country means many small sites, each managed separately, which gives back the centralization that made Mapping 1 easy to operate.

للقرب ثمنان، وكلاهما ينبع من الحقيقة نفسها التي جعلت زمن التأخير منخفضًا. الأول، محدودية النطاق الجغرافي: موقع الحافة (edge) قريب من بعض المستخدمين تحديدًا لأنه بعيد عن الجميع غيرهم، فهؤلاء إما لا يحصلون على خدمة أو يقطعون رحلة طويلة. الثاني، محدودية قابلية التوسع: موقع الحافة صغير، بضعة خوادم في غرفة صغيرة أو خزانة، لذلك لا يستطيع استيعاب حمل كبير كما تفعل منطقة سحابية. تغطية دولة كاملة تعني مواقع صغيرة كثيرة، يُدار كل منها على حدة، وهذا يتخلى عن المركزية التي جعلت تشغيل التعيين 1 سهلًا.

Where it shows up: the retail storeأين يظهر: متجر التجزئة

Cameras and shelf sensors in a store feed a server in the back office. It counts footfall, notices which products customers pick up, and tracks inventory as it changes. The decisions are local and time-sensitive: restock a shelf now, open a second checkout because the queue is growing. Sending every video frame to a distant cloud would add Latency and upload a lot of footage, so the edge server answers in the store.

الكاميرات وحساسات الرفوف في المتجر تغذي خادمًا في المكتب الخلفي. يعدّ هذا الخادم الزوار، ويلاحظ أي منتجات يلتقطها الزبائن، ويتتبع المخزون أثناء تغيّره. القرارات محلية وحساسة للوقت: أعد ملء رف الآن، افتح صندوق دفع ثانيًا لأن الطابور يطول. إرسال كل إطار فيديو إلى سحابة بعيدة سيضيف latency ويرفع كمية كبيرة من اللقطات، لذلك يجيب خادم الحافة داخل المتجر.

Now test the two weaknesses against it. Could that back-office box serve a branch in another city? No, its users are the cameras and staff in this store. That is limited reach. Could it absorb the peak traffic of a hundred stores on a sales weekend? No, it is sized for one store. That is limited scalability. The store is a good fit precisely because neither weakness matters for its workload.

الآن اختبر نقطتي الضعف عليه. هل يستطيع ذلك الجهاز في المكتب الخلفي خدمة فرع في مدينة أخرى؟ لا، فمستخدموه هم كاميرات هذا المتجر وموظفوه. هذه محدودية النطاق. هل يستطيع استيعاب ذروة حركة مئة متجر في عطلة تخفيضات؟ لا، فهو مصمم بحجم متجر واحد. هذه محدودية قابلية التوسع. المتجر مناسب تمامًا لأن أيًا من نقطتي الضعف لا تهم في حمل عمله.

Recall

Why can an edge server in one store not replace a cloud service for a national chain? And where would chain-wide sales trends be computed?لماذا لا يستطيع خادم حافة في متجر واحد أن يحل محل خدمة سحابية لسلسلة متاجر وطنية؟ وأين تُحسب اتجاهات المبيعات على مستوى السلسلة كلها؟

Limited geographic reach (it serves only nearby users and devices) and limited scalability (a small site cannot absorb large workloads). Chain-wide trends need data from every store, so they are typically computed in the cloud, which the last section of this part returns to.
بسبب محدودية النطاق الجغرافي (يخدم المستخدمين والأجهزة القريبة فقط) ومحدودية قابلية التوسع (الموقع الصغير لا يستوعب أحمالًا كبيرة). اتجاهات السلسلة كلها تحتاج إلى بيانات من كل متجر، لذلك تُحسب عادة في السحابة، وهو ما يعود إليه القسم الأخير من هذا الجزء.

So far each mapping put the whole pipeline in one place. But the three tasks are not equally demanding, so why should they share a layer? Mapping 4 splits the pipeline: the light tasks stay near the user and the heavy task runs one tier up. T1 (resize) and T3 (draw) run in the Edge layer, and T2 (object detection) runs in the Fog layer, which has more compute.

حتى الآن وضع كل تعيين خط المعالجة كله في مكان واحد. لكن المهام الثلاث ليست متساوية في متطلباتها، فلماذا تشترك في طبقة واحدة؟ التعيين 4 يقسّم خط المعالجة: المهام الخفيفة تبقى قرب المستخدم والمهمة الثقيلة تعمل في طبقة أعلى. T1 (تغيير الحجم) وT3 (الرسم) تعملان في طبقة الحافة (edge)، وT2 (اكتشاف الأجسام) تعمل في طبقة الضباب (fog) التي لديها قدرة حسابية أكبر.

Mapping 4: T1 and T3 land in the edge lane, T2 lands in the fog lane, and the data crosses between them twice.التعيين 4: تقع T1 وT3 في مسار الحافة، وتقع T2 في مسار الضباب، وتعبر البيانات بينهما مرتين.

Think of it as one logical service deployed in two physical places. The Service pipeline is now distributed, so the formula has to grow. Count the hops: client to edge, edge to fog, fog to edge, edge to client. That is four network crossings instead of two, and each task contributes its own processing term.

فكّر فيه كخدمة منطقية واحدة منشورة في مكانين فعليين. خط المعالجة (pipeline) أصبح موزعًا، فلا بد أن تكبر المعادلة. عُدّ القفزات: من العميل إلى الحافة، ومن الحافة إلى الضباب، ومن الضباب إلى الحافة، ومن الحافة إلى العميل. هذه أربعة عبورات للشبكة بدلًا من اثنين، وكل مهمة تساهم بحد معالجة خاص بها.

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}
Response time for Mapping 4: four latency terms and three processing termsزمن الاستجابة للتوزيع 4: أربعة حدود لزمن الانتقال وثلاثة حدود للمعالجة

In the simulator's Mapping 4 preset, those crossings add up to 40 ms and processing to 56 ms, so 96 ms, the lowest of the four presets. The fog does T2 much faster than the edge, and that saving outweighs the two extra hops. NIST describes fog nodes as sitting "between smart end-devices and centralized (cloud) services" and says fog "minimizes the request-response time" (NIST SP 500-325).

في الإعداد المسبق للتعيين 4 في المحاكي، مجموع هذه العبورات 40 ms والمعالجة 56 ms، أي 96 ms، وهو الأقل بين الإعدادات الأربعة. الضباب ينفذ T2 أسرع بكثير من الحافة، وهذا التوفير يفوق القفزتين الإضافيتين. تصف NIST عقد الضباب بأنها تقع "between smart end-devices and centralized (cloud) services" (بين الأجهزة الطرفية الذكية والخدمات المركزية السحابية) وتقول إن الضباب "minimizes the request-response time" (يقلل زمن الطلب والاستجابة) (NIST SP 500-325).

What sharing a fog node buysما الذي تكسبه من مشاركة عقدة ضباب

Speed is only part of the case. Picture ten intersections in a smart city. Each traffic camera has a small edge box that resizes frames. All ten send them to one nearby fog server, which runs a large vehicle detection model for all of them and returns detections to each box.

السرعة ليست إلا جزءًا من الحجة. تخيّل عشرة تقاطعات في مدينة ذكية. لكل كاميرا مرور صندوق حافة صغير يغيّر حجم الإطارات. الصناديق العشرة كلها ترسل الإطارات إلى خادم ضباب قريب واحد، يشغّل نموذجًا كبيرًا لاكتشاف المركبات لها جميعًا ويعيد نتائج الاكتشاف إلى كل صندوق.

Several edge cameras send resized frames to one fog node, which runs the shared model and returns detections to each edge box, while the cloud stays idle.عدة كاميرات حافة ترسل إطارات مصغّرة إلى عقدة ضباب واحدة تشغّل النموذج المشترك وتعيد نتائج الاكتشاف إلى كل صندوق حافة، بينما تبقى السحابة خاملة.
  1. Sharing: one detection model serves users of many edge nodes, instead of a copy squeezed onto each small box.المشاركة: نموذج اكتشاف واحد يخدم مستخدمي عقد حافة كثيرة، بدلًا من نسخة محشورة في كل صندوق صغير.
  2. Capacity: the fog node has more processing power and storage than any single edge site.السعة: عقدة الضباب لديها قدرة معالجة وتخزين أكبر من أي موقع حافة منفرد.
  3. Learning: the fog collects data from all the edge nodes, which keeps the model up to date, for example by retraining on new traffic patterns.التعلّم: يجمع الضباب البيانات من كل عقد الحافة، مما يبقي النموذج محدّثًا، مثلًا بإعادة تدريبه على أنماط مرور جديدة.

This matches how NIST frames fog. Fog nodes support "a common data management and communication system" and are organized in clusters by their "latency-distance to the smart end-devices" (NIST SP 500-325). Aggregation and coordination are the fog's job, which partly restores the centralization that Mapping 3 gave up, without going all the way to the cloud.

هذا يتوافق مع طريقة NIST في تأطير الضباب. عقد الضباب تدعم "a common data management and communication system" (نظامًا مشتركًا لإدارة البيانات والاتصال) وتُنظَّم في عناقيد بحسب "latency-distance to the smart end-devices" (مسافتها الزمنية من الأجهزة الطرفية الذكية) (NIST SP 500-325). التجميع والتنسيق هما وظيفة الضباب، وهذا يعيد جزئيًا المركزية التي تخلى عنها التعيين 3، دون الذهاب حتى السحابة.

What splitting costsما تكلفة التقسيم

  • The fog layer introduces latency relative to Mapping 3: every boundary between layers adds its own latency, with all four delay components. The fog is still much closer than the Cloud.طبقة الضباب تضيف زمن تأخير مقارنة بالتعيين 3: كل حد فاصل بين الطبقات يضيف زمن تأخيره الخاص بمكوّنات التأخير الأربعة كلها. ومع ذلك يبقى الضباب أقرب بكثير من السحابة (cloud).
  • Every byte that crosses a boundary may be billed. Cloud providers already charge this way: AWS states that "there is a charge for data transfer across Regions" and that "data transfer from AWS to the internet is charged" (AWS Architecture Blog). Those quotes are about regions and the internet, not edge to fog links, but the principle carries over.كل بايت يعبر حدًا فاصلًا قد يُحاسَب عليه. مزودو السحابة يفعلون هذا أصلًا: تذكر AWS أن "there is a charge for data transfer across Regions" (هناك رسوم لنقل البيانات بين المناطق) وأن "data transfer from AWS to the internet is charged" (نقل البيانات من AWS إلى الإنترنت مدفوع) (AWS Architecture Blog). هذان الاقتباسان عن المناطق والإنترنت، لا عن الوصلات بين الحافة والضباب، لكن المبدأ نفسه ينطبق.
  • So split where a task shrinks the data. Resizing before sending means fewer bytes cross the edge to fog link, which is exactly why T1 stays at the edge.لذلك قسّم عند المهمة التي تقلّص البيانات. تغيير الحجم قبل الإرسال يعني بايتات أقل تعبر وصلة الحافة إلى الضباب، وهذا بالضبط سبب بقاء T1 على الحافة.

Quick checkاختبار سريع

Compared with Mapping 3, what new cost does Mapping 4 introduce?مقارنة بالتعيين 3، ما التكلفة الجديدة التي يضيفها التعيين 4؟

Recall

List three benefits of putting T2 in the fog, and the price paid.اذكر ثلاث فوائد لوضع T2 في الضباب، والثمن المدفوع.

The model is shared across edge nodes, there is more compute and storage, and data is aggregated to keep the model current. The price is the extra edge to fog hops, which add latency and data transfer.
النموذج مشترك بين عقد الحافة، وهناك قدرة حسابية وتخزين أكبر، والبيانات تُجمَّع لإبقاء النموذج محدّثًا. والثمن هو القفزات الإضافية بين الحافة والضباب، التي تضيف زمن تأخير ونقل بيانات.

The four mappings are clean teaching cases. Practice is messier in one specific way: a dedicated fog tier is not always deployed, or identified, as a separate layer. In most cases, architects use two layers, Edge and Cloud.

التعيينات الأربعة حالات تعليمية نظيفة. الواقع أكثر فوضى في نقطة محددة: طبقة الضباب المخصصة لا تُنشر دائمًا، أو لا تُعرَّف دائمًا، كطبقة منفصلة. في معظم الحالات يستخدم المعماريون طبقتين، الحافة (edge) والسحابة (cloud).

NIST agrees that fog is optional: it "is not perceived as a mandatory layer", and "different usecase scenarios might have different architectures" (NIST SP 500-325). The claim that "most" architects choose edge plus cloud is the lecturer's observation from practice. No industry-wide statistic backs the exact share.

تتفق NIST على أن الضباب اختياري: فهو "is not perceived as a mandatory layer" (لا يُعدّ طبقة إلزامية)، و"different usecase scenarios might have different architectures" (سيناريوهات الاستخدام المختلفة قد تكون لها معماريات مختلفة) (NIST SP 500-325). أما القول بأن «معظم» المعماريين يختارون الحافة مع السحابة فهو ملاحظة المحاضر من الممارسة. لا توجد إحصائية على مستوى الصناعة تدعم النسبة الدقيقة.

The resulting design has the shape of Mapping 4 with the cloud in place of the Fog: T1 and T3 at the edge, T2 in the cloud. It borrows the strength of each earlier mapping for the task that needs it. Go back to the retail store. The back-office edge server makes the live decisions, as in Mapping 3, and the cloud trains new models and computes trends across the whole chain, using the centralization that made Mapping 1 attractive. Each task gets the Layer that suits it.

التصميم الناتج له شكل التعيين 4 مع السحابة بدلًا من الضباب (fog): T1 وT3 على الحافة، وT2 في السحابة. إنه يستعير نقطة قوة كل تعيين سابق للمهمة التي تحتاجها. عد إلى متجر التجزئة. خادم الحافة في المكتب الخلفي يتخذ القرارات الحية كما في التعيين 3، والسحابة تدرّب نماذج جديدة وتحسب الاتجاهات عبر السلسلة كلها، مستفيدة من المركزية التي جعلت التعيين 1 جذابًا. كل مهمة تحصل على الطبقة (layer) التي تناسبها.

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 كبيران، وغير مناسب للواقع المعزز أو الألعابPhoto tagging in a distant data centerوسم الصور في مركز بيانات بعيد
22All on the deviceكل شيء على الجهازNo network, privacy, works offlineلا شبكة، وخصوصية، ويعمل دون اتصالBattery, limited hardware, long PTالبطارية، والعتاد المحدود، وطول PTSmartwatch activity recognitionالتعرّف على النشاط في الساعة الذكية
33All at the edgeكل شيء على الحافةLow latency, data stays localزمن تأخير منخفض، والبيانات تبقى محليةLimited reach, limited scalabilityنطاق محدود، وقابلية توسع محدودةRetail store analyticsتحليلات متاجر التجزئة
44T1 edge, T2 fog, T3 edgeT1 على الحافة، وT2 في الضباب، وT3 على الحافةShared model, more compute, model updatesنموذج مشترك، وقدرة حسابية أكبر، وتحديث النموذجExtra inter-layer hops and transfer costقفزات إضافية بين الطبقات وتكلفة نقل البياناتSmart-city traffic camerasكاميرات المرور في المدينة الذكية
The four mappings side by sideالتعيينات الأربعة جنبًا إلى جنب

Quick checkاختبار سريع

According to the lecture, which two layers do most application architects deploy?بحسب المحاضرة، ما الطبقتان اللتان ينشرهما معظم معماريي التطبيقات؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • A mapping assigns each pipeline task to a continuum layer. It is a design decision, not a given.التعيين يُسند كل مهمة في خط المعالجة إلى طبقة من طبقات الاستمرارية. إنه قرار تصميمي وليس أمرًا مفروضًا.
  • RT = L1 + PT + L2. In the New York to California example, only 17.6% of 170 ms is computation.RT = L1 + PT + L2. في مثال نيويورك إلى كاليفورنيا، الحوسبة لا تتجاوز 17.6% من 170 ms.
  • Doubling server speed gives 155 ms, and even an infinitely fast server leaves 140 ms. Shorten the distance instead.مضاعفة سرعة الخادم تعطي 155 ms، وحتى الخادم ذو السرعة اللانهائية يترك 140 ms. الحل هو تقصير المسافة.
  • Mapping 2 removes the network but pays in battery, hardware limits and long PT.التعيين 2 يلغي الشبكة لكنه يدفع الثمن من البطارية وحدود العتاد وطول PT.
  • Mapping 3 cuts latency but serves only a local area with limited capacity.التعيين 3 يخفض زمن التأخير لكنه يخدم منطقة محلية فقط بسعة محدودة.
  • Mapping 4 shares a fog model across edge nodes but adds hops, latency and data transfer.التعيين 4 يشارك نموذجًا في الضباب بين عدة عقد حافة لكنه يضيف قفزات وزمن تأخير ونقل بيانات.
  • Fog is optional. Most architectures combine edge and cloud.الضباب اختياري. معظم المعماريات تجمع بين الحافة والسحابة.

Sourcesالمصادر

Part 10: Latency budget, exercises and summaryميزانية زمن الاستجابة والتمارين والخلاصة

Designing against a response-time threshold, three design exercises (smart glasses, AR, VR), and the lecture in one page.التصميم وفق عتبة محددة لزمن الاستجابة، وثلاثة تمارين تصميم (النظارات الذكية، والواقع المعزز AR، والواقع الافتراضي VR)، والمحاضرة كلها في صفحة واحدة.

4 concepts4 مفاهيم, ، slides 72-77الشرائح 72-77

Why this part mattersلماذا يهمّ هذا الجزء

Parts 7 to 9 gave you the physics of latency, the layers of the continuum, and ways to map a pipeline onto them. One ingredient was still missing: a deadline. Without a deadline, “edge or cloud?” is a matter of taste. With one, it becomes an inequality you can check with a calculator.

This part names that deadline τ, shows where defensible values of τ come from, and then turns it into a design method you can reuse on any system. You will practise the method on three workloads that sit at the heart of edge computing research: smart glasses, warehouse augmented reality and virtual reality (Chen et al. 2017, RFC 9699). The part ends by folding the whole lecture into one loop: split the service into tasks, give each a deadline, place it, and check response time against the deadline. For the exam you will compute response times and pick feasible mappings. For the research project, any edge system you propose should state τ per task, justify it from a published source, and report measured response time at a percentile.

أعطتك الأجزاء من 7 إلى 9 فيزياء التأخير، وطبقات المتصل، وطرقًا لتوزيع خط المعالجة (pipeline) عليها. لكن عنصرًا واحدًا كان لا يزال ناقصًا: المهلة الزمنية (deadline). من دون مهلة يصبح سؤال “الحافة أم السحابة؟” مسألة ذوق. ومع وجودها يتحول إلى متباينة تستطيع التحقق منها بآلة حاسبة.

يسمّي هذا الجزء تلك المهلة τ، ويبيّن من أين تأتي قيم τ التي يمكن الدفاع عنها، ثم يحوّلها إلى طريقة تصميم تعيد استخدامها على أي نظام. ستتدرب على الطريقة في ثلاثة أحمال عمل تقع في صميم أبحاث الحوسبة الطرفية: النظارات الذكية، والواقع المعزز في المستودعات، والواقع الافتراضي (Chen et al. 2017، وRFC 9699). وينتهي الجزء بطيّ المحاضرة كلها في حلقة واحدة: قسّم الخدمة إلى مهام، وأعطِ كل مهمة مهلة، وضعها في طبقة، ثم قارن زمن الاستجابة بالمهلة. في الاختبار ستحسب أزمنة الاستجابة وتختار التوزيعات الممكنة. وفي مشروع البحث، ينبغي لأي نظام حافة تقترحه أن يذكر τ لكل مهمة، ويبرّرها من مصدر منشور، ويعرض زمن الاستجابة المقاس عند مئين (percentile).

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Explain the latency budget [0, τ] and decide whether a mapping is feasible by checking RT ≤ τ, counting latency out, processing time and latency back.تشرح ميزانية التأخير [0, τ] وتحكم على جدوى أي توزيع بالتحقق من RT ≤ τ، مع احتساب زمن الذهاب ووقت المعالجة وزمن العودة.
  2. Justify τ from published human and physical limits (XR, conversation, web, wearable assistance) and check it at a percentile, not the mean.تبرّر قيمة τ من الحدود البشرية والفيزيائية المنشورة (الواقع الممتد XR، والمحادثة، والويب، والمساعدة عبر الأجهزة القابلة للارتداء) وتتحقق منها عند مئين (percentile) لا عند المتوسط.
  3. Apply the four-step method (tasks, τ per task, placement, RT and trade-offs) and defend a smart-glasses placement with battery, privacy and reach arguments.تطبّق الطريقة ذات الخطوات الأربع (المهام، ثم τ لكل مهمة، ثم التوزيع، ثم RT والمفاضلات) وتدافع عن توزيع مهام النظارات الذكية بحجج البطارية والخصوصية والانتشار.
  4. Explain why one AR or VR app needs several layers, and why motion-to-photon forces tracking and reprojection onto the device.تشرح لماذا يحتاج تطبيق AR أو VR واحد إلى عدة طبقات، ولماذا يفرض زمن motion-to-photon أن يجري التتبع وإعادة الإسقاط (reprojection) على الجهاز نفسه.
  5. State the lecture as one design loop, where τ decides the edge and cloud split, and connect it to virtualization, containers and cloud service models.تلخّص المحاضرة في حلقة تصميم واحدة تحدد فيها τ التقسيم بين الحافة والسحابة، وتربطها بالمحاكاة الافتراضية والحاويات ونماذج الخدمة السحابية.

Picture a video call. When you speak, your voice should reach the other person quickly enough that the two of you do not talk over each other. The ITU-T telephony standard G.114 puts a number on “quickly enough”: if one-way delay stays below 150 ms, most applications experience essentially transparent interactivity, and 400 ms should not be exceeded for general network planning. So for one direction of that call, you have about 150 ms to spend, and every hop, queue and processing step you place in the path takes some of it.

تخيّل مكالمة فيديو. عندما تتكلم، يجب أن يصل صوتك إلى الطرف الآخر بسرعة كافية كي لا يقاطع أحدكما الآخر. يضع معيار الاتصالات الهاتفية ITU-T G.114 رقمًا لعبارة “بسرعة كافية”: إذا بقي التأخير في اتجاه واحد أقل من 150 ms فإن معظم التطبيقات تحظى بتفاعل شفاف عمليًا، ولا ينبغي تجاوز 400 ms في التخطيط العام للشبكات. إذن في اتجاه واحد من تلك المكالمة لديك نحو 150 ms لتنفقها، وكل قفزة (hop) وكل طابور انتظار وكل خطوة معالجة تضعها في المسار تأخذ جزءًا منها.

That allowance is the Latency budget. Its upper limit is written τ (tau): the maximum acceptable end-to-end Response time (RT) of a service. The budget is the interval [0,τ][0, \tau], and a design is inside it when RT≤τRT \le \tau. Notice who sets τ. It is not the network, and it is not the hardware you happen to own. It comes from the user and the application: human perception for a chat or a game, physics for a headset that must keep up with your head. The network and the servers only decide how much of the budget you spend.

هذا المقدار المسموح به هو latency budget (ميزانية التأخير). ويُكتب حدّه الأعلى τ (تاو): أقصى response time (زمن استجابة) مقبول للخدمة من الطرف إلى الطرف. الميزانية هي الفترة [0,τ][0, \tau]، ويكون التصميم داخلها عندما RT≤τRT \le \tau. لاحظ من يحدد τ. ليست الشبكة، وليست الأجهزة التي تصادف أنك تملكها. إنها تأتي من المستخدم والتطبيق: الإدراك البشري في حالة المحادثة أو اللعبة، والفيزياء في حالة نظارة رأس يجب أن تواكب حركة رأسك. أما الشبكة والخوادم فتحدد فقط مقدار ما تنفقه من الميزانية.

What counts against the budgetما الذي يُخصم من الميزانية

It is tempting to compare τ with the Latency to a layer: the client reaches the edge with small latency, the fog with medium latency and the cloud with large latency. But latency is only part of the bill. Recall from part 9 that response time is the trip out, plus the Processing time (PT) at the server, plus the trip back:

من المغري مقارنة τ بـlatency (التأخير) إلى طبقة ما: يصل العميل إلى الحافة بتأخير صغير، وإلى الضباب بتأخير متوسط، وإلى السحابة بتأخير كبير. لكن التأخير ليس إلا جزءًا من الفاتورة. تذكّر من الجزء 9 أن زمن الاستجابة هو رحلة الذهاب، زائد processing time (وقت المعالجة) على الخادم، زائد رحلة العودة:

RT=L↑+PT+L↓≤τRT = L_{\uparrow} + PT + L_{\downarrow} \le \tau
Latency budget condition: out, processing, back, compared with τشرط ميزانية زمن الانتقال: الذهاب ثم المعالجة ثم العودة، مقارنةً بـ τ

A per-layer latency figure is one-way, so never compare a single arrow directly with τ. When a pipeline splits its tasks across several layers, every hop between them joins the sum as well, together with every task’s processing time. The gauge below makes the consequence visible: the same request, three placements, one deadline.

رقم التأخير الخاص بكل طبقة هو في اتجاه واحد، لذلك لا تقارن سهمًا واحدًا مباشرة مع τ أبدًا. وعندما يوزّع خط المعالجة مهامه على عدة طبقات، تدخل كل قفزة بينها في المجموع أيضًا، مع وقت معالجة كل مهمة. يجعل المقياس أدناه النتيجة مرئية: الطلب نفسه، وثلاثة توزيعات، ومهلة واحدة.

Three mappings of the same request against τ = 100 ms. Only the edge finishes before the τ line; fog and cloud run past it.ثلاثة توزيعات للطلب نفسه مقابل τ = 100 ms. الحافة وحدها تنتهي قبل خط τ، بينما يتجاوزه الضباب والسحابة.

Worked exampleمثال محلول

Is the fog mapping within τ = 100 ms? (illustrative numbers)هل توزيع الضباب داخل τ = 100 ms؟ (أرقام توضيحية)

  1. Write the budgetاكتب الميزانية

    The service must answer within τ = 100 ms.
    يجب أن تجيب الخدمة خلال τ = 100 ms.
  2. Sum the fog mappingاجمع توزيع الضباب

    One-way latency to the fog is 20 ms and processing takes 70 ms. So RT = 20 + 70 + 20 = 110 ms. That is over budget by 10 ms.
    التأخير في اتجاه واحد إلى الضباب 20 ms والمعالجة تستغرق 70 ms. إذن RT = 20 + 70 + 20 = 110 ms. وهذا يتجاوز الميزانية بمقدار 10 ms.
  3. Try the edgeجرّب الحافة

    One-way latency to the edge is 5 ms. If the edge server can still process in 70 ms, RT = 5 + 70 + 5 = 80 ms, which fits. In practice edge servers are smaller, so check that PT does not grow enough to undo the saving.
    التأخير في اتجاه واحد إلى الحافة 5 ms. فإذا استطاع خادم الحافة أن يعالج أيضًا في 70 ms، يكون RT = 5 + 70 + 5 = 80 ms، وهذا يناسب الميزانية. لكن خوادم الحافة في الواقع أصغر، فتحقّق من أن PT لا يزداد بما يكفي لإلغاء هذا التوفير.
  4. Resultالنتيجة

    Fog fails (110 > 100). Edge passes (80 ≤ 100). Always write the sum and the inequality.
    الضباب يفشل (110 > 100). والحافة تنجح (80 ≤ 100). اكتب دائمًا المجموع والمتباينة.

The last step of that example hides the real tension of this whole part. Moving closer shrinks the latency terms, but closer sites are smaller, so the processing term can grow. Neither “always edge” nor “always cloud” is a rule; the inequality decides. The simulator lets you feel that tension. Its three tasks are an image resize, object detection and drawing boxes, and the presets map them to different layers. Set τ to 100 ms and find the one preset that stays in budget.

الخطوة الأخيرة في ذلك المثال تخفي التوتر الحقيقي في هذا الجزء كله. الاقتراب يقلّص حدود التأخير، لكن المواقع الأقرب أصغر، لذلك قد يكبر حد المعالجة. لا “الحافة دائمًا” ولا “السحابة دائمًا” قاعدة؛ المتباينة هي التي تحسم. يتيح لك المحاكي أن تشعر بهذا التوتر. مهامه الثلاث هي تغيير حجم صورة، واكتشاف الكائنات (object detection)، ورسم المربعات، والإعدادات المسبقة (presets) توزّعها على طبقات مختلفة. اضبط τ على 100 ms وابحث عن الإعداد المسبق الوحيد الذي يبقى داخل الميزانية.

SimulatorمحاكيMap a pipeline onto the continuumوزّع خط معالجة على السلسلة المتصلة (continuum)
  1. T1Image resizeتصغير الصورةPT 8 ms
  2. T2Object detectionاكتشاف الأجسامPT 40 ms
  3. T3Draw boxesرسم المربعاتPT 8 ms
150 ms
Networkالشبكة40ms
Response timeزمن الاستجابة96ms
Within budgetضمن الميزانية RT ≤ 150 ms
τ
networkالشبكة 40 ms · 42%processingالمعالجة 56 ms · 58%

Formulaالمعادلة

RT = Σ one-way hops + Σ PT

RT = (5 + 15 + 15 + 5) + (8 + 40 + 8) = 96 ms

Client→Edge 5 · Edge→Fog 15 · Fog→Edge 15 · Edge→Client 5

Each hop costs the difference between the one-way latencies of the two layers: Device 0, Edge 5, Fog 20, Cloud 70 ms from the client.تكلفة كل قفزة (hop) هي الفرق بين زمني الانتقال أحادي الاتجاه للطبقتين: الجهاز (Device) 0، والحافة (Edge) 5، والضباب (Fog) 20، والسحابة (Cloud) 70 ms من العميل.

Recall

At τ = 100 ms, which simulator preset passes, and why do “all edge” and “all cloud” fail?عند τ = 100 ms، أي إعداد مسبق في المحاكي ينجح، ولماذا يفشل “الكل على الحافة” و“الكل على السحابة”؟

Only mapping 4 (edge, fog, edge) passes, at about 96 ms. All edge has almost no network cost but object detection runs slowly on the small edge server (120 ms), so RT is about 146 ms. All cloud processes fast but pays 70 ms each way, about 159 ms in total. The winner balances latency and processing time. Stretch: build a custom mapping by hand. All fog reaches about 88 ms, because the fog’s stronger processor outweighs its extra latency.
ينجح التوزيع 4 وحده (حافة، ضباب، حافة)، بنحو 96 ms. “الكل على الحافة” تكلفته الشبكية شبه معدومة، لكن اكتشاف الكائنات يعمل ببطء على خادم الحافة الصغير (120 ms)، فيصبح RT نحو 146 ms. و“الكل على السحابة” يعالج بسرعة لكنه يدفع 70 ms في كل اتجاه، أي نحو 159 ms إجمالًا. الفائز يوازن بين التأخير ووقت المعالجة. تحدٍّ إضافي: ابنِ توزيعًا مخصصًا بيدك. “الكل على الضباب” يصل إلى نحو 88 ms، لأن معالج الضباب الأقوى يعوّض تأخيره الإضافي ويزيد.

Where real values of τ come fromمن أين تأتي القيم الحقيقية لـ τ

Because τ belongs to the user, you should never invent it. Studies of human perception and device physics give defensible numbers, and they span four orders of magnitude: a headset that must track your head has a couple of tens of milliseconds, a conversation has about a hundred and fifty, a recognition assistant has most of a second, and a user waiting for a report keeps attention for about ten seconds. The table collects the values this course relies on, roughly from the strictest to the most relaxed. You will use every row in the design exercises that follow.

لأن τ ملك للمستخدم، لا ينبغي لك أن تخترعها أبدًا. دراسات الإدراك البشري وفيزياء الأجهزة تعطي أرقامًا يمكن الدفاع عنها، وهي تمتد عبر أربع مراتب عشرية: نظارة الرأس التي يجب أن تتتبع رأسك لديها بضع عشرات من الملّي ثانية، والمحادثة لديها نحو مئة وخمسين، ومساعد التعرف لديه معظم الثانية، والمستخدم الذي ينتظر تقريرًا يبقى منتبهًا نحو عشر ثوانٍ. يجمع الجدول القيم التي يعتمد عليها هذا المقرر، مرتبة تقريبًا من الأشد صرامة إلى الأكثر تساهلًا. وستستخدم كل صف منها في تمارين التصميم التالية.

InteractionالتفاعلττSourceالمصدر
VR / XR motion-to-photonزمن motion-to-photon في VR / XR≤ 20 ms (7 to 15 ms preferred)≤ 20 ms (ويُفضَّل 7 إلى 15 ms)RFC 9699RFC 9699
VR motion-to-photon consensusالإجماع على motion-to-photon في VR< 15 to 20 ms< 15 إلى 20 msElbamby et al.Elbamby et al.
Response feels instantaneousالاستجابة تبدو فورية0.1 s0.1 sNielsenNielsen
One-way conversational delayتأخير المحادثة في اتجاه واحد< 150 ms preferred, 400 ms ceiling< 150 ms مفضّل، و400 ms سقف أعلىITU-T G.114ITU-T G.114
Web interaction rated good (INP)تفاعل ويب مصنّف جيدًا (INP)≤ 200 ms at p75≤ 200 ms عند p75web.devweb.dev
Wearable face recognitionالتعرف على الوجوه في الأجهزة القابلة للارتداء370 to 1000 ms370 إلى 1000 msChen et al. 2017Chen et al. 2017
Step-by-step instruction (Lego, Draw, Sandwich)الإرشاد خطوة بخطوة (Lego وDraw وSandwich)600 ms tight, 2.7 s loose600 ms حد صارم، و2.7 s حد متساهلChen et al. 2017Chen et al. 2017
Flow of thought stays unbrokenتدفق التفكير يبقى متصلًا1 s1 sNielsenNielsen
User keeps attention on the taskالمستخدم يبقى منتبهًا للمهمة10 s10 sNielsenNielsen
Published latency budgetsميزانيات التأخير المنشورة

One more rule turns these numbers into a real test. A budget is a promise about the experience of users, and users remember the slow requests, not the average one. So published budgets are stated at a percentile.

قاعدة أخرى تحوّل هذه الأرقام إلى اختبار حقيقي. الميزانية وعد بشأن تجربة المستخدمين، والمستخدمون يتذكرون الطلبات البطيئة لا الطلب المتوسط. لذلك تُذكر الميزانيات المنشورة عند مئين (percentile).

Quick checkاختبار سريع

A service has τ = 120 ms. One-way latency to the fog is 25 ms and processing takes 75 ms. Is the fog mapping within budget?خدمة لها τ = 120 ms. التأخير في اتجاه واحد إلى الضباب 25 ms والمعالجة تستغرق 75 ms. هل توزيع الضباب داخل الميزانية؟

Quick checkاختبار سريع

Which published figure is the standard reference for acceptable one-way conversational delay?أي رقم منشور هو المرجع المعياري لتأخير المحادثة المقبول في اتجاه واحد؟

Knowing the inequality is not the same as designing a system. Real services are not one request and one server; they are pipelines of tasks with different needs. Design questions of this kind have no single right answer, but they do have a right method, and it is the same four steps every time: list the tasks, set τ per task, place each task on a layer, then check Response time (RT) and the trade-offs.

معرفة المتباينة ليست مثل تصميم نظام. الخدمات الحقيقية ليست طلبًا واحدًا وخادمًا واحدًا؛ إنها خطوط معالجة من مهام ذات احتياجات مختلفة. أسئلة التصميم من هذا النوع ليس لها إجابة صحيحة واحدة، لكن لها طريقة صحيحة، وهي الخطوات الأربع نفسها في كل مرة: اسرد المهام، وحدّد τ لكل مهمة، وضع كل مهمة على طبقة، ثم تحقّق من response time ومن المفاضلات.

Smart glasses are a good first case because every constraint pulls hard. The device is small, runs on a tiny battery and sits on your face, so it cannot get hot. Yet the job, recognizing the faces and objects in front of you, is heavy vision computing. Before reading on, take a minute and list the tasks a face-recognition assistant on glasses would need. That effort is what makes the model answer stick.

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

Worked exampleمثال محلول

Architecting smart glasses on the E2C continuumتصميم معمارية النظارات الذكية على متصل E2C

  1. 1. List the tasks1. اسرد المهام

    The Service pipeline is: capture a camera frame, compress or downscale it, detect and recognize nearby faces or objects, generate guidance text, render the overlay on the display, store history and photos, and retrain the recognition models.
    خط المعالجة (pipeline) هو: التقاط إطار من الكاميرا، وضغطه أو تصغير دقته، واكتشاف الوجوه أو الأشياء القريبة والتعرف عليها، وتوليد نص إرشادي، ورسم الطبقة المضافة (overlay) على الشاشة، وتخزين السجل والصور، وإعادة تدريب نماذج التعرف.
  2. 2. Set τ per task2. حدّد τ لكل مهمة

    The overlay must follow head motion, so it lives in a display loop of tens of milliseconds (RFC 9699 gives 20 ms for XR). Chen et al. derive 370 to 1000 ms for face recognition from how long people take to recognize a familiar face, and 600 ms tight to 2.7 s loose for step-by-step assembly guidance on Google Glass from a user study. Storage and training have no interactive deadline.
    يجب أن تتبع الطبقة المضافة حركة الرأس، لذلك تعيش في حلقة عرض مدتها عشرات الملّي ثانية (يعطي RFC 9699 قيمة 20 ms لـ XR). ويستنتج Chen et al. مهلة من 370 إلى 1000 ms للتعرف على الوجوه من الوقت الذي يحتاجه الناس للتعرف على وجه مألوف، ومن 600 ms كحد صارم إلى 2.7 s كحد متساهل لإرشادات التجميع خطوة بخطوة على Google Glass من دراسة على المستخدمين. أما التخزين والتدريب فليس لهما مهلة تفاعلية.
  3. 3. Place each task3. ضع كل مهمة في مكانها

    This is a Mapping. Capture, compression and overlay rendering stay on the glasses, the Mist layer. Detection, recognition and guidance use Offloading to a nearby Edge server (a cloudlet). Storage, analytics and model training go to the Cloud.
    هذا mapping (توزيع). يبقى الالتقاط والضغط ورسم الطبقة المضافة على النظارة، أي طبقة mist. ويستخدم الاكتشاف والتعرف والإرشاد offloading (نقل المعالجة) إلى خادم edge قريب (cloudlet). ويذهب التخزين والتحليلات وتدريب النماذج إلى cloud.
  4. 4. Check RT and trade-offs4. تحقّق من RT والمفاضلات

    In Chen et al.’s Figure 17, face recognition with Glass on a WiFi cloudlet reached 435 ms at the 90th percentile. That meets the loose bound (1000 ms) but misses the tight bound (370 ms), and even the phone on the cloudlet (410 ms) misses it. With a phone client, the cloud gave 615 ms against 410 ms on the cloudlet, and the paper notes that cloud offload almost always adds 100 to 200 ms compared with a cloudlet.
    في الشكل 17 من ورقة Chen et al.، بلغ التعرف على الوجوه باستخدام Glass مع cloudlet عبر WiFi زمن 435 ms عند المئين 90. هذا يحقق الحد المتساهل (1000 ms) لكنه يخفق في الحد الصارم (370 ms)، بل حتى الهاتف مع cloudlet (410 ms) يخفق فيه. ومع عميل هاتفي، أعطت السحابة 615 ms مقابل 410 ms على cloudlet، وتلاحظ الورقة أن نقل المعالجة إلى السحابة يضيف دائمًا تقريبًا 100 إلى 200 ms مقارنة بـ cloudlet.
  5. Resultالنتيجة

    Device for capture and display, edge for recognition, cloud for storage and training.
    الجهاز للالتقاط والعرض، والحافة للتعرف، والسحابة للتخزين والتدريب.
Relay: the glasses send a frame to the cloudlet and get a label back; only history travels on to the cloud.تتابع: ترسل النظارة إطارًا إلى الـ cloudlet وتستقبل تسمية في المقابل، والسجل وحده يكمل طريقه إلى السحابة.

Step 4 is worth a second look, because it shows the method working honestly. The cloudlet design does not magically hit every bound: it meets the loose face-recognition deadline and misses the tight one. That is a real, measured result at the tail, and it is exactly the kind of statement a good design report makes. The cloud alternative misses by more, so the edge is the better placement, not a perfect one.

الخطوة 4 تستحق نظرة ثانية، لأنها تُظهر الطريقة وهي تعمل بأمانة. تصميم الـ cloudlet لا يحقق كل حد بطريقة سحرية: إنه يحقق المهلة المتساهلة للتعرف على الوجوه ويخفق في الصارمة. هذه نتيجة حقيقية مقاسة عند الذيل (tail)، وهي بالضبط نوع العبارة التي يكتبها تقرير التصميم الجيد. بديل السحابة يخفق بفارق أكبر، لذلك فالحافة هي التوزيع الأفضل، لا التوزيع المثالي.

The trade-offs behind the placementالمفاضلات وراء هذا التوزيع

Latency is not the only reason for this split. Shi et al., summarizing Ha et al.’s cloudlet study for wearable cognitive assistance, report that offloading can cut energy use by 30 to 40%, which matters on a device with a battery the size of a stick of gum. They also argue that processing at the edge protects privacy better than uploading raw data to the cloud, and faces are among the most sensitive data there is.

التأخير ليس السبب الوحيد لهذا التقسيم. فـ Shi et al.، في تلخيصهم لدراسة Ha et al. عن الـ cloudlet للمساعدة المعرفية القابلة للارتداء، يذكرون أن نقل المعالجة قد يخفض استهلاك الطاقة بنسبة 30 إلى 40%، وهذا مهم في جهاز ببطارية بحجم قطعة علكة. ويرون أيضًا أن المعالجة على الحافة تحمي الخصوصية أفضل من رفع البيانات الخام إلى السحابة، والوجوه من أكثر البيانات حساسية على الإطلاق.

The price is dependence. The glasses now need a working wireless link and an edge site near wherever the wearer walks. Edge sites are few and expensive, so scalability and reach are limited. The cloud has global reach and elastic capacity, but it misses the tight end of the budget. That is exactly why the design keeps both, and why every placement you propose should name what it gains and what it gives up.

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

TaskالمهمةττLayerالطبقةReasonالسبب
Capture and downscale camera frameالتقاط إطار الكاميرا وتصغير دقتهEvery frameكل إطارMist (glasses)Mist (النظارة)Raw video is heavy; shrink it before it touches the radioالفيديو الخام ثقيل، فقلّصه قبل أن يصل إلى الراديو
Render the overlay on the displayرسم الطبقة المضافة على الشاشة≈ 20 ms display loop≈ 20 ms حلقة العرضMist (glasses)Mist (النظارة)Must follow head motion; no network trip fitsيجب أن تتبع حركة الرأس، ولا تتسع لأي رحلة عبر الشبكة
Detect and recognize faces or objectsاكتشاف الوجوه أو الأشياء والتعرف عليها370 to 1000 ms370 إلى 1000 msEdge (cloudlet)الحافة (cloudlet)Too heavy for the glasses, too slow via the cloudأثقل من أن تتحمله النظارة، وأبطأ من اللازم عبر السحابة
Generate guidance textتوليد نص الإرشاد600 ms to 2.7 s600 ms إلى 2.7 sEdge (cloudlet)الحافة (cloudlet)Needs the recognition result, which already lives thereيحتاج إلى نتيجة التعرف، الموجودة هناك أصلًا
Store history and photosتخزين السجل والصورSeconds or moreثوانٍ أو أكثرCloudالسحابةDurable, cheap, reachable from any deviceتخزين دائم ورخيص ويمكن الوصول إليه من أي جهاز
Retrain recognition modelsإعادة تدريب نماذج التعرفHoursساعاتCloudالسحابةNeeds large datasets and GPU poolsيحتاج إلى مجموعات بيانات كبيرة ومجمّعات GPU
Model answer for smart glassesالإجابة النموذجية للنظارات الذكية

Recall

Without looking: list the tasks of a smart-glasses face-recognition pipeline and place each on the continuum.من دون النظر: اسرد مهام خط معالجة التعرف على الوجوه في النظارات الذكية وضع كل مهمة على المتصل.

Capture, compression and overlay rendering on the glasses (mist). Detection and recognition on an edge cloudlet, with τ of 370 to 1000 ms. Storage and model training in the cloud. Justification: the cloud added 100 to 200 ms over a cloudlet in Chen et al., and cloudlet offloading cut energy use by 30 to 40% in Ha et al., as summarized by Shi et al.
الالتقاط والضغط ورسم الطبقة المضافة على النظارة (mist). والاكتشاف والتعرف على cloudlet طرفي، مع τ من 370 إلى 1000 ms. والتخزين وتدريب النماذج في السحابة. التبرير: أضافت السحابة 100 إلى 200 ms مقارنة بالـ cloudlet في Chen et al.، وخفض نقل المعالجة إلى الـ cloudlet استهلاك الطاقة بنسبة 30 إلى 40% في Ha et al.، كما لخّصه Shi et al.

Quick checkاختبار سريع

Moving face recognition from the smart glasses to a nearby edge server mainly trades what?نقل التعرف على الوجوه من النظارات الذكية إلى خادم حافة قريب يقايض أساسًا بين ماذا وماذا؟

Picture a warehouse worker holding a tablet. Overlays mark the next shelves to pick from, a ring counts progress, and a green arrow on the floor says the target is 12 m ahead. It looks like one app. For design purposes it is at least six tasks with deadlines that range from milliseconds to hours. That is the central idea of this concept: τ belongs to a task, not to an app, and a single app routinely needs every layer of the continuum at once.

تخيّل عاملًا في مستودع يحمل جهازًا لوحيًا. طبقات مضافة تحدد الرفوف التالية التي يلتقط منها، وحلقة تعدّ التقدم، وسهم أخضر على الأرض يقول إن الهدف على بعد 12 m أمامه. يبدو تطبيقًا واحدًا. لكنه لأغراض التصميم ست مهام على الأقل، بمهل تتراوح من الملّي ثانية إلى الساعات. هذه هي الفكرة المركزية في هذا المفهوم: τ تخص المهمة لا التطبيق، وكثيرًا ما يحتاج تطبيق واحد إلى كل طبقات المتصل في الوقت نفسه.

Motion-to-photon: the tightest budget in the courseMotion-to-photon: أضيق ميزانية في المقرر

Both augmented and virtual reality are governed by one deadline, so it pays to understand it before designing either. When you move your head, or the tablet, the image must move with you. The time from the movement to the matching light leaving the display is motion-to-photon (MTP) latency. If it is too long, your eyes and your inner ear disagree. Elbamby et al. explain that high MTP sends conflicting signals to the vestibulo-ocular reflex, which can cause motion sickness. In AR the failure is also visible: a virtual label that lags behind a real shelf is noticed at once, because the real world is the reference.

الواقع المعزز والواقع الافتراضي كلاهما محكوم بمهلة واحدة، لذلك يفيدك أن تفهمها قبل تصميم أي منهما. عندما تحرك رأسك، أو الجهاز اللوحي، يجب أن تتحرك الصورة معك. الزمن من الحركة إلى خروج الضوء المطابق من الشاشة هو تأخير motion-to-photon (MTP). إذا طال، تختلف عيناك مع أذنك الداخلية. يشرح Elbamby et al. أن ارتفاع MTP يرسل إشارات متعارضة إلى المنعكس الدهليزي العيني (vestibulo-ocular reflex)، وهذا قد يسبب دوار الحركة. وفي AR يكون الفشل مرئيًا أيضًا: التسمية الافتراضية التي تتأخر عن رف حقيقي تُلاحظ فورًا، لأن العالم الحقيقي هو المرجع.

The research community broadly agrees on the ceiling. Elbamby et al. report a broad consensus that MTP must stay below 15 to 20 ms. RFC 9699 uses 20 ms at most for XR as a whole, and shows how little of it is left for computing once the display has taken its share:

يتفق المجتمع البحثي إلى حد كبير على السقف. يذكر Elbamby et al. وجود إجماع واسع على أن MTP يجب أن يبقى أقل من 15 إلى 20 ms. ويستخدم RFC 9699 حدًا أقصاه 20 ms لـ XR ككل، ويبيّن كم يتبقى منه للحوسبة بعد أن تأخذ الشاشة نصيبها:

12-13⏟display+7-8⏟sensing, rendering, RTT≤20 ms\underbrace{12\text{-}13}_{\text{display}} + \underbrace{7\text{-}8}_{\text{sensing, rendering, RTT}} \le 20\ \text{ms}
RFC 9699 motion-to-photon splitتقسيم motion-to-photon في RFC 9699

Estimates of the split vary. Elbamby et al. put display delay at about 10 to 15 ms, expected to fall to 5 ms, which leaves 14 ms for computing and communication. Either way, only a few milliseconds remain for any network trip, and a trip to a distant cloud does not fit even once.

تتفاوت تقديرات هذا التقسيم. يضع Elbamby et al. تأخير الشاشة عند نحو 10 إلى 15 ms، مع توقع انخفاضه إلى 5 ms، وهذا يترك 14 ms للحوسبة والاتصال. وفي الحالتين لا يتبقى إلا بضع ملّي ثوانٍ لأي رحلة عبر الشبكة، ورحلة إلى سحابة بعيدة لا تتسع حتى مرة واحدة.

One frame on a stopwatch: display takes most of the 20 ms; a remote round trip would need a second lap.إطار واحد على ساعة إيقاف: الشاشة تأخذ معظم الـ 20 ms، ورحلة ذهاب وعودة إلى خادم بعيد ستحتاج دورة ثانية.

The standard escape is reprojection, also called time warp: the device takes the last rendered frame and shifts it to match the newest head pose just before display. Reprojection is cheap, so it can run locally inside the MTP budget, and it means a heavy frame rendered elsewhere can arrive a little late without the image lagging behind your head. This one technique is what lets the heavy work leave the device at all.

المخرج المعتاد هو إعادة الإسقاط (reprojection)، وتسمى أيضًا time warp: يأخذ الجهاز آخر إطار مرسوم ويزيحه ليطابق أحدث وضعية للرأس قبيل العرض مباشرة. إعادة الإسقاط رخيصة، لذلك يمكن أن تعمل محليًا داخل ميزانية MTP، وهي تعني أن إطارًا ثقيلًا رُسم في مكان آخر يمكن أن يصل متأخرًا قليلًا من دون أن تتأخر الصورة عن رأسك. هذه التقنية الواحدة هي ما يسمح للعمل الثقيل بمغادرة الجهاز أصلًا.

Warehouse AR: six tasks, four layersالواقع المعزز في المستودع: ست مهام، أربع طبقات

Worked exampleمثال محلول

Architecting warehouse AR pickingتصميم معمارية الالتقاط بالواقع المعزز في المستودع

  1. 1. List the tasks1. اسرد المهام

    Camera and motion-sensor (IMU) pose tracking; anchoring overlays to shelves and drawing arrows; recognizing shelf labels and items; looking up the pick list and inventory for this warehouse; optimizing routes across all pickers; fleet-wide analytics and demand forecasting.
    تتبع الوضعية (pose tracking) بالكاميرا ومستشعر الحركة (IMU)؛ وتثبيت الطبقات المضافة على الرفوف ورسم الأسهم؛ والتعرف على ملصقات الرفوف والأصناف؛ والبحث في قائمة الالتقاط والمخزون لهذا المستودع؛ وتحسين المسارات لجميع العاملين؛ والتحليلات على مستوى الأسطول كله والتنبؤ بالطلب.
  2. 2. Set τ per task2. حدّد τ لكل مهمة

    Tracking and anchoring share the 20 ms MTP budget, of which only 7 to 8 ms remain for sensor processing, rendering and the Round-trip time (RTT) to the edge. Recognition can take a few hundred milliseconds: Nielsen’s 1 s keeps the flow of thought, and 0.1 s feels instant. Inventory lookups should finish within a second, routing within seconds, and analytics can take hours.
    يتقاسم التتبع والتثبيت ميزانية MTP البالغة 20 ms، ولا يتبقى منها إلا 7 إلى 8 ms لمعالجة المستشعرات والرسم وRTT إلى الحافة. ويمكن أن يستغرق التعرف بضع مئات من الملّي ثانية: حد Nielsen البالغ 1 s يحافظ على تدفق التفكير، و0.1 s يبدو فوريًا. وينبغي أن تنتهي عمليات البحث في المخزون خلال ثانية، والتوجيه خلال ثوانٍ، ويمكن أن تستغرق التحليلات ساعات.
  3. 3. Place each task3. ضع كل مهمة في مكانها

    Tracking and reprojection run on the device. Heavy rendering and recognition are offloaded to an Edge server in the building. The inventory database and route optimizer run on a Fog node, the warehouse server shared by every picker. Analytics across all warehouses run in the Cloud.
    يعمل التتبع وإعادة الإسقاط على الجهاز. ويُنقل الرسم الثقيل والتعرف إلى خادم edge داخل المبنى. وتعمل قاعدة بيانات المخزون ومحسّن المسارات على عقدة fog، أي خادم المستودع المشترك بين جميع العاملين. وتعمل التحليلات عبر كل المستودعات في cloud.
  4. 4. Check RT and trade-offs4. تحقّق من RT والمفاضلات

    RFC 9699 is blunt: running these rendering tasks in the cloud is not feasible, because end-to-end delays must be within a few milliseconds. The same RFC names heat and battery drain as reasons to offload at all. The fog node keeps shared state close and scales to the whole site, while the cloud gives reach across sites.
    RFC 9699 صريح: تشغيل مهام الرسم هذه في السحابة غير ممكن، لأن التأخير من الطرف إلى الطرف يجب أن يكون في حدود بضع ملّي ثوانٍ. ويذكر الـ RFC نفسه الحرارة واستنزاف البطارية سببين لـ offload (نقل المعالجة) من الأساس. عقدة الضباب تبقي الحالة المشتركة قريبة وتتوسع لتخدم الموقع كله، بينما تعطي السحابة انتشارًا عبر المواقع.
  5. Resultالنتيجة

    One app, four layers: the deadline of each task picks its layer, not the name of the app.
    تطبيق واحد، أربع طبقات: مهلة كل مهمة هي التي تختار طبقتها، لا اسم التطبيق.
TaskالمهمةττLayerالطبقةReasonالسبب
Camera and IMU pose trackingتتبع الوضعية بالكاميرا ومستشعر IMU≤ 20 ms motion to photon≤ 20 ms من الحركة إلى الضوءDeviceالجهازOnly 7 to 8 ms remain after the displayلا يتبقى إلا 7 إلى 8 ms بعد الشاشة
Anchor overlays, render arrowsتثبيت الطبقات المضافة ورسم الأسهمWithin the same 20 msضمن الـ 20 ms نفسهاDevice, heavy parts on in-building edgeالجهاز، والأجزاء الثقيلة على حافة داخل المبنىOffloading cuts heat and battery drainنقل المعالجة يقلل الحرارة واستنزاف البطارية
Recognize shelf labels and itemsالتعرف على ملصقات الرفوف والأصنافa few hundred msبضع مئات من msEdgeالحافةHeavy vision work, still interactiveعمل بصري ثقيل، لكنه لا يزال تفاعليًا
Pick list and inventory lookupالبحث في قائمة الالتقاط والمخزون< 1 s< 1 sFog (warehouse server)الضباب (خادم المستودع)Shared by every picker on siteمشترك بين كل العاملين في الموقع
Route optimization across pickersتحسين المسارات لجميع العاملينSecondsثوانٍFogالضبابNeeds site-wide state, not per-frame speedيحتاج إلى حالة على مستوى الموقع، لا إلى سرعة لكل إطار
Fleet analytics and demand forecastingتحليلات الأسطول والتنبؤ بالطلبHoursساعاتCloudالسحابةCross-warehouse data, big computeبيانات عبر المستودعات وحوسبة ضخمة
Model answer for warehouse ARالإجابة النموذجية للواقع المعزز في المستودع

Notice the new role of the fog layer. Nothing in the smart-glasses design was shared between users, but a warehouse is a team. The pick list and the route optimizer serve every picker in the building, their deadline is around a second rather than a frame, and keeping them on site avoids sending every lookup to the cloud. Shared site state is the natural job of fog.

لاحظ الدور الجديد لطبقة الضباب. لم يكن شيء في تصميم النظارات الذكية مشتركًا بين المستخدمين، لكن المستودع فريق. قائمة الالتقاط ومحسّن المسارات يخدمان كل العاملين في المبنى، ومهلتهما نحو ثانية لا إطار واحد، وإبقاؤهما في الموقع يتجنب إرسال كل عملية بحث إلى السحابة. الحالة المشتركة على مستوى الموقع هي الوظيفة الطبيعية للضباب.

Recall

In the warehouse AR app, which task belongs on a fog node, and why?في تطبيق AR للمستودع، أي مهمة مكانها عقدة ضباب، ولماذا؟

The shared inventory and route-optimization service. Every picker in the building needs it, its τ is around a second rather than 20 ms, and keeping it on site avoids sending every lookup to the cloud. Cloud analytics still aggregate data across warehouses.
خدمة المخزون المشترك وتحسين المسارات. كل عامل في المبنى يحتاجها، وτ الخاصة بها نحو ثانية لا 20 ms، وإبقاؤها في الموقع يتجنب إرسال كل عملية بحث إلى السحابة. وتبقى تحليلات السحابة تجمع البيانات عبر المستودعات.

Quick checkاختبار سريع

In the warehouse AR app, which task has the tightest latency budget?في تطبيق AR للمستودع، أي مهمة لها أضيق ميزانية تأخير؟

Interactive VR: every pixel under the deadlineالواقع الافتراضي التفاعلي: كل بكسل تحت المهلة

Virtual reality shares the same budget, but raises the stakes: in AR only the overlay depends on MTP, while in VR every pixel you see does. The same four steps apply, and the same pattern appears, with a GPU-hungry rendering task pulled between a light headset and a distant data center.

يتشارك الواقع الافتراضي الميزانية نفسها، لكنه يرفع الرهان: في AR تعتمد الطبقة المضافة وحدها على MTP، أما في VR فكل بكسل تراه يعتمد عليه. تنطبق الخطوات الأربع نفسها، ويظهر النمط نفسه، مع مهمة رسم شرهة لـ GPU تتجاذبها نظارة رأس خفيفة ومركز بيانات بعيد.

Worked exampleمثال محلول

Architecting interactive VRتصميم معمارية الواقع الافتراضي التفاعلي

  1. 1. List the tasks1. اسرد المهام

    Head tracking, reprojection, frame rendering, encoding and streaming frames, physics and multiplayer state, the content library, and user profiles.
    تتبع الرأس، وإعادة الإسقاط، ورسم الإطارات، وترميز الإطارات وبثها، والفيزياء وحالة اللعب الجماعي، ومكتبة المحتوى، وملفات المستخدمين.
  2. 2. Set τ per task2. حدّد τ لكل مهمة

    Tracking through display: MTP under 15 to 20 ms. Multiplayer state: tens of milliseconds up to about 150 ms, borrowing G.114’s conversational figure as an analogy for social presence (an analogy, not a VR standard). Content downloads: seconds.
    من التتبع إلى العرض: MTP أقل من 15 إلى 20 ms. حالة اللعب الجماعي: من عشرات الملّي ثانية إلى نحو 150 ms، باستعارة رقم المحادثة في G.114 كتشبيه للحضور الاجتماعي (تشبيه، لا معيار خاص بـ VR). تنزيل المحتوى: ثوانٍ.
  3. 3. Place each task3. ضع كل مهمة في مكانها

    Tracking and reprojection on the headset. Full-quality rendering on an Edge GPU, which is what the lecturer means by “the edge manages frame rendering”. Session state on Fog or the nearest cloud region. The content library and large datasets in the Cloud.
    التتبع وإعادة الإسقاط على نظارة الرأس. والرسم بالجودة الكاملة على GPU في edge، وهذا ما يقصده المحاضر بعبارة “the edge manages frame rendering” (الحافة تتولى رسم الإطارات). وحالة الجلسة على fog أو أقرب منطقة سحابية. ومكتبة المحتوى ومجموعات البيانات الكبيرة في cloud.
  4. 4. Check RT and trade-offs4. تحقّق من RT والمفاضلات

    Elbamby et al. report that online VR computing can take up to 100 ms and the communication delay from the network edge to a server can reach 40 ms. Even ideal 4G loopback latency is 25 ms, already above 20 ms before any rendering. Remote cloud servers suit only low-resolution, non-interactive VR where the whole 360° video can be streamed ahead.
    يذكر Elbamby et al. أن حوسبة VR عبر الإنترنت قد تستغرق حتى 100 ms، وأن تأخير الاتصال من حافة الشبكة إلى الخادم قد يصل إلى 40 ms. وحتى تأخير الحلقة الراجعة المثالي في 4G يبلغ 25 ms، أي أعلى من 20 ms قبل أي رسم. خوادم السحابة البعيدة لا تناسب إلا VR منخفض الدقة وغير تفاعلي، يمكن فيه بث فيديو 360° كاملًا مسبقًا.
  5. Resultالنتيجة

    Headset protects the frame deadline, edge supplies GPU power, cloud supplies content.
    نظارة الرأس تحمي مهلة الإطار، والحافة توفّر قدرة GPU، والسحابة توفّر المحتوى.
TaskالمهمةττLayerالطبقةReasonالسبب
Head trackingتتبع الرأس< 15 to 20 ms MTP< 15 إلى 20 ms MTPHeadsetنظارة الرأسStarts the motion-to-photon clockيبدأ ساعة motion-to-photon
Reprojection (time warp)إعادة الإسقاط (time warp)Inside the MTP budgetداخل ميزانية MTPHeadsetنظارة الرأسFixes the pose even when a remote frame is lateيصحح الوضعية حتى عندما يتأخر إطار بعيد
Full-quality frame renderingرسم الإطارات بالجودة الكاملةPer frameلكل إطارEdge GPUGPU على الحافةToo heavy for a light headset, too far for the cloudأثقل من أن تتحمله نظارة خفيفة، وأبعد من اللازم في السحابة
Physics and multiplayer stateالفيزياء وحالة اللعب الجماعيtens of ms up to ≈ 150 msمن عشرات ms إلى ≈ 150 msFog or nearest regionالضباب أو أقرب منطقةShared by all players in a sessionمشتركة بين كل اللاعبين في الجلسة
Content library and assetsمكتبة المحتوى والأصولSecondsثوانٍCloudالسحابةLarge, rarely changing, globalكبيرة ونادرة التغيّر وعالمية
User profilesملفات المستخدمينSecondsثوانٍCloudالسحابةDurable records, no frame deadlineسجلات دائمة بلا مهلة إطار
Model answer for interactive VRالإجابة النموذجية للواقع الافتراضي التفاعلي

The trade-offs are sharp. An edge GPU per site is expensive, so each site serves a limited number of users. The alternative, a headset tethered by cable to a local PC, meets the budget but gives up mobility. In Latency budget terms, every design is judged the same way: does the per-frame Response time (RT) fit inside MTP, measured at the tail rather than the average?

المفاضلات حادة. وجود GPU طرفي في كل موقع مكلف، لذلك يخدم كل موقع عددًا محدودًا من المستخدمين. والبديل، نظارة رأس موصولة بكابل إلى حاسوب محلي، يحقق الميزانية لكنه يتنازل عن حرية التنقل. وبلغة latency budget، يُحكم على كل تصميم بالطريقة نفسها: هل يتسع response time لكل إطار داخل MTP، مقاسًا عند الذيل لا المتوسط؟

Recall

Why can a VR headset not send every frame to a distant cloud for rendering?لماذا لا تستطيع نظارة VR إرسال كل إطار إلى سحابة بعيدة لرسمه؟

Motion-to-photon must stay under about 15 to 20 ms. RFC 9699 leaves only 7 to 8 ms after the display, while Elbamby et al. report up to 40 ms of edge-to-server communication delay and 25 ms for ideal 4G loopback. So per-frame work stays on the headset or a nearby edge GPU with local reprojection, and the cloud serves content and datasets.
يجب أن يبقى motion-to-photon أقل من نحو 15 إلى 20 ms. لا يترك RFC 9699 إلا 7 إلى 8 ms بعد الشاشة، بينما يذكر Elbamby et al. تأخير اتصال يصل إلى 40 ms من الحافة إلى الخادم، و25 ms للحلقة الراجعة المثالية في 4G. لذلك يبقى العمل الخاص بكل إطار على النظارة أو على GPU طرفي قريب مع إعادة إسقاط محلية، وتخدم السحابة المحتوى ومجموعات البيانات.

Quick checkاختبار سريع

A VR headset must keep motion-to-photon latency within about 20 ms. Where should head-pose reprojection run?يجب أن تُبقي نظارة VR تأخير motion-to-photon في حدود 20 ms تقريبًا. أين ينبغي أن تعمل إعادة الإسقاط لوضعية الرأس؟

Put the three designs side by side and one pattern falls out. The lecturer’s reference answers below are a compact version of the tables you built above. If you placed recognition, sensor interaction and rendering at the edge and storage and analytics in the cloud, you have the same architecture.

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

ApplicationالتطبيقEdge roleدور الحافةCloud roleدور السحابةDriving ττ المحدِّدة
Smart glasses (AR)النظارات الذكية (AR)Recognize nearby objects or facesالتعرف على الأشياء أو الوجوه القريبةStorage and complex computationالتخزين والحوسبة المعقدة370 to 1000 ms per recognition370 إلى 1000 ms لكل عملية تعرف
Industrial ARAR الصناعيReal-time interaction with sensorsالتفاعل اللحظي مع المستشعراتLarge datasets and analyticsمجموعات البيانات الكبيرة والتحليلات≤ 20 ms MTP, < 1 s lookups≤ 20 ms MTP، و< 1 s لعمليات البحث
VR headsetsنظارات VRFrame rendering for smooth visualsرسم الإطارات لصورة سلسةProcessing large datasetsمعالجة مجموعات البيانات الكبيرة< 15 to 20 ms MTP< 15 إلى 20 ms MTP
Lecturer’s reference mappings, with the τ that drives each splitالتوزيعات المرجعية للمحاضر، مع τ التي تحدد كل تقسيم

Every app keeps the Cloud, and every app adds the Edge. What decides the Mapping of a task is a single comparison: is its deadline shorter than the cloud round trip plus the processing it needs? Recognizing a face, reacting to a sensor and drawing the next frame all have deadlines the cloud cannot meet. Storing photos, crunching datasets and training models have none, and they want exactly what the cloud is good at: scale, durability and reach.

كل تطبيق يحتفظ بـ cloud، وكل تطبيق يضيف edge. ما يحدد mapping (توزيع) المهمة هو مقارنة واحدة: هل مهلتها أقصر من رحلة الذهاب والعودة إلى السحابة زائد المعالجة التي تحتاجها؟ التعرف على وجه، والاستجابة لمستشعر، ورسم الإطار التالي، كلها لها مهل لا تستطيع السحابة الوفاء بها. أما تخزين الصور ومعالجة مجموعات البيانات وتدريب النماذج فليس لها مهل، وهي تريد بالضبط ما تجيده السحابة: الحجم والمتانة والانتشار.

Latency is the strongest force in that split, but not the only one. Satyanarayanan’s SEC 2017 keynote gives three reasons to use the edge, and all three appeared in the exercises. Latency, in both mean and tail, drives rendering and recognition. Bandwidth, both peak and average, explains why glasses and AR tablets should not stream raw video to a distant data center. Privacy, which he calls an exposure firewall for the IoT, explains keeping faces on a nearby server.

التأخير أقوى قوة في هذا التقسيم، لكنه ليس الوحيد. تعطي كلمة Satyanarayanan الرئيسية في SEC 2017 ثلاثة أسباب لاستخدام الحافة، وقد ظهرت الثلاثة كلها في التمارين. التأخير، بمتوسطه وذيله، يحرّك قرار الرسم والتعرف. وعرض النطاق (bandwidth)، في ذروته ومتوسطه، يفسّر لماذا لا ينبغي للنظارات وأجهزة AR اللوحية أن تبث فيديو خامًا إلى مركز بيانات بعيد. والخصوصية، التي يسميها جدار حماية من الانكشاف (exposure firewall) لإنترنت الأشياء، تفسّر إبقاء الوجوه على خادم قريب.

The whole lecture in one pictureالمحاضرة كلها في صورة واحدة

That pattern is the lecture’s conclusion in miniature. Before, you architected an application on a single Server layer: pick a machine, deploy the backend, done. Now, because data, IoT devices and machine learning produce and consume so much close to the user, the server is spread across the Edge-to-cloud (E2C) continuum.

هذا النمط هو خلاصة المحاضرة في صورة مصغّرة. في السابق كنت تصمم معمارية التطبيق على server layer (طبقة خادم) واحدة: اختر جهازًا، وانشر الخلفية، وانتهى الأمر. أما الآن، فلأن البيانات وأجهزة إنترنت الأشياء وتعلم الآلة تنتج وتستهلك الكثير قرب المستخدم، صار الخادم موزعًا على E2C continuum.

Before, one server layer. After, the same service spread across device, edge, fog and cloud, and checked against τ.قبل: طبقة خادم واحدة. بعد: الخدمة نفسها موزعة على الجهاز والحافة والضباب والسحابة، ومقارنة مع τ.

That changes the unit of design. You no longer place a server; you place each task of each service Service pipeline. And a placement needs a criterion. The lecture chooses response time, written as a function of Latency and Processing time (PT). Its concrete form generalizes the budget condition from the start of this part to a pipeline that crosses several layers:

هذا يغيّر وحدة التصميم. لم تعد تضع خادمًا؛ بل تضع كل مهمة من كل pipeline (خط معالجة) لخدمة. والتوزيع يحتاج إلى معيار. تختار المحاضرة زمن الاستجابة، مكتوبًا كدالة في latency وprocessing time. وصيغته الملموسة تعمّم شرط الميزانية من بداية هذا الجزء على خط معالجة يعبر عدة طبقات:

RT=f(Latency,PT)=∑hopsLh+∑iPTiRT = f(\text{Latency}, PT) = \sum_{\text{hops}} L_h + \sum_{i} PT_i
Summary formula: every network hop plus every task's processing time. With one layer it reduces to L1 + L2 + PTالصيغة الملخِّصة: كل قفزة شبكية مضافًا إليها زمن معالجة كل مهمة. ومع طبقة واحدة تختزل إلى L1 + L2 + PT

Response time is the right criterion because it is what users actually experience, and because it keeps both levers in view. A faster server only shrinks the processing terms; placement is what shrinks the latency terms. Every argument in this part, from the fog example that missed by 10 ms to the headset that cannot afford one 4G round trip, was an argument about which lever was available.

زمن الاستجابة هو المعيار الصحيح لأنه ما يعيشه المستخدمون فعلًا، ولأنه يبقي الرافعتين كلتيهما في الصورة. الخادم الأسرع يقلّص حدود المعالجة فقط؛ والتوزيع هو ما يقلّص حدود التأخير. كل حجة في هذا الجزء، من مثال الضباب الذي أخفق بفارق 10 ms إلى نظارة الرأس التي لا تحتمل رحلة ذهاب وعودة واحدة عبر 4G، كانت حجة حول أي رافعة كانت متاحة.

The design loopحلقة التصميم

  1. Break the service into a pipeline of tasks.قسّم الخدمة إلى خط معالجة من المهام.
  2. Set τ for each task from a published source.حدّد τ لكل مهمة من مصدر منشور.
  3. Choose a Mapping of tasks to Device, Edge, Fog and Cloud.اختر mapping (توزيعًا) للمهام على device وedge وfog وcloud.
  4. Compute RT from latency and processing time, at a percentile.احسب RT من التأخير ووقت المعالجة، عند مئين (percentile).
  5. Check RT ≤ τ and weigh battery, privacy, cost and reach. If it fails, remap and repeat.تحقّق من RT ≤ τ ووازن البطارية والخصوصية والتكلفة والانتشار. إذا فشل، أعد التوزيع وكرّر.

Recall

State the lecture summary in one sentence, including the design criterion.اذكر خلاصة المحاضرة في جملة واحدة، متضمنة معيار التصميم.

The server is no longer one layer: each pipeline task is mapped to a layer of the E2C continuum, and mappings are judged by response time, RT = f(latency, PT), against τ.
لم يعد الخادم طبقة واحدة: كل مهمة في خط المعالجة توزَّع على طبقة من متصل E2C، ويُحكم على التوزيعات بزمن الاستجابة، RT = f(latency, PT)، مقابل τ.

Recall

Write the latency budget condition and name each term.اكتب شرط ميزانية التأخير وسمِّ كل حد فيه.

RT ≤ τ, with RT = latency to the server + processing time + latency back. τ is the maximum acceptable end-to-end response time, set by the application and its users, not by the network.
RT ≤ τ، حيث RT = latency to the server + processing time + latency back (التأخير إلى الخادم زائد وقت المعالجة زائد تأخير العودة). τ هي أقصى زمن استجابة مقبول من الطرف إلى الطرف، ويحددها التطبيق ومستخدموه، لا الشبكة.

Quick checkاختبار سريع

According to the lecture summary, what is mapped to a layer of the E2C continuum?وفقًا لخلاصة المحاضرة، ما الذي يوزَّع على طبقة من طبقات متصل E2C؟

Where the course goes nextإلى أين يتجه المقرر بعد ذلك

Placing a task on a layer is still abstract. In practice it means running that task inside a virtual machine or a container on that layer. Satyanarayanan’s keynote notes that cloudlets can run lighter-weight containers such as Docker inside VMs, which is exactly what the virtualization and container lectures build.

وضع مهمة على طبقة لا يزال أمرًا مجردًا. عمليًا يعني تشغيل تلك المهمة داخل آلة افتراضية (VM) أو حاوية (container) على تلك الطبقة. تشير كلمة Satyanarayanan الرئيسية إلى أن الـ cloudlet يمكنها تشغيل حاويات أخف وزنًا مثل Docker داخل الآلات الافتراضية، وهذا بالضبط ما تبنيه محاضرات المحاكاة الافتراضية والحاويات.

Renting those layers means choosing a cloud model. NIST SP 800-145 defines the service models (SaaS, PaaS, IaaS) and the deployment models (private, community, public, hybrid). Those definitions are the subject of the cloud models lecture, and they decide who operates each layer in your mapping.

استئجار تلك الطبقات يعني اختيار نموذج سحابي. تعرّف وثيقة NIST SP 800-145 نماذج الخدمة (SaaS وPaaS وIaaS) ونماذج النشر (خاصة، ومجتمعية، وعامة، وهجينة). هذه التعريفات موضوع محاضرة النماذج السحابية، وهي التي تحدد من يشغّل كل طبقة في توزيعك.

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • τ is the maximum acceptable end-to-end response time. A mapping is feasible only if RT ≤ τ, where RT counts latency out, processing time and latency back.τ هو أقصى زمن استجابة مقبول من الطرف إلى الطرف. يكون التوزيع ممكنًا فقط إذا كان RT ≤ τ، حيث يشمل RT زمن الذهاب ووقت المعالجة وزمن العودة.
  • τ comes from people and physics: about 20 ms for XR motion-to-photon, 150 ms one-way for conversation, 200 ms for web interactions, 370 to 1000 ms for face recognition.تأتي τ من البشر والفيزياء: نحو 20 ms لزمن motion-to-photon في XR، و150 ms في اتجاه واحد للمحادثة، و200 ms لتفاعلات الويب، ومن 370 إلى 1000 ms للتعرف على الوجوه.
  • Check budgets at a percentile (p75, p90), not at the mean. Users feel the slow requests.تحقّق من الميزانيات عند مئين (p75 أو p90) لا عند المتوسط. فالمستخدمون يشعرون بالطلبات البطيئة.
  • Set τ per task, not per app. One AR app mixes 20 ms tracking with analytics that can take hours.حدّد τ لكل مهمة لا لكل تطبيق. فتطبيق AR واحد يجمع تتبعًا بمهلة 20 ms مع تحليلات قد تستغرق ساعات.
  • Tight-deadline tasks go to the device or edge. Shared site state goes to fog. Storage, training and analytics go to the cloud.المهام ذات المهل الضيقة تذهب إلى الجهاز أو الحافة. والحالة المشتركة على مستوى الموقع تذهب إلى الضباب (fog). والتخزين والتدريب والتحليلات تذهب إلى السحابة.
  • Offloading to the edge saves battery and keeps raw data private, but adds network dependence and needs edge sites where users are.نقل المعالجة (offloading) إلى الحافة يوفّر البطارية ويبقي البيانات الخام خاصة، لكنه يضيف اعتمادًا على الشبكة ويتطلب مواقع حافة قريبة من أماكن وجود المستخدمين.
  • Summary: the server now spans the E2C continuum. Each pipeline task is mapped individually, and response time is the guiding criterion.الخلاصة: الخادم صار ممتدًا على متصل E2C. تُوزَّع كل مهمة من مهام خط المعالجة (pipeline) على حدة، وزمن الاستجابة هو المعيار الموجِّه.

Sourcesالمصادر