Download as pdf or txt
Download as pdf or txt
You are on page 1of 72

Chapter 6: Network Layer -

Fundamentals of IP Datagram format and


Addressing

Undergraduate Program
School of Electrical and Computer Engineering
Outlines
• Internet Protocol
• Datagram, Fragmentation
• IPV4 datagram
• IPV6 datagram
• IP addressing
• IPV4 addressing And IPV6 addressing

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 2
Addressing
Internet as a connectionless network

• Communication at the network


layer in the internet is
connectionless
• The internet is made of so many
heterogeneous networks

• Almost impossible to create a


connection from source to
destination without knowing the
nature of the networks in advance

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 3
Addressing
Internet service model

• Quality of service (QoS) Metrices


• Bandwidth, packet loss, data order, and on time delivery

• Internet “best effort” service model


• Doesn’t guarantee all QoS metrices
• Successful datagram delivery to the destination

• Timing or order of the delivery

• Bandwidth available to end-to end flow

• It’s simplicity has allowed internet to be widely deployed

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 4
Addressing
Network Layer
• Responsible for host-to-host delivery
• Source
• Creates a packet from the data coming from upper layer
• Header of the packet contains the logical addresses of the source
and destination plus other information
• Intermediate nodes (routers or switches)
• Forwarding and routing
• Destination
• Address verification
• If the packet is fragmented –reassembles

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 5
Addressing
Network layer Functions
• Encapsulation
• On sending side encapsulates segments into datagrams
• On receiving side, delivers segments to transport layer
• Forwarding (Data plane)
• Local, Per-router function
• Determining how a datagram arriving at input port of router is
forwarded to router’s output port
• Routing (Control plane)
• Network-wide logic
• Determine the route taken by packets from source to destination
(path selection)

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 6
Addressing
The internet Protocol in Network Layer
• Includes a set of rules that embody the idea of unreliable packet
delivery
• defines the basic unit of data transfer and performs the routing function
• is the delivery mechanism used by the TCP/IP protocols

• Provides a packet delivery service which is:


• Connectionless datagram protocol
• A best effort delivery service –no error or flow control (no error detection
on the header)
• Unreliable - If reliability is important, IPv4 must be paired with a reliable
upper layer protocol such as TCP

• Packets in the IP layer are called datagrams

• Two working versions are available (Version 4 and Version 6)

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 7
Addressing
IPV4 Datagram format
20 – 65,536 byte
20 – 60 bytes

Header Payload (Data)

• Version (4 bits): Defines the


version of the IP protocol
(version 4 or 6)
• Header Length (4 bits): the
total length of the datagram
header
• Total length (16 bits): header
plus data
• Header Checksum (16 bits):
An error detecting code,
covers only the header
• Time to Live (TTL) (8 bits):
Used mostly to control the
maximum number of hoops
visited by the datagram

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 8
Addressing
Cont.… (IPV4 Datagram format )
• Source IP address (32 bits): Network (logical address) of the source
station

• Destination IP address (32 bits): Network (logical address) of the


destination station

• Protocol (8 bits): Defines the higher layer protocol that uses the
services of the IPv4 layer Value Protocol
1 ICMP
2 IGMP
6 TCP
17 UDP
46 RSVP
47 GRE
89 OSPF

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 9
Addressing
Cont.… (IPV4 Datagram format )
• Service type (8 bits):
• The name is changed from service type to differentiated services
(DiffServ)
• Service type
• Precedence –defines the priority of the datagram in issues such as
congestion (If a router is congested – discards datagram with lowest
precedence )
• Type of service(ToS)
• Activities requiring immediate attention –minimum delay
• Activities that send bulk data –maximum throughput
• Management activities –maximum reliability

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 10
Addressing
Cont.… (Service)

• Differentiated services
• 6 bits –code point (the last 2 bits are not used)

• When the 3 rightmost bits are 0s –the 3 left most bits are
interpreted the same as the precedence bits

• When the 3 rightmost bits are not 0s –6 bits define 64 services

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 11
Addressing
Cont.… (IPV4 Datagram format )
• Identification (16 bits), flags (3 bits), fragmentation offset (13 bits): use
in fragmentation
• Encapsulation/Decapsulation : Datagrams must move from machine to
machine via physical networks

20 – 65,536 byte
Datagram Header Datagram Data

Frame Header Frame Data

46 – 1500 byte
• What if a datagram won’t fit in a frame?  Fragmentation

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 12
Addressing
Cont.… (Maximum transfer unit)
• Each physical networking technology limits the amount of data that can
fit in a frame
• Ethernet: 1500 Bytes

• FDDI: 4470 Bytes

• This is called the network’s MTU

• Limiting datagrams to fit in the smallest possible MTU would make


travelling across networks with a larger MTU inefficient

• A small packet size can give better network latency and


minimum packet loss

• Allowing datagrams to be larger than a network’s MTU means that


datagrams will not always fit in a single frame

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 13
Addressing
Cont.… (Fragmentation)
• Fragmentation–a process of dividing a datagram into a number of
smaller datagrams
• The maximum length of IPv4 datagram = 65,535 bytes
• When a datagram is encapsulated in a frame, the total size of the
datagram must be less than the maximum size of the data field
• If we use a protocol with a MTU < the packet size –fragmentation is
required

• Each fragment has its own header


• most of the fields repeated, but with some changed

• Fragments
• Can be fragmented by the source or any router in the path
• Reassembled at the destination host

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 14
Addressing
Cont.… (Fragmentation)
• Fields related to fragmentation
• Identification
• Identification + IPv4 address uniquely define
a datagram
• All fragments have the same identification
number
• Helps the destination in reassembling the
datagram
• Flags
• D=1 –the machine must not fragment the
datagram
• D=0 –the datagram can be fragmented if
necessary
• M=0 –the last or only fragment
• M=1 –the datagram is not the last fragment
• Fragmentation offset
• The relative position of this fragment with
respect to the whole datagram

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 15
Addressing
Outlines
• Internet Protocol
• Datagram, Fragmentation
• IPV4 datagram
• IPV6 datagram
• IP addressing
• IPV4 addressing And IPV6 addressing

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 16
Addressing
From IPV4to IPV6
• Limited address space
• Internet population
• ∼630 million users end of 2002 −10% of world pop.
• ∼1320 million users end of 2007 −20% of world pop.
• ∼3400 million users end of 2016 −50% of world pop.
• Doubles every 5 years (approximately)
• Future? (World pop. ∼9B in 2050)

• New service types and concepts


• Multicast
• Quality of services
• Security
• Mobility (MIPV6)

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 17
Addressing
So What has really changed in IPV6?
• Expanded address space
• Address length quadrupled to 16 bytes – hexatets
• 64 bits aligned
• Header Format Simplification
• Fixed length, optional headers are daisy-chained.
• IPv6 header is twice as long (40 bytes) as IPv4 header without
options (20 bytes).
• No checksum at the IP network layer
• Authentication and Privacy Capabilities
• IPsec is mandated
• No more broadcast

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 18
Addressing
IPV6 Datagram format
Up to - 65,536 byte
40 bytes

Base Header Payload (Data)


• Version (4 bits): Defines the
version of the IP protocol (version
4 or 6)
• Traffic class/ priority (4 bits):
priority with respect to congestion
• Flow label(24 bits): provide
special handling for a particular
flow of data
• Payload length (16 bits): the
length of IP datagram (excluding
header)
• Next header (8 bits): the header
that follows the base header
• Hop limit (8 bits): the same as the
time to live field

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 19
Addressing
Cont.… (IPv6 datagram format)
• Priority
• Defines the priority of each packet with
respect to other packets
• Congestion-controlled data are
assigned priorities from 0 to 7
• Background data- e.g. delivery of the
news
• Unattended data – e.g. E-mail
• Attended bulk data – e.g. FTP and
HTTP
• Interactive traffic – e.g., TELNET
• Control traffic - e.g. routing protocols
• Non-congestion-controlled traffic
• Traffic that expects minim delay
• Priority numbers from 8 to 15 are
assigned

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 20
Addressing
Cont.… (IPv6 datagram format)
• Extension headers
• The base header can be followed by up to six extension headers

