Docstoc

Part I Introduction - PowerPoint

Document Sample
Part I Introduction - PowerPoint Powered By Docstoc
					Network Layer: a. Forwarding
Goals:                            Overview:
 understand principles
                                   network layer services
  behind network layer
  services:                        IP addresses & their usage
      forwarding                  NAT
      routing (path selection)    IP header
      dealing with scale          IP fragmentation
 instantiation and                ICMP
  implementation in the
                                   IPv6
  Internet




                                         Ch. 4: Network Layer - Forwarding   #1
Network Layer objectives
 Transport packet from source to
   dest.
    o Net layer in all hosts, routers
Basic functions:




                                      “Data plane”
   Forwarding
   move packets from source to
    destination through routers
   Routing
   prepare info (table) that
    enables finding a path for
                                      “Control plane”
    every packet/ data stream
   Call setup (VC only, see later)
   find path for a data session
    before data transfer starts
   keep record of it in routers
                                                        Ch. 4: Network Layer - Forwarding   #2
Interplay between routing and forwarding
                            routing algorithm


                          local routing table           Build routing tables
                         header value output link
                                 0100   3                    Routing
                                 0101   2
                                 0111   2
                                 1001   1




        value in arriving
        packet’s header
                               0111                 1

                                             3 2
                    Forwarding
                Move packets from
            input link to output link
Ch. 4: Network Layer -
Forwarding                                                        4-3
Network service model
  Q: What service model
    for “channel”
                                          The most important
    transporting packets                  abstraction provided
    from sender to                         by network layer:
    receiver?
   guaranteed bandwidth?
   preservation of inter-packet
    timing (no jitter)?
                                             ? ?
                                              virtual circuit
                                                    or
                                                datagram?
   loss-free delivery?
   in-order delivery?
   congestion feedback to
                                              ?
    sender?

                                   Ch. 4: Network Layer - Forwarding   #5
Virtual circuits: signaling protocols
 Principle
    prepare a path (= VC) before moving data
    each direction is a separate path

 Signaling
    used to set up, maintain, teardown VC
    used in ATM, frame-relay, X.25
    not used in today‟s Internet
        • but Cisco‟s MPLS builds a VC service over IP


application
transport 5. Data flow begins                     6. Receive data application
                                                                       transport
 network 4. Call connected                       3. Accept call
                                                                        network
 data link 1. Initiate call                     2. incoming call
                                                                        data link
 physical
                                                                        physical
              path recorded                         more path details

                                               Ch. 4: Network Layer - Forwarding   #6
Virtual Circuit: call setup
 Path preparation + resource allocation:
     Call setup message flows from source to
      destination.
       • path recorded at this time
     Path determination (routing):
       • Source based or network based.
     Msg may indicate required resources:
       • BW, latency, buffer, etc.
     A router can either:
       • accept (and commit required resources) or reject
     Path accepted if all routers accept.
                                      Ch. 4: Network Layer - Forwarding   #7
Virtual Circuit: Identifiers
 Forward call-setup pass:
      each router allocates an ID for the VC
        • intended for incoming (I/C) packets of the VC
        • records it + the preceding &following node of path
 Backward call-setup pass:
    each router tells predecessor its ID for the VC
        • will use this ID on outgoing (O/G) packets of this VC
   lists in the I/C port‟s fwding table the I/C VC-ID
   
   and the corresponding O/G port+O/G ID
 Runtime: when receiving a packet with an ID :
      find, in the I/C port‟s forwarding table, the I/C ID‟s record
      read from it the outgoing port & the O/G ID
      send packet on the required port with new ID .
                                         Ch. 4: Network Layer - Forwarding   #8
VC : identifiers preparation
 Example: call setup stage



       BW=1Mb                          BW=1Mb                          BW=1Mb
                   1               2               1               2



            In
            In         VC id
                       VC id   Out
                               Out     VC id
                                       VC id   In
                                               In      VC id   Out     VC id
            port
            port       in
                       in      port
                               port    out
                                       out     port
                                               port    in      port    out

            1
            1          38      2       22      1
                                               1       22      2       xx




                                                   Ch. 4: Network Layer - Forwarding   #9
