Docstoc

The Network Layer

Document Sample
The Network Layer Powered By Docstoc
					    Introduction to Data Communications (IDC) ECI-M-917
Lecturers: Dr. Sandra Dudley-McEvoy (me!) and Mr. Ya Bao (Coordinator)

             http://eent3.lsbu.ac.uk/staff/dudleyms/IDC.htm
        There is also a Blackboard website, you will need your login
                       name and windows password


   Methods of Teaching and Learning : Lecture over 12 weeks, Tutorial and
   Workshop

   Assessment of the unit :
   2-hour written examination -- 70%
   laboratory coursework      -- 30%
  Textbook: “Computer Networks” 4/E, by Andrew S. Tanenbaum, Publisher:
  Prentice-Hall, 2003. ISBN: 0-13-038488-7.
  “Data Communications and Networking”, Behrouz Forouzan, 3rd Ed There is
  now a 4th Ed                                                              1
Some Issues
     Plagiarism- not acceptable to hear “I didn’t know”
     There are severe penalties if caught. If you are not
     sure ASK ME!

     Caxton House (English help, dyslexia testing etc,
     money worries). Most Importantly all help and
     advice is FREE

     If you have any academic problems with this
     course COME AND SEE ME, SOONER
     RATHER THAN LATER.

     LASTLY- MOBILE PHONES OFF!
                                                            2
                        Lectures
a) 6 weeks will cover three layers of interest

b) Network, Transport and Application Layers

c) Lectures 1-2 Network layer

d) Lectures 3-4 Transport Layer

e) And Lectures 5-6 Application Layer
                                                 3
                              Outline
 Introduction to Network Layer
    A network.
    Responsibilities and functionalities of the network layer.
    Virtual Circuit Switching and Datagram Routing.
 Routing Algorithms
    Optimality principle
    Dijkstra’s “Shortest Path” Algorithm
    Distance Vector Routing (DVR)
    Link State Routing (LSR)
    Hierarchical Routing
 Internet Protocol (IP): The network layer in the Internet
    Packet format
 Routing in IP
    Addressing
    Autonomous Systems (ASs), Exterior and Interior Gateway Protocols
                                                                         4
A Sample Network



    fig 5-1




                   5
 Where is the network layer?
a)There are 7 layers from OSI model and 5 layers
from TCP/IP model (discuss later!)

b)From OSI, the Network layer rests between the
upper layer called the transport layer and the lower
layer called the Data Link Layer.

c)From the TCP/IP model, the Network layer is
called the Internet layer and it rests between the
upper Transport layer and the lower Host to Network
layer.


                                                       6
                         Layers
a) In the sense of purpose and responsibility, each layer is
   separate and independent
b) Each has its own function, but also provides a service to
   those layers above and below itself
c) The OSI and TCP/IP models should be considered an
   aid to understanding the nature of communication on
   the network – and useful in sorting out troubles that
   might occur on a network
d) By providing, it allows both software engineers and
   hardware manufacturers ensure their products work
   together.


                                                          7
