Het IPProtocol 3 IPprotocol Services l Routing l

  • Slides: 42
Download presentation
Het IP-Protocol 3

Het IP-Protocol 3

IP-protocol Services l Routing l Multiple client protocols l Datagram delivery l Independant from

IP-protocol Services l Routing l Multiple client protocols l Datagram delivery l Independant from the Network Interface Layer l Fragmentation and reassembly l Extensible through IP options l Packet switching technology 3

u. IP Header 0 15 16 4 -bit version 4 -bit header length 8

u. IP Header 0 15 16 4 -bit version 4 -bit header length 8 -bit type of service(TOS) 16 -bit identification 8 -bit time to live (TTL) 31 16 -bit total length (in bytes) 3 -bit flag 8 -bit protocol 13 -bit fragment offset 16 -bit header checksum 20 bytes 32 -bit source IP address 32 -bit destination IP address Options (if any) data 3

Wat is een IP Address? 86 90 94 133. 120. 75. 8 129. 102.

Wat is een IP Address? 86 90 94 133. 120. 75. 8 129. 102. 12. 7 MARIA AVE 129. 102. 0. 0 133. 120. 0. 0 131. 107. 0. 0 129. 102. 16. 2 131. 107. 3. 27 3

Conversie IP Adres van Binair naar Decimaal Formaat 8 Bits 1 1 1 1

Conversie IP Adres van Binair naar Decimaal Formaat 8 Bits 1 1 1 1 128 64 32 16 8 4 2 1 255 Decimal Value 3

Netwerk ID en Host ID 32 Bits Class B Network ID Example: Host ID

Netwerk ID en Host ID 32 Bits Class B Network ID Example: Host ID w. x. y. z. 131. 107. 3. 24 3

Address Classes Class A Number of Networks Number of Hosts per Network 126 16,

Address Classes Class A Number of Networks Number of Hosts per Network 126 16, 777, 214 16, 384 65, 534 2, 097, 152 254 Host ID Network ID 0 Class B Network ID Host ID 10 Class C Network ID Host ID 110 w x y z 3

Address Class Summary Number of Networks Number of Hosts per Network Range of Network

Address Class Summary Number of Networks Number of Hosts per Network Range of Network IDs (First Octet) Class A 126 16, 777, 214 1 – 126 Class B 16, 384 65, 534 128 – 191 Class C 2, 097, 152 254 192 – 223 3

Assigning Network IDs A C Router 124. x. y. z B Router 192. 121.

Assigning Network IDs A C Router 124. x. y. z B Router 192. 121. 73. z 131. 107. y. z 3

Network Addressing Guidelines n Network ID Must Be Unique n 127 Is Reserved for

Network Addressing Guidelines n Network ID Must Be Unique n 127 Is Reserved for Diagnostic Loopback Functions n Network ID Cannot Be all 255 (All Bits Set to 1) l n 255 is a broadcast address Network ID Cannot Be all 0 (All Bits Set to 0) l 0 indicates a local network 3

Assigning Host IDs A 124. 0. 0. 27 C 124. 0. 0. 1 B

Assigning Host IDs A 124. 0. 0. 27 C 124. 0. 0. 1 B 192. 121. 73. 2 Router 124. 0. 0. 28 192. 121. 73. 1 124. x. y. z 124. 0. 0. 29 131. 107. 24. 27 Router 131. 107. 24. 1 192. 121. 73. z 131. 107. 24. 28 131. 107. 24. z 131. 107. 24. 29 3

Host Addressing Guidelines n Host ID Must Be Unique to the Network ID n

Host Addressing Guidelines n Host ID Must Be Unique to the Network ID n Host ID Cannot Be 255 (All Bits Set to 1) l n 255 is a broadcast address Host ID Cannot Be 0 (All Bits Set to 0) l 0 means “this network only” 3

Common Addressing Problems n Network IDs on the Local Network Don’t Match l n

Common Addressing Problems n Network IDs on the Local Network Don’t Match l n Local hosts cannot communicate Host IDs on the Local Network Are Duplicate l Windows NT–based hosts cannot initialize l Other TCP/IP-based hosts may not be able to communicate l Other TCP/IP-based hosts could hang 3

How to choose/assign IP-addresses ? n Internet Service Provider n ICANN - Internet Corporation

How to choose/assign IP-addresses ? n Internet Service Provider n ICANN - Internet Corporation for Assigned Names and Number l n RIPE – ARIN – APNIC – LACNIC - Afri. NIC Private Address Space (RFC 1918) 10. 0 - 10. 255 172. 16. 0. 0 - 172. 31. 255 192. 168. 0. 0 - 192. 168. 255 3

Loopback interface n n IP driver 127. 0. 0. 1 IP output function name

Loopback interface n n IP driver 127. 0. 0. 1 IP output function name localhost IP input function Loopback driver Place on IP input queue yes Dest. IP = broadcast or multicast ? Place on IP input queue no Dest. IP = interface address ? Ethernet driver 3

Exercise 3

Exercise 3

Excercise n Connect two pc’s to a hub and assign an ipaddress from the