• Hop by hop: used when the source


need to pass information to all routes
visited by the datagram
• Source routing
• fragmentation: the same as IPv4-but
only the original source can fragment
• Authentication: validates message
sender
• Encryption: guard against
eavesdropping
• Destination option : used when the
source need to pass information to the
destination

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 21
Addressing
Transition from IPv4 to IPv6
• Three strategies are devised to help the
transition

1. Dual stack
• All station must run IPv4 and IPv6
simultaneously
• To determine which version to use –the
source host queries the DNS

2. Tunneling
• Used when two computers using IPV6
want to communicate with each other
and the packet must pass through a
region that uses IPv4
• Entering the region –the IPv6 packet is
encapsulated in an IPv4 packet

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 22
Addressing
Cont.… (Transition from IPv4 to IPv6)
3. Header translation
• The header of IPv6
packet is converted to
an IPv4 header
• Uses the mapped
address

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 23
Addressing
Outlines
• Internet Protocol
• Datagram, Fragmentation
• IP addressing
• IPV4 addressing
• Classful addressing
• Subnetting
• Classless Inter-Domain Routing (CIDR)
• Classless addressing and Variable length subnet Mask (VLSM)
• Network Address Translation (NAT)
• IPV6 addressing

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 24
Addressing
IP Addressing

• An IP address is an logical address used to uniquely


identify a device on an IP network.
• Has to be unique within a LAN for a local connection

• Has to be unique in the world for global connection

• IPV4 (32 bits – decimal format)

• IPV6 (128 bits – Hexadecimal format)

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 25
Addressing
IPV4 Addressing
• IPv4
 32 binary bits are broken into four octets (1 octet = 8 bits)

 Dotted decimal format (for example, 128.11.3.31)

• A logical address contains two


components:
• Network part– Part of an IP address
identifies the network.
• identifies which network a host belongs to.
• Host part – uniquely identifies the host on
that network.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 26
Addressing
Cont.… IPV4 Addressing
• Address blocks
• IP address are granted in the form of block/range of addresses
• Rules
• The addresses in a block must be contiguous
• The number of address must be a power of 2

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 27
Addressing
Network and Broadcast IPV4 Address
• The first address in a block is normally not assigned to any
device - used as the network address

• The last address in a block is normally not assigned to any


device - used as the broadcast address
• The broadcast address identifies all hosts on a particular network.
• A packet sent to the broadcast address will be received and
processed by every host on that network.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 28
Addressing
Subnet Mask
• A subnet mask (netmask) is 32 bit binary number required to provide to
distinguish the number of bits designated for a network:

• The above IP address has a subnet mask of 255.255.0.0.

• The subnet mask follows two rules:


• If a binary bit is set to a 1 (or on) in a subnet mask, the corresponding bit
in the address identifies the network.

• If a binary bit is set to a 0 (or off) in a subnet mask, the corresponding bit
in the address identifies the host.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 29
Addressing
Wild Mask
• A Wild mask (rarely used term) is also 32 bit binary number required to
provide to distinguish the number of bits designated for a host:

• Used in routing protocols like OSPF.

• The above IP address has a wild mask of 0.0.255.255

• The wild mask follows two rules:


• If a binary bit is set to a 0 (or on) in a wild mask, the corresponding bit in
the address identifies the network.

• If a binary bit is set to a 1 (or off) in a wild mask, the corresponding bit in
the address identifies the host.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 30
Addressing
E.g.:
• Given a particular host with an IP address of 158.80.164.3
255.255.0.0
• Looking at the above address and subnet mask in binary:
• IP Address: 10011110.01010000.10100100.00000011
• Subnet Mask: 11111111.11111111.00000000.00000000
• The first 16 bits of the subnet mask are set to 1.
• Thus, the first 16 bits of the address (158.80) identify the network.
• The last 16 bits of the subnet mask are set to 0.
• Thus, the last 16 bits of the address (164.3) identify the unique host
on that network.
• The address block
158.80.0.0 10011110.01010000.00000000.00000000

