Overview

نظرة عامة على VRRP مع تطور الإنترنت، تزداد الحاجة إلى موثوقية عالية للشبكة. بالنسبة لمستخدمي LAN، من الضروري البقاء على اتصال دائم بالشبكة الخارجية. عادةً، يتم تكوين جميع الأجهزة في شبكة داخلية بوجهة مسار افتراضي واحد موجه إلى بوابة خروج، يتم من خلالها التواصل مع الشبكات الخارجية. إذا فشلت بوابة الخروج، سيتقطع الاتصال بين هذه الأجهزة والشبكات الخارجية. طريقة شائعة لتحسين موثوقية النظام هي تكوين بوابات خروج متعددة. ومع ذلك، غالبًا ما لا تدعم معظم الأجهزة على LAN بروتوكولات التوجيه الديناميكي، لذا فإن اختيار مسار بين بوابات الخروج المتعددة يمثل تحديًا. طورت IETF بروتوكول VRRP (Virtual Router Redundancy Protocol) لتمكين الأجهزة على LAN من الوصول الموثوق إلى الشبكات الخارجية.
20170801100022797.png
وضع الشبكة الشائع
1. What is VRRP? VRRP (Virtual Routing Redundancy Protocol) is a network selection protocol. Simply put, the basic principle of VRRP is a redundant copy of the gateway, meaning a virtual router is created from two or more routers by running VRRP, and the virtual router is used as the gateway for devices connected to the home network. المفاهيم الأساسية المرتبطة بـ VRRP موضحة كما يلي:

المفاهيم

الأوصاف
VRRP Router The router runs VRRP and may belong to a single or multiple virtual routers.
راوتر افتراضي An abstract device managed by VRRP, also called a VRRP failover group. The virtual router acts as a virtual gateway for hosts on a shared LAN.
The virtual router consists of a virtual router ID and a set of virtual IP addresses.
عنوان IP افتراضي عنوان IP لراوتر افتراضي. يتم تعيين عنوان IP افتراضي واحد أو عدة عناوين IP افتراضية يدويًا للراوتر الافتراضي.
(IP Address Owner) A VRRP router uses the virtual router's IP as the real interface address. When functioning correctly, the VRRP router responds to packets addressed to the virtual IP, such as ping packets and TCP packets.

