Computer Networks CN Lecture Notes PDF
Document Details
Uploaded by StatelyTaylor
null
2024
null
ازدهار شاليش
Tags
Summary
These lecture notes cover computer networks, focusing on the network layer, including concepts like IPv4 addressing and subnetting. The notes include examples and diagrams.
Full Transcript
05/16/1446 Computer Networks CN المحاضرة السادسة & المحاضرة السابعة Network Layer ازدهار شاليش.م Note...
05/16/1446 Computer Networks CN المحاضرة السادسة & المحاضرة السابعة Network Layer ازدهار شاليش.م Note The first address in a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. 19.28 1 05/16/1446 Figure 5 A frame in a character-oriented protocol 19.29 Figure 6 Two levels of hierarchy in an IPv4 address 19.30 2 05/16/1446 Note Each address in the block can be considered as a two-level hierarchical structure: the leftmost n bits (prefix) define ;the network the rightmost 32 − n bits define the host. 19.31 Example 10 بفرض أنه تم منح شركة ما كتلة العناوين ،17.12.14.0/26أي ما مقداره 64 عنوان بفرض أيضا ً أن الشركة مكونة من ثالثة مكاتب وأنها تحتاج إلى تقسيم الكتلة السابقة إلى 3كتل جزئية تحوي على التوالي 32 :و 16و 16عنوانا ً. يمكننا إيجاد القناع الجديد كما يلي: أي أن n1=27 .232-n1 بفرض أن قناع الشبكة الجزئية األولى هو ،n1ينتج عنه أن = 32 بنفس الطريقة نستنتج أن n2=28و .n3=28 بالنتيجة ،يصبح لدينا القناع 26للشركة وثالثة أقنعة لكل شبكة جزئية . 32 3 05/16/1446 Figure 7 Configuration and addresses in a subnetted network 19.33 Figure 8 Three-level hierarchy in an IPv4 address 19.34 4 05/16/1446 Example 11 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations. 19.35 Example 11 (continued) Solution Figure 19.9 shows the situation. Group 1 For this group, each customer needs 256 addresses. This means that 8 (log2 256) bits are needed to define each host. The prefix length is then 32 − 8 = 24. The addresses are 19.36 5 05/16/1446 Example 11 (continued) Group 2 For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 − 7 = 25. The addresses are 19.37 Example 11 (continued) Group 3 For this group, each customer needs 64 addresses. This means that 6 (log264) bits are needed to each host. The prefix length is then 32 − 6 = 26. The addresses are Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576 19.38 6 05/16/1446 Figure 9 An example of address allocation and distribution by an ISP 19.39 مثال منح مزود خدمة إنترنت كتلة العناوين 190.100.0.0/16أي 65,536عنوان يحتاج مزود الخدمة هذا إلى تخصيص كتلة العناوين هذه إلى المجموعات التالية: تضم المجموعة األولى 64زبون؛ كل زبون يحتاج 256عنوانا ً. تضم المجموعة الثانية 128زبون؛ كل زبون يحتاج 128عنوانا ً. تضم المجموعة الثالثة 128زبون؛ كل زبون يحتاج 64عنوانا ً. صمم الكتل الجزئية وبين أنه ما زال يوجد عناوين متاحة. 40 7 05/16/1446 190.100.0.0/16 المجموعة األولى بما أن كل زبون يحتاج 256عنوانا ً فإننا بحاجة إلى 8بتات لعنونة األجهزة سيكون طول السابقة 32-8 = 24 أما العناوين فهي: الزبون األول 190.100.0.0/24إلى 190.100.0.255/24 الزبون الثاني 190.100.1.0/24إلى 190.100.1.255/24 .................... 190.100.63.0/24إلى 190.100.63.255/24 الزبون رقم 64 المجموع الكلي للعناوين المخصصة 64 x 256 = 16,384 41 المجموعة الثانية بما أن كل زبون يحتاج 128عنوانا ً فإننا بحاجة إلى 7بتات لعنونة األجهزة سيكون طول السابقة .32-7 = 25أما العناوين فهي: 190.100.64.0/25إلى 190.100.64.127/25 الزبون األول 190.100.64.128/25إلى 190.100.64.255/25 الزبون الثاني .................... 190.100.127.128/25إلى 190.100.127.255/25 الزبون رقم 128 المجموع الكلي للعناوين المخصصة : 128 x 128 = 16,384 42 8 05/16/1446 المجموعة الثالثة بما أن كل زبون يحتاج 64عنوانا ً فإننا بحاجة إلى 6بتات لعنونة األجهزة.سيكون طول السابقة .32-6 = 26أما العناوين فهي: 190.100.128.0/26إلى 190.100.128.63/26 الزبون األول 190.100.128.64/26إلى 190.100.128.127/26 الزبون الثاني .................... 190.100.159.192/26إلى 190.100.159.255/26 الزبون رقم 128 المجموع الكلي للعناوين المخصصة : 128 x 64 = 8,1924 عدد العناوين الممنوحة إلى مزود الخدمة65,535 : عدد العناوين التي خصصها مزود الخدمة40,960 : عدد العناوين المتاحة 24,576 : 43 Table 3 Addresses for private networks 19.44 9 05/16/1446 Figure 10 A NAT implementation 19.45 Figure 11 Addresses in a NAT 19.46 10 05/16/1446 Figure 12 NAT address translation 19.47 Table 4 Five-column translation table 19.48 11 05/16/1446 Figure 13 An ISP and NAT 19.49 أجب عن االسئلة التالية -1أوجد codewordللكلمة dataword=1010باستخدام هامنك كود . -2باستخدام checksum 16اوجد الكلمة المرمزة المراد ارسالها ,اذا علمت ان )dataword(7,10,5,1,4 -3أوجد اول واخر عنوان في :block 16.100.50.10/28وعدد عناوين الممكنة في هذا block 19.50 12 05/16/1446 2 IPv6 ADDRESSES Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6. Topics discussed in this section: Structure Address Space 19.51 Note An IPv6 address is 128 bits long. 19.52 13 05/16/1446 Figure 14 IPv6 address in binary and hexadecimal colon notation 19.53 Figure 15 Abbreviated IPv6 addresses 19.54 14 05/16/1446 Example 11 Expand the address 0:15::1:12:1213 to its original. Solution We first need to align the left side of the double colon to the left of the original pattern and the right side of the double colon to the right of the original pattern to find how many 0s we need to replace the double colon. This means that the original address is. 19.55 Table 5 Type prefixes for IPv6 addresses 19.56 15 05/16/1446 Table 5 Type prefixes for IPv6 addresses (continued) 19.57 Figure 16 Prefixes for provider-based unicast address 19.58 16 05/16/1446 Figure 17 Multicast address in IPv6 19.59 Figure 18 Reserved addresses in IPv6 19.60 17 05/16/1446 Figure19 Local addresses in IPv6 19.61 وظيفة أوجد العنوان األول و العنوان األخير و عدد العناوين بكل blockعدد بتات الشبكة و hostبكل block 1. 205.16.37.120/25 2. 16.100.50.10/28 3. 205.16.37.13/30 4. 400.1.1.1/16 5. 60.1.090.5/12 6. 3.1.2.3.4/28 مالحظة :كل عنوان هنا يمثل block 19.62 18