1 / 54

Wide Area Networks and Internet CT1403

Lecture-3: Internet Network Layer. Wide Area Networks and Internet CT1403. Late homework will never been accepted! Deadline : 11 am of next lecture. Absence should not exceed 25% without a valid excuse Slides & Resources are all on: http://fac.ksu.edu.sa/nalnabhan 4 quizzes

rumor
Download Presentation

Wide Area Networks and Internet CT1403

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture-3: Internet Network Layer Wide Area Networks and InternetCT1403

  2. Late homework will never been accepted! Deadline : 11 am of next lecture. Absence should not exceed 25% without a valid excuse Slides & Resources are all on: http://fac.ksu.edu.sa/nalnabhan 4 quizzes 2 are pop up ! first quiz: after two weeks (March 4, 2014) - Attention - CT1403

  3. Datagram format, fragmentation and assembly IP addressing: Classes, Subnets CIDR: Classless Interdomain Routing DHCP: Dynamic Host Configuration Protocol Outline CT1403

  4. datagram format • Fragmentation • Reassembly

  5. host, router network layer functions: • IP protocol • addressing conventions • datagram format • packet handling conventions The Internet network layer forwarding table transport layer: TCP, UDP • routing protocols • path selection • RIP, OSPF, BGP network layer • ICMP protocol • error reporting • router “signaling” link layer physical layer

  6. max number remaining hops (decremented at each router) header length (bytes) • how much overhead? • 20 bytes of TCP • 20 bytes of IP • = 40 bytes + app layer overhead IP protocol version number total datagram length (bytes) e.g. timestamp, record route taken, specify list of routers to visit. 32 bits for fragmentation/ reassembly “type” of data IP datagram format type of service head. len ver length upper layer protocol to deliver payload to fragment offset flgs 16-bit identifier upper layer time to live header checksum 32 bit source IP address 32 bit destination IP address options (if any) data (variable length, typically a TCP or UDP segment)

  7. network links have MTU (maximum transfer unit) - largest possible link-level frame different link types, different MTUs 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 reassembly IP fragmentation, reassembly … … fragmentation: in: one large datagram out: 3 smaller datagrams

  8. length =1040 length =4000 length =1500 length =1500 ID =x ID =x ID =x ID =x fragflag =1 fragflag =1 fragflag =0 fragflag =0 offset =370 offset =185 offset =0 offset =0 one large datagram becomes several smaller datagrams IP fragmentation, reassembly • example: • 4000 byte datagram • MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 offset 0: meaning the data should be inserted at the beginning go byte 0 offset 185: meaning the data should be inserted at the beginning go byte 1480 (185*8=1480) offset 370: meaning the data should be inserted at the beginning go byte 2960 (370*8=2960) 4-36 Network Layer

  9. IP Addressing • Classes • Subnets

  10. 223.1.2.2 IP address: 32-bit identifier for host, router interface Interface: connection between host/router and physical link router’s typically have multiple interfaces (==>multiple IP addresses) host typically has one interface IP addresses associated with each interface 223.1.1.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 IP Addressing 223.1.1.1 223.1.2.9 223.1.1.4 223.1.1.3 223.1.1.1 = 11011111 00000001 00000001 00000001 1 1 1 223 Network Layer

  11. Classes of IP Addresses

  12. Classes of IP Addresses 44 CT1403

  13. عدد الشبكات (Class A) = 72 – 2 = 126 شبكة. أقصى عدد الطرفيات في كل شبكة (Class A) = 242 – 2 = 16777214 طرفية. عدد الشبكات (Class B) = 142 – 2 = 16382 شبكة. أقصى عدد الطرفيات في كل شبكة (Class B) = 162 – 2 = 65534 طرفية. عدد الشبكات (Class C) = 212 – 2 = 2097150 شبكة. أقصى عدد الطرفيات في كل شبكة (Class C) = 82 – 2 = 254 طرفية. Classes of IP Addresses: How to count no. of Networks and Hosts within each Class reference: This slide is created by Dr. Mohammad Arafah CT1403

  14. عناوين الشبكة هي عبارة عن رقم بـ 32 خانة (أي 4 بايت)، ويكتب كل بايت بشكل عشري (Dotted Decimal Notation) من 0 إلى 255 وتفصل بينهما نقطة. عنوان IP الأقل هو 0.0.0.0. أما عنوان IP الأعلى فهو 255.255.255.255. مثال 1: حول عنوان IP التالي: 193.11.5.3 إلى الشكل الثنائي. الحل: 11000001.00001011.00000101.00000011 مثال 2: حول عنوان IP التالي: 11000010.00000111.00001010.00001111 إلى الشكل العشري (Dotted Decimal Notation). الحل: 194.7.10.15 Classes of IP Addresses reference: This slide is created by Dr. Mohammad Arafah CT1403

  15. القيمتان صفر ( 00…0 ) و –1 ( 11… 1 ) لهما معنيان خاصان، فالقيمة صفر تعني هذه الشبكة، أما القيمة –1 فتعني بث الرسالة لجميع الطرفيات للشبكة المعنونة. Classes of IP Addresses

  16. Subnets

  17. الهدف من الشبكات الجزئية (Subnets) هو تقسيم الشبكة إلى عدة أجزاء. وتؤخذ هذه الأقسام بعين الاعتبار في حالة الاتصال الداخلي بين الحاسبات فقط. ولكن مع اعتبارها كلها كشبكة واحدة في التعامل مع الشبكات الأخرى الخارجية، حيث أن الموجهات خارج هذه الشبكة تهتم فقط بالجزء الخاص برقم الشبكة في IP Address وتخفي الجزء الخاص برقم الطرفية بواسطة قناع الشبكة الفرعية (Subnet Mask). تتم عملية التجزئة للجزء الخاص برقم الطرفية في IP Address حيث يقسم إلى قسمين: القسم الأول للدلالة على الشبكة الجزئية. القسم الثاني للدلالة على الطرفية في الشبكة الجزئية. Subnets reference: This slide is created by Dr. Mohammad Arafah

  18. IP address: subnet part - high order bits host part - low order bits what’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router subnet Subnets 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.2 223.1.3.27 223.1.1.3 223.1.3.2 223.1.3.1 network consisting of 3 subnets

  19. 223.1.1.0/24 subnet 223.1.2.0/24 Subnets 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 • recipe • to determine the subnets, detach each interface from its host or router, creating islands of isolated networks • each isolated network is called a subnet 223.1.2.2 223.1.3.27 223.1.1.3 223.1.3.2 223.1.3.1 223.1.3.0/24 subnet mask: /24 4-41 Network Layer

  20. how many? Determined by subnet mask. Subnets 223.1.1.2 223.1.1.1 223.1.1.4 223.1.1.3 223.1.7.0 223.1.9.2 223.1.9.1 223.1.7.1 223.1.8.1 223.1.8.0 223.1.2.6 223.1.3.27 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 4-42 Network Layer

  21. IP address is stored in S.Addr, D.Addr fields in IP header Hierarchical, unlike Ethernet addresses Consists of network and host portions network (prefix): same for all hosts in network contiguous block of IP address space Dotted decimal notation: e.g. 128.208.2.151 Subnets 21

  22. Addresses are allocated in blocks called prefixes Prefix is determined by the network portion Has 2L addresses aligned on 2L boundary Written: address/length ===> e.g. 18.0.31.0/24 Subnets CT1403

  23. في المثال التالي، تجزئ الخانات 16 الخاصة برقم الطرفية في IP Address (Class B) إلى قسمين، القسم الأول مكون من 6 بتات للدلالة على الشبكة الجزئية والقسم الثاني مكون من 10 بتات للدلالة على الطرفية في تلك الشبكة الجزئية. شبكة جزئية شبكة طرفية شبكة طرفية 10 10 Subnets Class B Class B 10 bits 6 bits reference: This slide is created by Dr. Mohammad Arafah CT1403

  24. عدد الشبكات الجزئية = 62 – 2 = 62 شبكة جزئية. أقصى عدد الطرفيات في كل شبكة جزئية = 102 – 2 = 1022 طرفية. شبكة جزئية الشبكة طرفية Class B Subnets 10 bits 6 bits reference: This slide was created by Dr. Mohammad Arafah CT1403

  25. مثال 1: إذا افترضنا أن الجزء الخاص برقم الشبكة في IP Address = 150.0 شبكة جزئية 00001100 00001000 00000001 00000100 00000001 00000001 150 . 0 150 . 0 150 . 0 150 . 0 طرفية Class B Subnets 6 bits 10 bits الشبكة الجزئية الأولى تبدأ من العنوان 150.0.4.1 1 الشبكة الجزئية الثانية تبدأ من العنوان 150.0.8.1 2 3 الشبكة الجزئية الثالثة تبدأ من العنوان 150.0.12.1 … 8 bits 8 bits 8 bits 8 bits reference: This slide was created by Dr. Mohammad Arafah CT1403

  26. مثال 2: إذا افترضنا أن الجزء الخاص برقم الشبكة في IP Address = 150.0 00000110 00000100 00000001 00000010 00000001 00000001 150 . 0 150 . 0 150 . 0 شبكة جزئية 150 . 0 طرفية Class B Subnets 9 bits 7 bits الشبكة الجزئية الأولى تبدأ من العنوان 150.0.2.1 1 الشبكة الجزئية الثانية تبدأ من العنوان 150.0.4.1 2 3 الشبكة الجزئية الثالثة تبدأ من العنوان 150.0.6.1 … 8 bits 8 bits 8 bits 8 bits reference: This slide was created by Dr. Mohammad Arafah CT1403

  27. مثال 3: إذا افترضنا أن الجزء الخاص برقم الشبكة في IP Address = 150.0 شبكة جزئية 00011000 00000001 00010000 00001000 00000001 00000001 150 . 0 150 . 0 150 . 0 150 . 0 طرفية Subnets Class B 5 bits 11 bits الشبكة الجزئية الأولى تبدأ من العنوان 150.0.8.1 1 الشبكة الجزئية الثانية تبدأ من العنوان 150.0.16.1 2 3 الشبكة الجزئية الثالثة تبدأ من العنوان 150.0.24.1 … reference: This slide was created by Dr. Mohammad Arafah 8 bits 8 bits 8 bits 8 bits CT1403

  28. CIDR Classless Interdomain Routing

  29. CIDR:Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address IP addressing: CIDR host part subnet part 11001000 00010111 00010000 00000000 200.23.16.0/23

  30. Generalizes the notation of subnet addressing As within the subnet addressing, the 32-bit address is divided into two parts (net#, host # ) and has the dotted decimal form (a.b.c.d/x), where x indicates the number of bits in the first part of the address. CIDR replaces Classful addressing, where the network portion of IP addresses were constrained to 8, 16, or 24 Classful addressing waists IP addresses Classless Interdomain Routing : CIDR

  31. Most organizations needs more than class C but less than class B CIDR allocates IP address blocks of variable size without regard to classes Example: site needs 2000 addresses assign a block of 2048 addresses With CIDR address lookup is more complicated Classless Interdomain Routing : CIDR

  32. مثال 1: إذا احتاج موقع إلى 2046 طرفية (2048 – 2)، فإنه يعطى كتلة مؤلفة من 2048 عنواناُ، وليس الصنف B. فإذا افترضنا أن العناوين هي من 195.0.0.0 إلى 195.0.7.255، فإن قناع الشبكة الفرعية (Subnet Mask) هو 255.255.248.0 (/21). CIDR Example reference: This slide was created by Dr. Mohammad Arafah CT1403

  33. مثال 1(تكملة): ثابتة متغيرة 11000011 . 00000000 . 00000 000 . 00000000 11000011 . 00000000 . 00000 111 . 11111111 11111111 . 11111111 . 11111 000 . 00000000 CIDR Example 195.0.0.0 195.0.7.255 قناع الشبكة الفرعية 128 8 16 32 64 255.255.248.0 (/21) reference: This slide was created by Dr. Mohammad Arafah CT1403

  34. مثال 2: إذا احتاج موقع إلى 4094 طرفية (4096 - 2)، فإنه يعطى كتلة مؤلفة من 4096 عنواناُ، وليس الصنف B. فإذا افترضنا أن العناوين هي من 195.0.0.0 إلى 195.0.15.255، فإن قناع الشبكة الفرعية (Subnet Mask) هو 255.255.240.0 (/20). 11000011 . 00000000 . 0000 0000 . 00000000 11000011 . 00000000 . 0000 1111 . 11111111 11111111 . 11111111 . 1111 0000 . 00000000 195.0.0.0 CIDR Example 195.0.15.255 متغيرة ثابتة قناع الشبكة الفرعية 255.255.240.0 (/20) reference: This slide was created by Dr. Mohammad Arafah CT1403

  35. مثال 3: إذا احتاج موقع إلى 4094 طرفية (4096 - 2)، فإنه يعطى كتلة مؤلفة من 4096 عنواناُ، وليس الصنف B. فإذا افترضنا أن العناوين هي من 195.0.16.0 إلى 195.0.31.255، فإن قناع الشبكة الفرعية (Subnet Mask) هو 255.255.240.0 (/20). 11000011 . 00000000 . 0001 0000 . 00000000 11000011 . 00000000 . 0001 1111 . 11111111 11111111 . 11111111 . 1111 0000 . 00000000 CIDR Example 195.0.16.0 195.0.31.255 متغيرة ثابتة قناع الشبكة الفرعية 255.255.240.0 (/20) reference: This slide was created by Dr. Mohammad Arafah CT1403

  36. مثال 4: إذا احتاج موقع إلى 8190 طرفية (8192 - 2)، فإنه يعطى كتلة مؤلفة من 8192 عنواناُ، وليس الصنف B. فإذا افترضنا أن العناوين هي من 195.0.0.0 إلى 195.0.31.255، فإن قناع الشبكة الفرعية (Subnet Mask) هو 255.255.224.0 (/19). 11000011 . 00000000 . 000 00000 . 00000000 11000011 . 00000000 . 000 11111 . 11111111 11111111 . 11111111 . 111 00000 . 00000000 CIDR Example 195.0.0.0 195.0.31.255 متغيرة ثابتة قناع الشبكة الفرعية 255.255.224.0 (/19) reference: This slide was created by Dr. Mohammad Arafah CT1403

  37. مثال 5: قناع الشبكة الفرعية (Subnet Mask) هو (/22). 11111111 . 11111111 . 111111 00 . 00000000 قناع الشبكة الفرعية CIDR Example 255.255.252.0 (/22) متغيرة (رقم الطرفية) ثابتة (رقم الشبكة) reference: This slide was created by Dr. Mohammad Arafah CT1403

  38. مثال 6: قناع الشبكة الفرعية (Subnet Mask) هو (/30). 11111111 . 11111111 . 11111111 . 111111 00 قناع الشبكة الفرعية CIDR Example 255.255.255.252 (/22) متغيرة (رقم الطرفية) ثابتة (رقم الشبكة) reference: This slide was created by Dr. Mohammad Arafah CT1403

  39. تابع مثال 6: قناع الشبكة الفرعية (Subnet Mask) هو(/30). CIDR Example reference: This slide was created by Dr. Mohammad Arafah CT1403

  40. بالإضافة إلى ذلك، قسم العالم إلى أربع أجزاء. كل جزء أعطي كمية من عناوين الصنف C كالتالي: CIDR – Classless Interdomain Routing reference: This slide was created by Dr. Mohammad Arafah CT1403

  41. Obtaining IP Addresses

  42. Q: How does a host get IP address? hard-coded by system administrator in a file Windows: control-panel->network->configuration->tcp/ip->properties UNIX: /etc/rc.config More often using ===> DHCP:Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play” IP addresses: how to get one?

  43. goal: allow host to dynamically obtain its IP address from network server when it joins network can renew its lease on address in use allows reuse of addresses (only hold address while connected/“on”) support for mobile users who want to join network (more shortly) DHCP overview: host broadcasts “DHCP discover” msg [optional] DHCP server responds with “DHCP offer” msg [optional] host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg DHCP: Dynamic Host Configuration Protocol

  44. DHCP client-server scenario DHCP server 223.1.1.0/24 223.1.2.1 223.1.1.1 223.1.1.2 arriving DHCP client needs address in this network 223.1.1.4 223.1.2.9 223.1.2.2 223.1.3.27 223.1.1.3 223.1.2.0/24 223.1.3.2 223.1.3.1 223.1.3.0/24

  45. DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP client-server scenario DHCP server: 223.1.2.5 arriving client 4-47 Network Layer

  46. DHCP can return more than just allocated IP address on subnet: address of first-hop router for client name and IP address of DNS sever network mask (indicating network versus host portion of address) DHCP: more than IP addresses 4-48 Network Layer

  47. DHCP DHCP DHCP DHCP DHCP DHCP DHCP DHCP connecting laptop needs its IP address, addr of first-hop router, addr of DNS server: use DHCP DHCP DHCP DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP: example • DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.1 Ethernet 168.1.1.1 • Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server router with DHCP server built into router • Ethernet demuxed to IP demuxed, UDP demuxed to DHCP 4-49 Network Layer

  48. DHCP DHCP DHCP DHCP DHCP DHCP DHCP DCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server DHCP DHCP DHCP UDP IP Eth Phy DHCP UDP IP Eth Phy DHCP: example • encapsulation of DHCP server, frame forwarded to client, demuxing up to DHCP at client router with DHCP server built into router • client now knows its IP address, name and IP address of DSN server, IP address of its first-hop router 4-50 Network Layer

  49. DHCP: Wireshark output (home LAN) reply Message type: Boot Reply (2) Hardware type: Ethernet Hardware address length: 6 Hops: 0 Transaction ID: 0x6b3a11b7 Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 192.168.1.101 (192.168.1.101) Your (client) IP address: 0.0.0.0 (0.0.0.0) Next server IP address: 192.168.1.1 (192.168.1.1) Relay agent IP address: 0.0.0.0 (0.0.0.0) Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Server host name not given Boot file name not given Magic cookie: (OK) Option: (t=53,l=1) DHCP Message Type = DHCP ACK Option: (t=54,l=4) Server Identifier = 192.168.1.1 Option: (t=1,l=4) Subnet Mask = 255.255.255.0 Option: (t=3,l=4) Router = 192.168.1.1 Option: (6) Domain Name Server Length: 12; Value: 445747E2445749F244574092; IP Address: 68.87.71.226; IP Address: 68.87.73.242; IP Address: 68.87.64.146 Option: (t=15,l=20) Domain Name = "hsd1.ma.comcast.net." Message type: Boot Request (1) Hardware type: Ethernet Hardware address length: 6 Hops: 0 Transaction ID: 0x6b3a11b7 Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 (0.0.0.0) Your (client) IP address: 0.0.0.0 (0.0.0.0) Next server IP address: 0.0.0.0 (0.0.0.0) Relay agent IP address: 0.0.0.0 (0.0.0.0) Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Server host name not given Boot file name not given Magic cookie: (OK) Option: (t=53,l=1) DHCP Message Type = DHCP Request Option: (61) Client identifier Length: 7; Value: 010016D323688A; Hardware type: Ethernet Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Option: (t=50,l=4) Requested IP Address = 192.168.1.101 Option: (t=12,l=5) Host Name = "nomad" Option: (55) Parameter Request List Length: 11; Value: 010F03062C2E2F1F21F92B 1 = Subnet Mask; 15 = Domain Name 3 = Router; 6 = Domain Name Server 44 = NetBIOS over TCP/IP Name Server …… request

  50. Q: how does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space IP addresses: how to get one? ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. …. Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

More Related