IP Datagram

23
Presented by : Shubhangi Desai 6.7 IPv4 DATAGRAM

Transcript of IP Datagram

Page 1: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 1/23

Presented by : Shubhangi Desai

6.7 IPv4 DATAGRAM

Page 2: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 2/23

What is IP?y IP ² Internet Protocoly Work on network layery Connectionless

y Packets may take different pathy Packets may arrive out of order

y Packets may be discarded when network resources areexhausted

Page 3: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 3/23

What is IP D atagram ?y IP Datagram isfundamental unit of information passed

acrossany network utilizingInternet Protocoly H eader Areay Data Area

y IP Datagram containssource & destination addresses alongwith data & number of fields that define things such aslength of datagram, header, checksum & flags

y IP datagram is transported from one network toanother (encapsulated in network frame)

Page 4: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 4/23

IP Datagram

DatagramH

eaderData in the Datagram

IP Datagram

FrameH eader

Complete Datagram treated as data

MAC Frame

Page 5: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 5/23

D atagram Format

Page 6: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 6/23

Ve rsiony Size : 4 bitsy Identifies the version of IP used to generate the datagramy For IPv4, this is of course the number 4y The purpose of this field is to ensure compatibility

between devices that may be running different versions of IPy A device running an older version of IP will reject datagram

created by newer implementations,

Page 7: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 7/23

H e ad e r Le n gthy Size : 4 bitsy Specifies the length of theIP header, in 32-bit wordsy Includes the length of any options fields and padding.y The normal value of this field when no options are used is 5

(5 32-bit words = 5*4 = 20 bytes or octats)

Page 8: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 8/23

Type of S e rvic e (TOS)y TOS describes how the packet should be handled in transit in

terms of speed v/s reliability v/s throughputy Precedence : Specifies

importance of datagram(also known as code points)

y Delay : Set to 1 ² low delayy

Throughput:Set to 1 ² high throughputy Reliability: Set to 1 ² high reliability

0 1 2 3 4 5 6 7

Page 9: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 9/23

Total Le n gthy Size: 16 bits (2 bytes)y Specifies the total length of theIP datagram, in bytesy This field is 16 bits wide, the maximum length of anIP

datagram is 65,535 bytes

Page 10: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 10/23

Id e n t ificat iony Size: 16 bits (2 bytes)y Uniquely identifies the datagramy Usually incremented by 1 each time a datagram is sent.y All fragments of a datagram contain the same identification

value.y This allows the destination host to determine which fragment

belongs to which datagram

Page 11: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 11/23

IP Fragm e n tat ion - Enc a psu lat iony When a host or router handles a datagram, theIP software

determines the next hop to which the datagram should be sent.

y Encapsulation applies to one transmission at a time. When theframe arrives at the next hop, theIP datagram is removed and theframe discarded.

y If the datagram most be forwarded across another network, a newframe is created and the encapsulation is repeated

Page 12: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 12/23

Enc a psu lat ion (con t« )y H osts and routers store the datagram in memory; when

transmitted it is encapsulated in a frame suitable for thenetwork. Each hardware technology specifies the maximumamount of data that a frame can carry. This is calledthe Maximum Transmission Unit(MTU).

y H ost H 2 can only transmitdatagram containing 1,000octets or less to router R

can forward across network1 .H owever, if host H 1 transmits a 1,500-octet datagram,router R cannot send it across network2.

Page 13: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 13/23

Fragm e n tat iony IP uses a technique calledf ragmentationto solve the problem

of heterogeneous MTUs.y When a datagram is larger than the MTU of the network

over which it must be sent, it is divided intosmallerf ragmentswhich are each sent separately

Page 14: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 14/23

Fragm e n tat ion (con t« )y When an IP datagram is fragmented, each fragment is treated

as a separate datagramy It is reassembles at the final destination, not at a router!!!y Why so? Because it may possible that router needs to fragment

it once againy Each fragment has its own headery Identification number is copied to each fragment

Page 15: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 15/23

Flag sy 0 : Reserved (not used)y 1 (DF) : Set to 1. Specifies datagram

shouldnot be fragmented

y 2 (MF) : Set to 0. Specifieslast fragmentin message.

Set to 1. Specifiesmore fragments are yet to come.

y N ote: If D F is set to 1 then surely there will be only a single´fragmentµ soMF will always be set to 0

0 1 2

Page 16: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 16/23

Fragm e n t Offs e ty Size: 13 bitsy Reflects the position of the fragment within its original

datagramy

At receiver side the process of reconstructing the originaldatagram is called asREASSEMBLY .

y The F RAGMENT O FF SET field tells the receiver how toorder the fragments

Page 17: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 17/23

Tim e to Live (TTL)y Size: 8 bitsy The TIME TO LIVE field specifies how long (in seconds) a

datagram is allowed to remain on theInternet system.y

If this field is zero, the packet is destroyedy Usuallydecremented by one when passed from one

hop to the next

Page 18: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 18/23

Pro toco ly Size: 8 bitsy Uses someIDs to define datagram is using which protocolN ote : just for information

y

UDP uses the number 17y TCP uses 6y ICMP uses 1y IG RP uses 88y

And so on«

Page 19: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 19/23

H e ad e r Ch e cksu my Checksum is computed only on the header which reduces

processing timey Checksum is applied toonly the values of header field of

datagram,NOT

DATA

Page 20: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 20/23

Sou rce & De s t inat ion IP A ddr e ssy Size: 32 bits (each)y IP address of ultimate sending & receiving host of the packets

Page 21: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 21/23

Op tions & P add ing y Size: depending on which options are selected

Page 22: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 22/23

Any Qu e s t ions

Page 23: IP Datagram

8/7/2019 IP Datagram

http://slidepdf.com/reader/full/ip-datagram 23/23