PART 4 NETWORK LAYER - PowerPoint PPT Presentation

Loading...

PPT – PART 4 NETWORK LAYER PowerPoint presentation | free to view - id: 1ddacb-ZDc1Z



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

PART 4 NETWORK LAYER

Description:

only used as a destination address in an IP packet. 36. Loopback Address ... Which packet belongs the supernet? Sol) 205.16.37.44, because ... – PowerPoint PPT presentation

Number of Views:137
Avg rating:3.0/5.0
Slides: 111
Provided by: cespc1K
Category:
Tags: layer | network | part | address | an | belongs | do | find | how | ip | out | to | who

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: PART 4 NETWORK LAYER


1
PART 4 NETWORK LAYER
Computer Networks System
  • Lecturer Tae-Hyong Kim (D132)
  • thkim_at_cespc1.kumoh.ac.kr

2
Position of Network Layer
3
Issues to study
  • Internetworking
  • Addressing
  • Routing
  • Packetizing
  • Fragmenting
  • Address Resolution
  • Multicasting
  • Routing Protocols
  • Other Supporting Protocols

4
Chapters
  • Ch.19 Host-to-Host Delivery
  • Internetworking, Addressing, and Routing
  • Ch.20 Network Layer Protocols
  • ARP, IPv4, ICMP, IPv6, and ICMPv6
  • Ch.21 Unicast and Multicast Routing
  • Routing Protocols

5
Ch.19 Host-to-Host Delivery Internetworking,
Addressing, and Routing
Computer Networks System
  • Lecturer Tae-Hyong Kim (D132)
  • thkim_at_cespc1.kumoh.ac.kr

6
Contents
  • Internetworks
  • Introduction
  • Need for Network Layer
  • Internet as a Packet-Switched Network
  • Internet as a Connectionless Network
  • Addressing
  • Routing
  • Assignments 4

7
Internetwork
  • How can data be exchanged between networks?
  • Need to be connected to make an internetwork

8
Internetwork
  • Links in an internetwork
  • Are only physical layer and datalink layer enough
    for routing?
  • They handle local addresses only, not global
    addresses

9
Need for Network Layer
  • Network layer is responsible for
  • Host-to-host delivery
  • Routing through the routers or switches

10
Need for Network Layer
  • Network Layer at Source

11
Need for Network Layer
  • Network Layer at Router or Switch

12
Need for Network Layer
  • Network Layer at Destination

13
Internet as a Packet-Switched Network
  • Switching
  • Packet switching
  • Data are transmitted in discrete units of
    potentially variable-length blocks (?packets)

14
Internet as a Packet-Switched Network
  • Datagram approach
  • Each packet (?datagram) is treated independently
    of all others
  • The datagrams of a transmission to arrive out of
    order
  • An upper layer protocol reorders the datagrams
  • Does not need call setup and virtual circuit
    identifiers
  • Global source and destination addresses are used
    instead for routing
  • Switching at the network layer in the Internet is
    done using datagram approach to packet switching

15
Internet as a Connectionless Network
  • Connection oriented service
  • The source first makes a connection with the
    destination, and a sequence of packets can be
    sent one after another
  • Switches do not recalculate the route for each
    individual packet
  • Ex. Virtual circuit approach in Frame relay and
    ATM
  • Connectionless service
  • The network layer protocol treats each packet
    independently
  • The packets in a message may or may not travel
    the same path
  • Ex. Datagram approach (the Internet)
  • Communication at the network layer in the
    Internet is connectionless

16
Contents
  • Internetworks
  • Addressing
  • Internet Address
  • Classful Addressing
  • Subnetting
  • Supernetting
  • Classless Addressing
  • Dynamic Address Configuration
  • Network Address Translation (NAT)
  • Routing
  • Assignments 4

17
Internet Address
  • For a host to communicate with any other host
  • Need a universal identification system
  • Need to name each host
  • Internet address or IP address
  • a 32-bit address that uniquely and universally
    defines a host or a router on the Internet
  • Not a name Location-based architecture
  • The IP addresses are unique in the sense that
  • two devices can never have the same address.
  • However, a device can have more one address.

18
Address Space Notation
  • Address space of IPv4 232 4,294,967,296
  • Binary Notation
  • 32-bit address 4-byte address
  • Dotted-Decimal Notation

19
Address Architecure
  • Classful Addresses original
  • IP addresses using the concept of classes
  • ex. IPv4
  • Classless Addresses new
  • will eventually supersede the original one
  • ex. Slash notation, CIDR(Classless Interdomain
    Routing) notation, IPv6
  • ? Chapter 5.3

20
Classful Addressing
  • IP address space is divided into 5 classes
  • A, B, C, D, E
  • Recognizing Classes

21
Classful Addressing (cont.)
  • Recognizing Classes in Dotted-Decimal Notation

22
Example
  • Find the class of each address
  • 00000001 00001011 00001011 11101111
  • 11000001 10000011 00011011 11111111
  • 10100111 11011011 10001011 01101111
  • 11110011 10011011 11111011 00001111
  • 227.12.14.87
  • 193.14.56.22
  • 14.23.120.8
  • 252.5.15.111
  • 134.11.78.56
  • 165.132.10.37 (Yonsei Univ. Web Server)
  • 202.31.130.91 (CESPC1 Server)

23
Address Space
  • Addresses per class

24
Netid and Hostid
  • Each IP address is made of two parts netid and
    hostid (except Class D E)
  • Netid defines a network
  • hostid identifies a host on that network.

25
Class A
  • designed for large organization (16,777,216)
  • however, the no. of address is too large (wasted)

on this network
Loopback addresses
broadcast address
26
Class B
  • designed for mid-size organization (65,536)
  • however, the no. of address is also too large
    (wasted)

broadcast address
27
Class C
  • designed for small organization (256)
  • however, the no. of address is smaller than
    usually needed

broadcast address
28
Other Classes
  • Class D
  • just one block designed for multicasting
  • Each address is used to define one group of hosts
    on the Internet
  • Every host in this group will also have a
    multicast address
  • Class E
  • designed for use as reserved addresses
  • just one block most of the block is wasted
  • 255.255.255.255 limited broadcast address
  • Address Depletion
  • The available addresses are almost depleted due
    to this class architecture (in fact, no. of
    devices ltlt 232)
  • Nobody wants a class C block
  • Class A B blocks are limited but their
    addresses are wasted

29
Network Addresses
  • Properties
  • All hostid bytes are 0s
  • the first address in the block
  • defines the network to the rest of the Internet
  • reveals the class of the address, the block, and
    the range of the addresses in the block
  • Example
  • Network address 132.21.0.0
  • Class B, the netid of the block 132.21
  • Address range 132.21.0.0 132.21.255.255

30
Network Addresses
  • Examples

31
Masking
  • The network address can be found by applying the
    default mask to any addresses in the block

32
Multihomed Devices
  • A device that is connected to different networks
  • ex. a router

33
Special Addresses
34
Limited Broadcast Address
  • Class E address
  • used by a host to send a packet to every host on
    the same network

35
Direct Broadcast Address
  • used by a router to send a packet to all hosts in
    a specific network
  • only used as a destination address in an IP packet

36
Loopback Address
  • used to test the software on a machine
    (destination address)
  • A packet with this address never leaves the
    machine it simply returns to the protocol
    software
  • used by a client process to send a message to a
    server process on the same machine (destination
    address)

37
Unicast, Multicast, Broadcast
  • Unicast address one-to-one
  • Multicast address one-to-many
  • Class D address (a group address)
  • used as a destination address
  • local (same network) global level multicast
  • Broadcast address one-to-all
  • the direct limited broadcast address
  • only at the local level

38
Assigned Multicast Address
  • Category Addresses for special use

39
A Sample Internet with Classful Addresses
40
Subnetting
  • IP addresses are designed with two levels of
    higherarchy netid and hostid
  • In subnetting, A network is divided into several
    smaller subnetwork (or subnet) having its own
    subnetwork address
  • For more levels of hierarchy (grouping)

41
The subnetworks appear as a single network to
the rest of the Internet
42
Three Levels of Hierarchy
  • Site, Subnet, and host

43
Subnet Mask
  • Default mask

44
Subnet Mask
  • Subnet mask
  • Number of Subnets 2(the no. of extra 1s) (238)
  • Number of Addresses per subnet 2(the no. of 0s)
    (2138192)

45
Designing Subnets
  • Step 1 Deciding the no. of Subnets
  • must be a power of 2
  • Step 2 Finding the Subnet Mask
  • by the no. of 1s in the default mask and defining
    the subnets
  • Step 3 Finding the Range of Address in Each
    Subnet
  • Start with the first subnet, then add the number
    of address in each subnet to get the last address
  • Then add one to this address to find the first
    address in the next subnet, ... (repeat)
  • Another method in the reverse order

46
Designing Subnets (cont.)
  • Example A company is granted the site address
    201.70.64.0 (Class C). The company needs 6
    subnets. Design the subnets.
  • We need 3 more 1s in the subnet mask (238gt6)
  • The subnet mask
  • 11111111 11111111 11111111 11100000
    (255.255.255.224)
  • The number of subnets 8
  • The number of addresses in each subnet 25 32
  • The range of address
  • 201.70.64.0 201.70.64.31 (31, total 32)
  • 201.70.64.32 (1) 201.70.64.63 (31)
  • ...

47
Variable-Length Subnet Mask
  • Consider a site that is granted a class C address
    and needs to have 5 subnets with the following
    number of hosts 60, 60, 60, 30, 30
  • total no. of address 240 lt 256 (C Class)
  • no. of subnet addresses 6 bits 64, subnet 2
    bits 4 lt 5
  • subnet 3 bits 8, no. of subnet addresses 5
    bits 32 lt 60
  • Solution variable-length subnetting

except subnet addr. broadcast addr.
48
Supernetting
  • Although classes A B addresses are almost
    depleted, class C addresses are still available
  • However, even a mid-size organization may need
    more address (256)
  • Solution Supernetting
  • Superneting
  • Combine several class C blocks to create a larger
    range of addresses ? a Supernetwork
  • ex. KIT has a supernetwork composed of 32 class C
    blocks

49
A Supernetwork
50
Supernet Mask
  • In subnetting, we need the first address of the
    subnet and the subnet mask to define the range
    address
  • In supernetting, we need the first address of the
    supernet and the supernet mask to define the
    range of addresses

51
Examples
  • 1. We need to make a supernetwork out of 16 class
    C blocks. What is the supernet mask?
  • Sol) we need 16 blocks (1111 ? 0000)
  • 11111111 11111111 11110000 00000000
    (255.255.240.0)
  • 2. A supernet has a first address of 205.16.32.0
    and a supernet mask of 255.255.248.0. A router
    receives three packets with the following
    destination addresses 205.16.37.44,
    205.16.42.56, 205.17.33.76. Which packet belongs
    the supernet?
  • Sol) 205.16.37.44, because
  • 205.16.37.44 AND 255.255.248.0 ?
    205.16.32.0

52
Examples (cont.)
  • 3. A supernet has a first address of 205.16.32.0
    and a supernet mask of 255.255.248.0. How many
    blocks are in this supernet and what is the range
    of addresses?
  • Sol) The first address is
  • 11001101 00010000 00100000 00000000
  • The supernet mask is
  • 11111111 11111111 11111000 00000000
  • The no. of blocks is 23 8
  • The address range is (8256 2048)
  • 11001101 00010000 00100000 00000001
    (205.16.32.1)
  • 11001101 00010000 00100111 11111111
    (205.16.39.255)

53
Problems of Classful Addressing
  • The choice of a class among A,B, and C is
    limited.
  • Usually class B or several class C blocks.
  • What about a small business that needed only 16
    addresses? Or a household that needed only two
    addreses?
  • Increase of global internet routing table size
    due to increasing Class C addresses (? several
    class C blocks)
  • During the 1990s, Internet Service Providers
    (ISPs) provides Internet access
  • for individuals, small business, and mid-size
    organizations that do not want to create an
    Internet site and become involved in providing
    Internet service for their employees.
  • An ISP can be granted several class B or class C
    blocks and then subdivide the range of addresses
    (in group of 2,4,8, or 16 addresses)
  • To facilitate this evolution, in 1996, the
    Internet authorities announced a new
    architecture classless addressing

54
Variable-Length Blocks
  • The whole idea of classless addressing
  • We can have a block of 2, 4, 128 addresses, and
    so on.
  • ? In general, a block can range from very small
    to very large
  • No. of addresses in a block
  • must be a power of 2 (2, 4, 8, ...)
  • Beginning address
  • must be evenly divisible by the no. of addresses
  • ex. if 16 addresses, 205.16.37.32, 17.17.33.80
    are eligible
  • Mask the same concept as classful addressing

