ch20 Network Layer - IP Protocal 25 nov

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 69

Network Layer:

Internet Protocol
Links between two hosts
Internetworking, connecting networks together to make an
internetwork or an internet.

20.2
Network layer in an internetwork

20.3
Functioning of Network layer at the Source, Router, and Destination

20.4
Functioning of Network layer at the Source, Router, and Destination
(continued)

20.5
Internet Protocol (IPv4)

An unreliable and connectionless datagram;


A protocol that support - a best-effort delivery service.
The term best-effort means that IPv4 provides no error
control or flow control (except for error detection on the
header).
IPv4 assumes the unreliability of the underlying layers
and does its best to get a transmission through to its
destination, but with no guarantees.

22.6
Position of IPv4 in TCP/IP protocol suite

20.7
Internet Protocol (IPv4) Header Format

An if reliability is important, IPv4 must be paired with a


reliable protocol such as TCP.
A datagram is a variable-length packet consisting of two
parts: header and data.
The size of a datagram is 20 to 65536 bytes.
The header is 20 to 60 bytes in length and contains
information essential to routing and delivery.

22.8
IPv4 datagram format

20.9
Internet Protocol (IPv4) Header Format

A datagram header contains 13 fields.


1.Version (ver) :
4 bit long;
Define the version of IP protocol handling S/W
2.Header length (HLEN):
4 bit long;
Since size of IP datagram header is variable ;
It define size of header in datagram.
A 1 bit value increases 4 bytes size of header.

22.10
Internet Protocol (IPv4) Header Format

3.Service
8 bits long;
called differentiated services.
Specify the services provide to this
datagram;
Define the version of IP protocol
handling S/W;
Subfields – precedence (3 bits)
define priority, TOS ( 4bits) ; (DTRC)

22.11
Internet Protocol (IPv4) Header Format

4.Total length
4.16 bits long;
5.Specify the size of datagram ( header + data) ;
5.Identification
16 bits long;
Having same identification number for all datagram
packets belong to one message.
It helps the destinations to reassemble the packets of
same message.

22.12
Internet Protocol (IPv4) Header Format

6.Flags
3 bits long field;
Specify the more packets of belongs to same message
exist or not.
First bit is reserved; second and third bit is set to
having more fragments or not.

22.13
Internet Protocol (IPv4) Header Format

7.Fragmentation Offset
13 bits long; Specify the offset /position of the
datagram in whole message;
Offset is measured in units of 8 bytes.
8.Time to Live
8 bits long; Specify the lifetime of a datagram ;
Applying in forwarding the datagram during routing;
Reduce TOL value by each router;
Not Forwarded when it hits to zero.

22.14
Internet Protocol (IPv4) Header Format

9.Protocol
8 bit field
Defines the higher level protocol that uses it.

22.15
Internet Protocol (IPv4) Header Format

10.Header checksum
16-bit field used for error control;
Only responsible of error handling for header only,
not data part.
11.Source IP Address
12.Destinations IP Address

22.16
Internet Protocol (IPv4) Header Format

13.Options
0 to 40 (max) bytes variable size optional field;
Options, as the name implies, are not required for a
datagram.
They can be used for network testing and debugging.
 Although options are not a required part of the IPv4
header, option processing is required of the IPv4 software.

22.17
Taxonomy of options in IPv4

20.18
Fragmentation in Network Layer

 A datagram can travel through different networks.


 Each router de-capsulates the IPv4 datagram from the frame it
receives, processes it, and then encapsulates it in another frame.
 The format and size of the received frame depend on the data link
layer protocol used by the network through which the frame has
just traveled.
 The format and size of the sent frame depend on the protocol used
by the out going physical network.

22.19
Fragmentation in Network Layer

 For example, if a router connects a LAN to a WAN, it receives a


frame in the LAN format and sends a frame in the WAN format.
 A datagram can travel through different networks.
 Each data link layer protocol has its own frame format.
 One of the fields defined in the format is the maximum size of the
data field.
 In other words, when a datagram is encapsulated in a frame, the
total size of the datagram must be less than this maximum size.

22.20
Maximum transfer unit (MTU) in Frames
of Data Link layer Protocol

 So for the outgoing physical networks, we must divide the


datagram to make it possible to pass through these networks.
This is called fragmentation.

20.21
Maximum transfer unit (MTU) in Frames
of Data Link layer Protocol for some networks

20.22
Fragmentation in Network Layer

 The source usually does not fragment the IPv4 packet.


 The transport layer will instead segment the data into a size that can
be accommodated by IPv4 and the data link layer in use.
 When a datagram is fragmented, each fragment has its own header
with most of the fields repeated, but with some changed.
 a datagram can be fragmented several times before it reaches the
final destination.
 In IPv4, a datagram can be fragmented by the source host or any
router in the path.

22.23
Fragmentation in Network Layer

 The reassembly of the datagram, however, is done only by the


destination host because each fragment becomes an independent
datagram and can travel through different routes.
 All the fragments belonging to the same datagram should finally
arrive at the destination host.
 So it is logical to do the reassembly at the final destination.
 When a datagram is fragmented, required parts of the header must
be copied by all fragments.
 The option field may or may not be copied.

22.24
Fragmentation in Network Layer

 During fragmentation, The host or router must change the values


of three fields of a datagram :
I. Flags,
II. Fragmentation offset, and
III. Total length.
 The rest of the fields must be copied.
 The checksum must be recalculated regardless of fragmentation.

22.25
Fragmentation in Network Layer

 1. Identification: This 16-bit field identifies a datagram originating


from the source host.
 The combination of the identification and source IPv4 address must
uniquely define a datagram as it leaves the source host.
 When a datagram is fragmented, the value in the identification field is
copied to all fragments to make all fragments have the same
identification number the same as the original datagram.
 The identification number helps the destination in reassembling the
datagram. It knows that all fragments having the same identification
value must be assembled into one datagram.

22.26
Fragmentation in Network Layer

2. Flags:
 This is a 3-bit field (0DM).
The first bit is reserved.
The second bit is called the do notfragment bit. If its value is 1, the
machine must not fragment the datagram.
If its value is 0, the datagram can be fragmented if necessary.
The third bit is called the more fragment bit.
If its value is 1, it means the datagram is not the last fragment;
there are more fragments after this one.
If its value is 0, it means this is the last or only fragment.

22.27
Fragmentation in Network Layer

3. Fragmentation Offset:
13-bit field shows the relative position of this fragment with respect to
the whole datagram.
The value of the offset of the data in the original datagram measured
in units of 8 bytes.
Since the length of the offset field is only 13 bits and cannot represent
a sequence of bytes greater than 8191 (1111111111111).
This forces hosts or routers that fragment datagrams to choose a
fragment size so that the first byte number is divisible by 8.

22.28
Fragmentation Example

20.29
Detailed fragmentation example

20.30
Fragmentation in Network Layer

Checksum:
The checksum in the IPv4 packet covers only the header, not the
data.
The header of the IPv4 packet changes with each visited router,
but the data do not.
So the checksum includes only the part that has changed.
If the data were included, each router must recalculate the
checksum for the whole packet, which means an increase in
processing time.

22.31
Demerits of Internet Protocol (IPv4)

Although IPv4 is well designed, but it has some


deficiencies that make it unsuitable for the fast-growing
Internet. Some problems of it are –
Address depletion : Despite all short-term solutions, such
as subnetting, classless addressing, and NAT, address
depletion is still a long-term problem in the Internet.
Unsuitable for real-time audio and video transmission:
Requires minimum delay strategies and reservation of
resources.

22.32
Demerits of Internet Protocol (IPv4)

No encryption or authentication: The Internet must


accommodate encryption and authentication of data for some
applications. No encryption or authentication is provided by
IPv4.

22.33
Internet Protocol (IPv6)

To overcome these deficiencies, IPv6 (Internetworking


Protocol, version 6), also known as IPng (Internetworking
Protocol, next generation), was proposed.
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.

22.34
Internet Protocol (IPv6)

Related protocols, such as ICMP, were also modified.


Other protocols in the network layer, such as ARP, RARP, and
IGMP, were either deleted or included in the ICMPv6
protocol.
Routing protocols, such as RIP and OSPF were also
slightly modified to accommodate these changes.

22.35
Internet Protocol (IPv6) Header Format

An IPv6 datagram is a variable-length packet consisting


of two parts: header and data.
The size of a packet may be 40 to 65536 bytes including
data and header part.
The datagram is divided into three parts –
1.40 bytes long Base header,
2.variable size header extension and
3.Data.

22.36
IPv6 datagram header and payload

20.37
Format of an IPv6 datagram

20.38
Internet Protocol (IPv6) Base Header Format

A IPv6 datagram base header (mandatory part ) contains 8


fields.
1.Version (ver) :
4 bit long; Define the version of IP protocol handling
S/W
2.Priority:
4 bit long;
Define the priority of each packet.
Priority of packet decides the treatment of packet in
congestion- controlled and noncongestion-controlled traffic.
22.39
Internet Protocol (IPv6) Base Header Format

3.Flow label :
24 bit (3 bytes) long;
A sequence of packets, that needs special handling by
routers is called a flow of packets.
The combination of the source address and the value of
the flow label uniquely defines a flow of packets.
To a router, a flow is a sequence of packets that share the
same characteristics, such as traveling the same path, using the
same resources, having the same kind of security, and so on.

22.40
Internet Protocol (IPv6) Base Header Format

4.Payload length :
16 bits (2 bytes) long field;
Define the size of IP packet excluding the base header.
5.Next header :
8 –bits field defining the header that follows the base
header.
Optional part
Each extension header also contains this field.

22.41
Next header codes for IPv6

20.42
Internet Protocol (IPv6) Base Header Format

6.Hop Limit :
8 bits (1 bytes) long field; work as the same as Time to
Live in IPv4.
7.Source address :
16 Bytes IPv6 address of sender station.
8.Destination Address :
16 Bytes IPv6 address of receiver station.

22.43
Advantage of Internet Protocol (IPv6)

Larger address space :


Better header format :
IPv6 uses a new header format in which options are
separated from the base header and inserted, when needed,
between the base header and the upper-layer data.
 New options:
 Allowance for extension : designed to allow the extension
of the protocol if required by new technologies or applications.

22.44
Advantage of Internet Protocol (IPv6)

Support for resource allocation : In IPv6, the type-of-service


field has been removed, but a mechanism (called jlow label) has
been added to enable the source to request special handling of the
packet. This mechanism can be used to support traffic such as
real-time audio and video.
Support for more security: The encryption and
authentication options in IPv6 provide confidentiality and
integrity of the packet.

22.45
Comparison between IPv4 and IPv6 packet headers

20.46
TRANSITION FROM IPV4 TO IPV6

Because of the huge number of systems on the Internet,


the transition from IPv4 to IPv6 cannot happen suddenly. It
takes a considerable amount of time before every system in
the Internet can move from IPv4 to IPv6. Three methods :

1. Dual Stack
2. Tunneling
3. Header Translation

22.47
Three transition strategies

20.48
Dual stack

Every router runs S/W


for both IPv4 and IPv6.
Treat a datagram
according to the respond
obtained from DNS (Type of
IP address)

20.49
Tunneling Strategy

When sender and receiver both using IPv6;


The packet must pass through a region that uses IPv4.
To pass through this region, the packet must have an
IPv4 address.
So the IPv6 packet is encapsulated in an IPv4 packet
when it enters the region, and it leaves its capsule when it exits
the region.

20.50
Tunneling strategy

20.51
Header translation strategy

When sender using IPv6 while receiver IPv4;


Header translation is necessary when the majority of the
Internet has moved to IPv6 but some systems still use IPv4.
 The sender wants to use IPv6, but the receiver does not
