230 likes | 239 Views
IP Addressing. An IP address is 32-bit long. It is usually written as four decimal numbers separated by dots (periods), In hex, each of the four hexadecimal numbers is called an octet. Example: 137.207.192.003 or 89 CF C0 03
E N D
IP Addressing • An IP address is 32-bit long. • It is usually written as four decimal numbers separated by • dots (periods), • In hex, each of the four hexadecimal numbers is called an • octet. • Example: 137.207.192.003 or 89 CF C0 03 • An IP address contains a network part and a host part. • The number of address bits used to identify the network, and the number to • identify the host, vary according to the class of the address. • The three main address classes are class A, class B, and class C. • By examining the first few bits of an address, IP software can quickly • determine the address class, and therefore its structure.
Note: For Class A: Have a first dotted decimal number in the range 1-126 For Class B: Have a first dotted decimal number in the range 128-191 For Class C: Have a first dotted decimal number in the range 192-223 IP Addressing
Class A • If the first bit of an IP address is 0, it is the address of a class A network. • The first bit of a class A address identifies the address class. • The next seven bits identify the network, and • the last 24 bits identify the host. • There are fewer than 128 class A network numbers, but each class A network can have millions of hosts.
|_| first one bit is used to determine the class to which an address belongs to for Class A address. • |_______| 7 bits are used for Network address.Therefore, the number of class A networks can be 2 7 = 128. Number 0 is not used, and number 127 is used for testing loopback for each host. There are 126 potential Class A network numbers, which have a first dotted decimal number in the range 1 to 126. • |________________________| 24 bits are used for host address. Therefore, each Class A network can have 2 24 = 16,777,216 hosts. • Class A is not available to the general public, and it is restricted to special uses. • Class A final format: • |_|_______| |________________________| • 7 bits 24 bitsNetwork Host Part Part Class A
Class A • Summary: • If the the first decimal number in IP address is 1 to • 126, then it is a class A address. • The first byte is for the network number, and the next three • bytes are for the host addresses.
Class B • If the first two bits of the address are 1and 0, it is a class B • network address. • The first two bits identify class; the next fourteen • bits identify the network, and the last sixteen bits • identify the host. • There are thousands of class B network numbers. • Each class B network can have thousands of hosts.
Class B • |__| first two bits are used to determine the class to which an address belongs to for class B address. • |______________| 14 (6 + 8) bits are used for network address. Therefore, the number of class B networks can be 2 14 = 16,384. There are 16,384 potential Class B network numbers, which have a first dotted decimal number in the range 128 to 191. • |________________| 16 bits are used for host address. Therefore, each Class B network can have 2 16 = 65,536 hosts.
Class B • Class B final format • |__|______|________| |________________| 14 bits Network part 16 bits Host part • Summary: • If the the first decimal number in IP address is 128 to • 191, then it is a class B address. • The first two bytes identify the network. • The last two bytes identify the host.
Class C • If the first three bits of the address are 1 1 0, it is a • class C network address. • The first three bits are class identifiers. • The next 21 bits are for the network address. • The last eight bits identify the host. • There are millions of class C network numbers. • However, each class C network can have 254 hosts.
Class C • |___| first three bits are used to determine the class to which an address belongs to for class C address. • |_____|________|________| 21 (5 + 16) bits are used for network address. Therefore, the number of class C networks can be 2 21 = 2, 097,152. There are 2,097,152 potential Class C network numbers, which have a first dotted decimal number in the range 192 to 223. • |________| 8 bits are used for host address. Therefore, each Class C network can have 2 8 = 256 hosts.
Class C • Class C final format • |___|_____| |________| |________| |________| • 21 bits Network part 8 bits host part • Summary: • If the the first decimal number in IP address is 192 to • 223, then it is a class C address. • The first three bytes are for the network address. • The last byte is for the host number.
Summary • Class A:Few networks, each with many hosts. • Class B: Medium number of networks, each with a medium number of hosts • Class C: Many networks, each with a few hosts.
Use of different Class addresses • In some environment, it may be best to use addresses all from one class. • For example, a corporate internetwork that consists of a large number of departmental LANs may need to use Class C addresses exclusively. • However, the format of the addresses allow us to mix all three classes of the addresses on the same internetwork. Example: Internet. • We will prefer a mixture of classes for an internetwork consisting of a few large networks, many small networks, plus some medium-sized networks.
Address Depletion • The TCP/IP designers did not think about the enormous scale of • today's network. • When TCP/IP was being designed, networking was limited to • large organizations that could afford substantial computer • systems. • The idea of a powerful UNIX system on every desktop, or X- • terminal or a PC with X-Ware (PC software to emulate X- • terminal) did not exist. • At That time, a 32-bit address seemed so large that it was • divided into classes to reduce the processing load on routers.
Address Depletion • For example, assigning a large network a single class B address, • instead of few class C addresses, reduces the load on the router, • because the router only needs to keep one route for that entire • organization. • However, the organization that was given the class B address • probably does not have 64,000 computers, so most of the host • addresses available to the organization will never be assigned. • The current design, which favors routers over growth, is under • critical strain from the rapid growth of the Internet. At the present • rate of growth, all class B addresses could be exhausted soon!. • To prevent this, blocks of class C addresses are being assigned to • organizations, but each class C address requires its own entry • within the routing table. • This solution could cause the routing table to grow so rapidly that • the routers will soon be overwhelmed.
Address Depletion • These problems are being addressed by the ROAD (Routing and Addressing) working group of the Internet Engineering Task Force (IETF). They are looking for a scheme that: • It will improve the problem of address depletion, • perhaps by moving to a larger address, 160-bit address! • Classless addresses. • Implementation of new routers, without requiring • changes to the end-systems (the hosts). • We don't know what technique will be adopted by the IETF to overcome the problems of address depletion. However, according to them, whatever happens, the changes should not have any near-term effect on your hosts, and IP addressing will be same at least for some time.
Why subnetting? • Preservation of address space • Control network traffic, avoid collisions • Reduce the routing complexity • Improve network performance • Security
Subnetting Subnetting is a method for getting the most out of the limited 32-bit IP addressing space. With any address class, subnetting provides a mean of allocating a part of the host address space to network addresses, which will let you have more networks. The part of the host address space allocated to new network addresses is known as the subnet number. The InterNIC assigned the University of Windsor one class B Network address, which is 137.207.0.0 with network number part 137.207. The Host number part is left to be assigned by the owner of the network number (local management - The Computing Services)
Subnetting • In class B IP address, the 2 right-hand bytes assigned for the host • number, can be subdivided into 254 subnetworks and 254 hosts to • each subnetwork number. • Which bits in the host address bytes will be applied to subnet • addresses and which to host addresses is determined by a subnet • mask, or netmask.(/etc/netmasks) • The netmask can be applied to an IP address using the bitwise • logical AND operator. • If a netmask 255.255.255.0 (or FF.FF.FF.00) is applied to the • address 137.207.192.003 (or 89 CF C0 03), the result is a network • number 137.207.192.0 • i.e.: 137.207.192.003 & 255.255.255.000 • = 137.207.192.000 • or, 89 CF C0 03 & FF FF FF 00 • = 89 CF C0 00.
Subnetting In binary form, the operation is: 10001001 11001111 11000000 00000011 (IP address )AND11111111 11111111 11111111 00000000 (netmask) ------------------------------------------------------------------------ 10001001 11001111 11000000 00000000 (masked number) Now the system (router or server) will look for a network number of 137.207.192.000 instead of a network number of 137.207., then the router (or the server) will locate the host (workstation) from its table, and adds the corresponding machine number to get 137.207.192.003. To increase the host number from 254, a different mask number could be used for less subnetworks and more hosts.
Default subnet masks: • Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000 • Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000 • Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000