Transmission Control Protocol / Internet Protocol Unit Ii: Topics: Classfull Internet Address
Transmission Control Protocol / Internet Protocol Unit Ii: Topics: Classfull Internet Address
UNIT II
Topics: Class-ful Internet address, CIDR-Subnetting and Supernetting, ARP, RARP, BOOTP, DHCP.
Classes-
In classful addressing, the IP address space is divided into five classes – A, B, C, D and E. Each class
occupies some part of the whole address space.
Byte 1 Byte 2 Byte 3 Byte 4
Class A 0-127 (0......)
Class B 128-191 (10....)
Class C 192-223 (110....)
Class D 224-239 (1110...)
Class E 240-255 (1111...)
Class A: Since only 1 byte in class A defines the netid and the left-most bit should be 0, the next 7 bits
can be changed to find the number of blocks in this class. Therefore, class A is divided into 27 = 128
organizations.
Class B: Since 2 bytes in class B define the class and two leftmost bit is 10, the next 14 bits can be
changed to find the number of blocks in this class. Therefore, class B is divided into 214 blocks.
Class C: Since 3 bytes in class C define the class and the three leftmost bit is 110, the next 21 bits can be
changed to find the number of blocks in this class. Therefore, class C is divided into 221 blocks, in which
each block contains 256 addresses.
Class D: There is just one block of class D addresses. It is designed for multicasting. Each address in
this class is used to define one group of hosts on the internet. When a group is assigned in this class,
every host that is a member of this group, will have a multicast address in addition to its normal address.
Class E: There is just one block of class E address. It was designed for use as reserved address.
Two-Level Addressing –
Since all addresses in a network belonged to a single block, each address in classful addressing
contains two parts: netid and hostid. The netid defines the network; the hostid defines a particular
host connected to that network.
If n bits define the net, then 32-n bits defines the host. However, value of n depends on the class the
block belongs to. The value of n can be 8, 16 & 24 for class A, B and C respectively.
Network Mask –
The routers in the Internet normally use an algorithm to extract the network address from the
destination address of a packet.
To do this, we need a network mask.
A network mask or a default mask in classful addressing is a
32-bit number with n leftmost bits all set to 1s and (32 − n) rightmost bits all set to 0s.
Since n is different for each class in classful addressing, we have three default masks in classful
addressing as shown in Figure below:
1) Subnetting –
We are using 3-level addressing in which we are able to divide blocks of addresses available in
class A and B into smaller blocks. These smaller blocks are called as sub-networks.
The network mask (default mask) is used when a network is not sub-netted. When we divide a
network to several sub-networks, we need to create a subnet mask for each sub-network.
The subnet mask will have more number of 1s as compared to the network mask.
We can calculate the subnetid for each sub-network as – nsub= n + log2S
Subnetting increases the length of the netid and decreases the length of the hostid.
A network in class B is divided into 4 sub-networks. Here for class B the value of n = 16 and
value of subnet id = 16 + log24 = 18. This means that subnet-id is of 18 1s and (32-18=14) 14 0s.
2) Supernetting –
Subnetting could not completely solve address depletion problems in classful addressing because
most organizations did not want to share their granted blocks with others.
Since class C blocks were still available but the size of the block did not meet the requirement of
new organizations that wanted to join the Internet, one solution was supernetting.
In supernetting, an organization can combine several class C blocks to create a larger range of
addresses i.e. to create a super-network.
A super-net mask is the reverse if subnet mask. A subnet mask for class C has less 1s than the
default mask.
ARP associates an IP address with its physical address. On a typical physical network, such as a LAN, each
device on a link is identified by a physical or station address that is usually imprinted on the NIC.
Figure: ARP Packet Format
RARP finds the logical address for a machine that only knows its physical address.
Figure: RARP Packet
BOOTP
The bootstrap protocol (BOOTP) is the pre-runner of DHCP. It is a client-server protocol designed to
overcome the two deficiencies of the RARP protocol.
First, since it is a client/server program, the BOOTP server can be anywhere in the internet. Second,
it can provide all pieces of information, including IP address.
BOOTP is a static configuration protocol. When a client requests its IP address, the BOOTP server
consults a table that matches the physical address of the client with its IP address. this determines the
predetermined binding between physical and logical address.
There are some situations in which we need a dynamic configuration protocol. BOOTP cannot
handle such configuration because of static binding. Therefore, DHCP has been introduced.
DHCP
The Dynamic Host Configuration Protocol (DHCP) is a client/server protocol designed to provide
the four pieces of information for a diskless computer or a computer that is booted for the first time.
DHCP is successor to BOOTP and is backward compatible with it.
DHCP has been devised to provide static and dynamic address allocation.
Static allocation - DHCP server has a database that statically binds physical addresses to IP
addresses.
Dynamic allocation – DHCP has a second database with a pool of available IP addresses. This
second database makes DHCP dynamic. When a DHCP client requests a temporary IP address, the
DHCP server goes to pool of available IP addresses and assigns an IP address for a negotiable period
of time.
DHCP Packet Format –
Operation Code: this 8-bit field defines the type of DHCP packet: request(1) or reply(2).
Hardware Type: this is an 8-bit field defining the type of physical network. Each type of
network has been assigned an integer.
Hardware length: there is an 8-bit field defining the length of the physical address in bytes.
Hop count – this is an 8-bit field defining the maximum number of hops the packet can travel.
Transaction id – this is 4-byte field carrying an integer. The transaction identification is set by
the client and is used to match a reply with the request.
Number of seconds – 16-bit field that indicates the number of seconds elapsed since the time the
client started to boot.
Flag – 16-bit field in which only the left-most bit is used and the rest of the bits should be set to
0s. A left-most bit specifies a forced broadcasts reply from the server. If the reply were to be
unicast to the client, the destination IP address of the packet is the address assigned to the client.
Client IP address – 4-byte field that contains the client IP address. if the client does not have
this information, the field value is 0
Your IP address – 4-byte field contains the client IP address. it is filled by the server at the
request of the client.
Server IP address – 4-byte containing server IP address.
Gateway IP address – 4-byte containing the IP address of a router.
Client hardware address – contains the physical address of the client.
Server name – 54-byte field that is optionally filled by the server in reply packet.