Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
20 views68 pages

Internet Protocol

The Internet Protocol (IP) is essential for data transmission across the internet, enabling devices to communicate through unique IP addresses. It operates as a connectionless protocol, facilitating efficient data routing and management, and is integral to various addressing modes and classes. The Dynamic Host Configuration Protocol (DHCP) automates IP address assignment, simplifying network management by allowing devices to receive necessary configuration parameters automatically.

Uploaded by

saranyar.aids
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views68 pages

Internet Protocol

The Internet Protocol (IP) is essential for data transmission across the internet, enabling devices to communicate through unique IP addresses. It operates as a connectionless protocol, facilitating efficient data routing and management, and is integral to various addressing modes and classes. The Dynamic Host Configuration Protocol (DHCP) automates IP address assignment, simplifying network management by allowing devices to receive necessary configuration parameters automatically.

Uploaded by

saranyar.aids
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

INTERNET PROTOCOL

The Internet Protocol (IP) is a fundamental set of rules that


defines how data is transmitted across the internet. It's the
network layer protocol in the TCP/IP protocol suite, ensuring
that data packets can be routed from one device to another,
regardless of the network they travel through. Essentially, it's
the foundation upon which the internet is built, allowing devices
to communicate globally.
The Internet Protocol (IP) is a set of rules that allows computers and
other devices to communicate over the Internet. It ensures that
information sent from one device reaches the correct destination by
using a unique set of numbers known as IP addresses.
Whether you're browsing websites, sending emails, or watching videos,
the Internet Protocol helps manage how information travels, making sure
everything works smoothly and efficiently.
Why is Internet Protocol Important?
The Internet Protocol is a fundamental component of the Internet and computer
networks, responsible for delivering packets of data from the source host to the
destination host based on their IP addresses. It ensures that packets of data get to the
right destination from the source device.
Each device connected to a network is assigned an IP address, which serves as a "home
address" for the device, enabling other devices to locate and send messages to it and
providing the addressing and routing mechanisms the devices require for their
communications.
IP works in conjunction with the Internet Control Message
Protocol (ICMP) to send error messages and operational
information (e.g., destination unreachable, echo requests), which
inform senders about issues in packet delivery. Unlike some
protocols, IP does not establish a connection before transmitting
data, making it a connectionless protocol that allows for more
flexible and efficient data transmission
Primary Terminologies

● IP Address: IP address is referred as a number sticker given


to each device that belongs to the network which utilizes
Internet Protocol to communicate. It serves two main
purposes: host or network interface recognition, identifier
or location addressing.
● Packet: A packet is a parcel of data that is switched between an origin and a
destination via the Internet or some other network that is based on the packet
switching mechanism. This component mainly has a header and a payload.
● Router: A router is a network device that (serves as) a forwarding point for
data packets between computer networks. Routers carry out the traffic
routing functions through the Internet.
● IPv4: Internet Protocol version 4 (IPv4) is a protocol that tends to
provide connectivity between the desktop computers online and that
application layer is the wider application one that covers most of the
Internet communications nowadays
● IPv6: Internet Protocol version 6 (IPv6), the final iteration in the series
of the upgrades to the Internet Protocol, is used for the purpose of
identifying, locating and routing of various computers so that traffic
through Internet can be transferred properly.
2 types of IP Address
PUBLIC IP

PRIVATE IP
IP Address can be divided in to two portions
Network Portion
Host Portion
IPv4
IP stands for Internet Protocol version v4 stands for
Version Four (IPv4), is the most widely used system for
identifying devices on a network. It uses a set of four
numbers, separated by periods (like 192.168.0.1), to give
each device a unique address. This address helps data find
its way from one device to another over the internet.
What is an IP Address?
An IP address (Internet Protocol address) is a unique identifier assigned to
each device connected to a network that uses the Internet Protocol for
communication. It serves two main purposes:
● Identification: It uniquely identifies a device on a network.
● Location Addressing: It indicates where a device is located within a
network, making data routing possible.
It is made up of 32 binary bits.
32 binary bits are broken in to 4 octets( 1 octet = 8 bits) and converted in to Decimals.
The Value of each octet ranges from 0 to 255 in decimal or 00000000-11111111 in
binary.
The decimal format of IPV4 address is 192.68.10.11
Subnet is an logical subdivision of an IP Network .dividing an IP network is
Subnetting
Binary Representation

IPv4 is basically converted into binary form by computer although these are usually seen in
decimal form for human readability. Each octet is converted into 8 bit binary number . For
instance 185.107.80.231 in binary looks like:
● 185: 10111001
● 107: 01101011
● 80: 01010000
● 231: 11100111

