Beruflich Dokumente
Kultur Dokumente
Internet Protocol
(IP)
McGraw-Hill
CONTENTS
DATAGRAM
FRAGMENTATION
OPTIONS
CHECKSUM
IPPACKAGE
McGraw-Hill
Figure 8-1
McGraw-Hill
PositionofIPinTCP/IPprotocolsuite
8.1
DATAGRAM
McGraw-Hill
Figure 8-2
IPdatagram
McGraw-Hill
Figure 8-3
ServiceTypeorDifferentiatedServices
McGraw-Hill
Theprecedencesubfieldis
notusedinversion4.
McGraw-Hill
Thetotallengthfielddefinesthe
totallengthofthe
datagramincludingtheheader.
McGraw-Hill
Figure 8-4
McGraw-Hill
Encapsulationofasmalldatagram
inanEthernetframe
Figure 8-5
McGraw-Hill
Multiplexing
Example 1
AnIPpackethasarrivedwiththefirst8bits
asshown:
01000010
Thereceiverdiscardsthepacket.Why?
McGraw-Hill
Solution
There is an error in this packet. The 4 leftmost
bits(0100)showtheversion,whichiscorrect.The
next 4 bits (0010) show the header length, which
means(248),whichiswrong.Theminimum
number of bytes in the header must be 20. The
packethasbeencorruptedintransmission.
McGraw-Hill
Example 2
InanIPpacket,thevalueofHLENis1000
in binary. How many bytes of options are
beingcarriedbythispacket?
McGraw-Hill
Solution
The HLEN value is 8, which means the total
numberofbytesintheheaderis84or32bytes.
Thefirst20bytesarethemainheader,thenext12
bytesaretheoptions.
McGraw-Hill
Example 3
InanIPpacket,thevalueofHLENis516and
the value of the total length field is 002816.
Howmanybytesofdataarebeingcarriedby
thispacket?
McGraw-Hill
Solution
The HLEN value is 5, which means the total
numberofbytesintheheaderis54or20bytes
(no options). The total length is 40 bytes, which
means the packet is carrying 20 bytes of data
(4020).
McGraw-Hill
Example 4
Solution
McGraw-Hill
8.2
FRAGMENTATION
McGraw-Hill
Figure 8-6
McGraw-Hill
MTU
Figure 8-7
McGraw-Hill
Flagfield
Figure 8-8
McGraw-Hill
Fragmentationexample
Figure 8-9
McGraw-Hill
Detailed
example
Example 5
ApackethasarrivedwithanMbitvalueof
0.Isthisthefirstfragment,thelastfragment,
or a middle fragment? Do we know if the
packetwasfragmented?
McGraw-Hill
Solution
McGraw-Hill
Example 6
ApackethasarrivedwithanMbitvalueof
1.Isthisthefirstfragment,thelastfragment,
or a middle fragment? Do we know if the
packetwasfragmented?
McGraw-Hill
Solution
IftheMbitis1,itmeansthatthereisatleastone
morefragment.Thisfragmentcanbethefirstone
or a middle one, but not the last one. We dont
knowifitisthefirstoneoramiddleone;weneed
more information (the value of the fragmentation
offset). However, we can definitely say the
originalpackethasbeenfragmentedbecausetheM
bitvalueis1.
McGraw-Hill
Example 7
ApackethasarrivedwithanMbitvalueof1
and a fragmentation offset value of zero. Is
thisthefirstfragment,thelastfragment,ora
middlefragment?
McGraw-Hill
Solution
McGraw-Hill
Example 8
McGraw-Hill
Solution
McGraw-Hill
Example 9
McGraw-Hill
Solution
Thefirstbytenumberis100 8800.Thetotal
length is 100 bytes and the header length is 20
bytes(54),whichmeansthatthereare80bytes
in this datagram. If the first byte number is 800,
thelastbytenumbermust879.
McGraw-Hill
8.3
OPTIONS
McGraw-Hill
Figure 8-10
McGraw-Hill
Optionformat
Figure 8-11
McGraw-Hill
Categoriesofoptions
Figure 8-12
McGraw-Hill
Nooperationoption
Figure 8-13
McGraw-Hill
Endofoptionoption
Figure 8-14
McGraw-Hill
Recordrouteoption
Figure 8-15
McGraw-Hill
Recordrouteconcept
Figure 8-16
McGraw-Hill
Strictsourcerouteoption
Figure 8-17
Strictsourcerouteconcept
McGraw-Hill
Figure 8-18
Loosesourcerouteoption
McGraw-Hill
Figure 8-19
McGraw-Hill
Timestampoption
Figure 8-20
Useofflagintimestamp
McGraw-Hill
Figure 8-21
Timestampconcept
McGraw-Hill
Example 10
McGraw-Hill
Solution
Welookatthefirst(leftmost)bitofthecodefor
eachoption.
Nooperation:Codeis00000001;nocopy.
Endofoption:Codeis00000000;nocopy.
Recordroute:Codeis00000111;nocopy.
Strictsourceroute:Codeis10001001;copied.
Loosesourceroute:Codeis10000011;copied.
Timestamp:Codeis01000100;nocopy.
McGraw-Hill
Example 11
McGraw-Hill
Solution
Welookatthesecondandthird(leftmost)bitsof
thecode.
Nooperation:Codeis00000001;control.
Endofoption:Codeis00000000;control.
Recordroute:Codeis00000111;control.
Strictsourceroute:Codeis10001001;control.
Loosesourceroute:Codeis10000011;control.
Timestamp:Codeis01000100;debugging
McGraw-Hill
8.4
CHECKSUM
McGraw-Hill
Tocreatethechecksumthesenderdoes
thefollowing:
1.Thepacketisdividedintoksections,
eachofnbits.
2.Allsectionsareaddedtogetherusing
onescomplementarithmetic.
3.Thefinalresultiscomplemented
tomakethechecksum.
McGraw-Hill
Figure 8-22
McGraw-Hill
Checksumconcept
Figure 8-23
Checksuminonescomplementarithmetic
McGraw-Hill
Figure 8-24
McGraw-Hill
Exampleof
checksum
calculation
inbinary
Figure 8-25
McGraw-Hill
Exampleof
checksum
calculation
in
hexadecimal
CheckAppendixCforadetailed
descriptionofchecksumcalculation
andthehandlingofcarries.
McGraw-Hill
8.5
IPPACKAGE
McGraw-Hill
Figure 8-26
McGraw-Hill
IP
components
Figure 8-27
McGraw-Hill
MTUtable
Figure 8-28
McGraw-Hill
Reassemblytable