158.80.255.255 10011110.01010000. 11111111.11111111

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 31
Addressing
Cont.…
158.80.0.0 10011110.01010000.00000000.00000000

158.80.255.255 10011110.01010000. 11111111.11111111

 Getaway

• Network address: 158.80.0.0 subnet mask 255.255.0.0


• Broadcast address : 158.80.255.255
• Host address range : 158.80.0.1 -- 158.80.255.254

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 32
Addressing
Classful Addressing
• It is an earlier approach (outdated) of network addressing
architecture that divided IP addresses into 5 groups.
No of
Max
Address Networ available
Class Example IP number Application
Range k bits address
of ntk
per ntk
Used for large
IP Class A 1 to 126 1.0.0.1 8 128 224
number of hosts.
216 Used for medium
IP Class B 128 to 191 128.1.1.1 16 16384
size network.
28 Used for local area
IP Class C 192 to 223 192.1.11. 24 2097157
network.
Reserve for multi-
IP Class D 224 to 239 NA NA NA
casting.

This class is
IP Class E 240 to 254 NA NA NA
reserved for R&D.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 33
Addressing
Classful IP addressing
• Two-level hierarchy addressing

• E.g.: Class C : 192.168.1.3

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 34
Addressing
Range of Special IP Addresses:
• Range of Special IP Addresses:
• 169.254.0.0 – 169.254.0.16 : Link-local addresses
• 127.0.0.0 – 127.0.0.8 : Loop-back addresses
• 0.0.0.0 – 0.0.0.8: used to communicate within the current network.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 35
Addressing
Limitations of classful IP addressing

• Class boundaries did not encourage efficient allocation of


address space

• Risk of running out of address space soon

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 36
Addressing
Subnetting
• An organization that is granted
a large block of addresses
• Creates multiple logical networks
that exist within a single Class A,
B, or C network.
• Can create cluster of networks –
subnets
• Divide the addresses between
the different subnets
• Three-level of hierarchy in
addressing

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 37
Addressing
Benefits of Subnetting

• Reduced network traffic

• Optimized network performance

• Simplified management

• Facilitated spanning of large geographical distances

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 38
Addressing
Practice Example 1:
An organization is assigned a class C network address of
201.35.2.0. It uses a subnet mask of 255.255.255.192 to
divide this into sub-networks.

• How many subnets does the chosen subnet mask produce?


• Since 192 is 2 bit on (11000000) , the answer would be 22 = 4.

• What are the valid subnets?


• We just start at zero and count to the subnet mask value in blocks
(increments) of 26: 0, 64, 128, 192

• What are the range in each subnets?


• The range of subnet - 1 is: 201.35.2.0 to 201.35.2.63
• The range of subnet - 2 is: 201.35.2.64 to 201.35.2.127
• The range of subnet - 3 is: 201.35.2.128 to 201.35.2.191
• The range of subnet - 4 is: 201.35.2.192 to 201.35.2.255
Sem. II, 2023/24 39
Cont… (Practice Example 1)
• How many valid hosts per subnet are available?
• We have 6 host bits off (11000000), so the equation would be
26 – 2 = 62 hosts.
• Out of 64, 2 id's are used for Subnet id & Direct Broadcast id
• What’s the broadcast address of each subnet?
• The direct Broadcast id of subnet-1 is: 201.35.2.63
• The direct Broadcast id of subnet-2 is: 201.35.2.127
• The direct Broadcast id of subnet-3 is: 201.35.2.191
• The direct Broadcast id of subnet-4 is: 201.35.2.255
.

Sem. II, 2023/24 40


Practice Example 2:

• An organization is assigned a class C network address of


192.168.1.0. It uses a netmask of 255.255.255.128 to
divide this into sub-networks
• How many subnets does the chosen subnet mask produce?

• What are the valid subnets?

• What are the range in each subnets?

• How many valid hosts per subnet are available?

• What’s the broadcast address of each subnet?

Sem. II, 2023/24 41


