+ All Categories
Home > Documents > IPv4Overview

IPv4Overview

Date post: 06-Apr-2018
Category:
Upload: sahil-wadhwa
View: 221 times
Download: 0 times
Share this document with a friend

of 37

Transcript
  • 8/2/2019 IPv4Overview

    1/37

    IPv4 Overview

  • 8/2/2019 IPv4Overview

    2/37

    IP Protocol

    This is host to host network layer connection less datagram

    protocol with no guarantee of reliability. It is a unreliable protocol

    bz it does not provide any error and flow control. It can only

    detect the error and discard the corrupted packet.

    IP Datagram

    Packet in IP layer are called datagram.it is a variable length packet

    with two parts Header and Data .The header is 20-60 bytes in

    length and contains information required for routing and delivery.

    data field is of variable length.

  • 8/2/2019 IPv4Overview

    3/37

    Structure of IP frame header

  • 8/2/2019 IPv4Overview

    4/37

    Version (VER). This 4-bit field defines the version of the IP protocol. Currently

    the version is 4. However, version 6 may totally replace version 4 in the

    future. This field tells the IPv4 software running in the processing machine that the

    datagram has the format of version 4. All fields must be interpreted as specified

    in the fourth version of the protocol. If the machine is using some other version of

    IPv4, the datagram is discarded rather than interpreted incorrectly.

    Header length (HLEN). This 4-bit field defines the total length of the datagram

    header in 4-byte words. This field is needed because the length of the header

    is variable (between 20 and 60 bytes). When there are no options, the header length

    is 20 bytes, and the value of this field is 5 (5 x 4 = 20). When the option field is

    at its maximum size, the value of this field is 15 (15 x 4 = 60).

    Services. This is 8-bit field. This field, previously called service type, is now called

    differentiated services.it defines the class of datagram for quality of service purpose.

    Total length field defines the total length of the datagram including the header.

    Length of data =total length - header length

    Since the field length is 16 bits, the total length of the IPv4 datagram is limited to

    65,535 (216 - 1) bytes, of which 20 to 60 bytes are the header and the rest is data.

  • 8/2/2019 IPv4Overview

    5/37

    Identification:--This 16-bit field identifies a datagram originating from the source

    host. When a datagram is fragmented, the value in the identification field is copied

    to all fragments . 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.

    Flags:- This is a 3-bit field. The first bit is reserved and it should be zero. The

    second bit is called the do not fragment bit. If its value is 1, the machine must not

    fragment the datagram . If its value is 0, the datagram can be fragmented if

    required. 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.

    More fragmentation bitDo not fragment bit Reserved bit

    Fields Related to Fragmentation

  • 8/2/2019 IPv4Overview

    6/37

    Fragmentation offset

    This 13-bit field shows the relative position of this fragment with respect to the

    whole datagram. It is the offset of the data in the original datagram measured in

    units of 8 bytes.

  • 8/2/2019 IPv4Overview

    7/37

    The bytes in the original datagram are numbered 0 to 3999. The first fragment

    carries bytes 0 to 1399. The offset for this datagram is 0/8 =O. The second

    fragment carries bytes 1400 to 2799; the offset value for this fragment is 1400/8

    = 175. Finally, the third fragment carries bytes 2800 to 3999. The offset value

    for this fragment is 2800/8 =350. Remember that the value of the offset ismeasured in units of 8 bytes. This forces hosts that fragment datagrams to

    choose a fragment size so that the first byte number is divisible by 8.

    Time to live. A datagram has a limited lifetime in its travel through an internet.

    This field was designed to hold a timestamp, which was decremented by each

    visited router. The datagram was discarded when the value became zero. all themachines must have synchronized clocks and must know how long it takes for

    a datagram to go from one machine to another. this field is used mostly to

    control the maximum number of routers visited by the datagram. When a

    source host sends the datagram, it stores a number in this field. This value is 2

    times the maximum number of routes between any two hosts. Each router thatprocesses the datagram decrements this number by 1.If this value is zero, the

    router discards the datagram .

  • 8/2/2019 IPv4Overview

    8/37

    This field is needed because routing tables in the Internet can

    become corrupted . A datagram may travel between two or more

    routers for a long time without ever getting delivered to thedestination host. This field limits the lifetime of a datagram .

    this field is also used to intentionally limit the journey of the

    packet. if the source wants to confine the packet to the local

    network, it can store 1 in this field. When the packet arrives at the

    first router, this value is decremented to 0, and the datagram is

    discarded

  • 8/2/2019 IPv4Overview

    9/37

    A no-operation option is a I-byte option used as a filler between options.

    An end-of-option option is a I-byte option used for padding at the end of the option

    field. It, however, can only be used as the last option.

    A record route option is used to record the Internet routers that handle the datagram. Itcan list up to nine router addresses. It can be used for debugging and management

    purposes.A strict source route option is used by the source to predetermine a route for the datagram

    as it travels through the Internet. The sender can choose a route with a specific type of

    service, such as minimum delay or maximum throughput. Alternatively, it may choose a

    route that is safer or more reliable for the sender's purposeA loose source route option is similar to the strict source route, but it is less rigid. Each

    router in the list must be visited, but the datagram can visit other routers as well.

    A timestamp option is used to record the time of datagram processing by a router.

    Knowing the time a datagram is processed can help users and managers track the

    behavior of the routers in the Internet. We can estimate the time it takes for a datagram

    to go from one router to another.

  • 8/2/2019 IPv4Overview

    10/37

    Checksum

    First the value of the checksum field is set to O. Then the entire header is

    divided into 16-bit sections and added together. The result (sum) is

    complemented and inserted into the

    checksum field . The checksum in the IP packet covers only the header, not the

    data. There are two good reasons for this.

    First, all higher-level protocols that encapsulate data in the IP datagram have

    a checksum field that covers the whole packet. Therefore, the checksum forthe IP datagram does not have to check the encapsulated data.

    Second, the header of the IP 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.

  • 8/2/2019 IPv4Overview

    11/37

    Services provided by IP

    Addressing32 bit address used by intermediate router to select a path

    through the network for the packet. FragmentationIP packet may be split in to smaller packets. This permit a

    large packet to travel through a n/w that can handle the smaller packets.

    Packet time outtime to live

    Address Space. IP uses 32-bit addresses . An address space is the total number of addresses

    used by the protocol. IP uses 32-bit addresses, which means that the address

    space is 232 or 4,294,967,296 (more than 4 billion).

  • 8/2/2019 IPv4Overview

    12/37

    Protocol

    This 8-bit field defines the higher-level protocol that uses the services of

    the IP layer. An IP datagram can encapsulate data from several higher-levelprotocols such as TCP, UDP, ICMP, and IGMP. This field specifies the final

    destination protocol to which the IP datagram is delivered. since the IP protocol

    carries data from different other protocols, the value of this field helps the receiving

    network layer know to which protocol the data belong

  • 8/2/2019 IPv4Overview

    13/37

    Source address. This 32-bit field defines the IP address of the source. This fieldmust remain unchanged during the time the IP datagram travels from the source

    host to the destination host.

    Destination address. This 32-bit field defines the IP address of the destination .This field must remain unchanged during the time the IP datagram travels from the

    source host to the destination host.

    OptionsOptions, as the name implies, are not required for every datagram. They can be

    used for network testing and debugging.

  • 8/2/2019 IPv4Overview

    14/37

    IP Address

  • 8/2/2019 IPv4Overview

    15/37

    IP Addresses:

    Classful Addressing

  • 8/2/2019 IPv4Overview

    16/37

    An IP address is a

    32-bitaddress.

  • 8/2/2019 IPv4Overview

    17/37

    The IP addressesare

    unique.

  • 8/2/2019 IPv4Overview

    18/37

    RULE:

    addr15addr1

    addr2

    addr41addr31

    addr226

    ....

    ....

    ..

    ....

    If a protocol usesNbits to

    define an address,the address space is 2N

    because each bit can have two

    different values (0 and 1)andNbits can have 2Nvalues.

  • 8/2/2019 IPv4Overview

    19/37

    The address space of IPv4 is

    232

    or4,294,967,296.

    An address space is the total number of addresses used by the

    protocol.

  • 8/2/2019 IPv4Overview

    20/37

    01110101 10010101 00011101 11101010

    Binary Notation

  • 8/2/2019 IPv4Overview

    21/37

    Dotted-decimal notation

  • 8/2/2019 IPv4Overview

    22/37

    Every router and host on internet has a unique IP address .all IP address are of

    32 bit and they use source and destination field of the IP header. The first part

    of address is called network ID which identify the network on the internet and

    second called the host ID used to identify the individual host on that network.

    Classes of IP address :-

  • 8/2/2019 IPv4Overview

    23/37

    Netid and hostid

  • 8/2/2019 IPv4Overview

    24/37

    In classful addressing,

    the address space is

    divided into five classes:A,B, C,D, andE.

  • 8/2/2019 IPv4Overview

    25/37

    Class Ranges of Internet Addresses

  • 8/2/2019 IPv4Overview

    26/37

    Class A address

    The n/w field is of 7 bit and the host field is of 24 bits . One bit is used for the class

    type. So the n/w field can have numbers b/w 0 to 127. but the host number ranges from

    0.0.0.0 to 127.255.255.255. hence in class A there can be 127 types of n/ws. bit 0 in fist

    field indicates that it is class A n/w address.

    27 26 25 24 23 22 21 20

    0 0 0 0 0 0 0 0

    0 0 0 0 0 0 0 1

    .0 1 1 1 1 1 1 1

    Samewaytotal number of host will be ranges from 0. 0.0.0 to 127. 255.255.255

    0 7 bit / network ID 24 bit host ID

    0

    127

    32 bit

  • 8/2/2019 IPv4Overview

    27/37

    Millions of class A addressesare wasted.

  • 8/2/2019 IPv4Overview

    28/37

    Class B address

    The first field defines the class type and second field defines the

    networks. And last field defines the hosts. The n/w field values lies

    b/w 128 to 191.the first block covers the address from

    128.0.0.0 to 128.255.255.255 and last block covers from 191.0.0.0 to

    191.255.255.255.

    10 14 bit / network id 16 bit / host id

    10 (6 bit) 000000 8 bit( 00000000) Host id (8 + 8 )

    Range from 0 to 255

    Ranges from 128 to 191

    32 bit

    Range from 0 to 255

    Range from 0 to 255

    14 bits (6 + 8)

  • 8/2/2019 IPv4Overview

    29/37

    Many class B addressesare wasted.

  • 8/2/2019 IPv4Overview

    30/37

    Class C address32 bit

    110 Network ID ( 21 bit) Host ID (8 bit)

    110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Host ID(8 bit)

    21 bits(5+8+8)

    110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 HostID(8 bit)

    272625 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20

    00192

    110 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 HostID(8 bit)

    223

    255255

    0

    255

    192.0.0.0

    223.255.255.255

  • 8/2/2019 IPv4Overview

    31/37

    Class C address32 bit

    110 Network ID ( 21 bit) Host ID (8 bit)

    110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Host ID(8 bit)

    21 bits(5+8+8)

    110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 HostID(8 bit)

    272625 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20

    00192

    110 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 HostID(8 bit)

    223

    255255

    0

    255

    192.0.0.0

    223.255.255.255

  • 8/2/2019 IPv4Overview

    32/37

    Class D address

    1110 Multicast ID

    32 bit

    1 1 1 0 4 bit 8 bit 8 bit 8 bit

    1 1 1 0 0 0 0 0 00000000 0000000 0000000

    27 26 25 24 23 22 21 20

    00

    0224

    224.0.0.0

    1 1 1 0 1 1 1 1 11111111 11111111 1111111127 26 25 24 23 22 21 20

    239

    255255 255

    239.255.255.255

  • 8/2/2019 IPv4Overview

    33/37

    Class D addresses

    are used for multicasting;

    there is only

    one block in this class.

    Cl E dd

  • 8/2/2019 IPv4Overview

    34/37

    Class E address

    1111 Reserved for future use

    32 bit

    1 1 1 1 4 bit 8 bit 8 bit 8 bit

    1 1 1 1 0 0 0 0 00000000 0000000 0000000

    27 26 25 24 23 22 21 20

    00

    0240

    240.0.0.0

    1 1 1 1 1 1 1 1 11111111 11111111 1111111127 26 25 24 23 22 21 20

    255

    255255 255

    255.255.255.255

  • 8/2/2019 IPv4Overview

    35/37

    Class E addresses are reserved

    for special purposes;most of the block is wasted.

    Fi di th dd l

  • 8/2/2019 IPv4Overview

    36/37

    Finding the address class

  • 8/2/2019 IPv4Overview

    37/37

    Finding the class in decimal notation