Internetworking - PowerPoint PPT Presentation

About This Presentation
Title:

Internetworking

Description:

Chapter 3 Internetworking * – PowerPoint PPT presentation

Number of Views:239
Avg rating:3.0/5.0
Slides: 285
Provided by: klp8
Category:

less

Transcript and Presenter's Notes

Title: Internetworking


1
Chapter 3
  • Internetworking

2
Problems
  • In Chapter 2 we saw how to connect one node to
    another, or to an existing network. How do we
    build networks of global scale?
  • How do we interconnect different types of
    networks to build a large global network?

3
Chapter Outline
  • 3.1 Switching and Bridging
  • 3.2 Basic Interworking (IP)
  • 3.3 Routing
  • 3.4 Implementation and Performance

4
  • Two limitations on the directly connected
    networks
  • limit on how many hosts can be attached, examples
  • only two hosts can be attached to a
    point-to-point link
  • the Ethernet specification allows no more than
    1,024 hosts

5
  • limit on how large of a geographic area a single
    network can serve, examples
  • an Ethernet can span only 2,500 m
  • wireless networks are limited by the ranges of
    their radios
  • point-to-point links can be quite long

6
  • Goal
  • build networks that can be global in scale
  • Problem
  • how to enable communication between hosts that
    are not directly connected
  • Solution
  • computer networks use packet switches to enable
    packets to travel from one host to another, even
    when no direct connection exists between those
    hosts

7
  • Packet switch
  • a device with several inputs and outputs leading
    to and from the hosts that the switch
    interconnects
  • Core job of a switch
  • take packets that arrive on an input and forward
    (or switch) them to the right output so that they
    will reach their appropriate destination

8
  • A key problem that a switch must deal with is the
    finite bandwidth of its outputs
  • if packets destined for a certain output arrive
    at a switch and their arrival rate exceeds the
    capacity of that output, then we have a problem
    of contention
  • the switch queues (buffers) packets until the
    contention subsides, but if it lasts too long,
    the switch will run out of buffer space and be
    forced to discard packets
  • when packets are discarded too frequently, the
    switch is said to be congested

9
3.1 Switching and Bridging
  • Switch
  • a multi-input, multi-output device, which
    transfers packets from an input to one or more
    outputs
  • star topology
  • switched networks are more scalable (i.e.,
    growing to large numbers of nodes) than
    shared-media networks because of the ability to
    support many hosts at full speed

10
A switch provides a star topology
11
Scalable Networks
  • The figure shows the protocol graph that would
    run on a switch that is connected to two T3 links
    and one STS-1 SONET link

Example protocol graph running on a switch
12
  • A switch forwards packets from input port to
    output port
  • Port selected based on address in packet header
  • Advantages
  • cover large geographic area (tolerate latency)
  • support large numbers of hosts (scalable
    bandwidth)

13
Example switch with three input and output ports
14
  • How does the switch decide on which output port
    to place each packets?
  • general answer
  • it looks at the header of the packet for an
    identifier that it uses to make the decision
  • three common approaches
  • datagram (or connectionless) approach
  • virtual circuit (or connection-oriented approach)
  • source routing

15
3.1.1 Datagram
  • Sometimes called connectionless model
  • Analogy postal system
  • No connection setup phase
  • no round trip delay waiting for connection setup
  • a host can send data as soon as it is ready

16
  • Each packet is forwarded independently of
    previous packets that might have been sent to the
    same destination
  • two successive packets from host A to host B may
    follow completely different paths (perhaps
    because of a change in the forwarding table at
    some switch in the network)

17
  • A switch or link failure might not have any
    serious effect on communication if it is possible
    to find an alternate route around the failure and
    to update the forwarding table accordingly
  • Since every packet must carry the full address of
    the destination, the overhead per packet is
    higher than for the connection-oriented model

18
  • Source host has no way of knowing if the network
    is capable of delivering a packet or if the
    destination host is even up and running
  • Each switch maintains a forwarding (routing) table

19
  • Example
  • the hosts have addresses A, B, C, and so on
  • a switch consults a forwarding table (routing
    table) to decide how to forward a packet

20
Datagram forwarding an example network
21
  • The table shows the forwarding information that
    switch 2 needs to forward datagrams

Destination Port
A 3
B 0
C 3
D 3
E 2
F 1
G 0
H 0
22
3.1.2 Virtual Circuit Switching
  • Sometimes called connection-oriented model
  • Analogy phone call
  • Explicit connection setup (and tear-down) phase
  • it requires that a virtual connection from the
    source host to the destination host is set up
    before any data is sent
  • Typically wait full RTT (Round Trip Time) for
    connection setup before sending first data packet

23
  • If a switch or a link in a connection fails
  • the connection is broken and a new one needs to
    be established
  • Subsequence packets follow same circuit
  • Each switch maintains a Virtual Circuit (VC) table

24
  • Entry in the VC table on a single switch contains
  • a virtual circuit identifier (VCI)
  • uniquely identifies the connection at this switch
  • which will be carried inside the header of the
    packets that belong to this connection

25
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
2 5 1 11
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
3 11 2 7
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
0 7 1 4
26
  • an incoming interface
  • on which packets for this VC arrive at the switch
  • an outgoing interface
  • in which packets for this VC leave the switch
  • a potentially different VCI that will be used for
    outgoing packets

27
  • Two classes of approaches to establish connection
    state
  • Permanent Virtual Circuit (PVC)
  • Switched Virtual Circuit (SVC)

28
  • Permanent Virtual Circuit (PVC)
  • administrator configures the state, in which case
    the virtual circuit is permanent
  • administrator can also delete the state, so a
    permanent virtual circuit (PVC) might be thought
    of as a long-lived, or administratively
    configured VC

29
  • Switched Virtual Circuit (SVC)
  • a host may set up and delete a VC by sending
    messages without the involvement of a network
    administrator
  • this is referred to as signaling, and the
    resulting virtual circuits are said to be
    switched
  • an SVC should more accurately be called a
    signaled VC, since it uses signaling (not
    switching) to distinguish an SVC from a PVC

30
  • Example
  • assume that a network administrator wants to
    manually create a new virtual connection from
    host A to host B
  • two-stage process
  • connection setup
  • data transfer

31
(11)
(7)
(5)
(4)
An example of a virtual circuit network
32
  • The administrator picks a VCI value that is
    currently unused on each link for the connection
  • suppose
  • VCI 5, the link from host A to switch 1
  • VCI 11, the link from switch 1 to switch 2
  • VCI 7, the link from switch 2 to switch 3
  • VCI 4, the link from switch 3 to host B

33
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
2 5 1 11
VC table entry at switch 1
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
3 11 2 7
VC table entry at switch 2
Incoming Interface Incoming VCI Outgoing Interface Outgoing VCI
0 7 1 4
VC table entry at switch 3
34
A packet is sent into a virtual circuit network
35
A packet makes its way through a virtual circuit
network
36
  • Hop-by-hop flow control
  • each node is ensured of having the buffers it
    needs to queue the packets that arrive on that
    circuit
  • example, an X.25 network-a packet-switched
    network that uses the connection-oriented model

37
  • X.25 network employs the following three-part
    strategy
  • buffers are allocated to each virtual circuit
    when the circuit is initialized
  • the sliding window protocol is run between each
    pair of nodes along the virtual circuit, and this
    protocol is augmented with flow control to keep
    the sending node from overrunning the buffers
    allocated at the receiving node

38
  1. the circuit is rejected by a given node if not
    enough buffers are available at that node when
    the connection request message is processed

39
  • Examples of virtual circuit technologies
  • Asynchronous Transfer Mode (ATM)
  • Frame Relay, e.g., Virtual Private Network (VPN)
  • Frame Relay operates only at the physical and
    data link layers

40
ATM Cell Formats
  • Two different cell formats
  • User-Network Interface (UNI) format
  • host-to-switch format
  • interface between a telephone company and one of
    its customers
  • Network-Network Interface (NNI) format
  • switch-to-switch format
  • interface between a pair of telephone companies

41
Architecture of an ATM network
42
  • User-Network Interface (UNI)
  • GFC (4 bits) Generic Flow Control
  • VPI (8 bits) Virtual Path Identifier
  • VCI (16 bits) Virtual Circuit Identifier
  • Type (3 bits) management, congestion control,
    AAL5
  • CLP (1 bit) Cell Loss Priority
  • HEC (8 bits) Header Error Check (CRC-8)
  • Network-Network Interface (NNI)
  • GFC becomes part of VPI field (no GFC and becomes
    12-bit VPI)

43
ATM cell format at the UNI
44
ATM Headers
45
ATM Virtual Path
  • ATM uses a 24-bit identifier for vircuit circuits
  • 8-bit virtual path identifier (VPI)
  • 16-bit virtual circuit identifier (VCI)

46
  • Example
  • a corporation has two sites that connect to a
    public ATM network, and that at each site the
    corporation has a network of ATM switches
  • we could establish a virtual path between two
    sites using only the VPI field
  • within the corporate sites, however, the full
    24-bit space is used for switching

47
Example of a virtual path
48
  • Advantage of virtual path
  • although there may be thousands or millions of
    virtual connections across the public network,
    the switches in the public network behave as if
    there is only one connection
  • there needs to be much less connection-state
    information stored in the switches, avoiding the
    need for big, expensive tables of per-VCI
    information

49
TP?VPs?and VCs
50
Example of VPs and VCs
51
Connection Identifiers
52
Virtual Connection Identifiers in UNIs and NNIs
53
ATM Cell
54
Routing with a Switch
55
(No Transcript)
56
3.1.3 Source Routing
  • Neither virtual circuits nor conventional
    datagrams
  • All the information about network topology that
    is required to switch a packet across the network
    is provided by the source host

57
  • Various ways to implement source routing
  • method1
  • put an ordered list of switch ports in the header
    and to rotate the list so that the next switch in
    the path is always at the front of the list
  • for each packet that arrives on an input, the
    switch would read the port number in the header
    and transmit the packet on that output