understand IPv6.
In this case, the header format must be totally changed
through header translation. The header of the IPv6 packet is
converted to an IPv4 header.

20.52
Header translation strategy

20.53
Header translation

20.54
Address Mapping

The delivery of a packet to a host or a router requires two


levels of addressing: logical and physical.
We need to be able to map a logical address to its
corresponding physical address and vice versa. This can be done
by using either static or dynamic mapping.

22.55
Mapping Logical to Physical Address

The delivery of a packet to a host or a router requires two


levels of addressing:
Logical ( IP Address )and
Physical (NIC address).
In the network a host/ router is recognize by its IP Address.
While within a network/ LAN physical address is used to
send/deliver the message.

22.56
Address Resolution Protocol: ARP

ARP is used to map a logical address of a host / router to its


physical address.
It is required when a router has the IP address of host, but it
does not have its physical address.
The steps are :
The host or the router sends an ARP query packet
providing the IP addresses of the host.
the query is broadcast over the network.

22.57
Address Resolution Protocol: ARP

Every host or router on the network receives and


processes the ARP query packet, but only the intended
recipient recognizes its IP address and sends back an ARP
response packet.
The response packet contains the recipient's IP and
physical addresses.
The packet is unicast directly to the inquirer by using the
physical address received in the query packet.

22.58
ARP operation

21.59
Four cases using ARP

21.60
Reverse Address Resolution Protocol: RARP

RARP is used to map a physical address of a system to


its logical address.
It is required when a system restarts after the crash or
boot fist time in a new network.
It knows its physical address but it does not know its IP
address to connect outside world (Network).

22.61
Reverse Address Resolution Protocol: RARP

The steps are :


The host or the router sends an ARP query packet
providing the IP addresses of the host.
the query is broadcast over the network.
Another machine on the local network that knows all the
IP addresses will respond with a RARP reply.
The requesting machine must be running a RARP client
program; the responding machine must be running a RARP
server program.

22.62
Demerit of Reverse Address Resolution Protocol: RARP

RARP is applicable only at LAN level.


Broadcasting is done at the data link layer.
The physical broadcast address does not pass the
boundaries of a network.
This is the reason that RARP is almost obsolete.
protocols, BOOTP and DHCp, are replacing RARP.

22.63
Bootstrap Protocol: (BOOTP)

BOOTP is a client/server protocol used to map physical


address to logical address.
BOOTP is an application layer protocol.
The administrator may put the client and the server on the
same network or on different networks.
BOOTP messages are encapsulated in a UDP packet, and
the UDP packet itself is encapsulated in an IP packet.
The client simply uses all 0s the source address and all 1s as
the destination address.

22.64
BOOTP client and server on the same and different networks

21.65
Bootstrap Protocol: (BOOTP)

Advantages of BOOTP over RARP:


BOOTP is based on client –server based protocol which is
a application-layer processes.
A client can be in one network and the server in another,
separated by several other networks.
BOOTP cannot handle the temporary IP address
allocation.
Because the binding between the physical and IP
addresses is static and fixed in a table.

22.66
Demerit of Bootstrap Protocol: (BOOTP)

BOOTP is not a dynamic configuration protocol.


When a client requests its IP address, the BOOTP
server consults a table that matches the physical
address of the client with its IP address.
This implies that the binding between the
physical address and the IP address of the client
already exists.

22.67
Dynamic Host Configuration Protocol: (DHCP)

DHCP has been devised to provide static and


dynamic address allocation that can be manual or
automatic.
DHCP has two database for IP address mapping;
one for static and another for dynamic mapping.
In Static Address Allocation, a DHCP server has
a database that statically binds physical addresses to
IP addresses.
22.68
Dynamic Host Configuration Protocol: (DHCP)

For Dynamic allocation, DHCP has a second


database with a pool of available IP addresses.
This second database makes DHCP dynamic.
When a DHCP client requests a temporary IP
address, the DHCP server goes to the pool of available
(unused) IP addresses and assigns an IP address for a
negotiable period of time.

22.69

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy