Professional Documents
Culture Documents
Computer-NetworksII W 21
Computer-NetworksII W 21
NETWORK LAYER
Safwan Mawlood
Safwan Mawlood
Objectives
What will I learn to do in this module?
1. Addressing
End devices must be configured with
a unique IP address for identification
on the network.
Encapsulation
The network layer encapsulates the protocol data unit
(PDU) from the transport layer into a packet. The
encapsulation process adds IP header information,
such as the IP address of the source (sending) and
destination (receiving) hosts. The encapsulation
process is performed by the source of the IP packet.
3. Routing
The network layer provides services to direct the packets to a
destination host on another network. To travel to other networks,
the packet must be processed by a router.
The role of the router is to select the best path and direct packets
toward the destination host in a process known as routing.
4. Decapsulation
When the packet arrives at the network layer of the
destination host, the host checks the IP header of the
packet. If the destination IP address within the header
matches its own IP address, the IP header is removed
from the packet. After the packet is de-encapsulated
by the network layer, the resulting Layer 4 PDU is
passed up to the appropriate service at the transport
layer. The de-encapsulation process is performed by
the destination host of the IP packet.
10
Internet Protocol version 4 (IPv4) –Is the host-to-host delivers protocol for the Internet.
IP is an unreliable and connectionless. IP Not provide error control or flow control. IP
needs a protocol called ARP to find the MAC address of the next hop.
Internet Protocol version 6 (IPv6) -IPv6 also known as IPng (Internetworking Protocol,
next generation), was proposed and is now a standard. In IPv6, the Internet protocol
was extensively modified to accommodate the unforeseen growth of the Internet. The
format and the length of the IP address were changed along with the packet format.
Related protocols, such as ICMP,
IP is Best Effort
• IP will not guarantee delivery of the
packet.
• IP has reduced overhead since there is
no mechanism to resend data that is
not received.
• IP does not expect acknowledgments.
• IP does not know if the other device is
operational or if it received the packet.
Network Layer Characteristics
Media Independent
IP is unreliable:
It cannot manage or fix undelivered or
corrupt packets.
IP cannot retransmit after an error.
IP cannot realign out of sequence
packets.
IP must rely on other protocols for these
functions.
IP is media Independent:
IP does not concern itself with the type
of frame required at the data link layer
or the media type at the physical layer.
IP can be sent over any media type:
copper, fiber, or wireless.
IP datagram
The IPv4 packet header is used to ensure that this packet is delivered to its next
stop on the way to its destination end device.
Header: is 20-60 bytes in the length and contains information essential to the
touting and delivery.
Header length (HLEN). This 4-bit field defines the total length of the datagram header in 4-byte words. This field is needed because the length of the header is
variable (between 20 and 60 bytes). When there are no options, the header length is 20 bytes.
Time-to-Live: Demo
As the number of hosts on the network grows, more planning is required to manage and
address the network.
Rather than having all hosts everywhere connected to one vast global
network, it is more practical and manageable to group hosts into smaller
networks.
These smaller networks are often called subnetworks or subnets.
3. Address Management:
A protocol such as IPv4 that defines addresses has an address space. An address
space is the total number of addresses used by the protocol. If a protocol uses N
bits to define an address, the address space is 2N because each bit can have two
different values (0 or 1) and N bits can have 2 N values.
A company that wishes to have network hosts accessible from the Internet must have
a block of public addresses assigned.
These registration companies are called Regional Internet Registries (RIRs). There
are 5 RIRs:
AfriNIC (African Network Information Centre) - Africa Region http://www.afrinic.net
APNIC (Asia Pacific Network Information Centre) - Asia/Pacific Region
http://www.apnic.net
ARIN (American Registry for Internet Numbers) - North America Region http://www.arin.net
LACNIC (Regional Latin-American and Caribbean IP Address Registry) - Latin America and
some Caribbean Islands http://www.lacnic.net
RIPE NCC (Reseaux IP Europeans) - Europe, the Middle East, and Central Asia
http://www.ripe.net
12/06/2022 Safwan Mawlood 30
ISPs
1. Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often
referred to as a byte. So it is common to hear an IPv4 address referred to as a 32-
bit address or a 4-byte address. The following is an example of an IPv4 address in
binary notation:
To make the IPv4 address more compact and easier to read, Internet addresses are
usually written in decimal form with a decimal point (dot) separating the bytes. The
following is the dotted-decimal notation of the above address:
192.168.1.10
Network Portions
For each IPv4 address, some portion of the high-order bits represents the network address.
At Layer 3, we define a network as a group of hosts that have identical bit patterns in the network address
portion of their addresses.
Host Portions
The number of bits used in this host portion determines the number of hosts that we can have within the network.
For example, if we need to have at least 200 hosts in a particular network, we would need to use enough bits in
the host portion to be able to represent at least 200 different bit patterns.
To assign a unique address to 200 hosts, we would use the entire last octet. With 8 bits, a total of 256 different
bit patterns can be achieved. This would mean that the bits for the upper three octets would represent the
network portion.
Broadcast Address
The IPv4 broadcast address is a special address that
allows communication to all the hosts in that network.
The broadcast address uses the highest address in the
network range.
This is the address in which the bits in the host portion are
all 1s.
For the network 10.0.0.0 /24 the broadcast address
would be 10.0.0.255.
This address is also referred to as the directed broadcast.
Host Addresses
we assign the values between the network address and
the broadcast address to the devices in that network.
There are special addresses that can be assigned to hosts but with restrictions.
Default Route
The default route as 0.0.0.0.
The default route is used when a specific route is not available.
This also cover all addresses in the 0.0.0.0 - 0.255.255.255.
Public Addresses
The majority of the addresses are public addresses.
These addresses are designed to be used in the hosts that are publicly accessible
from the Internet.
Private addresses
There are blocks of addresses that require no Internet access.
10.0.0.0 to 10.255.255.255 (10.0.0.0 /8)
172.16.0.0 to 172.31.255.255 (172.16.0.0 /12)
192.168.0.0 to 192.168.255.255 (192.168.0.0 /16)
Hosts in different networks may use the same private addresses.
The hosts in the private networks use IP addresses that are
unique within their networking environment.
Classless Addressing
The system that we currently use is referred to as classless
addressing.
With the classless system, address blocks appropriate to the
number of hosts are assigned to companies or organizations
without regard to the unicast class.
The allocation of these addresses inside the networks should be planned and documented
for the purpose of:
Preventing duplication of addresses
Each host in an internetwork must have a unique address.
Providing and controlling access
For example, if a server has a random address assigned, blocking access to its address is difficult and clients
may not be able to locate this resource.
Monitoring security and performance
If we have proper planning and documentation of the network addressing, we can identify the device on the
network that has a problematic address.
Within a network, there are different types of hosts. Some examples of different types of
hosts are:
End devices for users
Servers and peripherals
Hosts that are accessible from the Internet
Intermediary devices
Each of these different device types should be allocated to a logical block of addresses
within the address range of the network.
12/06/2022 Safwan Mawlood 46
Static Address for End User Devices
Although the length of the netid and hostid (in bits) is predetermined in classful
addressing, we can also use a mask (also called the default mask)
IP address
172.16.20.35
10101100.00010000.00010100.00100011
subnet mask
255.255.255.224
11111111.11111111.11111111.11100000
network address
172.16.20.32
10101100.00010000.00010100.00100000