unit-2 internet.pdf

Upload: samsunglover

Post on 02-Apr-2018

240 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Unit-2 internet.pdf

    1/8

    UNIT 2 IP : NTERNET PROTOCOL

    Structure

    2.0 Introduction2.1 Objectives2.2 IP Header2.2.1 IP Addresses2.2.2 IP Address Components2.2.3 IT Address Format & Classes

    2.2.4 IP Routing2.2.5 IP Subnet Addressing2.2.6 Subnet Mask2.4 Summary2.5 Model Answers

    2.0 INTRODUCTION

    In UDP IP provides an unreliable, connectionl8ss datagram delivery service. There is noguarantee that an IP datagram will reach the destination. If a router temporarily runs outof buffers, IP runs an algorithm and throws away the datagram and tries to send anICMP message back to the,source. Required reliability is provided by TCP.

    IP does not maintain any state'information about successive datagrams. Each datagramsis handled independently from all other datagrams. If a source sends twaconsecutivedatagrams (A and B) to the same destination, each is routed independently and can takedifferent routes, with B arriving before A. In this unit we will discuss IP in quitedetail.

    2.1 OBJECTIVES-8 11After going through this unit, you will be able to understand the following:

    F r q e format of IPIP routing mechanism

    2.2 IP HEADER

    The Internet Protocol (IP), defined by IETF (Internet Engineering Task Force) RFC791,is the routing layer datagram service of the TCP/IP suite. All other protocols within theTCP/IP suite, except ARP and RAW, use IP to route frames from host to host. The IPframe header contains routing information and control information associated withdatagram delivery.

  • 7/27/2019 Unit-2 internet.pdf

    2/8

    Tlie 1P header structure is as follows:

    I identification I Flags I Fragment offset ITime to live Protocol Header checksum I

    Total lengther.

    Source addressDestinatio~i ddressOption + PaddingData

    -- - - -Figure 1 : 1P header structure

    IHL

    Explanation of the header structure

    Type of service

    VersionVersion field keeps track of which version of the protocol, the datagram belongs to:

    Internet Header length is the length of the lnternet header in 32-bit words. It Points tothe beginning of the data. Tlie ~ninimum alue for a correct header is 5 which applieswhen no options are present.Type of ServiceIndicates the quality of service desired by the host from the subnet. Variousco~nbi~iatio~isf reliability and speed are possible.For digitised voice, fast delivery beats accurate delivery. For file transfer, error freetransmission is more important than fast transmission.Total LengthLength of the datagram measured in bytes, including the lnternet header and data. Thisfield allows the length of a datagram to be up to 65,535 bytes, although such longdatagranis are impractical for most hosts and rietworks. All llosts .must be prepared toaccept datagrams of up to 576 bytes, regardless or whether they arrive whole or i nfragments. It is recommended that hosts send datagrams larger than 576 bytes only if thedestination is prepared to accept $e larger datagram. With future gigabits largerdatagranis will be needed.ldentificationIdentifjhg value assigned by the sender to aid in assembling the fragments of adatagrani.All the fragments of a datagrani contain the same identification value. Next comes anuiiused bit and then two bit 1 fields. DF Stands for Don't ~ragmen t.t is an order to

    IP : nterneProtoco

  • 7/27/2019 Unit-2 internet.pdf

    3/8

    TCPIIP Fundamenta l s routers riot fragment tlie datafrarn because the definiation is incapatable of putting thepieces back together again.MF stands for More Fragment. All fragments except the iast one have this bit set. It isneeded to known when all fragments of a datagram have arrived.Fragment offsetIndicates where this fragment belongs in the datagram. The fragment offset is measuredin units of 8 bytes (64 bits). The first fragment has offset zero.Since 13 bits are provided there is a maximum of 5192 fragments per datagram, giving'amaximum datagram length of 65 1536 bytes.Time to liveIndicates the maximum time the datagram is allowed to remain i n tlie Internet systeni. Ifthis field contains the value zero, the datagram must be destroyed. This field is modifiedin Internet header processing. The time is ~iieasured n units of seconds, allowing amaximum lifetime of 255 sec. It must be decremented on each hop and is si~pposedo bedecremented multiple times when queued for a long time in a router. 111practice, it justcounts hops.ProtocolIndicates the next level protocol used in the data portion of the In te r~ ~e tatagram. It stilltells the network layer which transport process to give it to. TCP is one possibility, butso are UDP and some others.Header checksumA checksum verifies the header only. Since some header fields change, e.g., 'Time ToLive', this is recomputed and verified at each point that the Internet header is processed.Source add reeldestination address32 bits each. A distinction is made between names, addresses and routes. A nameindicates an objects to be sought. An address indicates the location of tlie object. A routeindicates how to arrive at the object. The Internet protocol deals primarily withaddresses. It is the task of higher level protocols (such as host-to-host or application) tomake the mapping from names to addresses. The Internet module maps Internetaddresses to local net addresses. It is the task of lower level procedures (such as localnet or gateways) to make-the mapping from local net addresses to routes. [t indicatesthe network number and host number.OptionsOptions may or may not appear in datagrams. They must be implemented by all 1P -modules (host and gateways). What is optional is their transmission in any particulardatagram, not their implementation. In some environments, tlie security option may berequired in all datagrams. The option field is variable in length. There may be zero ormore options.2.2.1 IPAddressesTo understand IP address format the following definitions are important.

    Physical network: A collection of computers, com~nu~l icat io~~ sevices, wiring,etc. that communicate directly with one another (e.g., Ethernet, Token Ring).

  • 7/27/2019 Unit-2 internet.pdf

    4/8

    Host : A computer, connected to a physical network, tliat exchanges informationwith another computer via TCPIIP.Gateway: A computer tliat interconnects two or Inore physical networlchange I Paddress);are referenced by humans via dotted decimal (or dotted quad) notation, one ni~niberper 8 bits ( octet,or byte), e.g., 129.192.6.7.consist of three primary classes A, B and C (Class D s for nli~lticast) f tlie form[netid, liostid].

    Class A 1 0 I netid I Hosted 1Class B I 1 0 1 netid I hostidClass C I I I 1 I 0 I netidClass D I 1 I I 1 l 1 0 1 nii~lticast ddress

    Figure 2: Class Formats

    I n order to co~iimi~nicate11the Internet, each network adapter card on a compi~termustbe assigned an uniqtre 1P Address. This is an unique four-part, period delimited, addresscalled an Internet Protocol (ZP) ddress or IP nun~her.

    'Ihe first two might be reserved for any organization/instit~~tion/universitytc. forexample, IGNOU. Tlie third part yyy of the address identifies what suhnefthe computeris in. I n sollie organizations it is determined by what 6uildi11glde~art1ilentlie computeris located. For example School of Compi~ter cience. Although more than one subnetni~mbermay be in use within a single building, 110single subnet number can be used inone building if i t is already i n use i n another. Tlie final part of tlie address zzz isassigned arbitrary number to a given machine in the local subnet so tliat tlie entirenumber is rlnique.2.2.2 . IP Address ComponentsLike other network layer protocols, the IP addressing scheme is integral to tlie processof routing IP data through an internetwork.E;~cli ost 011 a I'CPII P networl< is assigned a u ~iiqi~e2-bit logical address. The IPaddress is divided into two main parts; tlie Network Number and the Host Numberl' l~ c etwork ni~mberdentities the network and must be assigned by the Inter~ietNetworlc Information Center (InterNIC) if the networl< is to be part of tlie Internet.'fhe liost number identifies a liost in the network and is assigned by the local networldatagram sent to arouter for delivery.Routing based on IP routing table of the fonn (netmask, net-address, next-hop)

    1 . Extract destination IP address ipdest from datagram2. Starting at the beginning of the routing table (and for each entry)

    a. Calculate network portion of ipdest --> ipnet =AND (netmask, ipdest)b. If ipnet equals net-address, send datagram to next-hopc. If ipnet does not equal net-address, repeat steps 1 and 2d. If no table entry matches, declare a routing error

    2.2.5 IP Subnet AddressingAll Classes of 1P networks can be divided into smaller networks called subnetworks (orsu bnets).Dividing the major class network is called subnetting. Subnetting provides networkadministrators with several benefits. It provides extra flexibility, n~akes fficient use ofnetwork address utilization, and contains broadcast traffic because a broadcast will notcross a router.Subnets are under local administration. As such, the outside world sees an organizationas a single network, and has not detailed knowledge of the organization's internalnetwork structure.A given network address can be brokequp into many subnetworks. For example,172.16.1.0, 172.16.2.0, 172.16.3.0,and 172.16.4 .0areal lsubnetsoftheClassBnetwork 17 1. 6.0.0.2.2.6 Subnet MaskA subnet address is created by "borrowing" bits from the host field and designatingthem as the subnet field. The number of borrowed bits is variable and specified by thesu bnet mask.

    IP : nternetProtocol

  • 7/27/2019 Unit-2 internet.pdf

    7/8

    The followi~igigure shows how bits are "borrowed" from the host address field tocreate the subnet address field:

    Figure 4: Class'B Address: Before & After Subnetting

    Subnet masks use the same format and representation technique as network maskformat, the subnet mask has binary 1s in all bits specifying the network and subnetworkfields, and binary 0s in all bits specifying the host field.'The following figure shows a sample subnet mask:

    Figure 5.:Subnet mask for Class B addressCheck Your Progress1 ) What are the various tlags in 1P header?

    ................................................................................................................................2) Explain the various class formats of IP address.

  • 7/27/2019 Unit-2 internet.pdf

    8/8

    1 M b a t d o 1011undcrsta~ld y 1P address'!

    2.3 SUMMARY1P (internet Protocol) is an unreliable (d elivery not guaranteed), connectionless ( packetsare independent of one another) and best effort (attempt to delivery packers) packetdelivery m echanism. Its basic unit is datagram (upto 65,535 bytes). This unit mainlycovered topics related to IP addressing routing etc.

    2.3 MODEL ANSWERSQuestion 1Quest io~l 2Q ~ ~ c s t i o n 7-7

    IP : nternetProtocol

    Refer to 2.2Refer to 2 2 . 3Refer to 2.2.1