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)

        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

   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

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
 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
A Sample Network

    fig 5-1

 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

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

Figure 19.3   Network layer in an internetwork`1

Position of network layer

Figure 19.4   Network layer at the source

Figure 19.5   Network layer at a router

Figure 19.6   Network layer at the destination

     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 !

     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.
     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.

    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
    Network layer duties

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

      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
Figure 18.4 Virtual Circuit Approach

Figure 18.5   More on Virtual Circuits

Figure 19.8   Datagram approach

Comparison of Virtual-Circuit and
    Datagram Approaches


 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.

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.

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

              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.
             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.
Building Link State Packets

(a) A subnet. (b) The link state packets for this subnet.
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).
Hierarchical Routing

      Hierarchical routing.

          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.

                          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

Why network IDs?

Another routing example in IP

Routing table with network and host

Sample Internet

      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
Subnetting in Classful Addresses

    Subnetting in Classful Addresses

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

Subnetting in Classful Addresses

 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.

        / 29

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

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


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

         Network ID: 153.237.96. 0

Classless InterDomain Routing (CIDR)
    Addressing in Internet Protocol

                             /29 /29


                             /29 /29

 10000000 11000000 01101111 1100000

  Routing Tables in IP with CIDR
              Mask        Destination          Next Hop

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.

    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
Curious ones can find more detail in “Internetworking with TCP/IP
vol.1” by Douglas Comer, Section-10.22.

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

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

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?

Routing Architecture in the Internet
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.).

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.

Routing Architecture in the Internet

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

OSPF – The Interior Gateway Routing

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

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


• 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

BGP – The Exterior Gateway Routing

                   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.

               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:

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


Shared By: