Docstoc

link

Document Sample
link Powered By Docstoc
					Link Layer


11/18/2009




             1
Admin
 Next exam?




               2
Recap: Internet Routing

 Intradomain routing and interdomain routing


 Intradomain routes are aggregated and
 announced to interdomain routing
     CIDR to allow flexibility in aggregation of
      destination addresses


 Longest prefix matching to determine the
 next hop to a destination



                                                    3
Example 1 (same network): A->B
         src       dst                     forwarding table in A
  misc                                 Dest. Net. next router           Nhops
                            data
 fields 223.1.1.1 223.1.1.3
                                     223.1.1/24             1
                                     223.1.2/24 223.1.1.4   2
 Look up dest address
                                     223.1.3/24 223.1.1.4   2
 find dest is on same net           0.0.0.0/0 223.1.1.4     -
 link layer will send the                          To Internet
                                   A 223.1.1.1
   datagram directly inside a                              223.1.4.1
   link-layer frame                                             223.1.2.1
                                         223.1.1.2
                                               223.1.1.4    223.1.2.9
                                   B
                                                                  223.1.2.2
                                       223.1.1.3    223.1.3.27

                                        223.1.3.1                223.1.3.2




                                                                                4
Example 2 (Different Networks): A-> E
                                              forwarding table in A
  misc                                    Dest. Net. next router           Nhops
                            data
 fields 223.1.1.1 223.1.2.3
                                        223.1.1/24             1
                                        223.1.2/24 223.1.1.4   2
  look up dest address in
                                        223.1.3/24 223.1.1.4   2
   forwarding table
                                        0.0.0.0/0 223.1.1.4     -
  routing table: next hop
                                      A 223.1.1.1      To Internet
   router to dest is 223.1.1.4                                223.1.4.1
  link layer sends datagram to                                    223.1.2.1
   router 223.1.1.4 inside a link-          223.1.1.2
                                                               223.1.2.9
   layer frame
                                                  223.1.1.4
                                      B
       the dest. of the link layer                                  223.1.2.3
        frame is 223.1.1.4                223.1.1.3    223.1.3.27                E

                                           223.1.3.1                223.1.3.2




                                                                                     5
Example 2 (Different Networks): A-> E
                                     forwarding table in router
  misc                              Dest. Net router Nhops interface
                            data
 fields 223.1.1.1 223.1.2.3
                                    223.1.1/24        -       1    223.1.1.4

Arriving at 223.1.1.4,              223.1.2/24        -       1    223.1.2.9
                                    223.1.3/24        -       1
  destined for 223.1.2.2
                                                                   223.1.3.27
                                    0.0.0.0/0         -       -    223.1.4.1
 look up dest address in           A                       To Internet
                                         223.1.1.1
  router’s forwarding table                                 223.1.4.1
 E on same network as router’s
                                                                 223.1.2.1
                                          223.1.1.2
  interface 223.1.2.9                           223.1.1.4    223.1.2.9
     router, E directly attached   B
                                                                   223.1.2.3
 link layer sends datagram to          223.1.1.3    223.1.3.27                E
  223.1.2.2 inside link-layer
                                         223.1.3.1                223.1.3.2
  frame via interface 223.1.2.9
 datagram arrives at
  223.1.2.2!! (hooray!)
                                                                                   6
What A Router Looks Like: Outside




                                    7
Look Inside a Router
Two key router functions:
 run routing algorithms/protocol (RIP, OSPF, BGP)
   switching datagrams from incoming to outgoing ports




                                                          8
Input Port Functions




     physical layer:
bit-level reception


   data link layer:
    e.g., Ethernet             network layer:
                           lookup output port
                       using forwarding table

                                                9
Switching: Low End




                     10
Switching Via An
Interconnection Network

 Overcome bus bandwidth limitations
 fragmenting datagram into fixed length
  cells, switch cells through the fabric.
 Crossbar, Banyan networks, and others




 Cisco 12416: switches 320 Gbps (upgradeable to 1.28
  Tbps) with 16 slots (each 10G full-duplex) through the
  crossbar interconnection network
                                                           11
New Potential Bottleneck: Output Ports

 Due to output port contention and head-of-the-Line
  (HOL) blocking (i.e., queued datagram at front of
  queue prevents others in queue from moving
  forward)




                                                       12
 Head-of-Line Blocking Limits Thrput

 Due to output-port contention and HOL blocking, the stable throughput
is only around 2 - sqrt(2) = 0.586 of line speed !




                                                                          13
  Avoiding Port Contention and HOB
   Virtual output queueing




   Input/output ports matching algorithm
   Switch fabric speedup, e.g., two cells to one
     output port
For more details: http://www.cisco.com/warp/public/63/arch12000-swfabric.html
                                                                        14
Output Ports
                  Buffering required when
                   datagrams arrive from
                   fabric faster than the
                   transmission rate

                  Queueing (delay) and
                   loss due to output port
                   buffer overflow !

                  Scheduling and
                   queue/buffer
                   management choose
                   among queued
                   datagrams for
                   transmission



                                             15
Summary
 We have covered the basics of the network
  layer
     routing and forwarding


 There are multiple other topics that we did
  not cover
   Multicast/anycast routing
   QoS
   slides linked on the schedule page just in case you
    want to take a quick look

                                                          16
Recap: The Hourglass Architecture of the Internet



                Telnet Email    FTP WWW


                     TCP        UDP


                           IP



               Ethernet Wireless FDDI




                                                    17
Link Layer: Introduction           “link”

Some terminology:
 hosts and routers are nodes
  (bridges and switches too)

 communication channels that
  connect adjacent nodes along a
  communication path are links
      wired, wireless
      dedicated, shared


 2-PDU is a frame,
  encapsulates datagram



                                            18
Link layer: Context
 Data-link layer has            transportation analogy
  responsibility of
                                  trip from New Haven to
  transferring datagram
                                   San Francisco
  from one node to
                                     taxi: home to union
  another node over a link
                                      station
                                     train: union station to
 Datagram transferred by
                                      JFK
  different link protocols
                                     plane: JFK to San
  over different links, e.g.,
      Ethernet on first link,
                                      Francisco airport
      frame relay on                shuttle: airport to
       intermediate links             hotel
      802.11 on last link

                                                                19
Link Layer Services
 Framing
   o encapsulate datagram into frame, adding header,
     trailer and error detection/correction
 Multiplexing/demultiplexing
   o frame headers to identify src, dest
      • different from IP address !
 Flow control
 Link access (interference and quality of service
 control)
 Reliable delivery between adjacent nodes
   o we learned how to do this already !
   o seldom used on low bit error link (fiber, some twisted pair)
   o common for wireless links: high error rates
                                                                    20
  Adaptors Communicating
                   datagram
                               link layer protocol                 receiving
sending                                                            node
node
                   frame                             frame
                   adapter                           adapter

  link layer                           sending side:
    implemented in                         encapsulates datagram in
    “adaptor” (aka NIC)                     a frame
         Ethernet card,                   adds error checking bits,
          modem, 802.11 card                rdt, flow control, etc.
  adapter is semi-                     receiving side
    autonomous,                            looks for errors, rdt, flow

    implementing link &                     control, etc
                                           extracts datagram, passes
    physical layers
                                            to receiving node
                                                                          21
 LAN/MAC/Physical Address
 Each adapter has a unique
link layer address (also called
MAC address)
     • used as address in
     datalink frames to identify
     the interface

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

    • MAC address allocation
    administered by IEEE;
    manufacturer buys portion
    of MAC address space (to
    assure uniqueness)

                                   22
 Recall Earlier Routing Discussion
Starting at A, given IP                       A    223.1.1.1
  datagram addressed to E:                         223.1.1.2
                                                                      223.1.2.1
 look up net. address of E, find C                      223.1.1.4 223.1.2.9
 link layer sends datagram to C              B                C
   inside link-layer frame; the                   223.1.1.3 223.1.3.27
                                                                         223.1.2.2
                                                                                     E
   dest. address should be C’s                    223.1.3.1              223.1.3.2
   MAC address

   frame source,       datagram source,
   dest address          dest address                     Question: how
                                                          to determine
