3 Het IP-Protocol
3 IP-protocol Services Routing Multiple client protocols Datagram delivery Independant from the Network Interface Layer Fragmentation and reassembly Extensible through IP options Packet switching technology
3 IP Header 20 bytes 4-bit version 4-bit hea- der length 8-bit type of service(TOS) 16-bit total length (in bytes) 16-bit identification 3-bit flag 13-bit fragment offset 8-bit time to live (TTL) 8-bit protocol16-bit header checksum 32-bit source IP address 32-bit destination IP address Options (if any) data
3
3 Conversie IP Adres van Binair naar Decimaal Formaat Bits 255 Decimal Value
3 Netwerk ID en Host ID Network IDHost ID 32 Bits w. x. y. z Example: Class B
3
3 Address Class Summary Number of Networks Number ,384 2,097,152 Number of Hosts per Network Number of Hosts per Network 16,777,214 65, Class A Class B Class C Range of Network IDs (First Octet) Range of Network IDs (First Octet) 1 – – – 223
3 Assigning Network IDs
3 Network Addressing Guidelines Network ID Must Be Unique 127 Is Reserved for Diagnostic Loopback Functions Network ID Cannot Be all 255 (All Bits Set to 1) 255 is a broadcast address Network ID Cannot Be all 0 (All Bits Set to 0) 0 indicates a local network
3 Assigning Host IDs
3 Host Addressing Guidelines Host ID Must Be Unique to the Network ID Host ID Cannot Be 255 (All Bits Set to 1) 255 is a broadcast address Host ID Cannot Be 0 (All Bits Set to 0) 0 means “this network only”
3 Common Addressing Problems Network IDs on the Local Network Don’t Match Local hosts cannot communicate Host IDs on the Local Network Are Duplicate Windows NT–based hosts cannot initialize Other TCP/IP-based hosts may not be able to communicate Other TCP/IP-based hosts could hang
3 How to choose/assign IP-addresses ? Internet Service Provider ICANN - Internet Corporation for Assigned Names and Number RIPE – ARIN – APNIC – LACNIC - AfriNIC Private Address Space (RFC 1918)
3 Loopback interface name localhost IP output function IP input function Place on IP input queue Loopback driver Ethernet driver Dest. IP = broadcast or multicast ? Place on IP input queue yes Dest. IP = interface address ? no yes Ethernet IP driver
3 Exercise
3 Excercise Connect two pc’s to a hub and assign an ip-address from the same network. Issue a ping command from one to the other. Do the same with ip-addresses from different networks Find the public address space assigned to your company (or any company that you know)
3 The Domain Name System An Alias Used to Reference a TCP/IP Host A Fully Qualified Domain Name (FQDN) Example: ftp.microsoft.com Provides a Simplified Way to Access a TCP/IP Host Used by Ping and Other TCP/IP Utilities Entries Are Stored in the HOSTS File or DNS Viewed with the nslookup Utility
3 IP addressing summary Network part: all host bits First ip address : Broadcast address: all host bits
3 Overview Subnetting What Is a Subnet? Subnet Addressing What Is a Subnet Mask? Defining a Subnet Mask Defining Network IDs for an Internetwork Defining Host IDs for Subnets
3 What Is a Subnet Mask? Distinguishes the Network ID from the Host ID Used to Specify Whether the Destination Host is Local or Remote
3 Default Subnet Masks (No Subnetting) Bits Used for Subnet Mask AddressClass Dotted Decimal Notation Notation Class A Class B Class C Class A Class B Class C Class B Example w.x. IP Address Subnet Mask Network ID Host ID y.z
IP Address Subnet Mask IP Address Subnet Mask Result How IP Determines If a Packet Is Destined Locally or Remotely Local IP and Destination IP are ANDed with Mask 1 AND 1 = 1 Other combinations = 0 If ANDed results of source and destination hosts match, the destination is local
3 Problem : Waste of address space ! Inefficient use of address space z z z AB We only use 2 address out of 254
3 How is subnetting done? Subnet Subnet Subnet Subnet Main Network Borrow bits from host part All hosts on same segment have same subnet number Subnet Subnet
3 Examples of a Custom Subnet Mask (Subnetting) Bits Used for Subnet Mask AddressClass Dotted Decimal Notation Notation Class ? Class B Example w.x. IP Address Subnet Mask Network ID Subnet ID Host ID w.x.y y.z z
3 IP Addresses Subnet Mask Using the Subnet Mask to Determine If a Host Is Local or Remote Comparing Two Network IDs Does Not Always Indicate a Local or Remote Host Example Example Compare Both Addresses to a Subnet Mask to Determine Location , or Same Network? Yes No
3 Determining the Number of Subnet Mask Bits Class B Network IDHost ID 1 Subnet Mask Number of Subnets Number of Hosts Subnet Mask Host ID 16,
3 Defining a Subnet Mask Determine the Number of Subnets Convert the Number of Subnets to Binary Convert the Required Number of Bits to Decimal (High Order) Example of Class B Address Number of Subnets Binary Value Convert to Decimal = 6 (3 Bits)
3 Shortcut to Defining Network IDs List the Number of Bits (High Order) Used for Subnet Mask Convert the Bit with the Lowest Value to Decimal Increment the Value for Each Bit Combination w.x.32.1w.x w.x.64.1w.x = = = = = 160 w.x.96.1w.x w.x.128.1w.x w.x.160.1w.x
3 Defining Host IDs for a Subnet Subnet IDs Host ID Range “Invalid” x.y.32.1 – x.y x.y.64.1 – x.y x.y.96.1 – x.y x.y – x.y x.y – x.y x.y – x.y “Invalid” x.y.32.1 – x.y x.y.64.1 – x.y x.y.96.1 – x.y x.y – x.y x.y – x.y x.y – x.y “Invalid” = = = = = = = = = = = = = = = = 224 Each Subnet ID Indicates the Beginning Value in a Range The Ending Value Is One Less Than the Beginning Value of the Next Subnet ID
3 Subnet Addressing Determine the Number of Required Network IDs One for each subnet One for each wide area network connection Determine the Number of Required Host IDs per Subnet One for each TCP/IP host One for each router interface Define One Subnet Mask Based on Requirements Define a Unique Network ID for Each Subnet Based on the Subnet Mask Define Valid Host IDs for Each Subnet Based on the Network ID
3 Exercise: Subnetting
3 Example : Assign subnets /24 10
3 Excercise : Assign subnets (subnet zero is valid) Internet / / /
3 Solution Network#bitsMask#hostsFirstLastBroadcast / / /
3 Excercise : Assign subnets (subnet zero is valid) Internet / / / / / / / / / / / / / / / / 26
3 50 Internet / Excercise : Assign subnets (subnet zero is valid)
3 Exercise /19 Define network mask Define network Define first ip address Define last ip address Define broadcast address
3 Review What Is a Subnet? Subnet Addressing What Is a Subnet Mask? Defining a Subnet Mask Defining Network IDs for an Internetwork Defining Host IDs for Subnets
3 Commands netstat Network connections and routing table Unix - Windows NT ifconfig interface information Unix winipcfg Windows 95/98 ipconfig Windows NT/2000
3 Classless Interdomain Routing (CIDR) Exhaustion IP address space No class A - B and C w.x.y.z/s with 1 <= s < = 32 Route aggregation