Classless addressing

• In classful approach
• The choice of IP addresses is limited. Min. no of addresses
assigned to an organization is 256 (class C).

• In addition, how to allocate Ip addresses to small business that


only need 16 addresses? Or household that only needs 2?

• An IPV4 addressing approach with variable-length blocks


that belong to no class
 Classless addressing allows you to use different subnet masks
and create subnets tailored to the number of users in each group.
 This technique is referred to as Variable Length Subnet Masks
(VLSM).
Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 42
Addressing
Classless Inter-Domain Routing (CIDR)
• CIDR is a simplified method of representing a subnet
mask.
• It identifies the number of binary bits set to a 1 (or on) in a
subnet mask, preceded by a slash.

• E.g.: a subnet mask of 255.255.255.240 would be


represented as follows
• In binary:
• 11111111.11111111.11111111.11110000
• The first 28 bits of the above subnet mask are set to 1.
• The CIDR notation for this subnet mask would thus be /28.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 43
Addressing
E.g.:
• A host address of 172.11.3.12 with a subnet mask of
255.255.255.192 would be represented as follows:
• In binary:
• 11111111.11111111.11111111.11000000
• The first 28 bits of the above subnet mask are set to 1.
• The CIDR notation for this subnet mask would thus be /26.

• The host address can be simplified as 172.11.3.12/26

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 44
Addressing
Example
• Given IP Address: 204.15.5.0/24

Sem. II, 2023/24 45


E.g. Cont.… (Subnetting in Classful Addressing)
• Each subnet will have will size
• 5 sub networks
• 3 bits used as subnet prefix

• Can be assigned as follows:


• netA: 204.15.5.0/27 host address
range 1 to 30
• netB: 204.15.5.32/27 host address
range 33 to 62
• netC: 204.15.5.64/27 host address
range 65 to 94
• netD: 204.15.5.96/27 host address
range 97 to 126
• netE: 204.15.5.128/27 host address
range 129 to 158
• Addresses are wasted

Sem. II, 2023/24 46


Variable Length Subnet Masks (VLSM)

• Divides an IP network into subnets with different subnet


masks.

• Benefits:
• Allows efficient use of address space

• Breaks up an address block into smaller custom blocks

• Allows for route summarization

• Provides more flexibility in network design

• Supports hierarchical enterprise networks

Sem. II, 2023/24 47


E.g. Cont.… (VLSM)

• Given the same network and requirements as in Sample


Exercise 1 develop a subnetting scheme using VLSM,
given:
• netA: must support 14 hosts

• netB: must support 28 hosts

• netC: must support 2 hosts

• netD: must support 7 hosts

• netE: must support 28 host

Sem. II, 2023/24 48


Cont..
• We can find the new masks by using the following
arguments starting from the largest host number:

• The network with max. number of user = 28 (NetB)


• Add two addresses for network and broadcast = 28 + 2 = 32 can be
represented by 5 host bits
• The mask for the first subnet is 32 − 5 = 27

• For NetB, the address 204.15.5.0/27 (255.255.255.224) can give


us the range of addresses
• 204.15.5.0/27 → 204.15.5.0 -- 204.15.5.31
• Network (Subnet) address: 204.15.5.0/27
• Broadcast address : 204.15.5.31/27
• Useful host (or interface) address range : (30 host addresses)
204.15.5.1 − 204.15.5.30

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 49
Addressing
Cont..
• The network with next max. number of user = 28 (NetE)
• Add two addresses for network and broadcast = 28 + 2 = 32 can be
represented by 5 host bits
• The mask for the first subnet is 32 − 5 = 27

• For NetE, the address 204.15.5.32/27 (255.255.255.224) can give


us the range of addresses
• 204.15.5.32/27 → 204.15.5.32 -- 204.15.5.63
• Network (Subnet) address: 204.15.5.32/27
• Broadcast address : 204.15.5.63/27
• Useful host (or interface) address range : (30 host addresses)
204.15.5. 33 − 204.15.5.62

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 50
Addressing
Cont..
• The network with next max. number of user = 14 (NetA)
• Add two addresses for network and broadcast = 14 + 2 = 16 can be
represented by 4 host bits