C’s MAC A’s MAC        A’s IP   E’s IP
                                           IP payload     MAC address of
  addr    addr         addr     addr
                                                          C knowing C’s IP
                                datagram                  address?
                   frame
                                                                                         23
ARP: Address Resolution Protocol
                                              Each IP node (Host, Router)
                                               on LAN has ARP table
                                              ARP Table: IP/MAC address
                                               mappings for some LAN
                                               nodes
                                                < IP address; MAC address; TTL>
                                                        TTL (Time To Live): time
                                                        after which address
                                                        mapping will be forgotten
                                                        (typically 20 min)



  [yry3@cicada yry3]$ /sbin/arp
  Address                  HWtype   HWaddress             Flags Mask        Iface
  zoo-gatew.cs.yale.edu    ether    AA:00:04:00:20:D4     C                 eth0
  artemis.zoo.cs.yale.edu ether     00:06:5B:3F:6E:21     C                 eth0
  lab.zoo.cs.yale.edu      ether    00:B0:D0:F3:C7:A5     C                 eth0


                                                                                    24
ARP Protocol
 ARP is “plug-and-play”:
     nodes create their ARP tables without
      intervention from net administrator


 A broadcast protocol:
   Source    broadcasts query frame, containing
      queried IP address
       • all machines on LAN receive ARP query

     destination D receives ARP frame, replies
       • frame sent to A’s MAC address (unicast)

                                                   25
Comparison of IP address and MAC Address

 IP address is               MAC address is flat
  hierarchical for routing
  scalability
                              MAC address does not
 IP address needs to be       need to be globally
  globally unique (if no       unique, but the current
  NAT)                         assignment ensures
                               uniqueness
 IP address depends on
  IP network to which an      MAC address is
  interface is attached        assigned to a device
      NOT portable                portable
                                                         26
Outline
 Admin
 Link layer overview
 Error detection




                        27
    Error Detection




                                                             ‘




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

• Error detection not 100% reliable!
    • a good error detector may miss some errors, but rarely
    • larger ED field generally yields better detection
                                                                     28
Cyclic Redundancy Check: Background
 Widely used in practice, e.g.,
     Ethernet, DOCSIS (Cable Modem), FDDI,
      PKZIP, WinZip, PNG
 For a given data D, consider it as a
  polynomial D(x)
     consider the string of 0 and 1 as the
      coefficients of a polynomial
       • e.g. consider string 10011 as x4+x+1
     addition and subtraction are modular 2, thus
      the same as xor
 Choose generator polynomial G(x) with r+1
  bits, where r is called the degree of G(x)
                                                     29
Cyclic Redundancy Check: Encode
 Given data G(x) and D(x), choose R(x) with
  r bits, such that
     D(x)xr+R(x) is exactly divisible by G(x)




                   x    +



 The bits correspond to D(x)xr+R(x) are
  sent to the receiver
                                                 30
    Cyclic Redundancy Check: Decode

                    T = D(x)xr+R(x)         T’
D         Encode:
                                                 check
          CRC(G)




     Since G(x) is global, when the receiver
      receives the transmission T’(x), it divides
      T’(x) by G(x)
       if non-zero remainder: error detected!
       if zero remainder, assumes no error


                                                         31
CRC: Steps and an Example


Suppose the degree of G(x)
   is r
Append r zero to D(x), i.e.
   consider D(x)xr
Divide D(x)xr by G(x). Let
   R(x) denote the
   reminder
Send <D, R> to the receiver




                              32
The Power of CRC
 Let T(x) denote D(x)xr+R(x), and E(x) the polynomial of the
    error bits
        the received signal is T’(x) = T(x)+E(x)


                       T = D(x)xr+R(x)              T’
D        Encode:
                                                             check
         CRC(G)


 Since T(x) is divisible by G(x), we only need to consider if E(x)
    is divisible by G(x)




                                                                      33
The Power of CRC

 Detect a single-bit error: E(x) = xi
      if G(x) contains two or more terms, E(x) is not divisible by
       G(x)

 Detect an odd number of errors: E(x) has an
  odd number of terms:
      lemma: if E(x) has an odd number of terms, E(x) cannot be
       divisible by (x+1)
        • suppose E(x) = (x+1)F(x), let x=1, the left hand will be 1, while the right
          hand will be 0
      thus if G(x) contains x+1 as a factor, E(x) will not be divided
       by G(x)

 Many more errors can be detected by designing the
  right G(x)

                                                                                        34
  Example G(x)
 16 bits CRC:
    CRC-16: x16+x15+x2+1,
     CRC-CCITT: x16+x12+x5+1
    both can catch
       • all single or double bit errors
       • all odd number of bit errors
       • all burst errors of length 16
         or less
       • >99.99% of the 17 or 18 bits
         burst errors
                                           CRC-16 hardware implementation
                                            Using shift and XOR registers
                        http://en.wikipedia.org/wiki/CRC-32#Implementation



                                                                            35
Example G(x)
 32 bits CRC:
    CRC32: x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5
     + x4 + x2 + x + 1
    used by Ethernet, FDDI, PKZIP, WinZip, and PNG

 GSM phones
                                           .




 For more details see the link below and further links it
   contains:
       http://en.wikipedia.org/wiki/Cyclic_redundancy_check
                                                                           36
Outline
 Admin
 Link layer overview
 Error detection
 Link access




                        37
Multiple Access Links and Protocols

Two types of “links”:
 point-to-point
    e.g., a leased dedicated line, PPP for dial-up access

 broadcast (shared wire or medium)
    traditional Ethernet
    802.11 wireless LAN
    satellite




                                                             38
Multiple Access Protocols
 Single shared broadcast channel
    thus, if two or more simultaneous transmissions by nodes, due
     to interference, only one node can send successfully at a time
     (see CDMA later for an exception)


multiple access protocol
 Protocol that determines how nodes share channel, i.e.,
  determines when nodes can transmit
 Communication about channel sharing must use channel
  itself !

 Discussion: properties of an ideal multiple access
  protocol.
                                                                  39
Ideal Mulitple Access Protocol
Broadcast channel of rate R bps
- Efficiency: when one node wants to transmit, it can
    send at rate R

- Fairness: when N nodes want to transmit, each can
    send at average rate R/N

- Decentralized:
      no special node to coordinate transmissions
      no synchronization of clocks


- Simple
                                                        40
MAC Protocols: a Taxonomy
Goals
 efficient, fair, decentralized, simple

Three broad classes:
 channel partitioning
      divide channel into smaller “pieces” (time slot, frequency,
       code)
 Non-partitioning
   random access
      • allow collisions
   “taking-turns”
        • a token coordinates shared access to avoid collisions

                                                                     41
Outline
 Admin. and recap
 Link layer overview
 Error detection and correction
 Media access control (MAC) protocols
     channel partitioning




                                         42
Channel Partitioning: TDMA
TDMA: time division multiple access
 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,6
  idle




                                                        43
Channel Partitioning: FDMA
FDMA: frequency division multiple access
 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, frequency
  bands 2,5,6 idle
                                   1
                 frequency bands




                                   2
                                   3
                                   4
                                   5
                                   6
                                                        44
GSM - TDMA/FDMA
                                                     935-960 MHz
                                                     124 channels (200 kHz)
                                                     downlink


                                                     890-915 MHz
                                                     124 channels (200 kHz)
                                                     uplink



                                                                                time

                           GSM TDMA frame

         1            2         3      4        5         6           7         8
                                                                                       4.615 ms

                           GSM time-slot (normal burst)
      guard                                                                    guard
      space    tail       user data   S Training S     user data          tail space
              3 bits       57 bits    1 26 bits 1        57 bits           3
                                                                               546.5 µs
                                                                                     577 µs
S: indicates data or control                                                                      45
Channel Partitioning: CDMA
CDMA (Code Division Multiple Access)
 Used mostly in wireless broadcast channels (cellular,
  satellite, etc)
 A spread-spectrum technique




 Example: Sprint , Verizon 3G
 802.11


 History:
 http://people.seas.harvard.edu/~jones/cscie129/nu_lectures/lecture7/
 hedy/lemarr.htm                                                        46