55
Slash Notation (CIDR notation)
  • Instead of writing the 4-byte mask, attach the
    no. of 1s in the mask to the end of a classless
    address
  • Conveys two ideas
  • the address is classless
  • routing is done using interdomain routing (?
    Ch.6)
  • prefix the common part of the address range
    (netid)
  • prefix length the length of the prefix (n)
  • suffix the varying part of the address range
    (hostid)
  • suffix length the length of the suffix (32-n)

the no. of bits that are the same in every
address in the block
56
Examples
  • Example 1 KIT was granted two groups of 16 class
    C address blocks whose starting addresses are
    202.31.128.0 and 202.31.192.0, respectively. What
    is the slash notation of the network address of
    each contiguous area?

57
Examples (cont.)
  • Example 2 A small organization is given a block
    with the beginning address and the prefix length
    205.16.37.24/29. What is the range of the block?
  • Ans) the beginning address
  • 11001111 00010000 00100101 00011000
  • the ending address
  • 11001111 00010000 00100101 00011111
  • There are only 8 addresses in this block.

58
Prefix length and the Mask
class A
class B
class C
59
Finding the Network Address
  • Example 1 What is the network address of one of
    the address is 167.199.170.82/27?
  • Ans) the network address the address AND the
    mask
  • the address 10100111 11000111 10101010
    01010010
  • the net. address 10100111 11000111 10101010
    01000000
  • 167.199.170.64/27
  • Subnetting similar to classful addressing
  • Supernetting there is no need in classless
    addressing
  • Classless addressing ? the application of the
    supernetting concept in class C to other classes
  • an organization is granted the right size block ?
    more flexible and efficient (can reduce the
    routing table size)

60
Examples
  • Example 2 An organization is granted the block
    130.34.12.64/26. The organization needs to have
    four subnets. What are the subnet addresses and
    the range of addresses for each subnet?
  • Ans) the suffix length 32-26 6
  • the total no. of addresses 26 64
  • therefore, each subnet will have 16 addresses
    (24)
  • ? the subnet prefix 32-4 28, or
    262(?224)28
  • 1st subnet 130.34.12.64 130.34.12.79 (16)
  • 2nd subnet 130.34.12.80 130.34.12.95
  • 3rd subnet 130.34.12.96 130.34.12.111
  • 4th subnet 130.34.12.112 130.34.12.127

61
Examples (cont.)
  • Example 2 (cont.)

62
Examples (cont.)
  • Example 3 An ISP is granted a block of addresses
    starting with 190.100.0.0/16. The ISP needs to
    distribute these addresses to three groups of
    customers as follows
  • a. The first group has 64 customers each needs
    256 addresses
  • b. The second group has 128 customers each needs
    128 addresses
  • c. The third group has 128 customers each needs
    64 addresses
  • Design the subblocks and give the slash
    notation for each subblocks. Find out how many
    addresses are still available after these
    allocation.

63
Examples (cont.)
  • Example 3 (cont.)
  • Ans) Group 1 for each customer 256 addresses
  • the suffix length 8 (28256) ? the
    prefix length 24 (32-8)
  • ? 1st customer 190.100.0.0/24
    190.100.0.255/24
  • ...
  • 64th customer 190.100.63.0/24
    190.100.63.255/24
  • Total 64256 16,384 (214)
    190.100.0.0/18 (32-14)
  • Group 2 for each customer 64 addresses
  • the suffix length 7 (2764) ? the
    prefix length 25 (32-7)
  • ? 1st customer 190.100.64.0/25
    190.100.64.127/25
  • ...
  • 128th customer 190.100.127.128/25
    190.100.127.255/25
  • Total 128128 16,384 (214)
    190.100.64.0/18 (32-14)

64
Examples (cont.)
  • Example 3 (cont.)
  • Ans) Group 3 for each customer 64 addresses
  • the suffix length 6 (2664) ? prefix
    length 26 (32-6)
  • ? 1st customer 190.100.128.0/26
    190.100.128.63/24
  • ...
  • 128th customer 190.100.159.192/26
    190.100.159.255/26
  • Total 12864 8192 (213)
    190.100.128.0/19 (32-13)
  • The no. of granted addresses 65,536 (216)
  • The no. of allocated addresses 40,960 (62.5)
  • The no. of allocated addresses 24,576 (37.5)