Figure 19.3   Network layer in an internetwork`1




                                                   8
Position of network layer




                            9
Figure 19.4   Network layer at the source




                                            10
Figure 19.5   Network layer at a router




                                          11
Figure 19.6   Network layer at the destination




                                                 12
     Network layer duties




The challenge is interconnecting different networks
(various LAN technologies, telephone network, satellite
link, ATM networks etc.) and making them look the
same to the transport layer. The transport layer should
not be worried about the underlying physical network !


                                                          13
     Network layer duties




Unique addresses are required to define each
host/machine/device/user in the network. We cannot
use the data link layer addresses !! Because these
addresses depend on the technology used in the data
link layer. Remember, network layer is independent of
the data link layer.
                                                        14
     Network layer duties




This is a task common to all layers. The Protocol Data
Units (PDU’s) coming from the transport layer must be
placed in network-layer packets and sent to the data-
link layer.


                                                         15
    Network layer duties




Remember, the network layer must be able to operate
on top of any data-link layer technology (Ethernet, Fast
Ethernet, ATM etc.). All these technologies can handle a
different packet length. The network layer must be able
to fragment transport layer PDUs into smaller units so
that they can be transferred over various data-link layer
technologies.
                                                       16
    Network layer duties




Now that you have your network layer packet, where do
you send it ?




                                                    17
      Figure 19.7   Switching
                                             Used in computer networks
                                             and (also in modern
                                             telephone networks).
                                             Packets of bits (not lines)
                                             are switched!




Used in telephone networks
for more than 100 years. A
physical link is dedicated
between Source and              (Also called              (Also called
Destination. Data can be        Connection-oriented       Connectionless
sent as a stream of bits        networking)               networking)
without the need for
                                                                           18
packetising.
Figure 18.4 Virtual Circuit Approach




                                       19
Figure 18.5   More on Virtual Circuits




                                         20
Figure 19.8   Datagram approach




                                  21
Comparison of Virtual-Circuit and
    Datagram Approaches



            5-4




                                    22
 The Optimality Principle




      (a) A subnet.                 (b) A sink tree for router B.

Here the distance metric is number of hops from B. There
will be other trees available and the goal of all algorithms is
             to find the sink trees for all routers.

                                                                  23
Dijkstra’s Algorithm
1.    Start with the local node (router): the root of the tree.
2.   Assign a cost of 0 to this node and make it the first permanent node.
3.   Examine each neighbour node of the node that was the last permanent node.
4.   Assign a cumulative cost to each node and make it tentative.
5.   Among the list of tentative nodes
         1. Find the node with the smallest cumulative cost and make it permanent.
     2. If a node can be reached from more than one direction
        1. Select the direction with the shortest cumulative cost.
      6. Repeat steps 3 to 5 until every node becomes permanent.




                                                                              24
            Shortest Path Routing
The first 5 steps used in computing the shortest path from A to D.
                 The arrows indicate the working node.




                                                              25
              Distance Vector Routing




This Alg. operates by having each
router maintain a table (a vector) giving
the best known distance to each
destination and which line to use.
These tables are then updated by
exchanging information with the
neighbours (direct link, 1 hop)
    (a) A subnet. (b) Input from A, I, H, K, and the new
    routing table for J.                                   26
     Distance Vector Routing (2)
                 The count-to-infinity problem!




Good news (a) travels faster than bad news (b)
 Routers are thick! They don’t how to adapt,
they must be told to change. Convergence to the correct answer is slow.
                                                                          27
             Link State Routing
Idea Behind LSR: Each router must do the following:

1. Discover its neighbors, learn their network address.
2. Measure the delay or cost to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to all other routers (flooding).
5. Compute the shortest path to every other router.
In effect the complete topology and all the delays are
    experimentally measured and distributed to every
    router, then Dijkstra’s algorithm can be run to find the
    shortest path to every other router.
                                                       28
Building Link State Packets




(a) A subnet. (b) The link state packets for this subnet.
                                                            29
Distributing the Link State Packets




Above, the data structure used by router B. Each row corresponds
to a recently-arrived, but as yet not fully processed, LSP. The table
shows where the packet originated, sequence number, age and the
data. ACF are directly connected to B.


The packet buffer for router B in the previous slide (Fig. 5-13).
                                                                   30
Hierarchical Routing




      Hierarchical routing.

                              31
          Internet Protocol (IP)
 IP connectionless network-layer protocol.
 IP is based on datagram routing.
 IP is unreliable !!
 IP has a two-level (at least, traditionally) hierarchical
addressing mechanism.
 Routing in IP is a mixture of hierarchical, distance vector
and link state routing algorithms.




                                                            32
                          IP Packet Header




                           Do not fragment !    Pointer to this        Total Length of the IP
                                                fragment in the        packet in terms of number of
IP Header Length in        More fragments       datagram in terms of   bytes.
terms of 32-bit words !                         8-byte units.

        Identifies each datagram from others.
        All fragments of a datagram must have the same
        unique Identification number.                                                      33
IP Addresses




               34
Why network IDs?




                   35
Another routing example in IP




                                36
Routing table with network and host
             addresses




                                  37
Sample Internet




                  38
      Subnetting in Classful Addresses

Classful addressing in IP is both inflexible and inefficient !




   allows 127 networks and 16 777 214 hosts on each network

 allows 16384 networks and 65534 hosts on each network


  allows 2 097 152 networks and 254 hosts on each network
                                                                 39
Subnetting in Classful Addresses




                               40
    Subnetting in Classful Addresses
                                 128.20.0.0




                           10000000 00010100 00000000 00000000
     Class B addess           Network Prefix   Host Suffix
                                              Subnet ID
Subnetting with /20 mask     Network Prefix               Host ID

                                                                    41
Subnetting in Classful Addresses




                               42
 Classless InterDomain Routing (CIDR)
     Addressing in Internet Protocol
CIDR allows each IP address to have a different length of network
ID and host ID. In CIDR each IP address is assigned a 32-bit mask
to extract the network ID.

                 128.192.111.202 / 29


      10000000 01101111 11000000 11001010
      11111111 11111111 11111111 11111000
      10000000 01101111 11000000 11001000

            Network ID: 128.192.111.200
                                                              43
Classless InterDomain Routing (CIDR)
    Addressing in Internet Protocol

            153.237.108.227 /19


   10011001 11101101 01101100 11100011
   11111111 11111111 11100000 00000000
   10011001 11101101 01100000 00000000

         Network ID: 153.237.96. 0


                                         44
Classless InterDomain Routing (CIDR)
    Addressing in Internet Protocol

                                            128.192.111.192 /29
                                      128.192.111.194 /29   128.192.111.194 /29




                                            128.192.111.200 /29

                                      128.192.111.201 /29    128.192.111.202 /29


        128.192.111.192 /28

 10000000 11000000 01101111 1100000


                                                                        45
  Routing Tables in IP with CIDR
              Mask        Destination          Next Hop
               /12         128.96.0.0         145.12.56.29
               /17         128.125.0.0       153.202.12.128
               /12         128.112.0.0        153.202.14.1
               /26       128.105.14.64        153.2.45.101
               /32       128.105.14.66        153.2.45.101


For each entry in the routing table:
   MaskedAddress := EntryMask (bitAND) IPDatagramDestinationAddress;
   if (MaskedAddress == EntryDestination)
         Mark the entry;

Choose the marked entry with the longest Mask prefix.


                                                                46
    Routing Tables in IP with CIDR
In reality, routing tables in IP routers may contain more information
and they are represented by some kind of a binary tree data structure
to speed up the searching process. We will not go into any more
detail.
Curious ones can find more detail in “Internetworking with TCP/IP
vol.1” by Douglas Comer, Section-10.22.




                                                                47
Routing Table Maintenance in the Internet
  • How can we update routing tables in the network below ?




                                                              48
Routing Table Maintenance in the Internet
  • What if we have alternative routes (e.g., network below) ?




                                                                 49
Routing Table Maintenance in the Internet
  • Manual maintenance of routing tables cannot reflect the
  dynamic characteristics of network links.

  • Routing protocols such as Distance Vector and Link State
  Routing (also known Shortest Path First) are needed to
  automatically update routing tables in the network.

  • Try implementing Distance Vector (or Link State) routing in
  a 500-node network.

  •How about in a network with 100000 nodes? How many
  routers exist in the Internet?

                                                               50
Routing Architecture in the Internet
Fact:
Nobody owns the whole Internet.
However, parts of the Internet are owned and administered by
commercial and public organisations (such as ISPs, universities,
governmental offices, research institutes, companies etc.).


Idea:
Divide the Internet in Autonomous Systems (AS) that are
independently administered by individual organisations. Let each
administrative authority use its own routing protocol within the
AS. Let’s use one routing protocol to exchange routing
information among AS.

                                                              51
Routing Architecture in the Internet




                                  52
Routing Information Protocol (RIP)
• Direct implementation of Distance Vector routing
• Path costs are based on number of hops
• Number of hops is limited to 16
• RIP messages are transmitted in UDP packets
• RIPv1 cannot contain subnet masks
• RIPv2 is an improvement on RIPv1 to contain subnet masks
and next-hop addresses




                                                             53
OSPF – The Interior Gateway Routing
             Protocol




                                                         54
(a) An autonomous system. (b) A graph representation of (a).
                   OSPF (2)




The relation between ASes, backbones, and areas in OSPF.
                                                           55
                         OSPF (3)


                                 5-66

• Based on Link State Routing
• OSPF messages are transported directly in IP packets
• OSPF standard supports novel concepts such as type of service routing,
load balancing and authentication




                                                                       56
BGP – The Exterior Gateway Routing
            Protocol




                                57
                   Further Reading
1- Chp-5 from “Computer Networks”, Andrew Tanenbaum, 4th Ed. to
learn more about the generic network layer.

2- “Internetworking with TCP/IP vol.1”, Douglas Comer, 4th Ed.,
provides a detailed and comprehensive presentation of TCP/IP.

3- “Data Communications and Networking”, Behrouz Forouzan, 3rd
Ed., when you get confused and wonder if there’s a simpler
explanation of all these issues.




                                                                  58
               Copyright Information
 Some figures used in this presentation have been either directly copied or
 adapted from several books.


1- “Computer Networks”, Andrew Tanenbaum, 4th Ed., Slides: 2,17,18,20-
26,28,29,35, 37,38, 51-54.

2- “Internetworking with TCP/IP vol.1”, Douglas Comer, 4th Ed., Slides:
34,39,42,45,46.

3- “Data Communications and Networking”, Behrouz Forouzan, 3rd Ed.,
Slides: 3-16,19,27,29-33,43,49.




                                                                              59

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:2/8/2012
language:
pages:59