Addressing
Addressing
Addressing in networked devices plays a crucial role in
ensuring the delivery of packets to the designated/intended
receivers.
The addressing scheme is synonymous with postal
addresses used in real-life scenarios.
Addressing mechanisms can be divided into two parts:
Data link layer addressing,
Network layer addressing.
Data link layer addressing
Data link layer addressing deals with media access control
(MAC) addresses of devices, which work at the MAC sub-
layer of the data link layer.
Data link layer addressing handles the host/device network
interface of physical addresses.
These physical addresses are also known as MAC addresses.
MAC addresses are 48-bits long; the first 24 bits are
organizational identifiers, while the last 24 bits are network
interface controller identifiers.
These addresses are unique globally.
Data link layer addressing is broadly divided into three types:
1) Unicast,
2) Multicast, and
3) Broadcast
(i) Unicast: This addressing is meant for one-to-one
communication. The data flow from a transmitting host is
restricted to only one receiving host in the link.
(ii) Multicast: This addressing is meant for one-to-many
communication within a single link. The data flow from a
transmitting host is intended for multiple hosts within the
same link. It is to be noted that more than one host can
transmit data streams, which are designed for multiple
receiving hosts in the link.
(iii) Broadcast: This addressing is meant for one-to-all
communication within a link. The data from a transmitting
host is received by all other hosts connected to that link.
Network layer addressing
• Network layer addressing is also termed as IP-based
addressing or logical addressing.
• IPv4 addressing uses 32-bits long addresses, whereas IPv6
uses addresses that are 128 bits long.
• These addresses can identify the source or destination
addresses from the address itself.
• The mapping of a device/host’s logical address to its
hardware address is done through a mechanism called
Address Resolution Protocol (ARP).
• During transmission of a packet from a host, the IPv4
sends an IPv4 packet, the nexthop address, and the next-
hop interface to the ARP.
Direct delivery is performed by the ARP if the destination
address for delivery matches the next-hop address.
In contrast, if the addresses do not match, the ARP performs
an indirect delivery by forwarding the packet to a router or
an intermediate node.
The resolution of the mapping of a packet’s next-hop
address to its MAC address is made using broadcasting
ARP requests.
The returning ARP reply frame to the sender contains the
MAC address corresponding to the packet’s next-hop
address.
In the context of addressing, we will discuss the structure
of IPv4 and IPv6 packets.
IPv4: The IPv4 header packet shown in Figure has 13
distinct fields, the functions of which are enumerated as
follows.
IPv4 packet
header structure
• VER: It is 4 bits long and represents the version of IP. In the
example given in Figure, it is 4 bits (binary: 0100).
• HLEN: It is 4 bits long and denotes the length of the IPv4 packet
header.
• ToS: It is 8 bits long. The first six most significant bits represent
the differentiated services code point (DSCP) to be provided to
this packet (by the routers).
• Explicit congestion notification (ECN), which gives information
about the congestion witnessed in the network, is handled by the
last 2 bits.
• TOTAL LENGTH: It is 16 bits long and identifies the length of
the entire IPv4 packet, including the header and the payload.
• IDENTIFIER: It is 16 bits long and used to identify the original
packets in case of packet fragmentation along the network.
• FLAGS: It is a 3-bit field with the most significant bit always set
to 0. FLAGS indicates whether a packet can be fragmented or not in
case the packet is too big for the network resources.
• FRAGMENT OFFSET: It identifies the exact offset or fragment
position of the original IP packet and is 13 bits long.
• TTL(Time To Live): It is 8 bits long and prevents a packet from
looping infinitely in the network. As it completes a link, its value is
decremented by one.
PROTOCOL: It is 8 bits long. This field identifies the protocol of the
packet as user datagram protocol, UDP (17), transmission control
protocol, TCP (6), or Internet control message protocol, ICMP (1).
The identification is made at the network layer of the destination host.
• HEADER CHECKSUM: It is 16 bits long and used for identifying
whether a packet is error-free or not.
• SOURCE ADDRESS: It indicates the origin address of the packet
and is 32 bits long.
• DESTINATION ADDRESS: It indicates the destination address of
the packet and is 32 bits long.
• OPTIONS and PADDING: It is an optional field, which may carry
values for security, time stamps, route records, and others.
IPv6: The IPv6 header packet shown in Figure has eight distinct fields,
the functions of which are enumerated as follows.
• VER: It is 4 bits long and represents the version of IP.
In the example given in Figure below, it is 6 (binary: 0110).
IPv6
packet
header
structure
• TRAFFIC CLASS: It is 8 bits long. The first six most significant
bits represent the type of service to be provided to this packet (by
the routers); explicit congestion notification (ECN) is handled by
the last 2 bits.
• FLOW LABEL: It is 20 bits long and designed for streaming media
or realtime data. The FLOW LABEL allows for information flow
ordering; it also avoids packet resequencing.
• PAYLOAD LENGTH: It is 16 bits long and provides a router with
information about a packet’s payload length or the amount of data
contained in the packet’s payload.
• NEXT HEADER: It is 8 bits long and informs the router about the
type of extension header the packet is carrying.
Some of the extension headers and their corresponding values are as
follows:
Hop-by-hop options header (0),
routing header (43),
fragment header (44),
destination options header (60),
authentication header (51), and
encapsulating security payload header (50).
In case an extension header is absent, it represents the upper layer
protocol data units (PDUs).
• HOP LIMIT: It is 8 bits long and prevents a packet from looping
infinitely in the network. As it completes a link, the limit’s value
is decremented by one.
• SOURCE ADDRESS: It is 128 bits long and indicates the origin
address of the packet.
• DESTINATION ADDRESS: It is 128 bits long and indicates the
destination address of the packet.