So 185.107.80.231 in binary is: 10111001.01101011.01010000.11100111


So 185.107.80.231 in binary is: 10111001.01101011.01010000.11100111
Parts of IPv4
IPv4 addresses consist of three parts:
● Network Part: The network part indicates the distinctive variety that’s appointed to the
network. The network part conjointly identifies the category of the network that’s assigned.
● Host Part: The host part uniquely identifies the machine on your network. This part of the
IPv4 address is assigned to every host.
For each host on the network, the network part is the same, however, the host half must vary.
● Subnet Number: This is the non obligatory part of IPv4. Local networks that have massive
numbers of hosts are divided into subnets and subnet numbers are appointed to that.
Types of IPv4 Addressing
IPv4 basically supports three different types of addressing modes:
● Unicast Addressing Mode: This addressing mode is used to specify single sender and
single receiver. Example: Accessing a website.
● Broadcast Addressing Mode: This addressing mode is used to send messages to all
devices in a network. Example: sending a message in local network to all the devices.
● Multicast Addressing Mode: This addressing mode is typically used within a local
network or across networks and sends messages to a group of devices. Example:
Streaming audio to multiple devices at once.
Classes of IP Addressing
The 32-bit IP address is divided into five sub-classes. These are given below:
● Class A
● Class B
● Class C
● Class D
● Class E
Each of these classes has a valid range of IP addresses. Classes D and E
are reserved for multicast and experimental purposes respectively. The
order of bits in the first octet determines the classes of the IP address.
The class of IP address is used to determine the bits used for network
ID and host ID and the number of total networks and hosts possible in
that particular class. Each network administrator assigns an IP address to
each device that is connected to its network.
Note:
● IP addresses are globally managed by Internet Assigned Numbers Authority
(IANA) and Regional Internet Registries (RIR).
● While finding the total number of host IP addresses, 2 IP addresses are not
counted and are therefore, decreased from the total count because the first IP
address of any network is the network number and whereas the last IP
address is reserved for broadcast IP.
Class A

IP addresses belonging to class A are assigned to the networks that contain a large number of
hosts.
● The network ID is 8 bits long.
● The host ID is 24 bits long.

The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits in the
first octet are used to determine network ID. The 24 bits of host ID are used to determine the
host in any network. The default subnet mask for Class A is 255.x.x.x. Therefore, class A has
a total of:
● 2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 1.0.0.1 – 126.255.255.255.
Class B

IP address belonging to class B is assigned to networks that range 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 the network ID. The 16 bits of host ID are used to
determine the host in any network. The default subnet 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.0.0 – 191.255.255.255.
Class C

