dccn(4th & 5th unit)

Upload: ajoy-ku-panda

Post on 04-Feb-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/21/2019 DCCN(4th & 5th Unit)

    1/22

    Unit- IV

    What is Network Layer?

    The network layer is concerned with getting packets from thesource all the way to the destination.The functions of this layer

    include:

    1. Routing -The process of transferring packets received from the Data Link

    Layer of the source network to the Data Link Layer of the correctdestination network is called routing. Involves decision making at eachintermediate node on where to send the packet next so that it eventually

    reaches its destination. The node which makes this choice is called a router.For routing we require some mode of addressing which is recognied !y the

    "etwork Layer. This addressing is different from the #$% layer addressing.

    &. Inter-networking - The network layer is the same across all physicalnetworks 'such as Token()ing and *thernet+. Thus, if two physically

    different networks have to communicate, the packets that arrive at the DataLink Layer of the node which connects these two physically differentnetworks, would !e stripped of their headers and passed to the "etwork

    Layer. The network layer would then pass this data to the Data Link Layerof the other physical network...

    -. Congestion Control( If the incoming rate of the packets arriving at any

    router is more than the outgoing rate, then congestion is said to occur.%ongestion may !e caused !y many factors. If suddenly, packets !egin

    arriving on many input lines and all need the same output line, then a queuewill !uild up. If there is insufficient memory to hold all of them, packets will

    !e lost. ut even if routers have an infinite amount of memory, congestiongets worse, !ecause !y the time packets reach to the front of the queue, theyhave already timed out 'repeatedly+, and duplicates have !een sent. $ll these

    packets are dutifully forwarded to the next router, increasing the load all the

    way to the destination. $nother reason for congestion are slow processors. Ifthe router/s %0s are slow at performing the !ookkeeping tasks required ofthem, queues can !uild up, even though there is excess line capacity.

    2imilarly, low(!andwidth lines can also cause congestion.

    Routing: Routing is the process of forwarding of a packet in a network so that it

    reaches its intended destination. The main goals of routing are:

    1. Correctness: The routing should !e done properly and correctly so that thepackets may reach their proper destination.

  • 7/21/2019 DCCN(4th & 5th Unit)

    2/22

    &. Simplicity: The routing should !e done in a simple manner so that theoverhead is as low as possi!le. 3ith increasing complexity of the routing

    algorithms the overhead also increases.

    -. Robustness: 4nce a ma5or network !ecomes operative, it may !e expected

    to run continuously for years without any failures. The algorithms designedfor routing should !e ro!ust enough to handle hardware and software

    failures and should !e a!le to cope with changes in the topology and trafficwithout requiring all 5o!s in all hosts to !e a!orted and the network re!ooted

    every time some router goes down.

    6. Stability: The routing algorithms should !e sta!le under all possi!le

    circumstances.

    7. Fairness: *very node connected to the network should get a fair chance oftransmitting their packets. This is generally done on a first come first serve!asis.

    8. ptimality: The routing algorithms should !e optimal in terms ofthroughput and minimiing mean packet delays. 9ere there is a trade(off and

    one has to choose depending on his suita!ility.

    Static routing: Staticroutingis not really a routing protocol.Static routing is simply the process of manually

    enteringroutesinto a device's routing table via a conguration lethat is loaded when theroutingdevice starts up. As an alternativetheseroutescan be entered by anetworkadministrator whocongures theroutesmanually. Since these manuallyconguredroutesdon't change after they are congured !unless ahuman changes them" they are called 'static'routes.

    Static routing may have the following uses:

    Static routing can be used to define an exit point from a router when no other routes are

    available or necessary. This is called a default route.

    Static routing can be used for small networks that require only one or two routes. This is

    often more efficient since a link is not being wasted by exchanging dynamic routinginformation.

    Static routing is often used as a complement to dynamic routing to provide a failsafe

    backup in the event that a dynamic route is unavailable.

    Static routing is often used to help transfer routing information from one routing protocol

    to another (routing redistribution).

    http://www.inetdaemon.com/tutorials/internet/ip/routing/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://en.wikipedia.org/wiki/Default_routehttp://en.wikipedia.org/wiki/Default_routehttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/route.shtmlhttp://en.wikipedia.org/wiki/Default_routehttp://www.inetdaemon.com/tutorials/internet/ip/routing/index.shtml
  • 7/21/2019 DCCN(4th & 5th Unit)

    3/22

    Dynamic routing: #ynamicrouting protocolsare supportedbysoftwareapplications running on the routing device !therouter"which dynamically learnnetworkdestinations and how to get tothem and also advertise those destinations to other routers. This

    advertisement function allows all the routers to learn about all thedestinationnetworksthat e$ist and how to to thosenetworks.

    %lassication of Routing Algorithms

    The routing algorithms may !e classified as follows:

    1. !"apti#e Routing !lgorithm: These algorithms change their routingdecisions to reflect changes in the topology and in traffic as well. These get

    their routing information from ad5acent routers or from all routers. Theoptimiation parameters are the distance, num!er of hops and estimated

    transit time. This can !e further classified as follows:

    1. Centrali$e": In this type some central node in the network gets entire

    information a!out the network topology, a!out the traffic and a!outother nodes. This then transmits this information to the respective

    routers. The advantage of this is that only one node is required tokeep the information. The disadvantage is that if the central node goes

    down the entire network is down, i.e. single point of failure.

    &. Isolate": In this method the node decides the routing without seeking

    information from other nodes. The sending node does not know a!outthe status of a particular link. The disadvantage is that the packet may

    !e send through a congested route resulting in a delay. 2omeexamples of this type of algorithm for routing are:

    %ot &otato: 3hen a packet comes to a node, it tries to get rid

    of it as fast as it can, !y putting it on the shortest output queue

    without regard to where that link leads. $ variation of this

    algorithm is to com!ine static routing with the hot potatoalgorithm. 3hen a packet arrives, the routing algorithm takesinto account !oth the static weights of the links and the queue

    lengths.

    'ackwar" Learning: In this method the routing ta!les at each

    node gets modified !y information from the incoming packets.4ne way to implement !ackward learning is to include the

    identity of the source node in each packet, together with a hopcounter that is incremented on each hop. 3hen a node receives

    a packet in a particular line, it notes down the num!er of hops

    http://www.inetdaemon.com/tutorials/internet/ip/routing/routing_protocol.shtmlhttp://www.inetdaemon.com/tutorials/computers/software/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/router.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/router.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/routing_protocol.shtmlhttp://www.inetdaemon.com/tutorials/computers/software/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/router.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/internet/ip/routing/router.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtmlhttp://www.inetdaemon.com/tutorials/networking/lan/index.shtml
  • 7/21/2019 DCCN(4th & 5th Unit)

    4/22

    it has taken to reach it from the source node. If the previousvalue of hop count stored in the node is !etter than the current

    one then nothing is done !ut if the current value is !etter thanthe value is updated for future use. The pro!lem with this is

    that when the !est route goes down then it cannot recall thesecond !est route to a particular node. 9ence all the nodes

    have to forget the stored information;s periodically and start allover again.

    -. (istribute": In this the node receives information from itsneigh!ouring nodes and then takes the decision a!out which way to

    send the packet. The disadvantage is that if in !etween the the intervalit receives information and sends the packet something changes then

    the packet may !e delayed.

    &. Non-!"apti#e Routing !lgorithm: These algorithms do not !ase their

    routing decisions on measurements and estimates of the current traffic andtopology. Instead the route to !e taken in going from one node to the other is

    computed in advance, off(line, and downloaded to the routers when thenetwork is !ooted. This is also known as static routing. This can !e further

    classified as:

    1. Floo"ing: Flooding adapts the technique in which every incoming

    packet is sent on every outgoing line except the one on which it

    arrived. 4ne pro!lem with this method is that packets may go in aloop. $s a result of this a node may receive several copies of a

    particular packet which is undesira!le. 2ome techniques adapted to

    overcome these pro!lems are as follows:

    Se)uence Numbers: *very packet is given a sequence

    num!er. 3hen a node receives the packet it sees its sourceaddress and sequence num!er. If the node finds that it has sent

    the same packet earlier then it will not transmit the packet and

    will 5ust discard it.

    %op Count: *very packet has a hop count associated with it.

    This is decremented 'or incremented+ !y one !y each node

    which sees it. 3hen the hop count !ecomes ero 'or amaximum possi!le value+ the packet is dropped.

    Spanning *ree: The packet is sent only on those links that

    lead to the destination !y constructing a spanning tree routed atthe source. This avoids loops in transmission !ut is possi!le

    only when all the intermediate nodes have knowledge of thenetwork topology.

  • 7/21/2019 DCCN(4th & 5th Unit)

    5/22

    Flooding is not practical for general kinds of applications. ut incases where high degree of ro!ustness is desired such as in military

    applications, flooding is of great help.

    &. Ran"om Walk: In this method a packet is sent !y the node to one of

    its neigh!ours randomly. This algorithm is highly ro!ust. 3hen thenetwork is highly interconnected, this algorithm has the property of

    making excellent use of alternative routes. It is usually implemented!y sending the packet onto the least queued link.

    Shortest &ath Routing

    ere the central (uestion dealt with is 'ow to determine the

    optimal path for routing)' *arious algorithms are used to

    determine the optimal routes with respect to some predetermined

    criteria. A network is represented as a graph with its terminals as

    nodes and the links as edges. A 'length' is associated with each

    edge which represents the cost of using the link for transmission.

    +ower the cost more suitable is the link. The cost is determined

    depending upon the criteria to be optimi,ed. Some of the

    important ways of determining the cost are:

    Minimum number of hops: -f each link is given a unit cost

    the shortest path is the one with minimum number of hops.Such a route is easily obtained by a breadth rst searchmethod. This is easy to implement but ignores load linkcapacity etc.

    Transmission and Propagation Delays: -f the cost is

    $ed as a function of transmission and propagation delays itwill reect the link capacities and the geographicaldistances. owever these costs are essentially static and donot consider the varying load conditions.

    Queuing Delays: -f the cost of a link is determined through

    its (ueuing delays it takes care of the varying loadconditions but not of the propagation delays.

    -deally the cost parameter should consider all the above

    mentioned factors and it should be updated periodically to reect

    the changes in the loading conditions. owever if the routes are

    changed according to the load the load changes again. This

    feedback e/ect between routing and load can lead to undesirableoscillations and sudden swings.

  • 7/21/2019 DCCN(4th & 5th Unit)

    6/22

    CN+,S*IN CN*RL: %ongestion control refers to techniques andmechanisms that can either prevent congestion, !efore it happens, or removecongestion, after it has happened. In general, we can divide congestion control

    mechanisms into two !road categories: open(loop congestion control 'prevention+

    and closed(loop congestion control 'removal+.pen-Loop Congestion Controla.Retransmission &olicy:)etransmission is sometimes unavoida!le. f the senderfeels that a sent packet is lost or corrupted, the packet needs to !e retransmitted.

    )etransmission in general may increase congestion in the network. 9owever, agood retransmission policy can prevent congestion. The retransmission policy and

    the retransmission timers must !e designed to optimie efficiency and at the sametime prevent congestion.b.Win"ow &olicy:The type of window at the sender may also affect congestion.The 2elective )epeat window is !etter than the

  • 7/21/2019 DCCN(4th & 5th Unit)

    7/22

    packet is used for this purpose= in the explicit signaling method, the signal isincluded in the packets that carry data. *xplicit signaling, as we will see in Frame

    )elay congestion control, can occur in either the forward or the !ackwarddirection.

    Congestion control algorithms

    (a) Leaky Bucket Algorithm

    It is a traffic shaping mechanism

    that controls the amount and the rate

    of the traffic sent to the network.

    A leaky bucket algorithm shapes

    bursty traffic into fixed rate traffic byaveraging the data rate.

    Imagine a bucket with a small hole

    at the bottom.

    The rate at which the water is poured into the bucket is not fixed and can vary but it

    leaks from the bucket at a constant rate. Thus (as long as water is present in bucket)

    the rate at which the water leaks does not depend on the rate at which the water is

    input to the bucket.

    Also when the bucket is full any additional water that enters into the bucket spills

    over the sides and is lost.

    The same concept can be applied to packets in the network. !onsider that data is

    coming from the source at variable speeds. "uppose that a source sends data at #$

    %bps for & seconds. Then there is no data for ' seconds. The source again transmits

    data at a rate of # %bps for $ seconds. Thus in a time span of seconds *+ %b datahas been transmitted.

    If a leaky bucket algorithm is used the data flow will be + %bps for seconds. Thus

    constant flow is maintained.

    (b)Token bucket Algorithm

    The leaky bucket algorithm allows only an average (constant) rate of data flow. Its

    ma,or problem is that it cannot deal with bursty data.

  • 7/21/2019 DCCN(4th & 5th Unit)

    8/22

    A leaky bucket algorithm does not consider the idle time of the host. -or example if

    the host was idle for # seconds and now it is willing to sent

    data at a very high speed for another # seconds the total data

    transmission will be divided into $ seconds and average

    data rate will be maintained. The host is having no advantage of sitting

    idle for # seconds.

    To overcome this problem a token

    bucket algorithm is used. A token bucket

    algorithm allows bursty data transfers.

    A token bucket algorithm is a modification of leaky bucket in which leaky bucket

    contains tokens.

    In this algorithm a token(s) are generated at every clock tick. -or a packet to be

    transmitted system must remove token(s) from the bucket.

    Thus a token bucket algorithm allows idle hosts to accumulate credit for the future

    in form of tokens.

    -or example if a system generates # tokens in one clock tick and the host is idle

    for # ticks. The bucket will contain # tokens.

    ow if the host wants to send bursty data it can consume all # tokens at once

    for sending # cells or bytes.

    Thus a host can send bursty data as long as bucket is not empty.

    TCP/IP

    +ike 0S- network model T%&1-& also has a network model. T%&1-&

    was on the path of development when the 0S- standard was

    published and there was interaction between the designers

    of 0S-and T%&1-& standards. The T%&1-& model is not same as 0S-

    model. 0S-is a seven2layered standard but T%&1-& is a four layered

    standard.

    +ayer 3. Application +ayer

    Application layeris the top most layer of four layer T%&1-& model.Application layer is present on the top of theTransport layer.

    http://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/application-layer.phphttp://www.omnisecu.com/tcpip/transport-layer.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/osi-model.phphttp://www.omnisecu.com/tcpip/application-layer.phphttp://www.omnisecu.com/tcpip/transport-layer.php
  • 7/21/2019 DCCN(4th & 5th Unit)

    9/22

    Application layer denes T%&1-& application protocols and how host

    programs interface withTransport layerservices to use the network.

    Application layer includes all the

    higher2level protocols like #4S !#omain4aming System" TT& !yperte$t

    Transfer &rotocol" Telnet SS 5T& !5ile

    Transfer &rotocol" T5T& !Trivial 5ile

    Transfer &rotocol" S46& !Simple

    4etwork 6anagement &rotocol" S6T&

    !Simple 6ail Transfer &rotocol" #%&

    !#ynamic ost %onguration &rotocol" 7 8indows R#& !Remote

    #esktop &rotocol" etc.

    +ayer 9. Transport +ayer

    Transport +ayeris the third layer of the four layer T%&1-& model. The

    position of theTransport layeris between Application and -nternet

    layer. The purpose ofTransport layeris to permit devices on the

    source and destination hosts to carry on a conversation.Transport

    layerdenes the level of service and status of the connection used

    when transporting data.

    The main protocols included at Transport layer areT%& !Transmission

    %ontrol &rotocol"and #& !ser #atagram &rotocol".

    +ayer ;. -nternet +ayer

    -nternet +ayeris the second layer of the four layer T%&1-& model. The

    position of -nternet layeris between 4etwork Access

    +ayerandTransport layer. -nternet layerpack data into data packets

    known as -& datagrams which contain source and destination

    address !logical address or -& address" information that is used toforward the datagrams between hosts and across networks.

    The -nternet layeris also responsible for routing of -& datagrams.

    &acket switching network depends upon a connectionless

    internetwork layer. This layer is known as -nternet layer. -ts

  • 7/21/2019 DCCN(4th & 5th Unit)

    10/22

    The main protocols included at -nternet layerare -& !-nternet

    &rotocol" -%6& !-nternet %ontrol 6essage &rotocol" AR& !Address

    Resolution &rotocol" RAR& !Reverse Address Resolution &rotocol"

    and -=6& !-nternet =roup 6anagement &rotocol".

    +ayer >. 4etwork Access +ayer

    4etwork Access +ayeris the rst layer of the four layer T%&1-&

    model. 4etwork Access +ayerdenes details of how data is

    physically sent through the network including how bits are

    electrically or optically signaled by hardware devices that interface

    directly with a network medium such as coa$ial cable optical ber

    or twisted pair copper wire.

    The protocols included in 4etwork Access +ayerare ?thernetToken

    Ring 5##- 7.;@ 5rame Relay etc.The most popular +A4

    architecture among those listed above is ?thernet. ?thernet uses

    an Access 6ethodcalled %S6A1%# !%arrier Sense 6ultiple

    Access1%ollision #etection" to access the media when ?thernet

    operates in a shared media. An Access 6ethoddetermines how a

    host will place data on the medium.

    -4 %S6A1%# Access 6ethod every host has e(ual access to the

    medium and can place data on the wire when the wire is free from

    network trac. 8hen a host wants to place data on the wire it will

    check the wire to nd whether another host is already using the

    medium. -f there is trac already in the medium the host will wait

    and if there is no trac it will place the data in the medium.

    UDP User Datagram Protocol!

    D0 (( like its cousin the Transmission %ontrol 0rotocol 'T%0+ (( sits directly ontop of the !ase Internet 0rotocol 'I0+. In general, D0 implements a fairly

    >lightweight> layer a!ove the Internet 0rotocol. It seems at first site that similarservice is provided !y !oth D0 and I0, namely transfer of data. ut we need D0

    for multiplexing?demultiplexing of addresses.

    D0/s main purpose is to a!stract network traffic in the form of datagrams. $

    datagram comprises one single >unit> of !inary data= the first eight '@+ !ytes of adatagram contain the header information and the remaining !ytes contain the data

    itself.

    D0 9eaders

    The D0 header consists of four '6+ fields of two !ytes each:

    http://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-control-message-protocol-icmp.phphttp://www.omnisecu.com/tcpip/address-resolution-protocol-arp.phphttp://www.omnisecu.com/tcpip/address-resolution-protocol-arp.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/basic-networking/lan-technologies-ethernet.phphttp://www.omnisecu.com/basic-networking/lan-technologies-token-ring.phphttp://www.omnisecu.com/basic-networking/lan-technologies-token-ring.phphttp://www.omnisecu.com/basic-networking/lan-technologies-fibre-distributed-data-interface-fddi.phphttp://www.omnisecu.com/basic-networking/lan-technologies-ethernet.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/cisco-certified-network-associate-ccna/what-are-collision-domain-and-broadcast-domain.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-layer.phphttp://www.omnisecu.com/tcpip/internet-control-message-protocol-icmp.phphttp://www.omnisecu.com/tcpip/address-resolution-protocol-arp.phphttp://www.omnisecu.com/tcpip/address-resolution-protocol-arp.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/tcpip/network-access-layer.phphttp://www.omnisecu.com/basic-networking/lan-technologies-ethernet.phphttp://www.omnisecu.com/basic-networking/lan-technologies-token-ring.phphttp://www.omnisecu.com/basic-networking/lan-technologies-token-ring.phphttp://www.omnisecu.com/basic-networking/lan-technologies-fibre-distributed-data-interface-fddi.phphttp://www.omnisecu.com/basic-networking/lan-technologies-ethernet.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/cisco-certified-network-associate-ccna/what-are-collision-domain-and-broadcast-domain.phphttp://www.omnisecu.com/basic-networking/network-access-methods.phphttp://www.omnisecu.com/basic-networking/network-access-methods.php
  • 7/21/2019 DCCN(4th & 5th Unit)

    11/22

    2ource 0ort Destination 0ort

    length checksum

    source port num!er

    destination port num!er

    datagram sie

    checksum

    D0 port num!ers allow different applications to maintain their own >channels>

    for data= !oth D0 and T%0 use this mechanism to support multiple applicationssending and receiving data concurrently. The sending application 'that could !e a

    client or a server+ sends D0 datagrams through the source port, and the recipientof the packet accepts this datagram through the destination port. 2ome applications

    use static port num!ers that are reserved for or registered to the application. 4therapplications use dynamic 'unregistered+ port num!ers. ecause the D0 port

    headers are two !ytes long, valid port num!ers range from A to 877-7= !yconvention, values a!ove 6B171 represent dynamic ports.

    The datagram sie is a simple count of the num!er of !ytes contained in the headerand data sections . ecause the header length is a fixed sie, this field essentially

    refers to the length of the varia!le(sied data portion 'sometimes called thepayload+. The maximum sie of a datagram varies depending on the operating

    environment. 3ith a two(!yte sie field, the theoretical maximum sie is 877-7!ytes. 9owever, some implementations of D0 restrict the datagram to a smaller

    num!er (( sometimes as low as @1B& !ytes.

    D0 checksums work as a safety feature. The checksum value represents an

    encoding of the datagram data that is calculated first !y the sender and later !y thereceiver. 2hould an individual datagram !e tampered with 'due to a hacker+ or get

    corrupted during transmission 'due to line noise, for example+, the calculations ofthe sender and receiver will not match, and the D0 protocol will detect this error.

    The algorithm is not fool(proof, !ut it is effective in many cases. In D0, checksumming is optional (( turning it off squeees a little extra performance from the

    system (( as opposed to T%0 where checksums are mandatory. It should !eremem!ered that check summing is optional only for the sender, not the receiver.

    If the sender has used checksum then it is mandatory for the receiver to do so.

  • 7/21/2019 DCCN(4th & 5th Unit)

    12/22

    sage of the %hecksum in D0 is optional. In case the sender does not use it, itsets the checksum field to all A/s. "ow if the sender computes the checksum then

    the recipient must also compute the checksum an set the field accordingly. If thechecksum is calculated and turns out to !e all 1/s then the sender sends all 1/s

    instead of all A/s. This is since in the algorithm for checksum computation used !yD0, a checksum of all 1/s if equivalent to a checksum of all A/s. "ow the

    checksum field is unam!iguous for the recipient, if it is all A/s then checksum hasnot !een used, in any other case the checksum has to !e computed.

    Class0ul !""ressing: -n classful addressing the address space isdivided into ve classes: A B % # and ?. ?ach class occupies somepart of the address space. 8e can nd the class of an address whengiven the address in binary notation or dotted2decimal notation. -fthe address is given in binary notation the rst few bits can

    immediately tell us the class of the address. -f the address is givenin decimal2dotted notation the rst byte denes the class.

    4ne pro!lem with classful addressing is that each class is divided into a fixed

    num!er of !locks with each !lock having a fixed sie.

    In classful addressing, an I0 address in class $, , or % is divided into netid and

    hostid. These parts are of varying lengths, depending on the class of the

    address.

    The netid is in color, the hostid is in white.

    #uring the era of classful addressing subnetting was

    introduced. -f an organi,ation was granted a large block in

    class A or B it could divide the addresses into severalcontiguous groups and assign each group to smaller networks!called subnets".

    Classless !""ressing To overcome address depletion and give more organiationsaccess to the Internet, classless addressing was designed and implemented. In this

    scheme, there are no classes, !ut the addresses are still granted in !locks.

    In classless addressing, when an entity, small or large, needs to !e connected to

    the Internet, it is granted a !lock 'range+ of addresses. The sie of the !lock 'thenum!er of addresses+ varies !ased on the nature and sie of the entity.

    )estriction to simplify the handling of addresses, the Internet authorities impose threerestrictions on classless address !locks:

    1. The addresses in a !lock must !e contiguous, one after another.&. The num!er of addresses in a !lock must !e a power of & 'I, &, 6, @ ...+.

    -. The first address must !e evenly divisi!le !y the num!er of addresses.

  • 7/21/2019 DCCN(4th & 5th Unit)

    13/22

    Transport Layer: Transport layer offers peer!to!peer and end!to!end connection betweentwo processes on remote hosts. Transport layer takes data from upper layer (i.e. "pplicationlayer) and then breaks it into smaller si#e segments$ numbers each byte$ and hands over tolower layer (%etwork &ayer) for delivery.

    Functions : This &ayer is the first one which breaks the information data$ supplied by

    "pplication layer in to smaller units called segments. t numbers every byte in the segment and

    maintains their accounting.

    This layer ensures that data must be received in the same sequence in which it was

    sent.

    This layer provides end!to!end delivery of data between hosts which may or may not

    belong to the same subnet.

    "ll server processes intend to communicate over the network are equipped with well!

    known Transport Service "ccess 'oints (TS"'s) also known as port numbers.

    End-to-End Communication : " process on one host identifies its peer host on remotenetwork by means of TS"'s$ also known as 'ort numbers. TS"'s are very well defined and aprocess which is trying to communicate with its peer knows this in advance.The two main Transport layer protocols are:

    Transmission Control Protocol

    t provides reliable communication between two hosts.

    User Datagram Protocol

    t provides unreliable communication between two hosts.

    U"IT-V

    D"S Domain "ame Ser#ice!The internet primarily uses I0 addresses for locating nodes. 9owever, its humanly

    not possi!le for us to keep track of the many important nodes as num!ers.$lpha!etical names as we see would !e more convenient to remem!er than the

    num!ers as we are more familiar with words. 9ence, in the chaotic organiation ofnum!ers 'I0 addresses+ we would !e much relieved if we can use familiar sounding

    names for nodes on the network.

    There is also another motivation for D"2. $ll the related information a!out a

    particular network 'generally maintained !y an organiation, firm or university+should !e availa!le at one place. The organiation should have complete control

    over what it includes in its network and how does it >organie> its network.#eanwhile, all this information should !e availa!le transparently to the outside

    world.

    %onceptually, the internet is divide into several hundred top level domains where

    each domain covers many hosts. *ach domain is partitioned in su!domains which

    may !e further partitioned into su!su!domains and so on... 2o the domain space is

  • 7/21/2019 DCCN(4th & 5th Unit)

    14/22

    partitioned in a tree like structure as shown !elow. It should !e noted that this treehierarchy has nothing in common with the I0 address hierarchy or organiation.

    The internet uses a hierarchical tree structure of Domain "ame 2ervers for I0address resolution of a host name.

    The top level domains are either generic or

    names of countries. eg of generic top leveldomains are .edu .mil .gov .org .net

    .com .int etc. For countries we have one entry for each country as defined in I24-188. eg. .in 'India+ .uk

    'nited Cingdom+.

    The leaf nodes of this tree are target machines. 4!viously we would have to

    ensure that the names in a row in a su!domain are unique. The max length of anyname !etween two dots can !e 8- characters. The a!solute address should not !e

    more than &77 characters. Domain names are case insensitive. $lso in a name onlyletters, digits and hyphen are allowed. For eg. www.iitk.ac.in is a domain name

    corresponding to a machine named www under the su!su!domain iitk.ac.in.

    Resource Recor"s:

    *very domain whether it is a single host or a top level domain can have a set of

    resource records associated with it. 3henever a resolver 'this will !e explainedlater+ gives the domain name to D"2 it gets the resource record associated with it.2o D"2 can !e looked upon as a service which maps domain names to resource

    records. *ach resource record has five fields and looks as !elow:

    Domain "ame %lass Type Time to Live alue

    Domain name: the domain to which this record applies.

    %lass: set to I" for internet information. For other information other codes

    may !e specified.

    Type: tells what kind of record it is.

    Time to live: pper Limit on the time to reach the destination

    alue: can !e an I0 address, a string or a num!er depending on the recordtype.

  • 7/21/2019 DCCN(4th & 5th Unit)

    15/22

    A$esource $ecord!RR" has the following:

    o%nerwhich is the domain name where the RR is found.

    typewhich is an encoded >C bit value that species thetype of the resource in this resource record. -t can be one ofthe following:

    o &a host address

    o '"&M(identies the canonical name of an alias

    o )I"*+identies the %& and 0S used by a host

    o M,identies a mail e$change for the domain.

    o "Sthe authoritative name server for the domain

    o PT$a pointer to another part of the domain name

    space

    o S+&identies the start of a ,one of authority class

    which is an encoded >C bit value which identies aprotocol family or instance of a protocol.

    class0ne of:I"the -nternet system or')the %haos

    system

    TTwhich is the time to live of the RR. This eld is a 9; bit

    integer in units of seconds an is primarily used by resolverswhen they cache RRs. The TT+ describes how long a RR canbe cached before it should be discarded.

    $D&Tata in this eld depends on the values of the typeand class of the RR and a description for each is as follows:

    o for A: 5or the -4 class a 9; bit -& address 5or the %

    class a domain name followed by a >C bit octal %haosaddress.

    o for %4A6?: a domain name.

  • 7/21/2019 DCCN(4th & 5th Unit)

    16/22

    o for 67: a >C bit preference value !lower is better"

    followed by a host name willing to act as a maile$change for the owner domain.

    o

    for 4S: a host name.

    o for &TR: a domain name.

    o for S0A: several elds.

    "ote:8hile short TT+s can be used to minimi,e caching and a

    ,ero TT+ prohibits caching the realities of -nternet performance

    suggest that these times should be on the order of days for the

    typical host. -f a change can be anticipated the TT+ can be

    reduced prior to the change to minimi,e inconsistency during thechange and then increased back to its former value following the

    change. The data in the R#ATA section of RRs is carried as a

    combination of binary strings and domain names. The domain

    names are fre(uently used as DpointersD to other data in the #4S.Aliases and %annonical 4ames

    Some servers typically have multiple names for convenience. 5or

    e$ample www.iitk.ac.in E yamuna.iitk.ernet.in identify the same

    server. -n addition multiple mailbo$es might be provided by someorgani,ations. 6ost of these systems have a notion that one of

    the e(uivalent set of names is the canonical or primary name and

    all others are aliases.

    3hen a name server fails to find a desired )) in the resource set associated with

    the domain name, it checks to see if the resource set consists of a %"$#* record

    with a matching class. If so, the name server includes the %"$#* record in the

    response and restarts the query at the domain name specified in the data field of the

    %"$#* record.

    4ame Servers

    4ame servers are the repositories of information that make up the

    domain database. The database is divided up into sections called

    ,ones which are distributed among the name servers. 4ame

    servers can answer (ueries in a simple mannerF the response can

    always be generated using only local data and either contains

    the answer to the (uestion or a referral to other name servers

    DcloserD to the desired information. The way that the name server

  • 7/21/2019 DCCN(4th & 5th Unit)

    17/22

    answers the (uery depends upon whether it is operating in

    recursive mode or iterative mode:

    The simplest modefor the serveris non2recursive since it

    can answer (ueries using only local information: theresponse contains an error the answer or a referral to someother server DcloserD to the answer. All name servers mustimplement non2recursive (ueries.

    The simplest modefor the clientis recursive since in this

    mode the name server acts in the role of a resolver andreturns either an error or the answer but never referrals.

    This service is optional in a name server and the nameserver may also choose to restrict the clients which can userecursive mode.

    ?6A-+ !electronic mail 2 S6T& 6-6? ?S6T&"

    *mail is the most widely used application service which is used !y computer users.It differs from other uses of the networks as network protocols send packets

    directly to destinations using timeout and retransmission for individual segments ifno ack returns. 9owever in the case of email the system must provide for

    instances when the remote machine or the network connection has failed and takesome special action.*mail applications involve two aspects (

    ser(agent' pine, elm etc.+

    Transfer agent' sendmail daemon etc.+

    3hen an email is sent it is the mail transfer agent '#T$+ of the source thatcontacts the #T$ of the destination. The protocol used !y the #T$ /s on the

    source and destination side is called 2#T0. 2#T0 stands forSimple 1ail*rans0er &rotocol2. There are some protocols that come !etween the user agent

    and the #T$ eg. 040,I#$0 which are discussed later.

    1ail +ateways -

    6ail gateways are also called mail relays mail bridges and in such systems the

    senders machine does not contact the receiver's machine directly but sends

    mail across one or more intermediate machines that forward it on.

    Theseintermediate machinesare called mail gateways.6ail gateways areintroduce unreliablity.0nce the sender sends to rst intermediate m1c then it

    discards its local copy. So failure at an intermediate machine may result in

    message loss without informing the sender or the receiver. 6ail gateways also

    introduce delays. 4either the sender nor the receiver can determine how longthe delay will last or where it has been delayed.

  • 7/21/2019 DCCN(4th & 5th Unit)

    18/22

    owever mail gateways have an advantage providing interoperability ie. They

    provide connections among standard T%&1-& mail systems and other mail

    systems as well as between T%&1-& internets and networks that do not support

    -nternet protocols. So when there is a change in protocol then the mail gateway

    helps in translating the mail message from one protocol to another since it will

    be designed to understand both. .

    S-6&+? 6A-+ TRA4S5?R &R0T0%0+ !S6T&"

    T%&1-& protocol suite species a standard for the e$change of mail between

    machines. -t was derived from the !6T&" 6ail Transfer &rotocol. it deals with how

    the underlying mail delivery system passes messages across a link from one

    machine to another. The mail is enclosed in what is called an envelope. The

    envelope contains the To and 5rom elds and these are followed by the mail. The

    mail consists of two parts namely the eader and the #ata.

    The eader has the To and 5rom elds. -f eaders are dened by us they should

    start with 7. The standard headers do not start with 7.

    -n S6T& data portion can contain only printable AS%-- characters The old methodof sending a binary le was to send it in uuencoded form but there was no way to

    distinguish between the many types of binary les possible eg. .tar .g, .dvi

    etc.

    &R'L,1S WI*% S1*&

    1. There is no convenient way to send nonprinta!le characters

    &. There is no way to know if one has received mail or not or has read it or not.

    -. 2omeone else can send a mail on my !ehalf.

    2o a !etter protocol was proposed ( ,S1*&*2#T0 stands for *xtended 2imple

    #ail Transfer 0rotocol. It is compati!le with 2#T0. Eust as the first packet sent in

    2#T0 is 9*L4 similarly in *2#T0 the first packet is called *9*L4. If the

    receiver supports *2#T0 then it will answer to this *9*L4 packet !y sending

    what data type and what kind of encoding it supports. *ven a 2#T0 !ased receiver

    can reply to it. $lso if there is an error message or there is no answer then the

    sender uses 2#T0.

    "et%or. Security

    The various issues in "etwork security are as follows:

    1. !uthentication: 3e have to check that the person who has requested forsomething or has sent an e(mail is indeed allowed to do so. In this process

    we will also look at how the person authenticates his identity to a remotemachine.

  • 7/21/2019 DCCN(4th & 5th Unit)

    19/22

    &. Integrity: 3e have to check that the message which we have received isindeed the message which was sent. 9ere %)% will not !e enough !ecause

    some!ody may deli!erately change the data. "o!ody along the route should!e a!le to change the data.

    -. Con0i"entiality:"o!ody should !e a!le to read the data on the way so weneed *ncryption

    6. Non-repu"iation: 4nce we sent a message, there should !e no way that wecan deny sending it and we have to accept that we had sent it.

    7. !uthori$ation: This refers to the kind of service which is allowed for aparticular client. *ven though a user is authenticated we may decide not to

    authorie him to use a particular service.

    5or authentication if two persons know a secret then we

  • 7/21/2019 DCCN(4th & 5th Unit)

    20/22

    5. 1,SS!+, IN*,+RI*6: *ncryption and decryption provide secrecy, orconfidentiality, !ut not integrity2

    (ocument an" Fingerprint:4ne way to preserve the integrity of a document is through the

    use of a fingerprint. f $lice needs to !e sure that the contents of her document will not !eillegally changed,she can put her fingerprint at the !ottom of the document. *ve cannot modify

    the contents of this document or create a false document !ecause she cannot forge $lice/sfingerprint. To ensure that the document has not !een changed, $lice/s fingerprint on the

    documentcan !e compared to $lice/s fingerprint on file. f they are not the same, thedocument is

    not from $lice. *o preser#e the integrity o0 a "ocument7 both the "ocument an" the

    0ingerprint are nee"e"2

    1essage an" 1essage (igest: The electronic equivalent of the document and fingerprint pair is

    the message and message digest pail: To preserve the integrity of a message, the message is

    passed through an algorithm called a hash function. The hash function creates a compressedimage ofthe message that can !e used as a fingerprint. Figure shows the message, hash function,and the message digest. *he message "igest nee"s to be kept secret2

    Creating an" Checking the (igest: The message digest is created at the sender site and is

    sent with the message to the receiver. To check the integrity of a message, or document, thereceiver creates the hash function again and compares the new message digest with the one

    received. f !oth are the same, the receiver is sure that the original message has not !een

    changed. 4f course, we are assuming that the digest has !een sent secretly. Figure shows the

    idea. *o be eligible 0or a hash7 a 0unction nee"s to meet three criteria: one-wayness7

    resistance to weak collision7 an" resistance to strong collision2

    8. 1,SS!+, !9*%,N*IC!*IN:$ hash function guarantees the integrity of a message.

    t guarantees that the message has not !een changed. $ hash function, however, does not

    authenticate the sender of the message. 3hen $lice sends a message to o!, o! needs to

    know if the message is coming from $lice or *ve. To provide message authentication, $lice

    needs to provide proof that it is $lice sending the message and not an imposter. $ hash

    function per se cannot provide such a proof. The digest created !y a hash function is normally

    called a modificationdetection code '#D%+. The code can detect any modification in themessage.

    1!C: To provide message authentication, we need to change a modification detection code

    to a message authentication code '#$%+. $n #D% uses a keyless hash function.$ #$%uses a keyed hash function. $ keyed hash function includes the symmetric key !etween the

    sender and receiver when creating the digest. There are several implementations of #$% in

    use today. 9owever, in recent /years, some #$%s have !een designed that are !ased on

    keyless hash functions such as 29$(l. This idea is a hashed #$%, called 9#$% that can use

    any standard keyless hash function such as 29$(l. 9#$% creates a nested #$% !y applying

    a keyless hash function to the concatenation of the message and a symmetric key.. (I+I*!L SI+N!*9R,: $lthough a #$% can provide message integrity andmessage authentication, it has a draw!ack. t needs a symmetric key that must !e esta!lished

    !etween the sender and the receiver. $ digital signature, on the other hand, can use a pair of

    asymmetric keys 'a pu!lic one and a private one+. 3hen $lice sends a message to o!, o!

    needs to check the authenticity of the sender= he needs to !e sure that the message comes

    from $lice and not *ve. o! can ask $lice to sign the message electronically. In other words,

    an electronic signature can prove the authenticity of $lice as the sender of the message. 3e

    refer to this type of signature as a digital signature.

    Comparison: let us discuss the differences !etween two types of signatures: conventional

    and digital.

  • 7/21/2019 DCCN(4th & 5th Unit)

    21/22

    Inclusion: $ conventional signature is included in the document= it is part of the document.

    3hen we write a check, the signature is on the check= it is not a separate document. 4n the

    other hand, when we sign a document digitally, we send the signature as a separate document.

    The sender sends two documents: the message and the signature. The recipient receives !oth

    documents and verifies that the signature !elongs to the supposed sender. f this is proved, the

    message is kept= otherwise, it is re5ected.;eri0ication 1etho":The second difference !etween the two types of documents is the

    method of verifying the signature. In conventional signature, when the recipient receives a

    document, she compares the signature on the document with the signature on file. f they are

    the same, the document is authentic. The recipient needs to have a copy of this signature on

    file for comparison. In digital signature, the recipient receives the message and the signature.

    $ copy of the signature is not stored anywhere. The recipient needs to apply a verification

    technique to the com!ination of the message and the signature to verify the authenticity.

  • 7/21/2019 DCCN(4th & 5th Unit)

    22/22

    destination. This makes it easier to bill data usage. owever$ an "T network is less adaptable

    to a sudden network traffic surge.

    The "T provides data link layer services that run on the *S/s &ayer 0 physical links. t

    functions much like small!packet switched and circuit!switched networks$ which makes it ideal for

    real!rime$ low!latency data such as 1o' and video$ as well as for high!throughput data traffic likefile transfers. " virtual circuit or connection must be established before the two end points can

    actually exchange data.

    "T services generally have four different bit rate choices:

    "vailable 2it 3ate: 'rovides a guaranteed minimum capacity but data can be bursted to

    higher capacities when network traffic is minimal.

    ,onstant 2it 3ate: Specifies a fixed bit rate so that data is sent in a steady stream. This

    is analogous to a leased line.

    4nspecified 2it 3ate: +oesn5t guarantee any throughput level and is used for applications

    such as file transfers that can tolerate delays.

    1ariable 2it 3ate (123): 'rovides a specified throughput$ but data is not sent evenly. This

    makes it a even popular choice for voice and videoconferencing.

    !*1 !rchitecture:

    $T# is a cell(switched network. The user access devices, called the endpoints, are connected

    through a user(to(network interface '"I+ to the switches inside the network.The switches are connected through network(to(network interfaces '""Is+.