UNIT-2 Chapter 6 IP Addressing
UNIT-2 Chapter 6 IP Addressing
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, Chapter 6 – IP Addressing
What is an IP Address?
Any computer or device connected to the internet have a mailing address called the
Internet Protocol address or IP address. An IP address is an identifier for a computer or
device on a TCP/IP network. An IP address is a 32-bit number written in dotted decimal
notation: four 8-bit fields (octets) converted from binary to decimal numbers, separated
by dots.
Example IP addresses: 122.169.236.244, 78.125.0.209, 216.27.61.137
An IP address can either be static or dynamic. If it is static, then it will remain unchanged
every time we connect a node to a network and if it is dynamic then a local DHCP
(Dynamic Host Configuration Protocol) server grants a new IP address every time we
connect a node to internet.
An IP address format is usually divided into two parts:
• Network ID: To uniquely identify the network to which the host belongs.
• Host ID: To uniquely identify the host in a particular network.
For example, 145.10.34.3.
Above address is a 32-bit address represented within the system in binary form:
10010001.00001010.00100010.00000011
The network number field is called the network prefix, network number or network ID
(Network Identifier). The network-number field has been referred to as the network-
prefix because the leading portion of each IP address identifies the network number.
Network Id Host Id
Class A Addresses
• First octet is Network ID and next 3 octets are Host ID.
• This Class IP address always has its first bit as 0, next 7 bits as a network address and
following 24 bits as the host address.
• The range of IP addresses is 0.0.0.0 to 127.255.255.255.
• This means that it allows 2^7 networks and 2^24 hosts per network.
• This class of IP address is used for a very large network. Ex. Big Organisation
Class B Addresses
• First 2 octets are Network ID and next 2 octets are Host ID.
• Class B IP address always has its first bits as 10, next 14 bits as a network address and
following 16 bits as the host address.
• The range of IP addresses is 128.0.0.0 to 191.255.255.255.
• This means that it allows 2^14 networks and 2^16 hosts per network.
• This class of IP address is used for a medium network like multinational companies.
SDM
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER,
Class C Addresses
• First 3 octets are Network ID and last 1 octet is Host ID.
• Class C IP address always has its first bits as 110, next 21 bits as a network address and
following 8 bits as the host address.
• The range of IP addresses is the first block from 192.0.0.0 to 192.0.0.255 and the last
block from 223.255.255.0 to 223.255.255.255.
• This means that it allows 2^21 networks and 2^8 hosts per network.
• This class is used for a small network such as small companies or colleges.
Class D Addresses
• Class D IP address always has its first bits as 1110.
• There is no segregation of host and network addresses.
• It is in the range of 224.0.0.0 to 239.255.255.255
• Reserved for multicast.
• Multicast is a mechanism for defining groups of nodes and sending IP messages to that
group rather than to every node on the LAN (broadcast) or just one other node (unicast).
Class E Addresses
• The address begins with 11110.
• It in the range of 240.0.0.0 to 255.255.255.255.
• It is reserved for future use, research, and development purpose.
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, Unicast
In this mode, data is sent only to one destined host. The destination address field contains
32-bit IP address of the destination host. Here source sends data to the targeted
destination.
Broadcast
In this mode the packet is addressed to all hosts in a network segment. The destination
address field contains special broadcast address i.e. 255.255.255.255. When a host sees
this packet on the network, it is bound to process it. Here source sends packet, which is
entertained by all the nodes.
Broadcast signifies a one to all relation between the source and the destination.
Broadcasts are mostly confined to the LAN and need special rules to travel beyond the
router.
Multicast
This mode is a mix of previous two modes, i.e. the packet sent is neither destined to a
single host nor all the hosts on the segment. In this packet, the destination address
contains special address which starts with 224.x.x.x and can be entertained by more
than one host.
Here a source sends packets which are entertained by more than one nodes. Every
network has one IP address reserved for network number which represents the network
and one IP address reserved for broadcast address, which represents all the host in that
network.
IP Loopback Address
127.0.0.1 is the loopback address in IP. Loopback is a test mechanism of network
adapters. Messages sent to 127.0.0.1 do not get delivered to the network. Instead, the
adapter intercepts all loopback messages and returns them to the sending application. IP
applications often use this feature to test the behavior of their network interface. As with
broadcast, IP officially reserves the entire range from 127.0.0.0 through 127.255.255.255
for loopback purposes. Nodes should not use this range on the Internet, and it should not
be considered part of the normal Class A range.
Zero Addresses
As with the loopback address range, the address range from 0.0.0.0 through
0.255.255.255 should not be considered part of the normal Class A range. 0.x.x.x
SDM
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, addresses serve no particular function in IP, but nodes attempting to use them will be
unable to communicate properly on the Internet.
Version: 4 bits
Identifies the version of IP used to generate the datagram. For IPv4, this is of course the
number 4. The purpose of this field is to ensure compatibility between devices that may
be running different versions of IP.
IHL: 4 bits
Internet Header Length (IHL) specifies the length of the IP header, in 32-bit words.
This includes the length of any options fields and padding. The normal value of this
field when no options are used is 5 (5 32-bit words = 5 *4 = 20 bytes). Contrast to the
longer Total Length field.
Type of Service: 8 bits
Type of Service (ToS) field is used carry information to provide quality of service
(QoS) features, such as prioritized delivery, for IP datagrams. These parameters are to
be used to guide the selection of the actual service parameters when transmitting a
datagram through a particular network. It contains a 3-bit precedence field (that is
ignored today), 4 service bits, and 1 unused bit. The four service bits can be:
1000 Minimize Delay
0100 Maximize Throughput
0010 Maximize Reliability
0001 Minimize Monetary cost
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, fragments may arrive from multiple messages mixed together, since IP datagrams can be
received out of order from any device.
Flags: 3 bits
It is used for fragmentation. DF means do not fragment. It is a request to routers not to
fragment the datagram since the destination is incapable of putting the pieces back
together.
MF means more fragments to follow. All fragments except the last one have this bit set.
It is needed to know if all fragments of a datagram have arrived.
Fragment Offset: 13 bits
When fragmentation of a message occurs, this field specifies the offset, or position, in the
overall message where the data in this fragment goes. It is specified in units of 8 bytes
(64 bits). The first fragment has an offset of 0.
Time to Live: 8 bits
Specifies how long the datagram is allowed to live on the network, in terms of router
hops. Each router decrements the value of the TTL field (reduces it by one) prior to
transmitting it. If the TTL field drops to zero, the datagram is assumed to have taken too
long a route and is discarded.
Protocol: 8 bits
This field tells IP where to send the datagram up to. Few commonly used protocols are
Hex Value Dec Value Protocol
00 0 Reserved
01 1 ICMP (Internet Control Message Protocol)
02 2 IGMP (Internet Group Management Protocol)
06 6 TCP (Transmission Control Protocol)
11 17 UDP (User Datagram Protocol)
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, Subnet Mask
A subnet mask is a 32-bit number used to differentiate the network component of an IP
address by dividing the IP address into a network address and host address. A subnet
mask is also known as an address mask.
Subnet mask can be used to find if an IP address is present on a subnet or not. Subnet mask is
utilized for isolating the network id and host ids.
Subnetting
Subnetting is the creation of a network within a network, often known as a subnetwork – or
simply subnet. Also defined as a logical subdivision of an IP network, a subnetwork is more
localised and compact than a main network.
Subnetting is most often done for efficiency purposes, allowing network traffic to be streamlined
by erasing the need for it to travel through additional routers.
Supernetting
Supernetting is the opposite of Subnetting. In subnetting, a single big network is divided into
multiple smaller subnetworks. In Supernetting, multiple networks are combined into a bigger
network termed as a Supernetwork or Supernet.
Supernetting is mainly used in Route Summarization, where routes to multiple networks with
similar network prefixes are combined into a single routing entry, with the routing entry pointing
to a Super network, encompassing all the networks.
IPv6
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block is then
converted into 4-digit Hexadecimal numbers separated by colon symbols.
An IPv6 address is represented as eight groups of four hexadecimal digits, each group
representing 16 bits The groups are separated by colons (:).
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
IPv6 Features
The new IP addressing is not designed to be backward compatible with IPv4. IPv6 is redesigned
entirely. It has the following features.
1) Vast Address Space: In contrast to IPv4, IPv6 uses 4 times more bits (128 bits) to address
a device on the Internet. This can provide
300,000,000,000,000,000,000,000,000,000,000,000,000 (approximately 3.4×1038) different
combinations of addresses. This address can accumulate the aggressive requirement of
address allotment for almost everything in this world. According to a research estimate, 1564
addresses can be allocated to every square meter of this earth.
2) Simplified Header: IPv6’s header has been simplified by moving all unnecessary
information and options (which are present in IPv4 header) to the end of the IPv6 header.
IPv6 header is only twice as bigger than IPv4 providing the fact the IPv6 address is four times
longer.
3) End-to-end Connectivity: Every system now has unique IP address and can traverse through
the internet without using NAT (Network Address Translation). After IPv6 is fully
implemented, every host can directly reach other host on the Internet.
4) Auto-configuration: IPv6 supports both stateful and stateless auto configuration mode of its
host devices. This way absence of a DHCP server does not put stop inter segment
communication.
5) Faster Forwarding/Routing: IPv6’s simplified header puts all unnecessary information at
the end of the header. All information in first part of the header is enough for a router to take
routing decision. This makes routing decision as quickly as looking at the mandatory header.
6) IPSec [IP Security]: Network security is integrated into the design of the IPv6 architecture.
Internet Protocol Security (IPsec) was originally developed for IPv6, but found optional
SDM
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, deployment first in IPv4 (into which it was back-engineered). The IPv6 specifications
mandate IPsec implementation as a fundamental interoperability requirement.
7) No Broadcast: IPv6 does not have any Broadcast support. It uses multicast to
communicate with multiple hosts.
8) Anycast Support: This is another characteristic of IPv6. IPv6 has introduced Anycast mode
of packet routing. In this mode, multiple interfaces over the Internet are assigned same
anycast IP address. Routers, while routing, sends the packet to the nearest destination.
9) Mobility: IPv6 was designed keeping mobility feature in mind. This feature enables hosts
(such as mobile phone) to roam around in different geographical area and remain connected
with same IP address. IPv6 mobility feature takes advantage of auto IP configuration and
Extension headers.
10) Enhanced Priority support: Where IPv4 used 6 bits DSCP (Differential Service Code
Point) and 2 bits ECN (Explicit Congestion Notification) to provide Quality of Service (QoS)
but it could only be used if the end-to-end devices support it, that is, the source and
destination device and underlying network must support it. In IPv6, Traf ic class and Flow
label are used to tell underlying routers how to efficiently process the packet and route it.
11) Smooth Transition: Large IP address scheme in IPv6 enables to allocate devices with
globally unique IP addresses. This assures that mechanism to save IP addresses such as NAT
is not required. So devices can send/receive data between each other, for example VoIP
and/or any streaming media can be used much efficiently. Other fact is, the header is less
loaded so routers can make forwarding decision and forward them as quickly as they arrive.
12) Extensibility: One of the major advantages of IPv6 header is that it is extensible to add more
information in the option part. IPv4 provides only 40-bytes for options whereas options in
IPv6 can be as much as the size of IPv6 packet itself.
A unicast address identifies a single interface within the scope of the type of unicast address.
With the appropriate unicast routing topology, packets addressed to a unicast address are
delivered to a single interface. To accommodate load-balancing systems, RFC 2373 allows for
multiple interfaces to use the same address as long as they appear as a single interface to the
IPv6 implementation on the host.
Multicast
A multicast address identifies multiple interfaces. With the appropriate multicast routing
topology, packets addressed to a multicast address are delivered to all interfaces that are
identified by the address.
In multicast there is a one to many associations between the source and the destination.
SDM
ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, SDM COLLEGE, MANGALORE – 03 ARUN F. SEQUEIRA, LECTURER, Anycast
Anycast is a network addressing and routing methodology in which a single destination IP
address is shared by devices (generally servers) in multiple locations.
The process of redirecting a user request to the nearest server is called anycasting.
Anycast technology is a system that increases both the speed and security of the Internet naming
system and, consequently, the entire Internet by creating many copies of the same data in
multiple locations across the world. An anycast address identifies multiple interfaces. With the
appropriate routing topology, packets addressed to an anycast address are delivered to a single
interface, the nearest interface that is identified by the address. The nearest interface is defined
as being closest in terms of routing distance. A multicast address is used for one-to-many
communication, with delivery to multiple interfaces. An anycast address is used for one-to-one-
of-many communications, with delivery to a single interface. The routing tables on the router are
updated using IPv6 to give the packets the path to the nearest destination, making the transfer
much faster. IPv6 determines automatically as to which destination end points are closest, and
sends them the packets like a Unicast. The destination then carries on relays the packets to its
nearest hosts until all destinations are addressed.
1) Version: The size of the Version field is 4 bits. The Version field shows the version of IP
and is set to 6 for IPv6.
2) Traffic Class: The size of Traffic Class field is 8 bits. Traffic Class field is similar to the
IPv4 Type of Service (ToS) field. The Traffic Class field indicates the IPv6 packet’s class or
priority.
3) Flow Label : The size of Flow Label field is 20 bits. The Flow Label field provide additional
support for real-time datagram delivery and quality of service features. The purpose of Flow
Label field is to indicate that this packet belongs to a specific sequence of packets between a
source and destination and can be used to prioritized delivery of packets for services like
voice.
4) Payload Length: The size of the Payload Length field is 16 bits. The Payload Length field
shows the length of the IPv6 payload, including the extension headers and the upper layer
protocol data
5) Next Header: The size of the Next Header field is 8 bits. The Next Header field shows either
the type of the first extension (if any extension header is available) or the protocol in the
upper layer such as TCP, UDP, or ICMPv6.
6) Hop Limit: The size of the Hop Limit field is 8 bits The Hop Limit field shows the maximum
number of routers the IPv6 packet can travel. This Hop Limit field is similar to IPv4 Time to
Live (TTL) field. This field is typically used by distance vector routing protocols, like
Routing Information Protocol (RIP) to prevent layer 3 loops (routing loops).
7) Source Address: The size of the Source Address field is 128 bits. The Source Address field
shows the IPv6 address of the source of the packet.
8) Destination Address: The size of the Destination Address field is 128 bits. The Destination
Address field shows the IPv6 address of the destination of the packet.
*-*-*-*-*-*-*
SDM