You are on page 1of 21

Islamic University of Gaza

Faculty of Engineering

Computer Engineering Department

Networks Discussion ECOM 4021

Lecture # 5
CH.4
The Network Layer

By

Eng. Wafaa Audah

April 2013
Networks Discussion
Eng. Wafaa Audah

(Theoretical material: page 2-9, Review questions and problems :10-end)

4.1 Introduction
- Forwarding: move packets from router’s input to
appropriate router output.

‫ خاص به‬Forwarding table ‫لكل راوتر يوجد‬

- Routing: determine route taken by packets from source to


destination.

‫ الخاصة‬Tables ‫ لتحديد الراوتنج وعمل ال‬Algorithms ‫يوجد عدة‬


‫بالشبكة‬

Network service model

- Characteristics of end-to-end transport of packets between


sending and receiving end systems.

- Services that could be provided by the network layer


includes:

• Guaranteed delivery: This service guarantees that the


packet will eventually arrive at its destination.

• Guaranteed delivery with bounded delay: This service not


only guarantees delivery of the packet, but delivery within
a specified host-to-host delay bound (for example, within
100 msec).

‫ في الكتاب‬543 ‫يوجد كثير من األنواع ولكن شرحها المفصل في صفحة‬

" pdf ‫" فوق في ترقيم ال‬

4.2 Virtual circuit and datagram networks


- Computer networks that provide only a connection service
at the network layer are called virtual-circuit (VC) networks.

- Computer networks that provide only a connectionless


service at the network layer are called datagram networks.

2
Networks Discussion
Eng. Wafaa Audah

Virtual Circuit Network

- VC consists of:

1. Path: from source to destination: all links/routers


between source and destination.

2. VC numbers: one number for each link along path ***

3. entries in forwarding tables in routers along path

‫*** عند التعامل مع النوعين الفيرتشوال سيركت والداتاجرام الزم نفرق‬


‫بين شغلتين‬

, ‫ بحيث تمثل الرقم الخاص بكل لينك لتمييزه في الشبكة‬: VC number -


" ‫لذلك لكل لينك رقم خاص فيه غير مسموح تكراره "خاص بنوع الفيرتشوال‬

‫ وهيا شغلة موجودة في النوعين بحيث هو رقم‬:interface number -


‫يُعطى لكل انترفيس خاص بالراوتر (طرف اللينك بالنسبة للراوتر) يبدأ‬
‫ ولكل راوتر يتكرر نفس الشي بمعنى انو الرقم ممكن‬1 ‫الترقيم عادة من‬
‫يتكرر بالشبكة _ الشكل التالي يوضح الفرق بين النوعين السابقين من‬
: ‫االرقام‬

There are three identifiable phases in a virtual circuit:

- VC Setup: The network layer determines the path between


sender and receiver, that is, the series of links and routers
through which all packets of the VC will travel. The
network layer also determines the VC number for each link
along the path. Finally. the network layer adds an entry in
the forwarding table in each router along the path.

3
Networks Discussion
Eng. Wafaa Audah

- Data transfer: As shown in figure below, once the VC has


been established, packets can begin to flow along the VC.

- VC teardown: This is initiated when the sender (or


receiver) informs the network layer of its desire to
terminate the VC. The network layer will then typically
inform the end system on the other side of the network of
the call termination and update the forwarding tables in
each of the packet routers on the path to indicate that the
VC no longer exists.

Forwarding Table For Virtual circuit Networks :

A ‫مقطع من التيبل الخاص بالراوتر‬

‫لحتى نالحظ الفرق بين الفيرتشوال سيركت والداتاجرام الزم نثبت‬


‫في بالنا شكل التيبل هادا والمدخالت الثابتة اللي فيه النو بيختلف‬
....... ‫عن التيبل الخاص بالراوتر في الداتاجرام نتورك‬

4
Networks Discussion
Eng. Wafaa Audah

Datagram Network

- No call setup at network layer


- Packets forwarded using destination host address

Forwarding table

‫ بحيث قد يكون عنوان‬destination ‫نالحظ هنا ان التيبل يعتمد على عنوان‬


‫ في‬.‫ االنترفيس الخاص فيها‬Range ‫ معين ولكل‬subnet ‫ ل‬Range ‫واحد او‬
4 billion ‫ بت للعنوان رح يكون عنا احتمال وجود‬32 ‫هاي الحالة عنا‬
‫ احنا مش محتاجين نكتب كل هاي الشغالت بالتيبل‬possible entries
:‫ زي التالي‬Prefix Match ‫الحل هوا استخدام‬

5
Networks Discussion
Eng. Wafaa Audah

- The router matches a prefix of the packet's destination address


with the entries in the table; if there's a match, the router
forward the packet to a link associated with the match.

- When there are multiple matches, the router uses the longest
prefix matching rule; that is. it finds the longest matching entry
in the table and forwards the packet to the link interface
associated with the longest prefix match.

4.3 What’s inside a router

Input Port Functions

6
‫‪Networks Discussion‬‬
‫‪Eng. Wafaa Audah‬‬

‫‪Input Port Queuing‬‬

‫‪ Fabric slower than input ports combined queuing may‬‬


‫‪occur at input queues.‬‬

‫عندما تصل الداتاجرامز إلى ‪ fabric switch‬بسرعة أكبر من معدل النقل‪.‬‬

‫‪ Head-of-the-Line (HOL) blocking: queued datagram at‬‬


‫‪front of queue prevents others in queue from moving‬‬
‫‪forward.‬‬

‫حالة وجود داتاجرام في ‪ queue‬تمنع غيرها من االنتقال فتكون شاغلة‬


‫المسار مع انو غيرها موجود والطرف اآلخر مستعد الستقبالها ولكن اليتم‬
‫النقل كما في الصورة التالية‪:‬‬

‫حسب الصورة فان الداتا باللون األخضر رح تستنى الداتا اللي باللون االحمر‬
‫ويسير عندها ديلي مع انو الطرف التاني مستعد الستقبال الداتا باللون‬
‫االخضر_ال ‪ queue‬الوسطى اللي بالطرف اليمين فارغة وهادا معناه ‪HOL‬‬
‫‪ Blocking‬‬

‫!‪ Queuing delay and loss due to input buffer overflow‬‬

‫‪Output Ports‬‬

‫‪- Buffering when arrival rate via switch exceeds output line‬‬
‫‪speed‬‬

‫عندما تصل الداتاجرامز من ‪ fabric switch‬بسرعة أكبر من معدل النقل‪.‬‬

‫‪7‬‬
Networks Discussion
Eng. Wafaa Audah

- Queuing (delay) and loss due to output port buffer


overflow!

Three types of switching fabrics

‫ يرجى مراجعة‬..... ‫لمزيد من المعلومات والتفاصيل عن هادا الموضوع‬


 563-533 ‫الكتاب من صفحة‬

4.4 IP: Internet Protocol


IP Fragmentation & Reassembly

‫عملية تقسيم بلوك كبير من الداتا إلى مجموعة من البلوكات األصغر حجما‬
fragmentation ‫تسمى عملية ال‬

- Network links have MTU (max. transfer size) - largest


possible link-level frame.
- Large IP datagram divided (“fragmented”) within net
 one datagram becomes several datagrams
 “reassembled” only at final destination
 IP header bits used to identify, order related
fragments

‫ سيتم توضيحها بالتفصيل مع‬fragmentation ‫شرح كيفية التعامل مع ال‬


....... ‫السؤال الحقا في هذه المتريال‬

8
Networks Discussion
Eng. Wafaa Audah

‫ مارح يتم‬IP Addresses and Subnetting ‫باقي مواضيع السكشن زي‬


‫شرحها هنا النو تم تغطيتها في الالب وموجودة بالكتاب والساليدز‬



4.5 Routing algorithms


- Link-State Routing Algorithm

Dijkstra's algorithm requires that each node must have


complete information about the network; that is, each node
must know the link costs of all links in the network.

‫عشان نعمل الراوتنج تيبل الزم نعرف معنى الرموز اللي موجودة فيه وهيا‬
:‫كالتالي‬

- L(v): current value of cost of path from source to dest. V


= ∞ if not direct neighbors
- P: path from source to v
- M: set of nodes whose least cost path definitively known
(visited nodes)

- Distance Vector Algorithm

The Bellman-Ford algorithm uses only on information from its


neighbors and knowledge of its link costs, to update it costs
and paths.

‫ ستأتي‬Bellman-Ford ‫ و‬Dijkstra ‫*** شرح آلية العمل الخاصة ب‬


**** ‫بالتفصيل مع األسئلة الخاصة بها الحقا‬

‫ باقي المواضيع التي لم تتم تغطيتها هنا في المتريال هيا اكيد‬:‫مالحظة‬


^_^ ‫مطلوبة وموجودة بالساليدز والكتاب ويجب قراءتها‬

9
Networks Discussion
Eng. Wafaa Audah

Review Questions and Problems

Review Questions

R.9 Describe how packet loss can occur at input ports. Describe how
packet loss at input ports can be eliminated (without using infinite
buffers).

Packet loss occurs if queue size at the input port grows large because of slow
switching fabric speed and thus exhausting router’s buffer space. It can be
eliminated if the switching fabric speed is at least n times as fast as the
input line speed, where n is the number of input ports.

Speed=

n input ports n*port speed

10
Networks Discussion
Eng. Wafaa Audah

Problems

P.4 Consider the network below.


a. Suppose that this network is a datagram network. Show the
forwarding table in router A, such that all traffic destined to host H3 is
forwarded through interface 3.

b. Suppose that this network is a datagram network. Can you write down
a forwarding table in router A, such that all traffic from H1 destined to
host H3 is forwarded through interface 3, while all traffic from H2
destined to host H3 is forwarded through interface 4?

c. Now suppose that this network is a virtual circuit network and that
there is one ongoing call between H1 and H3, and another ongoing call
between H2 and H3. Write down a forwarding table in router A, such
that all traffic from H1 destined to host H3 is forwarded through
interface 3, while all traffic from H2 destined to host H3 is forwarded
through interface 4.

a. Destination Address Link Interface


H3 3

b. No, because forwarding rule is only based on destination address.


)!!!!! ‫ وكل واحد له انترفيس‬H3 ‫(اليمكن عمل التيبل ألنو رح يكون عنا صفين ل‬

c. Incoming interface Incoming VC# Outgoing Interface Outgoing VC#


1 12 3 22
2 63 4 18

11
Networks Discussion
Eng. Wafaa Audah

P.8 Consider the switch shown below. Suppose that all datagrams have
the same fixed length, that the switch operates in a slotted, synchronous
manner, and that in one time slot a datagram can be transferred from an
input port to an output port. The switch fabric is a crossbar so that at
most one datagram can be transferred to a given output port in a time
slot, but different output ports can receive datagrams from different
input ports in a single time slot. What is the minimal number of time
slots needed to transfer the packets shown from input ports to their
output ports, assuming any input queue scheduling order you want (i .e.
, it need not have HOL blocking)? What is the largest number of slots
needed, assuming the worst-case scheduling order you can devise,
assuming that a non-empty input queue is never idle?

12
‫‪Networks Discussion‬‬
‫‪Eng. Wafaa Audah‬‬

‫‪Slot 1‬‬ ‫‪Slot 2‬‬ ‫‪Slot 3‬‬

‫‪Q1‬‬ ‫‪X‬‬ ‫‪X‬‬

‫‪Q2‬‬ ‫‪X‬‬ ‫‪Y‬‬ ‫‪X‬‬ ‫‪Y‬‬ ‫‪X‬‬

‫‪Q3‬‬ ‫‪Z‬‬ ‫‪Y‬‬ ‫‪Z‬‬ ‫‪Y‬‬ ‫‪Z‬‬ ‫‪Y‬‬ ‫‪Z‬‬

‫‪Slot 1: From Q1: X‬‬ ‫‪Slot 2: From Q1: -‬‬ ‫‪Slot 3: From Q1: -‬‬

‫‪From Q2: Y‬‬ ‫‪From Q2: X‬‬ ‫‪From Q2: -‬‬

‫‪From Q3: -‬‬ ‫‪From Q3: Y‬‬ ‫‪From Q3: Z‬‬

‫‪The number of time slots needed is 3‬‬

‫هنا رح نحتار هل هادا الرقم اللي طلع معنا هوا المينمم وال الماكسيمم‪.....‬خلينا‬
‫نشوف هل عنا حل آخر غير الموجود بمعنى هل في خيارات في اختيار الداتا ممكن‬
‫تغير في عدد التايم سلوت !!!؟؟؟؟‬

‫‪Slot 1‬‬ ‫‪Slot 2‬‬ ‫‪Slot 3‬‬

‫‪X Y‬‬ ‫‪X‬‬

‫‪z‬‬

‫‪Slot 1: From Q1: X‬‬ ‫‪Slot 2: From Q1: -‬‬ ‫‪Slot 3: From Q1: -‬‬

‫‪From Q2: -‬‬ ‫‪From Q2: Y‬‬ ‫‪From Q2: X‬‬

‫‪From Q3: Y‬‬ ‫‪From Q3: Z‬‬ ‫‪From Q3: -‬‬

‫!!! ‪The minimum and maximum slots equal 3‬‬

‫بس هنا في هاي الحالة صدفت انو نفس الشي وما فرق معنا بس في حاالت تانية‬
‫بيكون الوضع فيها معقد أكتر بمعنى انو لو كان في أكتر من حالة ‪ HOL‬بيكون في عدة‬
‫خيارات لالرسال بتعطي فرصة وجود مينمم وماكسيمم تايم ‪‬‬

‫‪13‬‬
Networks Discussion
Eng. Wafaa Audah

P.9 Consider a datagram network using 32-bit host addresses. Suppose a


router has four links, numbered 0 through 3, and packets are to be
forwarded to the link interfaces as follows:

a. Provide a forwarding table that has four entries, uses longest prefix
matching, and forwards packets to the correct link interfaces.

b. Describe how your forwarding table determines the appropriate link


interface for datagrams with destination addresses:

14
Networks Discussion
Eng. Wafaa Audah

a. Prefix Match Link Interface


‫عشان نطلع البريفكس الزم نتتبع‬
1st 11100000 00 0 ‫على العنوان بداية من الشمال‬
‫بحيث انو نطلع المقطع الثابت‬
2nd 11100000 01000000 1
‫في كل الرينج بحيث انو العناوين‬
3rd 1110000 2 ‫متتالية وبداية كل رينج هيا‬
‫التالية الخر عنوان بالرينج‬
4th 11100001 1 3
......‫السابق‬
5th otherwise 3

‫ لو انا حكيت هادا العنوان بدي اعرف اليا‬.. ‫ لسبب مهم وهوا‬entry ‫الزم نحط هادي ال‬
‫ ؟؟؟؟‬1110000110000000000000000000000 : ‫انترفيس بيتبع‬

2 ‫لو ما كنا حاطين هاي االنتري رح يكون الجواب انو هادا العنوان تابع لالنترفيس‬
‫هادا الشي مش صحيح لذلك الزم‬. ‫!! حسب ال بريفكس اللي موجود بالتيبل السابق‬
‫ بحيث بنبحث عال بريفكس تبع الرينج‬5 ‫نميز العناوين اللي رح يبدا منها رينج انترفيس‬
11100001 1 ‫الجديد وهوا‬

b. Prefix match for first address is 5th entry: link interface 3


Prefix match for second address is 3nd entry: link interface 2
Prefix match for third address is 4th entry: link interface 3

P.10 Consider a datagram network using 8-bit host addresses. Suppose


a router uses longest prefix matching and has the following forwarding
table:

Prefix Match Interface

00 0

010 1

011 2

10 2

11 3

For each of the four interfaces, give the associated range of destination
host addresses and the number of addresses in the range.

15
‫‪Networks Discussion‬‬
‫‪Eng. Wafaa Audah‬‬

‫هنا الحل هوا عكس حل السؤال السابق بمعنى انو هنا المعطى هوا ال بريفكس‬
‫والمطلوب الرينج ‪‬‬

‫عشان نحسب عدد الهوست في كل رينج بنشوف كم عدد البتات اللي بيسير فيها‬
‫التغيير في الرينج مسال لما احكي من ‪ 000‬ل ‪ 111‬كم عنوان عنا ؟؟؟ بيكون الحل هوا‬
‫‪ ^2‬عدد البتات اللي صار فيها التغيير يعني ‪ 2^3=8‬عناوين ‪......‬هنا بالسؤال نفس‬
‫الشي بنشوف كم بت صار فيهم التغيير في الرينج وعأساسهم بنشوف عدد الهوست‬

‫‪16‬‬
Networks Discussion
Eng. Wafaa Audah

P.12 Consider a router that interconnects three subnets: Subnet I,


Subnet 2, and Subnet 3. Suppose all of the interfaces in each of these
three subnets are required to have the prefix 223.1.17/24. Also suppose
that Subnet I is required to support up to 63 interfaces, Subnet 2 is to
support up to 95 interfaces, and Subnet 3 is to support up to 16
interfaces. Provide three network addresses that satisfy these
constraints.

Subnet 1: 2^n-2> 63: n= 7 -------- 128 interfaces

Subnet 2: 2^n-2> 95: n= 7 -------- 128 interfaces

Subnet 3: 2^n-2> 16: n= 5 -------- 32 interfaces

Subnet 1: 223.1.17.0

Subnet 2: 223.1.17.128 ------ ‫الخر الشبكة‬

Subnet 3: ‫ مالها مكان بالشبكة‬

So,we can’t make a classsfull subnetting based on the topology above

with network prefix address 223.1.17/24

P.17 Consider sending a 2400-byte datagram into a link that has an


MTU of 700 bytes . Suppose the original datagram is stamped with the
identification number 422. How many fragments are generated? What
are the values in the various fields in the IP datagram(s) generated
related to fragmentation?

17
Networks Discussion
Eng. Wafaa Audah

- Datagram = Header + Data


- MTU = Header + Data
- We will assume that the size of the IP header is 20 bytes

‫ بايت‬2533 ‫ بايت يعني الداتا الفعلية اللي موجودة فيها‬2433 ‫الداتاجرام حجمها‬

‫ بايت اللي هيا اكبر حجم‬633 ‫ بايت معناها الداتا الفعلية هيا‬033= MTU ‫وحجم ال‬
‫ الوحدة‬fragment ‫مسموح الي انقلها في ال‬

Fragment Data length ID Offset Flag


number (bytes) (8 bytes)
1 680 422 0 1
2 680 422 680/8 = 85 1
3 680 422 (680+680)/8=170 1
4 340 422 (680+680+680)/8=255 0

- fragment offset must be a multiple of 8-byte.

- n = number of fragments
- d = total data
- m = maximum data size
General form: n= |‾ d/m ‾| = |‾ 2380/680 ‾| = |‾ 3.5 ‾| = 4

So we need 4 fragments.

8-bytes ‫ متغير بيشوف كم حجم الداتا اللي تم نقلها مسبقا بوحدة ال‬: Offset
‫ بما معناه انو لسه ضايل داتا ماعدا اخر مرة بيكون‬1 ‫ دايما بيكون‬: More Flag
‫زيرو بما يعني انو الداتا خلصت‬

P.24 Consider the following network. With the indicated link costs, use
Dijkstra's shortest-path algorithm to compute the shortest path from X to
all network nodes.

18
‫‪Networks Discussion‬‬
‫‪Eng. Wafaa Audah‬‬

‫‪Step‬‬ ‫‪M‬‬ ‫‪L (t) P‬‬ ‫‪L (u) P‬‬ ‫‪L (v) P‬‬ ‫‪L (w) P‬‬ ‫‪L (y) P‬‬ ‫‪L (z) P‬‬
‫‪1‬‬ ‫‪x‬‬ ‫∞‬ ‫‪-‬‬ ‫∞‬ ‫‪-‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪2‬‬ ‫‪xv‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪3‬‬ ‫‪xvu‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪4‬‬ ‫‪xvuw‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪5‬‬ ‫‪xvuwy‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪6‬‬ ‫‪xvuwyt‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬
‫‪7‬‬ ‫‪xvuwytz‬‬ ‫‪7‬‬ ‫‪x-v-t‬‬ ‫‪6‬‬ ‫‪x-v-u‬‬ ‫‪3 x-v‬‬ ‫‪6 x-w‬‬ ‫‪6 x-y‬‬ ‫‪8 x-z‬‬

‫اول ما نبدا نحل بنشوف مين المتصلين مباشرة بالنود ‪ x‬وبنحط الكوست تبعها‬
‫عطول في الجدول وغير هيك ايا نودز مش متصلة بنحطلها انفينيتي ‪‬‬

‫بنشوف مين من النودز الموجودين الكوست تبعها اقل شي وبنضمها ل ‪ M‬بحيث‬


‫تمثل ‪ M‬مجموعة النودز اللي تم زيارتها واللي بامكاني اني اتحرك من خاللها‬
‫يعني اول صف في الجدول بنحكي من خالل ‪ x‬بس بقدر اوصل لمين وهيك في‬
‫الصف التاني من خالل ‪ x,v‬بقدر اوصل لمين وبنضل ماشيين في كل الخطوات‬
‫زي هيك نشوف االقل ونضيفو للجدول ومابنرجع نطلع عالنود بعد مانضيفها عال‬
‫‪ M‬خلص بنثبت الكوست تبعها الخر الجد ول ‪ .‬وفي حال تساوي قيمتين لنودز‬
‫بناخد ايا وحدة فيهم زي هادي مسال ‪ :‬ال ‪ u‬و ‪w‬و ‪ y‬نفس الكوست ايا شي‬
‫فيهم مابيفرق‪.‬‬

‫في كل مرة انا بقارن الكوست الجديد اللي بيطلع معي والخاص بنود معينة‬
‫باللي موجود مسبقا مابغير في الجدول القيمة اال لو كانت القيمة الجديدة اقل‬
‫من القيمة الموجودة اصال بالجدول النو احنا معنيين بالحصول على ‪least‬‬
‫‪cost\shortest path‬‬

‫بنضل ماشيين في الجدول لحد مايسير كل النودز موجودين في ‪ M‬حتى لو‬


‫الحظنا انو االجابات ثبتت وبالمقابل ممنوع نزيد خطوة بعد ما يسير كل النودز‬
‫في ال ‪" M‬ازا بدنا نتأكد نتأكد بمخنا مش ضروري نحطها بالجواب ^_^ "‪.‬‬

‫‪P.26‬‬ ‫‪Consider the network shown below, and assume that each node‬‬
‫‪initially knows the costs to each of its neighbors. Consider the distance-‬‬
‫‪vector algorithm and show the distance table entries at node z.‬‬

‫‪19‬‬
Networks Discussion
Eng. Wafaa Audah

h Lh (u) P Lh (v) P Lh (x) P Lh (y) P


0 ∞ - ∞ - ∞ - ∞ -
1 ∞ - 6 z-v 2 z-x ∞ -
2 7 z-v-u 5 z-x-v 2 z-x 5 z-x-y
3 6 z-x-v-u 5 z-x-v 2 z-x 5 z-x-y
4 6 z-x-v-u 5 z-x-v 2 z-x 5 z-x-y

‫ المسموح التحرك فيهم للوصول‬hops ‫فكرة الحل هنا بتعتمد على زيادة عدد‬
‫ وفي كل مرة‬....‫ او‬... ‫ او‬... ‫ او‬1 ‫ او‬0 ‫للنودز ففي كل مرة بنشوف لو كان‬
‫ "اللينكات" بقدر اوصل للنودز وبجيب‬hops ‫بنشوف هل من خالل هادا العدد من‬
‫في كل مرة الكوست وزي ماشفنا في الدايجسترا انو لو الكوست الجديد اقل‬
‫ لحد ما يبطل‬hops ‫ وبنوقف زيادة عدد ال‬ ‫من الموجود بنغير غير هيك ال‬
‫عندي تغيير يعني لما اوصل اطول باث بين ايا نودز بيكون وقتها خلص انتهى‬
 ‫الحل‬

P.28 Consider the network fragment shown below. x has only two
attached neighbors, wand y. w has a minimum-cost path to destination u
(not shown) of 5, and y has a minimum-cost path to u of 6. The complete
paths from wand y to u (and between w and y) are not shown. All link
costs in the network have strictly positive integer values.

a. Give x's distance vector for destinations w, y, and u.

b. Give a link-cost change for either c(x, w) or c(x,y) such that x will
inform its neighbors of a new minimum-cost path to It as a result of
executing the distance-vector algorithm.

20
Networks Discussion
Eng. Wafaa Audah

a. Dx(w) = 2, Dx(y) = 4, Dx(u) = 7


" Dx(u) = min(x-u = x-w + x-u = 2+5=7 , x-y + y-u=4+6 = 10) = 7 "

b. First consider what happens if c(x,y) changes:

- If c(x,y) becomes larger ( ‫)مش مهم أكبر بمقدار كم‬, c(x,u) remains 7
.
- If c(x,y) becomes smaller (‫)الزم نحدد رح تقل بمقدار كم او شو الحد‬:
y ‫ وبما انو احنا بنغير في‬w ‫ حسب التعامل مع‬7 ‫بما انو الكوست لحتى اآلن‬
1 ‫ ثابتةومحتاجة‬y-u =6 ‫ عاعتبار انو‬1 ‫رح يكون الفرق اللي رح يعمل التغيير هوا‬
: ‫ عشان هيك‬0 ‫لحتى توصل‬
- If c(x,y) =δ<1, then the least cost path now passes through y and
has cost δ+6.
-
- Now consider if c(x,w) changes. If c(x,w) becomes smaller ( ‫مش‬
‫)مهم أصغر بمقدار كم‬, then the least-cost path to u continues to
pass through w and its cost changes to 5 + ε.
-
- If c(x,w) = δ > 5, then the least cost path now passes through y
and has cost 10.
-
‫ اللي هيا خاصة‬10 ‫ يعني محتاجين تكون اقل من‬w ‫)بما انو احنا بنغير في ال‬
)  5 ‫ هيا‬13 ‫ لل‬w ‫ يعني اللي رح يوصل ال‬5 ‫ ثابتة انها‬w-u ‫ واحنا عنا‬y ‫ب‬

See You at Next lecture

Best Wishes

21

You might also like