• The mask for the first subnet is 32 − 4 = 28

• For NetA, the address 204.15.5.64/28 (255.255.255.240) can give


us the range of addresses
• 204.15.5.64/28 → 204.15.5.64 -- 204.15.5.79

• Network (Subnet) address: 204.15.5.64/28

• Broadcast address : 204.15.5.79/28

• Useful host (or interface) address range : (14 host addresses)


204.15.5. 65 − 204.15.5.78

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 51
Addressing
Cont..
• The network with next max. number of user = 7 (NetD)
• Add two addresses for network and broadcast = 7 + 2 = 9 can be
represented by 4 host bits

• The mask for the first subnet is 32 − 4 = 28

• For NetD, the address 204.15.5.80/28 (255.255.255.240) can give


us the range of addresses
• 204.15.5.80/28 → 204.15.5.80 -- 204.15.5.95

• Network (Subnet) address: 204.15.5.80/28

• Broadcast address : 204.15.5.95/28

• Useful host (or interface) address range : (14 host addresses)


204.15.5. 81 − 204.15.5.94

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 52
Addressing
Cont..
• The network with next max. number of user = 2 (NetC)
• Add two addresses for network and broadcast = 2 + 2 = 4 can be
represented by 2 host bits

• The mask for the first subnet is 32 − 2 = 30

• For NetC, the address 204.15.5.96/30 (255.255.255.252) can give


us the range of addresses
• 204.15.5.96/30 → 204.15.5.96 -- 204.15.5.99

• Network (Subnet) address: 204.15.5.96/28

• Broadcast address : 204.15.5.99/28

• Useful host (or interface) address range : (2 host addresses)


204.15.5. 97 − 204.15.5.98

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 53
Addressing
E.g. Cont.… (VLSM)
• The easiest way to assign the subnets is to assign the largest first. For
example, you can assign in this manner:
• netB: 204.15.5.0/27 host
address range 1 to 30

• netE: 204.15.5.32/27 host


address range 33 to 62

• netA: 204.15.5.64/28 host


address range 65 to 78

• netD: 204.15.5.80/28 host


address range 81 to 94

• netC: 204.15.5.96/30 host


address range 97 to 98

Sem. II, 2023/24 54


Practical EX 2:
• As an example, suppose an organization is given the block
17.12.40.0/26, which contains 64 addresses. The organization has
three offices and needs to divide the addresses into three subblocks of
28, 10, and 8 addresses.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 55
Addressing
Cont.…
• Answer:
• In subnet 1, the address 17.12.14.0/27 can give us the subnet
address
• In subnet 2, the address 17.12.14.32/28 can give us the subnet
address
• In subnet 3, the address 17.12.14.48/28 can give us the subnet
address

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 56
Addressing
Limitations of classful IP addressing

• Class boundaries did not encourage efficient allocation of


address space

• Risk of running out of address space soon

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 57
Addressing
Address allocation
• Internet Assigned Numbers Authority (IANA), a department
with in Internet cooperation for Assigned Names and
Numbers (ICANN) - a global authority responsible for
address allocation
• Allocate addresses to ISPs
• An ISP in turn divides its assigned block into subblocks and grants
to its customers

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 58
Addressing
Network Address Translation (NAT)
• Public address
• A Unique network address can be routed on the Internet.
• Hosts that must be Internet-accessible must be configured with (or
reachable by) public addresses.
• Allocation of public addresses is governed by the IANA.

• Ever increasing internet users – shortage of addresses


• Solution: A use of private addresses that can be repeated by different
organizations

• Private address
• is intended for internal use within a home or organization, and can be
freely used by anyone.
• Private addresses can never be routed on the Internet.
• Internet routers are configured to immediately drop traffic with private
addresses.

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 59
Addressing
Cont.…(Network Address Translation (NAT))
• If hosts with private IP wants to access the internet?
• NAT: translation of on IP address into another IP address
• enables a user to have a large set of addresses internally and one
or small set of addresses externally