65
Address Allocation Example
66
Dynamic Address Configuration
  • Necessary information in order to be attached to
    the Internet
  • IP address
  • Subnet mask
  • IP address of a router
  • IP address of a name server
  • Dynamic Host Configuration Protocol (DHCP)
  • A client-server program designed to provide such
    information dynamically
  • DHCP server has a static databases binding
    physical addresses to IP addresses and another
    database for the available IP address pool
  • When a DHCP client sends a request to a DHCP
    server, the server first checks its static
    database
  • If an entry with the requested physical address
    exists the IP address is returned
  • Otherwise, the server selects an IP address from
    the available pool

67
State Transition Diagram
  • To keep track of all the different events
    happening during connection establishment,
    connection termination, data transfer, TCP
    software is implemented as a Finite State Machine
    (FSM)
  • An FSM is a machine is a machine that goes
    through a limited number of states
  • At any moment, the machine is in one of the
    states
  • Formal definition of an FSM
  • An FSM M is a 5-tuple (S, I, O, ?, ?) where
  • S finite non-empty set of states
  • I finite non-empty set of input symbols (input
    alphabet)
  • O finite non-empty set of output symbols (output
    alphabet)
  • d SI?S the state transition function (next
    state function)
  • ? SI?O the output function (for Mealy
    Machine)
  • cf. S?O the output function for Moore Machine

68
Dynamic Address Configuration
  • DHCP Transition diagram (client side)

69
Network Address Translation
  • NAT enables a user to have
  • a large set of addresses internally
  • one address, or a small set of addresses
    externally
  • Addresses for private networks
  • Unique inside the network, not unique globally
  • No router will forward a packet that has one of
    these addresses as the destination address

70
Network Address Translation
  • Simple implementation of NAT
  • A private network is invisible to the rest of the
    Internet
  • The rest of the Internet sees only the NAT router
  • Address translation by NAT router

71
Network Address Translation
  • Transition Table
  • How does the NAT router know the destination
    address for a packet coming from the Internet?
  • Using one IP address

72
Network Address Translation
  • Transition Table
  • Using one IP address
  • Communication must always be initiated by the
    private network
  • Ex. Email that originates from a noncustomer site
    is received by the ISP email server, the email is
    stored in the mailbox of the customer until
    retrieved
  • A private network cannot run a server program for
    clients outside of its network
  • Only one private network host can access the same
    external host!
  • Using a pool of IP addresses
  • Multiple network hosts can communicate with the
    same external host at the same time
  • No private network host can access two external
    server programs at the same time (why?)

73
Network Address Translation
  • Transition Table
  • Using both IP addresses and port numbers
  • allows a many-to-many relationship between
    private-network hosts and external server
    programs
  • Five-column translation table
  • The temporary port numbers must be unique

74
Contents
  • Internetworks
  • Addressing
  • Routing
  • Routing Techniques
  • Static vs. Dynamic Routing
  • Routing table and Routing module for Classful
    Addressing
  • Routing table for Classless Addressing CIDR
  • Assignments 4

75
Routing
  • A router (or a host) has and uses a routing table
    to route a packet to the final destination
  • Today, entries in the routing table increases
    excessively ? table lookups are inefficient
  • Several techniques that reduce the routing table
    to manageable size and handle security issues
  • Next-Hop Routing
  • Network-Specific Routing
  • Host-Specific Routing
  • Default Routing

76
Next-Hop Routing
  • The routing table holds only the address of the
    next hop instead of holding information about the
    complete route
  • The entries of a routing table must be consistent
    with each other

77
Network-Specific Routing
  • The routing table has only one entry to define
    the address of the network itself, instead of
    having an entry for every host connected to the
    same physical network
  • It treats all hosts connected to the same network
    as one single entry

78
Host-Specific Routing
  • The inverse of network-specific routing
  • The destination host address is given in the
    routing table
  • In spite of its inefficiency, there are occasions
    in which the administrator wants to have more
    control over routing such as checking the route
    or providing security measures

79
Default Routing
  • Instead of listing all networks in the entire
    internet, a host/router can just have one entry
    called default
  • default network address 0.0.0.0

80
Static Routing Table
  • It contains route information for each
    destination entered manually by the administrator
  • After creation, it cannot update automatically
  • The table must be manually altered...
  • It can be used in a small internet that does not
    change very often, or in an experimental internet
    for troubleshooting
  • not good for the Internet

