1/19 IP Addressing Surasak Sanguanpong nguan@ku.ac.th http://www.cpe.ku.ac.th/~nguan Last updated: 27 June 2002 Hostname and IP Address 2/19 browser What is the IP address of www.isoc.org? www.isoc.org is 198.6.250.9 Packets for 198.6.250.9 DNS Each node is assigned with a name and address A DNS reponds to the name-to IP address mapping The IP address is used by the client to create packets with IP destination address www.isoc.org (198.6.250.9)
IP Address 3/19 32 bits 10101010 10101010 10101010 10101010 8 bits 8 bits 8 bits 8 bits 198.6.250.9 written in decimal form with decimal points (Dot-decimal Notation) A 32 bit address that uniquely identifies a node Two devices can never have the same address The dot notation is easily for reading and writing IP Address with router 4/19 An IP address is associated with an interface (not a machine) 158.108.15.2 158.108.15.3 158.108.16.2 158.108.16.3 158.108.15.1 158.108.16.1 192.150.250.1 192.150.244.2 192.150.244.3 192.150.250.2 192.150.244.1
Addressing concept 5/19 Partitions address into 2 fields Network address (define a network) Node address (specific a device on the network) network 1 network 2 1.1.1.2 1.1.1.3 2.2.1.2 2.2.1.3 1.1.1.1 2.2.1.1 3.3.1.1 network 3 IP Addressing 6/19 8,16, 24 bits from NIC Network 32 bits Host Identify a host Identify a network
IP Address Class 7/19 8 16 24 32 Class A 0 Network ID Host ID Class B 10 Network ID Host ID Class C 110 Network ID Host ID Class D 1110 Multicast Address Class E 11110 Reserved Note: No Network ID and Host ID on Class D and Class E IP Address Network 8/19 Class A 0. 0. 0. 0 0.0.0.0 to 127.0.0.0 Class B 0 to 127 128. 0. 0. 0 128.0.0.0 to 191.255.0.0 Class C 128 to 191 0 to 255 192. 0. 0. 0 192.0.0.0 to 239.255.255.0 192 to 223 0 to 255 0 to 255 Class D Class E 224. 0. 0. 0 240. 0. 0. 0
Number of Networks and Hosts 9/19 Class Number of Networks Number of Hosts A B C D E 2 7-2=126 2 14-2=16,384 2 21-2=2,097,152 Not applicable Not applicable 2 24-2=16,277,214 2 16-2=65,534 2 8-2=254 Not applicable Not applicable Special Addresses 10/19 Reserved addresses that are not allowed to be assigned to any node NetID any any All 1s All 0s 127 HostID All 0s All 1s All 1s All 0s any Purpose Network Address Directed Broadcast Address Limited Broadcast Address This host on this network Loopback Address
Network Address : Example 11/19 Class A Class B 63.0.0.1 63.0.0.2 158.108.2.71 158.108.2.72 Network 63.0.0.0 Broadcast 63.255.255.255 Network 158.108.0.0 Broadcast : 158.108.255.255 Class C 203.15.5.3 203.15.5.4 Network 203.15.5.0 Broadcast : 203.15.5.255 Directed Broadcast Address 12/19 203.15.5.3 203.15.5.4 Directed Broadcast Address Broadcast to a specific subnet Router forwards directed broadcast address to the subnet 203.15.5.1 203.15.5.5 203.15.5.255
Limited Broadcast Address : Example 13/19 203.15.5.3 203.15.5.4 Limited Broadcast Address Broadcast to all hosts on my network Router blocks limited broadcast address to the subnet 255.255.255.255 203.15.5.1 203.15.5.5 Note : An class E address This host on this network Address 14/19 Bootstrap Server A diskless client uses 0.0.0.0 as a source address for requesting a service from a bootstrap server class A address Source : 0.0.0.0 Destination : 255.255.255.255 class E address 0.0.0.0 is also used by routers to advertise the default route
Loopback Address 15/19 Process A Process B TCP/UDP IP Loopback driver Datalink Physical Pseudo interface that allows a host to use IP to talk to its own services Most system assign the IP address of 127.0.0.1 and assign it the name localhost A packet that has been sent to loopback address never leaves the machine Private Address Space 16/19 Class A B C Networks 10.0.0.0 172.16.0.0 to 172.31.0.0 192.168.0.0 to 192.168.255.0 Number 1 16 256 RFC 1918 defines special IP address blocks of Class A, B and C that will be isolated from the Internet Any organization can use any address from this set without any permission. Purposes : Experiment or isolated network Internal Security
ifconfig See your IP address and subnet mask with Unix s interface configuration command : $ ifconfig -a lo Link encap:local Loopback inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1 RX packets:4849 errors:0 dropped:0 overruns:0 frame:0 TX packets:4849 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 eth0 Link encap:ethernet HWaddr 00:10:4B:13:0A:BC inet addr:172.16.32.6 Bcast:172.16.32.63 Mask:255.255.255.192 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1131930 errors:0 dropped:0 overruns:0 frame:0 TX packets:1305924 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 Interrupt:10 Base address:0xb800 17/19 Problems with Class assignment 18/19 Class A takes 50% range, class B 25%, class C 12.5% These lead to : address wasteful (specially in class A) running out of IP address A B C D E
19/19 HOW IR assigns IP address (RFC1466) Class A : no allocations will be made at this time Class B : allocations will be restricted. To apply: organization presents a subnetting more than 32 subnets organization has more than 4096 hosts Class C : divided into allocated blocks to distributed regional Multi-regional Europe Others North America Central/South America Pacific Rim Others Others IANA reserved 192.0.0.0-193.255.255.255 194.0.0.0-195.255.255.255 196.0.0.0-197.255.255.255 198.0.0.0-199.255.255.255 200.0.0.0-201.255.255.255 202.0.0.0-203.255.255.255 204.0.0.0-205.255.255.255 206.0.0.0-207.255.255.255 208.0.0.0-223.255.255.255