CDMA: Encoding

 All users share same frequency, but each user m has
    its own unique “chipping” sequence (i.e., code) cm to
    encode data, i.e., code set partitioning
       e.g. cm = 1 1 1 -1 1 -1 -1 -1


 Assume original data are represented by 1 and -1


   Encoded signal = (original data) modulated by
    (chipping sequence)
       assume          cm = 1 1 1 -1 1 -1 -1 -1

       if data is d, send d cm,
         • if data d is 1, send cm
         • if data d is -1 send -cm
                                                            47
CDMA: Encoding
             tb


                                                  user data d(t)

             1                       -1              X

                   tc

                                                  chipping
                                                  sequence c(t)

     -1 1   1 -1        1 -1 1 -1 1 1 -1 1 -1 1
                                                         =

                                                  resulting
                                                  signal


     -1 1   1 -1 1 -1 1 1 -1 -1 1 -1 1 -1

                  tb: bit period
                  tc: chip period
                                                                   48
CDMA: Decoding

 Inner-product (summation of bit-by-bit
 product) of encoded signal and chipping
 sequence
     if inner-product > 0, the data is 1; else -1




                                                     49
   CDMA Encode/Decode
                       Encode

Code of user m cm:
 1 1 1 -1 1 -1 -1 -1




- The number of bits
                        Decode
of each chipping
sequence is M




                                 50
    CDMA: Deal with Multiple-User Interference

     Two codes Ci and Cj are orthogonal, if
       c j  ci  0, where we use “.” to denote inner product,
                                    
        e.g.
                           C1:   1      1 1 -1 1 -1 -1 -1
                           C2:    1 -1 1          1 1 -1        1    1
                     -----------------------------------------
                        .
                     C1  C2 =    1 +(-1) + 1 + (-1) +1 + 1+ (-1)+(-1)=0

     If codes are orthogonal, multiple users can
        “coexist” and transmit simultaneously with
        minimal interference:
                              ( d j c j )  ci  di ci
                                j

Analogy: Speak in different languages!                                     51
   CDMA: Two-Sender Interference

Code 1: 1 1 1 -1 1 -1 -1 -1
Code 2: 1 -1 1 1 1 -1 1 1




                                   52
Discussions
 Advantages of channel partitioning




 Problems of channel partitioning




                                       53
Backup Slides




                54
Backup: IP Multicast




                       55
  IP Fragmentation & Reassembly
 Network links have MTU
  (max.transfer size) -
  largest possible link-level
  frame.                                     fragmentation:
    different link types,                   in: one large datagram
      different MTUs, e.g.                   out: 3 smaller datagrams
      Ethernet MTU is 1500
      bytes
 Large IP datagram divided
  (“fragmented”)                reassembly
    one datagram becomes
      several datagrams
    “reassembled” only at
      final destination
    IP header bits used to
      identify, order related
      fragments

                                                                56
 IP Fragmentation and Reassembly
                       length ID fragflag offset
Example                =4000 =x     =0      =0
 4000 byte
                     One large datagram becomes
  datagram           several smaller datagrams
 MTU = 1500 bytes
                           length ID fragflag offset
                           =1500 =x     =1      =0

                           length ID fragflag offset
                           =1500 =x     =1    =1480

                           length ID fragflag offset
                           =1040 =x     =0    =2960




                                                       57
IP Multicast: Service Model
                                           128.59.16.12


128.119.40.186

                                 multicast                    128.34.108.63
                                   group
                               226.17.30.197
                                                                  128.34.108.60


   Multicast group concept: use of indirection
        A group is identified by a location-independent
         logical address (class D IP address: prefix 1110)
   Open group model
        Anyone can send packets to the “logical” group address
        Anyone can join a group and receive packets
   Normal, best-effort delivery semantics of IP
    Needed: infrastructure to deliver mcast-addressed datagrams to
    all hosts that have joined that multicast group
                                                                                  58
Multicast Across LANs
   Goal: find a tree (or trees) connecting routers having
    local mcast group members
       source-based: different tree from sender to each receiver
             – Distance-vector multicast routing protocol (DVMRP)
             – Protocol-independent multicast-dense mode (PIM-DM)
       shared-tree: same tree used by all group members
             – Core-Based Tree (CBT)
             – Protocol-independent multicast-sparse mode (PIM-SM)




             shared tree                  source-based trees
                                                                     59