Excercise n Connect two pc’s to a hub and assign an ipaddress from the same network. Issue a ping command from one to the other. Do the same with ip-addresses from different networks n Find the public address space assigned to your company (or any company that you know) 3

The Domain Name System n An Alias Used to Reference a TCP/IP Host n

The Domain Name System n An Alias Used to Reference a TCP/IP Host n A Fully Qualified Domain Name (FQDN) Example: ftp. microsoft. com n Provides a Simplified Way to Access a TCP/IP Host n Used by Ping and Other TCP/IP Utilities n Entries Are Stored in the HOSTS File or DNS n Viewed with the nslookup Utility 3

IP addressing summary n Network part: all host bits 0 l n First ip

IP addressing summary n Network part: all host bits 0 l n First ip address : l n 193. 58. 9. 0 193. 58. 9. 1 Broadcast address: all host bits 1 l 193. 58. 9. 255 3

Overview Subnetting n What Is a Subnet? n Subnet Addressing n What Is a

Overview Subnetting n What Is a Subnet? n Subnet Addressing n What Is a Subnet Mask? n Defining a Subnet Mask n Defining Network IDs for an Internetwork n Defining Host IDs for Subnets 3

What Is a Subnet Mask? n Distinguishes the Network ID from the Host ID

What Is a Subnet Mask? n Distinguishes the Network ID from the Host ID n Used to Specify Whether the Destination Host is Local or Remote 3

Default Subnet Masks (No Subnetting) Address Class Bits Used for Subnet Mask Dotted Decimal

Default Subnet Masks (No Subnetting) Address Class Bits Used for Subnet Mask Dotted Decimal Notation Class A 1111 00000000 255. 0. 0. 0 Class B 11111111 00000000 255. 0. 0 Class C 11111111 0000 255. 0 Class B Example IP Address 131. 107. 16. 200 Subnet Mask 255. 0. 0 Network ID 131. 107. y. z Host ID w. x. 16. 200 3

How IP Determines If a Packet Is Destined Locally or Remotely n Local IP

How IP Determines If a Packet Is Destined Locally or Remotely n Local IP and Destination IP are ANDed with Mask l l 1 AND 1 = 1 Other combinations = 0 If ANDed results of source and destination hosts match, the destination is local IP Address 10011111 11100000111 10000001 Subnet Mask 11111111 00000000 l Result 10011111 11100000000 3

Problem : Waste of address space ! n Inefficient use of address space 193.

Problem : Waste of address space ! n Inefficient use of address space 193. 107. 8. 1 193. 107. 16. 2 193. 107. 16. 1 193. 107. 24. 1 193. 107. 16. z A We only use 2 address out of 254 193. 107. 8. z B 193. 107. 24. z 3

How is subnetting done? 131. 107. 3. 27 131. 107. 12. 7 n Borrow

How is subnetting done? 131. 107. 3. 27 131. 107. 12. 7 n Borrow bits from host part All hosts on same have same Subnet segment 1 subnet number 131. 107. 12. 0 131. 107. 10. 0 n 255. 0 Main Network Subnet 2 131. 107. 3. 0 255. 0 Subnet 3 131. 107. 12. 0 255. 0 131. 107. 12. 31 131. 107. 10. 12 3

Examples of a Custom Subnet Mask (Subnetting) Address Class Bits Used for Subnet Mask

Examples of a Custom Subnet Mask (Subnetting) Address Class Bits Used for Subnet Mask Dotted Decimal Notation Class ? 11111111 00000000 111100000000 255. 0. 0 255. 240. 0. 0 Class ? 11111111 0000 111111110000 255. 0 255. 240. 0 Class B Example IP Address 131. 107. 16. 200 Subnet Mask 255. 0 Network ID 131. 107. y. z Subnet ID w. x. 16. z Host ID w. x. y. 200 3

Using the Subnet Mask to Determine If a Host Is Local or Remote n

Using the Subnet Mask to Determine If a Host Is Local or Remote n Comparing Two Network IDs Does Not Always Indicate a Local or Remote Host Example 1 Example 2 131. 107. 35. 200 131. 107. 61. 26 153. 170. 37. 16 217. 170. 172. 233 n Compare Both Addresses to a Subnet Mask to Determine Location IP Addresses 131. 107. 35. 200 131. 107. 61. 26 Subnet Mask 255. 0. 0, or 255. 0 Same Network? Yes No 3

Determining the Number of Subnet Mask Bits Subnet Mask Number of Subnets 2. .

Determining the Number of Subnet Mask Bits Subnet Mask Number of Subnets 2. . . 254 Network ID Class B Subnet Mask Host ID 1 0 Number of Hosts 16, 382. . . 254 Host ID 3

Defining a Subnet Mask 1 Determine the Number of Subnets 2 Convert the Number

Defining a Subnet Mask 1 Determine the Number of Subnets 2 Convert the Number of Subnets to Binary 3 Convert the Required Number of Bits to Decimal (High Order) Example of Class B Address Number of Subnets 6 Binary Value 0 0 0 1 1 0 (3 Bits) 4+2 = 6 Convert to Decimal 11111111 11100000 255 . 224 . 0 3