58
Source routing in a switched network (where the
switch reads the rightmost number)
59
  • method2
  • example, rather than rotate the header, each
    switch just strip the first element as it uses it
  • method3
  • have the header carry a pointer to the current
    next port entry, so that each switch just
    updates the pointer rather than rotating the
    header

60
Three ways to handle headers for source routing
(a) rotation, (b) stripping, and (c) pointer.
The labels are read right to left
61
3.1.4 Bridges and LAN Switches
  • LANs have physical limitations (e.g., 2500m)
  • Bridge
  • connect two or more LANs
  • Extended LAN
  • a collection of LANs connected by one or more
    bridges
  • accept and forward strategy (accept all frames
    transmitted on either of the Ethernets, so it
    could forward them to the other)

62
Learning Bridges
  • Do not forward when unnecessary
  • whenever a frame from host A that is addressed to
    host B arrives on port 1, there is no need for
    the bridge to forward the frame out over port 2

63
Illustration of a learning bridge
64
Host Port
A 1
B 1
C 1
X 2
Y 2
Z 2
  • How does a bridge come to learn on which port the
    various hosts reside?
  • each bridge inspects the source address in all
    the frames it receives
  • when host A sends a frame to a host on either
    side of the bridge, the bridge receives this
    frame and records the fact that a frame from host
    A was just received on port 1
  • in this way, the bridge can build a table just
    like the following table

65
Host Port
A 1
B 1
C 1
X 2
Y 2
Z 2
66
Spanning Tree Algorithm
  • Problem extended LAN has a loop in it
  • frames potentially loop through the extended LAN
    forever
  • example
  • bridges B1, B4, and B6 form a loop

67
Extended LAN with loops
68
  • Solution bridges run a distributed spanning tree
    algorithm
  • spanning tree is a subgraph of a graph that
    covers (spans) all the vertices, but contains no
    cycles

69
Example of (a) a cyclic graph (b) a
corresponding spanning tree
70
  • Spanning tree algorithm (developed by Radia
    Perlman)
  • each bridge has a unique identifier (e.g., B1,
    B2, B3)
  • the algorithm first elects the bridge with the
    smallest ID as the root of the spanning tree
  • the root bridge always forwards frames out over
    all of its ports

71
  • each bridge computes the shortest path to the
    root and notes which of its ports is on this path
  • this port is selected as the bridges preferred
    path to the root

72
  • finally, all the bridges connected to a given LAN
    elect a single designated bridge that will be
    responsible for forwarding frames toward the root
    bridge
  • each LANs designated bridge is the one that is
    closest to the root, and if two or more bridges
    are equally close to the root, then the bridges
    identifiers with the smallest ID wins

73
Spanning tree with some ports not selected
74
  • Bridges have to exchange configuration messages
    with each other and then decide whether or not
    they are the root or a designated bridge based on
    these messages
  • configuration messages contain
  • the ID for the bridge that is sending the message
  • the ID for what the sending bridge believes to be
    the root bridge
  • the distance, measured in hops, from the sending
    bridge to the root bridge

75
  • each bridge records current best configuration
    message for each port
  • initially, each bridge believes it is the root
  • when learn not root, stop generating config
    messages
  • in steady state, only root generates
    configuration messages
  • when learn not designated bridge, stop forwarding
    config messages
  • in steady state, only designated bridges forward
    config messages

76
  • root continues to periodically send config
    messages
  • if any bridge does not receive config message
    after a period of time, it starts generating
    config messages claiming to be the root
  • upon receiving a config message over a particular
    port
  • the bridge checks to see if that new message is
    better than the current best configuration
    message recorded for that

77
  • the new configuration message is considered
    better than the currently recorded information
    if
  • it identifies a root with a smaller ID or
  • it identifies a root with an equal ID but with a
    shorter distance or
  • the root ID and distance are equal, but the
    sending bridge has a smaller ID

78
  • Sequence of events
  • assume all the bridges boot at about the same
    time and all the bridges would start off by
    claiming to be the root
  • (Y, d, X) denotes a configuration message from
    node X in which it claims to be distance d from
    root node Y

79
  • Sequence of events on the activity at node B3
  • B3 receives (B2, 0, B2)
  • since 2 lt 3, B3 accepts B2 as root (B2, 1, B3)
  • B3 adds one to the distance advertised by B2 (0)
    and thus sends (B2, 1, B3) toward B5 (B2, 1,
    B3), (B2, 2, B5)
  • meanwhile, B2 accepts B1 as root because it has
    the lower ID, and it sends (B1, 1, B2) toward
    B3(B1, 1, B2), (B1, 2, B3)

80
  1. B5 accepts B1 as root and sends (B1, 1, B5)
    toward B3 (B1, 1, B5), (B1, 2, B3)
  2. B3 accepts B1 as root, and it notes that both B2
    and B5 are closer to the root than it is (B1,
    2, B3), (B1, 1, B2), (B1, 1, B5)
  3. B3 stops forwarding messages on both its
    interfaces (this leaves B3 with both ports not
    selected)(B1, 1, B2), (B1, 1, B5)