VC : identifiers usage
 Example: runtime stage



      VCid=38                          VCid=22                           VCid=xx
                   1               2                 1               2



            In
            In         VC id
                       VC id   Out
                               Out     VC id
                                       VC id     In
                                                 In      VC id   Out     VC id
            port
            port       in
                       in      port
                               port    out
                                       out       port
                                                 port    in      port    out

            1
            1          38      2       22        1
                                                 1       22      2       xx




                                                     Ch. 4: Network Layer - Forwarding   #10
Datagram networks: Internet model
 no call setup at network layer
 routers: no state about end-to-end connections
    no network-level concept of “connection”

 packets typically routed using destination host ID
    packets between same source-dest pair may take
     different paths


application
                                                       application
transport
                                                       transport
 network
                                                        network
 data link 1. Send data                2. Receive data
                                                        data link
 physical
                                                        physical


                                   Ch. 4: Network Layer - Forwarding   #14
ATM: overview
 Asynchronous Transfer Mode
 Fixed packets size: called cells
    53 bytes = 5 header + 48 data

 All virtual-circuit based
 Types of virtual circuits
    “virtual circuits” aggregated into “virtual paths”
    Permanent or switched

 Architecture is QoS-focused
      Service Quality types: CBR, VBR, ABR, UBR
 Access traffic policing
   Typical tool: leaky-bucket access control
                                  Ch. 4: Network Layer - Forwarding   #15
    Network Layer Quality of Service
                                                    Guarantees ?
     Network         Service                                    Congestion
  Architecture       Model          Bandwidth Loss Order Timing feedback

       Internet      best effort none               no       no        no         no (inferred
                                                                                  via loss/delay)
             ATM     CBR            constant        yes      yes       yes        no
                                    rate                                          congestion
             ATM     VBR            guaranteed      yes      yes       yes        no
                                    rate                                          congestion
             ATM     ABR            guaranteed      no       yes       no         yes
                                    minimum
             ATM     UBR            none            no       yes       no         no
    Internet model is being extended: Intserv, Diffserv
            multimedia networking
ATM: Asynchronous Transfer Mode; CBR: Constant Bit Rate; V: Variable; A: available; U: Unspecified
                                                           Ch. 4: Network Layer - Forwarding   #16
Datagram or VC network: why?
Internet (Datagram)                ATM (VC)
 data exchange among hosts         evolved from telephony
    (mostly) “elastic” service,         but supports also data
     no strict timing req.          human conversation:
 “smart” end systems                  strict timing &reliability
                                        requirements
    can adapt, perform
                                       svc guaranteed needed
     control, error recovery
                                    “dumb” end systems
    simple inside network,
                                       telephones
     complexity at “edge”
                                       complexity inside
 many link types
                                        network
    different characteristics
                                    VC Benefits:
    uniform service difficult
                                       Fast forwarding
 Datagram benefit:                    Traffic Engineering.
    Simplicity                        In order delivery

                                       Ch. 4: Network Layer - Forwarding   #17
IP Addressing Scheme

 We need an address to uniquely identify
  each destination
 Routing scalability requires flexibility in
  aggregation of destination addresses
   we should be able to aggregate a set of
    destinations as a single routing unit
   necessary for routing table scalability

 Preview: the unit of routing in the Internet
  is a network - the destinations in the routing
  protocols and tables are networks

                               Ch. 4: Network Layer - Forwarding   #19
IP Addressing: introduction
 IP address: 32-bit                      223.1.1.1

  identifier for host or                                           223.1.2.1
  router interface
                                          223.1.1.2
                                                 223.1.1.4   223.1.2.9
 interface: connection
                                                                   223.1.2.2
  between host/router                    223.1.1.3    223.1.3.27

  and physical link
      router‟s typically have
       multiple interfaces                223.1.3.1            223.1.3.2
      a host has typically a
       single interface
      IP addresses
       associated with         223.1.1.1 = 11011111 00000001 00000001 00000001
       interface, not host, or
                                             223        1        1        1
       router
                                             Ch. 4: Network Layer - Forwarding   #20
IP Addressing
 IP address is divided              223.1.1.1

  into two parts:                    223.1.1.2
                                                              223.1.2.1

      network prefix                       223.1.1.4   223.1.2.9
        • K high order bits
                                                               223.1.2.2
      host number                  223.1.1.3    223.1.3.27
        • remaining low order
          bits                                            LAN
 This partitioning of               223.1.3.1                 223.1.3.2
  the address depends
  on the context
  network in which we
  see this NIC                  Qn: What is the router‟s IP
                                address in the drawing we see?
      networks are nested
       inside each other
                                        Ch. 4: Network Layer - Forwarding   #21
What is a network in IP view?
IP network terminology:           223.1.1.1

   a Subnet is:                   223.1.1.2
                                                            223.1.2.1

       a set of devices that             223.1.1.4   223.1.2.9
        can physically reach
        each other without       223.1.1.3     223.1.3.27
                                                             223.1.2.2

        intervening router(s)
       e.g. a LAN                                     LAN

 a Network is:                    223.1.3.1                 223.1.3.2
    a subnet , or:
    the union of several
     subnets that are           three subnets (LANs) 223.1.1.*,
     interconnected by links    223.1.2.*, 223.1.3.*, together they
                                form a larger network with prefix
                                223.1 (16 bits) (OR MORE bits?)

                                     Ch. 4: Network Layer - Forwarding   #22
IP Address Structure (CIDR method)
   the network prefix consists of the K most significant bits of the
  address
    in some cases it is called the subnet prefix (see subnets below)
 the host number = the other (32-K) bits
 the size K of the network prefix differs and must be specified in
  each case. Two methods used for this:
    network mask has all 1„s in the prefix part and all 0‟s elsewhere
    short notation is   /K (also called the CIDR notation)

Exercise 1
    a)   write the following IP address in dotted decimal notation
    b)   specify corresponding netwk mask (binary and dotted decimal)
    c)   show network prefix & host # parts of that address (binary)
      11001000 00010111 00010001 10110101 /23
 see solutions at end of chapter
  Ch. 4: Network Layer -
  Forwarding                                                  4-23
Special Types of IP Address
   network broadcast address : host # = 11...1
        means: all the hosts in the network specified in address prefix
        used only as destination address of packets
        if dest. address = 11… 1 (32 1‟s), broadcast on sender‟s subnet
   network address : host # = 0 (all zeros)
        means: the whole network (used only in routing tables)
 therefore the IP address of a host/router can not
    have host number = 0 or = “all ones”
Exercise 2
    1.   write the network address of the network from Exercise 1
    2.   write the broadcast address for that network
    3.   how many IP host addresses are possible in that network?
    4.   write host & network address with /K notation
    5.   write the first and last host address on that network
  Ch. 4: Network Layer -
  Forwarding                                                   4-24
Subnets                              Example
                               Network 223.1.0.0 / 21
Recipe
 To determine the
  subnets of a network,
  detach each interface
  from its host or
  router, creating
  islands of isolated
  networks. Each
  isolated network is
  a subnet.
                          Divide network into subnets and
                           give an address to each subnet
 Ch. 4: Network Layer -
 Forwarding                                       4-25
Solution of Example                         Stage 2
                                          Network 223.1.0.0 / 21
        Stage 1          Subnet 223.1.1.0 / 24
                                 223.1.1.1   Subnet 223.1.2.0 / 24
                                                       223.1.2.1
                                   223.1.1.2
                                                    223.1.2.9
                                        223.1.1.4
                                                    223.1.3.27
                            223.1.1.3
                                                                   223.1.2.2



                             223.1.3.1                          223.1.3.2


                                        Subnet 223.1.3.0 / 24

                                          Subnets: /24
Ch. 4: Network Layer -
Forwarding                                                      4-26
                                        Whole network: 223.1.0.0/20
Subnets                     Subnet 223.1.1.0/24
                                                            223.1.1.2


                                            223.1.1.1
o How many subnets?
                                                                        223.1.1.4

o Write an address for                          223.1.1.3
  each subnet,
  including /K
                               223.1.9.2                          223.1.7.2
                  Subnet 223.1.9.0/24                                    Subnet 223.1.7.0/24
o Write an address for
  the whole network,
  including /K       223.1.9.1
                                 223.1.8.1                      223.1.8.2
                                                                               223.1.7.1


                                223.1.2.6
                                                   Subnet 223.1.8.0/24
                                                                                223.1.3.27
                                                  223.1.2.2    223.1.3.1            223.1.3.2
                          223.1.2.1



 Ch. 4: Network Layer -       Subnet 223.1.2.0/24                   Subnet 223.1.3.0/24
 Forwarding                                                                         4-27
IP Addresses
given notion of “network”, let‟s re-examine IP addresses:
“classful” addressing:
(does not need mask or /K indicator)
    class
                                                              1.0.0.0 to
     A      0 network              host                       127.255.255.255

     B             network                                    128.0.0.0 to
            10                            host
                                                              191.255.255.255
                                                              192.0.0.0 to
     C      110         network                  host
                                                              223.255.255.255
                                                              224.0.0.0 to
     D      1110         multicast address (*)
                                                              239.255.255.255
                             32 bits
(*) this range used as multicast also in CIDR method


                                                 Ch. 4: Network Layer - Forwarding   #28
IP addressing: CIDR
 classful addressing:
     inefficient use of address space, address space exhaustion
     e.g., class B net allocated enough addresses for 65K hosts,
      even if only 2K hosts in that network
 CIDR: Classless InterDomain Routing
     network portion of address of arbitrary length
     address format: a.b.c.d/x, where x is # bits in network
      portion of address
     Requires inclusion of mask or “/K” in routing table

                    network                         host
                      part                          part
      11001000 00010111 00010000 00000000
                  200.23.16.0/23
                                       Ch. 4: Network Layer - Forwarding   #29
IP addresses: how to get one?
Hosts (host number):
 hard-coded by system admin in a file
      Can see in IPConfig
 DHCP: Dynamic Host Configuration Protocol:
  dynamically get address: “plug-and-play”
    host broadcasts “DHCP discover” msg
    DHCP server responds with “DHCP offer” msg
    host requests IP address: “DHCP request” msg
    DHCP server sends address: “DHCP ack” msg
    this is the common practice in LAN (why?)
    in home access: same procedure using PPP protocol

                                Ch. 4: Network Layer - Forwarding   #30
    IP addresses: how to get one?
    Network (network prefix+mask):
     get allocated portion of ISP‟s 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



                                         Ch. 4: Network Layer - Forwarding   #31
IP addresses: how to get one?
ISP
 Gets a block of addresses from ICANN:
A: ICANN: Internet Corporation for Assigned
  Names and Numbers
   allocates addresses
   manages DNS
   assigns domain names, resolves disputes
   allocates codes for the various protocols




                                Ch. 4: Network Layer - Forwarding   #32
Hierarchical addressing: route aggregation
   Hierarchical addressing allows efficient advertisement of routing
   information:


 Organization 0
     200.23.16.0/23
 Organization 1
                                               “Send me anything
     200.23.18.0/23                            with addresses
 Organization 2                                beginning
     200.23.20.0/23    .   Fly-By-Night-ISP    200.23.16.0/20”
                       .
                  .    .                                              Internet
                  .
 Organization 7   .
    200.23.30.0/23
                                                 “Send me anything
                             ISPs-R-Us
                                                 with addresses
                                                 beginning
                                                 199.31.0.0/16”


                                              Ch. 4: Network Layer - Forwarding   #33
Hierarchical addressing: more specific
routes
ISPs-R-Us has a more specific route to Organization 1
 Organization 0
     200.23.16.0/23

                                                “Send me anything
                                                with addresses
 Organization 2                                 beginning
     200.23.20.0/23     .   Fly-By-Night-ISP    200.23.16.0/20”
                        .
                    .   .                                              Internet
                    .
 Organization 7     .
    200.23.30.0/23
                                                 “Send me anything
                              ISPs-R-Us
                                                 with addresses
   Organization 1                                beginning 199.31.0.0/16
                                                 or 200.23.18.0/23”
       200.23.18.0/23


                                               Ch. 4: Network Layer - Forwarding   #34
                                          4 billion
Routing table                             possible entries (*)
         Destination Address Range                        Link Interface

  11001000 00010111 00010000 00000000
                  through                                      0
  11001000 00010111 00010111 11111111

  11001000 00010111 00011000 00000000
                 through                                       1
  11001000 00010111 00011000 11111111

  11001000 00010111 00011001 00000000
                 through                                       2
  11001000 00010111 00011111 11111111
            otherwise                                          3

                  (*) true for IPv4; in IPv6 MUCH more
                                        Ch. 4: Network Layer - Forwarding   #35
Longest prefix matching
                  Network                              /K     Link Interface
      11001000    00010111    00010000 00000000      /21         0
      11001000    00010111    00011000 00000000      /24         1
      11001000    00010111    00010100 00000000      /24         2
      00000000    00000000    00000000 00000000       /0         3
             Network          Link Interface
          200.23.16.0 /21            0
          200.23.24.0 /24            1
          200.23.20.0 /24            2
                                                            Routing table
          otherwise                  3
Examples:
Which interface will be used by this router for following dest addresses?
(a)     DA: 11001000 00010111 00010110 10100001
(b)     DA: 11001000 00010111 00010100 10101010
(c)     DA: 11001000 00010111 00011100 10111110
(d)        DA: 11001000     00010111   00011000    11101010
  Network Layer
                                                                     4-36
Getting a datagram from source to dest.
                                           routing table in R
                                     Dest. Net. next router Nhops
IP datagram:                          223.1.1                          1
                                      223.1.2      223.1.5.2           2
  misc source dest
                          data        223.1.3      223.1.5.2           2
 fields IP addr IP addr
                                         223.1.1.4    R
  datagram remains              A    223.1.1.1          223.1.5.1
   unchanged (*), as it
   travels source to                  223.1.1.2
                                                               223.1.2.1
   destination                               223.1.5.2   223.1.2.9
  addr fields of interest       B                       S
   here                              223.1.1.3    223.1.3.27
                                                                223.1.2.2
                                                                            E
     Main field :
      dest. IP addr                   223.1.3.1                223.1.3.2


      (*) almost
                                      Ch. 4: Network Layer - Forwarding     #37
Getting a datagram from source to dest.
 misc                                  A’s IPConfig:                A’s ARP Table:
                           data
fields 223.1.1.1 223.1.1.3             IP Addr: 223.1.1.1           223.1.1.3 => 
                                       Subnet /K = 24 (*)           223.1.1.4 => 
Starting at A, given IP                Dflt Gtwy: 223.1.1.4         Etc.
  datagram addressed to B:
 A looks up its /K(*) in IPConfig              223.1.1.4       R
                                        A
 Compares first K bits in dest              223.1.1.1          223.1.5.1

   address with those in its own                                      223.1.2.1
                                             223.1.1.2
 find B is on same net. as A
                                                    223.1.5.2   223.1.2.9
      same prefix  sane subnet        B                       S
 link layer will send datagram             223.1.1.3    223.1.3.27
                                                                       223.1.2.2
                                                                                   E
   directly to B in link-layer frame
      using ARP table/protocol              223.1.3.1                223.1.3.2

      B and A are directly
        connected
                                        (*) subnet mask = 225.225.225.0
(*) in the form of subnet mask
                                             Ch. 4: Network Layer - Forwarding     #38
Getting a datagram from source to dest.
                                    Routing Table
 misc
                           data
fields 223.1.1.1 223.1.2.2           Dest. Net.       Next router Port          Hops
                                    223.1.1.0 /24                       a           1
Starting at A, dest. E:             223.1.2.0 /24 223.1.5.2             b           2
 look up network address of E      223.1.3.0 /24 223.1.5.2             b           2
 E on   different network                            a      R
                                             223.1.1.4
        A sees this by comparing    A    223.1.1.1       b 223.1.5.1
        /K prefixes of A and E
                                                                   223.1.2.1
   routing table: next hop               223.1.1.2
    router to E is 223.1.5.2                     223.1.5.2   223.1.2.9
                                     B                a      S b
   link layer sends datagram to
                                                               c
                                                                    223.1.2.2
    router 223.1.5.2 inside link-        223.1.1.3    223.1.3.27                E
    layer frame
                                          223.1.3.1                223.1.3.2
   datagram arrives at 223.1.5.2
   cont. on next slide..
                                           Ch. 4: Network Layer - Forwarding    #39
Getting a datagram from source to dest.
                                     Dest. Net.       Next router Port          Hops
  misc
                            data
 fields 223.1.1.1 223.1.2.2         223.1.1.0 /24 223.1.5.1             a           2
                                    223.1.2.0 /24                       b           1
Arrived at 223.1.5,2,               223.1.3.0 /24                       c           1
  continuing to 223.1.2.2
                                                      a      R
 look up network address of E               223.1.1.4
                                     A                    b 223.1.5.1
 E on subnet   directly attached         223.1.1.1

  to router‟s interface b                                          223.1.2.1
                                          223.1.1.2
 link layer sends datagram to                   223.1.5.2   223.1.2.9
  223.1.2.2 inside link-layer        B                a      S b
  frame via I/F b (223.1.2.9)
                                                               c
                                                                    223.1.2.2
                                         223.1.1.3    223.1.3.27                E
 datagram arrives at
  223.1.2.2!!! (hooray!)                  223.1.3.1                223.1.3.2

 Qn: What table consulted
  here?
                                           Ch. 4: Network Layer - Forwarding    #40
 Network Address Translation (NAT): Outline
     A local network uses just one public IP address as far as outside
    world is concerned
     Each device on the local network is assigned a private IP address

          rest of                          local network
         Internet                      (e.g., home network)
                                          192.168.1.0/24               192.168.1.2

                                  192.168.1.1
                                                                         192.168.1.3
                138.76.29.7

                                                                        192.168.1.4


All datagrams leaving local              Datagrams with source or
network have same single source          destination in this network
NAT IP address: 138.76.29.7,             have 192.168.1/24 address for
different source port numbers            source /destination (as usual)
                                                Ch. 4: Network Layer - Forwarding    #41
  NAT: Implementation
NAT router must:

for outgoing datagrams:
   replace (source IP address, port #) of every outgoing
    datagram by (NAT IP address, new port #)
     . . . remote clients/servers will respond using (NAT
        IP address, new port #) as destination addr.
   remember (in NAT translation table) every (source
    IP address, port #) to (NAT IP address, new port #)
    translation pair

for incoming datagrams:
   replace (NAT IP address, new port #) in dest fields
    of every incoming datagram with corresponding
    (source IP address, port #) stored in NAT table
                                  Ch. 4: Network Layer - Forwarding   #42
     NAT: Network Address Translation
                              NAT translation table
2: NAT router                                                        1: host 192.168.1.2
                          WAN side addr    LAN side addr
changes datagram                                                     sends datagram to
                     138.76.29.7, 5001 192.168.1.2, 3345             128.119.40.186, 80
source addr from
                       ……                            ……
192.168.1.2, 3345 to
138.76.29.7, 5001,                               S: 192.168.1.2, 3345
updates table                                    D: 128.119.40.186, 80
                                                                                         192.168.1.2
                                                                    1
                    S: 138.76.29.7, 5001
              2     D: 128.119.40.186, 80   192.168.1.1
                                                                                        192.168.1.3
                           138.76.29.7          S: 128.119.40.186, 80
                                                D: 192.168.1.2, 3345    4
            S: 128.119.40.186, 80
            D: 138.76.29.7, 5001    3                                                  192.168.1.4
                                                 4: NAT router
         3: Reply arrives                        changes datagram
         dest. address:                          dest addr from
         138.76.29.7, 5001                       138.76.29.7, 5001 to 192.168.1.2, 3345

                                                          Ch. 4: Network Layer - Forwarding   #43
NAT: Advantages
 No need to be allocated range of addresses
  from ISP: - just one public IP address is
  used for all devices
   16-bit port-number field allows 60,000
    simultaneous connections with a single LAN-side
    address !
   can change ISP without changing addresses of
    devices in local network
   can change addresses of devices in local network
    without notifying outside world
 Devices inside local net not explicitly
  addressable, visible by outside world (a
  security plus)
                               Ch. 4: Network Layer - Forwarding   #44
NAT: Drawbacks
 If both hosts are behind distinct NATs,
  they will have difficulty establishing
  connection
 NAT is controversial:
   violates layer modularity principle:
    routers should process up to only layer 3
   causes problem for some application protocols:
      • if application writes an explicit IP address within the
        L5 header, the peer application will get a useless
        internal IP address as an argument
 proper address shortage solution : IPv6 !

                                      Ch. 4: Network Layer - Forwarding   #45
  IP datagram format
IP protocol version
            number                      32 bits                       total datagram
     header length          head. type of                             length (bytes)
            (bytes)     ver                    length
                              len service                             for
     “type” of data                              fragment
                        16-bit identifier flgs                        fragmentation/
                                                   offset             reassembly
        max number      time to upper          Internet
     remaining hops       live     layer       checksum
   (decremented at
       each router)            32 bit source IP address

upper layer protocol          32 bit destination IP address
to deliver payload to                                                E.g. timestamp,
                                    Options (if any)
                                                                     record route
                                          data                       taken, specify
                                    (variable length,                list of routers
                                     typically a TCP                 to visit.
                                    or UDP segment)


                                                  Ch. 4: Network Layer - Forwarding   #46
 IPv6
 Initial motivation: 32-bit address space soon
  to be completely allocated.
 Additional motivation:
       IPv6 header format helps speed processing
 IPv6 datagram format:
     16-byte (128 bit) IP address
     fixed-length 40 byte header
         • no options allowed inside the header
         • each option gets its own header after the main IP header
       fragmentation discouraged
         • allowed only using an options header

 Network Layer
                                                             4-47 ‫אפקה‬
                                                                  "‫תשע‬
Transition From IPv4 To IPv6
 Not all routers can be upgraded simultaneously
   How will the network operate with mixed IPv4 & IPv6 routers?

   Tunneling: IPv6 datagrams are carried as payload in IPv4
                  datagrams when travelling through IPv4 routers
       source and destination network are IPv6, but need to transit
        an existing IPv4 network
   How is tunneling done?
       gateway router in source network takes the IPv6 datagram as
        payload and encapsulates it into an IPv4 datagram
          • i.e. adds an IPv4 header in front of it
       the IPv4 destination is the gateway router of the destination
        network, which removes the IPv4 header and routes by IPv6
 Gateway router must support IPv4, IPv6 and tunneling
 Network Layer
                                                              4-48 ‫אפקה‬
                                                                   "‫תשע‬
Tunneling
                    A             B                                          E             F
 Logical view:                           IPv4        tunnel         IPv4
                           IPv6                                                  IPv6
                   IPv6                                                                 IPv6

                    A             B              C            D              E   IPv6
                                                                                           F
                          IPv6          IPv4                        IPv4
Physical view:
                   IPv6                         IPv4      IPv4                          IPv6

                        Flow: X        Src:B                       Src:B         Flow: X
                         Src: A       Dest: E                     Dest: E         Src: A
                        Dest: F                                                  Dest: F
                                       Flow: X                     Flow: X
                                        Src: A                      Src: A
                          data         Dest: F                     Dest: F         data


                                          data                        data


                        A-to-B:                                                  E-to-F:
                                        B-to-C:                     B-to-C:
                         IPv6                                                     IPv6
                                      IPv6 inside                 IPv6 inside
   Network Layer                         IPv4                        IPv4
                                                                                               4-49 ‫אפקה‬
                                                                                                    "‫תשע‬
Usage of Tunneling
 Tunneling is used to move a packet between
  similar networks A, B through a network C
  that is unable to understand its L3 header
 Possible reasons:
   1.    C uses a different protocol (e.g. IPv6 vs IPv4)
   2.    A wants to encipher the data and the header
         (VPN application)
   3.    All networks use same protocol, but the
         destination node is currently at a foreign network
         (Mobile IP application)


Network Layer
                                                     4-50 ‫אפקה‬
                                                          "‫תשע‬
IPv6 Header (Cont)
Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same “flow.”
           (concept of“flow” not well defined).
Next header: identify upper layer protocol for data




                                 Ch. 4: Network Layer - Forwarding   4-51
Transition From IPv4 To IPv6
 Not all routers can be upgraded simultaneous
   no “flag days”
   How will the network operate with mixed IPv4 and
    IPv6 routers?
 Tunneling: IPv6 carried as payload in IPv4
  datagram among IPv4 routers




                              Ch. 4: Network Layer - Forwarding   4-52
IPv6 status report
 Operating systems –
   wide support – early 2000
   Windows (2000, XP, Vista), BSD, Linux, Apple

 Networking infrastructure
   Cisco

 Deployment
    Slow

 Penetration
    Host - minor (less than 1%)
    Used in 2008 in China Olympic games

 Motivation: CIDR & NAT


                                     Ch. 4: Network Layer - Forwarding   #53
Extra




        Ch. 4: Network Layer - Forwarding   #54
  IP Fragmentation & Reassembly
 network links have MTU
  (max.transfer size) - largest
  possible link-level frame.
    different link types,                             fragmentation:
      different MTUs                                   in: one large datagram
 large IP datagram divided                            out: 3 smaller datagrams
  (“fragmented”) within net
    one datagram becomes
      several datagrams
                                   reassembly
    “reassembled” only at final
      destination
    IP header bits used to
      identify, order related
      fragments




                                        Ch. 4: Network Layer - Forwarding   4-55
 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
1480 bytes in
data field                   length ID fragflag offset
                             =1500 =x     =1     =185
            offset =
            1480/8           length ID fragflag offset
                             =1040 =x     =0     =370




                                    Ch. 4: Network Layer - Forwarding   4-56
ICMP: Internet Control Message Protocol

 used by hosts & routers to
  communicate network-level        Type   Code   description
  information                      0      0      echo reply (ping)
                                   3      0      dest. network unreachable
    error reporting:
                                   3      1      dest host unreachable
      unreachable host, network,   3      2      dest protocol unreachable
      port, protocol               3      3      dest port unreachable
    echo request/reply (used      3      6      dest network unknown
      by ping)                     3      7      dest host unknown
 network-layer “above” IP:        4      0      source quench (congestion
    ICMP msgs carried in IP                     control - not used)
      datagrams                    8      0      echo request (ping)
 ICMP message: type, code plus
                                   9      0      route advertisement
  first 8 bytes of IP datagram     10     0      router discovery
  causing error                    11     0      TTL expired
                                   12     0      bad IP header


                                          Ch. 4: Network Layer - Forwarding   4-57
Traceroute and ICMP
 Source sends series of           When ICMP message
  UDP segments to dest              arrives, source calculates
      First has TTL =1             RTT
      Second has TTL=2, etc.      Traceroute does this 3
      Unlikely port number         times
 When nth datagram arrives       Stopping criterion
  to nth router:                   UDP segment eventually
      Router discards datagram     arrives at destination host
      And sends to source an      Destination returns ICMP
       ICMP message (type 11,       “host unreachable” packet
       code 0)
                                    (type 3, code 3)
      Message includes name of
                                   When source gets this
       router& IP address
                                    ICMP, stops.


                                        Ch. 4: Network Layer - Forwarding   4-58
 Exercise 1 Answers

            11001000 00010111 00010001 10110101                 /23

 128 64 32 16 8 4 2 1                  128 64 32 16 8 4 2 1
27 26 25 24 23 22 21 20               27 26 25 24 23 22 21 20


Ans 1: 11001000 00010111 00010001 10110101 =200.23.17.181
      128+64+8= 200        16+7= 23   16+1= 17       128+32+16+5= 181


Ans 2: 11111111 11111111 11111110 00000000 = 255.255.254.0
                                                          255-1 = 254


                      Ans 3: 11001000 00010111 00010001 10110101
                                      NETWORK               HOST



  Ch. 4: Network Layer -
  Forwarding                                                            4-59
 Exercise 2 Answers

            11001000 00010111 00010001 10110101             /23

                              NETWORK
Ans 1: 11001000 00010111 00010000 00000000 = 200.23.16.0



Ans 2: 11001000 00010111 00010001 11111111 = 200.23.17.255

                                        Ans 3: 29-2 = 510 hosts

                                        Ans 4: network: 200.23.16.0/23
                                         host:    200.23.17.181/23
                       Ans 5: first host address: 200.23.16.1/23
                       last host address: 200.23.17.254/23
  Ch. 4: Network Layer -
  Forwarding                                                       4-60

				
DOCUMENT INFO