unit 4 ipv4
TRANSCRIPT
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 1/50
UNIT 4
NETWORK-LAYER IP
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 2/50
CONTENT
INTRO TO INTERNET PROTOCOL (IP).
Datagram Format. - header de!r"#t"o$.
Fragme$tat"o$. - %a&"m'm Tra$er U$"t (%TU).
- F"ed Reated to Fragme$tat"o$.
O#t"o$.
- *"$ge-+,te O#t"o$. - %'t"#e-+,te O#t"o$.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 3/50
INTERNET PROTOCOL (IP)The network layer in version 4 consist of one main protocol
and three auxiliary ones.
1. The main protocol(IPv4) is responsi!le for packeti"in#
forwardin# and delivery of a packet at the network layer.
$. (I%&Pv4) helps IPv4 to handle some errors that may occur
in the network-layer delivery.
'. (I&P) is used to help IPv4 in multicastin#.
4. (*P) is used to #lue the network and data-link layers in
mappin# network-layer addresses to link-layer addresses.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 4/50
INTERNET PROTOCOL (IP4) IPv4 is an (unrelia!le + !est-effort) protocol of
data#ram delivery service.
,ecause Packets can !e corrupted !e lost arriveout of order or !e delayed and may create
con#estion for the network.
To make it relia!le IPv4 must !e paired with arelia!le transport-layer protocol such as T%P.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 5/50
INTERNET PROTOCOL (IP4) IPv4 is also a connectionless protocol that
uses the data#ram approach.
This means that each data#ram is handledindependently and each data#ram can follow
a different route to the destination.
This implies that data#rams sent !y the same
source to the same destination could arrive
out of order.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 6/50
DATARA% FOR%AT data#ram is a varia!le-len#th packet consistin# of two parts
header and payload (data).
The header is $ to / !ytes in len#th and contains information
essential to routin# and delivery.
Payload (data) is the main reason for creatin# a data#ram.
Payload is the packet comin# from other protocols that use the
service of IP.
%omparin# payload is the content of the packa#e the header is
only the information written on
the packa#e.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 7/50
DATARA% FOR%AT/ 0EADER
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 8/50
DATARA% FOR%AT/ 0EADER 0ersion um!er(02*) defines the version of the IPv4
4-!its len#th and has the value of 4.
3eader en#th(32) defines the total len#th of theheader divide !y 4 4-!its len#th used to know when
the header stops and the data 5tart.
3eader len#th 6 4 7 value of (32)
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 9/50
DATARA% FOR%AT/ 0EADER 5ervice Type defines how the data#ram should
!e handled 8-!its len#th.
Total en#th defines the total len#th ofdata#ram (header plus data) in !ytes 1/-!its
len#th.
This field helps the receivin# device to know when
the packet has completely arrived.
en#th of data 6 Total len#th - 3eader len#th
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 10/50
DATARA% FOR%AT/ 0EADER Identification helps the destination in reassem!lin#
the data#ram 1/-!its len#th It knows that all
fra#ments havin# the same identification value should
!e assem!led into one data#ram.
9la#s '-!its len#th defines three fla#s
-leftmost !it is reserved (not used)
-The second !it (: !it) if its value 1 means that
packet not fra#ment ;therwise fra#ment.
-The third !it (& !it) if its value 1 means that this
data#ram is not the last fra#ment< there are more fra#ments
after this one.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 11/50
DATARA% FOR%AT/ 0EADER 9ra#mentation ;ffset shows the relative
position of this fra#ment with respect to the
whole data#ram1'-!its len#th
;ffset value 6 The first !yte num!er is divisi!le !y 8
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 12/50
DATARA% FOR%AT/ 0EADER Time-to-live used to control the maximum num!er of
hops(routers) visited !y the data#ram 8-!its len#th<
=hen a source host sends the data#ram it stores a
num!er in this field.
This value is approximately two times the maximum
num!er of routers !etween any two hosts.
2ach router that processes the data#ram decrements
this num!er !y one.
If this value after !ein# decremented is "ero the
router discards the data#ram.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 13/50
DATARA% FOR%AT/ 0EADER Protocol 8-!it =hen the payload is encapsulated in
a data#ram at the source IP the correspondin#
protocol num!er is inserted in this field<
when the data#ram arrives at the destination the
value of this field helps to define to which protocol
the payload should !e delivered.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 14/50
DATARA% FOR%AT/ 0EADER 3eader checksum 1/-!its field header checksum
field to check the header ,ecause 2rrors in the IP
header can !e a disaster.
If the destination IP address is corrupted the packet
can !e delivered to the wron# host.
If the protocol field is corrupted the payload may !e
delivered to the wron# protocol.
If the fields related to the fra#mentation are
corrupted the data#ram cannot !e reassem!led
correctly at the destination and so on.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 15/50
DATARA% FOR%AT/ 0EADER 5ource ddresses '$-!its define the address of
the source.
:estination ddresses '$-!its define the
address of the destination.
ote that the value of these fields must remain
unchan#ed durin# the time data#ram travels
from the source host to the destination host.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 16/50
DATARA% FOR%AT/ 0EADER E1A%PLE
3eader len#th 6 4 7 value of (32)
3eader len#th 6 4 7 > 6 $.
en#th of data 6 Total len#th - 3eader len#th
en#th of data 6 4 - $ 6$
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 17/50
EXAMPLE OF CHECKSUM
CALCULATION IN IPV4
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 18/50
ONE %AY A*K W0Y WE NEEDT0I* 0EADER ?
=hen a machine (router or host) receives a
frame it drops the header and the trailer
leavin# the data#ram.
in many cases we really do not need thevalue in this field.
3owever there are occasions in which the
data#ram is not the only thin# encapsulated
in a frame< it may !e that paddin# has !een added.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 19/50
FRA%ENTATION 2ach router decapsulates the IP data#ram from the frame it
receives processes it and then encapsulates it in another
frame.
The format and si"e of the received frame depend on the
protocol used !y the physical network throu#h which theframe has ?ust traveled.
The format and si"e of the sent frame depend on the protocol
used !y the physical network throu#h which the frame is #oin#
to travel.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 20/50
FRA%ENTATION/ (%TU) 2ach link-layer protocol has its own frame format. ;ne of the
features of each format is the maximum si"e of the payload
that can !e encapsulated.
The total si"e of the data#ram must !e less than this
maximum si"e. maximum len#th of the IP data#ram e@ual to />>'> !ytes.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 21/50
FRA%ENTATION data#ram can !e fra#mented !y the source host or any router
in the path.
=hen a data#ram is fra#mented each fra#ment has its own
header with most of the fields repeated !ut some have !een
chan#ed. The reassem!ly of the data#ram however is done only !y the
destination host !ecause each fra#ment !ecomes an
independent data#ram.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 22/50
OPTION* data#ram header can have up to 4 !ytes of options.
;ptions can !e used for network testin# and
de!u##in#.
lthou#h options are not a re@uired part of the IP
header option processin# is re@uired of the IPsoftware.
This means that all implementations must !e a!le to
handle options if they are present in the header.
some options can !e chan#ed !y routers which forces
each router to recalculate the header checksum.
There are one-!yte and multi-!yte options.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 23/50
OPTION* The header of the IPv4 data#ram is made of two
parts
The fixed part is $ !ytes lon#
The varia!le part comprises the options that can
!e a maximum of 4 !ytes to preserve the
!oundary of the header.
;ptions are divided into two !road cate#ories
sin#le-!yte options and multiple-!yte options.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 24/50
OPTION*/ SINGLE-BYTE OPTIONS
There are two sin#le-!yte options
o ;peration is a 1-!yte option used as a
filler !etween options.
2nd of ;ption is a 1-!yte option used for
paddin# at the end of the option field.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 25/50
OPTION* / %ULTLIPLE-+YTE *ecord *oute is used to record the Internet
routers that handle the data#ram. It can list up
to nine router addresses. It can !e used for
de!u##in# and mana#ement purposes.
5trict 5ource *oute is used !y the source to
predetermine a route for the data#ram The
sender can choose a route with a specific type of
service such as minimum delay or maximumthrou#hput.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 26/50
OPTION* / %ULTLIPLE-+YTE oose 5ource *oute is similar to the strict source
route !ut it is less ri#id. 2ach router in the list
must !e visited !ut the data#ram can visit other
routers as well.
T"metam#/ is used to record the time of data#ram
processin# !y a router =e can estimate the time it
takes for a data#ram to #o from one router to
another.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 27/50
IP ADDRE**IN
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 28/50
CONTENT
IP4 ADDRE**E*
-Addre *#a!e.
-0"erar!h, "$ addre"$g
-Ca' Addre"$g.
-Cae Addre"$g.
-D,$am"! 0ot Co$"g'rat"o$ Proto!o(D0CP).
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 29/50
IP4 ADDRE**E* The Internet address (IP address) the identifier used to
identify the connection of each device to the Internet.
The IP address may !e chan#ed if the device is moved
to another network.
The IPv4 address is a '$-!it address that uni@uely and
universally defines the connection of a host to the
Internet.
IPv4 addresses uni@uely 2ach address defines only one
connection to the Internet. IPv4 addresses universally the addressin# system must
!e accepted !y any host that wants to !e connected to
the Internet.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 30/50
ADDRE** *PACE n address space is the total num!er of addresses used
!y the protocol.
If a protocol uses ! !its to define an address the
address space is $A!.
In !inary notation an IPv4 address is displayed as '$
!its.
In hexadecimal notation an IPv4 address is displayed
as 8 hexadecimal di#its.
2ach octet is often referred to as a !yte.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 31/50
0IERARC0Y IN ADDRE**IN '$-!it IPv4 address is hierarchical divided
into two parts.
The first part of the address called the
prefix defines the network. the second part of the address called the
suffix defines the node.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 32/50
CLA**FUL ADDRE**IN IPv4 address was desi#ned with a fixed len#th
prefix.
To accommodate !oth small and lar#e networks
three fixed-len#th prefixes were desi#nedinstead of one (n = 8, n = 16, and n = 24).
The whole address space was divided into five
classes (class , % : and 2).
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 33/50
CLA**FUL ADDRE**IN class network len#th is 8 !its first !it defines the
class seven !its as the network identifier. there are only
1$8 networks in the world that can have a class address.
class , network len#th is 1/ !its first two !its 1 definethe class14 !its as the network identifier. there are only
1/'84 networks in the world that can have a class ,
address.
In class % network len#th is $4 !its three !its 11 definethe class $1 !its as the network identifier. there are
$BC1>$ networks in the world that can have a class %
address.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 34/50
CLA**FUL ADDRE**IN
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 35/50
ADDRE** DEPLETION %lass can !e assi#ned to only 1$8 or#ani"ations in the world
!ut each or#ani"ation needs to have a sin#le network with
1/CCC$1/ nodes.
5ince there may !e only a few or#ani"ations that are this
lar#e most of the addresses in this class were wasted(unused).
%lass , addresses were desi#ned for midsi"e or#ani"ations !ut
many of the addresses in this class also remained unused.
%lass % addresses have a completely different flaw in desi#n
The num!er of addresses that can !e used in each network($>/ nodes) was so small that most companies were not
comforta!le usin# a !lock in this address
%lass 2 addresses were almost never used wastin# the whole
class.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 36/50
IP ADDRE**E*The values and -1 (all 1s) have special meanin#s. The value
means this network or this host. The value of -1 is used as a
!roadcast address to mean all hosts on the indicated network.
'/
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 37/50
IP ADDRE**E*
All the hosts in a network must have the same network number. This property of IP addressing can cause problems as networks grow. For
example……
The problem is the rule that a single class A ! or " address refers to
one network not to a collection of #A$s.
The solution is to allow a network to be split into several parts for
internal use but still act like a single network to the outside world.
'C
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 38/50
IP ADDRE**E*
To implement subnetting the main router needs a subnet mask thatindicates the split between network % subnet number and host.
For example if the university has a ! address&'().*).).)+ and (*departments it could use a ,-bit subnet number and a ')-bit hostnumber allowing for up to , /thernets each with a maximum of
')00 hosts.
The su!net mask can !e written as $>>.$>>.$>$.. nalternative notation is +$$ to indicate that the su!net maskis $$ !its lon#.
'8
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 39/50
*U+NETTIN AND*UPERNETTIN
In 5u!nettin# a class or class , !lock is
divided into several su!nets.
2ach su!net has a lar#er prefix len#th than the
ori#inal network.
5upernettin# was devised to com!ine several
class % !locks into a lar#er !lock to !e
attractive to or#ani"ations that need more thanthe $>/ addresses availa!le in a class % !lock.
This idea did not work either !ecause it makes
the routin# of packets more difficult.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 40/50
ADANTAE OF CLA**FUL ADDRE**IN
It had one advanta#e
iven an address we can easily find the
class of the address and since the prefix
len#th for each class is fixed we can find theprefix len#th immediately.
In other words the prefix len#th in classful
addressin# is inherent in the address< noextra information is needed to extract the
prefix and the suffix.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 41/50
CLA**LE** ADDRE**IN In classless addressin# varia!le-len#th !locks are
used that !elon# to no classes.
=e can have a !lock of 1 address $ addresses 4
addresses 1$8 addresses and so on. the whole address space is divided into varia!le
len#th !locks.
The prefix defines the !lock (network)<
The suffix defines the node(device).
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 42/50
PREFI1 LENT0/ *LA*0NOTATION
the prefix len#th n is added to the address
separated !y a slash.
The notation is informally referred to as slash
notation and formally as classless interdomainroutin# (%I:*).
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 43/50
ADDRE** INFOR%ATION 1.The num!er of addresses in the !lock is
found as 6 $A('$Dn)<n is prefix.
$.To find the first address we keep the nleftmost !its and set the ('$ D n) ri#htmost
!its all to s.
'.To find the last address we keep the nleftmost !its and set the ('$ D n) ri#htmost
!its all to 1s.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 44/50
ADDRE** %A*K
The address mask is a '$-!it num!er in which
The prefix !its are set to 1s.
The rest of the !its are set to s.
1.The num!er of addresses in the !lock
6 ;T (mask) E 1.
$.The first address in the !lock 6(ny address in the!lock) : (mask).
'.The last address in the !lock 6(ny address in the
!lock) ;* F(;T (mask)G.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 45/50
NETWORK ADDRE** 2 +LOCK ALLOCATION
etwork address is particularly important
!ecause it is used in routin# a packet to its
destination network.
,lock llocation I% does not normally
allocate addresses to individual Internet users. It
assi#ns a lar#e !lock of addresses to an I5P.
The num!er of re@uested addresses needs to
!e a power of $.
The re@uested !lock needs to !e allocated where
there is an ade@uate num!er of conti#uous
addresses availa!le in the address space.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 46/50
*U+NETTIN
num!er of addresses is
the prefix len#th is n
the assi#ned num!er of addresses to each
su!network is su! the prefix len#th for each su!network is nsu!
The num!er of addresses in each su!network
should !e a power of $.
The prefix len#th for each su!network should !efound usin# the followin# formula
The startin# address in each su!network should !e
divisi!le !y the num!er of addresses in that
su!network
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 47/50
ADDRE** AREATION
=hen !locks of addresses are com!ined to create
a lar#er !lock routin# can !e done !ased on the
prefix of the lar#er !lock.
I% assi#ns a lar#e !lock of addresses to an
I5P. 2ach I5P in turn divides its assi#ned !lock
into smaller su!!locks and #rants the su!!locks
to its customers.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 48/50
*PECIAL ADDRE**E* ...+'$ is called the host address.
$>>.$>>.$>>.$>>+'$ is called the limited-
!roadcast address.
1$C...+8 is called the loop!ack address.
private addresses 1...+8 1C$.1/..+1$1B$.1/8..+1/and 1/B.$>4..+1/.
$$4...+4 is reserved for multicast addresses.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 49/50
NETWORK ADDRE** TRAN*LATION (NAT)
The technolo#y allows a site to use a set of private addresses
for internal communication and a set of #lo!al Internet
addresses (at least one) for communication with the rest of
the world.
The site must have only one connection to the #lo!al Internet
throu#h a T-capa!le router that runs T software.
7/21/2019 UNIT 4 IPv4
http://slidepdf.com/reader/full/unit-4-ipv4 50/50
NAT ADDRE** TRAN*LATION