Professional Documents
Culture Documents
Faculty of Engineering
Lecture # 5
CH.4
The Network Layer
By
April 2013
Networks Discussion
Eng. Wafaa Audah
4.1 Introduction
- Forwarding: move packets from router’s input to
appropriate router output.
2
Networks Discussion
Eng. Wafaa Audah
- VC consists of:
3
Networks Discussion
Eng. Wafaa Audah
4
Networks Discussion
Eng. Wafaa Audah
Datagram Network
Forwarding table
5
Networks Discussion
Eng. Wafaa Audah
- 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.
6
Networks Discussion
Eng. Wafaa Audah
حسب الصورة فان الداتا باللون األخضر رح تستنى الداتا اللي باللون االحمر
ويسير عندها ديلي مع انو الطرف التاني مستعد الستقبال الداتا باللون
االخضر_ال queueالوسطى اللي بالطرف اليمين فارغة وهادا معناه HOL
Blocking
Output Ports
- Buffering when arrival rate via switch exceeds output line
speed
7
Networks Discussion
Eng. Wafaa Audah
عملية تقسيم بلوك كبير من الداتا إلى مجموعة من البلوكات األصغر حجما
fragmentation تسمى عملية ال
8
Networks Discussion
Eng. Wafaa Audah
عشان نعمل الراوتنج تيبل الزم نعرف معنى الرموز اللي موجودة فيه وهيا
:كالتالي
9
Networks Discussion
Eng. Wafaa Audah
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=
10
Networks Discussion
Eng. Wafaa Audah
Problems
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.
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: From Q1: X Slot 2: From Q1: - Slot 3: From Q1: -
هنا رح نحتار هل هادا الرقم اللي طلع معنا هوا المينمم وال الماكسيمم.....خلينا
نشوف هل عنا حل آخر غير الموجود بمعنى هل في خيارات في اختيار الداتا ممكن
تغير في عدد التايم سلوت !!!؟؟؟؟
z
Slot 1: From Q1: X Slot 2: From Q1: - Slot 3: From Q1: -
بس هنا في هاي الحالة صدفت انو نفس الشي وما فرق معنا بس في حاالت تانية
بيكون الوضع فيها معقد أكتر بمعنى انو لو كان في أكتر من حالة HOLبيكون في عدة
خيارات لالرسال بتعطي فرصة وجود مينمم وماكسيمم تايم
13
Networks Discussion
Eng. Wafaa Audah
a. Provide a forwarding table that has four entries, uses longest prefix
matching, and forwards packets to the correct link interfaces.
14
Networks Discussion
Eng. Wafaa Audah
لو انا حكيت هادا العنوان بدي اعرف اليا.. لسبب مهم وهواentry الزم نحط هادي ال
؟؟؟؟1110000110000000000000000000000 : انترفيس بيتبع
2 لو ما كنا حاطين هاي االنتري رح يكون الجواب انو هادا العنوان تابع لالنترفيس
هادا الشي مش صحيح لذلك الزم. !! حسب ال بريفكس اللي موجود بالتيبل السابق
بحيث بنبحث عال بريفكس تبع الرينج5 نميز العناوين اللي رح يبدا منها رينج انترفيس
11100001 1 الجديد وهوا
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
Subnet 1: 223.1.17.0
17
Networks Discussion
Eng. Wafaa Audah
بايت2533 بايت يعني الداتا الفعلية اللي موجودة فيها2433 الداتاجرام حجمها
بايت اللي هيا اكبر حجم633 بايت معناها الداتا الفعلية هيا033= MTU وحجم ال
الوحدةfragment مسموح الي انقلها في ال
- 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وبنحط الكوست تبعها
عطول في الجدول وغير هيك ايا نودز مش متصلة بنحطلها انفينيتي
في كل مرة انا بقارن الكوست الجديد اللي بيطلع معي والخاص بنود معينة
باللي موجود مسبقا مابغير في الجدول القيمة اال لو كانت القيمة الجديدة اقل
من القيمة الموجودة اصال بالجدول النو احنا معنيين بالحصول على least
cost\shortest path
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
المسموح التحرك فيهم للوصول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.
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
- 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 ب
Best Wishes
21