network layer-05-ip

Upload: rsakm20019931

Post on 30-May-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Network Layer-05-IP

    1/3

    Computer NetworksCPS 422

    NETWORK LAYERAddressing in the Internet

    Faisal Amjad CPS 422

    Behrouz A. Forouzan

    Faisal Amjad CPS 422

    Internet Address

    For communication on the Internet, we need touniquely identify everydevice connected to theInternet.

    The identifier used in the network layer of theInternet model to identify each device on theInternet is called the Internet Address, InternetProtocol Address or commonly, the IP Address

    An IP address is a 32-bit binary address thatuniquely and universally defines the connection ofa host or a router to the Internet

    A host can have multiple IP addresses, but twohosts cannot have the same IP address on theInternet

    Faisal Amjad CPS 422

    Internet Address - Notations

    There are two notations to represent IPaddresseso Binary notation ando Dotted Decimal notation

    Binary Notationo Written as 32 bits usually with a space after every

    Octet (8 bits) e.g. 10101010 01110101 10110100 11011101o Can also be called as consisting of 4-bytes

    Dotted-Decimal Notationo To make the IP addresses compact and easier to read,

    they are written in decimal form with a decimal point(dot) separating the bytes

    o Because of 8-bits in a byte, every number in the dotteddecimal notation is between 0 and 255

    Faisal Amjad CPS 422

    Internet Address - Notations

    Example of the two Notations

    10000000 00001011 00000011 00011111

    128.11.3.31

    Faisal Amjad CPS 422

    IP Address - Classes

    Initially IP addressing used the concept of classesof address

    This architecture is called Classful Addressing

    Due to some problems (to be discussed later) a

    new architecture called Classless Addressing wasintroduced

    Systems are slowly migrating to Classlessaddressing

    Faisal Amjad CPS 422

    IP Classful Addressing

    In classful addressing, the address space isdivided into five classes: A,B,C,D and E

    The first few bits of an IP address tell the Classof address

    Class A

    Class B

    Class C

    Class D

    Class E

    First Byte Second Byte Third Byte Fourth Byte

    0

    10

    110

    1110

    1111

  • 8/14/2019 Network Layer-05-IP

    2/3

    Faisal Amjad CPS 422

    IP Address Finding the Class

    1st Bit 2nd Bit 3rd Bit 4th Bit

    Class A Class B Class C Class D

    Class E

    Start

    0

    1

    0

    1

    0

    1

    0

    1

    Faisal Amjad CPS 422

    Class A

    Class B

    Class C

    Class D

    Class E

    First Byte Second Byte Third Byte Fourth Byte0 to 127

    128 to 191

    192 to 223

    224 to 239

    240 to 255

    IP Address Finding the Class inDecimal Notation

    Faisal Amjad CPS 422

    IP Address NetID & HostID In classful addressing, an IP address is divided into two

    partso NetID ando HostID

    These parts are of varying lengths, depending upon theclass

    Class A

    Class B

    Class C

    Class D

    Class E

    First Byte Second Byte Third Byte Fourth Byte

    0

    10

    110

    1110

    1111

    Net ID

    Net -------------- ID

    Net ------------------------- ---------- ID

    Host ------------------- ID

    Host ------------------------- ------------ ID

    Host --- ID

    Multicast -------------Address

    Reserved for Future Use

    Faisal Amjad CPS 422

    IP Address Classes & Blocks

    The division of IP addresses into classes revealsthat every class can have a fixed number of blocksof addresses, with a fixed size

    For example, class A is divided into 128 blocks (0to 127), with each block having different netIDo All numbers in one byte, from 0 to 127 have the first bit

    equal to 0 (Hence these numbers show they belong to aclass A Address)

    o Hence, the first block covers addresses from 0.0.0.0 to0.255.255.255 with netID = 0

    o The second block covers addresses from 1.0.0.0 to1.255.255.255 with netID = 1

    o The last block of class A covers addresses from127.0.0.0 to 127.255.255.255 with netID = 127

    Faisal Amjad CPS 422

    IP Address Classes & Blocks

    Note that for each block of addresses (in a classA address), the first byte (netID) is the same

    The other 3-bytes (hostID) (in a class Aaddress)can take any value within the given range

    When an organization is given a block ofaddresses, the first address in it is used toidentify the organization on the Internet, hence itis called the Network Address, NOTany individualhost

    Faisal Amjad CPS 422

    IP Address Classes & Blocks

    For Future Use1E

    For multicasting1D

    2562,097,152C

    65,53616,384B

    16,777,216128A

    HostsBlocksClass Too Many

    Too Many

    Too Less

    Result is a lot of address wastage

  • 8/14/2019 Network Layer-05-IP

    3/3

    Faisal Amjad CPS 422

    IP Network Address

    Network address is an address that defines thenetwork itself

    It cannot be assigned to a hostProperties of network address are

    o All hostID bytes are 0s

    o It defines the network to rest of the Internet, helps inefficient routing of packets

    o It is the first address in the block

    o Given the network address, we can find the class ofaddress

    Faisal Amjad CPS 422

    Subnetting

    A portion of IP address indicates the network(netID) and a potortion indicates the hosts on thenetwork (through hostID)

    It means that there is a sense of heirarchy in IPaddressing

    To reach a host on the Internet, we must firstreach the network by using netID

    Then we must reach the host itself by using thehostID

    Therefore we can conclude that IP has two levelsof heirarchy

    Faisal Amjad CPS 422

    Subnetting

    An organization often needs to assemble its hostsinto groups i.e. the network needs to be subdividedinto subnetworks (or subnets)

    As the networks have network address to identifyit on the Internet, each subnet has a subnetaddress to identify the subnet within the network(and not outside it)

    Subnetting, therefore introduces another level ofhierarchy. Although the subnets in total stillappear as a single network to rest of the Internet

    Faisal Amjad CPS 422

    Subnetting Example

    Suppose our college is allotted a single class BBlock of IP address 141.14.0.0

    Also suppose that there are only four departmentsin our college namely CS, EE, IS and BasicSciences (or BS)

    Logically we would like to create separate subnetsfor each of the departments

    All departments would also be required to beinter-connected e.g. with routers

    Faisal Amjad CPS 422

    Subnetting Example

    CS EE

    IS BS

    To rest of the Internet

    141.14.192.2

    141.14.192.1

    Subnet:141.14.192.0

    Network Address:141.14.0.0

    Subnet:141.14.128.0

    Subnet:141.14.50.0 Subnet:

    141.14.115.0

    141.14.192.254

    141.14.192.3 141.14.128.1 141.14.128.254

    141.14.128.2

    141.14.128.3

    141.

    14.5

    0.

    2

    141.

    14.1

    15.

    2

    141.14.50.1 141.14.50.254 141.14.115.1 141.14.115.254