1 / 232

Data Link Control

CHAPTER 11. Data Link Control. التحكم بربط البيانات . المهندسة : بنان عبد الكريم محمودي. introduction.

locke
Download Presentation

Data Link Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 11 Data Link Control التحكم بربط البيانات المهندسة : بنان عبد الكريم محمودي

  2. introduction • The two main functions of the data link layer are data link control and media access control. The first, data link control, deals with the design and procedures for communication between two adjacent nodes: node-to-node communication. The second function of the data link layer is media access control, or how to share the link. • الوظيفتين الأساسيتين لطبقة ربط البيانات هي التحكم بربط البيانات والتحكم بالوصول للوسط . أولا : التحكم بربط البيانات يتعامل مع التصميم والاجراءات للاتصال بين عقدتين متجاورتين node-to-node communication . • الوظيفة الثانية لطبقة ربط البيانات هي التحكم بالوصول للوسط او كيفية مشاركة الخط . • Data link control functions include framing, flow and error control, and software implemented protocols that provide smooth and reliable transmission of frames between nodes. • وظائف التحكم بربط البيانات تتضمن التأطير والتحكم بالتدفق والخطأ ، وبروتوكولات البرامج المطبقة التي تزود بارسال موثوق للاطارات بين العقد

  3. introduction • To implement data link control, we need protocols. Each protocol is a set of rules that need to be implemented in software and run by the two nodes involved in data exchange at the data link layer. • لتطبيق التحكم بوصل البيانات نحتاج لبروتوكولات . كل بروتوكول هو مجموعة من القواعد التي من الضروري أن تطبق في البرامج وتدار من قبل العقدتين المشتركتين في تبادل البيانات في طبقة وصل البيانات . • We discuss five protocols: two for noiseless (ideal) channels and three for noisy (real) channels. • يوجد خمس بروتوكولات اثنان لقنوات خالية من الضجيج (مثالية ) وثلاثة لقنوات تحوي ضجيج (حقيقية ) .

  4. FRAMING • Data transmission in the physical layer means moving bits in the form of a signal from the source to the destination. The physical layer provides bit synchronization to ensure that the sender and receiver use the same bit durations and timing. • تراسل البيانات في الطبقة الفيزيائية تعني نقل البتات بشكل إشارة من المصدر إلى الهدف . الطبقة الفيزيائية تزود ببتات مزامنة للتأكد من أن المرسل والمستقبل يستخدموا نفس مدة البت والتوقيت . • The data link layer, needs to pack bits into frames, so that each frame is distinguishable from another. • طبقة وصل البيانات تحتاج لوضع بتات داخل الإطارات وذلك لتمييز إطار عن آخر .

  5. FRAMING • Our postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one piece of information from another, each envelope defines the sender and receiver addresses since the postal system is a many-to-many carrier facility. • النظام البريدي يزاول نوع من التأطير . إدخال الرسالة في ظرف يفصل قطعة من المعلومات عن الأخرى وكل ظرف يعرف عنوان المرسل والمستقبل حيث نظام البريد هو وسيلة نقل many-to-many • Framing in the data link layer separates a message from one source to a destination, by adding a sender address and a destination address. The destination address defines where the packet is to go; the sender address helps the recipient acknowledge the receipt. • التأطير في طبقة ربط البيانات يفصل الرسالة من مصدر واحد إلى الهدف بإضافة عنوان المرسل وعنوان الهدف . عنوان الهدف يعرف أين ستذهب الرزمة ، وعنوان المرسل يساعد المستقبل على ارسال اقرار بالاستلام .

  6. FRAMING • Although the whole message could be packed in one frame, that is not normally done. One reason is that a frame can be very large, making flow and error control very inefficient. When a message is carried in one very large frame, even a single-bit error would require the retransmission of the whole message. When a message is divided into smaller frames, a single-bit error affects only that small frame. • بالرغم من أن الرسالة يمكن أن تكون في إطار واحد ولكن عادة لايتم ذلك واحد الأسباب لذلك هو أن الإطار يمكن أن يكون كبير جدا وبالتالي التحكم بالتدفق والخطأ لايتم بكفاءة . عندما تحمل الرسالة في إطار كبير جدا فأي خطأ في بت وحيد سيتطلب إعادة إرسال كامل الرسالة . أما عندما تقسم الرسالة إلى إطارات صغيرة الخطأ في بت وحيد سيؤثر فقط على الإطار الصغير .

  7. Fixed-Size Framingالتأطير ثابت الحجم • Frames can be of fixed or variable size. In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself can be used as a delimiter. An example of this type of framing is the ATM wide-area network, which uses frames of fixed size called cells. • الإطارات يمكن أن تكون ثابتة او متغيرة الحجم . في التأطير ثابت الحجم لاتوجد حاجة لتعريف حدود الإطار ، الحجم نفسه يمكن ان يستخدم كـdelimiter . كمثال على هذا النوع من التأطير هو شبكة ATM العالمية التي تستخدم الإطارات ذات الحجم الثابت والتي تسمى خلايا Cells .

  8. Variable-Size Framing التأطير متغير الحجم • Our main discussion in this chapter concerns variable-size framing, prevalent in local area networks. In variable-size framing, we need a way to define the end of the frame and the beginning of the next. Historically, two approaches were used for this purpose: a character-oriented approach and a bit-oriented approach. • مناقشتنا الرئيسية في هذا الفصل هي التأطير بحجم متغير السائد في الشبكات المحلية .في التأطير متغير الحجم نحتاج طريقة لتعريف نهاية الاطار وبداية الاطار التالي . تاريخيا استخدمت نظريتنا لهذا الهدف : character-oriented approach و bit-oriented approach

  9. Character-Oriented Protocols • In a character-oriented protocol, data to be carried are 8-bit characters from a coding system such as ASCII .The header, which normally carries the source and destination addresses and other control information, and the trailer, which carries error detection or error correction redundant bits, are also multiples of 8 bits. To separate one frame from the next, an 8-bit (I-byte) flag is added at the beginning and the end of a frame. The flag, composed of protocol-dependent special characters. Figure 11.1 shows the format of a frame in a character-oriented protocol. • هنا البيانات تحمل 8 بت من نظام التشفير مثل ASCII . الرأس الذي يحمل عناوين المصدر والهدف ومعلومات تحكم أخرى وتذييل يحمل بتات الزيادة لكشف الخطأ أو تصحيح الخطأ ، أيضا 8 بت . لفصل إطار عن آخر يضاف علم من البايت (8 بت أي 1 بايت ) إلى بداية ونهاية الاطار . العلم يتكون من بروتوكول يعتمد على الأحرف . • الشكل التالي يبين تهيئة اطار في بروتوكول الحرف الموجه

  10. Character-Oriented Protocols • Character-oriented framing was popular when only text was exchanged by the data link layers. The flag could be selected to be any character not used for text communication. Now, however, we send other types of information such as graphs, audio, and video. Any pattern used for the flag could also be part of the information. If this happens, the receiver, when it encounters this pattern in the middle of the data, thinks it has reached the end of the frame. To fix this problem, a byte-stuffing strategy was added to character-oriented framing. • هذا البرتوكول يستخدم عندما يتم تبادل نص فقط من قبل طبقة ربط البيانات . العلم يمكن أن يتم اختياره ليكون أي حرف لايستخدم في نص الاتصال . ولكن عند إرسال أنواع أخرى من المعلومات كالصور أو الصوت أو الفيديو . أي نمط يستخدم للعلم يمكن أن يكون جزء من المعلومات . وإذا حدث هذا المستقبل عندما يصادف هذا النمط في وسط البيانات يعتقد بأنه وصل إلى نهاية الإطار . لحل هذه المشكلة استراتيجية حشوة البايت تضاف إلى character-oriented framing

  11. Character-Oriented Protocols • In byte stuffing (or character stuffing), a special byte is added to the data section of the frame. This byte is usually called the escape character (ESC), which has a predefined bit pattern. Whenever the receiver encounters the ESC character, it removes it from the data section and treats the next character as data, not a delimiting flag. • في حشو البايت أو حشو الأحرف byte stuffing (or character stuffing) يضاف بايت خاص إلى قسم البيانات في الإطار . هذا البايت يدعى عادة escape character (ESC) ويعرف له نمط بت . عندما يصادف المستقبل escape character (ESC) يزيله من قسم البيانات ويعامل الرمز التالي كبيانات وليس كعلم محدد .

  12. Character-Oriented Protocols • Byte stuffing by the escape character allows the presence of the flag in the data section of the frame, but it creates another problem. What happens if the text contains one or more escape characters followed by a flag? The receiver removes the escape character, but keeps the flag, which is incorrectly interpreted as the end of the frame. To solve this problem, the escape characters that are part of the text must also be marked by another escape character. Figure 11.2 shows the situation. • حشوة البايت باستخدام escape character تسمح بوجود العلم في قسم البيانات للإطار ولكن تنشأ مشكلة ثانية . ماذا يحدث إذا احتوى النص واحد أو أكثر من escape characters متبوعين بعلم ؟ المستقبل يزيل escape character ولكن يبقي العلم ، الذي يترجم بشكل خاطئ كنهاية للاطار . ولحل هذه المشكلة يجب جعل escape characters الذي هو جزء من النص ملحوظ من قبل escape characters آخر .الشكل التالي يبين الحالة .

  13. Character-Oriented Protocols • Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text. • حشو البايت هو عملية إضافة 1 بايت إضافي حينما يكون هناك علم أو escape character في النص . • Character-oriented protocols present another problem in data communications. The universal coding systems in use today, such as Unicode, have 16-bit and 32-bit characters that conflict with 8-bit characters. We can say that in general, the tendency is moving toward the bit-oriented protocols that we discuss next. • Character-oriented protocols قدم مشكلة أخرى في اتصالات البيانات .أنظمة التشفيرالعالمية المستخدمة اليوم مثل نظام الحروف الدولي الموحد الذي يملك 16 بت و32 بت أحرف تتعارض مع 8 بت حرف . يمكن القول بشكل عام الاتجاه حاليا إلى بروتوكول bit-oriented protocols .

  14. Bit-Oriented Protocols • In a bit-oriented protocol, the data section of a frame is a sequence of bits to be interpreted by the upper layer as text, graphic, audio, video, and so on. However, in addition to headers (and possible trailers), we still need a delimiter to separate one frame from the other. Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning and the end of the frame, as shown in Figure 11.3. • في هذا البروتوكول قسم البيانات للإطار هو سلسلة من البتات ستترجم بالطبقة العليا كنص ، صور ، صوت ، فيديو وهكذا . بالإضافة إلى عناوين رأسية وتذييلات محتملة نبقى بحاجة إلى محدد delimiter لفصل إطار عن آخر . معظم البروتوكولات تستخدم محدد من 8 بت كعلم 01111110 لمعرفة بداية ونهاية الإطار كما في الشكل التالي :

  15. Bit-Oriented Protocols • This flag can create the same type of problem we saw in the byte-oriented protocols. That is, if the flag pattern appears in the data, we need to somehow inform the receiver that this is not the end of the frame. We do this by stuffing 1 single bit (instead of I byte) to prevent the pattern from looking like a flag. The strategy is called bit stuffing. In bit stuffing, if a 0 and five consecutive I bits are encountered, an extra 0 is added. This extra stuffed bit is eventually removed from the data by the receiver. This guarantees that the flag field sequence does not inadvertently appear in the frame. • هذا العلم يمكن أن ينشأ نفس نوع المشكلة التي رأيناها في byte-oriented protocols وهي أن يظهرنمط العلم في البيانات ، نحتاج لاخبار المستقبل بان هذا ليس نهاية الاطار . نعمل ذلك بحشو بت واحد بدلا من 1 بايت لمنع النمط من أن يبدو مثل العلم . هذه الإستراتيجية تسمى حشوة البت bit stuffing .في هذه الإستراتيجية إذا كان هناك 0 وخمس واحدات يضاف 0 زائد . هذا البت الزائد يزال من البيانات من قبل المستقبل . وهذا يضمن ان حقل العلم لن يظهر بشكل غير مقصود في الإطار

  16. Bit-Oriented Protocols • Bit stuffing is the process of adding one extra 0 whenever five consecutive 1 follow a 0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag. • حشو البت هو عملية إضافة 0 إضافي عند عند مرور خمس واحدات متتاليين بعد 0 ، لذلك المستقبل لايخطئ بالنمط 0111110 على أنه علم . • Figure 11.4 shows bit stuffing at the sender and bit removal at the receiver. • الشكل التالي يظهر حشو البت عند المرسل وإزالة البت عند المستقبل . • This means that if the flag like pattern 01111110 appears in the data, it will change to 011111010 (stuffed) and is not mistaken as a flag by the receiver.. • هذا يعني أنه إذا ظهر علم مثل النمط التالي 01111110 في البيانات سوف يتغير 011111010 ولن يخطئ به المستقبل

  17. FLOW AND ERROR CONTROLالتحكم بالتدفق والخطأ • Data communication requires at least two devices working together, one to send and the other to receive. Even such a basic arrangement requires a great deal of coordination for an intelligible exchange to occur. The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control. • اتصال البيانات يتطلب على الأقل جهازين يعملان معا واحد للإرسال وآخر للاستقبال . وهذا الترتيب الأساسي يتطلب الكثير من التنسيق حتى يحدث التبادل . المسؤولية الأكثر أهمية لطبقة ربط البيانات هي التحكم بالتدفق والتحكم بالخطأ . وهذه الوظائف تسمى التحكم بوصلة البيانات data link control

  18. Flow Controlالتحكم بالتدفق • Flow control coordinates the amount of data that can be sent before receiving an acknowledgment and is one of the most important duties of the data link layer. • التحكم بالتدفق ينسق كمية البيانات التي يمكن إرسالها قبل استقبال الإقرار وهو احد أهم واجبات طبقة وصل البيانات . • In most protocols, flow control is a set of procedures that tells the sender how much data it can transmit before it must wait for an acknowledgment from the receiver. The flow of data must not be allowed to overwhelm the receiver. • في معظم البروتوكولات التحكم بالتدفق هو مجموعة من الإجراءات التي تخبر المرسل كم من البيانات يمكن إرسالها قبل انتظار الإقرار من المستقبل . تدفق البيانات يجب أن لا تسمح بإغراق المستقبل

  19. Flow Controlالتحكم بالتدفق • Any receiving device has a limited speed at which it can process incoming data and a limited amount of memory in which to store incoming data. • أي جهاز استقبال له سرعة محددة يمكنها معالجة البيانات القادمة وكمية محددة من الذاكرة لتخزين البيانات القادمة • The receiving device must be able to inform the sending device before those limits are reached and to request that the transmitting device send fewer frames or stop temporarily. Incoming data must be checked and processed before they can be used. • جهاز الاستقبال يجب أن يكون قادرعلى إعلام جهاز الإرسال قبل وصول الحدود السابقة والطلب من جهاز الإرسال إرسال إطارات أقل أو التوقف مؤقتا . البيانات القادمة يجب أن تدقق وتعالج قبل إمكانية استخدامها

  20. Flow Controlالتحكم بالتدفق • The rate of such processing is often slower than the rate of transmission. For this reason, each receiving device has a block of memory, called a buffer, reserved for storing incoming data until they are processed. If the buffer begins to fill up, the receiver must be able to tell the sender to halt transmission until it is once again able to receive. • معدل هذه المعالجات عادة أبطأ من معدل الإرسال . ولهذا السبب كل جهاز استقبال له كتلة في الذاكرة تسمى العازل bufferمخصصة لتخزين البيانات القادمة حتى يتم معالجتهم . عندما يبدأ الحاجز بالامتلاء يجب على المستقبل أن يكون قادرا لإخبار المرسل لوقف الإرسال حتى يستطيع الاستقبال مرة ثانية .

  21. Flow Controlالتحكم بالتدفق • Summary : • Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. • التحكم بالتدفق يشير إلى مجموعة من الإجراءات المستخدمة لتحديد كمية البيانات التي يمكن للمرسل إرسالها قبل انتظار الإقرار

  22. Error Controlالتحكم بالخطأ • Error control is both error detection and error correction. It allows the receiver to inform the sender of any frames lost or damaged in transmission and coordinates the retransmission of those frames by the sender. In the data link layer, the term error control refers primarily to methods of error detection and retransmission. • التحكم بالخطأ هو كشف الخطأ وتصحيح الخطأ معا . يسمح للمستقبل لإعلام المرسل عن أي اطار ضائع أو اطار متضرر في الارسال وينسق إعادة الإرسال لهذه الإطارات الى المرسل . في طبقة وصلة البيانات مصطلح التحكم بالخطأ error control يشير بشكل أولي الى طرق كشف الخطأ وإعادة الارسال .

  23. Error Controlالتحكم بالخطأ • Error control in the data link layer is often implemented simply: Any time an error is detected in an exchange, specified frames are retransmitted. This process is called automatic repeat request (ARQ). • التحكم بالخطأ في طبقة ربط البيانات عادة يطبق ببساطة : في أي وقت الخطأ يكتشف اثناء التبادل الاطارات المحددة يعاد ارسالها . هذه العملية تسمى طلب التكرار الآلي (ARQ)

  24. Error Controlالتحكم بالخطأ • Error control in the data link layer is based on automatic repeat request, which is the retransmission of data. • التحكم بالخطأ في طبقة وصل البيانات يعتمد على طلب التكرار الآلي (ARQ) الذي هو إعادة إرسال للبيانات

  25. PROTOCOLS • Now let us see how the data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another. The protocols are normally implemented in software by using one of the common programming languages. To make our discussions language-free, we have written in pseudocode a version of each protocol that concentrates mostly on the procedure instead of delving into the details of language rules. • الآن سنرى كيف بإمكان طبقة ربط البيانات دمج التأطير ، التحكم بالتدفق ، والتحكم بالخطأ لانجاز تسليم البيانات من عقدة الى عقدة أخرى . البروتوكولات عادة تطبق في البرامج باستخدام إحدى لغات البرمجة العامة . وهنا نسخة أن كل بروتوكول يركز على الإجراء بدلا من الدخول لتفاصيل قواعد اللغة .

  26. PROTOCOLS • We divide the discussion of protocols into those that can be used for noiseless (error-free) channels and those that can be used for noisy (error-creating) channels. The protocols in the first category cannot be used in real life, but they serve as a basis for understanding the protocols of noisy channels. Figure 11.5 shows the classifications. • نقسم مناقشة البروتوكولات الى تلك التي تستخدم للقنوات بدن ضجيج (خالية من الخطأ ) والتي تستخدم لقنوات تحوي ضجيج (انشاء خطأ ) . البروتوكولات في المجموعة الأولى لايمكن استخدامها في الحياة الواقعية ، لكن يستفاد منهم كأساس لفهم بروتوكولات القنوات التي تحوي ضجيج . الشكل التالي يبين التصنيفات .

  27. PROTOCOLS • There is a difference between the protocols we discuss here and those used in real networks. All the protocols we discuss are unidirectional in the sense that the data frames travel from one node, called the sender, to another node, called the receiver. • هناك اختلاف بين البروتوكولات التي نشرحها وبين البروتوكولات المستخدمة في الشبكات الواقعية . كل البروتوكولات التي نشرحها وحيدة الاتجاه حيث إطارات البيانات تنتقل من عقدة تسمى المرسل الى عقدة أخرى تسمى المستقبل . • Although special frames, called acknowledgment (ACK) and negative acknowledgment (NAK) can flow in the opposite direction for flow and error control purposes, data flow in only one direction. • بالرغم من أن الإطارات الخاصة المسماة الإقرار الايجابي (ACK) والإقرار السلبي (NAK) يمكن أن تتدفق في اتجاه معاكس لهدف التحكم بالتدفق والتحكم بالخطأ ، البيانات تتدفق فقط في اتجاه واحد .

  28. PROTOCOLS • In a real-life network, the data link protocols are implemented as bidirectional; data flow in both directions. In these protocols the flow and error control information such as ACKs and NAKs is included in the data frames in a technique called piggybacking. • في شبكات الحياة الواقعية بروتوكولات ربط البيانات تطبق كثنائية الاتجاه ، البيانات تتدفق في كلا الاتجاهين . في هذه البروتوكولات معلومات التحكم بالتدفق والخطأ مثل ACKs and NAKs تضمن في إطارات البيانات من خلال تقنية تسمى piggybacking . • Because bidirectional protocols are more complex than unidirectional ones, we chose the latter for our discussion. If they are understood, they can be extended to bidirectional protocols. • بسبب أن بروتوكولات ثنائية الاتجاه أكثر تعقيدا من البروتوكولات وحيدة الاتجاه ، لذلك سنناقش البروتوكول وحيد الاتجاه فإذا تم فهمه يمكن فهم بروتوكولات ثتائية الاتجاه

  29. NOISELESS CHANNELS • Let us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. The first is a protocol that does not use flow control; the second is the one that does. Of course, neither has error control because we have assumed that the channel is a perfect noiseless channel. • لنفرض انه لدينا قناة مثالية لايوجد فيها إطارات مفقودة او مضاعفة او منحرفة . نقدم بروتوكولين لهذا النوع من القناة . البروتوكول الاول لايستخدم التحكم بالتدفق ، والثاني هو الذي يستخدم ذلك . طبعا لايوجد التحكم بالخطأ لأننا افترضنا أن القناة لاتحوي ضجيج

  30. Simplest Protocol • Our first protocol is one that has no flow or error control. Like other protocols we will discuss in this chapter, it is a unidirectional protocol in which data frames are traveling in only one direction-from the sender to receiver. We assume that the receiver can immediately handle any frame it receives with a processing time that is small enough to be negligible. • البروتوكول الاول لايملك تحكم بالتدفق او تحكم بالخطأ ومثل البروتوكولات الأخرى التي سنشرحها في هذا الفصل هو بروتوكول وحيد الاتجاه حيث إطارات البيانات تنتقل في اتجاه واحد من المرسل الى المستقبل . نفترض ان المستقبل يمكنه ان يعالج فورا أي اطار يستقبله بوقت معالجة صغير بشكل كافي ليكون مهملا .

  31. Simplest Protocol • The data link layer of the receiver immediately removes the header from the frame and hands the data packet to its network layer, which can also accept the packet immediately. In other words, the receiver can never be overwhelmed with incoming frames. • طبقة ربط البيانات عند المستقبل مباشرة يزيل عنوان الرأس من الإطار ويحمل رزمة البيانات الى طبقة الشبكة التي يمكنها أيضا قبول الرزمة مباشرة . بكلمات أخرى المستقبل لا يمكن ان يغرق بالإطارات القادمة

  32. Simplest Protocol • Design • There is no need for flow control in this scheme. The data link layer at the sender site gets data from its network layer, makes a frame out of the data, and sends it. The data link layer at the receiver site receives a frame from its physical layer, extracts data from the frame, and delivers the data to its network layer. • هنا لايوجد حاجة للتحكم بالتدفق في هذا المخطط . طبقة وصلة البيانات في موقع المرسل تحصل على البيانات من طبقة شبكتها . تصنع اطار من خارج البيانات وترسله . طبقة وصل البيانات في موقع المستقبل تستقبل الإطار من طبقتها الفيزيائية وتستخلص البيانات من الإطار وتوصل البيانات لطبقة شبكتها .

  33. Simplest Protocol • Design • The data link layers of the sender and receiver provide transmission services for their network layers. The data link layers use the services provided by their physical layers (such as signaling, multiplexing, and so on) for the physical transmission of bits. Figure 11.6 shows a design. • طبقات وصلة البيانات للمرسل والمستقبل تزود بخدمات الارسال لطبقات شبكاتهم. طبقات وصلة البيانات تستخدم الخدمات المزودة من قبل طبقاتهم الفيزيائية (مثل الاشارات والتجميع وغيرها ) للارسال الفيزيائي للبتات . الشكل التالي يبين التصميم .

  34. Simplest Protocol • Design • We need to elaborate on the procedure used by both data link layers. The sender site cannot send a frame until its network layer has a data packet to send. The receiver site cannot deliver a data packet to its network layer until a frame arrives. If the protocol is implemented as a procedure, we need to introduce the idea of events in the protocol. • نحتاج للتوسع على الاجرء المستخدم من قبل كلتا طبقة وصلة البيانات . موقع المرسل لايمكنه إرسال اطار حتى يكون لطبقة الشبكة رزمة بيانات للارسال . موقع المستقبل لايمكنه توصيل رزمة البيانات الى طبقة شبكته حتى يصل الاطار . إذا طبق البروتوكول كإجراء نحتاج لتقديم فكرة عن الأحداث في البروتوكول .

  35. Simplest Protocol • Design • The procedure at the sender site is constantly running; there is no action until there is a request from the network layer • الإجراء في موقع المرسل يجري بشكل ثابت ، لايكون هناك عمل حتى يكون هناك طلب من طبقة الشبكة . • The procedure at the receiver site is also constantly running, but there is no action until notification from the physical layer arrives. • الإجراء عند موقع المستقبل أيضا يجري بشكل ثابت ولكن لايوجد هناك عمل حتى يصل تبليغ من الطبقة الفيزيائية . • Both procedures are constantly running because they do not know when the corresponding events will occur. • كلا الاجرائين يجريان بشكل ثابت لأنهم لايعلمون متى الأحداث المطابقة ستحدث

  36. Simplest Protocol • Algorithms • Algorithm 11.1 shows the procedure at the sender site. • الخوارزمية التالية تبين الإجراء عند موقع المرسل

  37. Simplest Protocol • Analysis • The algorithm has an infinite loop, which means lines 3 to 9 are repeated forever once the program starts. The algorithm is an event-driven one, which means that it sleeps (line 3) until an event wakes it up (line 4). This means that there may be an undefined span of time between the execution of line 3 and line 4; there is a gap between these actions. When the event, a request from the network layer, occurs, lines 6 though 8 are executed. • الخوارزمية لها حلقة لانهائية وهذا يعني ان الخطوات من 3 الى 9 سوف تتكرر الى مالا نهاية حالما يبدأ البرنامج . الخوارزمية من نوع event-driven one مما يعني أن (السطر(3 ينام حتى يوجد حدث يوقظه (السطر4) . هذا يعني انه قد يكون هناك مدى غير معرف من الوقت بين تنفيذ السطر 3 والسطر 4 ، هناك فجوة بين هذه الأفعال . عندما يتم حدوث طلب من طبقة الشبكة السطر 6 الى السطر 8 ينفذوا

  38. Simplest Protocol • Analysis • The program then repeats the loop and again sleeps at line 3 until the next occurrence of the event. We have written pseudocode for the main process. We do not show any details for the modules GetData, MakeFrame, and SendFrame. GetData() takes a data packet from the network layer, MakeFrame() adds a header and delimiter flags to the data packet to make a frame, and SendFrame() delivers the frame to the physical layer for transmission. • البرنامج بعدها يكرر الحلقة ثم ينام عند السطر 3 حتى الحدوث التالي للحدث . نحن كتبنا الكود للعملية الأساسية . لم نظهر أية تفاصيل للوحدات GetData, MakeFrame, and SendFrame • GetData() يأخذ رزمة البيانات من طبقة الشبكة • MakeFrame()تضيف رأس وعلم محدد الى رزمة البيانات لصنع الاطار ، • SendFrame() توصل الاطار الى الطبقة الفيزيائية للارسال

  39. Simplest Protocol • Algorithms • Algorithm 11.2 shows the procedure at the receiver site. • الخوارزمية التالية تبين الإجراء عند موقع المستقبل

  40. Analysis • This algorithm has the same format as Algorithm 11.1, except that the direction of the frames and data is upward. The event here is the arrival of a data frame. After the event occurs, the data link layer receives the frame from the physical layer using the ReceiveFrame( )process, extracts the data from the frame using the ExtractData() process, and delivers the data to the network layer using the DeliverData() process. Here, we also have an event-driven algorithm because the algorithm never knows when the data frame will arrive. • الخوارزمية هنا لها نفس شكل الخوارزمية السابقة ماعدا اتجاه الإطارات والبيانات تكون صاعدة . الحدث هنا هو وصول اطار البيانات . بعد حدوث الحدث طبقة وصلة البيانات تستقبل الاطار من الطبقة الفيزيائية باستخدام عملية ReceiveFrame( )process وتستخلص البيانات من الاطار باستخدام ExtractData() process وتوصل البيانات الى طبقة الشبكة باستخدام DeliverData() process . هنا أيضا لدينا خوارزمية من النوع event-driven algorithm وذلك بسبب ان الخوارزمية لاتعلم متى سيصل اطار البيانات .

  41. Example 11.1 • Figure 11.7 shows an example of communication using this protocol. It is very simple. The sender sends a sequence of frames without even thinking about the receiver. To send three frames, three events occur at the sender site and three events at the receiver site. Note that the data frames are shown by tilted boxes; the height of the box defines the transmission time difference between the first bit and the last bit in the frame. • الشكل التالي يبين مثال للاتصال باستخدام هذا البروتوكول . وهو بسيط جدا . المرسل يرسل سلسلة من الإطارات بدون أي تفكير بشأن المستقبل . لإرسال ثلاث إطارات ثلاثة أحداث تحدث عند موقع المرسل وثلاثة أحداث تحدث عند موقع المستقبل . نلاحظ ان اطار البيانات يظهر في صندوق ارتفاع الصندوق يعرف اختلاف وقت الارسال بين البت الاول والبت الأخير في الاطار

  42. Stop-and-Wait Protocol • If data frames arrive at the receiver site faster than they can be processed, the frames must be stored until their use. Normally, the receiver does not have enough storage space, especially if it is receiving data from many sources. This may result in either the discarding of frames or denial of service. To prevent the receiver from becoming overwhelmed with frames, we somehow need to tell the sender to slow down. There must be feedback from the receiver to the sender. • اذا وصلت إطارات البيانات الى موقع المستقبل أسرع من معالجتها ، الاطارات يجب ان تخزن حتى تستخدم . عادة المستقبل ليس لديه مساحة كافية ، خاصة اذا كان يستقبل بيانات من مصادر متعددة . هذا قد يؤدي الى استبعاد الإطارات أو رفض الخدمة . لمنع المستقبل من الإغراق بالإطارات يجب بطريقة ما إخبار المرسل للتباطؤ . لابد من وجود رد من المستقبل للمرسل .

  43. Stop-and-Wait Protocol • The protocol we discuss now is called the Stop-and-Wait Protocol because the sender sends one frame, stops until it receives confirmation from the receiver (okay to go ahead), and then sends the next frame. We still have unidirectional communication for data frames, but auxiliary ACK frames (simple tokens of acknowledgment) travel from the other direction. • يسمى هذا البرتوكول توقف وانتظر بسبب أن المرسل يرسل إطار واحد ثم يقف حتى يستلم تأكيد من المستقبل (الموافقة للمتابعة ) ثم يرسل الاطار التالي . لازال عندنا اتصال وحيد الاتجاه لإطارات البيانات ، ولكن اطارات الاقرار المساعدة (رموز بسيطة من الاقرارات ) تنتقل من الاتجاه الثاني .

More Related