3rd Edition: Chapter 4 - PowerPoint PPT Presentation

About This Presentation
Title:

3rd Edition: Chapter 4

Description:

Chapter 4 Network Layer Read the paper (IP Addressing) http://www.3com.com/other/pdfs/infra/corpinfo/en_US/501302.pdf#search=%22understanding%20ip%20addressing ... – PowerPoint PPT presentation

Number of Views:185
Avg rating:3.0/5.0
Slides: 217
Provided by: ecstCsuc8
Category:
Tags: 3rd | chapter | edition

less

Transcript and Presenter's Notes

Title: 3rd Edition: Chapter 4


1
Chapter 4Network Layer
Read the paper (IP Addressing) http//www.3com.com
/other/pdfs/infra/corpinfo/en_US/501302.pdfsearch
22understanding20ip20addressing20everything2
2
Computer Networking A Top Down Approach ,4th
edition. Jim Kurose, Keith RossAddison-Wesley,
July 2007.
A excellent source for IP addressing and
subnetting routing Also read Chapter 3 of
http//www.redbooks.ibm.com/redbooks/pdfs/gg243376
.pdf
2
Chapter 4 Network Layer
  • Chapter goals
  • understand principles behind network layer
    services
  • network layer service models
  • forwarding versus routing
  • how a router works
  • routing (path selection)
  • dealing with scale
  • advanced topics IPv6, mobility
  • instantiation, implementation in the Internet

3
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

4
Network layer Network layer functions
  • Application-layer protocols
  • define when and how
  • messages are sent
  • Transport-layer protocols
  • deliver data between processes on different
    end-systems
  • Transport protocols execute only on end systems
  • Network-layer protocols
  • deliver data from one end-system to another
  • Hop-to-hop rather than end-to-end
  • Network layer protocols execute on every
    end-systems and routers

Virtual end-to-end transport
5
The Network Layer Network layer
functions(Packet switching)
  • The network-layer provides four important
    functions
  • Addressing the means by which end systems
    identify each other
  • Path determination (routing) the route taken
    by packets from source to destination
  • Switching (forwarding) the movement of packets
    from an input interface to an appropriate output
    interface
  • Call setup termination The establishment of
    a virtual circuit from sender to receiver in case
    of a connection-oriented service-- ATM, frame
    relay, X.25

6
Interplay between routing and forwarding
Routing ?
Act of updating routing table usually via talking
to other routers
Forwarding ?
Act of looking up routing table and
sending(forwarding) to another router
7
Connection setup
  • Connection-oriented network architectures
  • ATM, frame relay, X.25
  • before datagrams flow, two end hosts and
    intervening routers establish virtual connection
  • routers get involved in setting up the connection
  • network vs transport layer connection service
  • network between two hosts (may also involve
    intervening routers in case of VCs)
  • transport between two processes

8
Network service model
  • What service model should be provided for
    transporting packets from sender to receiver? In
    other words, what aspects should we consider in
    designing network layer?
  • Some possible elements of a service model
  • Guaranteed bandwidth
  • Guaranteed delay
  • Preservation of inter-packet timing (guaranteed
    maximum jitter)end-to-endgeared toward
    time-sensitive traffic
  • Loss-free delivery
  • In-order delivery
  • Congestion feedback to sender

Does IP protocol provide any of the above? NO !
9
Network layer service models
Constant Bit Rate (CBR) Variable Bit Rate
(VBR) Available Bit Rate (ABR) Unspecified Bit
Rate (UBR)
Guarantees ?
Network Architecture Internet (IP) ATM ATM ATM
ATM
Service Model best effort CBR VBR ABR UBR
Congestion feedback no (inferred via
loss) no congestion no congestion yes no
Bandwidth none constant rate guaranteed rate gua
ranteed minimum none
Loss no yes yes no no
Order no yes yes yes yes
Timing no yes yes no no
Connection-oriented protocols can do all of these!
10
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

11
Connection-Oriented or Connectionless ?
  • Datagram(DG) network provides network-layer
    connectionless service--IP
  • Virtual Circuit(VC) network provides
    network-layer connection-oriented serviceFrame
    Relay, X.25
  • analogous to the transport-layer services, but
  • service should provide host-to-hostsame with
    transport layer in this respect
  • no choice network either provides or
    nottransport layer has choice between TCP or UDP
  • implementation in network core

12
Connection-oriented Virtual Circuits
  • source-to-dest path behaves much like telephone
    circuit
  • performance-wise
  • network actions along source-to-dest path
  • call setup for each call before data can flow,
    and teardown when done
  • each packet carries VC identifier (not
    destination host address)
  • every router on source-dest path maintains
    state for each passing connectionconnection
    managementflow control, windowing, etc.
  • link, router resources (bandwidth, buffers) may
    be allocated to VC (dedicated resources
    predictable service) ? QOS

13
VC implementation
  • a VC consists of
  • path from source to destination
  • VC numbers, one number for each link along
    pathnumber changes hop-to-hop
  • entries in forwarding tables in routers along
    pathan entry fixed until VC teardown
  • packet belonging to VC carries VC number (rather
    than full destination address)
  • VC number can be changed on each link.
  • VC number changed according to the entry in
    forwarding table

14
ATM cell format Virtual Circuit identifier
8 bits
GFC
VPI
VPI
VCI
VCI
VCI
CLP
PTI(3 bits)
HEC
48 BYTES PAYLOAD
GFC--Generic flow control (000uncontrolled
access). VPI--Virtual path identifier.
VCI--Virtual channel identifier. Together, the
VPI and VCI comprise the VPCI. These fields
represent the routing information within the ATM
cell. PTI--Payload Type Indication. CLP--Cell
Loss Priority. HEC--Header Error Control.
VC identifier
15
Forwarding table
Forwarding table in northwest router
Routers maintain connection state information for
each Virtual circuit and also do windowinglarge
overhead!
16
Virtual circuits signaling protocols
  • used to setup, maintain, teardown VC using
    control packets
  • used in ATM, frame-relay, X.25
  • VC signaling protocol are used only along parts
    of Internet
  • Used primarily near the network core where a
    connection-oriented service (e.g. ATM) is used
  • The signaling protocols are not part of IP