Source Tree:
Reverse Path Flooding (RPF)
 A router x forwards a packet from source (S)
  iff it arrives via neighbor y, and y is on the
  shortest path from x back to S
 A packet is replicated to all but the incoming
  interface
                                              S
                                          1       1

                                                          y
                                  x
                                                              1

                                      1                   z

                                                      1
                                              t

                                                                  a
                                                                  60
Reverse Path Forwarding:
Improvement
 Basic idea: forward a packet from S only on
  child links for S
 A child link of router x for source S
   a link that has x as parent on
    the shortest path from the
                                          S
    link to S
   a child x notifies its parent y   x
                                              y
    (through the routing protocol)
    that it has selected y as its             z
    parent
                                          t

                                                  a
                                                  61
Reverse Path Forwarding: Pruning
 No    need to forward datagrams down subtree
   with no mcast group members
 “prune” msgs sent upstream by router with
   no downstream group members

S: source                           LEGEND

            R1                           router with attached
                          R4
                                         group member

      R2                                 router with no attached
                      P                  group member
                                     P
                               R5         prune message
 R3                    P                 links with multicast
                 R6   R7                 forwarding


                                                                   62
Pruning
 Prune (Source, Group) at a leaf router if no members
    send No-Membership Report (NMR) up tree

 If all children of router R prune (S,G)
    propagate prune for (S,G) to its parent

 What do you do when a member of a group (re)joins?
   send a Graft message to upstream parent

 How to deal with failures?
   prune dropped
   flow is reinstated
   down stream routers re-prune

 Note: again a soft-state approach



                                                         63
Implementation of
Source Trees in the Internet
 Multicast OSFP (MOSFP)
   Membership is part of the link state distribution; calculate
    source specific, pre-pruned trees

 Reverse Path Forwarding
    Distance Vector Multicast Routing Protocol (DVMRP)
    Protocol Independent Multicast – Dense Mode (PIM-DM)
        • very similar to DVMRP

      Difference: PIM uses any unicast routing algorithm to
       determine the path from a router to the source; DVMRP
       uses distance vector

      Question: the state requirement of Reverse Path
       Forwarding
                                                                   64
Building a Shared Tree
 Steiner Tree: minimum cost
    tree connecting all routers
    with attached group members
   A Steiner tree is not a
    spanning tree because you
    do not need to connect all
    nodes in the network
   Problem is NP-hard
   Excellent heuristics exists
   Not used in practice:
       computational complexity
       information about entire network needed
       monolithic: rerun whenever a router needs to join/leave

                                                                  65
Center (Core) based Shared Tree
 Single delivery tree shared by all
 One router identified as      “center” of tree
 Tree construction is receiver-based
    edge router sends unicast join-msg addressed to center
     router
    join-msg “processed” by intermediate routers and
     forwarded towards center
    join-msg either hits existing tree branch for this center,
     or arrives at center
    path taken by join-msg becomes new branch of tree for
     this router
 A sender unicasts a packet to center
    The packet is distributed on the tree when it hits the tree

                                                                   66
Example: M3 Joins
 Group members: M1, M2

                                                        core


                    M1




                            M2                             M3

      shared tree
     join message
                                           S1


Discussion: what is property of the constructed tree?
                                                                67
Example: M1 Sends Data
 Group members: M1, M2, M3
 M1 sends data
                                       core


               M1




                             M2           M3



   control (join) messages
   data                           S1



                                               68
Shared Tree Protocols in the Internet

 Core Based Tree
 Protocol Independent Multicast (PIM)
  Sparse mode
 The catch: how do you know the center?
     session announcement




                                           69
Mbone: Tunneling
Q: How to connect “islands” of multicast
 routers in a “sea” of unicast routers?




            physical topology         logical topology

 mcast datagram encapsulated inside “normal” (non-multicast-
  addressed) datagram
 normal IP datagram sent thru “tunnel” via regular IP unicast to
  receiving mcast router
 receiving mcast router unencapsulates to get mcast datagram

                                                                    70

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:38
posted:4/1/2011
language:English
pages:70