81
Dynamic Routing Table
  • It is updated periodically using a dynamic
    routing protocol such as RIP, OSPF, or BGP
    (?Ch.21)
  • When a change, the dynamic routing protocols
    update all of the tables in the routers (and
    eventually in the host)
  • good for the Internet need to be updated
    dynamically for efficient delivery

82
Routing Module Routing Table Design
  • Hierarchical Strategy
  • When looking for the route,
  • The router must first check for direct delivery,
  • then, host-specific delivery,
  • then, network-specific delivery,
  • finally, default delivery.
  • A routing table with the hierarchical scheme is a
    normal solution to implement a routing module

83
Routing Table
  • The seven fields
  • Mask for finding (sub)network address of the
    destination
  • Host-specific routing 255.255.255.255 (/32)
  • Default routing 0.0.0.0 (/0)
  • Unsubnetted network default mask of each class
  • Destination address either host address or
    network address
  • Next-hop address the address of the next-hop
    router

84
Routing Table (cont.)
  • The seven fields (cont.)
  • Flags
  • U (Up) ? the router is running, ? the router is
    down
  • G (Gateway) ? indirect delivery, ? direct
    delivery
  • H (Host-Specific) ? host-specific address, ?
    network address
  • D (Added by redirection) ? the routing
    information has been added by a redirection
    message from ICMP
  • M (Modified by redirection) ? the routing
    information has been modified by a redirection
    message from ICMP
  • Reference count no. of users using this route at
    any moment
  • Use no. of packets transmitted through router
  • Interface the name of the interface

85
Routing Module
  • 1. For each entry in the routing table
  • 1. Apply the mask to packet destination address
  • 2. If (the result matches the value in the
    destination field)
  • 1. If (the G flag is present)
  • 1. Use the next-hop entry in the table as
    next-hop address
  • 2. If (the G flag is missing)
  • 1. Use packet destination address (direct
    delivery)
  • 3. Send packet to fragmentation module with
    next-hop address
  • 4. Stop
  • 2. If no match is found, send an ICMP error
    message
  • 3. Stop

86
Examples
  • Configuration for routing examples

87
Examples (cont.)
  • Routing table for router R1 in the figure

88
Examples (cont.)
  • Ex.1 Router R1 receives 500 packets for
    destination 192.16.7.14 the algorithm applies
    the masks row by row to the destination address
    until a match is found
  • 1. Direct delivery check (for each entry with no
    G flag)
  • a. 192.16.7.14 255.0.0.0 ? 192.0.0.0 ? no
    match
  • b. 192.16.7.14 255.255.255.224 ? 192.16.7.0 ?
    no match
  • c. 192.16.7.14 255.255.255.224 ? 192.16.7.0 ?
    no match
  • 2. Host-specific check (for each entry with H
    flag)
  • a. 192.16.7.14 255.255.255.255 ? 192.16.7.14 ?
    no match
  • 3. Network-specific check (for each entry with G
    flag no H flag)
  • a. 192.16.7.14 255.255.255.0 ? 192.16.7.0 ?
    match
  • The router sends the packet through interface m0
    along with the next hop IP address (111.15.17.32)
    to the fragmentation module. It increments the
    use field by 500 and the reference count field by
    1.

89
Examples (cont.)
  • Ex.2 Router R1 receives 100 packets for
    destination 193.14.5.176 the algorithm applies
    the masks row by row to the destination address
    until a match is found
  • 1. Direct delivery check (for each entry with no
    G flag)
  • a. 193.14.5.176 255.0.0.0 ? 193.0.0.0 ? no
    match
  • b. 193.14.5.176 255.255.255.224 ?
    193.14.5.160 ? match
  • The router sends the packet through interface m2
    along with the destination IP address
    (193.14.5.176) to the fragmentation module. It
    increments the use field by 100 and the reference
    count field by 1.