IP addresses 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 is always set to 110. The remaining
21 bits are used to determine the network ID. The 8 bits of host ID are used to determine the host in
any network. The default subnet 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 range from 192.0.0.0 –
223.255.255.255.
Class D
IP address belonging to class D is reserved for multi-casting. The higher-order bits
of the first octet of IP addresses belonging to class D is always set to 1110. The
remaining bits are for the address that interested hosts recognize.
Class D does not possess any subnet mask. IP addresses belonging to class
D range 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 range from
240.0.0.0 – 255.255.255.255. This class doesn’t have any subnet
mask. The higher-order bits of the first octet of class E are always
set to 1111.
Structure of Classful Addressing
Characteristics of IPv4
● IPv4 could be a 32-bit IP Address.
● IPv4 could be a numeric address, and its bits are separated by a dot.
● The number of header fields is twelve and the length of the header field is
twenty.
● It has Unicast, broadcast, and multicast-style addresses.
● IPv4 supports VLSM (Virtual Length Subnet Mask).
● IPv4 uses the Post Address Resolution Protocol to map to the MAC address.
● RIP may be a routing protocol supported by the routed daemon.
Advantages of IPv4
● IPv4 security permits encryption to keep up privacy and security.
● IPV4 network allocation is significant and presently has quite 85000 practical routers.
● It becomes easy to attach multiple devices across an outsized network while not NAT.
● This is a model of communication so provides quality service also as economical knowledge
transfer.
● IPV4 addresses are redefined and permit flawless encoding.
● IPv4 has high System Management prices and it’s labor-intensive, complex, slow & prone to errors.
● Routing is scalable and economical as a result of addressing its collective more effectively.
● Data communication across the network becomes a lot of specific in multicast organizations.
Limitations of IPv4
● IP relies on network layer addresses to identify end-points on the network, and each
network has a unique IP address.
● The world’s supply of unique IP addresses is dwindling, and they might eventually run out
theoretically.
● If there are multiple hosts, we need the IP addresses of the next class.
● Complex host and routing configuration, non-hierarchical addressing, difficult to
re-numbering addresses, large routing tables, non-trivial implementations in providing
security, QoS (Quality of Service), mobility, and multi-homing, multicasting, etc. are the
big limitations of IPv4 so that’s why IPv6 came into the picture.
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol is a
network protocol used to automate the process
of assigning IP addresses and other network
configuration parameters to devices (such as
computers, smartphones, and printers) on a
network.
Instead of manually configuring each device with
an IP address, DHCP allows devices to connect to
a network and receive all necessary network
information, like IP address, subnet mask, default
gateway, and DNS server addresses, automatically
from a DHCP server.
This makes it easier to manage and maintain large
networks, ensuring devices can communicate
effectively without conflicts in their network settings.
DHCP plays a crucial role in modern networks by
simplifying the process of connecting devices and
managing network resources efficiently.
What is DHCP?
DHCP stands for Dynamic Host Configuration Protocol. It is
the critical feature on which the users of an enterprise
network communicate. DHCP helps enterprises to smoothly
manage the allocation of IP addresses to the end-user clients’
devices such as desktops, laptops, cellphones, etc.
is an application layer protocol that is used to provide:
Subnet Mask (Option 1 - e.g., 255.255.255.0)
Router Address (Option 3 - e.g., 192.168.1.1)
DNS Address (Option 6 - e.g., 8.8.8.8)
Vendor Class Identifier (Option 43 - e.g.,
'unifi' = 192.168.1.9 ##where unifi = controller)
DHCP is based on a client-server model and based on discovery,
offer, request, and ACK.
Why Do We Use DHCP?
DHCP helps in managing the entire process automatically
and centrally. DHCP helps in maintaining a unique IP
Address for a host using the server. DHCP servers maintain
information on TCP/IP configuration and provide
configuration of address to DHCP-enabled clients in the form
of a lease offer.
Components of DHCP
The main components of DHCP include:
● DHCP Server: DHCP Server is a server that holds IP Addresses and other
information related to configuration.
● DHCP Client: It is a device that receives configuration information from the server.
It can be a mobile, laptop, computer, or any other electronic device that requires a
connection.
● DHCP Relay: DHCP relays basically work as a communication channel between
DHCP Client and Server.
● IP Address Pool: It is the pool or container of IP Addresses possessed by the DHCP
Server. It has a range of addresses that can be allocated to devices.
● Subnets: Subnets are smaller portions of the IP network
partitioned to keep networks under control.
● Lease: It is simply the time that how long the information
received from the server is valid, in case of expiration of the
lease, the tenant must have to re-assign the lease.
● DNS Servers: DHCP servers can also provide DNS (Domain
Name System) server information to DHCP clients, allowing
them to resolve domain names to IP addresses.
● Default Gateway: DHCP servers can also provide information about the default
gateway, which is the device that packets are sent to when the destination is
outside the local network.
● Options: DHCP servers can provide additional configuration options to clients,
such as the subnet mask, domain name, and time server information.
● Renewal: DHCP clients can request to renew their lease before it expires to
ensure that they continue to have a valid IP address and configuration
information.
● Failover: DHCP servers can be configured for failover, where two servers work
together to provide redundancy and ensure that clients can always obtain an IP
address and configuration information, even if one server goes down.
● Dynamic Updates: DHCP servers can also be configured to dynamically update
DNS records with the IP address of DHCP clients, allowing for easier
management of network resources.
● Audit Logging: DHCP servers can keep audit logs of all DHCP transactions,
providing administrators with visibility into which devices are using which IP
addresses and when leases are being assigned or renewed.
DHCP Packet Format
● Hardware Length: This is an 8-bit field defining the length of the physical
address in bytes. e.g for Ethernet the value is 6.
● Hop count: This is an 8-bit field defining the maximum number of hops the packet
can travel.
● Transaction ID: This is a 4-byte field carrying an integer. The transcation
identification is set by the client and is used to match a reply with the request. The
server returns the same value in its reply.
● Number of Seconds: This is a 16-bit field that indicates the number of seconds
elapsed since the time the client started to boot.
● Flag: This is a 16-bit field in which only the leftmost bit is used and the rest of
the bit should be set to os. A leftmost bit specifies a forced broadcast reply
from the server. If the reply were to be unicast to the client, the destination. IP
address of the IP packet is the address assigned to the client.
● Client IP Address: This is a 4-byte field that contains the client IP address . If
the client does not have this information this field has a value of 0.
● Your IP Address: This is a 4-byte field that contains the client IP address. It is
filled by the server at the request of the client.
● Server IP Address: This is a 4-byte field containing the server IP
address. It is filled by the server in a reply message.
● Gateway IP Address: This is a 4-byte field containing the IP address
of a routers. IT is filled by the server in a reply message.
● Client Hardware Address: This is the physical address of the client
.Although the server can retrieve this address from the frame sent by
the client it is more efficient if the address is supplied explicity by the
client in the request message.
● Server Name: This is a 64-byte field that is optionally filled by the server in a reply
packet. It contains a null-terminated string consisting of the domain name of the server. If
the server does not want to fill this filed with data, the server must fill it with all 0s.
● Boot Filename: This is a 128-byte field that can be optionally filled by the server in a
reply packet. It contains a null- terminated string consisting of the full pathname of the
boot file. The client can use this path to retrieve other booting information. If the server
does not want to fill this field with data, the server must fill it with all 0s.
● Options: This is a 64-byte field with a dual purpose. IT can carry
either additional information or some specific vendor information.
The field is used only in a reply message. The server uses a number,
called a magic cookie, in the format of an IP address with the value of
99.130.83.99. When the client finishes reading the message, it looks
for this magic cookie. If present the next 60 bytes are options.
Working of DHCP
DHCP works on the Application layer of the UDP Protocol. The main task of DHCP is
to dynamically assigns IP Addresses to the Clients and allocate information on TCP/IP
configuration to Clients.
The DHCP port number for the server is 67 and for the client is 68. It is a client-server
protocol that uses UDP services. An IP address is assigned from a pool of addresses. In
DHCP, the client and the server exchange mainly 4 DHCP messages in order to make a
connection, also called the DORA process, but there are 8 DHCP messages in the
process.
The 8 DHCP Messages

1. DHCP Discover Message: This is the first message


generated in the communication process between the server
and the client. This message is generated by the Client host
in order to discover if there is any DHCP server/servers are
present in a network or not. This message is broadcasted to
all devices present in a network to find the DHCP server.
This message is 342 or 576 bytes long.
2. DHCP Offers A Message: The server will respond to the
host in this message specifying the unleased IP address and
other TCP configuration information. This message is
broadcasted by the server. The size of the message is 342
bytes. If there is more than one DHCP server present in the
network then the client host will accept the first DHCP
OFFER message it receives. Also, a server ID is specified in
the packet in order to identify the server.
3. DHCP Request Message: When a client receives an offer
message, it responds by broadcasting a DHCP request
message. The client will produce a gratuitous ARP in order
to find if there is any other host present in the network with
the same IP address. If there is no reply from another host,
then there is no host with the same TCP configuration in the
network and the message is broadcasted to the server
showing the acceptance of the IP address. A Client ID is also
added to this message.
4. DHCP Acknowledgment Message: In
response to the request message received, the
server will make an entry with a specified client
ID and bind the IP address offered with lease
time. Now, the client will have the IP address
provided by the server.
5. DHCP Negative Acknowledgment Message:
Whenever a DHCP server receives a request for an IP
address that is invalid according to the scopes that are
configured, it sends a DHCP Nak message to the client.
Eg-when the server has no IP address unused or the pool
is empty, then this message is sent by the server to the
client.
6. DHCP Decline: If the DHCP client determines the
offered configuration parameters are different or
invalid, it sends a DHCP decline message to the
server. When there is a reply to the gratuitous ARP
by any host to the client, the client sends a DHCP
decline message to the server showing the offered IP
address is already in use.
7. DHCP Release: A DHCP client sends a
DHCP release packet to the server to release
the IP address and cancel any remaining lease
time.
8. DHCP Inform: If a client address has obtained an IP address
manually then the client uses DHCP information to obtain other
local configuration parameters, such as domain name. In reply
to the DHCP inform message, the DHCP server generates a
DHCP ack message with a local configuration suitable for the
client without allocating a new IP address. This DHCP ack
message is unicast to the client.
Security Considerations for Using DHCP
To make sure your DHCP servers are safe, consider these DHCP security issues:
● Limited IP Addresses :
● Fake DHCP Servers :
● DNS Access :
Advantages
● Centralized management of IP addresses.
● Centralized and automatedTCP/IP configuration .
● Ease of adding new clients to a network.
● Reuse of IP addresses reduces the total number of IP addresses
that are required.
Disadvantages
● IP conflict can occur.
● The problem with DHCP is that clients accept any server. Accordingly,
when another server is in the vicinity, the client may connect with this
server, and this server may possibly send invalid data to the client.
● The client is not able to access the network in absence of a DHCP Server.

You might also like