Internet Address
CPS 422 Computer Networks NETWORK LAYER Addressing in the Internet Behrouz A. Forouzan
For communication on the Internet, we need to uniquely identify every device connected to the Internet. The identifier used in the network layer of the Internet model to identify each device on the Internet is called the Internet Address, Internet Protocol Address or commonly, the IP Address An IP address is a 32-bit binary address that uniquely and universally defines the connection of a host or a router to the Internet A host can have multiple IP addresses, but two hosts cannot have the same IP address on the Internet Faisal Amjad CPS 422
Faisal Amjad CPS 422
Internet Address - Notations There are two notations to represent IP addresses o Binary notation and o Dotted Decimal notation
Internet Address - Notations Example of the two Notations 10000000 00001011 00000011 00011111
Binary Notation
o Written as 32 bits usually with a space after every Octet (8 bits) e.g. 10101010 01110101 10110100 11011101 o Can also be called as consisting of 4-bytes
128.11.3.31
Dotted-Decimal Notation
o To make the IP addresses compact and easier to read, they are written in decimal form with a decimal point (dot) separating the bytes o Because of 8-bits in a byte, every number in the dotted decimal notation is between 0 and 255
Faisal Amjad CPS 422
IP Address - Classes
Faisal Amjad CPS 422
IP – Classful Addressing
Initially IP addressing used the concept of classes of address This architecture is called Classful Addressing Due to some problems (to be discussed later) a new architecture called Classless Addressing was introduced Systems are slowly migrating to Classless addressing
Faisal Amjad CPS 422
In classful addressing, the address space is divided into five classes: A,B,C,D and E The first few bits of an IP address tell the Class of address First Byte Class A
0
Class B
10
Class C
110
Class D
1110
Class E
1111
Second Byte
Third Byte
Fourth Byte
Faisal Amjad CPS 422
1
IP Address – Finding the Class in Decimal Notation
IP Address – Finding the Class Start
First Byte 1
1st Bit
1
2nd Bit
0
0
1
0 Class C
Class B
Class A
3rd Bit
1
4th Bit 0 Class D
Class A
0 to 127
Class B
128 to 191
Class C
192 to 223
Class D
224 to 239
Class E
240 to 255
Second Byte
Fourth Byte
Third Byte
Class E
Faisal Amjad CPS 422
IP Address – NetID & HostID In classful addressing, an IP address is divided into two parts o NetID and o HostID
These parts are of varying lengths, depending upon the class First Byte Class A
0
Class B
10
Class C
110
Class D
1110
Class E
1111
Second Byte
Fourth Byte
Third Byte
Host ------------------------------------- ID
Net ID
Host ------------------- ID
Net -------------- ID Net ----------------------------------- ID
Host --- ID
Multicast ------------- Address Reserved
for
Future
Use
Faisal Amjad CPS 422
IP Address – Classes & Blocks The division of IP addresses into classes reveals that every class can have a fixed number of blocks of addresses, with a fixed size For example, class A is divided into 128 blocks (0 to 127), with each block having different netID
o All numbers in one byte, from 0 to 127 have the first bit equal to 0 (Hence these numbers show they belong to a class A Address) o Hence, the first block covers addresses from 0.0.0.0 to 0.255.255.255 with netID = 0 o The second block covers addresses from 1.0.0.0 to 1.255.255.255 with netID = 1 o The last block of class A covers addresses from 127.0.0.0 to 127.255.255.255 with netID = 127
Faisal Amjad CPS 422
IP Address – Classes & Blocks Note that for each block of addresses (in a class A address), the first byte (netID) is the same The other 3-bytes (hostID) (in a class A address)can take any value within the given range When an organization is given a block of addresses, the first address in it is used to identify the organization on the Internet, hence it is called the Network Address, NOT any individual host
Faisal Amjad CPS 422
IP Address – Classes & Blocks Class
Blocks
Hosts
A
128
16,777,216
B
16,384
65,536
Too Many
C
2,097,152
256
Too Less
D
1
For multicasting
E
1
For Future Use
Too Many
Result is a lot of address wastage Faisal Amjad CPS 422
Faisal Amjad CPS 422
2
IP – Network Address
Subnetting
Network address is an address that defines the network itself It cannot be assigned to a host Properties of network address are o All hostID bytes are 0s o It defines the network to rest of the Internet, helps in efficient routing of packets o It is the first address in the block o Given the network address, we can find the class of address
A portion of IP address indicates the network (netID) and a potortion indicates the hosts on the network (through hostID) It means that there is a sense of heirarchy in IP addressing To reach a host on the Internet, we must first reach the network by using netID Then we must reach the host itself by using the hostID Therefore we can conclude that IP has two levels of heirarchy
Faisal Amjad CPS 422
Subnetting
Faisal Amjad CPS 422
Subnetting Example
An organization often needs to assemble its hosts into groups i.e. the network needs to be subdivided into subnetworks (or subnets) As the networks have network address to identify it on the Internet, each subnet has a subnet address to identify the subnet within the network (and not outside it) Subnetting, therefore introduces another level of hierarchy. Although the subnets in total still appear as a single network to rest of the Internet
Suppose our college is allotted a single class B Block of IP address 141.14.0.0 Also suppose that there are only four departments in our college namely CS, EE, IS and Basic Sciences (or BS) Logically we would like to create separate subnets for each of the departments All departments would also be required to be inter-connected e.g. with routers
Faisal Amjad CPS 422
Faisal Amjad CPS 422
Subnetting Example 141.14.50.1
141.14.50.254
141.14.115.1
CS
141.14.115.2
141.14.192.1
141.14.192.254
141.14.128.1
141.14.128.2
141.14.50.2
BS
Subnet: 141.14.50.0
141.14.192.3
IS
141.14.115.254
Subnet: 141.14.115.0
141.14.128.254
EE
Subnet: 141.14.192.0
Subnet: 141.14.128.0
141.14.192.2 Network Address: 141.14.0.0
141.14.128.3
To rest of the Internet Faisal Amjad CPS 422
3