Professional Documents
Culture Documents
History and Evolution: Jitter (Or Delay Variation) Packet Drops
History and Evolution: Jitter (Or Delay Variation) Packet Drops
لديك اشتراك في األنترنت واردت ان تشاهد مبارة كرة قدم على الهواء مباشرة او دعيت الى مؤتمر عبر الفيديو .ولكن كانت
الصورة التي تصل اليك في المبارة متقطعة واحيانا يسبقها الصوت.
ما هي ردة الفعل لديك؟
كان هذا قديما ليس قديما تماما بل قبل عقود قليلة.
األن الصورة واضحة وبدون اي تقطيع.
رائع!ذ
ما الذي حدث؟
).class of service (CoS
دعني اقول لك ان في البداية ان QoSاو Quality of Serviceهو القدرة على إيجاد العديد من priorityللعديد من
التطبيقات ،كذلك المستخدمين او البيانات او ضمان وجود جودة في إنسياب البيانات.
دعني اقول لك ان هناك العديد من الخصائص لكل .traffic classوالذي من خالله يحدد كيف تعالج الشبكة الـ packets
التي تنتمي الى .traffic classمن تلك الخصائص:
:Delay (or latency) نستطيع القول انه الزمن الذي يستغرقه الـ packetحتى يصل الى endpointبعد ارساله
من قبل المرسل.
:Jitter (or delay variation) وهو األختالف في التأخير في الوصول من packetالى اخر.
:Packet drops نسبة ما بين تلك الـ packetsالتي ترسل من المرسل وكم منها تم استقبالها.
Evolution of QoS
قبل العام 2000كنا نصنف انواع الـ trafficفي الشبكات على انه voiceوالذي نطلق عليه بـ .real timeيجب ان يكون
فيه كم كبير من الـ bandwidthكم انه يجب ان يكون هناك توقيت زمنى لوصول packetsالمتتالية.
بينما النوع الثاني كان هو dataوكان يسمى بـ non-real-timeواليهم فيه حجم .bandwidthكما انه اليهم التوقيت
الزمني الذي تصل فيه .packets
مع الوقت ظهر .video traffic
هناك العديد من انواع الـ packetsمع العديد من اوقات الـ delayوكذلك loss toleranceكما يبين ذلك الشكل ادناه.
مع زيادة الطلب على شبكات Wirelessالتي اصبحت مع مرور السنوات اسياسية وتشكل ركيزة اساسية في معظم الشركات
والفنادق والمحالت التجارية كما في المنازل بالطبع .واصبح معيار مهم فيها وهو bandwidthايضا throughput
خصائصها ايضا تعتمد على الموقع وكذلك .power
بعد ذلك بمدة زمنية اصبحت QoSفي تطوير مستمر للميزات التي لديها واصبح الطلب عليها اكبر.
مما خلق هناك العديد من المستويات من الخدمة من اجل .end users
ولذلك بدأ network administratorsفي استخدام ميزات .QoSاعطانا ذلك جودة افضل.
MBZ في الشكل اعاله سوف تبقى.)Type of Service (ToS) byte( نطلق عليها8-bit يوجد لديناIPv4 packet في
.Traffic Class ونطلق عليها8-bit يوجد ايضاIPv6 بينما في.RFC ( الى صفر دائما وهذا من قبلMust Be Zero)
وهي ما تعطي التصنف الذي كلما كان.)IP Precedence( او ما تسمى بـIPP bits تعتبر3 bits في كال النوعين اول
. كما في الجدول ادناه.اعلى كان افضل
Type of Service IP Precedence
1000 minimize delay 000 Routine
0100 maximize throughput 001 Priority
0010 maximize reliability 010 Immediate
0000 minimize monetary cost 011 Flash
100 Flash Override
101 Critic/Critical
110 Internetwork Control
111 Network Control
احتمال64 هذا سوف يعطينا.)DSCP bits( اخرى معها لتكون ما يسمى بـ3-bit يتم جمع.)classes of service( او
TOS (Type of Service) ما يسمى بـlayer 3 وهنا يجب عدم الخلط حيث نطلق عليها في.)classes of service( من
.) سوف نتطرق لها الحقاCOS (Class of Service)( وهذا ما نطلق عليه بـmarking fields كذلك يوجدlayer 2 في
.DS Field (Differentiated Services) ليصبحTOS تم تغيير1998 بعد ذلك وبالتحديد في
.ليصبح كما في الشكل ادناه
حيث ان اول 6bitعبارة عن DSوتستخدم في codepointوالتي سوف تؤثر على ().)PHB (Per Hop Behavior
قد نطلق DSCPعلى ،codepointوهي تمثل نفس precedenceالمستخدمه في TOS byteوالتي تستخدم من اجل .priority
دعني اوضح لك .PHB
في الشكل ادناه لدينا 3 routersعندما نحتاج ان نضع إعدادات QoSمن اجل تمييز VoIP packetsوجعلها ذات اولوية .سوف نضعها على
كل .devices
لو انتهينا من اعداد كال من R1 and R3فقط .فسوف تبقى المشكلة في R2انه سوف يعامل VoIP packetsنفس المعاملة العادية.
لذلك من اجل ان تعمل QoSيجب ان تتم عملية اإلعداد على الجميع اي .end-to-end
وهنا يوجد لدينا طريقتين هما:
الحجز اي ان كل جهاز في الشكل سوف يحجز الـ bandwidthمن اجل phone callفي الشبكة.
عمل إعدادات لكل جهاز على حدة من اجل وضع األولوية لـ .VoIP packets
تبدو فكرة الحجز األقرب .لكن ماذا لو ان احد routersفقد معلومات الحجز؟
الفكرة هي اجبار االجهزة على استخدام ( )reservationsوذلك end-to-end QoSوهذا ما يسمى بـ ().)IntServ (Integrated Services
على النقيض من IntSerنستخدم فكرة () )DiffServ (Differentiated Servicesوالتي تعني وضع األولوية لتلك packetsالتي نريدها فقط
بدون حجز اي .bandwidth
فكرة PHBان تلك packetsيجب ان يتم التعليم عليها بـ codepointمعين .وهنا سوف تعامل معاملة خاصة اي QoSمثال في queuingاو
في policingاو حتى في .shaping
Queueing
Congestion Avoidance
يوجد هناك اربع classesكل classيوضع في صف مختلف حيث يوجد احتمال dropعندما يكون الصف في حالة fullتكون هناك احتمالية
dropعالية.
حيث يوجد هناك ثالث مستويات من dropكما يلي في الجدول ادناه.
Drop Class 1 Class 2 Class 3 Class 4
Low 001010 010010 011010 100010
AF11 AF21 AF31 AF41
Medium 001100 010100 011100 100100
AF12 AF22 AF32 AF42
High 001110 010110 011110 100110
AF13 AF23 AF33 AF43
Expedited Forwarding
وجود () )EF (Expedited Forwardingفي PHBله وظيفتين هما
Queueing
Policing
الهدف هو ضوع packetsفي الصف الذي يكون فيه اقل delayوكذلك اقل عدد في .lossوهذا ما نريده في real-time applicationsمثال
VoIP
العديد من التطبيقات مثل FTPال يهم فيها وجود أي .delay or jitterفهي تستهلك الكثير من الـ .bandwidth
في المقابل هناك مثال VoIPتعتبر من التطبيقات التفاعلية وتستهلك القليل من الـ bandwidthولكن في حالة ان نسبة التأخير عالية
سيكون األمر سيئ وسنصل الى حالة شبيهة بمحادثات الـ (.)walkie-talkie
األمر سوف ينطبق على jitterحيث سيسبب في ردأة الصوت او نقص الجودة.
هذا يجعلنا نقول انه البد من وجود ().)QoS(Quality of Service
الخطوة األولى وهي الـ (.)classification
عندما يعبر packetعبر routerلن يهم routerمن اين قادم ولكن يهمه الى اين متجه من اجل البحث في .routing tableاما فيما
يخص QoSفإنه يهمنا معرفة تصنيف .packetبمعني ادق الى applicationينتمي ذلك الـ .packet
لماذا ذلك؟
من اجل ان يتم وضع عالمة على packetوالقيام بتطبيق policyعليه.
هناك طريقتين من اجل عملية classificationوهي:
Header inspection
Payload inspection
حيث ان هناك حقول في headersمن الممكن ان تستدل على applicationمن خاللها .مثال في TCPيوجد portهو 23سوف
يدلنا على ان التطبيق هو .telnetبالمثل HTTPسوف نستخدم .TCP port=80
فمن خالل فحص headerسوف ننظر الى:
Layer 2: MAC addresses
Layer 3: source and destination IP addresses
Layer 4: source and destination port numbers and protocol
االمر سهل!
ليست كما تتوقع.
حيث ان بعض التطبيقات مثال تستخدم TCP port=80على انه destination portوهذا يعني ان التطبيق هو .HTTP
لكن من الممكن ان يكون غير ذلك مثل ( )instant messagingاو .IMوهذا يعني انه من التفتيش العميق داخل .header
وهذا سوف يعني انه البد من البحث داخل payloadومعرفة الـ .application
في Cisco IOS routersسوف يقوم بتفعيل () .)NBAR (Network-Based Application Recognitionحيث انه بعد تفعيلها
على .interfaceفإن routerسوف يعاين كل .incoming IP packetsومن ثم يحاول يطابقها مع signatures and attributes
في ).PDLM (Packet Description Language Module
مثال:
قام NBARبعملية اكتشاف وجود HTTP trafficال يهم أي portsتم استخدامه .لكن سيقوم بعملية مطابقة:
URL
)MIME type (zip le, image, etc
)User-agent (Mozilla, Opera, etc
فعندما يرى URLسوف يستخدم block websitesواالختيار العام لـ classificationوالذي سنعرفه الحقا.
Configuration
من اجل اعداد MQCفإننا بحاجة الى معرفة التالي:
class-mapوهذا من اجل تحديد packetالتي تطابق معيار معين وهي تلك التي تنتمى الى classمعين.
policy-mapمن اجل وضع actionوتطبيقها على كل .traffic class
service-policyيستخدم من اجل ربط policy mapوربطها بـ ( .)logical or physical interfaceأيضا تحديد
االتجاه الذي سوف تطبق فيه أي .input or output
التي نستخدمهاtopology من خاللtelnet traffic وذلك لـclassify من اجل عمليةaccess-list في الشكل ادناه سوف نستخدم
.telnet server سيكون هوR2 بينما فيclient سوف يكون هوR1 وهي
.R2 عندما تصل الىpackets فسوف نقوم بعملية تصنيف او فرز الـ
:كما يلي
R2(config)#ip access‐list extended TELNET
R2(config‐ext‐nacl)#permit tcp any any eq 23
.filtering من اجل عمليةinterface سوف نطبقها على.23 سوف يعبر باستخدام المنفذpackets أي كل
.MQC (Modular Quality of Service Command-Line Interface) عملية االعداد بالطريقة أعاله تستمى بـ
.marking, queueing, policing, shaping, …. مثل.QoS actions من اجل عملية اعدادpolicy-map سوف نستخدم
:دعني اعرض لك التالي
Input Output
----- ------
Protocol Packet Count Packet Count
Byte Count Byte Count
5min Bit Rate (bps) 5min Bit Rate (bps)
5min Max Bit Rate (bps) 5min Max Bit Rate (bps)
----------------- ------------------------ ------------------------
Total 0 0
0 0
0 0
0 0
: كما يليclass-map فيNBAR دعنا االن نضع
R2(config)#class‐map NBAR‐TELNET
R2(config‐cmap)#match protocol telnet
: كما يليapplication ولكن على مستوىheader لكن ليس فيclass-map لنعيد استخدام
R2(config)#policy‐map CLASSIFY
R2(config‐pmap)#no class TELNET
R2(config‐pmap)#class NBAR‐TELNET
:لالستعراض كما يلي
R2#show policy‐map interface FastEthernet 0/0
FastEthernet0/0
Service‐policy input: CLASSIFY
Class‐map: NBAR‐TELNET (match‐all)
9 packets, 549 bytes
5 minute offered rate 0 bps
Match: protocol telnet
Class‐map: class‐default (match‐any)
3 packets, 180 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
.telnet التي تخصpackets بعملية فرزNBAR وقامaccess-list رائع! لقد استخدامنا
QoS Architectural Framework
Default Behaviors
تلك unclassified trafficالتي لم تستوفي المعايير من اجل ان تطبق عليها QoSسوف تتم معالجتها بدون وجود أي ميزة لـ .QoS
أي بطريقة first-in, first-out (FIFO) queueمع احتمالية ان يتم حذف تلك trafficفي حالة كان output queueفي حالة
.full
)Traffic Classification (Class Maps
هناك ثالث طرق من خاللها سوف نستطيع عمل classify trafficوهي كما يلي:
Markingsوفيها يتم عملية اختبار layer 2من خالل حقول ()] )(class of service [CoSاو اختبار layer 3من خالل
IPPاو إعدادات ()].)differentiated services code point [DSCP
Addressingوفيها سوف يتم فحص ( )source/destination interfaceاو فحص ( ،)L2 destination addressاو
فحص ( )L3 source/destination addressاو فحص (.)source/L4 destination port
Application signaturesيوجد داخل packetالمحتوى من الممكن من خالل فحصه نستطيع فرز نوع .traffic
Definition of Policies (Policy Maps)
: عليها من خالل احد التاليaction فإننا بحاجة الى تطبيقQoS التي سوف تطبق عليهاpackets بعد ان تمت معرفة
Bandwidth allocation
Queuing directives (priority queuing, fair queuing, queue length limits)
Traffic shaping (rate limiting by queuing or delaying packets)
Packet dropping (policing or rate limiting by dropping packets, random dropping, tail
dropping, or unconditional dropping)
Marking packets (setting various header fields to certain values)
Counting packets
Compression of the packet header
Admission decisions
تخيل معي احد األمثلة األخرى على droppingالي trafficتفوق سعة .bandwidthهو ان لدينا 3 computersمتصلة كال بـ
switchعلى حده.
في الصباح الباكر دخل الجميع على systemاو لنقل على .serverحجم trafficلكل hostتصل الى حوالي 70 Mbpsعلى سبيل
المثال .هذا يعني ان حجم trafficسوف يصل الى 210 Mbpsوهذا اكبر من الطاقة األستيعابية لـ Fa0/0 interfaceالتي من
المكن لـ switch Dاستيعابها.
النتيجة الحتمية هي .dropped
قد يقول قائل TCPلديه خاصية .retransmissionنعم لكن ماذا لو كانت نوع البيانات هي real-time applications؟
بالطبع الحل في المقام األول هو إضافة مزيد من .bandwidth
لكن لدينا تطبيقات اخرى سوف تعمل على استهالك تلك الزيادة .ما لم يكن هناك إعدادات لـ .QoS
حيث ان QoSسوف يخبر switchesمن اجل وضع اولوية في حالة وجود اي .congestionاي سوف يستمر switchesفي
عملية forwardingلنوع معين من البيانات مثال VoIPبينما بقية dataسوف يقوم بعملية .dropped
باختصار هذا سوف يضمن لنا ان تطبيقات real-timeسوف تعمل حتى لو حصل congestionsولو مؤقتا.
) Class of Service (CoSيستخدم عادة في الربط مع )(Ethernet Layer 2 frames
يتكون من 3-bitبحيث ينتج لنا تقريبا 8 classes
اي من 0الى .7
في حالة IEEE 802.1Qفإن القيمة تكون .0
.IPv6 headers وكذلك فيIPv4 headers تستخدم في كال منDSCP في حقول6 bit اذا يوجد
) حيث يوجد ثالثة اقسام منper-hop behaviors (PHBs)( من الممكن ان نعبر عنها بقيمة رقمية او عن طريق اسماء خاصة نطلق عليها
: وهيDSCP PHBs
تعتبر اول خانة في AFxyوهي xترمز لـ AF classولها قيمة من 1إلى .4
الخانة الثانية وهي yتشير الى مستوى drop preferenceداخل
كل .AF classحيث يعتبر 1هو )(lowest drop preference
بينما يعتبرالرقم 3هو الـ ).(highest drop preference
فمثال الرقم AF33سيكون هناك احتمالية droppedفيه اكثر من ،AF32والذي
بدوره سيكون اعلى من .AF31
MPLS
من المعروف ان MPLSتقع ما بين layer 2 and Layer 3اي في الطبقة .2.5يتم إدخال 4-byteعبارة عن label header
الى .IP packetفيما يخص CoSيتم وضع حقل عبارة عن 3-bitيسمى بـ .MPLS EXP (Experimental) bitsكما في الشكل ادناه.
حيث ان القيمة المحتملة هي نفس الموجودة في .IP precedence
Ethernet 802.1Q/p
يعتبر من األهمية بمكان عملية markingعلى
Ethernet framesمن خالل وضع 802.1pوالتي
تعتبر ) .priority bits (CoSفي الـ
headerكما في الشكل المقابل.
IPv4 and IPv6
.Traffic Class والتي تسمى بـ8-bit فلديناIPv6 اما في.ToS والتي تعتبر8-bit لديناIPv4 packet في
التي تليها لتشكل ما3 bits وتجمع مع.IP Precedence (IPP) ما هو معروف بـ3 bits يعتبر اولIPv4 and IPv6 في كال الحقلين اي في
: ومن اجل معرفة األوامر إلنجاز المهمة نستخدم.DiffServ Code Point (DSCP) bits يعرف بـ
policy-map SET-DSCP
class DSCP-AF31
set dscp af31
Classification Tools
Layer 7 Classification
كما في الشكلData Payload وذلك النه في هذه الحالة نحتاج الى البحث العميق داخلmarking وليسclassification وهنا سوف نعتمد فقط
. او من خالل الطريقة الديناميكيةstatic من الممكن ان يكون عملية الفرز بطريقة.ادناه
dropping or re- مثالactions فإن بشكل عاجل يتم هنا اتخاذ األجراء أوtraffic violations في حالة حدوث:Policers
. تفحص وتتخذ األجراءtraffic فهي التأخر.excess traffic وذلك أليmarking
حيث يتم تخزين الزائد ومن ثم تأخيره حتي.traffic حيث انها التحذف الـ.buffer وهنا تعتبر اداه مرنه حيث انها متصلة بـShapers
.تتاح فرصة إرساله
:والجدول ادناه يوضح الفرق بينهما من خالل التالي
Policer Shaper
Causes TCP resends when traffic is dropped Typically delays (rather than drops) traffic;
involves fewer TCP resends
Inflexible and inadaptable; makes instantaneous Can adapt to network congestion by queuing
packet drop decisions excess traffic
An ingress or egress interface tool Typically an egress interface tool
Introduces no delay or jitter in a traffic Introduces delay and jitter if arriving traffic
stream exceeds the contracted (shaped) rate
Rate limiting without buffering Rate-limiting with buffering
Introduction to Policing
قد يكون خط. وتم تزويدك بباقة معينة فإنت بحاجة الى ان تدفع مقابل ذلكISP في حالة قررت األشتراك في احد باقات االنترنت وذهب الى
لكنك لست بحاجة الى كل هذه السرعة او باألصح لن تدفع.100 Mbps األشتراك العام لديه القدرة على تزويدك بمعدل معين قد يصل مثال الى
.مبلغ اكبر من الذي لديك
ستكون هناك اتفاقية من خاللها سوف تمنح سرعة معينة بناء على المقابل المادي الذي.fiber ستختار باقة اقل من السرعة القصوى لخط او لكبل
.CIR ( او اختصارا بـCommitted Information Rate) يسمى بـISP الذي سوف يمنح لك من قبلbit rate معدل.ستدفعه
.shaping او عن طريقpolicing سوف يكون من خالل احد من التالي اماbit تحديد معدل
.traffic لتلك الفائض من الـdrop يقوم بعمليةpolicing األختالف بينهما من خالل ان
. الحقاshaping سوف نتكلم عن. فسوف يخزن الفائضshaping اما
: سوف يكون الخيار احد التاليpolicer في حالة
Conformingاي ان packetصمن حدود traffic contractاي األتفاقية التي ابرمت مع .ISP
Exceedingيعني ان packetقد زاد عن السعة المتوفرة او حدث ما يسمى بـ (.)excess burst
Violatingيعني انه تماما خارج .traffic contract rate
مع actionاعاله سوف يكون لدينا packetمثال فإن كان ضمن سعة bandwidthفإنه سوف يمر او conformingفإن زاد عن السعة او حالة
exceedingسوف يتم عمل re-markفإن زاد فسوف تتخذ حالة dropفي حالة .violating
Types of Policers
هناك العديد من الخوارزميات التي تعمل مع مع policersوهي:
Single-Rate Two-Color Policersالفكرة األساسية وراء ( )token bucketانه سوف يتم توليد tokenمن قبل نظام التشغيل
.IOSومن ثم يتم وضعه في .bucketنسمى ذلك بـ replenishingاو تجديد الموارد.
كلما يصل packetفإن policerسوف يقوم بعملية فحصه ليرى فيما إذا كان هناك tokensكافية في .bucketفإن يتم السماح لـ
packetبالمرور .ما لم يكن فإن يتم حذفه .كل tokenيمثل بـ byteواحد.
لكن السؤال كيف يتم حساب tokensفي bucket؟
الجواب حسب المعادلة التالية:
Packet arrival time ‐ Previous packet arrival time * Police Rate / 8
اي ان عدد tokensفي bucketسوف تعتمد على الزمن بين وصول كل packetاخر ويكون بالثانية.
دعنا نوضح ذلك بمثال كما في الشكل ادناه:
تخيل لديك policerوكانت بقيمة .128000 bpsوكان الزمن ما بين وصول packetواخر هو .1 secondفإن policerسوف
تحسب كمايلي1 second * 128.000bps / 8 = 16.000 bytes :
لذلك سوف يوضع 16.000 tokensفي .token bucketاالن تخيل معي packetالثالث عندما يصل ففي حالة كان الزمن ما بين
وصول والثاني هو 0.5 secondفإننا نحسب المعادلة0.5 second * 128.000bps / 8 = 8.000 bytes :
هذا سوف يعني اننا سوف نضع 8.000 tokensفي .bucketاي كلما كان اكثر replenishفي ،token bucketفإننا سوف نحصل
على عدد اقل من .tokensعندما يكون bucketفي حالة fullفإن tokensسوف تقسم وتحذف.
Single Rate, Two Color Single Rate, Three Color Dual-Rate, Three Color
1st bucket based on time difference of based on time difference of based on time difference of
refill arrival between 2 packets arrival between 2 packets arrival between 2 packets
no 2nd bucket Filled by spilled tokens from Same as the 1st bucket, but
2nd bucket available 1st bucket based on PIR rate
refill
conforming take tokens from 1st bucket take tokens from 1st bucket take tokens from bot buckets
Exceeding all packets that are not packets that are not packets that are not
conforming conforming, take tokens from conforming but enough
2nd bucket tokens in 2nd bucket
Violating not available All packets that are not All packets that are not
conforming or exceeding conforming or exceeding
-1بدال من اإلنتظار في policerمن اجل حذف او رمي الـ .trafficلما ال نقوم بعملية shapeللمنفذ المتصل بـ .ISP
-2من اجل تجنب عمل blockingالي .egressحيث اننا سوف نتجه من high speed interfaceالى منفذ اقل .وبالتالي
فإن trafficستكون معرضة حتما للحذف.
يقوم routersبعملية إرسال bitsكل .physical clock rateدعنا نضرب مثال على ذلك.
في حالة كان لدنيا serial linkوكانت سعته .128 kbpsفتخيل معي اننا نريد عمل shapeله الى .64 kbpsففي حالة اردنا ذلك
فإننا سوف نحتاج على ان فقط بقدرة 50%وثم نوقف 50%ونرسل وهكذا.
مثال:
في حالة كان لدينا خط بسعة 128 kbpsلكن تعتبر CIRهي .96 kbpsفإن هذا سوف يعني اننا سوف نرسل بعدل 75%من الزمن ونتوقف
25%من الزمن وتحسب كما يلي (.)96 / 128 = 0.75
اظن اآلن اتضحت الصورة.
في الشكل المقابل لدينا ) ،(physical bitrate=128 kbpsوقمنا
بعمل shapeليصبح .64 kbpsفي المحور العمودي سوف نالحظ
ان المعدل هو .128 kbpsاما في المحور األفقي فإن لدينا الزمن والذي
يمثله من 0الى 1000ميلي ثانية .تمثل الخطوط الخضراء الى عملية إرسال
.Trafficحيث اننا نتوقف ونرسل.
اول 62.5 msقمنا بعملية إرسال trafficوبعدها توقفنا لمدة
.62.5 msاول زمن بعده سيكون ).(62.5 + 62.5 = 125 ms
نسمى ذلك intervalبـ ) .Tc (Time Intervalسيكون لدينا 8 time intervalsوكل منها يمثل .125 msحيث ان المجموع
سيكون .8*128ms=1000ms
معظم Cisco routersلديها المعدل Tcاو اإلفتراضي بالقيمة .125 msحيث اننا ارسلنا في السابق بمعدل 50%فقط .وتوقفنا لمدة .50%
هنا سيكون 50%من 128 kbpsحيث يصبح معدل shapingهو .64 kbps
وهنا سوف نحسب كما معدل bitsفي كل Tcوالذي من خالله اصل الى معدل .shapingحيث تسمى
هذه القيمة بـ ) .Bc (committed burstهنا سيكون Bcهو 8.000 bitsاي ان كل 125 msسيتم ارسال .8.000 bits
دعني الخص الموضوع كما يلي:
) Tc (time intervalوهو زمن بالميلي ثانية الذي نستطيع ارسال ).Bc (committed burst -
) Bc (committed burstوهو حجم trafficالذي نرسله خالل TCويقاس بـ .bits -
) CIR (committed information rateوهو معدل bitsالمعرفة في )(traffic contractوالذي يتم اسقباله من .ISP -
ولمعرفة الصيغ سيكون كما يلي:
Bc = Tc * CIR
Tc value:
Tc = Bc / CIR
دعنا نأخذ مثال اخر هو حالة كان معدل البيانات 256 kbpsوكان لدينا shapingبمعدل يساوي .128 kbpsفكم عدد bitsالتي سوف ترسل
TC؟
للجواب اوال لدينا المعطيات التالية وهي:
CIR = 128 kbpsايضا لدينا TCافتراضيا تساوي .125 msولذلك نطبق المعادلة السابقة ليكون الناتج هو:
125 ms x 128 kbps = 16.000 bits
اي ان Bc = 16 bitsحيث ان كل Tcسوف يتم ارسال .16.000 bits
اي ان المفهوم اننا سوف نرسل 16.000 bitsكل Tcومن ثم سوف نتوقف حي
تنتهي Tcوتبدأ Tcجديدة .الرائع في shapingوهي ان كل trafficسوف يرسل
حيث اننا سوف يتم تخزينة .لكن على الجانب اآلخر سوف يتسبب ذلك في عملية تأخير
او delayوكذلك .jitterلنضرب المثل التالي:
في الشكل المقابل سوف يكون لدنيا نفس interfaceمع معدل bitهو .128 kbps
وسيكون لدينا .Tc=125 ms
عملية shapingسوف يتم اعدادها لتكون .64 kbpsحيث اننا سوف نالحظ اننا
ناخذ 62 msمن اجل اإلرسال .لكن كيف جاء هذا الرقم؟
لنأخذ التالي.125 ms * 64 kbps= 8.000 bits :
اآلن دعنا نحسب قيمة delayحسب المعادلة:
Delay = Bc / physical bitrate
8.000 / 128.000 = 0.0625
اي اننا سوف نأخذ كل 62.5 msمن اجل ارسال 8000 bitsخالل منفذ بسعة .128 kbps
بعد ان طبقا الصيغ السابقة رأينا كم من الوقت سوف نأخذ من اجل إرسال 8.000 bitsمن خالل منفذ بسعه .128 Kbpوالذي يساوي 62.5 ms
وكلما كان سرعة linkاكبر كان delayاقل .وهذا ما يعكسه المنفذ T1الذي لديه سعة تصل الى .1.54 Mbpsوحسب المعادلة سيكون لدينا
بالطبع الناتج 8.000 / 1.540.000 = 0.0051اي في النهاية أننا سوف نأخذ 5 msمن اجل إرسال 8000 bitsمن خالل منفذ .T1
في النهاية قد يكون ) .(excess burstعندما اقوم بإعداد shapingسوف يكون لدي خيار هو ارسال اكثر من سعة Bcفي بعض .Tcs
هذا رائع جدا .لكن كيف ذلك؟
تخيل معي الشكل المقابل ان لدينا .bucketقمنا بملئ ذلك بـ .tokensحيث تمثل كل token
ما مقداره .1 bitبعدد bitsالتي سوف ترسل سوف نأخذ مقدارها tokensوهذا مطلوب
من اجل إرسال packetمعين.
مثال لدي 120 bitsسوف أخذ مقدارها 120 tokensمن bucketالذي هو في األصل
سيكون .Bc
عندما bucketيصبح فارغ لن نستطيع إرسال اي شيء .بل سوف ننتظر حتي يأتي
Tcالتالية .حيث سنقوم بعملية ملئ bucketبعدد معين من tokensومن ثم نرسل مرة
اخرى.
هذا سوف يعني اننا لن نرسل اكثر من .Bc
R2#
ip route 192.168.1.0 255.255.255.0 192.168.12.1
.128 kbps الىclock rate سوف نعمل على وضع
. من اجل المراقبة والقياس للسرعةiperf سوف نستخدم برنامجcomputers في
SERVER#
[SUM] 0.0‐93.8 sec 2.75 MBytes 246 Kbits/sec
.246 kbps لقد اقتربنا من الرقم حيث وصلنا الى
.fastethernet سوف نستخدمserial اسرع؟ اي بدلinterface ماذا لو استخدمنا
R1(config)#no ip route 192.168.2.0 255.255.255.0 192.168.12.2
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.21.2
R2(config)#no ip route 192.168.1.0 255.255.255.0 192.168.12.1
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.21.1
.throughput لنرى ما هو نوع
CLIENT# iperf ‐c 192.168.2.2 ‐P 8
SERVER#
[SUM] 0.0‐10.2 sec 116 MBytes 95.4 Mbits/sec
:100 Mbps بدال من1 Mbps ليكونshap سوف نجعل
R1(config)#policy‐map SHAPE_AVERAGE
R1(config‐pmap)#class IPERF
R1(config‐pmap‐c)#shape average 1m
R1(config)#interface FastEthernet 0/0
R1(config‐if)#service‐policy output SHAPE_AVERAGE
:router التي سوف يحسبهاBc كم قيمة
R1#show policy‐map interface FastEthernet 0/0
FastEthernet0/0
Service‐policy output: SHAPE_AVERAGE
Class‐map: IPERF (match‐all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access‐group name IPERF_CLIENT_SERVER
Queueing
queue limit 64 packets
(queue depth/total drops/no‐buffer drops) 0/0/0
(pkts output/bytes output) 0/0
shape (average) cir 1000000, bc 4000, be 4000
target shape rate 1000000
:Tc لنحسب قيمة
4000 / 1000000 = 0.004 ms.
.4 ms ايضا القيمة
.Tc=125 ms األقدم فإن قيمةIOS لكن في. طبقا لذلكBc وتحسب قيمةTc=4 ms تفضل القيمةcisco IOS version اي ان معظم
:iperf مرة اخرى
CLIENT~# iperf ‐c 192.168.2.2 ‐P 8
SERVER#
[SUM] 0.0‐27.4 sec 3.12 MBytes 955 Kbits/sec
.1 Mbps وهذه قيمة قريبة منshaped = 955 kbps رائع لقد اقتربنا من القيمة حيث وصلنا الى
:CIR=1 Mbps مع وجودTc=10 ms اي. ولم نتركها للقيم األفتراضيةTc and Bc ماذا لو قمنا نحن بعملية وضع قيم
Bc = Tc * CIR
10 ms * 1000 Kbps = 10.000 bits
.Bc=10.000 bits لقد حصلنا على
R1(config)#policy‐map SHAPE_AVERAGE
R1(config‐pmap)#class IPERF
R1(config‐pmap‐c)#shape average 1m 10000
: سوف تكون النتيجة كما يليrouter في
R1#show policy‐map interface FastEthernet 0/0
FastEthernet0/0
Service‐policy output: SHAPE_AVERAGE
Class‐map: IPERF (match‐all)
2496 packets, 3716912 bytes
5 minute offered rate 19000 bps, drop rate 0 bps
Match: access‐group name IPERF_CLIENT_SERVER
Queueing
queue limit 64 packets
(queue depth/total drops/no‐buffer drops) 0/189/0
(pkts output/bytes output) 2307/3430766
shape (average) cir 1000000, bc 10000, be 10000
target shape rate 1000000
:Tc=125 ms لنأخذ مثال اخر بحيث ان قيمة
125 ms * 1000 Kbps = 125.000 bits
R1(config)#policy‐map SHAPE_AVERAGE
R1(config‐pmap)#class IPERF
R1(config‐pmap‐c)#shape average 1000000 125000
:سوف نحصل على التالي
R1#show policy‐map interface FastEthernet 0/0
FastEthernet0/0
Service‐policy output: SHAPE_AVERAGE
Class‐map: IPERF (match‐all)
2496 packets, 3716912 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access‐group name IPERF_CLIENT_SERVER
Queueing
queue limit 64 packets
(queue depth/total drops/no‐buffer drops) 0/189/0
(pkts output/bytes output) 2307/3430766
shape (average) cir 1000000, bc 125000, be 125000
target shape rate 1000000
Peak Traffic Shaping on Cisco IOS
تدعم Cisco IOSنوعين من shapingوهما
peak shapingتستخدم Beبطريقة مختلفة تماما .حيث انه اليزال لدينا token bucketوالذي يتم تخزينه عند مستوى Bc+Beلكن سوف
نملئ token bucketبمعدل Bc and Be tokensكل فترة Tcوستكون tokensالغير مستخدمة في حالة discardedكما يبدو في الشكل.
.trust خارج حدودIP phone اي انtrust في الشكل المقابل لن يكون لدينا
وكذلكclassification عمليةaccess layer switch بمعني اخر سوف تتولى
.access layer switches على مستوىmarking عملية
حيث اننا سوف نستخدم من اجل.trust boundary لنبدأ في معرفة كيفية إعداد
. في هذا المثالCatalyst 3560 ذلك
:في البداية كما يلي التفعيل
3560Switch(config)#mls qos
. التي تم استقبالهاpackets من كلmarking سوف يتجه الى مسح كلswitch فإنQoS يجب ان تنتبه الى شئ مهم وهو انك عندما تفعيل
:في حالة لم ترد ان يحدث ذلك كل ما عليك هو ان تتجه الى كتابة األمر التالي
3560Switch(config)#no mls qos rewrite ip dscp
:في البداية سوف نقوم بالبحث بعملية ادخال األمرمن اجل استعراض ما حدث
3560Switch#show mls qos interface fastEthernet 0/1
FastEthernet0/1
trust state: not trusted
trust mode: not trusted
COS override: dis
default COS: 0
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
.IP phone اوCoS فيframes ايضا،DSCP فقط حسب قيمtrust بعمليةcisco switches افتراضيا يقوم
3560Switch(config‐if)#mls qos trust cos
. الداخلة الى المنفذframes لكلCoS حسب قيمtrust من اجل التأكد من عملية
3560Switch#show mls qos interface fastEthernet 0/1
FastEthernet0/1
trust state: trust cos
trust mode: trust cos
COS override: dis
default COS: 0
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
.cos-to-dscp map طبقا لـframe داخلpacket في الـDSCP لقيمoverwrite بعمليةswitches بشكل افتراضي سوف تقوم كل
:في حالة لم ترد ذلك فعليك بما يلي
3560Switch(config‐if)#mls qos trust cos pass‐through
سنقومDSCP لقيمةtrust فمن اجل،CoS الى جانب قيمةDSCP لن يتجاوز قيمswitch سوف تضمن انpass-through الكلمة
:بإدخال األمر التالي
3560Switch(config‐if)#mls qos trust dscp
3560Switch#show mls qos interface fastEthernet 0/1
FastEthernet0/1
trust state: trust dscp
trust mode: trust dscp
COS override: dis
default COS: 0
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
؟Cisco IP phone علىtrust boundary األن ماذا لو ادرنا ان نضع عملية
3560Switch(config‐if)#mls qos trust device cisco‐phone
التي تصلCoS values على كلtrust من ان يقوم بعمليةswitch سوف نخبرmls qos trust بإستخدام
.Cisco IP phone من
3560Switch#show mls qos interface FastEthernet0/1
FastEthernet0/1
trust state: not trusted
trust mode: not trusted
COS override: dis
default COS: 0
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: cisco‐phone
؟another vendor وبينCisco IP phone الفرق بينswitch قد تتسأل كيف سيعرف
.CDP (Cisco Discovery Protocol) بالطبع سوف نستخدم
.Cisco IP phone االمر تم لكن ماذا عن الكمبيوتر خلف
3560Switch(config‐if)#switchport priority extend cos
IP phone خلفcomputer التي تم استقبالها منEthernet frames لكلCoS االمر اعاله سوف يقوم بتجاهل كل قيم
3560Switch(config‐if)#switchport priority extend trust
.computer التي تم استقبالها منCoS values لكل قيمtrust االمر اعاله سوف يقوم بعملية
.4 سوف يتم وضع التصنيفuntagged frames سوف يمر ويكون في حالةframe من اجل وضع قيم معينة بنفسك فإن اي
3560Switch(config‐if)#mls qos cos 4
. عليهاremarked لن يتم وضع ايtagged بقية
:من اجل روية التأثير علي ذلك كما يلي
3560Switch#show mls qos interface FastEthernet0/1
FastEthernet0/1
trust state: not trusted
trust mode: not trusted
COS override: dis
default COS: 4
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
: بشكل اجباري سيكون كما يليremarking وفي حالة اردنا عملية
3560Switch(config‐if)#mls qos cos override
.traffic لكلremark من اجل ان يقوم بعمليةswitch اي نخبر
:دعنا نستخدم نرى التأثير
3560Switch#show mls qos interface FastEthernet 0/1
FastEthernet0/1
trust state: not trusted
trust mode: not trusted
COS override: ena
default COS: 4
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
.4 ) سوف تضع لها القيمةtagged and untagged Ethernet frames( اي ان كل
؟serial 0/0 interface لدينا لها األولوية عندما تغادرSSH traffic ماذا لو اردنا ان نجعل
.MQC معstandard, extended or MAC access-list in سوف نستخدم
Switch(config)#class‐map match‐all SERVER
Switch(config‐cmap)#match access‐group 1
.access-list سوف نصله بـ، معينtraffic من اجل اختيارclass-map لقد قمنا بإستخدام
Switch(config)#access‐list 1 permit 192.168.1.1
:policy-map االن لنطبق
Switch(config)#policy‐map SET‐DSCP‐SERVER
Switch(config‐pmap)#class SERVER
Switch(config‐pmap‐c)#set ip dscp 40
: على المنفذpolicy map لنقوم بعملية تفعيل.DSCP=40 تم وضع قيمة
Switch(config)#interface FastEthernet 0/1
Switch(config‐if)#service‐policy input SET‐DSCP‐SERVER
: كما يليtraffic لما نريد منmark لنرى هل تم عمل
Switch#show policy‐map interface FastEthernet 0/1
FastEthernet0/1
Service‐policy input: SET‐DSCP‐SERVER
Class‐map: SERVER (match‐all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access‐group 1
Class‐map: class‐default (match‐any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
.0 packets الى االن.f0/1 على المنفذpolicy-map لقد تم تطبيق
: كما يليextended access-list ولكن بأستخدامSSH علىQoS دعنا نقوم بعملية تطبيق
Switch(config)#class‐map SSH
Switch(config‐cmap)#match access‐group 100
.access-list 100 وتطابقSSH تسمى بـclass-map تم انشاء
Switch(config)#access-list 100 permit tcp host 192.168.1.1 eq 22 any
Switch(config)#policy‐map SET‐DSCP‐SSH
Switch(config‐pmap)#class SSH
Switch(config‐pmap‐c)#set ip dscp cs6
: االن الربط مع المنفذ كما يلي.DSCP=CS6 تم وضع قيمة
Switch(config)#interface FastEthernet 0/1
Switch(config‐if)#no service‐policy input SET‐DSCP‐SERVER
Switch(config‐if)#service‐policy input SET‐DSCP‐SSH
:لنتطلع على النتائج كما يلي
Switch#show policy‐map interface fastEthernet 0/1
FastEthernet0/1
Service‐policy input: SET‐DSCP‐SSH
Class‐map: SSH (match‐all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access‐group 100
Class‐map: class‐default (match‐any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
.packets=0 اليزال عدد
Switch(config)#class‐map SERVER‐MAC
Switch(config‐cmap)#match access‐group name MAC
: كما يليMAC ومتصلة بـextended access-list انشاءنا
Switch(config)#mac access‐list extended MAC
Switch(config‐ext‐macl)#permit host 1234.1234.1234 any
: وتفعيلهاpolicy-map لنقوم اآلن بإنشاء
Switch(config)#policy‐map SET‐DSCP‐FOR‐MAC
Switch(config‐pmap)#class SERVER‐MAC
Switch(config‐pmap‐c)#set ip dscp cs1
Switch(config)#interface FastEthernet 0/1
Switch(config‐if)#no service‐policy input SET‐DSCP‐SSH
Switch(config‐if)#service‐policy input SET‐DSCP‐FOR‐MAC
:االن لنقوم بعملية استعراض ما حدث
Switch#show policy‐map interface fastEthernet 0/1
FastEthernet0/1
Service‐policy input: SET‐DSCP‐FOR‐MAC
Class‐map: SERVER‐MAC (match‐all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access‐group name MAC
Class‐map: class‐default (match‐any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
Queue-set
queue-set 2 او من الممكنqueue-set 1 حيث من الممكن وضع.switches فيQoS فيtemplate وهو مثلqueue-set
Switch(config)#interface fa0/2
Switch(config‐if)#queue‐set 2
Buffer Allocation
: األمر العام. مختلفةqueues حيث اننا سوف نقسمه الىinterface فهو مثل المخزن فيbuffer فيما يخص
mls qos queue‐set output <queue set> buffers Q1 Q2 Q3 Q4
.queue 1,2,3 and 4 بينbuffers ومن ثم تقسيمqueue-set سوف يتم اختيار
.queuw 1,4 and 4 لـ99 الى0 حيث اننا من الممكن اختيار القيمة من
: كما في المثال التالي.CPU buffer فإنه يستخدم كـqueue 2 فيما يخص.diable the queue فإنها تعني0 في حالة كتبت الرقم
Switch(config)#mls qos queue‐set output 2 buffers 33 17 25 25
: كما يليbuffer space هذا سوف يقسم
33% for queue 1.
17% for queue 2.
25% for queue 3.
25% for queue 4.
: من الممكن التقسيم بالشكل التاليqueues بينbuffer space الى جانب تقسيم
Threshold 1 value
Threshold 2 value
Reserved value
Maximum value
:كمثال على ذلك
Switch(config)#mls qos queue‐set output 2 threshold 3 33 66 100 300
.queue-set 2 هذا سوف يقوم بإعداد
Threshold 1 = 33%
Threshold 2 = 66%
Reserved = 100%
Maximum = 300%
.queue منthreshold 1=33% ما قمنا به يعني اننا سوف يكون قيمة
فمن الممكنfull في حالةqueue ففي حالة كان،buffer space على انه100% وسوف نحتفظ بـ.queue من قيمةthreshold 2=66% اما
.common pool من300% استالف
Assign marked packets/frames to correct queue
.DSCP and CoS قيمswich لكن البد من اعطاءbuffer and thresholds من الممكن اعداد
mls qos srr-queue <direction> <marking> <queue> <threshold> <values>
:هذا يعني ان
Bandwidth Allocation
. او بمعنى اخر كم حجم المخزن الذي لدينا. او طولهqueue لكن كيف نحدد حجم
Switch(config)#mls qos srr‐queue input bandwidth 30 70
.70% سيكونqueue 2 بينما فيbandwidth من30% حيث ان تم حجزqueue 1 في المثال تم على
Switch(config)#interface fa0/1
Switch(config‐if)#srr‐queue bandwidth share 30 20 25 25
: كما يليbandwidth المثال اعاله يعني تقسيم
Queue 1: 30%
Queue 2: 20%
Queue 3: 25%
Queue 4: 25%
بينما25% فسيكونqueue 3 اما.20% سيكونqueue 2 بينما.queue 1 ستكون من اجل30% فإن هذا يعني ان100Mbit لدينا
.25% سيكونQueue 4
.sharing فإن هذا سوف يعنيcongestion في حالة عدم وجود اي
Switch(config)#interface fa0/1
Switch(config‐if)#srr‐queue bandwidth limit 85
.85Mbit فقط او بمعني85% معدلinterface من100 Mbit األمر اعاله سوف يعني اننا سوف نحدد من
Verification and troubleshooting
.االن كيف سنعرف انه تم اعداد كل شئ بشكل تام
Switch#show interfaces fa0/23 capabilities
FastEthernet0/23
Model: WS‐C3560‐24PS
Type: 10/100BaseTX
Speed: 10,100,auto
Duplex: half,full,auto
Trunk encap. type: 802.1Q,ISL
Trunk mode: on,off,desirable,nonegotiate
Channel: yes
Broadcast suppression: percentage(0‐100)
Flowcontrol: rx‐(off,on,desired),tx‐(none)
Fast Start: yes
QoS scheduling: rx‐(not configurable on per port basis),
tx‐(4q3t) (3t: Two configurable values and one fixed.)
CoS rewrite: yes
ToS rewrite: yes
UDLD: yes
Inline power: yes
SPAN: source/destination
PortSecure: yes
Dot1x: yes
.threshold وايضا ثالثة مستويات من4 queues تقريباswitch كما نالحظ انه لدى
: مفعلة على المنفذ اوالQoS ولنتأكد هل
Switch#show mls qos
QoS is enabled
QoS ip packet dscp rewrite is enabled
: سوف نرى التاليQoS parameters ومن اجل التدقيق اكثر على
Switch#show mls qos interface fa0/1
FastEthernet0/1
trust state: trust cos
trust mode: trust cos
trust enabled flag: ena
COS override: dis
default COS: 1
DSCP Mutation Map: Default DSCP Mutation Map
Trust device: none
qos mode: port‐based
: سوف نالحظ التاليqueue-sets وذلك لحالةverify اما من اجل عمل
Switch#show mls qos queue‐set
Queueset: 1
Queue : 1 2 3 4
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
buffers : 25 25 25 25
threshold1: 100 200 100 100
threshold2: 100 200 100 100
reserved : 50 50 50 50
maximum : 400 400 400 400
Queueset: 2
Queue : 1 2 3 4
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
buffers : 33 17 25 25
threshold1: 100 33 33 100
threshold2: 100 66 66 100
reserved : 50 100 100 50
maximum : 400 200 200 400
: تحت المنافذ فستكون كما يليqueuing اما اعدادات
Switch#show mls qos interface fastEthernet 0/24 queuing
FastEthernet0/24
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 25 0 0 0
Shared queue weights : 25 25 25 25
The port bandwidth limit : 100 (Operational Bandwidth:100.0)
The port is mapped to qset : 1
: فسيكون لدينا التاليqueues وذلك فيdrops ومن اجل التأكد من حدوث اي
Switch#show platform port‐asic stats drop FastEthernet 0/1
Interface Fa0/1 TxQueue Drop Statistics
Queue 0
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 1
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 2
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 3
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
:اما األحصائية فستكون كما يلي
Switch#show mls qos interface fastEthernet 0/1 statistics
FastEthernet0/1 (All statistics are in packets)
dscp: incoming
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
0 ‐ 4 : 0 0 0 0 0
5 ‐ 9 : 0 0 0 0 0
10 ‐ 14 : 0 0 0 0 0
15 ‐ 19 : 0 0 0 0 0
20 ‐ 24 : 0 0 0 0 0
25 ‐ 29 : 0 0 0 0 0
30 ‐ 34 : 0 0 0 0 0
35 ‐ 39 : 0 0 0 0 0
40 ‐ 44 : 0 0 0 0 0
45 ‐ 49 : 0 0 0 0 0
50 ‐ 54 : 0 0 0 0 0
55 ‐ 59 : 0 0 0 0 0
60 ‐ 64 : 0 0 0 0
dscp: outgoing
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
0 ‐ 4 : 0 0 0 0 0
5 ‐ 9 : 0 0 0 0 0
10 ‐ 14 : 0 0 0 0 0
15 ‐ 19 : 0 0 0 0 0
20 ‐ 24 : 0 0 0 0 0
25 ‐ 29 : 0 0 0 0 0
30 ‐ 34 : 0 0 0 0 0
35 ‐ 39 : 0 0 0 0 0
40 ‐ 44 : 0 0 0 0 0
45 ‐ 49 : 0 0 0 0 0
50 ‐ 54 : 0 0 0 0 0
55 ‐ 59 : 0 0 0 0 0
60 ‐ 64 : 0 0 0 0
cos: incoming
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
0 ‐ 4 : 2 0 0 0 0
5 ‐ 7 : 0 0 0
cos: outgoing
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
0 ‐ 4 : 0 0 0 0 0
5 ‐ 7 : 0 0 0
Policer: Inprofile: 0 OutofProfile: 0
R1(config)#class‐map TELNET
R1(config‐cmap)#match protocol telnet
R1(config)#class‐map HTTP
R1(config‐cmap)#match protocol http
R1(config)#policy‐map CBWFQ
R1(config‐pmap)#class TELNET
R1(config‐pmap‐c)#bandwidth percent 10
R1(config‐pmap‐c)#exit
R1(config‐pmap)#class HTTP
R1(config‐pmap‐c)#bandwidth percent 20
R1(config‐pmap‐c)#exit
ولنقم بعملية تطبيقها على المنفذ كماHTTP من اجل20% وايضاtelnet من اجلbandwidth من10% واعطاءهCBWFQ فقط تم تفعيل
:يلي
R1(config)#interface serial 0/0.1
R1(config‐subif)#service‐policy output CBWFQ
CBWFQ : Not supported on subinterfaces
.لم تطبق بشكل مباشر
R1(config)#policy‐map PARENT
R1(config‐pmap)#class class‐default
R1(config‐pmap‐c)#service‐policy CBWFQ
: لنقم اآلن بربطها مع المنفذclass-default وربطها معPARENT تسمىpolicy-map لقد قمنا بعمل
R1(config)#interface serial 0/0.1
R1(config‐subif)#service‐policy output PARENT
CBWFQ : Hierarchy supported only if shaping is configured in this class
R1(config)#policy‐map PARENT
R1(config‐pmap)#class class‐default
R1(config‐pmap‐c)#shape average percent 100
.100% بنسبةshape لقد قمنا بعمل
R1(config)#interface serial 0/0.1
R1(config‐subif)#service‐policy output PARENT
:ومن التجربة
R1#telnet 192.168.12.2
Trying 192.168.12.2 ... Open
Password required, but none set
[Connection to 192.168.12.2 closed by foreign host]
:اآلن لنجرب نعرض ما تم اعداده
R1#show policy‐map interface serial 0/0.1
Serial0/0.1
Service‐policy output: PARENT
Class‐map: class‐default (match‐any)
39 packets, 4086 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Traffic Shaping
Target/Average Byte Sustain Excess Interval Increment
Rate Limit bits/int bits/int (ms) (bytes)
100 (%) 0 (ms) 0 (ms)
1544000/1544000 9650 38600 38600 25 4825
Adapt Queue Packets Bytes Packets Bytes Shaping
Active Depth Delayed Delayed Active
‐ 0 39 4086 0 0 no
Service‐policy : CBWFQ
Class‐map: TELNET (match‐all)
11 packets, 514 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol telnet
Queueing
Output Queue: Conversation 73
Bandwidth 10 (%)
Bandwidth 154 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no‐buffer drops) 0/0/0
Class‐map: HTTP (match‐all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol http
Queueing
Output Queue: Conversation 74
Bandwidth 20 (%)
Bandwidth 308 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no‐buffer drops) 0/0/0
Class‐map: class‐default (match‐any)
28 packets, 3572 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
policy-map معtelnet نعم لقد تطابقت
PPP Multilink Link Fragmentation and Interleaving
load من خالل.single logical interface تم تحويلها الىphysical interfaces ماذا لو كان لدينا اكثر من
مع بعضrouter تم ربط اكثر من. خذ معي الشكل المقابل.balance
.serial interfaces من خالل
bundle فإننا نستطيع من خاللها عملPPP multilink عندما نستخدم
serial links لتكوين
.logical layer 3 interface وتكوين
R1(config)#interface virtual‐template 1
R1(config‐if)#bandwidth 128
R1(config‐if)#ip address 192.168.12.1 255.255.255.0
R1(config‐if)#fair‐queue
R1(config‐if)#ppp multilink fragment delay 10
R1(config‐if)#ppp multilink interleave
R2(config)#interface virtual‐template 1
R2(config‐if)#bandwidth 128
R2(config‐if)#ip address 192.168.12.2 255.255.255.0
R2(config‐if)#fair‐queue
R2(config‐if)#ppp multilink fragment delay 10
R2(config‐if)#ppp multilink interleave
.PPP multilink وذلك من اجل اعدادIP addresses وإعدادvirtual-template لقد استخدمنا
.VoIP بالنسبة لـ10 ms والذي هوmaximum delay ليكون مساويdelay تم اعداد
R1(config)#multilink virtual‐template 1
R2(config)#multilink virtual‐template 1
:االن اعداد المنافذ كما يلي
R1(config)#interface serial 0/0
R1(config‐if)#bandwidth 128
R1(config‐if)#encapsulation ppp
R1(config‐if)#ppp multilink
Resource reservation
.flow معين من اجلbandwidth and delay للشبكة و تطلبResource reservation signals
وكذلكbandwidth فسوف يكون لديناrouters بشكل كامل لكل مكونات الشبكة او بشكل ادق علىreservation عندما تتم عملية
. المطلوبdelay
Admission control
. معينةreservation لعمليةpermit or deny تستخدم من اجلAdmission control
بعد ان يوافق.destination الىroute حيث انها تمر عبر.RSVP معينة فسوف نرسل طلب بذلك باستخدام رسائلreservation عندما نريد
فإنه سوف يرد برسالةdestination عندما تصل الى، المطلوبة فإنه يمررها الى التالي حسب المسارbandwidth/delay علىrouter
. وتتم المعالجة بالمثل في األتجاه العكسي.RSVP resv
:لنأخذ الشكل المقابل كمثال على ذلك
:interface على كلRSVP في البداية تفعيل
R2(config)#interface fa0/0
R1(config‐if)#ip rsvp bandwidth 128 64
-----------------------------------------
R2(config)#interface fa0/0
R2(config‐if)#ip rsvp bandwidth 128 64
R2(config)#interface fa0/1
R2(config‐if)#ip rsvp bandwidth 128 64
-----------------------------------------
R3(config)#interface fa0/0
R3(config‐if)#ip rsvp bandwidth 128 64
R3(config)#interface fa0/1
R3(config‐if)#ip rsvp bandwidth 128 64
-----------------------------------------
R4(config)#interface fa0/0
R4(config‐if)#ip rsvp bandwidth 128 64
.reservation ) من اجل عمليةinterface bandwidth( من75% فسوف يتم استقطاع تقريباbandwidth في حالة لم نحدد اي
: عبر المسارRSVP وبالتالي سوف يرسلRSVP host من اجل ان يكون هوR1 سوف نقوم بإعداد
R1(config)#ip rsvp sender‐host 192.168.34.4 192.168.12.1 tcp 23 0 64 32
بينما في.telnet وهذا يعنيport=23 حيث انTCP باستخدام192.168.34.4 والمستقبل192.168.12.1 ما بين المرسل
.maximum burst=32kbps مع وجود.bitrate=64 kbps ومعدل.anything وهذا يعنيsource port=0
R1#show ip rsvp sender
To From Pro DPort Sport Prev Hop I/F BPS
192.168.34.4 192.168.12.1 TCP 23 0 192.168.12.1 64K
:بعد المرسل األن دور المستقبل
R4(config)#ip rsvp reservation‐host 192.168.34.4 192.168.12.1 tcp 23 0 ff ?
load Controlled Load Service
rate Guaranteed Bit Rate Service
بينما يعتبر.bandwidth and delay والذي يعني ضمان حجزguaranteed bit rate او الخيارcontrolled load سوف يكون لدينا خيار
.delay لكن لن يضمن ايbandwidth يضمن ايضاcontrolled load
R4(config)#ip rsvp reservation‐host 192.168.34.4 192.168.12.1 tcp 23 0 ff rate
64 32
:R4 فيverify من اجل
R3#
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Received Path message from
192.168.23.2 (on FastEthernet0/0)
RSVP: new path message passed parsing, continue...
RSVP: Triggering outgoing Path refresh
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Refresh Path psb = 6508EB64
refresh interval = 0mSec
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending Path message to
192.168.34.4
R4#
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Received Path message from
192.168.34.3 (on FastEthernet0/0)
R4#
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Refresh Path psb = 6618082C
refresh interval = 30000mSec
RSVP: can't forward Path out received interface
.R4 واخيرا الىR3 ومنه الىR2 الىR1 ابتدا منforwarding استمرت عملية
:R4 لنضع الرد في
R4(config)#$reservation‐host 192.168.34.4 192.168.12.1 tcp 80 0 ff rate 64 3
:هذا ما سنالحظه
R4#
RSVP session 192.168.34.4_80[0.0.0.0]: Received RESV for 192.168.34.4
(receiver host) from 192.168.34.4
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: this RESV has a confirm object
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: reservation not found‐‐new one
RSVP‐RESV: Admitting new reservation: 674BE740
RSVP‐RESV: Locally created reservation. No admission/traffic control needed
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: start requesting 64 kbps FF
reservation for 192.168.12.1(0) TCP‐> 192.168.34.4(80) on FastEthernet0/0
neighbor 192.168.34.3
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Refresh RESV, req=674C39E8,
refresh interval=0mSec [cleanup timer is not awake]
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending Resv message to
192.168.34.3
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: RESV CONFIRM Message for
192.168.34.4 (FastEthernet0/0) from 192.168.34.3
R3#
RSVP session 192.168.34.4_80[0.0.0.0]: Received RESV for 192.168.34.4
(FastEthernet0/1) from 192.168.34.4
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: this RESV has a confirm object
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: reservation not found‐‐new one
RSVP‐RESV: Admitting new reservation: 66171920
RSVP‐RESV: reservation was installed: 66171920
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: start requesting 64 kbps FF
reservation for 192.168.12.1(0) TCP‐> 192.168.34.4(80) on FastEthernet0/0
neighbor 192.168.23.2
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Refresh RESV, req=661769B4,
refresh interval=0mSec [cleanup timer is not awake]
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending Resv message to
192.168.23.2
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: RESV CONFIRM Message for
192.168.34.4 (FastEthernet0/0) from 192.168.23.2
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending RESV CONFIRM message to
192.168.34.4
R2#
RSVP session 192.168.34.4_80[0.0.0.0]: Received RESV for 192.168.34.4
(FastEthernet0/1) from 192.168.23.3
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: this RESV has a confirm object
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: reservation not found‐‐new one
RSVP‐RESV: Admitting new reservation: 674B8E00
RSVP‐RESV: reservation was installed: 674B8E00
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: start requesting 64 kbps FF
reservation for 192.168.12.1(0) TCP‐> 192.168.34.4(80) on FastEthernet0/0
neighbor 192.168.12.1
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Refresh RESV, req=674BDE94,
refresh interval=0mSec [cleanup timer is not awake]
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending Resv message to
192.168.12.1
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: RESV CONFIRM Message for
192.168.34.4 (FastEthernet0/0) from 192.168.12.1
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending RESV CONFIRM message to
192.168.23.3
R1#
RSVP session 192.168.34.4_80[0.0.0.0]: Received RESV for 192.168.34.4
(FastEthernet0/0) from 192.168.12.2
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: this RESV has a confirm object
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: reservation not found‐‐new one
RSVP‐RESV: Admitting new reservation: 66C95AF4
RSVP‐RESV: reservation was installed: 66C95AF4
RSVP 192.168.12.1_0‐>192.168.34.4_80[0.0.0.0]: Sending RESV CONFIRM message to
192.168.12.2
. معينflow من اجلreservation لتلك الرسالة وقام بعملforward بعمليةrouter كل
RSVP DSBM (Designated Subnetwork Bandwidth Manager)
two routers بينlink سوف يعمل بشكل جيد عندما نقوم بعمل ذلك عبرRSVP
؟shared segment لكن ماذا عن
.half-duplex Ethernet network متصلة بـrouters في الشكل لدينا اكثر من
.bandwidth اي لديها تشارك لـ
؟bandwidth معين استقطع جزء معين منrouter انrouters كيف ستعلم بقية
.DSBM الجواب بالضبط من خالل
سوف يتم تمرير كلrouters وكلDSBM سوف يتم انتخاب
. من خاللهRSVP PATH and RESV messages