7. Discconnect request
8. Discconnect confirm
6. Receive data
5. Data flow begins
4. Call connected
3. Accept call
1. Initiate call
2. incoming call
What happens when a packet is hit by noise on a
link?
17
Example ATM Backbone on Internet
18
Datagram networks--connectionless
  • no call setup at network layer
  • routers no state about hop-to-hop or end-to-end
    connections
  • no network-level concept of connection
  • packets forwarded using destination host address
  • Packets routed independently each other
  • packets between same source-dest pair may take
    different paths

Advantage Much less overhead than VC
Disadvantages?
unreliable, no flow control, no error control
1. Send data
2. Receive data
19
Forwarding table
For 32 bit addresses, 4 billion possible entries
to have an entry for every address for every
router, so better way is
Destination Address Range
Link Interface
11001000 00010111 00010000 00000000
through
0
11001000 00010111 00010111 11111111
11001000 00010111 00011000 00000000
through
1
11001000 00010111 00011000 11111111
11001000 00010111 00011001 00000000
through
2
11001000 00010111 00011111 11111111
otherwise
3
Above will have the same effect as
20
Longest prefix matching the idea used in
Internet(glimpse of how routing works)
Prefix Match
Link Interface 11001000
00010111 00010 0
11001000 00010111 00011000
1 11001000 00010111 00011
2
otherwise
3
Examples
Which interface?
DA 11001000 00010111 00010110 10100001
Which interface?
DA 11001000 00010111 00011000 10101010
21
Datagram or VC network why?
  • Internet (datagram)
  • data exchange among computers
  • elastic service, no strict timing required
  • smart end systems (computers)
  • can adapt, perform control, error recovery
  • simple inside network, complexity at edge
  • many link types
  • different characteristics
  • uniform service difficult
  • ATM (VC)
  • evolved from telephony--BISDN
  • human conversation
  • strict timing, reliability requirements
  • need for guaranteed service
  • dumb end systems
  • telephones
  • complexity inside network

22
Connection-oriented(VC)   vs   Conncectionless(DG)
  •  
  • ISSUES               Connection-oriented          
       Connectionless
  • --------------------------------------------------
    --------------------------------------------------
    ---------------
  • Initial setup Required                            
          No
  • and termination
  • Routing Routing only done on Each packet
    routed
  • initial VC setup independently
  • Connection state Routers keep state info.
    Router do not hold state info.
  • for each connection
  • Need for Needed during initial setup  Full
    address needed
  • Full address Afterwards only VC always
  • needed                                          
                          
  • Packet                        Guaranteed          
                        Not guaranteed
  • Sequencing
  •                                                   
                                                      
          
  • Error recovery            Handles error
    conditions          Left to a higher layer

23
Connection-oriented(VC)   vs   Conncectionless(DG)
Contd
ISSUES      Connection-oriented    Connectionless
--------------------------------------------------
--------------------------------------------------
--------- Congestion control Easy Difficult QO
S Easy Difficult Flow Control        Handles   
       Not done Overhead           High        
          Low Examples         TCP             
    UDP, IP, IPX, ISO-IP
24
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

25
Router Architecture Overview
  • Two key router functions
  • run routing algorithms/protocol (RIP, OSPF, BGP)
  • forwarding datagrams from incoming to outgoing
    link

Explore this first
26
Input Port Functions Centralized switching
Routing processor
Output port
Routing Table
Physical layer bit-level reception
Data link layer e.g., Ethernet see chapter 5
  • Centralized switching
  • Input port forward to Routing processor
  • Routing processor perform forwarding table lookup
  • Forwards the packet to output port
  • This approach used for low end routers,
    workstations or servers acting as routers

27
Input Port Functions Decentralized switching
Physical layer bit-level reception
  • Decentralized switching
  • given datagrams dest., input port processor
    lookup output port using forwarding table(a
    shadow copy in each input port) in input port
    memorysome routers use Content Addressable
    Memory for faster lookupse.g. Cisco 8500 has 64K
    CAM for each input port
  • goal complete input port processing at line
    speedneeds parallel processors
  • queuing if datagrams arrive faster than
    forwarding rate into switch fabric

Data link layer e.g., Ethernet see chapter 5
28
Three types of switching fabrics
2
1
3
29
Switching Via Memory
  • First generation routers
  • earlier routers (often just a computer) with
    switching under direct control of CPU
  • packet copied to systems memory
  • speed limited by memory bandwidth (2 system bus
    crossings per datagram)
  • many modern routers still use but in a shared
    memory multiprocessor modea processor for each
    input port

Memory
Input Port
Output Port
System Bus
e.g. CISCO Catalyst 8500
30
Switching Via a Bus
  • datagram from input port memory
  • to output port memory via a shared busone
    packet at a time to output port
  • bus contention switching speed limited by bus
    bandwidth
  • 1 Gbps bus, Cisco 1900 sufficient speed for
    access and enterprise routers (not fast enough
    for regional or backbone routers)

31
Switching Via An Interconnection Network
  • overcome bus bandwidth limitations
  • Banyan networks other interconnection nets
    initially developed to connect processors in
    multiprocessor
  • Advanced design fragmenting datagram into fixed
    length cells, switch cells through the fabric and
    reassemble at receiving end
  • Fastest, most expensive
  • Cisco 12000 series switches up to 1.28 tera bps
    through the interconnection network