Shortcut to Defining Network IDs for 1 List the Number of Bits (High Order)

Shortcut to Defining Network IDs for 1 List the Number of Bits (High Order) Used 11100000 Subnet Mask 32 2 Convert the Bit with the Lowest Value to Decimal 3 Increment the Value for Each Bit Combination 0 + = + = + = 32 32 32 64 32 96 32 128 32 160 w. x. 32. 1 w. x. 63. 254 w. x. 64. 1 w. x. 95. 254 w. x. 96. 1 w. x. 127. 254 w. x. 128. 1 w. x. 159. 254 w. x. 160. 1 w. x. 192. 254 3

Defining Host IDs for a Subnet IDs 0000 = 0 00100000 = 32 01000000

Defining Host IDs for a Subnet IDs 0000 = 0 00100000 = 32 01000000 = 64 01100000 = 96 10000000 = 128 10100000 = 160 11000000 = 192 11100000 = 224 Host ID Range “Invalid” x. y. 32. 1 – x. y. 64. 1 – x. y. 96. 1 – x. y. 128. 1 – x. y. 160. 1 – x. y. 192. 1 – “Invalid” x. y. 63. 254 x. y. 95. 254 x. y. 127. 254 x. y. 159. 254 x. y. 191. 254 x. y. 223. 254 n Each Subnet ID Indicates the Beginning Value in a Range n The Ending Value Is One Less Than the Beginning Value of the Next Subnet ID 3

Subnet Addressing n n Determine the Number of Required Network IDs l One for

Subnet Addressing n n Determine the Number of Required Network IDs l One for each subnet l One for each wide area network connection Determine the Number of Required Host IDs per Subnet l One for each TCP/IP host l One for each router interface n Define One Subnet Mask Based on Requirements n Define a Unique Network ID for Each Subnet Based on the Subnet Mask n Define Valid Host IDs for Each Subnet Based on the Network ID 3

Exercise: Subnetting 3

Exercise: Subnetting 3

Example : Assign subnets 210. 10. 0/24 10 10 10 3

Example : Assign subnets 210. 10. 0/24 10 10 10 3

Excercise : Assign subnets (subnet zero is valid) 100 193. 58. 1. 0 /24

Excercise : Assign subnets (subnet zero is valid) 100 193. 58. 1. 0 /24 193. 58. 2. 0 / 24 193. 58. 3. 0 / 24 10 2 100 50 50 50 40 40 2 Internet 28 6 3

Solution 100 193. 58. 1. 0 /24 193. 58. 2. 0 / 24 193.

Solution 100 193. 58. 1. 0 /24 193. 58. 2. 0 / 24 193. 58. 3. 0 / 24 11111111 255 1111 10000000 . 255. 128 Network #bit s Mask #host s First Last Broadcast 193. 58. 9. 0 24 255. 0 254 193. 58. 9. 1 193. 58. 9. 2 54 193. 58. 9. 2 55 193. 58. 9. 0 25 255. 12 8 126 193. 58. 9. 1 27 193. 58. 9. 128 25 255. 12 8 126 193. 58. 9. 1 29 193. 58. 9. 2 54 193. 58. 9. 2 55 3

Excercise : Assign subnets (subnet zero is valid) 193. 58. 1. 0 /24 193.

Excercise : Assign subnets (subnet zero is valid) 193. 58. 1. 0 /24 193. 58. 2. 0 / 24 193. 58. 3. 0 / 24 193. 58. 1. 0 /25 193. 58. 1. 128 /25 193. 58. 3. 224 / 28 193. 58. 3. 248 / 30 Internet 193. 58. 3. 252 / 30 193. 58. 3. 192 / 27 193. 58. 2. 0 /25 193. 58. 2. 128 /26 193. 58. 2. 192 /26 193. 58. 3. 0 / 26 193. 58. 3. 64 / 26 193. 58. 3. 128 / 26 193. 58. 3. 240 / 29 3

Excercise : Assign subnets (subnet zero is valid) 50 192. 168. 1. 0 /

Excercise : Assign subnets (subnet zero is valid) 50 192. 168. 1. 0 / 24 40 10 20 Internet 30 3

Exercise n 25. 158. 7. 89/19 l Define network mask l Define network l

Exercise n 25. 158. 7. 89/19 l Define network mask l Define network l Define first ip address l Define last ip address l Define broadcast address 3

Review n What Is a Subnet? n Subnet Addressing n What Is a Subnet

Review n What Is a Subnet? n Subnet Addressing n What Is a Subnet Mask? n Defining a Subnet Mask n Defining Network IDs for an Internetwork n Defining Host IDs for Subnets 3

Commands n netstat l Network connections and routing table l Unix - Windows NT

Commands n netstat l Network connections and routing table l Unix - Windows NT ifconfig l interface information l Unix winipcfg l n Windows 95/98 ipconfig l Windows NT/2000 3

Classless Interdomain Routing (CIDR) n Exhaustion IP address space n No class A -

Classless Interdomain Routing (CIDR) n Exhaustion IP address space n No class A - B and C n w. x. y. z/s with 1 <= s < = 32 n Route aggregation 3