EEC-484/584 Computer Networks - PowerPoint PPT Presentation


PPT – EEC-484/584 Computer Networks PowerPoint presentation | free to download - id: 54654f-YWMxZ


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

EEC-484/584 Computer Networks


Title: EEC 682/782 Author: Wenbing Zhao Last modified by: Wenbing Zhao Created Date: 5/10/2000 9:19:33 AM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 33
Provided by: Wenbin9


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

Title: EEC-484/584 Computer Networks

EEC-484/584Computer Networks
  • Lecture 13
  • Wenbing Zhao
  • (Part of the slides are based on Drs. Kurose
    Rosss slides for their Computer Networking book,
    and on materials supplied by Dr. Louise Moser at
    UCSB and Prentice-Hall)

  • Classful IP address allocation
  • CIDR
  • Network address translation
  • ICMP
  • IPv6

IP Addresses
  • Classful addressing - every host and router has
    unique IP address consisting of network number
    and host number (2 level hierarchy)
  • E.g., Class A up to 27 128 networks with up to
    224 16,777,216 hosts each
  • Network numbers are managed by ICANN (Internet
    Corporation for Assigned Names and numbers) to
    avoid conflicts
  • No longer used, but references to it are still

IP Addresses
IP Addresses
  • IP address are usually written in dotted decimal
  • Each of the 4 bytes is written in decimal, from 0
    to 255
  • Lowest IP, highest
  • Special IP addresses

  • Allow a network to be split into several parts
    for internal use, but to act as a single network
    to outside world
  • Take some bits away from host numbers
  • Subnet mask needed by the main router.
    Indicates split between network subnet number
    and host
  • Write the address and the mask as a binary number
  • If mask bit is 1, then corresponding bit of
    address matters

  • E.g., A class B network can be subnetted into 64
  • Originally 16 bits for host info. Now, 6 bits
    used for subnet and 10 bits for host numbers
  • Subnet mask can be written as or

Subnet 1 10000010 00110010 000001 00 00000001 Subnet 2 10000010 00110010 000010 00
00000001 Subnet 3 10000010
00110010 000011 00 00000001
Routing without Subnets
  • Each router has a table listing two types of
  • (network, 0) tells how to get to distant
  • (this-network, host) tells how to get to a local
  • When an IP packet arrives, its destination
    address is looked up in the routing table
  • If the packet is for a distant network, it is
    forwarded to the next router on the interface
    given in the table
  • If it is for a local host, it is sent directly to
    the destination
  • If the network is not present, the packet is
    forwarded to a default router with more extensive

Routing with Subnets
  • Three-level hierarchy entries in a routing table
    take the form
  • (network, 0)
  • (this-network, subnet, 0) and
  • (this-network, this-subnet, host)
  • A router on subnet k knows how to get to all the
    other subnets and also how to get to all the
    hosts on subnet k
  • If a packet is for this network
  • Do a Boolean AND of the destination address with
    the networks subnet mask to get rid of the host
  • Look up the resulting address in the routing table

Routing with Subnets
  • For example, a packet address to, the
    subnet mask is, AND them, we get and this address is looked up in the
    routing table to find out which output line to

Subnet base address
10000010 00110010 00000100 00000000 Output to
line A 10000010 00110010 00001000 00000000
Output to line B 10000010 00110010 00001100
00000000 Output to line C
10000010 00110010 00001111 00000110
(Destination IP Addr
11111111 11111111 11111100 00000000 (Subnet
10000010 00110010 00001100 00000000 (After AND
Problems with Classful Addressing
  • A class is obviously too large for any
  • C class is too small (only 256 addresses
  • B class is requested and allocated, but it is
    still too large for most organizations
  • ? Many IP addresses are wasted
  • ? Shortage of IP addresses

CIDR Classless InterDomain Routing
  • For the remaining IP addresses, classless
    allocation is used
  • Allocate remaining IP addresses in variable-sized
    blocks (must be power of 2), without regard to
    the classes
  • The starting address must fall on the boundary of
    the block size
  • E.g., if a site needs, say, 2000 addresses, it is
    given a block of 2048 addresses on a 2048-byte

Classless Allocation Example
  • Routing tables are updated with the three
    assigned entries. Each entry contains a base
    address and a subnet mask (in short base
    address/subnet mask)

C 11000010 00011000 00000000 00000000 11111111
11111111 11111000 00000000 E 11000010 00011000
00001000 00000000 11111111 11111111 11111100
00000000 O 11000010 00011000 00010000 00000000
11111111 11111111 11110000 00000000
Base address
Subnet mask
Classless InterDomain Routing
  • Each routing table is extended by giving it a
    32-bit mask
  • The routing table contains entries of (IP
    address, subnet mask, outgoing line) triples
  • When a packet comes in, its destination IP
    address is first extracted
  • Then, the routing table is scanned entry by
    entry, masking the destination address and
    comparing it to the table entry looking for a
  • If multiple entries (with different subnet mask
    lengths) match, the longest mask is used
  • E.g., if there is a match for a /20 mask and a
    /24 mask, the /24 mask is used

Classless InterDomain Routing Example
  • If a packet is addressed to, in
    binary 11000010 00011000 00010001 00000100
  • First it is Boolean ANDed with the Cambridge mask
    to get 11000010 00011000 00010000 00000000
  • This value does not match the Cambridge base
    address, so next try Edinburgh mask, to
    get11000010 00011000 00010000 00000000
  • This value still does not match, so Oxford is
    tried, yielding 11000010 00011000 00010000
  • This value matches the Oxford base. If no longer
    matches are found, the Oxford entry is used and
    the packet is sent along the line named in it

C 11000010 00011000 00000000 00000000 11111111
11111111 11111000 00000000 E 11000010 00011000
00001000 00000000 11111111 11111111 11111100
00000000 O 11000010 00011000 00010000 00000000
11111111 11111111 11110000 00000000
Base address
Subnet mask
Classless InterDomain Routing
  • Aggregate entry all three new entries can be
    combined into a single aggregate entry with a binary address and submask
    as follows11000010 00000000 00000000 00000000
    11111111 11111111 11100000 00000000
  • By aggregating the three entries, a router has
    reduced its table size by two entries
  • Aggregation is heavily used throughout the

NAT Network Address Translation
  • Another workaround for the IP addresses shortage
    problem network address translation
  • One public IP address, many private IP addresses
  • When a packet exits the private network and goes
    to the ISP, an address translation takes place
  • Three ranges of IP addresses have been declared
    as private
  • (16,777,216 hosts)
  • (1,048,576 hosts)
  • (65,536 hosts)

NAT Network Address Translation
  • Placement and operation of a NAT box

NAT What about the Incoming Traffic?
  • Solution is based on the assumption all traffic
    is TCP/UDP
  • TCP/UDP has two port fields, one for source port,
    the other for destination port, each 16 bits wide
  • The source port is used as an index to an
    internal table maintained by the NAT box
  • The internal senders private IP and original
    port info are stored in the table
  • When the reply comes back, it will carry the
    index as the destination port, the NAT box then
    translates the address back
  • For both outgoing and incoming address
    translations, the TCP/UDP and IP header checksums
    are recomputed

Drawback of NAT
  • NAT violates the architectural model of IP, which
    states that every IP address uniquely identifies
    a single machine worldwide
  • NAT box must maintain mapping info for each
    connection passing through it. This changes the
    Internet from a connectionless network to a kind
    of connection-oriented network
  • NAT violates the most fundamental rule of
    protocol layering layer k may not make any
    assumptions about what layer k1 has put into the
    payload field
  • NAT only support UDP/TCP traffic
  • NAT has problem supporting apps that include
    local IPs in payload, such as FTP and H.323
  • Each NAT box can support at most 65,536 (216)

Internet Control Message Protocol
  • ICMP messages are sent using the basic IP header
  • The first byte of the data portion of the
    datagram is a ICMP type field
  • The type field determines the format of the
    remaining data
  • Typical format type, code plus first 8 bytes of
    IP datagram causing error

Destination Unreliable Message Format
Internet Control Message Protocol
  • When something unexpected occurs in Internet, the
    event is reported by routers using ICMP
  • Principal ICMP message types

Internet Protocol Version 6
  • IPv4 current version
  • IPv5 experimental real-time stream protocol
  • IPv6
  • Longer addresses than IPv4 16 bytes
  • Fixed-length 40 byte header
  • No checksum field
  • No fragmentation (by intermediate routers)
    allowed. Only sender is allowed to fragment a
    packet, using fragment extension
  • Better support for options

The Main IPv6 Header
The Main IPv6 Header
  • Version 6
  • Priority
  • 0-7 slow down in event of congestion
  • 8-15 real-time traffic
  • Flow label allows source and destination to set
    up pseudo-connection with particular properties
    and requirements
  • Payload length (as opposed to total length in
  • Next header additional optional extension
  • Hop limit (time to live in IPv4)
  • Source/destination address 128 bits (32 bits in

IPv6 Extension Headers
IPv6 Extension Headers
IPv6 Extension Headers
  • Two types of extension header formats
  • Fixed format
  • Variable number of variable-length fields
  • Each item is encoded as a (type, length, value)
  • Type 1-byte field telling which option this is
  • Length 1-byte field telling how long the value
    is (0-255 bytes)
  • Value any info required

IPv6 Extension Headers
  • Hop-by-hop options used for info that all
    routers along the path must examine
  • One option has been defined to support datagrams
    exceeding 64K
  • Next header 1-byte field telling type of header
  • Length field 1-byte field telling how long the
    hop-by-hop header is in bytes, excluding the
    first 8 bytes, which are mandatory
  • 1-byte field indicating that this option defines
    the datagram size
  • 1-byte field telling the size is a 4-byte number
  • 4-byte field size of datagram

IPv6 Extension Headers
  • Routing option header lists one or more routers
    that must be visited on the way to destination
  • Routing type field 1-byte giving format of the
    rest of the header
  • Segments left field 1-byte keeping track of how
    many of the addresses in the list have not yet
    been visited

Exercise - CIDR
  • According to Classless InterDomain Routing, the
    remaining IP addresses are allocated in
    variable-sized blocks, without regard to the
    classes. However, the starting address must fall
    on the boundary of the block size allocated.
    Assuming that a large number of consecutive IP
    address are available starting at
    Suppose that three organizations, A, B, and C,
    request 4000, 1000, and 2000 addresses,
    respectively, and in that order. For each of
    these, give the first IP address assigned, the
    last IP address assigned, both must be in dotted
    decimal form, and the mask in the w.x.y.z/s

Exercise - CIDR
  • A router has just received the following new IP
    addresses,,, and If all of them
    use the same outgoing line, can they be
    aggregated? If so, to what? If not, why not?