.
.
.
Horizontal busno contention
.
.
Vertical buscontention
.
See this
32
Cisco 12000 Crossbar switch
33
Output Ports
  • Buffering required when datagrams arrive from
    switching fabric faster than the transmission
    rate
  • Scheduling discipline chooses among queued
    datagrams for transmissiondepends upon
    protocols
  • If IP, then First-In-First-Out
  • If ATM, then depending on the QOS
  • Constant Bit Rate (CBR)
  • Variable Bit Rate (VBR)
  • Available Bit Rate (ABR)
  • Unspecified Bit Rate (UBR)

34
Output port queueing
  • buffering when arrival rate via switch exceeds
    output line speed
  • queueing (delay) and loss due to output port
    buffer overflow!Assuming Switch operates 3 times
    the speed of line speed

35
Input Port Queuing
  • Fabric slower than input ports combined -gt
    queueing may occur at input queues
  • Head-of-the-Line (HOL) blocking queued datagram
    at front of queue prevents others in queue from
    moving forward
  • queueing delay and loss due to input buffer
    overflow!

36
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

37
TCP/IP Protocol Suite
38
IP
39
The IP (Internet Protocol) RFC 791
  • Network layer functions of hosts routers

Transport layer TCP, UDP
Network layer
Link layer
physical layer
40
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

41
IP datagram format RFC 791
IP protocol version Number IPv4
32 bits
total datagram length (bytes)
header length (32 bit words)
head. len
type of service
16
ver
length
8
4
4
Used for fragmentation/ reassembly
fragment offset
type of data
13
flgs
16-bit identifier
max number remaining hops (decremented at each
router)
time to live
Proto- col
header checksum
16
8
8
For error checking
32 bit source IP address
32 bit destination IP address
upper layer protocol to deliver payload to
E.g. timestamp, record route taken, specify list
of routers to visit.
Options (if any)
  • how much overhead with TCP?
  • 20 bytes of TCP
  • 20 bytes of IP
  • 40 bytes app layer overhead

data (variable length, typically a TCP or UDP
segment)
42
Table from IANA Assigned Numbers
The Protocol numbers are Service Access Points on
IP layer
43
Service Access Points
Telnet
http
DNS
Port numbers
23
80
53
UDP
TCP
ICMP
IGMP
Protocol numbers
1
6
17
2
IP
ARP
Ether Types
x0806
x0800
Ethernet
44
MTU (Maximum Transmission Unit)
Transport layer(TCP/UDP) has MSSIP layer has
MTU(determined by Link layer)
  • network links have MTU (Maximum Transmission
    Unit) - largest possible link-level frame.
  • different link types ? different MTUs
  • Given 1500 Byte MTU(Ethernet), what is
    MSS(Maximum Segment Size) for TCP?
  • 1500 20(TCP) -20(IP) 1460

headers
45
MTU (Maximum Transmission Unit)
46
IP Fragmentation Reassembly
  • large IP datagram divided (fragmented) within
    net
  • By a router
  • one datagram becomes several datagrams
  • reassembled only at final destination hostwhy?
  • IP header bits used to identify, reorder related
    fragments

fragmentation in one large datagram out 3
smaller datagrams
reassembly
47
Fragmentation example
Ping from a Windows workstation -f Set
Don't Fragment flag -l Send buffer size.
Screen captured on a Windows system
C\Documents and Settings\Administratorgtping
www.google.com -f -l 1400 Pinging
www.l.google.com 66.102.7.104 with 1400 bytes
of data Packet needs to be fragmented but DF
set. Packet needs to be fragmented but DF
set. Packet needs to be fragmented but DF
set. Packet needs to be fragmented but DF
set. Ping statistics for 66.102.7.104
Packets Sent 4, Received 0, Lost 4 (100
loss),
48
Fragmentation
32 bits
head. len
type of service
ver
length
Fields needed for fragmentation
fragment offset
flgs
16-bit identifier
time to live
Proto- col
header checksum
Flags3 bits
32 bit source IP address
32 bit destination IP address
R Reservednot used DF Dont Fragment MF More
Fragment
Options (if any)
data (variable length, typically a TCP or UDP
segment)
49
IP Fragmentation and Reassembly
  • Example
  • 4000 byte datagram
  • MTU 1500 bytes

1480 bytes in data field 20bytes of IP header
offset 1480/8
Fragments are counted in units of 8
octets(bytes).
50
Internal modules of IP Layer for routers hosts
To upper layer protocol
From upper layer protocol
Data
Data dest. addr.
Header-composing module
IP
IP packet
Reassembly module
IP packet
Processing module
Routing module
IP packet
IP packet, next hop addr., interface
MTU table
Fragmentation module
IP packet, next hop addr.
IP packet
To data link layer
From data link layer
51
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

52
IP packet formatIPv4
53
IP packet formatIPv4from RFC791
54
IP Addressing introduction
  • IP address 32-bit identifier for host, router
    interface
  • interface connection between host/router and
    physical link
  • routers typically have multiple interfaces
  • host typically has one interface
  • IP addresses associated with each interface

223.1.1.1
223.1.2.9
223.1.1.4
223.1.1.3
223.1.1.1 11011111 00000001 00000001 00000001
223
1
1
1
55
IP Addressing
IPv432bits
IPv6128 bits
When?
Huge address space More streamlined for
efficiency More Auto-configuration Accommodates
QOS
  • CIDR
  • VLSM
  • NAT

Classful Addressing
1992
  • Inefficient division into 5 classes
  • A, B, C, D, E
  • Address space running out

interim solutions
56
IP Addressing Classful or Classless
  • Older IP addressing (and routing) called
    Classful IP addressing which fixes the size of
    a block to one of classes (A, B, C, D, E)
  • Out of 5 classes, only 3 classes are assignable
    to computers as IP addressesonly 3 sizes to fit
    all organizations of the world?
  • More elastic (size-wise) scheme is called
    CIDR(Classless Inter Domain Routing)IP address
    blocks can be any size using prefix subnet
    maskslater
  • Both used but Classless mostly used by ISP level
    or above

57
IP Addressing Classful Addressing
7
24
16
14
8
21
58
IP Addressing Dotted Decimal Notation
  • 32 bit IP addresses are often represented in the
    human-friendly 4 groups of 8 bits and written in
    decimal number with dots separating them ?
    dotted decimal notation

.
.
.
132
241
158
35
59
Private IP addresses
  • The Internet Assigned Numbers Authority (IANA)
    under ICANN has reserved the following three
    blocks of the IP address space for private
    networks Read here
  • 10.0.0.0 - 10.255.255.255 172.16.0.0 -
    172.31.255.255 192.168.0.0 - 192.168.255.255
  • Also, IP addresses in the range of 169.254.0.0
    -169.254.255.255 are reserved for Automatic
    Private IP Addressing (Zero Configuration
    Networking).
  • Used for ad hoc or isolated networks
  • The above IP addresses should not be used on the
    Internet. Internet routers will not route packets
    with those addressesonly usable for private
    networks or Intranets

60
Address ranges
61
Special Addresses
  • Some parts of classes A, B, C are used for
    special addresses

--------------------------------------------------
--------------------------------------------------
------------- Special Addresses Netid Hostid
Source or Destination ---------------------
--------------------------------------------------
------------------------------------------ Network
address Specific All 0s None (e.g.
132.241.0.0 is the network address for the CSU,
Chico LAN) ---------------------------------------
--------------------------------------------------
------------------------ Direct broadcast
address Specific All 1s Destination (This is
used by a router to send a packet to all hosts in
a subnet, e.g. 132.241.255.255) ------------------
--------------------------------------------------
--------------------------------------------- Limi
ted broadcast address All 1s All
1s Destination (A broadcast address for a
subnet--It is used when a host wants to send a
message to all the hosts in the local
subnet--routers will not pass this to other
subnets) -----------------------------------------
--------------------------------------------------
---------------------- This host on this
network All 0s All 0s Source (All 0s designate
this host on this network--used by a host when
it does not know its own IP address) ------------
--------------------------------------------------
--------------------------------------------------
- Specific host on this network All
0s Specific Destination (It is used by a host
to send a message to another host on the same
subnet-- Routers will not process this
kind) --------------------------------------------
--------------------------------------------------
------------------- Loopback address 127 Any De
stination (It is used to test the health of
TCP/IP protocol on a host, e.g. ping 127.0.0.1)
62
The Needs for subnetting
  • Given a chunk of addresses (e.g. a class B), an
    organization usually need to sub-divide the
    address space in a hierarchical fashion
  • Just as an organization is structured
    hierarchically, IP addresses are divided as
    needed
  • From http//www.cisco.com/univercd/cc/td/doc/cisin
    twk/ito_doc/ip.htm
  • Subnetting provides the network administrator
    with several benefits, including extra
    flexibility, more efficient use of network
    addresses, and the capability to contain
    broadcast traffic (a broadcast will not cross a
    router). Subnets are under control of local
    administration. As such, the outside world sees
    an organization as a single network and has no
    detailed knowledge of the organization's internal
    structure.
  • Also read http//www.support.psi.net/support/commo
    n/routers/files/SUBNET-Desc.html

63
Without Subnetting?
  • Analogous to One person in mailroom delivering
    all mails of the organization
  • Without subnetting, The entire network (e.g.
    132.241.0.0) is connected as one LAN--All
    workstations should be connected directly to the
    routereither directly to the router ports or the
    LAN is connected only through hubs and
    switchesthis is not feasible except for a very
    small networkless than 100 computers

64
Without Subnetting?
To Internet
This router should be very fast, should have a
large number of ports. Also long cables needed--
Not feasible except for very small networkless
than 100 computers?!
65
Subnets
subnetid
hostid
  • IP address divided
  • subnetid part (high order bits)
  • hostid part (low order bits)
  • Whats a subnet ?
  • device interfaces with same subnet part of IP
    address
  • Hosts within a subnet can physically reach each
    other without intervening router

223.1.1.1
223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
subnet
223.1.3.2
223.1.3.1
network consisting of 3 subnets
66
Subnets
  • Recipe
  • To determine the subnets, detach each interface
    from its host or router, creating islands of
    isolated networks. Each isolated network is
    called a subnet.
  • The host are usually connected to a hub or a
    switch

Subnet mask /24
67
Subnets
223.1.1.2
  • Decisions to make
  • How many subnets?
  • How big each subnet?
  • How many levels of subnetting?
  • All depends upon the organizational structure and
    requirements

223.1.1.1
223.1.1.4
223.1.1.3
223.1.7.0
223.1.9.2
223.1.9.1
223.1.7.1
223.1.8.0
223.1.8.1
223.1.2.6
223.1.3.27
223.1.2.1
223.1.2.2
223.1.3.2
223.1.3.1
68
Subnetting
  • After acquiring a block of network addresses,
    e.g. a Class B address, divide it according to
    needs
  • Lets say, we need 6 large divisions first, then
    each division may be divided as needed
  • Each division must be equal sizes

1st division
2nd
3rd
69
Subnetting Classful--example
  • Given class B address of 132.241.0.0, we need to
    divide the networks into 255 equal-sized
    subnetsvariable sizing covered later (VLSM)
  • With a class B address, we are given the last 16
    bits to play with(divide)

netid
hostid
Can be subnetted
Fixed
132 . 241 . 0 .
0
70
Subnetting Classful--example
132 . 241 . 0 .
0
Can be subnetted
Fixed
. . .
Where should we put the divider?
of subnets? of hosts in a subnet?
  • The decision should be based upon
  • of subnets needed
  • of hosts on each subnets
  • Future needs
  • Routing protocol (RIPv1, RIPv2, or OSPF)

71
Subnetting Classful--example
132 . 241 . 0 .
0
Can be subnetted
Fixed
. . .
The division is indicated by subnet maskdone
by putting 1s until the division point For
example Lets put it after 19th bit
Where should we put the divider?
of subnets? of hosts in a subnet?
Then the subnet mask should be
?
0
224
255
255
72
Subnetting Classful
0
241
132
0
Then the subnet mask should be
0
224
255
255
subnetid
hostid
netid
hostid
subnetid
subnet mask
  • To be precise, we have netid, subnetid, hostid
  • But the (netid subnetid) is often called as
    subnetid
  • Notation for subnet mask 2 ways
  • Dotted decimal notation e.g. 255.255.224.0
  • Prefix notation e.g. /19 called slash notation
    also--19bits are subnet mask

73
Example for classful subnetting
  • Given a class B address of 132.241.0.0/16
  • Lets say we decided to divide using next 8 bits

0
241
132
0
Then the subnet mask should be
255
0
255
255
hostid
subnetid
subnet mask
132.241.0.0/24
In prefix notation ?
74
Example for classful subnetting, contd
  • Restrictions legacy routers following rfc 950,
    do not recognize all zeros and all ones subnet
    ? 132.241.0.0/24 132.241.255.0/24 --wasted
    space
  • In rfc 1878, all zeros and all ones subnets are
    allowed by default
  • Can be turned off by no ip subnet-zero command
    for CISCO routers
  • Read http//www.cisco.com/en/US/tech/tk648/tk361/
    technologies_tech_note09186a0080093f18.shtml
  • In hostid portion, all zeros and all ones are
    not allowedthey are reserved for special
    purposeall zeros represent the subnetid all
    ones represent subnet broadcast address e.g.
    132.241.0.0 is the subnetid for subnet
    132.241.0.0 and 132.241.0.255 is the broadcast
    address for the 132.241.0.0 subnetalso see slide
    4.61

75
Example for classful subnetting, contdLets
write down all the subnet addresses and host
addresses
76
Another example for classful subnettingLets
subnet a subnet Mini Lab
  • A class B subnet 132.241.0.0 was divided using 8
    bit(/24) division as previous example
  • Now, we are assigned one of the subnets
    132.241.158.0we want to subnet this subnet
  • Requirements We need at least 4 subnets and each
    subnet should accommodate at least 20 hosts

77
Subnetting of 132.241.158.0 subnet
132
158
0
241
Then the subnet mask should be ???
255
255
255
?
. . .
Choosing subnet mask Using 1 bit ( 2 ) subnets
132.241.158.0/25 132.241.158.1/25 Size of each
subnets is 128 2 (126) max Using 2 bits (4
) subnets with max size (62) Using 3 bits ( ? )
subnets with max size ( ? ) Using 4 bits ( ? )
subnets with max size ( ? ) Using 5 bits ( ? )
subnets with max size ( ? ) Using 6 bits ( ? )
subnets with max size ( ? ) Using 7 bits ( ? )
subnets with max size ( ? )
?
. . .
At least 4 subnets at least 20 hosts on each
subnet ? The choice is ?
3 bits
78
Problems with Classful addressing subnetting
  • Only 3 classes useable (A, B, C)
  • Only 3 sizes to satisfy all organizations
  • Address spaces are depletednot much
    leftespecially class B (most comfortable fit)
  • Some predictions say the address space will be
    exhaustedone predicts in 2008 and the other in
    2018to see current assignments, see
    http//bgp.potaroo.net/index-ale.html
  • In classful addressing, the assignment of class C
    addresses result in a large number of entries in
    routing table for Internet backbone routers---
    http//bgp.potaroo.net/

79
IP adddress assignmentFrom http//bgp.potaroo.ne
t/ipv4-stats/allocated-all.html
80
Routing table size of Internet backbone routers
81
Solutions for IPv4 address depletion
  • Short term (interim) solutions
  • CIDR(Classless InterDomain Routing)by not
    sticking to 3 classes (A,B,C) and their fixed
    sizes, we can accommodate better fittings to
    different size organizations a.b.c.d/x
  • NAT(Network Address Translation) Small block of
    addresses can be timeshared by large number of
    connections
  • VLSM(Variable Length Subnet Mask) Allows
    intranets use variable sizes for distributing
    address spaces(rather than the fixed size
    divisions we saw in the classful subnetting
    examples)
  • Long term solution IPv6 (128 bit IP address)

82
IP Addressing
IPv432bits
IPv6128 bits
When?
Huge address space More streamlined for
efficiency More Auto-configuration Accommodates
QOS
  • CIDR
  • VLSM
  • NAT

Classful Addressing
1992
  • Inefficient division into 5 classes
  • A, B, C, D, E
  • Address space running out

interim solutions
83
CIDR Motivation
  • Observation Many organizations need larger
    address than one class C(254), but less than 1000
    (ltlt class B)they need multiple class C addresses
    but not class B(remember class B space is
    depleted)
  • Assigning multiple class C addresses as a
    block(aggregation) helps to reduce the effects of
    the explosion of Internet Backbone routers
  • Therefore, eliminate the restriction of classes!
  • RFC 1517, 1518, 1519, 1817

