basic nw complete_chandan

Upload: gauravjuneja4

Post on 14-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Basic Nw Complete_Chandan

    1/627

    Welcome

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    2/627

    DATA COMMUNICATIONAND

    COMPUTER

    NETWORKS

    INTRODUCTION

  • 7/27/2019 Basic Nw Complete_Chandan

    3/627

    Data comn are the exchange of data b/w twodevices via some form of txn medium such aswire cable.

    These comn devices must be part of a comn sys(combination of HW & SW)

    Effectiveness of data comn depends upon Delivery

    Accuracy

    Timeliness

    Jitter

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    4/627

    Source

    Generates data to be transmitted

    Transmitter

    Converts data into transmittable signals Transmission System

    Carries data

    Receiver

    Converts received signal into data Destination

    Takes incoming data

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    5/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    6/627

    Message

    Sender

    Receiver Txn Media

    Protocol

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    7/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    8/627

    Simplex

    Half - Duplex

    Full - Duplex

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    9/627

    Simplex

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    10/627

    Half-Duplex

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    11/627

    Full-Duplex

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    12/627

    data flows move in one direction only, (radio or

    cable television broadcasts)

    data flows both ways, but only one direction at

    a time (e.g., CB radio) (requires control info)

    data flows in both directions at

    the same time

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    13/627

    NETWORKS

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    14/627

    A network is a set of devices(referred as

    nodes) connected by comn ch.

    Node can be any device capable of sending/

    receiving data generated by other nodes on

    the network.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    15/627

    Computer Network

    Computer Network is a collection of autonomous

    computers interconnected by a single technology. eg

    Ethernet LAN

    Is Interneta computer network?

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    16/627

    Distributed System is a collection of

    independent computers that appear to its

    users as a single coherent system

    Existence of multiple autonomous computers is

    transparent

    It is like a virtual uniprocessor

    Implemented in SW and build over computernetworks

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    17/627

    Performance

    Throughput (High)

    Delay (Low)

    Reliability

    Security

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    18/627

    Computers connected over a network canmake that information exchange easier andfaster.

    The information moves directly fromcomputer to computer rather than through ahuman intermediary.

    People can concentrate on getting their workdone rather than on moving informationaround the company.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    19/627

    Resource Sharing

    Robustness

    Load Balancing Location Independence

    Productivity

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    20/627

    Based on transmission technology

    Broadcast networks

    Pt-to-Pt networks

    Based on scale Personal Area Networks (PAN)

    Local Area Networks (LAN)

    Metropolitan Area Networks (MAN)

    Wide Area Networks (WAN)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    21/627

    Pt to Pt

    Broadcast

    Topology Based Cct SW Vs Message SW Vs Packet Sw

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    22/627

    Broadcast Networks

    Single comn channel shared by all cmptrs

    Packets send by one cmptr received by all others.

    Address in packet- specifies for whom intended.

    Packet can also be addressed to all cmptrs (broadcast)

    or a gp of cmptrs(Multicasting)

    Smaller networks broadcast

    Eg Ethernet(802.3),IBM Token Ring(802.5)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    23/627

    Single comn channel shared by all cmptrs on

    NW.

    Packets sent by one cmptr received by all others. Address fd in packet- specifies for whom

    intended.

    Packet can also be addressed to all cmptrs(broadcast).

    Some networks also support multicasting

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    24/627

    Point To Point Networks

    Many connections between indl pairs of cmptrs.

    Packets visit one or more intermediate machines.

    Multiple routes .

    Routing algorithm To determine the best route

    Also called as unicasting

    Larger networks pt to pt

    Eg. WAN

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    25/627

    Many connections between indl pairs ofcmptrs.

    Packets visit one or more intermediate

    machines. Multiple routes.

    Routing algorithm.

    Smaller networks broadcast larger networks pt to pt

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    26/627

    LAN

    WAN

    MAN

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    27/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    28/627

    A local area network (LAN) is a number ofcomputers connected to each other bycable in a single location by a common

    medium i.e switch, hub and etc, usually asingle floor of a building or all thecomputers in a small company within thegeographical area.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    29/627

    Local Area Networks(LAN)

    Within same building/ campus - upto a few kms.

    Speed 4/16/10/100/1000 Mbps.

    Normally broadcast type

    Topology (bus,ring, star) Restricted in size- worst case txn time is bounded and

    known in advance.eg 10 Mbps Ethernet LAN(10

    BaseT) has max dia of 500m Simple network management

    Eg- Ethernet(802.3),IBM Token Ring(802.5),Wi-

    Fi(802.11,Wireless LAN)Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    30/627

  • 7/27/2019 Basic Nw Complete_Chandan

    31/627

    Operates within the limited geographical area.

    Allow access through high bandwidth up to 1000

    mbps.

    Controls the network under local administration

    Provides the full time connectivity to local system.

    Connects physical adjacent devices.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    32/627

    Metropolitan Area Networks(MAN)

    Bigger version of LAN.

    Uses similar technology as LAN.

    Can cover a city.

    Eg- Wi-Max(802.16,Wireless MAN)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    33/627

    While local area networks are perfect for sharingresources within a building or campus, they cannot beused to connect distant sites.

    Wide area networks (WANs) fill this need. Stated

    simply, wide area networks are the set of connectinglinks between local area networks.

    These links are made over telephone lines leasedfrom the various telephone companies. In rareinstances, WANs can be created with satellite links,

    packet radio, or microwave transceivers. These options are generally far more expensive than

    leased telephone lines, but they can operate in areaswhere leased lines are not available.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    34/627

    A wide area network links computers in differentlocations.

    M C E M ESecunderabad

    ARMY HQ

    New Delhi

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    35/627

    Operates over a large geographical area.

    Allow access over serial interface

    Works at a local speed 2mbps is maximum speed

    in internet.

    Connects devices separates wide even global area.

    Lt Col Chandan Tiwari

    Wide Area Networks(WAN)

  • 7/27/2019 Basic Nw Complete_Chandan

    36/627

    Wide Area Networks(WAN)

    Spans larger geographical area.

    Collection of cmptrs (hosts) connected by a comn

    subnet

    Subnet consists of :-

    Transmission lines.

    Switching elements (or routers).

    Packet sent from router to router. (Store and fwd /

    packet switching)

    Gen Pt to Pt Topologies

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    37/627

    Star

    Mesh

    Ring

    Bus

    Hierarchical

    To reduce complexity of NW

    Better comd & contrl Better mgmt

    Tiered Architecture

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    38/627

    Point-to-Point Line Configuration

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    39/627

    Point-to-Point Line Configuration

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    40/627

    Point-to-Point Line Configuration

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    41/627

    Multipoint Line Configuration

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    42/627

    Mesh Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    43/627

    Star Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    44/627

    Tree Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    45/627

    Bus Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    46/627

    Ring Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    47/627

    Hybrid Topology

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    48/627

  • 7/27/2019 Basic Nw Complete_Chandan

    49/627

    Baseband

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    50/627

    Broadband

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    51/627

    Bandwidth is the capacity of a medium to conveydata.

    One example of bandwidth is automobile traffic. Atwo-lane road with a speed limit can accommodate

    only so many cars before there are too many and atraffic jam results.

    You can increase the bandwidth of a road by

    making the cars travel more quickly (which corresponds

    to using a faster transmission method in networks)or

    by making the road wider (which corresponds to usingmore wires in networks).

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    52/627

    Means sending a digital signal over channel w/ochanging digital signal to an analog signal.

    The cable connecting the computer can carry onesignal at a time, and all the system take turn using it.

    This type of network is called Base band network. In the base band network, when a computer transmits

    data it might be broken into many packet andtransmits separately.

    The receiving system reassembles them back intooriginal. This is called packet switching network.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    53/627

    The alternative to a packet switching network is cct

    switching. In CSN two system established a cct before

    communication and broken cct only after the finish the

    communication between them.

    HELLO HOW ARE YOU

    YOUAREHOWHELLO

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    54/627

  • 7/27/2019 Basic Nw Complete_Chandan

    55/627

  • 7/27/2019 Basic Nw Complete_Chandan

    56/627

  • 7/27/2019 Basic Nw Complete_Chandan

    57/627

  • 7/27/2019 Basic Nw Complete_Chandan

    58/627

    VOIP FTP Telnet

    Co-ax Wireless OFC

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    59/627

  • 7/27/2019 Basic Nw Complete_Chandan

    60/627

    Single comn channel shared by all cmptrs onNW.

    Packets sent by one cmptr received by allothers.

    Address fd in packet- specifies for whomintended.

    Packet can also be addressed to all cmptrs

    (broadcast). Some networks also support multicasting

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    61/627

  • 7/27/2019 Basic Nw Complete_Chandan

    62/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    63/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    64/627

  • 7/27/2019 Basic Nw Complete_Chandan

    65/627

  • 7/27/2019 Basic Nw Complete_Chandan

    66/627

  • 7/27/2019 Basic Nw Complete_Chandan

    67/627

    Computer NWs are often described using

    layered architecture

    Layered architecture specifies functionality at

    each layer (modularity)

    Higher layer protocols can operate without

    knowing details of the lower layers .

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    68/627

    Fundamental idea is to provide a service but

    keep details of implementation i.e. internal

    state and algorithms, at each level hidden.

    Info hiding.

    Abstraction

    Data encapsulation.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    69/627

  • 7/27/2019 Basic Nw Complete_Chandan

    70/627

  • 7/27/2019 Basic Nw Complete_Chandan

    71/627

    Layering hides information

    If it did not (layering violation) then changes to

    one layer could require changes everywhere

    Sometimes hiding information can degrade

    performance

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    72/627

    Example. flow control protocol at an upper layer may think

    packet loss is always because of network congestion

    But if it is due to a lossy link then performancedegrades.

    So hiding information about reason of packet loss

    from flow control protocol leads to degraded

    performance

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    73/627

    Conflict between information-hiding andachieving good performance

    Leak enough information to allow good

    performance but not so much that smallchanges in one layer need changes to other

    layers

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    74/627

  • 7/27/2019 Basic Nw Complete_Chandan

    75/627

    Aprotocolis a set of rules and formats thatgovern the communication between peers

    set of valid messages

    meaning of each message

    A protocol is necessary for any function that

    requires cooperation between peers

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    76/627

    Problem: Exchange a file over a network that

    may corrupt packets but doesnt lose or reorderthem

    A simple protocol

    send file as a series of packets send a checksum

    receiver sends OK or not-OK message

    sender waits for OK message if no response, resends entire file

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    77/627

  • 7/27/2019 Basic Nw Complete_Chandan

    78/627

    Switching

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    79/627

  • 7/27/2019 Basic Nw Complete_Chandan

    80/627

    Packet

    Switch

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    81/627

  • 7/27/2019 Basic Nw Complete_Chandan

    82/627

    A network is a set of connected devices.

    Prob how to connect them for one to one

    comn

    Pt to Pt

    Different topology

    Switching

    SW NW consists of a series of interlinked nodes,

    called switches.

    SW are capable of creating temp conn b/w two

    or more devices linked to SW.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    83/627

    The end devices are called stations. The switching devices are called nodes.

    Key features of a switched communicationnetwork Network Topology is not regular. Uses FDM or TDM for node-to-node communication.

    There exist multiple paths between a source-destination pair for better network reliability.

    The switching nodes are not concerned with thecontents of data.

    Their purpose is to provide a switching facility thatwill move data from node to node until they reachthe destination.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    84/627

  • 7/27/2019 Basic Nw Complete_Chandan

    85/627

  • 7/27/2019 Basic Nw Complete_Chandan

    86/627

    SwitchedNetworks

    CircuitSwitched NW

    PacketSwitched NW

    DatagramNW

    VirtualCircuit NW

    MessageSwitched NW

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    87/627

    circuit switching implies that there is adedicated communication path between the

    two stations.

    The path is a connected through a sequenceof links between network nodes.

    On each physical link, a logical channel is

    dedicated to the connection.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    88/627

    Circuit SW takes place at the physical layer Before starting comn, the stn must make a reservation of

    resources. BW in FDM / time slots in TDM

    SW Buffers

    SW processing time SW input/output port

    Data transfer are not packetized (Physical layer transfer),data are continuous flow

    No addressing involved during data transfer SWs route the data based on their occupied band(FDM) ortime slot (TDM)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    89/627

  • 7/27/2019 Basic Nw Complete_Chandan

    90/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    91/627

  • 7/27/2019 Basic Nw Complete_Chandan

    92/627

    Efficiency Low

    Delay Minimal

    No waiting at SWs Total delay = Time to est conn + transfer Data +

    Disconnect the circuit

    Data propagation delay 5msec per 1000km

    No congestion

    No Busy signal

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    93/627

  • 7/27/2019 Basic Nw Complete_Chandan

    94/627

  • 7/27/2019 Basic Nw Complete_Chandan

    95/627

  • 7/27/2019 Basic Nw Complete_Chandan

    96/627

  • 7/27/2019 Basic Nw Complete_Chandan

    97/627

  • 7/27/2019 Basic Nw Complete_Chandan

    98/627

  • 7/27/2019 Basic Nw Complete_Chandan

    99/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    100/627

  • 7/27/2019 Basic Nw Complete_Chandan

    101/627

  • 7/27/2019 Basic Nw Complete_Chandan

    102/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    103/627

    OSI Reference Model

  • 7/27/2019 Basic Nw Complete_Chandan

    104/627

    International Organisation for

    Standardisation (ISO) -international organisation

    responsible for a wide range

    of standards.

    1984 - Open Systems Interconnect ion (OSI)

    Reference Modelapproved as international

    std for comn architecture to aid NWinterconnection without necessarily requiring

    complete redesign.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    105/627

  • 7/27/2019 Basic Nw Complete_Chandan

    106/627

    7 Application

    6 Presentation

    5 Session

    4 Transport

    3 Network

    2 Data Link

    1 Physical

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    107/627

    7 Application

    6 Presentation

    5 Session

    4 Transport

    3 Network

    2 Data Link

    1 Physical

    NIC Card

    Hub

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    108/627

  • 7/27/2019 Basic Nw Complete_Chandan

    109/627

    Provides network services to

    application processes (such as

    electronic mail, file transfer, and

    terminal emulation)

    7 Application

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    110/627

  • 7/27/2019 Basic Nw Complete_Chandan

    111/627

  • 7/27/2019 Basic Nw Complete_Chandan

    112/627

  • 7/27/2019 Basic Nw Complete_Chandan

    113/627

    7 Application

    6 Presentation

    5Session

    Transport4

    Network3

    Inter-host communication

    Network services to applications

    Data representation

    End-to-end connection reliability

    Addresses and best path Identifying source and destination

    Path selection between two

    systems (routing)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    114/627

    7 Application

    6 Presentation

    5 Session

    Transport4

    Network3

    Data Link2

    Inter-host communication

    Network services to applications

    Data representation

    End-to-end connection reliability

    Addresses and best path

    Access to media

    Provides reliable transfer of dataacross media

    Physical addressing, network

    topology, error notification, flow

    control

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    115/627

    7 Application

    6 Presentation

    5 Session

    Transport4

    Network3

    Data Link2

    Physical1

    Inter-host communication

    Network services to applications

    Data representation

    End-to-end connection reliability

    Addresses and best path

    Access to media

    Binary transmission

    Wires, connectors, voltages,

    data rates

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    116/627

  • 7/27/2019 Basic Nw Complete_Chandan

    117/627

    Application

    Presentation

    Session

    Transport

    Network

    Physical

    Data Link

    Application

    Presentation

    Session

    Transport

    Network

    Physical

    Data Link

    Host A Host B

    Data} {

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    118/627

  • 7/27/2019 Basic Nw Complete_Chandan

    119/627

  • 7/27/2019 Basic Nw Complete_Chandan

    120/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    121/627

    message

    segmentdatagram

    frame

    sourceapplication

    transportnetwork

    linkphysical

    HtHnHl M

    HtHn MHt M

    M

    destinationapplicationtransportnetwork

    link

    physical

    HtHnHl M

    HtHn M

    Ht M

    Mnetwork

    linkphysical

    link

    physical

    HtHnHl MHtHn M

    HtHnHl MHtHn M

    HtHnHl M HtHnHl M

    router

    switch

    Data Encapsulation

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    122/627

  • 7/27/2019 Basic Nw Complete_Chandan

    123/627

  • 7/27/2019 Basic Nw Complete_Chandan

    124/627

  • 7/27/2019 Basic Nw Complete_Chandan

    125/627

  • 7/27/2019 Basic Nw Complete_Chandan

    126/627

    Layer 2

    Data Link Layer

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    127/627

    Reliable communication over a single link.

    Introduces the notion of a frame

    set of bits that belong together

    Begin and end markers delimit a frame

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    128/627

    On a broadcast link (such as Ethernet) end-system must receive only bits meant for it

    need datalink-layer address

    also need to decide who gets to speak next these functions are provided by Medium

    Access Sublayer

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    129/627

    DLL protocols are the first layer of SW &heavily dependent on underlying physical

    link properties.

    Hence, both physical and data link layers

    are usually bundled together on Network

    Interface Card

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    130/627

  • 7/27/2019 Basic Nw Complete_Chandan

    131/627

    24 bits

    ROM

    RAM

    24 bits

    2b5f.0c12. 3a56

    Serial NumberVendor Code

    MAC address is burned into ROM on a networkinterface card

    Can it be changed? (OTW)

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    132/627

    Layer 3

    Network Layer

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    133/627

    Breaks Transport Layer PDUs into

    packets and ensures their delivery

    Defines logical addressing

    Responsible for routing on the NW

    (Routers operate at this layer)

    Found both in end-systems and in

    intermediate systems

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    134/627

  • 7/27/2019 Basic Nw Complete_Chandan

    135/627

  • 7/27/2019 Basic Nw Complete_Chandan

    136/627

    Network Node

    1 1GeneralExample

    Network Host

    10. 8.2.48TCP/IPExample

    (Mask 255.0.0.0)

    Network Node

    1aceb0b. 0000.0c00.6e25Novell IPXExample

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    137/627

    BB

    X Y

    AA

    CC

    Presentation

    Data Link

    Physical

    Data Link

    Physical

    Router A Router B Router C

    Data Link

    Physical

    Data Link

    Network

    Transport

    Session

    Presentation

    Application

    Physical

    Host X Host Y

    Data LinkNetwork

    Transport

    Session

    Application

    Physical

    Network Network Network

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    138/627

  • 7/27/2019 Basic Nw Complete_Chandan

    139/627

  • 7/27/2019 Basic Nw Complete_Chandan

    140/627

  • 7/27/2019 Basic Nw Complete_Chandan

    141/627

    AA BB

    CCDD

    XX

    Can an alternate route substitute for a failed route?

    Yes but With dynamic routing enabled

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    142/627

  • 7/27/2019 Basic Nw Complete_Chandan

    143/627

  • 7/27/2019 Basic Nw Complete_Chandan

    144/627

    Transport Layer

    Layer 4

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    145/627

  • 7/27/2019 Basic Nw Complete_Chandan

    146/627

    Transport layer Multiplexes multiple applications to the same end to end

  • 7/27/2019 Basic Nw Complete_Chandan

    147/627

    Multiplexes multiple applications to the same end-to-end

    connection

    adds an application-specific identifier (port number) so that receivingend-system can hand in incoming packet to the correct application

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    148/627

  • 7/27/2019 Basic Nw Complete_Chandan

    149/627

    Transmit

    Buffer Full

    Not ReadyStopProcess

    Segments

    Buffer OKReadyGo

    Resume Transmission

    ReceiverSender

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    150/627

  • 7/27/2019 Basic Nw Complete_Chandan

    151/627

  • 7/27/2019 Basic Nw Complete_Chandan

    152/627

  • 7/27/2019 Basic Nw Complete_Chandan

    153/627

    Not common

    Establishes, manages, and terminatessessions between applications

    Provides full-duplex service, expedited

    data delivery, and session synchronization

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    154/627

    Duplex

    if transport layer is simplex, concatenates twotransport endpoints together

    Expedited data delivery

    allows some messages to skip ahead in end-system queues, by using a separate low-delay transport layer endpoint

    Synchronization

    allows users to place marks in data streamand to roll back to a pre-specified mark

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    155/627

    Presentation Layer

    Layer 6

    Lt Col Chandan Tiwari

    U lik th l hi h d l ith h d

  • 7/27/2019 Basic Nw Complete_Chandan

    156/627

    Unlike other layers which deal with headers,

    presentation layer also touches theapplication data

    Hides data representation differences

    between applications. For example: Endian-ness Characters (ASCII, unicode, EBCDIC.)

    Can also encrypt data

    Compression

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    157/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    158/627

    Application Layer

    Layer 7

    Lt Col Chandan Tiwari

    Closest to the user

  • 7/27/2019 Basic Nw Complete_Chandan

    159/627

    Closest to the user.

    Provides network services to the users applications. Application layer establishes the availability of intended

    communication partners, synchronizes and establishesagreement on procedures control of data integrity.

    Differs from other layers in that it does not provide

    services to any other OSI layer, but rather, only toapplications outside the OSI model.

    Examples of such applications are Spreadsheetprograms, Network virtual terminal, Mail services,Directory services, File transfer, access, and

    management.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    160/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    161/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    162/627

    TCP/ IP REFERENCEMODEL

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    163/627

    Research sponsored by United States DoD Major design goals

    Ability to connect multiple NWs seamlessly

    Survivability

    Flexible architecture to cater for applications with divergentrequirements

    DoD wanted connections to remain intact as long as source

    and destination machines were intact.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    164/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    165/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    166/627

  • 7/27/2019 Basic Nw Complete_Chandan

    167/627

    Connectionless packet switched service Uses Internet Protocol (IP) which defines packets

    Permit injection of packets into any NW and have them

    travel independently to the destination

    Packet routing and congestion control are major issues.

    Similar to OSI Network Layer .

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    168/627

    Designed to allow conversation between peer entities on

    source and destination hosts Similar to OSI Transport Layer.

    Two protocols defined for this layer:

    Transmission Control Protocol (TCP) - handles flow control and

    sequencing. Reliable connection oriented protocol

    User Datagram Protocol (UDP) prompt delivery more importantthan accurate delivery. Unreliable connectionless protocol

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    169/627

    No session or presentation layer.

    Application layer serves as the communication interfacefor users by providing specific application services to theuser

    Protocols - Virtual terminal (telnet), FTP, SMTP, DNS,HTTP, etc.

    Lt Col Chandan Tiwari

    TCP/IP f d l d l d d h OSI

  • 7/27/2019 Basic Nw Complete_Chandan

    170/627

    TCP/IP reference models development preceded the OSI

    model by several years. Unlike OSI, TCP/IP was never intended to be an

    international standard.

    TCP/IP was not designed with layers and does not fit neatly

    into OSI models 7 layers.

    OSI introduces the concept of Services, Interfaces and

    Protocols. TCP/IP model originally did not distinguish

    between these.

    Lt Col Chandan Tiwari

    P t l b tt hidd i OSI d l d th il

  • 7/27/2019 Basic Nw Complete_Chandan

    171/627

    Protocols better hidden in OSI model and thus easily

    replaced with change in technology

    In OSI model, protocols were invented after model was

    devised. In TCP/IP model, protocols came first and model

    was merely description of protocols

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    172/627

    ADDRESSES

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    173/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    174/627

    MAC SUB LAYER

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    175/627

  • 7/27/2019 Basic Nw Complete_Chandan

    176/627

    Static allocation The channel BW is divided equally among users.

    Unused bandwidth will be lost.

    Dynamic allocation

    Users able to access unused bandwidth from

    others.

    There is no dedicated bandwidth.

    Lt Col Chandan Tiwari

    Traditional method example - Frequency Division

  • 7/27/2019 Basic Nw Complete_Chandan

    177/627

    Traditional method example Frequency Division

    Multiplexing (FDM). Involves splitting up the usable frequency into

    smaller channels.

    Unused bandwidth will be wasted, but the allocatedbandwidth is guaranteed.

    Simple and efficient for known workloads.

    Lt Col Chandan Tiwari

    Larger the number of users, smaller are the FDM

  • 7/27/2019 Basic Nw Complete_Chandan

    178/627

    channels.

    In computer systems, data is generally bursty, thus,

    FDM results in poor bandwidth utilization as stn is

    idle for most of the time.

    Data bursts from one computer will take a long time

    to travel over the bandwidth, while other computers

    may not be using their resources.

    Similar is the case for Time Division Multiplexing

    (TDM)

    Lt Col Chandan Tiwari

    Key assumptions:

  • 7/27/2019 Basic Nw Complete_Chandan

    179/627

    Key assumptions:

    Station Model

    The network consists of independent stations (orcomputers).

    All stations are considered to be equal.

    They produce frames to be transmitted.

    Once a frame is generated the station is blocked

    and does nothing until the frame has beensuccessfully transmitted.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    180/627

    Single Channel Assumption There will be a single channel for all of the

    terminals to communicate on.

    All stations can transmit and receive on it.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    181/627

  • 7/27/2019 Basic Nw Complete_Chandan

    182/627

    C i S

  • 7/27/2019 Basic Nw Complete_Chandan

    183/627

    Carrier Sense

    The terminal can sense if the channel is busy No terminal will transmit until the channel is idle

    No Carrier Sense

    The terminal cannot sense if the channel is busy

    Terminals will transmit and check for collisions later.

    LANs generally use Carrier Sense but not satellitenetworks. Why?

    Lt Col Chandan Tiwari

    If more than 2 users send at the same time - collision

  • 7/27/2019 Basic Nw Complete_Chandan

    184/627

    All collided packets are lost -> waste of bandwidth

    Ideally, the MAC protocol for a broadcast channel with

    the bit-rate R bpsshould satisfy:

    if only 1 node is sending then the throughput is R

    when M nodes have data to send than the

    throughput is R/M

    decentralized protocol no master

    simple & inexpensive to implement

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    185/627

    Carrier Sense Multiple Access Protocols (CSMA) Collision-Free Protocols

    Wireless LAN Protocols

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    186/627

    Stn monitors the channel until it is idle.

  • 7/27/2019 Basic Nw Complete_Chandan

    187/627

    Once it is idle, the Stn transmits.

    If a collision occurs the stn waits for a random amount of timeand starts all over again.

    Known as 1-persistent because the probability that it willtransmit on an idle channel is 1.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    188/627

    Longer is the propagation delay, worse is theperformance of the protocol

    Lt Col Chandan Tiwari

    Limitations of 1 persistent protocol

  • 7/27/2019 Basic Nw Complete_Chandan

    189/627

    Propagation Delay.

    Simultaneous Txn will result in collisions.

    Lt Col Chandan Tiwari

    Before sending Node senses the channel. If idle it

  • 7/27/2019 Basic Nw Complete_Chandan

    190/627

    transmits its frame. If channel is busy, the node waits for random time

    and then repeats the algorithm.

    Less greedy than 1-persistent protocol which

    continues to sense the channel to try to seize itimmediately upon detecting the end of previous

    transmission.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    191/627

  • 7/27/2019 Basic Nw Complete_Chandan

    192/627

  • 7/27/2019 Basic Nw Complete_Chandan

    193/627

    Comparison of the channel utilization versus

    load for various random access protocols.Lt Col Chandan Tiwari

    Stations abort transmission on detecting collision asopposed to continuing to send out data that will be

  • 7/27/2019 Basic Nw Complete_Chandan

    194/627

    opposed to continuing to send out data that will be

    lost anyway. In CSMA, each collision wastes at least one complete

    frame time, because both stations transmit theircomplete frames even though they are garbled theinstant they collide.

    Terminating the transmission on detecting collisionsaves both time and bandwidth.

    The transmitting stns will then wait a random

    amount of time and try again.

    Used in Ethernet LAN.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    195/627

    Collision detection can take as long as 2. A stn cannot be sure

    that it has seized the channel until it has transmitted for 2

    without hearing a collision Lt Col Chandan Tiwari

    802.1: This standard gives an introduction to the set ofstandards

    802 2: This standard describes the upper part of the DLL

  • 7/27/2019 Basic Nw Complete_Chandan

    196/627

    802.2: This standard describes the upper part of the DLL,

    which uses Logical Link Control Protocol. 802.3: Describes the LAN Standard for Ethernet 802.4: Describes the LAN Standard Token Bus 802.5: Describes the LAN Standard Token Ring 802.6: Describes the LAN Standard Distributed Queue Dual Bus

    (DQDB) 802.11: Wireless LAN 802.15: Bluetooth 802.16: Wireless MAN

    Each standard covers the physical layer and MAC sublayerprotocol

    Lt Col Chandan Tiwari

    Ethernet refers to cable (the ether)

    d i t i d LAN t h l

  • 7/27/2019 Basic Nw Complete_Chandan

    197/627

    dominant wired LAN technology

    first widely used LAN technology Simpler, cheap

    Kept up with speed race: 10 Mbps 10 Gbps

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    198/627

  • 7/27/2019 Basic Nw Complete_Chandan

    199/627

  • 7/27/2019 Basic Nw Complete_Chandan

    200/627

  • 7/27/2019 Basic Nw Complete_Chandan

    201/627

    LLC

    MAC

    Network layer

    Physical layer

    PKT

    LLC PKT

    MAC LLC PKT MAC

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    202/627

  • 7/27/2019 Basic Nw Complete_Chandan

    203/627

    WIRELESS 802.11

    Lt Col Chandan Tiwari

    Modes of operation

  • 7/27/2019 Basic Nw Complete_Chandan

    204/627

    Point Coordination Function (PCF) - In the presenceof a base station all communication must go through

    the base station, called an access point

    Distribution Coordination Function(DCF) - In the

    absence of a base station the computers would just

    send to one another directly. This mode is now

    sometimes called adhoc networking

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    205/627

  • 7/27/2019 Basic Nw Complete_Chandan

    206/627

  • 7/27/2019 Basic Nw Complete_Chandan

    207/627

  • 7/27/2019 Basic Nw Complete_Chandan

    208/627

  • 7/27/2019 Basic Nw Complete_Chandan

    209/627

  • 7/27/2019 Basic Nw Complete_Chandan

    210/627

  • 7/27/2019 Basic Nw Complete_Chandan

    211/627

  • 7/27/2019 Basic Nw Complete_Chandan

    212/627

    Upon correct receipt of the data frame, B responds with anACK frame, terminating the exchange. If A's ACK timerexpires before the ACK gets back to it, the whole protocol isrun again.

  • 7/27/2019 Basic Nw Complete_Chandan

    213/627

    C is within range of A, so it may receive the RTS frame. If itdoes, it realizes that someone is going to send data soon,so for the good of all it desists from transmitting anythinguntil the exchange is completed. From the informationprovided in the RTS request, it can estimate how long thesequence will take, including the final ACK, so it asserts a

    kind of virtual channel busy for itself, indicated by NAV(Network Allocation Vector). D does not hear the RTS, butit does hear the CTS, so it also asserts the NAV signal foritself.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    214/627

  • 7/27/2019 Basic Nw Complete_Chandan

    215/627

  • 7/27/2019 Basic Nw Complete_Chandan

    216/627

  • 7/27/2019 Basic Nw Complete_Chandan

    217/627

  • 7/27/2019 Basic Nw Complete_Chandan

    218/627

    Duration field tells how long the frame and itsacknowledgement will occupy the channel. This field is alsopresent in the control frames and is how other stations managethe NAV mechanism

  • 7/27/2019 Basic Nw Complete_Chandan

    219/627

    the NAV mechanism.

    The frame header contains four addresses. The source anddestination are obviously needed. The other two addresses areused for the source and destination base stations for intercelltraffic.

    Sequence field allows fragments to be numbered. Of the 16 bitsavailable, 12 identify the frame and 4 identify the fragment.

    Data field contains the payload, up to 2312 bytes

    Checksum

    Management frames have a format similar to that of data

    frames, except without one of the base station addressesbecause management frames are restricted to a single cell.

    Control frames are shorter still, having only one or twoaddresses, no Data field, and no Sequence field. The keyinformation here is in the Subtype field, usually RTS, CTS, or ACK.

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    220/627

  • 7/27/2019 Basic Nw Complete_Chandan

    221/627

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    222/627

    Link Layer: Introduction

    Some terminology: hosts and routers are nodes

    link

  • 7/27/2019 Basic Nw Complete_Chandan

    223/627

    5: DataLink Layer 5-226

    hosts and routers are nodes

    communication channels thatconnect adjacent nodes alongcommunication path are links wired links

    wireless links LANs

    layer-2 packet is a frame,encapsulates datagram

    data-link layer has responsibility oftransferring datagram from one nodeto adjacent node over a link

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    224/627

  • 7/27/2019 Basic Nw Complete_Chandan

    225/627

    Link Layer Services (more)

  • 7/27/2019 Basic Nw Complete_Chandan

    226/627

    5: DataLink Layer 5-229

    Flow Control: pacing between adjacent sending and receiving nodes important if large propagation delays

    Error Detection:

    errors caused by signal attenuation, noise. receiver detects presence of errors:

    signals sender for retransmission or drops frame

    Error Correction:

    receiver identifies and correctsbit error(s) withoutresorting to retransmission

    Half-duplex and full-duplex with half duplex, nodes at both ends of link can transmit,

    but not at same time Lt Col Chandan Tiwari

    Adaptors Communicating

    sending

    rcvingdatagram

    link layer protocol

  • 7/27/2019 Basic Nw Complete_Chandan

    227/627

    5: DataLink Layer 5-230

    link layer implemented in

    adaptor (aka NIC) Ethernet card, PCMCI

    card, 802.11 card

    sending side:

    encapsulates datagram ina frame

    adds error checking bits,rdt, flow control, etc.

    receiving side looks for errors, rdt, flow

    control, etc

    extracts datagram, passesto rcving node

    adapter is semi-autonomous

    link & physical layers

    g

    nodeframe

    nodeframe

    adapter adapter

    Lt Col Chandan Tiwari

  • 7/27/2019 Basic Nw Complete_Chandan

    228/627

    Error Detection

    EDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking, may include header fields

  • 7/27/2019 Basic Nw Complete_Chandan

    229/627

    5: DataLink Layer 5-232

    p y g y

    Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction

    Lt Col Chandan Tiwari

    Parity Checking

    Single Bit Parity: Two Dimensional Bit Parity:and correct

  • 7/27/2019 Basic Nw Complete_Chandan

    230/627

    5: DataLink Layer 5-233

    Detect single bit errors Detectand correct

    single bit errors

    0 0

    Lt Col Chandan Tiwari

    Internet checksum

    Goal:detect errors (e.g., flipped bits) in transmitted

  • 7/27/2019 Basic Nw Complete_Chandan

    231/627

    5: DataLink Layer 5-234

    Sender: treat segment contents

    as sequence of 16-bitintegers

    checksum: addition (1scomplement sum) ofsegment contents

    sender puts checksumvalue into UDP checksumfield

    Receiver: compute checksum of received

    segment

    check if computed checksumequals checksum field value:

    NO - error detected

    YES - no error detected. Butmaybe errors nonetheless?

    segment (note: used at transport layer only)

    Lt Col Chandan Tiwari

    Cyclic Redundancy Check

    view data bits, D, as a binary number

  • 7/27/2019 Basic Nw Complete_Chandan

    232/627

    5: DataLink Layer 5-235

    choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that

    exactly divisible by G (modulo 2)

    receiver knows G, divides by G. If non-zero remainder:error detected!

    can detect all burst errors less than r+1 bits widely used in practice (ATM, HDLC)

    Lt Col Chandan Tiwari

    CRC Example

    Want:r

  • 7/27/2019 Basic Nw Complete_Chandan

    233/627

    5: DataLink Layer 5-236

    D.2r

    XOR R = nGequivalently:

    D.2r = nG XOR Requivalently:

    if we divide D.2r byG, want remainder R

    R = remainder[ ]D.2rG

    Lt Col Chandan Tiwari

    Part 3: Link Layer

    3.1 Introduction and 3.6 Hubs and switches

  • 7/27/2019 Basic Nw Complete_Chandan

    234/627

    5: DataLink Layer 5-237

    services 3.2 Error detection

    and correction

    3.3Multiple accessprotocols

    3.4 Link layeraddressing

    3.5 Ethernet

    3.7 PPP

    Lt Col Chandan Tiwari

    Multiple Access Links and Protocols

    Two types of links: point-to-point

  • 7/27/2019 Basic Nw Complete_Chandan

    235/627

    5: DataLink Layer 5-238

    PPP for dial-up access point-to-point link between Ethernet switch and host

    broadcast (shared wire or medium) Old-fashioned Ethernet

    upstream HFC 802.11 wireless LAN

    Lt Col Chandan Tiwari

    Multiple Access protocols

    single shared broadcast channel

  • 7/27/2019 Basic Nw Complete_Chandan

    236/627

    5: DataLink Layer 5-239

    two or more simultaneous transmissions by nodes:interference collision if node receives two or more signals at the same time

    multiple access protocol

    distributed algorithm that determines how nodes sharechannel, i.e., determine when node can transmit

    communication about channel sharing must use channelitself!

    no out-of-band channel for coordination

    Lt Col Chandan Tiwari

    802.3 MAC Sub Layer Protocol

    Preamble Length Data PadCheck-SourceDestination

    SO

    Bytes 7 1 2/ 6 2/ 6 2 0-1500 0-46 4

  • 7/27/2019 Basic Nw Complete_Chandan

    237/627

    Preamble of 7 bytes each with bit pattern 10101010 Manchester Encoding of this pattern produces 10 MHzsquare wave for 5.6 sec to allow the receiver clock to

    synchronise with the senders. 1 byte Start of Frame 10101011 delimiter

    6 byte source and destination addresses.

    Length indicates number of bytes in data field.

    Pad field ensures min frame size is 64 bytes (lessPreamble+SOF)

    Checksum field 32 bit CRC

    sumAddressAddressF

    48 bit address field provide a unique MAC address

    Higher order bit(47th bit) 0 for ordinary addresses and

  • 7/27/2019 Basic Nw Complete_Chandan

    238/627

    1 for group/multicast address. 46th bit to distinguishbetween local and global address-2^(48-2).

    All bits are 1 for a broadcast address

    The MAC ADDRESS is burned into ROM on a network

    interface card

    24 bits

    ROMRAM

    24 bits

    00-90-F5 - 0C-99-6ASerial NumberVendor Code

    Lt Col Chandan Tiwari

    Ideal Multiple Access Protocol

    Broadcast channel of rate R bps

  • 7/27/2019 Basic Nw Complete_Chandan

    239/627

    5: DataLink Layer 5-242

    1. When one node wants to transmit, it can send atrate R.

    2. When M nodes want to transmit, each can send ataverage rate R/M

    3. Fully decentralized: No special node to coordinatetransmissions

    4. Simple

    Lt Col Chandan Tiwari

    MAC Protocols: a taxonomy

    Three broad classes:

  • 7/27/2019 Basic Nw Complete_Chandan

    240/627

    5: DataLink Layer 5-243

    Channel Partitioning divide channel into smaller pieces (time slots,

    frequency, code)

    allocate piece to node for exclusive use

    Random Access channel not divided, allow collisions

    recover from collisions

    Taking turns Nodes take turns, but nodes with more to send can take

    longer turns

    Lt Col Chandan Tiwari

    Channel Partitioning MAC protocols: TDMA

    TDMA: time division multiple access

  • 7/27/2019 Basic Nw Complete_Chandan

    241/627

    5: DataLink Layer 5-244

    access to channel in "rounds" each station gets fixed length slot (length = pkt

    trans time) in each round

    unused slots go idle

    example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6idle

    Lt Col Chandan Tiwari

    Channel Partitioning MAC protocols: FDMA

    FDMA: frequency division multiple access

  • 7/27/2019 Basic Nw Complete_Chandan

    242/627

    5: DataLink Layer 5-245

    channel spectrum divided into frequency bands each station assigned fixed frequency band

    unused transmission time in frequency bands go idle

    example: 6-station LAN, 1,3,4 have pkt, frequencybands 2,5,6 idle

    frequenc

    ybands

    Lt Col Chandan Tiwari

    Random Access Protocols

    When node has packet to send

  • 7/27/2019 Basic Nw Complete_Chandan

    243/627

    5: DataLink Layer 5-246

    transmit at full channel data rate R.

    no a prioricoordination among nodes

    two or more transmitting nodes collision,

    random access MAC protocol specifies: how to detect collisions

    how to recover from collisions (e.g., via delayedretransmissions)

    Examples of random access MAC protocols: slotted ALOHA ALOHA

    CSMA, CSMA/CD, CSMA/CA

    Lt Col Chandan Tiwari

    Pure (unslotted) ALOHA

    unslotted Aloha: simpler, no synchronization, no

  • 7/27/2019 Basic Nw Complete_Chandan

    244/627

    5: DataLink Layer 5-247

    carrier sensing. when frame first arrives

    transmit immediately

    collision probability increases:

    frame sent at t0 collides with other frames sent in [t0-1,t0+1]

    Lt Col Chandan Tiwari

    Pure Aloha efficiency

    P(success by given node) = P(node transmits) .

    P(no other node transmits in [p -1,p ] .

  • 7/27/2019 Basic Nw Complete_Chandan

    245/627

    5: DataLink Layer 5-248

    0 0P(no other node transmits in [p0-1,p0]

    = p . (1-p)N-1 . (1-p)N-1

    = p . (1-p)2(N-1)

    choosing optimum p and then letting n -> infty ...

    = 1/(2e) = .18

    Lt Col Chandan Tiwari

    Slotted ALOHA

    Assumptions

    all frames same sizeOperation

  • 7/27/2019 Basic Nw Complete_Chandan

    246/627

    5: DataLink Layer 5-249

    time is divided intoequal size slots, time totransmit 1 frame

    nodes start to transmitframes only atbeginning of slots

    nodes are synchronized

    if 2 or more nodestransmit in slot, allnodes detect collision

    when node obtains freshframe, it transmits in nextslot

    no collision, node can sendnew frame in next slot

    if collision, noderetransmits frame in eachsubsequent slot with prob.p until success

    Lt Col Chandan Tiwari

    Slotted ALOHA

  • 7/27/2019 Basic Nw Complete_Chandan

    247/627

    5: DataLink Layer 5-250

    Pros

    single active node cancontinuously transmitat full rate of channel

    highly decentralized:only slots in nodesneed to be in sync

    simple

    Cons collisions, wasting slots idle slots nodes may be able to

    detect collision in less than

    time to transmit packet clock synchronization (used

    in a hub-spoke manner)Lt Col Chandan Tiwari

    Slotted Aloha efficiency

    For max efficiencywith N nodes, find p*

    h

    Efficiency is the long-runfraction of successful slots

    h h d

  • 7/27/2019 Basic Nw Complete_Chandan

    248/627

    5: DataLink Layer 5-251

    Suppose N nodes with

    many frames to send,each transmits in slotwith probabilityp

    prob that node 1 hassuccess in a slot= p(1-p)N-1

    prob that any node hasa success = Np(1-p)N-1

    that maximizesNp(1-p)N-1

    For many nodes, takelimit of Np*(1-p*)N-1

    as N goes to infinity,gives 1/e = .37

    when there are many nodes,each with many frames to send

    At best:channel

    used for usefultransmissions 37%of time!

    Lt Col Chandan Tiwari

    CSMA (Carrier Sense Multiple Access)

    CSMA l b f

  • 7/27/2019 Basic Nw Complete_Chandan

    249/627

    5: DataLink Layer 5-252

    CSMA: listen before transmit:If channel sensed idle: transmit entire frame

    If channel sensed busy, defer transmission

    Human analogy: dont interrupt others!

    Lt Col Chandan Tiwari

    All frames must take more than 2t to send so that

  • 7/27/2019 Basic Nw Complete_Chandan

    250/627

    the txn is still taking place when the noise burst gets

    back to the sender, otherwise the sender will

    incorrectly conclude that the frame was successfully

    sent For 10Mbps LAN with max length of 2500m and 04

    repeaters 2t=50 micro sec which corresponds to

    min frame size of 500 bits. With safety margin it is

    chosen to be 512 bits(64 bytes)

    Lt Col Chandan Tiwari

    Collisions are caused when two adaptors transmit at the

    same time (adaptors sense collision based on voltage

    diff )

  • 7/27/2019 Basic Nw Complete_Chandan

    251/627

    CS 640 254

    A B

    A B

    differences) Both found line to be idle

    Both had been waiting to for a busy line to become idle

    A starts attime 0

    Message almost

    there at time T when

    B starts collision!

    How can we be sure A knows about the collision?

    How can A know that a collision has taken place? There must be a mechanism to insure retransmission on collision

  • 7/27/2019 Basic Nw Complete_Chandan

    252/627

    CS 640 255

    As message reaches B at time T

    Bs message reaches A at time 2T

    So, A must still be transmitting at 2T

    IEEE 802.3 specifies max value of 2T to be 51.2us

    This relates to maximum distance of2500m between hosts At 10Mbps it takes 0.1us to transmit one bit so 512 bits (64B) take

    51.2us to send

    So, Ethernet frames must be at least 64B long

    14B header, 46B data, 4B CRC

    Padding is used if data is less than 46B Send jamming signal after collision is detected to insure all hosts

    see collision

    48 bit signal

    A B

    time 0

  • 7/27/2019 Basic Nw Complete_Chandan

    253/627

    CS 640 256

    A B

    A B

    time = 0

    time = T

    time = 2T

    Ethernet uses CSMA/CD protocol

  • 7/27/2019 Basic Nw Complete_Chandan

    254/627

    Nodes are required to wait for random time for

    retransmission after collision.

    Need to have the randomization interval growexponentially as more and more consecutive collisions

    take place.

    Lt Col Chandan Tiwari

    After collision, time divided into discrete time slots equal

    to worst case RTT.

  • 7/27/2019 Basic Nw Complete_Chandan

    255/627

    After first collision, each stn waits 0 or 1 slot times

    before trying again.

    After second collision, each stn waits for 0,1,2 or 3 slottimes before trying again.

    After i collisions, a random number between 0 and 2i1

    is chosen.

    Lt Col Chandan Tiwari

    After 10 collisions, randomization interval frozen at

    1023

  • 7/27/2019 Basic Nw Complete_Chandan

    256/627

    1023. Nodes give up after 16 collisions. Left to upper layers

    to resolve the issue

    The algorithm ensures

    low delay when few nodes collide.

    collision is resolved in a reasonable interval when

    many nodes collide.

    Lt Col Chandan Tiwari

    CSMA collisions

    collisions can still occur:

    propagation delay means

    spatial layout of nodes

  • 7/27/2019 Basic Nw Complete_Chandan

    257/627

    5: DataLink Layer 5-260

    propagation delay meanstwo nodes may not hear

    each others transmission

    collision:

    entire packet transmissiontime wasted

    note:role of distance & propagation delay

    in determining collision probability

    Lt Col Chandan Tiwari

    CSMA/CD (Collision Detection)

    CSMA/CD: carrier sensing, deferral as in CSMA llisi s detected ithi sh t tim

  • 7/27/2019 Basic Nw Complete_Chandan

    258/627

    5: DataLink Layer 5-261

    collisions detectedwithin short time colliding transmissions aborted, reducing channel

    wastage

    collision detection: easy in wired LANs: measure signal strengths,

    compare transmitted, received signals

    difficult in wireless LANs: receiver shut off whiletransmitting

    human analogy: the polite conversationalist

    Lt Col Chandan Tiwari

    CSMA/CD collision detection

  • 7/27/2019 Basic Nw Complete_Chandan

    259/627

    5: DataLink Layer 5-262Lt Col Chandan Tiwari

    Taking Turns MAC protocols

    channel partitioning MAC protocols:

    share channel efficiently and fairly at high load

  • 7/27/2019 Basic Nw Complete_Chandan

    260/627

    5: DataLink Layer 5-263

    share channel efficiently and fairly at high load

    inefficient at low load: delay in channel access,1/N bandwidth allocated even if only 1 activenode!

    Random access MAC protocols

    efficient at low load: single node can fullyutilize channel

    high load: collision overhead

    taking turns protocols

    look for best of both worlds!Lt Col Chandan Tiwari

    Taking Turns MAC protocols

    Polling:

    master node

    Token passing:

    control token passed from one

  • 7/27/2019 Basic Nw Complete_Chandan

    261/627

    5: DataLink Layer 5-264

    master nodeinvites slave nodesto transmit in turn

    concerns:

    polling overhead latency

    single point offailure (master)

    control token passed from onenode to next sequentially.

    token message

    concerns:

    token overhead latency

    single point of failure (token)

    Lt Col Chandan Tiwari

    Summary of MAC protocols

    What do you do with a shared media?Ch l P titi i b ti f d

  • 7/27/2019 Basic Nw Complete_Chandan

    262/627

    5: DataLink Layer 5-265

    Channel Partitioning, by time, frequency or code Time Division, Frequency Division

    Random partitioning (dynamic), ALOHA, S-ALOHA, CSMA, CSMA/CD

    carrier sensing: easy in some technologies (wire), hardin others (wireless)

    CSMA/CD used in Ethernet

    CSMA/CA used in 802.11

    Taking Turns polling from a central site, token passing

    Lt Col Chandan Tiwari

    Part 3: Link Layer

    3.1 Introduction and

    services

    3.6 Hubs and switches

    3 7 PPP

  • 7/27/2019 Basic Nw Complete_Chandan

    263/627

    5: DataLink Layer 5-266

    services 3.2 Error detection

    and correction

    3.3Multiple access

    protocols 3.4 Link layer

    addressing

    3.5 Ethernet

    3.7 PPP

    Lt Col Chandan Tiwari

    MAC Addresses and ARP

    32 bit IP dd ss:k l dd

  • 7/27/2019 Basic Nw Complete_Chandan

    264/627

    5: DataLink Layer 5-267

    32-bit IP address: network-layeraddress used to get datagram to destination IP subnet

    MAC (or LAN or physical or Ethernet)

    address: used to get frame from one interface to another

    physically-connected interface (same network)

    48 bit MAC address (for most LANs)burned in the adapter ROM

    Lt Col Chandan Tiwari

    LAN Addresses and ARP

    Each adapter on LAN has unique LAN address

  • 7/27/2019 Basic Nw Complete_Chandan

    265/627

    5: DataLink Layer 5-268

    Broadcast address =FF-FF-FF-FF-FF-FF

    = adapter

    1A-2F-BB-76-09-AD

    58-23-D7-FA-20-B0

    0C-C4-11-6F-E3-98

    71-65-F7-2B-08-53

    LAN(wired orwireless)

    Lt Col Chandan Tiwari

    LAN Address (more)

    MAC address allocation administered by IEEE

    manufacturer buys portion of MAC address space

  • 7/27/2019 Basic Nw Complete_Chandan

    266/627

    5: DataLink Layer 5-269

    manufacturer buys portion of MAC address space(to assure uniqueness)

    Analogy:

    (a) MAC address: like Social Security Number

    (b) IP address: like postal address

    MAC flat address portability can move LAN card from one LAN to another

    IP hierarchical address NOT portable depends on IP subnet to which node is attached

    Lt Col Chandan Tiwari

    ARP: Address Resolution Protocol

    Each IP node (Host,

    Router) on LAN has

    Question: how to determine

    MAC address of B

  • 7/27/2019 Basic Nw Complete_Chandan

    267/627

    5: DataLink Layer 5-270

    Router) on LAN hasARP table

    ARP Table: IP/MACaddress mappings for

    some LAN nodes< IP address; MAC address; TTL> TTL (Time To Live): time

    after which addressmapping will be forgotten

    (typically 20 min)

    MAC address of Bknowing Bs IP address?

    1A-2F-BB-76-09-AD

    58-23-D7-FA-20-B0

    0C-C4-11-6F-E3-98

    71-65-F7-2B-08-53

    LAN

    137.196.7.23

    137.196.7.78

    137.196.7.14

    137.196.7.88

    Lt Col Chandan Tiwari

    ARP protocol: Same LAN (network)

    A wants to send datagramto B, and Bs MAC address

    not in As ARP table

    A caches (saves) IP-to-

    MAC address pair in itsP bl l f

  • 7/27/2019 Basic Nw Complete_Chandan

    268/627

    5: DataLink Layer 5-271

    not in A s ARP table. A broadcasts ARP query

    packet, containing B's IPaddress

    Dest MAC address =

    FF-FF-FF-FF-FF-FF all machines on LAN

    receive ARP query

    B receives ARP packet,replies to A with its (B's)

    MAC address frame sent to As MAC

    address (unicast)

    MAC address pair in itsARP table until informationbecomes old (times out)

    soft state: informationthat times out (goes

    away) unless refreshed ARP is plug-and-play:

    nodes create their ARPtables withoutintervention from net

    administrator

    Lt Col Chandan Tiwari

    DHCP: Dynamic Host Configuration Protocol

    Goal: allow host to dynamicallyobtain its IP addressfrom network server when it joins network

  • 7/27/2019 Basic Nw Complete_Chandan

    269/627

    5: DataLink Layer 5-272

    from network server when it joins networkCan renew its lease on address in use

    Allows reuse of addresses (only hold address while connected anon

    Support for mobile users who want to join network (more shortly)DHCP overview:

    host broadcasts DHCP discover msg

    DHCP server responds with DHCP offer msg

    host requests IP address: DHCP request msgDHCP server sends address: DHCP ack msg

    Lt Col Chandan Tiwari

    DHCP client-server scenario

    223 1 2 1A DHCP

  • 7/27/2019 Basic Nw Complete_Chandan

    270/627

    5: DataLink Layer 5-273

    223.1.1.1

    223.1.1.2

    223.1.1.3

    223.1.1.4 223.1.2.9

    223.1.2.2

    223.1.2.1

    223.1.3.2223.1.3.1

    223.1.3.27

    A

    B E

    DHCPserver

    arriving DHCPclient needs

    address in this

    network

    Lt Col Chandan Tiwari

    DHCP client-server scenarioDHCP server: 223.1.2.5 arriving

    client

    DHCP discover

    src : 0.0.0.0, 68

    dest.: 255.255.255.255,67

    yiaddr: 0.0.0.0

    transaction ID: 654

  • 7/27/2019 Basic Nw Complete_Chandan

    271/627

    5: DataLink Layer 5-274

    time

    DHCP offer

    src: 223.1.2.5, 67

    dest: 255.255.255.255, 68

    yiaddrr: 223.1.2.4

    transaction ID: 654

    Lifetime: 3600 secs

    DHCP requestsrc: 0.0.0.0, 68

    dest:: 255.255.255.255, 67

    yiaddrr: 223.1.2.4

    transaction ID: 655

    Lifetime: 3600 secs

    DHCP ACK

    src: 223.1.2.5, 67dest: 255.255.255.255, 68

    yiaddrr: 223.1.2.4

    transaction ID: 655

    Lifetime: 3600 secs

    Lt Col Chandan Tiwari

    Routing to another LAN

    walkthrough: send datagram from A to B via R

    assume A knows B IP address

  • 7/27/2019 Basic Nw Complete_Chandan

    272/627

    5: DataLink Layer 5-275

    Two ARP tables in router R, one for each IPnetwork (LAN). R works as a gateway into anothernetwork

    A

    RB

    Lt Col Chandan Tiwari

    A creates datagram with source A, destination B A uses ARP to get Rs MAC address for 111.111.111.110

    A creates link-layer frame with R's MAC address as dest,frame contains A-to-B IP datagram

    As adapter sends frame

    Rs adapter receives frame

  • 7/27/2019 Basic Nw Complete_Chandan

    273/627

    5: DataLink Layer 5-276

    R s adapter receives frame

    R removes IP datagram from Ethernet frame, sees itsdestined to B

    R uses ARP to get Bs MAC address

    R creates frame containing A-to-B IP datagram sends to B

    A

    RB

    Lt Col Chandan Tiwari

    Part 3: Link Layer

    3.1 Introduction and

    services

    3.6 Hubs and switches

    3 7 PPP

  • 7/27/2019 Basic Nw Complete_Chandan

    274/627

    5: DataLink Layer 5-277

    services 3.2 Error detection

    and correction

    3.3Multiple access

    protocols 3.4 Link layer

    addressing

    3.5 Ethernet

    3.7 PPP

    Lt Col Chandan Tiwari

    Ethernet

    dominant wired LAN technology:

    cheap $20 for 100Mbs!

    first widely used LAN technology

  • 7/27/2019 Basic Nw Complete_Chandan

    275/627

    5: DataLink Layer 5-278

    first widely used LAN technology

    Simpler, cheaper than token LANs and ATM

    Kept up with speed race: 10 Mbps 10 Gbps

    Metcalfes Ethernetsketch

    Lt Col Chandan Tiwari

    Star topology

    Bus topology popular through mid 90s

    Now star topology prevails

    Connection choices: hub or switch (more later)

  • 7/27/2019 Basic Nw Complete_Chandan

    276/627

    5: DataLink Layer 5-279

    Connection choices: hub or switch (more later)

    hub or

    switch

    Lt Col Chandan Tiwari

    Ethernet Frame Structure

    Sending adapter encapsulates IP datagram (or othernetwork layer protocol packet) in Ethernet frame

  • 7/27/2019 Basic Nw Complete_Chandan

    277/627

    5: DataLink Layer 5-280

    Preamble: 7 bytes with pattern 10101010 followed by one

    byte with pattern 10101011

    used to synchronize receiver, sender clock rates

    Lt Col Chandan Tiwari

    Ethernet Frame Structure (more)

    Addresses: 6 bytes if adapter receives frame with matching destination

  • 7/27/2019 Basic Nw Complete_Chandan

    278/627

    5: DataLink Layer 5-281

    f p f m m gaddress, or with broadcast address (eg ARP packet), itpasses data in frame to net-layer protocol

    otherwise, adapter discards frame

    Type: indicates the higher layer protocol (mostlyIP but others may be supported such as NovellIPX and AppleTalk)

    CRC: checked at receiver, if error is detected, theframe is simply dropped

    Lt Col Chandan Tiwari

    Unreliable, connectionless service

    Connectionless: No handshaking between sending

    and receiving adapter

  • 7/27/2019 Basic Nw Complete_Chandan

    279/627

    5: DataLink Layer 5-282

    and receiving adapter. Unreliable:receiving adapter doesnt send acks or

    nacks to sending adapter stream of datagrams passed to network layer can have

    gaps gaps will be filled if app is using TCP

    otherwise, app will see the gaps

    Lt Col Chandan Tiwari

    Ethernet uses CSMA/CD

    No slots

    adapter doesnt transmit

    Before attempting a

    retransmission,

  • 7/27/2019 Basic Nw Complete_Chandan

    280/627

    5: DataLink Layer 5-283

    adapter doesn t transmitif it senses that someother adapter istransmitting, that is,

    carrier sense transmitting adapter

    aborts when it sensesthat another adapter is

    transmitting, that is,collision detection

    retransmission,adapter waits arandom time, that is,random access

    Minimum Ethernetframe size related tothe physical size ofthe network

    Lt Col Chandan Tiwari

    Ethernet CSMA/CD algorithm

    1. Adaptor receivesdatagram from net layer &

    creates frame

    4. If adapter detectsanother transmission while

    transmitting, aborts and

  • 7/27/2019 Basic Nw Complete_Chandan

    281/627

    5: DataLink Layer 5-284

    creates frame2. If adapter senses channelidle (96 bit times), it startsto transmit frame. If it

    senses channel busy, waitsuntil channel idle and thentransmits

    3. If adapter transmits

    entire frame withoutdetecting anothertransmission, the adapter isdone with frame !

    transmitting, aborts andsends 48 bit jam signal

    5. After aborting, adapterenters exponential backoff:

    after the mth collision,adapter chooses a K atrandom from{0,1,2,,2m-1}. Adapter waits

    K512 bit times and returnsto Step 2

    Lt Col Chandan Tiwari

    Ethernets CSMA/CD (more)

    Jam Signal: make sure allother transmitters are aware

    of collision; 48 bits

    Exponential Backoff:

    Goal: adapt retransmissionattempts to estimated

  • 7/27/2019 Basic Nw Complete_Chandan

    282/627

    5: DataLink Layer 5-285

    Bit time: .1 microsec for 10Mbps Ethernet ;for K=1023, wait time is about50 msec

    pcurrent load heavy load: random wait

    will be longer

    first collision: choose K

    from {0,1}; delay is K 512bit transmission times

    after second collision:choose K from {0,1,2,3}

    after ten collisions, chooseK from {0,1,2,3,4,,1023}

    Lt Col Chandan Tiwari

    CSMA/CD efficiency

    Tprop = max prop between 2 nodes in LAN

    ttrans = time to transmit max-size frame

  • 7/27/2019 Basic Nw Complete_Chandan

    283/627

    5: DataLink Layer 5-286

    ttrans t me to transm t max s ze frame

    Efficiency goes to 1 as tprop goes to 0

    Goes to 1 as ttrans goes to infinity

    Much better than ALOHA, but still decentralized,simple, and cheap

    transpr op tt /51

    1efficiency

    Lt Col Chandan Tiwari

    Manchester encoding

  • 7/27/2019 Basic Nw Complete_Chandan

    284/627

    5: DataLink Layer 5-287

    Used in 10BaseT

    Each bit has a transition

    Allows clocks in sending and receiving nodes to

    synchronize to each other no need for a centralized, global clock among nodes!

    Hey, this is physical-layer stuff!Lt Col Chandan Tiwari

    Chapter 4

    Network Layer

  • 7/27/2019 Basic Nw Complete_Chandan

    285/627

    Lt Col Chandan Tiwari

    Part 5: Network Layer

    5. 1 Introduction

    5.2 Datagram networks

    5.5 Routing algorithms

    Link state

  • 7/27/2019 Basic Nw Complete_Chandan

    286/627

    Lt Col Chandan Tiwari

    5.3 Whats inside a router

    5.4 IP: Internet Protocol

    Datagram format

    IPv4 addressing

    ICMP

    IPv6

    Distance Vector

    Hierarchical routing

    5.6 Routing in the Internet

    RIP OSPF

    BGP

    5.7 Broadcast and multicast

    routing

    Network layer transport segment from sending to receiving host

    on sending side encapsulates segments intodatagrams

    on rcving side, delivers segments to transport layer

    network layer protocols in everyhost, router

    Router examines header fields in all IP datagramspassing through it networkdata linkph si l

    networknetworkd t li k

    applicationtransportnetwork

    data linkphysical

  • 7/27/2019 Basic Nw Complete_Chandan

    287/627

    Lt Col Chandan Tiwari

    networkdata linkphysical

    networkdata linkphysical

    physical

    networkdata linkphysical

    networkdata linkphysical

    data linkphysical

    networkdata linkphysical

    data linkphysical

    applicationtransportnetworkdata linkphysical

    forwarding:move packets from routers input

    to appropriate router output

  • 7/27/2019 Basic Nw Complete_Chandan

    288/627

    Lt Col Chandan Tiwari

    to appropriate router output

    routing: determine route taken by packets

    from source to dest.

    routing algorithms

    routing algorithm

    local forwarding table

    h d l t t li k

    Interplay between routing and forwarding

  • 7/27/2019 Basic Nw Complete_Chandan

    289/627

    Lt Col Chandan Tiwari

    1

    23

    0111

    value in arriving

    packets header

    header value output link

    0100

    0101

    0111

    1001

    3

    2

    2

    1

    Part 5: Network Layer

    5. 1 Introduction

    5.2 Datagram networks

    5.5 Routing algorithms

    Link state

  • 7/27/2019 Basic Nw Complete_Chandan

    290/627

    Lt Col Chandan Tiwari

    5.3 Whats inside a router

    5.4 IP: Internet Protocol

    Datagram format

    IPv4 addressing

    ICMP

    IPv6

    Distance Vector

    Hierarchical routing

    5.6 Routing in the Internet

    RIP OSPF

    BGP

    5.7 Broadcast and multicast

    routing

    datagram network provides network-layer

    connectionless service

  • 7/27/2019 Basic Nw Complete_Chandan

    291/627

    Lt Col Chandan Tiwari

    connectionless service

    analogous to the transport-layer services,

    but:

    service: host-to-host

    implementation: in network core

    Datagram networks

    routers: no state about end-to-end connections

    no network-level concept of connection

    packets forwarded using destination host address packets between same source-dest pair may take different paths

  • 7/27/2019 Basic Nw Complete_Chandan

    292/627

    Lt Col Chandan Tiwari

    packets between same source dest pair may take different paths

    applicationtransportnetworkdata linkphysical

    applicationtransportnetwork

    data linkphysical

    1. Send data 2. Receive data

    Destination Address Range Link Interface

    11001000 00010111 00010000 00000000

    4 billionpossible entries

  • 7/27/2019 Basic Nw Complete_Chandan

    293/627

    Lt Col Chandan Tiwari

    11001000 00010111 00010000 00000000

    through 0

    11001000 00010111 00010111 11111111

    11001000 00010111 00011000 00000000through 1

    11001000 00010111 00011000 11111111

    11001000 00010111 00011001 00000000

    through 2

    11001000 00010111 00011111 11111111

    otherwise 3

    Prefix Match Link Interface

    11001000 00010111 00010 0

    11001000 00010111 00011000 1

  • 7/27/2019 Basic Nw Complete_Chandan

    294/627

    Lt Col Chandan Tiwari

    11001000 00010111 00011000 1

    11001000 00010111 00011 2

    otherwise 3

    DA: 11001000 00010111 00011000 10101010

    Examples

    DA: 11001000 00010111 00010110 10100001 Which interface?

    Which interface?

    Part 5: Network Layer

    5. 1 Introduction

    5.2 Datagram networks

    5.5 Routing algorithms

    Link stateDi t V t

  • 7/27/2019 Basic Nw Complete_Chandan

    295/627

    Lt Col Chandan Tiwari

    5.3 Whats inside a router

    5.4 IP: Internet Protocol

    Datagram format

    IPv4 addressing

    ICMP

    IPv6

    Distance Vector

    Hierarchical routing

    5.6 Routing in the Internet

    RIP OSPF

    BGP

    5.7 Broadcast and multicast

    routing

    The Internet Network layer

    Host, router network layer functions:

    Transport layer: TCP, UDP

  • 7/27/2019 Basic Nw Complete_Chandan

    296/627

    Lt Col Chandan Tiwari

    forwardingtable

    Routing protocolspath selectionRIP, OSPF, BGP

    IP protocoladdressing conventionsdatagram formatpacket handling conventions

    ICMP protocolerror reportingrouter signaling

    Link layer

    physical layer

    Network

    layer

    Part 5: Network Layer

    5. 1 Introduction

    5.2 Datagram networks

    5.5 Routing algorithms

    Link stateDi t V t

  • 7/27/2019 Basic Nw Complete_Chandan

    297/627

    Lt Col Chandan Tiwari

    5.3 Whats inside a router

    5.4 IP: Internet Protocol

    Datagram format

    IPv4 addressing

    ICMP

    IPv6

    Distance Vector

    Hierarchical routing

    5.6 Routing in the Internet

    RIP OSPF

    BGP

    5.7 Broadcast and multicast

    routing

    ver length

    32 bits

    16-bit identifierheadertime to

    IP protocol versionnumber

    header length(bytes)

    max number

    for

    fragmentation/reassembly

    total datagramlength (bytes)

    head.len

    type ofservice

    type of data

    flgsfragment

    offsetupper

  • 7/27/2019 Basic Nw Complete_Chandan

    298/627

    Lt Col Chandan Tiwari

    data(variable length,

    typically a TCPor UDP segment)

    headerchecksum

    time tolive

    32 bit source IP address

    max numberremaining hops

    (decremented ateach router)

    upper layer protocolto deliver payload to

    upperlayer

    32 bit destination IP address

    Options (if any) E.g. timestamp,record routetaken, specifylist of routers

    to visit.

    how much overhead

    with TCP?

    20 bytes of TCP

    20 bytes of IP

    = 40 bytes + app

    layer overhead

    IP Fragmentation & Reassembly

    network links have MTU

    (max.transfer size) - largest

    possible link-level frame.

    different link types, different

    MTUfragmentation:

    l

  • 7/27/2019 Basic Nw Complete_Chandan

    299/627

    Lt Col Chandan Tiwari

    MTUs

    large IP datagram divided

    (fragmented) within net

    one datagram becomes

    several datagrams

    reassembled only at final

    destination

    IP header bits used to identify,

    order related fragments

    in: one large datagramout: 3 smaller datagrams

    reassembly

    IP Fragmentation and Reassembly

    ID=x

    offset=0

    fragflag=0

    length=4000

    One large datagram becomes

    Example

    4000 byte datagram

  • 7/27/2019 Basic Nw Complete_Chandan

    300/627

    Lt Col Chandan Tiwari

    ID

    =x

    offset

    =0

    fragflag

    =1

    length

    =1500ID=x

    offset=185

    fragflag=1

    length=1500

    ID

    =x

    offset

    =370

    fragflag

    =0

    length

    =1040

    One large datagram becomesseveral smaller datagrams MTU = 1500 bytes

    1480 bytes indata field

    offset =1480/8

    Part 5: Network Layer

    5. 1 Introduction

    5.2 Datagram networks

    5.5 Routing algorithms

    Link stateDistance Vector

  • 7/27/2019 Basic Nw Complete_Chandan

    301/627

    Lt Col Chandan Tiwari

    5.3 Whats inside a router

    5.4 IP: Internet Protocol

    Datagram format

    IPv4 addressing

    ICMP

    IPv6

    Distance Vector

    Hierarchical routing

    5.6 Routing in the Internet

    RIP OSPF

    BGP

    5.7 Broadcast and multicast

    routing

    IP Addressing: introduction

    IP address: 32-bit

    identifier for host, router

    interface

    223.1.1.1

    223.1.1.2223.1.1.4 223.1.2.9

    223.1.2.1

  • 7/27/2019 Basic Nw Complete_Chandan

    302/627

    Lt Col Chandan Tiwari

    interface: connection

    between host/router and

    physical link

    routers typically havemultiple interfaces

    host typically has one

    interface

    IP addresses associated

    with each interface

    223.1.1.3223.1.2.2

    223.1.3.2223.1.3.1

    223.1.3.27

    223.1.1.1 = 11011111 00000001 00000001 00000001

    223 1 11

    Subnets

    IP address:

    subnet part (high order

    bits)

    host part (low order bits)

    223.1.1.1

    223.1.1.2223.1.1.4 223.1.2.9

    223.1.2.1

  • 7/27/2019 Basic Nw Complete_Chandan

    303/627

    Lt Col Chandan Tiwari

    host part (low order bits)

    Whats a subnet ?

    device interfaces with

    same subnet part of IPaddress

    can physically reach each

    other without intervening

    router

    223.1.1.3223.1.2.2

    223.1.3.2223.1.3.1

    223.1.3.27

    network consisting of 3 subnets

    subnet

    Subnets 223.1.1.0/24 223.1.2.0/24

    Recipe

    To determine the subnets,detach each interface

  • 7/27/2019 Basic Nw Complete_Chandan

    304/627

    Lt Col Chandan Tiwari

    223.1.3.0/24

    detach each interface

    from its host or router,

    creating islands of isolated

    networks. Each isolated

    network is called a

    subnet.

    Subnet mask: /24

    Subnets

    How many? 223.1.1.1

    223.1.1.3

    223.1.1.4

    223.1.1.2

  • 7/27/2019 Basic Nw Complete_Chandan

    305/627

    Lt Col Chandan Tiwari

    223.1.2.2223.1.2.1

    223.1.2.6

    223.1.3.2223.1.3.1

    223.1.3.27

    223.1.7.0

    223.1.7.1223.1.8.0223.1.8.1

    223.1.9.1

    223.1.9.2

    CIDR:Classless InterDomain Routing

    subnet portion of address of arbitrary lengthaddress format a b c d/x where x is # bits in

  • 7/27/2019 Basic Nw Complete_Chandan

    306/627

    Lt Col Chandan Tiwari

    address format: a.b.c.d/x, where x is # bits in

    subnet portion of address

    11001000 00010111 00010000 00000000

    subnetpart

    hostpart

    200.23.16.0/23

    Q: How does networkget subnet part of IP addr?

    A:gets allocated portion of its provider ISPsaddress space

  • 7/27/2019 Basic Nw Complete_Chandan

    307/627

    Lt Col Chandan Tiwari

    address space

    ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

    Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23

    Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23

    Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23

    ... .. . .

    Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

    Q: How does hostget IP address?

  • 7/27/2019 Basic Nw Complete_Chandan

    308/627

    Lt Col Chandan Tiwari

    hard-coded by system admin in a file

    /etc/network/interfaces

    DHCP:Dynamic Host Configuration Protocol: dynamically getaddress from as server

    plug-and-play

    Organization 0

    Hierarchical addressing allows efficient advertisement of routinginformation:

  • 7/27/2019 Basic Nw Complete_Chandan

    309/627

    Lt Col Chandan Tiwari

    Send me anythingwith addresses

    beginning200.23.16.0/20

    200.23.16.0/23

    200.23.18.0/23

    200.23.30.0/23

    Fly-By-Night-ISP

    Organization 0

    Organization 7Internet

    Organization 1

    ISPs-R-UsSend me anythingwith addressesbeginning199.31.0.0/16

    200.23.20.0/23Organization 2

    ...

    ...

    ISPs-R-Us has a more specific route to Organization 1

    200 23 16 0/23

    Organization 0

  • 7/27/2019 Basic Nw Complete_Chandan

    310/627

    Lt Col Chandan Tiwari

    Send me anythingwith addressesbeginning

    200.23.16.0/20

    200.23.16.0/23

    200.23.18.0/23

    200.23.30.0/23

    Fly-By-Night-ISP

    Organiza