شبکه‌های کامپیوتری/مسیریابی: تفاوت میان نسخه‌ها

محتوای حذف‌شده محتوای افزوده‌شده
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۱۱۳:
[[Image:Pic DV 1.svg]]
 
 
The cost of each link is set to 1. Thus, the least cost path is simply the path with the fewer hops. The table below represents each node knowledge about the distance to all other nodes:
هزینه هر پیوند 1 تنظیم شده است. بنابراین، مسیری با کمترین هزینه، تنها مسیری است که هزینه آن کمترین باشد . جدول زیر نشان دهنده دانش هر گره از فاصله به تمام گره های دیگر است:
 
<br />
سطر ۱۳۶ ⟵ ۱۳۷:
! G || <math>\infty</math> || <math>\infty</math> || <math>\infty</math> || 1 || <math>\infty</math> || 1 || 0
|}
 
 
در ابتدا، هر گره هزینه 1 را به گره هایی که مستقیما به آن متصل هستند و مقدار بی نهایت به تمامی گره های دیگر می دهد. در زیر جدول مسیریابی اولیه در گره A نشان داده شده است:<br />
<br />
Initially, each node sets a cost of 1 to its directly connected neighbors and infinity to all the other nodes. Below is shown the initial routing table at node A:
 
{| border=1 cellpadding=5 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
سطر ۱۵۳ ⟵ ۱۵۶:
|-
| G || <math>\infty</math> || -
|}
 
در مرحله بعد، هر گره یک پیام را به گره های متصل  ارسال می کند. این پیام حاوی لیستی از فاصله هر گره تا  گره های دیگر است. به عنوان مثال، گره F به گره A می گوید که می تواند با هزینه 1 به  گره G برسد. گره A همچنین می داند که با هزینه ی 1  می تواند به F  برسد، بنابراین این هزینه را برای هزینۀ رسیدن به G با استفاده از F می افزاید. از آنجائیکه هزینه فعلی  بی نهایت است و 2  کمتر، بنابراین  گره A می گوید که می تواند از طریق F به G با هزینه 2 برسد. گره A از گره C می آموزد که گره B را می توان از گره C با هزینه ی 1 رد کرد، بنابراین نتیجه می شود که هزینه رسیدن به B از طریق گره C هزینه 2 در بردارد. از آنجا که این هزینه ، بهینه تر ازهزینه فعلی رسیدن به B  که در حال حاضر1 است نمی باشد، اطلاعات جدید نادیده گرفته می شود. جدول نهایی نهایی در گره A در زیر نشان داده شده است:
During the next step, every node sends a message to its directly connected neighbors. That message contains the node's personal list of distances. Node F, for example, tells node A that it can reach node G at cost of 1; node A also knows that it can reach F at a cost of 1, so it adds these costs to get the cost of reaching G by means of F. Because 2 is less than the current cost of infinity, node A records that it can reach G at a cost of 2 by going trough F. Node A learns from C that node B can be reached from C at a cost of 1, so it concludes that the cost of reaching B via C is 2. Because this is worse than the current cost of reaching B, which is 1, the new information is ignored. The final routing table at node A is shown below:
 
{| border=1 cellpadding=5 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
سطر ۱۷۳ ⟵ ۱۷۶:
|}
 
 
The process of getting consistent routing information to all the nodes is called '''convergence'''.
فرایند دریافت اطلاعات مسیر یابی سازگار به تمام گره ها همگام سازی نامیده می شود. مجموعه نهایی هزینه ها از هر گره به تمام گره های دیگر در جدول زیر نشان داده شده است:
The final set of costs from each node to all other nodes is shown in the table below:
 
<br />
 
{| border=1 cellpadding=5 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
سطر ۱۹۵ ⟵ ۲۰۰:
|-
! G || 2 || 3 || 2 || 1 || 3 || 1 || 0
|}
 
یکی از مشکلات با الگوریتم های بردار فاصله، "شمارش تا بی نهایت" نامیده می شود. بگذارید مشکل زیر را با یک مثال بررسی کنیم:
The cost of each link is set to 1. Thus, the least cost path is simply the path with the fewer hops.
 
یک شبکه را با یک گراف در زیر نشان دهید. تنها یک اتصال بین D و سایر قسمت های شبکه وجود دارد.
One of the problems with distance vector algorithms is called "count to infinity." Let's examine the following problem with an example:
 
Consider a network with a graph as shown below. There is only one link between D and the other parts of the network.
 
[[Image:Dijkstra algorithm example 13.svg]]
 
{| border=1 cellpadding=10 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
[[Image:Dijkstra algorithm example 13.svg]]
 
with vectors
 
d [A][A] = 0 d [A][B] = 1 d [A][C] = 2 d [A][D] = 3
 
 
{| border=1 cellpadding=10 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
|-
! !! A !! B !! C !! D
سطر ۲۲۸ ⟵ ۲۲۶:
|}
 
در حال حاضر لینک C به D  دچار تصادم است  زیرا برای ارسال  بسته با آدرس D باید از لینک  CD استفاده شود ، اما اگر گره D در حال ارسال اطلاعات باشد، هزینه ∞ = [C] [D]  میشود،
 
بنابراین گره C باید بردار فاصله خود را مجددا محاسبه و مسیری را انتخاب کند . به همین ترتیب گره D باید بردارهای خود را بروزرسانی کند. پس از به روزرسانی بردارهای خود در C و D، ما داریم :
Now the C to D link crashes
So cost [C][D] = ∞
C used to forward any packets with address D directly on the CD link, but now link is down, so C has to recompute its distance vector (and make a new choice of how to forward packets to D) - similarly D has to update its vector. After updating their vectors at C and D, we have
 
 
{| border=1 cellpadding=10 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
سطر ۲۵۱ ⟵ ۲۴۷:
|}
 
گره C گره B را به عنوان بهترین مسیر به گره D با هزینه 3 میشناسد، زمانی که گره C بردارهای خود را به گره B ارسال میکند، گره B می فهمد که انتخاب قبلی خود برای ارسال اطلاعات به گره D از طریق گره C هزینه بیشتری دربر دارد بنابراین گره B باید بردارهای خود را دوباره محاسبه کند.
 
C views B as the best route to D, with cost 1 + 2, so C sends new vector to B. B learns that its former choice for sending to D via C now has higher cost, so B should recompute its vector.
 
 
{| border=1 cellpadding=10 cellspacing=0 style="text-align: center; background-color: #FFFFDD;"
|-