84
IP addressing CIDR
  • CIDR Classless InterDomain Routing
  • Around 1993, CIDR replaced Classful addressing
  • CIDR is principally a bitwise, prefix-based
    standard for the interpretation of IP
    addresses.--wikipedia
  • IP address space can have many different
    sizesnot only 3 sizes!
  • Uses address format a.b.c.d/x, where x is bits
    in subnet portion of addressprefix notation
  • Class has no meaning!

host part
subnet part
11001000 00010111 00010000 00000000
Is 200.23.17.0/23 possible?
200.23.16.0/23
host part
subnet part
11001000 00010111 00010010 00000000
200.23.18.0/23
85
Commonly used CIDR prefixes
86
IP addressing CIDR
  • CIDR is also called as supernetting since we
    aggregate classful addressesmostly class B and
    class C addresses
  • Example
  • Lets say we have the following 4 class C
    addresses
  • 200.168.4.0 11001000 10101000 00000100 00000000
  • 200.168.5.0 11001000 10101000 00000101 00000000
  • 200.168.6.0 11001000 10101000 00000110 00000000
  • 200.168.7.0 11001000 10101000 00000111 00000000
  • With 255.255.255.0 as subnet mask prefix ?
  • Lets compare with CIDR address of
  • 200.168.4.0/22
  • What is the difference?
  • List Class C address blocks given 200.168.8.0/21

87
IP addresses how to get one?
  • Q How does a host get IP address?
  • Static addressing hand-coded by system admin in
    a file
  • Wintel control-panel-gtnetwork-gtconfiguration-gttcp
    /ip-gtproperties
  • UNIX /etc/rc.config
  • Dynamic addressing DHCP Dynamic Host
    Configuration Protocol dynamically get address
    from as a DHCP server
  • plug-and-play
  • (more in next chapter)

88
IP addresses how to get one? Using CIDR
  • Q How does a network get subnet part of IP addr?
  • A gets allocated portion of its provider ISPs
    address space

ISP's block 11001000 00010111 00010000
00000000 200.23.16.0/20 Organization 0
11001000 00010111 00010000 00000000
200.23.16.0/23 Organization 1 11001000
00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100
00000000 200.23.20.0/23 ...
..
. . Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
89
Hierarchical addressing route aggregationusing
CIDR
Hierarchical addressing allows efficient
advertisement of routing information
Organization 0
Organization 1
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16
ISPs-R-Us
90
route aggregation using CIDRReduces size of
routing tables for Internet Backbone routers
Growth of BGP table 1994 to present
91
Hierarchical addressing more specific routes
ISPs-R-Us has a more specific route to
Organization 1 This may happen when Organization
1 used to subscribe to Fly-By-Night-ISP but now
moved to ISPs-R-Us. Organization 1 wants to keep
200.23.18.0/23! this is one possible
scenario In our text, you see another possible
scenariopage 337
Organization 0
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16 or 200.23.18.0/23
ISPs-R-Us
Organization 1
199.31.0.0/16
92
IP addressing the last word...
  • Q How does an ISP get a block of addresses?
  • A From ICANN Internet Corporation for Assigned
  • Names and Numbers
  • allocates addresses
  • manages DNS
  • assigns domain names, resolves disputes

Also see http//www.pch.net/resources/data/WoN/it
u-seminar-20040211-1.ppt480,1,Internet
Addressing and the RIR system
93
Solutions to IP address depletion
  • Short term (interim) solutions
  • CIDR
  • NAT(Network Address Translation)
  • VLSM(Variable Length Subnet Mask)
  • Long term solution IPv6 (128 bits)

94
NAT Network Address Translation
Internet
local network (e.g., home network) 10.0.0/24
10.0.0.1
10.0.0.4
10.0.0.2
138.76.29.7
NAT table here
10.0.0.3
Intranet Datagrams use 10.0.0/24 address Internet
Datagrams are sent to the router ( 10.0.0.4 )
All datagrams leaving local network have same
single source NAT IP address 138.76.29.7, But
different source port numbers
95
NAT Network Address Translation
  • Motivation local network uses just one IP
    address as far as outside world is concerned
  • range of addresses not needed from ISP just one
    IP address for all devices
  • can change addresses of devices in local network
    without notifying outside world
  • can change ISP without changing addresses of
    devices in local network
  • devices inside local net not explicitly
    addressable/ visible by outside world (a security
    plus).
  • popularly used by home networks connections to
    Internet

96
NAT Network Address Translation
  • Implementation NAT router must
  • outgoing datagrams replace (source IP address,
    port ) of every outgoing datagram to (NAT IP
    address, new port )
  • . . . remote clients/servers will respond using
    (NAT IP address, new port ) as destination
    addr.
  • remember (in NAT translation table) every (source
    IP address, port ) to (NAT IP address, new port
    ) translation pair
  • incoming datagrams replace (NAT IP address, new
    port ) in dest fields of every incoming datagram
    with corresponding (source IP address, port )
    stored in NAT table

97
NAT Network Address Translation
NAT translation table WAN side addr LAN
side addr
138.76.29.7, 5001 10.0.0.1, 3345

10.0.0.1
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
4 NAT router changes datagram dest addr
from 138.76.29.7, 5001 to 10.0.0.1, 3345
3 Reply arrives dest. address 138.76.29.7,
5001
98
NAT Network Address Translation
  • 16-bit port-number field
  • 60,000 simultaneous connections with a single
    LAN-side address! Plenty!
  • NAT is controversial
  • routers should only process up to layer 3
  • violates end-to-end argument
  • NAT possibility must be taken into account by app
    designers, eg, P2P applications
  • address shortage should instead be solved by IPv6

99
NAT Another form
  • The NAT described so far is also called as NAPT
    (Network Address Port Translation)
  • Another form is Basic NAT or Static
    NATinvolves only IP address translation--not
    ports
  • Router is configured with a pool of IP addresses
  • When a computer having private IP address wants
    to connect to Internet, router assigns an IP
    address from the pool until disconnected
  • Example usage An ISP with 1000 users and only
    maximum 20 are on-line at a time. ISP uses NAT
    with a class C address(254 IP addresses) to serve
    all users

100
NAT Another form
Notice that only IP addresses are changed by
router
NAT translation table WAN side addr LAN
side addr
138.76.29.7 10.0.0.1

10.0.0.1
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
4 NAT router changes datagram dest addr
from 138.76.29.7 to 10.0.0.1 Only IP addresses
are changed!
3 Reply arrives dest. address 138.76.29.7,
5001
101
Solutions to IP address depletion
  • Short term (interim) solutions
  • CIDR
  • NAT(Network Address Translation)
  • VLSM(Variable Length Subnet Mask)
  • Long term solution IPv6 (128 bits)

102
VLSM(Variable Length Subnet Mask) rfc 1817
  • Classful subnetting divides a network into equal
    sizes at a given levelone size fits all
  • With CIDR, the VLSM was introducedwe can divide
    a network into different sizes at a given
    levelmore flexible save addresses

1st division
2nd
3rd
103
VLSM an example
  • Uses all 0s all 1s subnets to fully utilze
    address space
  • A company is assigned a class C address space and
    needs the following

X.Y.Z.0/26 62 hosts
X.Y.Z.64/26 62 hosts
1st subnet mask 255.255.255.192 /26
. . .
X.Y.Z.144/28 14 hosts
X.Y.Z.128/28 14 hosts
X.Y.Z.176/28 14 hosts
2nd subnet mask 255.255.255.240 /28
. . .
X.Y.Z.192/30 2 hosts
X.Y.Z.196/30 2 hosts
X.Y.Z.252/30 2 hosts
3rd subnet mask 255.255.255.252 /30
For another example, visit here
104
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

105
ICMP Internet Control Message Protocol
  • used by hosts routers to communicate
    network-level control information
  • error reporting unreachable host, network, port,
    protocol
  • echo request/reply (used by ping)
  • network-layer but above IP
  • ICMP msgs carried in IP datagramshorizontal
    layering
  • ICMP message type, code plus first 8 bytes of IP
    datagram causing error

Type Code description 0 0 echo
reply (ping) 3 0 dest. network
unreachable 3 1 dest host
unreachable 3 2 dest protocol
unreachable 3 3 dest port
unreachable 3 6 dest network
unknown 3 7 dest host unknown 4
0 source quench (congestion
control - not used) 8 0
echo request (ping) 9 0 route
advertisement 10 0 router
discovery 11 0 TTL expired 12 0
bad IP header
106
ICMP
ICMP uses the service of IP to send a control
message
107
Traceroute and ICMP an example usage of ICMP
  • Source sends series of UDP segments (in Unix) to
    dest
  • First has TTL 1
  • Second has TTL2, etc.
  • Unlikely port number(33434 and up) in unix
    implementations
  • Windows systems use ICMP Echo request not UDP
  • When nth datagram arrives to nth router
  • Router discards datagram
  • And sends to source an ICMP message (type 11,
    code 0)
  • Message includes name of router IP address
  • When ICMP message arrives, source calculates RTT
  • Traceroute does this 3 times
  • Stopping criterion
  • UDP segment eventually arrives at destination
    host
  • Destination returns ICMP host unreachable
    packet (type 3, code 3)
  • When source gets this ICMP, stops.

http//kb.pert.switch.ch/cgi-bin/twiki/view/PERTKB
/VanJacobsonTraceroute
108
Result of tracert www.csuchico.edu on a Windows
host
C\Documents and Settings\Administratorgt tracert
www.csuchico.edu Tracing route to
calypso.csuchico.edu 132.241.82.62 over a
maximum of 30 hops 1 6 ms 5 ms
11 ms 208-53-80-5.chico.ca.digitalpath.net
208.53.80.5 2 7 ms 4 ms 4 ms
198-69-248-1.chico.ca.digitalpath.net
198.69.248.1 3 9 ms 8 ms 8 ms
sl-gw26-stk-5-0-TS9.sprintlink.net
144.232.195.169 4 8 ms 10 ms 10 ms
sl-bb20-stk-8-0.sprintlink.net 144.232.4.114
5 13 ms 10 ms 9 ms sl-bb20-sj-9-0.sprin
tlink.net 144.232.20.99 6 11 ms 9 ms
10 ms sl-bb21-sj-15-0.sprintlink.net
144.232.3.158 7 10 ms 12 ms 10 ms
sl-st20-sj-13-0.sprintlink.net 144.232.9.58 8
118 ms 11 ms 14 ms so-7-1.car4.SanJose1.L
evel3.net 209.245.146.245 9 13 ms 10 ms
12 ms ge-11-0.ipcolo3.SanJose1.Level3.net
4.68.123.43 10 12 ms 14 ms 10 ms
4.79.44.6 11 14 ms 18 ms 14 ms
dc-svl-dc1--isp-1-ge.cenic.net 137.164.22.58
12 21 ms 22 ms 14 ms dc-oak-dc1--svl-dc1
-10ge.cenic.net 137.164.22.31 13 23 ms
22 ms 24 ms dc-csac-dc1--oak-dc1-ge.cenic.net
137.164.22.111 14 26 ms 24 ms 24 ms
dc-cor-dc1--sac-dc1-ge.cenic.net
137.164.22.153 15 31 ms 26 ms 25 ms
dc-cor-dc2--cor-dc1-df-iconn-1.cenic.net
137.164.22.199 16 29 ms 27 ms 26 ms
dc-csuchico-egm--cor-dc2.cenic.net
137.164.41.26 17 32 ms 29 ms 35 ms
chi-mocha-ge0-0-132.net.CSUChico.EDU
132.241.95.74 18 40 ms 46 ms 46 ms
calypso.CSUChico.EDU 132.241.82.62 Trace
complete.
Round trip time of 3 probes
109
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

110
IPv6 (previously known as IPng (IP next
generation))RFC 2460
  • Initial motivation 32-bit address space soon to
    be completely allocated.
  • Additional motivation
  • header format helps speed processing/forwarding
  • header changes to facilitate QoS
  • IPv6 datagram format
  • fixed-length 40 byte header
  • no fragmentation allowed

111
IPv6 Header (Cont)
Priority identify priority among datagrams in
flow Flow Label identify datagrams in same
flow. (concept offlow
not well defined). Next header identify upper
layer protocol for data
With 128 bits, you can assign over 3.7x1021
addresses per square inch of the earth's surface.
112
Other Changes from IPv4
  • Checksum removed entirely to reduce processing
    time at each hop
  • Options allowed, but outside of header,
    indicated by Next Header field
  • ICMPv6 new version of ICMP
  • additional message types, e.g. Packet Too Big
  • multicast group management functions

113
Differences Between IPv4 and IPv6
114
Transition From IPv4 To IPv6
  • Not all routers can be upgraded simultaneous
  • no flag days feasible
  • How will the network operate with mixed IPv4 and
    IPv6 routers?
  • Two main approaches
  • Dual Stack A host or router implements both IPv4
    and IPv6.
  • Tunneling IPv6 carried as payload in IPv4
    datagram among IPv4 routers

115
Tunneling
116
Tunneling
tunnel
Logical view
IPv6
IPv6
IPv6
IPv6
Physical view
IPv6
IPv6
IPv6
IPv6
IPv4
IPv4
A-to-B IPv6
E-to-F IPv6
B-to-C IPv6 inside IPv4
B-to-C IPv6 inside IPv4
117
Tunneling another view
From http//www.cisco.com/univercd/cc/td/doc/produ
ct/software/ios123/123cgcr/ipv6_c/sa_tunv6.htm
118
IPv6 Deployment?
Not likely to happen in the foreseeable future
To see the current deployment, visit
http//bgp.potaroo.net/index-v6.html
119
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

120
Interplay between routing, forwarding
Difference?
121
Graph abstractionrouting can be analyzed as a
graph problem
edges
nodes
Graph G (N,E) N set of routers u, v, w,
x, y, z E set of links (u,v), (u,x),
(v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)
Remark Graph abstraction is useful in other
network contexts Example P2P, where N is set of
peers and E is set of TCP connections
122
Graph abstraction costs
  • c(x,x) cost of link (x,x)
  • - e.g., c(w,z) 5
  • cost could always be set to 1(all links has same
    costhop count), or
  • inversely related to bandwidth,
  • or inversely related to
  • Congestion, or

Cost of path (x1, x2, x3,, xp) c(x1,x2)
c(x2,x3) c(xp-1,xp)
Question Whats the least-cost path between u
and z ?
Routing algorithm algorithm that finds
least-cost path
123
Routing algorithm design
  • Assuming that we can decide the cost of the links
  • How would routers learn about the weights of the
    links other than the directly connected links?
  • How often routers advertise the weights?
  • The scope of advertisement?

124
Routing Algorithm classification
  • Global or decentralized information?
  • Global
  • all routers have complete topology, link cost
    info
  • link state algorithms
  • Decentralized
  • router knows physically-connected neighbors, link
    costs to neighbors
  • iterative process of computation, exchange of
    info with neighbors
  • distance vector algorithms
  • Static or dynamic?
  • Static
  • routes change slowly over time
  • Dynamic
  • routes change more quickly
  • periodic update
  • in response to link cost changes

125
IGP(Intra AS) vs EGP(Inter AS)
To see AS numbers, visit here
AS Autonomous System
A group of networks and routers under the
authority of a single administration
126
AS numbers from http//bgp.potaroo.net/cidr/autnum
s.html
AS3895 AMEDD-EUR - DoD Network Information Center
AS3896 AMEDD-EUR - DoD Network Information Center
AS3897 AMEDD-EUR - DoD Network Information Center
AS3898 UCSF-HISD - University of Calif. S.F. -
Hospital Info Sys AS3899 CHICO-NET - California
State University, Chico AS3900 TEXASNET-ASN -
Yokubaitis Holding Corporation AS3901 ARRAKIS -
Higher Technology Services AS3902 GLAXOCA-1 -
Glaxo Canada Inc. AS3903 NAG-AS - Network
Ananlysis Group AS3904 ASTHOUGHTPRT -
ThoughtPort inc.
127
Popular Routing Algorithms
128
Chapter 4 Network Layer
  • 4. 1 Introduction
  • 4.2 Virtual circuit and datagram networks
  • 4.3 Whats inside a router
  • 4.4 IP Internet Protocol
  • Datagram format
  • IPv4 addressing
  • ICMP
  • IPv6
  • 4.5 Routing algorithms
  • Link state
  • Distance Vector
  • Hierarchical routing
  • 4.6 Routing in the Internet
  • RIP
  • OSPF
  • BGP
  • 4.7 Broadcast and multicast routing

129
Routing Algorithms
  • Interior Routing(within one AS) vs Exterior
    Routing (between AS's)
  • Current Routing AlgorithmsTwo common Routing
    Algorithms(Both are adaptive(dynamic) algorithms)
  • (a) "Link State Routing"-Each router shares its
Write a Comment
User Comments (0)
About PowerShow.com