81
Spanning tree with some ports not selected
82
Broadcast and Multicast
  • Since most LANs support both broadcast and
    multicast, then bridges must also support these
    two features
  • Broadcast
  • each bridge forwards a frame with a destination
    broadcast address out on each active (selected)
    port other than the one on which the frame was
    received
  • Multicast
  • implemented in exactly the same way, with each
    host deciding itself whether or not to accept the
    message

83
Limitations of Bridges
  • Do not scale
  • Do not accommodate heterogeneity

84
Do not Scale
  • It is not realistic to connect more than a few
    (tens of) LANs by means of bridges
  • the spanning tree algorithm scales linearly,
    i.e., there is no provision for imposing a
    hierarchy on the extended LAN
  • bridges forward all broadcast frames and
    broadcast does not scale

85
  • Virtual LAN (VLAN)
  • used to increase the scalability of extended LANs
  • allows a single extended LAN to be partitioned
    into several seemingly separate LANs
  • each virtual LAN is assigned an identifier
    (sometimes called a color), and packets can only
    travel from one segment to another if both
    segments have the same identifier
  • this limits the number of segments in an extended
    LAN that will receive any given broadcast packet

86
  • Example
  • four hosts (W, X, Y, Z) on four different LAN
    segments
  • in the absence of VLANs, any broadcast packet
    from any host will reach all the other hosts
  • suppose that we define the segments connected to
    hosts W and X as being in one LAN, VLAN 100
  • also define the segments that connect to hosts Y
    and Z as being in VLAN 200
  • to do his, we need to configure a VLAN ID on each
    port of bridges B1 and B2
  • the link between B1 and B2 is considered to be in
    both VLANs

87
Two virtual LANs share a common backbone
88
  • When a packet sent by host X arrives at bridge B2
  • the bridge observes that it came in a port that
    was configured as being in VLAN 100
  • it inserts a VLAN header between the Ethernet
    header and its payload
  • the bridge applies normal rules for forwarding to
    the packet, with the extra restriction that the
    packet may not be sent out an interface that is
    not part of VLAN 100
  • thus, even a broadcast packet cant be sent out
    the interface to host Z, which is in VLAN 200

89
  • An attractive feature of VLANs
  • it is possible to change the logical topology
    without moving any wires or changing any
    addresses
  • example
  • if we want to make the segment that connects to
    host Z be part of VLAN 100, and thus enable X, W
    and Z be on the same virtual LAN, we would just
    need to change one piece of configuration on
    bridge B2

90
Do not Accommodate Heterogeneity
  • Bridges are fairly limited in the kinds of
    networks they can interconnect
  • Bridges make use of the networks frame header and
    so can support only networks that have exactly
    the same format for addresses
  • Bridges can be used to connect Ethernets to
    Ethernets, 802.5 (Token Ring) to 802.5, and
    Ethernets to 802.5 rings, since both networks
    support the same 48-bit address format
  • Bridges do not readily generalize to other kinds
    of networks, such as ATM

91
3.2 Basic Internetworking (IP)
  • 3.2.1 What is an Internework?
  • 3.2.2 Service Model
  • 3.2.3 Global Addresses
  • 3.2.4 Datagram Forwarding in IP
  • 3.2.5 Subnetting and Classless Addressing
  • 3.2.6 Address Translation (ARP)
  • 3.2.7 Host Configuration (DHCP)
  • 3.2.8 Error Reporting (ICMP)
  • 3.2.9 Virtual Networks and Tunnels

92
3.2.1 What is an Internework?
  • Concatenation of networks

A simple internetwork. Hn host, Rn router
93
  • An internetwork is a network of networks
  • in the figure, we see Ethernets, an FDDI ring,
    and a point-to-point link
  • each of these is a single-technology network
  • the nodes that interconnect the networks are
    called routers (sometimes called gateways)
  • The following figure shows how H1 and H8 are
    logically connected by the internet, including
    the protocol graph running on each node

94
  • A simple internetwork of protocol stack

Protocol layers used to connect H1 to H8. ETH
the protocol that runs over Ethernet.
95
3.2.2 Service Model
  • Service model for an internetwork
  • a host-to-host service only if this service can
    somehow be provided over each of the underlying
    physical networks
  • IP service model has two parts
  • addressing scheme
  • provides a way to identify all hosts in the
    internetwork
  • datagram (conectionless) model of data delivery
  • This service model is sometimes called best
    effort
  • although IP makes every effort to deliver
    datagrams, it makes no guarantees

96
  • Datagram
  • a type of packet sent in a connectionless manner
    over a network
  • every datagram carry enough information to let
    the network forward the packet to its correct
    destination
  • no need for any advance setup mechanism to tell
    the network what to do when the packet arrives

97
  • Best-effort delivery (unreliable service)
  • if something goes wrong and has the following
    situations
  • packets are lost
  • packets are delivered out of order
  • duplicate copies of a packet are delivered
  • packets can be delayed for a long time
  • the network does not make any attempt to recover
    from the failure

98
  • Datagram format

99
  • Datagram format
  • a succession of 32-bit words
  • the top word is transmitted first
  • the leftmost byte of each word is transmitted
    first

100
  • 1st word of the header
  • Version the version of IP
  • the current version of IP is 4 (IPv4)
  • HLen the length of the header in 32-bit words
  • most of the time, the header is 5 words (20
    bytes) long

101
  • TOS the 8-bit type of service
  • allow packets to be treated differently based on
    application needs
  • example, the TOS value might determine whether or
    not a packet should be placed in a special queue
    that receives low delay

102
  • Length 16 bits of the header
  • contain the length of the datagram, including the
    header
  • the field counts bytes rather than words
  • the maximum size of an IP datagram is 65,535
    bytes
  • the physical network over which IP is running may
    not support such long packets
  • IP supports a fragmentation and reassembly process

103
  • 2nd word of the header contains information about
    fragmentation
  • Offset 12-bit counts 8-byte chunk, not bytes
  • the distance (number of chunks) between the start
    of the original data and the start of the current
    fragment

104
  • 3rd word of the header
  • TTL one-byte time to live
  • a specific number of seconds that the packet
    would be allowed to live
  • routers along the path would decrement this field
    until it reached 0
  • Protocol one-byte demultiplexing key
  • identifies the higher-level protocol to which
    this IP packet should be passed
  • values defined for TCP (6), UDP (17)

105
  • Checksum
  • calculated by considering the entire IP header as
    a sequence of 16-bit words
  • adding them up using ones complement arithmetic,
    and taking the ones complement of the result

106
  • the fourth word of the header SourceAddr
  • the fifth word of the header DestinationAddr
  • there may be a number of options at the end of
    the header
  • the presence or absence of options may be
    determined by examining the header length (HLen)
    field

107
Fragmentation and Reassembly
  • Each network technology tends to have its own
    idea of how large a packet can be, example,
  • Ethernet can accept packets up to 1,500 bytes
    long
  • FDDI packets may be 4,500 bytes long
  • Every network type has a maximum transmission
    unit (MTU)
  • the largest IP datagram that it can carry in a
    frame
  • this value is smaller than the largest packet
    size on that network because the IP datagram
    needs to fit in the payload of the link-layer
    frame

108
  • Fragmentation
  • typically occurs when necessary (MTU lt Datagram)
  • to enable these fragments to be reassembled at
    the receiving host, they all carry the same
    identifier in the Ident field
  • this identifier is chosen by the sending host and
    is intended to be unique among all the datagrams
    that might arrive at the destination from this
    source over some reasonable time period

109
  • since all fragments of the original datagram
    contain this identifier, the reassembling host
    will be able to recognize those fragments that go
    together
  • should all the fragments not arrive at the
    receiving host, the host gives up on the
    reassembly process and discards the fragments
    that did arrive
  • IP does not attempt to recover from missing
    fragments

110
  • example
  • consider what happens when host Hl sends a
    datagram to host H8
  • assuming that the MTU is 1,500 bytes for the two
    Ethernets, 4,500 bytes for the FDDI network, and
    532 bytes for the point-to-point network
  • a 1,420-byte datagram (20-byte IP header plus
    1,400 bytes of data) sent from H1 makes it across
    the first Ethernet and the FDDI network without
    fragmentation but must be fragmented into three
    datagrams at router R2
  • these three fragments are then forwarded by
    router R3 across the second Ethernet to the
    destination host

111
1500


532
1500
4500
112

IP datagrams traversing the sequence of physical
networks
113
  • each fragment is itself a self-contained IP
    datagram that is transmitted over a sequence of
    physical networks, independent of the other
    fragments
  • each IP datagram is reencapsulated for each
    physical network over which it travels

114
(a)
(b)
Header fields used in IP fragmentation (a)
unfragmented packet (b) fragmented packets.
115
  • The unfragmented packet has 1,400 bytes of data
    and a 20-byte IP header
  • when the packet arrives at router R2, which has
    an MTU of 532 bytes, it has to be fragmented
  • a 532-byte MTU leaves 512 bytes for data after
    the 20-byte IP header, so the first fragment
    contains 512 bytes of data
  • the router sets the M bit in the Flags field,
    meaning that there are more fragments to follow
  • it sets the Offset to 0, since this fragment
    contains the first part of the original datagram

116
  • the data carried in the second fragment starts
    with the 513th byte of the original data, so the
    field in this header is set to 64 ( 512/8)
  • the third fragment contains the last 376 bytes of
    data, and the offset is now 2 512 / 8 128
    (since this is the last fragment, the M bit is
    not set)

117
3.2.3 Global Addresses
  • Ethernet addresses are globally unique
  • that alone does not suffice for an addressing
    scheme in a large internetwork
  • Ethernet addresses are also flat
  • they have no structure and provide very few clues
    to routing protocols

118
  • IP addresses are hierarchical
  • made up of two parts that correspond to some sort
    of hierarchy in the internetwork
  • network part
  • identifies the network to which the host is
    attached
  • all hosts attached to the same network have the
    same network part
  • host part
  • identifies each host uniquely on that particular
    network

119
  • example 1
  • the addresses of the hosts on network 1 would all
    have the same network part and different host
    parts
  • example 2
  • the routers are attached to two networks
  • they need to have an address on each network, one
    for each interface, e.g., router Rl
  • an IP address on the interface to network 2 that
    has the same network part as the hosts on network
    2
  • an IP address on the interface to network 3 that
    has the same network part as the hosts on network
    3
  • IP addresses belong to interfaces than to hosts

120
  • IP addresses are divided into three different
    classes
  • each of the following figure defines
    different-sized network and host parts
  • there are also class D addresses specify a
    multicast group, and class E addresses that are
    currently unused
  • in all cases, the address is 32 bits long

121
IP addresses (a) class A (b) class B (c) class
C
122
  • the class of an IP address is identified in the
    most significant few bits
  • if the first bit is 0, it is a class A address
  • if the first bit is 1 and the second is 0, it is
    a class B
  • if the first two bits are 1 and the third is 0,
    it is a class C address
  • of the approximately 4 billion ( 232)possible IP
    addresses
  • one-half are class A
  • one-quarter are class B
  • one-eighth are class C

123
  • Class A addresses
  • 7 bits for the network part and 24 bits for the
    host part
  • 126 ( 27-2) class A networks (0 and 127 are
    reserved)
  • each network can accommodate up to 224-2 (about
    16 million) hosts (again, two are reserved
    values)
  • Class B addresses
  • 14 bits for the network part and 16 bits for the
    host part
  • 65,534 ( 216-2) hosts

124
  • Class C addresses
  • 21 bits for the network part and 8 bits for the
    host part
  • 2,097,152 ( 22l) class C networks
  • 254 hosts (host identifier 255 is reserved for
    broadcast, and 0 is not a valid host number)

125
  • IP addresses are written as four decimal integers
    separated by dots
  • each integer represents the decimal value
    contained in 1 byte ( 0255) of the address,
    starting at the most significant
  • Example, 171.69.210.245
  • Internet domain names (DNS)
  • also hierarchical
  • domain names tend to be ASCII strings separated
    by dots, e.g., cs.nccu.edu.tw

126
3.2.4 Datagram Forwarding in IP
  • Forwarding
  • the process of taking packet from an input and
    sending it out on the appropriate output
  • Routing
  • the process of building up the tables that allow
    the correct output for a packet to be determined

127
  • Strategy
  • every datagram contains destinations address
  • if connected to destination network
  • then forward to host
  • if not directly connected
  • then forward to some router
  • forwarding table maps network number (NetworkNum)
    into next hop (NextHop)
  • each host has a default router
  • each router maintains a forwarding table

128
  • Datagram forwarding algorithm
  • if (NetworkNum of destination NetworkNum of one
    of my interfaces) then
  • deliver packet to destination over
    that interface
  • else
  • if (NetworkNum of destination is in my
    forwarding table) then
  • deliver packet to NextHop route
  • else
  • deliver packet to default router

129
  • For a host with only one interface and only one
    default router in its forwarding table
    (simplified algorithm)
  • if (NetworkNum of destination my NetworkNum)
    then
  • deliver packet to destination directly
  • else
  • deliver packet to default router

130
  • Example1
  • suppose H1 wants to send a datagram to H2
  • since they are on the same physical network, H1
    and H2 have the same network number in their IP
    address
  • H1 deduces that it can deliver the datagram
    directly to H2 over the Ethernet
  • the one that needs to be resolved is how Hl finds
    out the correct Ethernet address for H2

131
  • Example2
  • suppose H1 wants to send a datagram to H8
  • since they are on different physical networks
  • H1 deduces that it needs to send the datagram to
    a router
  • Hl sends the datagram over the Ethernet to R1
  • R1 knows that it cannot deliver a datagram
    directly to H8 because neither of Rls interfaces
    is on the same network as H8

132
  • suppose R1s default router is R2 R1 then sends
    the datagram to R2 over the token ring network
  • assume R2 has the forwarding table shown as
    follows, it looks up H8s network number (network
    1) and forwards the datagram to R3

133
Network Number Next Hop
1 R3
2 R1
3 Interface 1
4 Interface 0
Forwarding table for router R2
134
  • R3 forwards the datagram directly to H8
  • it is possible to include the information about
    directly connected networks in the forwarding
    table
  • example, we could label the network interfaces of
    router R2 as interface 0 for the point-to-point
    link (network 4) and interface l for the token
    ring (network 3)

Network Number Next Hop
1 R3
2 R1
3 Interface 1
4 Interface 0
0
1
135
3.2.5 Subnetting and Classless Addressing
  • Subnetting deals with address space utilization
  • Original intent of IP addresses
  • the network part would uniquely identify exactly
    one physical network
  • Problem of address assignment inefficiency
  • class C with 2 hosts (2/255 0.78 efficiency)
  • class B with 256 hosts (256/65535 0.39
    efficiency)

136
  • Subnet
  • add another level to address / routing hierarchy
  • reduce the total number of network numbers that
    are assigned
  • idea
  • take a single IP network number and allocate the
    IP addresses with that network number to several
    physical networks
  • a perfect use of subnetting is a large campus or
    corporation that has many physical networks

137
  • Subnet mask
  • define variable partition of host part
  • a single network number can be shared among
    multiple networks involves configuring all the
    nodes on each subnet with a subnet mask

138
  • subnet mask enables a subnet number
  • hosts may be on different physical networks but
    share a single network number
  • example, to share a single class B address among
    several physical networks, we could use a subnet
    mask of 255.255.255.0 (all 1s in the upper 24
    bits and 0s in the lower 8 bits)
  • the top 24 bits are network number
  • the lower 8 bits are host number
  • the top 16 bits identify the network in a class B
    address

139
  • three parts address
  • network part (16 bits)
  • subnet part (8 bits)
  • host part (8 bits)

140
Subnetted Address
141
Subnet Example
142
  • Exactly one subnet mask per subnet
  • H1
  • IP address 128.96.34.15
  • subnet mask 255.255.255.128
  • subnet number 128.96.34.0
  • Defines the subnet number of the host and of all
    other hosts on the same subnet
  • take bitwise AND of IP address and subnet
    mask
  • example, 128.96.34.15 AND 255.255.255.128 equals
    128.96.34.0

143
  • When a host wants to send a packet to a certain
    IP address
  • perform a bitwise AND of its own subnet mask and
    the destination IP address
  • if the result equals the subnet number of the
    sending host
  • the destination host is on the same subnet and
    the packet can be delivered directly over the
    subnet

144
  • if the results are not equal
  • the packet needs to be sent to a router to be
    forwarded to another subnet
  • example, if H1 is sending to H2, then H1 ANDs its
    subnet mask (255.255.255.128) with the address
    for H2 (128.96.34.139) to obtain 128.96.34.128
  • 128.96.34.128 does not match the subnet number
    for H1 (128.96.34.0), so H1 and H2 are on
    different subnets
  • H1 has to send packet to its default router R1
    then to H2

145
  • Router with/without subnetting
  • simple IP
  • entries of forwarding tables is of the form
    (NetworkNum, NextHop)
  • support subnetting
  • entries of forwarding tables is of the form
    (SubnetNumber, SubnetMask, NextHop)

146
  • find the right entry in the table
  • the router ANDs the packet's destination address
    with the SubnetMask for each entry in turn
  • if the result matches the SubnetNumber of the
    entry, then this is the right entry to use
  • it forwards the packet to the next hop router
    indicated
  • router Rl of the subnet example would have the
    following entries

147
(No Transcript)
148
  • continuing with the example, a datagram from H1
    being sent to H2
  • Rl would AND H2's address (128.96.34.139) with
    the subnet mask of the first entry
    (255.255.255.128)
  • compare the result (128.96.34.128) with the
    network number for that entry (128.96.34.0)
  • since this is not a match (the first entry), it
    proceeds to the next entry
  • this time a match does occur (the second entry),
    so Rl delivers the datagram to H2 using interface
    1, which is the interface connected to the same
    network as H2

149
Datagram Forwarding Algorithm
  • D destination IP address
  • for each entry (SubnetNum, SubnetMask, NextHop)
  • D1 SubnetMask D
  • if D1 SubnetNum
  • if NextHop is an interface
  • deliver datagram directly to D
  • else
  • deliver datagram to NextHop
    (router)

150
Classless Routing (CIDR)
  • Classless InterDomain Routing (CIDR, pronounced
    "cider")
  • CIDR addresses two scaling concerns in the
    Internet
  • the growth of backbone routing tables as more and
    more network numbers need to be stored
  • the potential for the 32-bit IP address space to
    be exhausted well before the 4 billionth ( 232)
    host is attached to the Internet
  • CIDR assigns block of contiguous network numbers
    to nearby networks

151
  • CIDR tries to balance the following
  • minimize the number of routes that a router needs
    to know
  • the need to hand out addresses efficiently
  • CIDR helps to aggregate routes
  • uses a single entry in a forwarding table to
    reach a lot of different networks by breaking the
    rigid boundaries between address classes

152
  • example, consider a hypothetical AS (Autonomous
    System) with 16 class C network numbers
  • instead of handing out 16 addresses at random, we
    can hand out a block of contiguous class C
    addresses
  • suppose we assign the class C network numbers
    from 192.4.16 through 192.4.31
  • the top 20 bits of all the addresses in this
    range are the same (11000000 00000100 0001)

153
  • what we have effectively created is a 20-bit
    network number-something that is between a class
    B network number and a class C number

154
IP addresses (a) class A (b) class B (c) class
C
155
  • CIDR allows the prefixes (network numbers) can be
    of any length
  • convention place a /X after the prefix where X
    is the prefix length in bits
  • the example above, the 20-bit prefix for all the
    networks 192.4.16 through 192.4.31 is represented
    as 192.4.16/20
  • if we want to represent a single class C network
    number, its prefix is 24 bits long, we would
    write it 192.4.16/24

156
  • Routing protocol can use CIDR to deal with
    "classless" addresses
  • it must understand that a network number may be
    of any length
  • network numbers are represented by (length,
    value) pairs
  • length gives the number of bits in the network
    prefix, e.g., 20 in the above example

157
  • Internet Service Provider (ISP) network has to
    provide Internet connectivity to a large number
    of corporations and campuses (customers)
  • if we assign prefixes to the customers in such a
    way that many different customer networks
    connected to the provider network share a common,
    shorter address prefix, then we can get even
    greater aggregation of routes

158
  • example, assume that eight customers served by
    the provider network have each been assigned
    adjacent 24-bit network prefixes
  • those prefixes all start with the same 21 bits
  • all of the customer are reachable through the
    same provider network
  • it can advertise a single route to all of them by
    just advertising the common 21-bit prefix they
    share

159

128
1 0 0 0 0 0 0 0
135
1 0 0 0 0 1 1 1
Route aggregation with CIDR
160
IP Forwarding Revisited
  • CIDR means that prefixes may be of any length,
    from 2 to 32 bits
  • it is possible to have prefixes in the forwarding
    table that "overlap," in the sense that some
    addresses may match more than one prefix
  • example1
  • we might find both 171.69 (a 16-bit prefix) and
    171.69.10 (a 24-bit prefix) in the forwarding
    table of a single router
  • a packet destined to, say, 171.69.10.5, clearly
    matches both prefixes
  • 171.69.10 would be the longest match in this case

161
  • example2
  • a packet destined to 171.69.20.5 would match
    171.69 and not 171.69.10
  • in the absence of any other matching entry in the
    routing table, 171.69 would be the longest match

162
3.2.6 Address Translation (ARP)
  • Issue
  • IP datagrams contain IP addresses, but the
    physical interface hardware on the host or router
    to which you want to send the datagram only
    understands the addressing scheme of that
    particular network

163
  • Resolution
  • translate the IP address to a link-level address
    that makes sense on this network (e.g., a 48-bit
    Ethernet address)
  • encapsulate the IP datagram inside a frame that
    contains that link-1evel address and send it
    either to the ultimate destination or to a router
    that promises to forward the datagram toward the
    ultimate destination

frame
link-level address
IP datagram
Encapsulation
164
Network part
Host part
(physical address)
  • Simple way to map an IP address into a physical
    network address
  • encode a hosts physical address in the host part
    of its IP address
  • example, a host with physical address 00100001
    01001001 (the decimal value 33 in the upper byte
    and 73 in the lower byte) might be given the IP
    address 128.96.33.73
  • it is limited in that the networks physical
    addresses can be no more than 16 bits long in
    this example

165
  • More general solution
  • each host maintains a table of address pairs (map
    IP addresses into physical addresses)
  • Alternative solutionAddress Resolution Protocol
    (ARP)
  • enable each host on a network to build up a table
    of mappings between IP addresses and link-level
    addresses
  • since these mappings may over time (e.g. because
    an Ethernet card in a host breaks and is replaced
    by a new one with a new address), the entries are
    timed out periodically and removed

166
  • this happens on the order of every 15 minutes
  • the set of mappings currently stored in a host is
    known as the ARP cache or ARP table

167
  • The ARP packet contains
  • HardwareType
  • the type of physical network (e.g., Ethernet)
  • ProtocolType
  • the higher-layer protocol (e.g., IP)
  • HLen (hardware address length) and PLen
    (protocol address length)
  • the length of the link-layer address and
    higher-layer protocol address

168
  • Operation
  • specifies whether this is a request or a response
  • Addresses
  • source hardware (Ethernet) address (6 bytes)
  • source protocol (IP) address (4 bytes)
  • target hardware (Ethernet) address (6 bytes)
  • target protocol (IP) address (4 bytes)

169
ARP Packet Format
170
3.2.7 Host Configuration (DHCP)
  • Dynamic Host Configuration Protocol (DHCP)
  • relies on the existence of a DHCP server that is
    responsible for providing configuration
    information to hosts
  • there is at least one DHCP server for an
    administrative domain
  • at the simplest level, the DHCP server can
    function just as a centralized repository for
    host configuration information

171
  • a more sophisticated use of DHCP saves the
    network administrator from even having to assign
    addresses to individual hosts
  • the DHCP server maintains a pool of available
    addresses that it hands out to hosts on demand
  • this considerably reduces the amount of
    configuration an administrator must do by
    allocating a range of IP addresses (all with the
    same network number) to each network

172
  • DHCP server discovery
  • to contact a DHCP server, a newly booted or
    attached host sends a DHCPDISCOVER message to a
    special IP (broadcast) address (255.255.255.255)
  • it will be received by all hosts and routers on
    that network
  • in the simplest case, one of these nodes is the
    DHCP server for the network
  • the server would then reply to the host that
    generated the discovery message (all the other
    nodes would ignore it)

173
  • DHCP uses the concept of relay agent
  • there is at least one relay agent on each
    network, and it is configured with just one piece
    of information the IP address of the DHCP server
  • when a relay agent receives a DHCPDISCOVER
    message, it unicasts it to the DHCP server and
    awaits the response, which it will then send back
    to the requesting client

Slide 1
Write a Comment
User Comments (0)
About PowerShow.com