Unit-2 Notes
Unit-2 Notes
Hexadecimal Notation:
Class B:
IP address belonging to class B are assigned to the networks that ranges from medium-
sized to large-sized networks.
The network ID is 16 bits long.
The host ID is 16 bits long.
The higher order bits of the first octet of IP addresses of class B are always set to 10. The
remaining 14 bits are used to determine network ID. The 16 bits of host ID is used to
determine the host in any network. The default sub-net mask for class B is 255.255.x.x.
Class B has a total of:
2^14 = 16384 network address
2^16 – 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.
Class C:
IP address belonging to class C are assigned to small-sized networks.
The network ID is 24 bits long.
The host ID is 8 bits long.
The higher order bits of the first octet of IP addresses of class C are always set to
110. The remaining 21 bits are used to determine network ID. The 8 bits of host
ID is used to determine the host in any network. The default sub-net mask for class
C is 255.255.255.x. Class C has a total of:
2^21 = 2097152 network address
2^8 – 2 = 254 host address
IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.
Class D:
IP address belonging to class D are reserved for multi-casting. The higher order
bits of the first octet of IP addresses belonging to class D are always set to 1110.
The remaining bits are for the address that interested hosts recognize.
Class D does not posses any sub-net mask. IP addresses belonging to class D
ranges from 224.0.0.0 – 239.255.255.255.
Class E:
IP addresses belonging to class E are reserved for experimental and research
purposes. IP addresses of class E ranges from 240.0.0.0 – 255.255.255.254. This
class doesn’t have any sub-net mask. The higher order bits of first octet of class E
are always set to 1111.
BASIS FOR
SUBNETTING SUPERNETTING
COMPARISON
Mask bits are moved Right of the default mask. Left of the default mask.
towards
Purpose Used to reduce the address To simplify and fasten the routing
depletion. process.
Definition of Subnetting
Subnetting is a technique of partitioning an individual physical network into several
small-sized logical sub-networks. These subnetworks are known as subnets. An IP
address is made up of the combination of the network segment and a host segment. A
subnet is constructed by accepting the bits from the IP address host portion which are
then used to assign a number of small-sized sub-networks in the original network. The
Subnetting basically converts the host bits into the network bits. As mentioned above the
subnetting strategy was initially devised for slowing down the depletion of the IP
addresses. The subnetting permits the administrator to partition a single class A, class B,
class C network into smaller parts. VLSM (Variable Length Subnet Mask) is a
technique which partitions IP address space into subnets of different sizes and prevent
memory wastage. Furthermore, when the number of hosts is same in subnets that is
known as FLSM (Fixed Length Subnet Mask).
Definition of Supernetting
Supernetting is inverse process of subnetting, in which several networks are merged into
a single network. While performing supernetting, the mask bits are moved toward the left
of the default mask. The supernetting is also known as router
summarization and aggregation. It results in the creation of more host addresses at the
expense of network addresses, where basically the network bits are converted into host
bits. The supernetting is performed by internet service provider rather than the normal
users, to achieve the most efficient IP address allocation. CIDR (Classless Inter-
Domain Routing) is scheme used to route the network traffic across the internet. CIDR
is a supernetting technique where the several subnets are combined together for the
network routing. In simpler words, CIDR allows the IP addresses to be organized in the
subnetworks independent of the value of
addresses.
Key Differences Between Subnetting and Supernetting
1. The strategy used to divide a huge network into smaller subnetworks is known as
subnetting. On the contrary, supernetting is the technique of merging multiple
networks into a single one.
2. The subnetting process involves the increment of network part bits from the IP
address. Conversely, in supernetting, the host part bits of the address are increased.
3. In order to perform subnetting the mask bits are repositioned towards the right of
the default mask. As against, in supernetting, the mask bits are moved left of the
default mask.
4. VLSM is a method of subnetting whereas CIDR is a supernetting technique.
Advantages of Subnetting
The size of the router memory table is minimized by summarizing several routing
information entries into a single entry.
It also increases the speed of routing table lookup.
Provision for the router to isolate the topology changes from the other routers.
It also reduces the network traffic.
Disadvantages of Subnetting
In subnetting, The mask bits are While In supernetting, The mask bits
3. moved towards right. are moved towards left.
Figure 16.1. Encapsulation of BOOTP requests and replies within a UDP datagram.
Figure 16.2 shows the format of the 300-byte BOOTP request and reply.
Figure 16.2. Format of BOOTP request and reply.
Opcode is 1 for a request and 2 for a reply. The hardware type field is 1 for a 10
Mbits/sec Ethernet, the same value that is in the field of the same name in an ARP
request or reply (Figure 4.3). Similarly, the hardware address length is 6 bytes for
an Ethernet.
The hop count is set to 0 by the client, but can be used by a proxy server (described in
Section 16.5).
The transaction ID is a 32-bit integer set by the client and returned by the server.
This lets the client match a response with a request. The client should set this to a
random number for each request.
Number of seconds can be set by the client to the time since it started trying to
bootstrap. The servers can look at this value, and perhaps a secondary server for a
client won't respond until the number of seconds has exceeded some value,
implying that the client's primary server is down.
If the client already knows its IP address, it fills in the client IP address.
Otherwise, the client sets this to 0. In the latter case the server fills in your IP
address with the client's IP address. The server IP address is filled in by the
server. If a proxy server is used (Section 16.5), that proxy server fills in its
gateway IP address.
The client must set its client hardware address. Although this is the same value as in
the Ethernet header, by placing the field in the UDP datagram also, it is easily
available to any user process (e.g., a BOOTP server) that receives the datagram. It
is normally much harder (or impossible) for a process reading UDP datagrams to
determine the fields in the Ethernet header that carried the UDP datagram.
The server hostname is a null terminated string that is optionally filled in by the
server. The server can also fill in the boot filename with the fully qualified, null
terminated pathname of a file to bootstrap from.
The vendor-specific area is used for various extensions to BOOTP. Section 16.6
describes some of these extensions.
Port Numbers
There are two well-known ports for BOOTP: 67 for the server and 68 for the client.
This means the client does not choose an unused ephemeral port, but uses 68 instead.
The reason two port numbers were chosen
, instead of just one for the server, is that a server's reply can be (but normally isn't)
broadcast.
If the server's reply were broadcast, and if the client were to choose an ephemeral
port number, these broadcasts would also be received by other applications on
other hosts that happen to be using the same ephemeral port number. Hence, it is
considered bad form to broadcast to a random (i.e., ephemeral) portnumber.
If the client also used the server's well-known port (67) as its port, then all servers
on the network are awakened to look at each broadcast reply. (If all the servers
were awakened, they would examine the opcode, see that it's a reply and not a
request, and go back to sleep.) Therefore the choice was made to have all clients
use a single well-known port that differs from the server's well-known port.
If multiple clients are bootstrapping at the same time, and if the server broadcasts
the replies, each client sees the replies intended for the other clients. The clients can
use the transaction ID field in the BOOTP header to match replies with requests, or
the client can examine the returned client hardware address.
DHCP Packet Format
DHCP header:
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Hardware
Opcode Hardware type Hop count
address
length
Transaction ID
Number of seconds Flags
Client IP address
Your IP address
Server IP address
Gateway IP address
Client hardware address
:::
Server host name :::
Boot filename :::
Options :::
Opcode. 8 bits.
Valu Descriptio
e n
1 BOOTREQUEST, Boot request.
2 BOOTREPLY, Boot reply.
Hardware type. 8
bits.
Hardware
address length. 8
bits. Hop count. 8
bits.
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
B 0
B, Broadcast. 1 bit.
Client IP address. 32 bits.
The first four bytes contain the (decimal) values 99, 130, 83 and 99. This is the
same magic cookie as has been defined for BOOTP. The remainder of the field
consists of a list of tagged parameters that are called options. All of the vendor
extensions used by BOOTP are also DHCP options.
Bootstrap Protocol (BootP) and DHCP:-
BootP:-
The problem with using Reverse Address Resolution Protocol (RARP) (RFC
903) for assigning IP addresses to clients is that it operates at the data link layer
and is therefore limited to the local LAN. Bootp however uses IP/UDP (port 67 for
the server destination port, and port 68 for the client source port) and can cross
routers. If a client does not know its own IP address when it boots up then it can
utilise a Bootp server to obtain its IP address. It will use a IP broadcast address of
255.255.255.255. This IP broadcast is transmitted in a link-layer broadcast of
FFFF.FFFF.FFFF. If the client is on the same LAN as the Bootp server, then the
Bootp server will respond to the broadcast, by using the MAC address of the client,
and the IP address will be given to the client. If the Bootp server is on another LAN
i.e. on the other side of a router then we are left with the situation whereby
broadcasts are being sent by the client and the router is designed not to pass
broadcasts. Consider the following scenario:
The client requires an IP address and a default gateway address so it sends out an IP
broadcast BOOTREQUEST.
1. No Bootp server exists locally so the router R1, which is configured to
forward Bootp/DHCP requests, sends a unicast with the source IP address
of it's LAN interface on which it received the initial broadcast. Note that
this is different from TCP connections which use the WAN IP address on
the router which owns the LAN interface from whence the packet came.
The unicast contains the IP address of the Bootp server which R1 knows
since this is part of the Bootp forwarding configuration.
2. R2 forwards the unicast to the Bootp server.
3. The server examines the packet and checks for the client's hardware
address in its database. If the MAC address has been entered then the
server can map the client MAC address to the IP address configured in
the database.
4. The server then looks to see if the client is requesting a configuration file (boot
file).
5. The server replies with a unicast BOOTREPLY containing the client's IP
address and details of the configuration file.
6. R1 recognizes the unicast reply and forwards the packet to the clients MAC
address.
7. The client's TCP/IP stack then pings the IP address to check that it is
not being used beforetaking it for itself.
8. The client then can use TFTP etc. to download the configuration file
including information such as the default gateway to the LAN interface
of R1.
Note that the TCP/IP stack needs to be in place on the client, since the client needs
to be able to send an IP broadcast (not a layer 2 broadcast!).
Below is the frame format which is used for both Bootp and DHCP: