4-4 Network Layer.pptx

download 4-4 Network Layer.pptx

of 37

Transcript of 4-4 Network Layer.pptx

  • 8/13/2019 4-4 Network Layer.pptx

    1/37

    Network Layer (Part 4)

    Computer Networks

    Tutun JuhanaTelecommunication EngineeringSchool of Electrical Engineering & InformaticsInstitut Teknologi Bandung

    4

  • 8/13/2019 4-4 Network Layer.pptx

    2/37

    INTERNET PROTOCOLVERSION 4 (IPV4)

  • 8/13/2019 4-4 Network Layer.pptx

    3/37

    3

  • 8/13/2019 4-4 Network Layer.pptx

    4/37

    4

    This is why we needTotal Length field

  • 8/13/2019 4-4 Network Layer.pptx

    5/37

    5

  • 8/13/2019 4-4 Network Layer.pptx

    6/37

    6

  • 8/13/2019 4-4 Network Layer.pptx

    7/37

    7

  • 8/13/2019 4-4 Network Layer.pptx

    8/37

    FRAGMENTATION

    8

  • 8/13/2019 4-4 Network Layer.pptx

    9/37

    Maximum Transfer Unit (MTU)

    9

  • 8/13/2019 4-4 Network Layer.pptx

    10/37

    Maximum IP datagram length is 65,535bytes

    We might have to divide the datagram tomake it possible to pass through differentphysical networks This is calledfragmentation.

    10

  • 8/13/2019 4-4 Network Layer.pptx

    11/37

    When a datagram is fragmented, each fragmenthas its own header with most of the fieldsrepeated, but some changed

    A fragmented datagram may itself be

    fragmented if it encounters a network with aneven smaller MTU (a datagram can befragmented several times before it reaches thefinal destination)

    A datagram can be fragmented by the sourcehost or any router in the path

    The reassembly of the datagram, however, is

    done only by the destination host 11

  • 8/13/2019 4-4 Network Layer.pptx

    12/37

    When a datagram is fragmented, required partsof the header must be copied by all fragments

    The option field may or may not be copied The host or router that fragments a datagrammust change the values of three fields: flags,fragmentation offset, and total length (The rest of

    the fields must be copied) The value of the checksum must be recalculated

    regardless of fragmentation.

    12

  • 8/13/2019 4-4 Network Layer.pptx

    13/37

    Fields Related to Fragmentation

    Identification Flags

    Fragmentation offset

    13

  • 8/13/2019 4-4 Network Layer.pptx

    14/37

    Identification

    16 bit Identifies a datagram originating from the source host The combination of the identification and source IP

    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 into all fragments allfragments have the same identification number, which is

    also the same as the original datagram The identification number helps the destination in

    reassembling the datagram all fragments having thesame identification value should be assembled into onedatagram

    14

  • 8/13/2019 4-4 Network Layer.pptx

    15/37

    Flags

    D (Do not fragment) 1 : machine must not fragment the datagram 0 : datagram can be fragmented if necessary

    M (More fragments) 1 : datagram is not the last datagram 0 : This is the last or only fragment

    15

    not used

  • 8/13/2019 4-4 Network Layer.pptx

    16/37

    Fragmentation offset

    This 13-bit field shows the relative position of thisfragment with respect to the whole datagram. Measured in units of 8 bytes

    16

  • 8/13/2019 4-4 Network Layer.pptx

    17/37

    17

    identification

    The last fragment

    the offset field isalways relativeto the originaldatagram

  • 8/13/2019 4-4 Network Layer.pptx

    18/37

    Final destination host can reassemble theoriginal datagram from the fragments received (ifnone of them is lost) using the following strategy:a. The first fragment has an offset field value of zero.

    b. Divide the length of the first fragment by 8. Thesecond fragment has an offset value equal to thatresult.

    c. Divide the total length of the first and second

    fragment by 8. The third fragment has an offsetvalue equal to that result.

    d. Continue the process. The last fragment has a morebit value of 0.

    18

  • 8/13/2019 4-4 Network Layer.pptx

    19/37

    OPTIONS

    19

  • 8/13/2019 4-4 Network Layer.pptx

    20/37

    Are not required for a datagram But all IP software implementations must be

    able to handle options if they are present inthe header.

    Can be used for network testing anddebugging.

    20

  • 8/13/2019 4-4 Network Layer.pptx

    21/37

    Format

    21

    type-length-value (TLV)

  • 8/13/2019 4-4 Network Layer.pptx

    22/37

    Option Types

    22

    do not require the length or the data fields

    require the length or the data fields

  • 8/13/2019 4-4 Network Layer.pptx

    23/37

    No-Operation Option

    1-byte option used as a filler betweenoptions

    23

  • 8/13/2019 4-4 Network Layer.pptx

    24/37

    End-of-Option Option

    1-byte option used for padding at the end of the optionfield. It can only be used as the last option Only one end-of-

    option option can be used After this option, the

    receiver looks for the payload data If more than 1 byteis needed to align the option field, some no-operationoptions must be used, followed by an end-of-optionoption

    24

  • 8/13/2019 4-4 Network Layer.pptx

    25/37

    Record-Route Option is used to record the Internet routers that handle

    the datagram It can list up to nine router IP addresses

    25

    Pointer field is an offset integer field containing the bytenumber of the first empty entry It points to the firstavailable entry.

  • 8/13/2019 4-4 Network Layer.pptx

    26/37

    26

  • 8/13/2019 4-4 Network Layer.pptx

    27/37

    Strict-Source-Route Option

    used by the source to predetermine aroute for the datagram as it travels throughthe Internet

    27

  • 8/13/2019 4-4 Network Layer.pptx

    28/37

    28

  • 8/13/2019 4-4 Network Layer.pptx

    29/37

    Loose-Source-Route Option

    similar to the strict source route, but it is morerelaxed Each router in the list must be visited,but the datagram can visit other routers as well.

    29

  • 8/13/2019 4-4 Network Layer.pptx

    30/37

    Timestamp A timestamp option is used to record the time of

    datagram processing by a router The time is expressed in milliseconds from midnight,

    Universal Time.

    30

  • 8/13/2019 4-4 Network Layer.pptx

    31/37

    31

  • 8/13/2019 4-4 Network Layer.pptx

    32/37

    32

  • 8/13/2019 4-4 Network Layer.pptx

    33/37

    CHECKSUM

    33

  • 8/13/2019 4-4 Network Layer.pptx

    34/37

    Checksum Calculation at the Sender

    The packet is divided into k sections, eachof n bits.

    All sections are added together usingones complement arithmetic.

    The final result is complemented to makethe checksum.

    34

  • 8/13/2019 4-4 Network Layer.pptx

    35/37

    35

  • 8/13/2019 4-4 Network Layer.pptx

    36/37

    Checksum in the IP Packet

    36

  • 8/13/2019 4-4 Network Layer.pptx

    37/37

    37