• Private addresses
• Can be used without permission from the ISPs
• Unique inside an organization but not globally

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 60
Addressing
Address translation
• All the outgoing and incoming packets go through the NAT
router
• Outgoing – replaces the source address with the global NAT
address
• Incoming – replaces the destination address in the packet with the
appropriate private address

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 61
Addressing
Cont.… (Address translation)
• How does a NAT router know the destination address of
the incoming packets?
• Translation table
• Using one global IP address

• Communication must always


be initiated by the private
network
• Only one private network
host can access the same
external host

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 62
Addressing
Outlines
• Internet Protocol
• Datagram, Fragmentation
• IP addressing
• IPV4 addressing
• Classful addressing
• Subnetting
• Classless Inter-Domain Routing (CIDR)
• Classless addressing and Variable length subnet Mask (VLSM)
• Network Address Translation (NAT)
• IPV6 addressing (Extra)

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 64
Addressing
IPv6 Address Representation
• Length - 16 bytes/128 bits
• Hexadecimal colon notation
• The 128 bits are divided into eight sections – each 2 bytes long

• Address abbreviation
• Successive fields of 0 represented as ::, but only once in an
address:

Sem. II, 2023/24 65


Cont.…

• Successive fields of 0 represented as ::, but only once in


an address:
• 2031:0:130F::9C0:876A:130B is OK!
• 2031::130F::9C0:876A:130B is NOT OK!
• 0:0:0:0:0:0:0:1 → ::1 (loopback address)
• 0:0:0:0:0:0:0:0 → :: (unspecified address)

• :: representation
• RFC5952 recommends that the rightmost set of :0: be replaced
with :: for consistency
• 2001:db8:0:2f::5 rather than 2001:db8::2f:0:0:0:5

Sem. II, 2023/24 66


Cont..

• Prefix Representation for network and host addresses


• Representation of prefix is just like IPv4 CIDR

• In this representation you attach the prefix length like IPv4


address:
• 198.10.0.0/16

• IPv6 address is represented in the same way:


• 2001:db8:12::/40

Sem. II, 2023/24 67


Cont.….
• Address space
• 2128 addresses
• 3.4 × 1038 possible
addressable devices
• 5 × 1028 addresses
per person on the
planet

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 68
Addressing
IPV6 addressing
• Unicast addresses
• Geographical and provider based

/32 /48 /64

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 69
Addressing
Cont.… (Unicast addresses )

• 64 bits reserved for the interface/node ID


• Possibility of 264 hosts on one network LAN

• In theory 18,446,744,073,709,551,616 hosts

• 16 bits reserved for the end site


• Possibility of 216 networks at each end-site

• 65536 subnets equivalent to a /12 in IPv4 (assuming a /28 or 16


hosts per IPv4 subnet)

Sem. II, 2023/24 70


Cont… (Unicast addresses )

• Lowest order 64-bit field of unicast address may be


assigned in several different ways:

• SLAAC (Stateless Address Autoconfiguration)


• Auto-configured from a 64-bit EUI-64, or expanded from a 48-bit MAC
address (e.g., Ethernet address)

• Auto-generated pseudo-random number (to address privacy


concerns)

• Assigned via DHCP (Dynamic host configuration protocol)

• Manually configured

Sem. II, 2023/24 71


Cont.…. (IPV6 addressing)
• Multicast addresses
• Used to define a group of hosts

• Anycast addresses
• Defines group of nodes
• The packet destined to anycast address is delivered to one of the
member of the multicast group – the nearest one

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 72
Addressing
Cont.…
• Reserved addresses
• Unspecified address – when the host does not know its own
address and send an inquiry to find its address
• Loopback address – used by a host to test itself
• A compatible address – used when a host using IPv6 want to send
a message to another computer using IPv6 , but the message
needs to pass through IPv4 network
• A mapped address – used when a computer that uses IPv6 want to
send a packet to a host using IPv4

Sem. II, 2023/24 Data communication and Computer networks - Ch. 6 –Network Layer 73
Addressing

You might also like