90
Examples (cont.)
  • Ex.3 Router R1 receives 20 packets for
    destination 200.34.12.34 the algorithm applies
    the masks row by row to the destination address
    until a match is found
  • 1. Direct delivery check (for each entry with no
    G flag)
  • a. 200.34.12.34 255.0.0.0 ? 200.0.0.0 ? no
    match
  • b. 200.34.12.34 255.255.255.224 ?
    200.34.12.32 ? no match
  • c. 200.34.12.34 255.255.255.224 ?
    200.34.12.32 ? no match
  • 2. Host-specific check (for each entry with H
    flag)
  • a. 200.34.12.34 255.255.255.255 ?
    200.34.12.34 ? no match
  • 3. Network-specific check (for each entry with G
    flag no H flag)
  • a. 200.34.12.34 255.255.255.0 ? 200.34.12.0 ?
    no match
  • b. 200.34.12.34 255.255.255.0 ? 200.34.12.0 ?
    no match
  • 4. Default delivery check (for the entry whose
    mask is 0.0.0.0)
  • a. 200.34.12.34 0.0.0.0 ? 0.0.0.0 ? match
  • The router sends the packet through interface m0
    along with the next hop IP address (111.30.31.18)
    to the fragmentation module. It increments the
    use field by 20 and the reference count field by
    1.

91
Examples (cont.)
  • Ex.4 Make the routing table for router R1 in the
    following figure.
  • Sol) There are three explicit destination
    networks, two class B and one class C with no
    subnetting. There is also one access to the rest
    of the Internet (default route) ? The routing
    table has four rows

92
Examples (cont.)
  • Ex.4 (cont.)
  • Sol)

Mask Destination Next Hop I/F 255.255.0.0 134.1
8.0.0 -- m0 255.255.0.0 129.8.0.0 222.13.16.40 m
1 255.255.255.0 220.3.6.0 222.13.16.40
m1 0.0.0.0 0.0.0.0 134.18.5.2 m0
93
Examples (cont.)
  • Ex.5 Make the routing table for router R1 in the
    following figure.

94
Examples (cont.)
  • Ex.5 (cont.)
  • Sol) There are five networks and the rest of the
    Internet (default route)
  • Two are point-to-point with no hosts
  • ? no entry in the table.
  • Three C class networks ? three entries in the
    table
  • Some information is missing
  • ex. IP address of the default router
  • Two paths to networks 80.4.5.0 and 80.4.6.0
  • ? We do not know which route is optimal (?
    Ch.13)

95
Examples (cont.)
  • Ex.5 (cont.)
  • Sol)

Mask Destination Next Hop I/F. 255.255.255.0 200.
8.4.0 ---- m2 -----------------------------------
------------------------------------------ 255.255
.255.0 80.4.5.0 201.4.10.3 m1 or
200.8.4.12 or m2 --------------------------------
---------------------------------------------- 255
.255.255.0 80.4.6.0 201.4.10.3 m1 or
200.4.8.12 or m2 ---------------------------------
---------------------------------------------
0.0.0.0 0.0.0.0 ???????????? m0
96
Examples (cont.)
  • Ex.6 The routing table for router R1 is given in
    the following table. Draw its topology.

Mask Destination Next Hop I/F. 255.255.0.0 110.70
.0.0 - m0 255.255.0.0 180.14.0.0 - m2 255.255.0.
0 190.17.0.0 - m1 255.255.0.0 130.4.0.0 190.17.6.
5 m1 255.255.0.0 140.6.0.0 180.14.2.5 m2 0.0.0.0
0.0.0.0 110.70.4.6 m0
97
Examples (cont.)
  • Ex.6 (cont.)
  • Sol)
  • There are three networks directly connected to
    router R1
  • There are two networks indirectly connected to
    router R1
  • There must be at least other routers involved (?
    Next hop)
  • One router is connected to the rest of the
    Internet (default router)
  • There is some missing information
  • We do not know if network 130.4.0.0 (and
    140.6.0.0) is directly connected to router R2 or
    through a point-to-point network (WAN) and
    another router
  • Point-to-point networks normally do not have an
    entry in the routing table ? no hosts are
    connected

98
Examples (cont.)
  • Ex.6 (cont.)
  • Sol)

99
Routing Table Size
  • The no. of entries in the routing table can
    either decrease or increase in case of classless
    addressing
  • If the block of addresses assigned to an
    organization is larger than the block in classful
    addressing ? decrease
  • e.g. a supernet from four class C blocks
  • If the block of addresses assigned to an
    organization is smaller than the block in
    classful addressing ? increase
  • This is because the intent of classless
    addressing (?class A, B)
  • e.g. a class B block may be divided up between 60
    organization ? 60 routing table entries

100
Hierarchical Routing
  • To solve the problem of gigantic routing tables,
    a sense of hierarchy in the Internet architecture
    and routing tables was created
  • The Internet today has a sense of hierarchy
  • If the routing table has a sense of hierarchy
    like the Internet architecture, the routing table
    can decrease in size.
  • e.g.) A local ISP ? individual users and
    organizations
  • If the block assigned to the local ISP is
    A.B.C.D/N, the ISP can create blocks of
    E.F.G.H/M, where M (gtN) may vary for each
    customer.
  • The rest of the Internet does not have to aware
    of this division. ? All customers of the local
    ISP are defined as A.B.C.D/N to the rest of the
    Internet ? only one entry in every router
  • Inside the local ISP, the router must recognize
    the subblocks and route the packet to the
    destined customer.
  • A customer (large organization) also can create
    another level of hierarchy by subnetting

101
Geographical Routing
  • To decease the size of the routing table even
    further, we need to extend hierarchical routing
    to include geographical routing
  • e.g. The entire address space is divided into a
    few large blocks ? Each block is assigned to each
    continent.
  • The routers of ISPs outside of a continent will
    have only one entry for packets to the continent
    in the routing tables.
  • Part of this idea has already been implement for
    class C addressing.
  • For real efficiency, all of classes A and B need
    to be recycled and reassigned.

102
Routing Table Search Algorithm
  • Searching in Classful Addressing
  • The routing table is organized as a list.
  • To facilitate the routing table searching, it can
    be divided into 3 areas (buckets), one for each
    class ? the router searches the corresponding
    bucket only
  • Because each address has self-contained
    information
  • Searching in Classless Addressing
  • It uses 32 buckets, one for each prefix length.
  • There is no self-contained information in the
    destination address
  • The simplest (not the most efficient) solution
    the longest match
  • The router tries to use the longest prefix (/32
    host-specific), and the next prefix (/31), and so
    on.
  • It takes a long time on average, 16 buckets must
    be searched
  • Solution change of the data structure used for
    searching
  • e.g. binary tree, a trie (a special kind of tree)
    instead of a list

103
Assignment 4
  • Exercises (selected)
  • 43, 44, 53, 55, 61, 63, 64
  • Additional 7 exercises in the following slides
  • Due Date
  • Next class

104
Assignment 4
  • Ex.1 An organization of granted the block
    130.56.0.0 in class B. The administrator wants to
    create 1024 subnets.
  • a. Find the subnet mask.
  • b. Fine the number of addresses in each subnet
  • c. Find the first and the last address in the
    first subnet.
  • d. Find the first and the last address in the
    last subnet (subnet 1024)

105
Assignment 4
  • Ex.2 An ISP is granted a block of addresses
    starting with 150.80.0.0/16. The ISP wants to
    distribute these blocks to customers as follows
  • a. The first group has 200 medium-size
    businesses, each needs 128 addresses.
  • b. The second group has 400 small businesses,
    each needs 16 addresses.
  • c. The third group has 2048 households, each
    needs 4 addresses.
  • Design the subblocks and give the slash notation
    for each subblock. Find out how many addresses
    are still available after these allocations.

106
Assignment 4
  • Ex.3 Using the following table, determine the
    next-hop address if router R1 receives a packet
    destined for 194.17.21.45.

107
Assignment 4
  • Ex.4 Show the routing table for router R4 in the
    following figure

108
Assignment 4
  • Ex.5 Draw the topology of the network if the
    following table is the routing table for router
    R1.

109
Assignment 4
  • Ex.6 A classful routing table has four buckets in
    the table and a single entry for default routing.
    The first bucket is for host-specific routing
    with 10 entries. The second bucket is for class A
    blocks with 50 entries. The third bucket is for
    class B blocks with 400 entries. The fourth
    bucket is for class C blocks with 2000 entries.
    Find the average number of table lookups for each
    of the following cases
  • a. A packet with host-specific route has arrived.
  • b. A packet with a class A address has arrived.
  • c. A packet with a class B address has arrived.
  • d. A packet with a class C address has arrived.
  • e. A packet has arrived that must be default
    routed.

110
Assignment 4
  • Ex.7 A classless routing table has 32 buckets in
    the table and a single entry for default routing.
    The average number of entries in each bucket is
    100. How many table lookups are needed on average
    for each of the following packets
  • a. A packet with prefix /32.
  • b. A packet with prefix /24.
  • c. A packet with prefix /12
  • d. A packet with prefix /8.
About PowerShow.com