(Default MAC address)
A MAC address is generated by a virtual router according to the virtual router ID. The virtual router has a single virtual MAC address.
The virtual router responds to ARP requests using the virtual MAC address instead of the actual interface MAC address.
(العنوان IP الأساسي) An IP address is chosen from one of the physical interface IP addresses. It is usually the first configured IP address.
The primary IP address acts as the source IP in VRRP broadcast packets.
Master Router(Virtual Router Master) راوتر AVRRP الذي يوجه الحزم إلى عنوان IP الافتراضي ويستجيب لطلبات ARP.
عند توفر مالك عنوان IP، عادةً ما يعمل كجهاز التوجيه الرئيسي
راوتر احتياطي(Virtual Router Backup) A set of VRRP routers does not forward packets. If the primary router fails, the best backup router selected through competition becomes the new primary router.
3. ما هي فوائد VRRP؟ The function of VRRP is to dynamically assign a virtual router to one of the VRRP routers on the LAN. The VRRP router that controls the IP address of the virtual router is called the master router, which forwards packets to these virtual IP addresses. If the master router fails, this selection process provides a dynamic failover mechanism. In this way, if a host fails to route the next hop, another router can be used in a timely manner to replace it, ensuring continuity and reliability of the connection.4. كيف يعمل VRRP؟ As shown in Figure 1, routers A, B, and C form a virtual router VRRP. The default VRRP IP address is 10.110.10.1. Router A acts as the primary router with its IP address 10.110.10.5; routers B and C serve as backup routers, with IP addresses 10.110.10.6 and 10.110.10.7 respectively. The default gateway for hosts A, B, and C on the LAN is set to the VRRP default IP address 10.110.10.1. Typically, router A routes packets from the LAN to the external network; if router A is stopped or fails, router B or C (depending on priority) becomes the primary backup router to route packets from the LAN to external networks, maintaining connectivity between the LAN and the external network and improving network reliability. الشكل 1 مخطط الراوتر الافتراضي
20170823040037313.png
كما هو موضح في الشكل 1، بيئة شبكة الراوتر الافتراضي كما يلي: يتواصل المضيفون مع الشبكات الخارجية عبر هذه البوابة الافتراضية. آلية عمل الراوتر كما يلي: ● يتم اختيار الموجه الرئيسي وفقًا لمستويات الأولوية: يتم اختيار الموجه ذو الأولوية الأعلى كموجه رئيسي. إذا كان لدى راوترين نفس الأولوية، فقارن عنوان IP للواجهة. سيتم اختيار الراوتر الذي يمتلك عنوان IP للواجهة الأكبر كراوتر رئيسي. تعمل أجهزة الراوتر الأخرى كراوترات احتياطية تراقب حالة الراوتر الرئيسي في أي وقت. ● في حال لم يتلقَ الراوتر الاحتياطي في المجموعة حزمًا من الراوتر الرئيسي خلال فترة Master_Down_Interval، سيتحول إلى الراوتر الرئيسي. في مجموعة VRRP مع عدة راوترات احتياطية، قد يتم إنشاء عدة راوترات رئيسية في فترة قصيرة، ثم تتم مقارنة الأولويات في حزم VRRP المستلمة مع الأولويات المحلية، ويتم اختيار الراوتر ذو الأولوية الأعلى كراوتر رئيسي. 5. آلة حالة VRRP تعرف VRRP على ثلاث حالات: التهيئة، الرئيس، والنسخ الاحتياطي. فقط الراوتر في حالة الرئيس يمكنه توجيه الحزم الموجهة إلى عنوان IP الافتراضي. Figure 1 shows the VRRP state transition Figure 1 VRRP State Transition
20170807042158397.png
Becomes Master Initialize: receive hang‑up message The start becomes Master: receive a Shutup message with priority 255 يصبح الرئيس نسخة احتياطية: استلام حزمة ذات أولوية أعلى من المحلية. Configuration becomes a backup: receive a Shutup message with priority lower than 255 يصبح النسخ الاحتياطي رئيسيًا :انتهاء المهلة · تهيئة The router enters the Initialize state on boot. If a Startup message is received on the interface, the router switches to Backup or Master state (if the interface owner’s IP address priority is 255, the router immediately goes to Master). In this case, the router does not process VRRP packets. · رئيسي (1) In Master mode, the router does the following: · يمرر حزم VRRP بشكل دوري. · Responds to ARP requests for a default IP address and replies with a default MAC address instead of the physical interface's MAC. · forwards packets whose destination MAC address is the default MAC address · ينتقل إلى حالة النسخ الاحتياطي إذا تم استلام حزمة ذات أولوية أعلى. · ينتقل إلى حالة النسخ الاحتياطي إذا تم استلام حزمة ذات أولوية مماثلة وكان عنوان IP الأساسي في الطرف المرسل أكبر من العنوان المحلي. · ينتقل إلى حالة Initialize عند استلام حدث إغلاق الواجهة. · احتياطي · (2) في حالة النسخ الاحتياطي، يقوم الراوتر بالآتي: · Receives VRRP packets sent by the master and determines whether the main router is functioning correctly. · لا يستجيب لطلب ARP لعنوان IP الافتراضي. · يتجاهل حزم IP التي يكون عنوان MAC الوجهة فيها عنوان MAC افتراضي. · لا يتلقى حزم IP التي يكون عنوان IP الوجهة فيها عنوان IP افتراضي. · Switch to Master state only when the backup router receives a MASTER_DOWN_TIMER event. · ينتقل إلى حالة Initialize عند استلام حدث إغلاق الواجهة.6. الخاتمة VRRP يطبق النسخ الاحتياطي عبر مفتاحي توجيه أو أكثر يدعمان VRRP. عندما يفشل الموجه الرئيسي، يمكن الحفاظ على الاتصال عبر الموجهات الاحتياطية الأخرى. في حالة حدوث عطل، لا يلزم استبدال أي تكوين لمعدات موقع العميل (CPE). وظيفة التوجيه تنتقل تلقائيًا إلى الموجهات الاحتياطية. في التطبيق العملي، اختيار تقنية التوجيه المناسبة بالتوافق مع المتطلبات للتخطيط مفيد جدًا لاستقرار تشغيل الشبكة.