Week 2 To 3
Week 2 To 3
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Contents
• IPV4 Address
• IPV6 Address
• IP Headers
• MAC Address
• Port Address
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IP (Internet Protocol) Address
A unique number/identifier which is used to represent a host within a network.
It has two versions. IPV4 and IPV6.
Layer 3 Protocols.
This identity is then used to access data and information available on the web when the client device sends a
request to the server and is passed through routers, hubs, and other network nodes.
IP addresses are not only essential when connecting to the internet but also performs other functions, which
are:
Identity for the host: This function of the IP address is responsible for providing the network device that
accesses the internet with a unique identity on the web. This identity allows the system to access data
available on the internet and as an identifier for the hubs, routers, or switches it connects to and access data.
Location of the host: As the name suggests, the other function of the IP address provides the system’s
location on the network. This is beneficial because, in case of a hacking incident or spamming, you can
track the perpetrator through the system's IP address used to execute the task.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IP (Internet Protocol) Address
IANA, or the Internet Assigned Numbers Authority, is
responsible for allocating the entire IP address space to any
entity that needs a presence on the Internet (0.0.0.0 –
255.255.255.255).
IANA has delegated this responsibility to
five Regional Internet Registries (RIRs): ARIN, RIPE, LACNIC,
AFRINIC, APNIC, which in turn allocate address space to the
various corporations in their regions.
There are two strategies the RIRs use to allocate IP address
space: the legacy strategy called Classful addressing, and the
current strategy of Classless addressing (commonly referred to
as Classless Inter-Domain Routing, or CIDR).
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 Address
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 Address
How to find Network Address, Valid / Host Address, Broadcast Address ??
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 Subnetting
Fixed Length Subnet Masking (FLSM) Variable Length Subnet Masking (VLSM)
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 Subnetting
Attributes FLSM VLSM
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV6 Address
IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the problem of IPv4
exhaustion. IPv6 is a 128-bits address having an address space of 2128, which is way bigger than
IPv4. IPv6 use Hexa-Decimal format separated by colon (:) .
Components in Address format :
i. There are 8 groups and each group represents 2 Bytes (16-bits).
ii. Each Hex-Digit is of 4 bits (1 nibble)
iii. Delimiter used – colon (:)
1234:0fd2:5621:0001:0089:0000:0000:4500
Original IPv6 =
Original IPv6 = 2001:1234:0000:0000:1b12:0000:0000:1a13
Compressed IPv6 = 1234:fd2:5621:1:89:0:0:4500 Compressed
IPv6 = 2001:1234::1b12:0:0:1a13
or
ef82:0000:0000:0000:0000:1a12:1234:1b12
Original IPv6 =
IPv6 = 2001:1234:0:0:1b12::1a13
Compressed IPv6 = ef82::1a12:1234:1b12
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV6 – EUI-64
EUI-64 (Extended Unique Identifier) is a method we can use to
automatically configure IPv6 host addresses. An IPv6 device will
use the MAC address of its interface to generate a unique 64-bit
interface ID. However, a MAC address is 48 bit and the interface ID
is 64 bit. What are we going to do with the missing bits
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 Header
•Version: This is a 4-bit field describing the IP type used in the packet.
•Header length: Header length, also called IHL (Internet Header Length), is a 4-bit field that tells us about the
length of the IPv4 header. The size of the IPv4 header is not always the same, which is why this field is used.
•TOS: TOS stands for Type of Service. It is an 8-bit field. This field explains the type of service required for the
packet. The most common type of services is reliability, precedence, throughput, and delay.
•Total Length: It is a 16-bit field that indicates the total size of the packet. The highest value a 16-bit field can store
is 65535, which can be the maximum size of the packet.
•Identification: It is a 16-bit field that tells us about the identification number of a packet. If the data being sent
cannot be sent in one packet, the source device fragments the packet and assigns the pieces the same
identification number so the device which receives the packets can reassemble the fragment to get the entire
data.
•Flag: This is a 3-bit field that enables fragmentation. This first bit in this field is always set to 0. The second bit
explains whether the packet should be fragmented. The last bit indicates whether more fragments are left after
the current fragment.
•Offset: This is known as the fragmentation offset. It is a 13-bit field that determines to which part of the original
packet this fragment belongs.
•TTL: TTL stands for Time to Live. It is an 8-bit field that indicates the amount of time or the number of hops a
packet can have before it is discarded.
•Protocol: This is an 8-bit field that specifies the upper layer protocol. It tells the receiver device how to process
this packet. An example of an upper-layer protocol would be UDP.
•Checksum: This is a 16-bit field. The checksum is calculated at every router hop. It is used to check the validity of
the header. So, if the checksum verification at any router fails, that means the header is corrupted, and so the
packet is discarded.
•Source address: This field is used to specify the 32-bit IP address of the source device.
•Destination address: This field is used to specify the 32-bit IP address of the destination device.
•Options: This is an optional field in the header, and its max size is 40 bytes. It is not commonly used. It can be
used to specify options like the path the packet needs to take.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV6 Header
•Version: This is a 4-bit field that describes the IP type that is being used in the packet.
•Traffic class: This is an 8-bit field. This is similar to the TOS field in the IPv4 header. The first 6-bits
represent the service required for this packet, and the last 2-bits are used for ECN (Explicit
Congestion Notification).
•Flow label: This is a 20-bits field. It is used to label the packets belonging to the same sequence. It's
to ensure that the packets are delivered in order. This field is mainly used to deliver real-time data
such as audio or video. So, this field ensures that they are delivered in order.
•Payload length: This is a 16-bit field that indicates the size of the packet. The highest value a 16-bit
field can store is 65535, which can be the maximum size of the packet. If the packet exceeds that
size, this field is set to 0.
•Next header: This is an 8-bit field that indicates the type of the first extension header, or in some
cases, it just specifies the upper layer protocol, such as UDP or TCP.
•Hop limit: This is the same as the TTL field in the IPv4 header. It indicates the number of hops a
packet can take before being discarded.
•Source address: This field is used to specify the 128-bit IP address of the source device.
•Destination address: This field is used to specify the 128-bit IP address of the destination device.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
IPV4 and IPV6 Comparison
i. IPv4 is 32-bit, whereas IPv6 is 128-bit.
ii. In IPv4, binary bits are separated by a dot (.); IPv6 separates
binary bits by a colon (:).
iii. IPv4 follows the numeric addressing method and IPv6
is alphanumeric/Hexadecimal.
iv. IPv4 offers 12 header fields and IPv6 offers eight header
fields.
v. IPv4 has checksum fields but IPv6 doesn't.
vi. IPv4 supports broadcast address, which is a type of special
address that transmits data packets to every node on the
network. IPv6 doesn't support broadcast, but instead uses a
multicast address.
vii. IPv4 supports Variable Length Subnet Mask, but IPv6
doesn't.
viii. When mapping to media access control addresses, IPv4
uses the Address Resolution Protocol. IPv6 uses the
Neighbor Discovery Protocol
https://www.networkacademy.io/ccna/ipv6/ipv4-vs-ipv6
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
MAC Address
MAC Addresses are unique 48-bit hardware numbers of
a computer that are embedded into a network card
(known as a Network Interface Card) during
manufacturing. The MAC Address is also known as
the Physical Address of a network device. In the IEEE
802 standard, the data link layer is divided into two
sublayers:
Logical Link Control (LLC) Sublayer
Media Access Control (MAC) Sublayer
The MAC address is used by the Media Access Control
(MAC) sublayer of the Data-Link Layer. MAC Address is
worldwide unique since millions of network devices exist
and we need to uniquely identify each.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
MAC Address
Unicast: A Unicast-addressed
frame is only sent out to the
interface leading to a specific
NIC. If the LSB (least
significant bit) of the first octet
of an address is set to zero,
the frame is meant to reach
only one receiving NIC. The
MAC Address of the source
machine is always Unicast.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
MAC Address
Multicast: The multicast address
allows the source to send a frame
to a group of devices. In Layer-2
(Ethernet) Multicast address, the
LSB (least significant bit) of the first
octet of an address is set to one.
IEEE has allocated the address
block 01-80-C2-xx-xx-xx (01-80-
C2-00-00-00 to 01-80-C2-FF-FF-
FF) for group addresses for use by
standard protocols.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
MAC Address
Broadcast: Similar to Network Layer,
Broadcast is also possible on the
underlying layer( Data Link Layer).
Ethernet frames with ones in all bits of
the destination address (FF-FF-FF-FF-
FF-FF) are referred to as the broadcast
addresses. Frames that are destined with
MAC address FF-FF-FF-FF-FF-FF will
reach every computer belonging to that
LAN segment.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
PORT Address
Port is an address of a 16-bit unsigned integer number that ranges
from 0 to 65535. The primary application of a port number is to
transmit the data between a Computer Network and an Application.
Port is just a unique number assigned to every application of a
computer.
Ports are represented by 16-bit numbers. There are 216 port numbers i.e
65536.
They are divided into three categories
1. Well-Known Port Numbers
0 to 1023 are well-known port numbers are as they are used by well-
known protocol services.
These are allocated to server services by the Internet Assigned Numbers
Authority (IANA).
2. Registered Port Numbers
1024 to 49151 are registered port numbers i.e it can be registered to
specific protocols by software corporations.
3. Dynamic Port Numbers
49152 to 65535 are dynamic port numbers and they can be used by
anyone
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk