Download ppt - DePaul University

Document related concepts

Net bias wikipedia , lookup

Distributed firewall wikipedia , lookup

Deep packet inspection wikipedia , lookup

IEEE 1355 wikipedia , lookup

Peering wikipedia , lookup

AppleTalk wikipedia , lookup

Network tap wikipedia , lookup

Internet protocol suite wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

Computer network wikipedia , lookup

Airborne Networking wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Routing wikipedia , lookup

Transcript
Computer Networks
Network Layer
Autumn 2000
John Kristoff
1
Where are we?
Autumn 2000
John Kristoff
2
Will Layer 2 Networking
Suffice?
Autumn 2000
John Kristoff
3
Motivation
Ñ Connect various link technologies to form a larger
internetwork
Ñ
Ñ
Ñ
Ñ
Ñ
Universal addressing scheme required
General purpose use
Hides underlying technologies from end user
Facilitate communicate between autonomous domains
Able to move packets between any host on the
internetwork
Autumn 2000
John Kristoff
4
Connecting Heterogeneous
Networks
Ñ Computer System used
ÑSpecial purpose
ÑDedicated
ÑWorks with LAN or WAN technologies
ÑKnown as
Ñrouter
Ñgateway
Autumn 2000
John Kristoff
5
Illustration of a Router
Ñ Cloud denotes an arbitrary network
Ñ One interface per network
Autumn 2000
John Kristoff
6
Important Idea
A router can interconnect networks that use
different technologies, including different
media and media access techniques,
physical addressing schemes or frame
formats.
Autumn 2000
John Kristoff
7
The Internet Concept
Autumn 2000
John Kristoff
8
Key Functions of the
Network Layer
Ñ Global Addressing
Ñ Fragmentation
Ñ Routing
We’ll be primarily concerned with addressing and routing
Autumn 2000
John Kristoff
9
Example Network Layer:
Internet Protocol (IP)
Ñ Standardized by IETF as RFC 791
Ñ Most popular Layer 3 protocol
Ñ Core protocol used on the public Internet
Ñ Connectionless protocol
Ñ datagrams contain identity of the destination
Ñeach datagram sent/handled independently
Ñ Of utmost importance for this class!
Autumn 2000
John Kristoff
10
IP Addressing
Ñ Provides an abstraction
Ñ Independent of hardware (MAC)
addressing
Ñ Used by
Ñhigher layer protocols
ÑApplications
Good IP addressing tutorial: http://www.3com.com/nsc/501302.html
Autumn 2000
John Kristoff
11
IP Address
Ñ Virtual
Ñonly understood by software
Ñ Used for all communication across an
internetwork
Ñ 32-bit integer
Ñ Unique value for each host/interface
Autumn 2000
John Kristoff
12
IP Address Assignment
An IP address does not identify a specific
computer. Instead, each IP address
identifies a connection between a
computer and a network. A computer
with multiple network connections (e.g., a
router) must be assigned one IP address
for each connection.
Autumn 2000
John Kristoff
13
IP Address Details
Ñ Divided into two parts
Ñprefix identifies the network
Ñsuffix identifies the host/interface
Ñ Global authority assigns unique prefix for
the network
Ñ Local administrator assigns unique suffix
for the host/interface
Autumn 2000
John Kristoff
14
Class of IP Addresses
(Historical)
Ñ Initial bits determined the class
Ñ The class determines the boundary between prefix and suffix
Autumn 2000
John Kristoff
15
Dotted Decimal Notation
Ñ Shorthand for IP addresses
Ñ Allows humans to avoid binary
Ñ Represents each octet in decimal
separated by dots
Ñ NOT the same as names like
www.depaul.edu
Autumn 2000
John Kristoff
16
Examples of Dotted
Decimal Notation
Ñ Four decimal values per 32-bit address
Ñ Each decimal number
Ñ represents eight bits
Ñ is between 0 and 255 inclusive
Autumn 2000
John Kristoff
17
Class Hierarchy and
Network Size (Historical)
Ñ
Maximum size determined by class of address
Ñ Class A large
Ñ Class B medium
Ñ Class C small
Autumn 2000
John Kristoff
18
Addressing Example
Autumn 2000
John Kristoff
19
Illustration of Router
Addresses
Ñ Address prefix identifies the network
Ñ Need one address per router connection
Autumn 2000
John Kristoff
20
Special Addresses
Ñ Network Address not used in packets
Ñ Loopback addresses never leave the local computer
Autumn 2000
John Kristoff
21
Getting IP Addresses
Ñ IANA has global authority for allocation
ÑRegional registries: ARIN, RIPE, APNIC
Ñ RFC 1918 defines private address space
ÑNOT globally unique
Ñ10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
Ñ End users obtain address space from their
Internet Service Provider (ISP)
Autumn 2000
John Kristoff
22
IP Addressing: Problems
with Classes
Ñ Internet growth
Ñ Routing table size
Ñ Exhaustion of addresses
Ñ Administration overhead
Ñ Misappropriation of addresses
Autumn 2000
John Kristoff
23
IP Addressing: Solutions
Ñ Subnetting
Ñ Supernetting
Ñ Classless InterDomain Routing (CIDR)
Ñ Variable Length Subnet Mask (VLSM)
Autumn 2000
John Kristoff
24
Subnetting
Ñ Split the suffix into a local network portion and a smaller
host id portion
Autumn 2000
John Kristoff
25
Subnet Masks
Ñ Cannot determine prefix on first few bits
Ñ Need a 'bit mask' that specifies prefix/suffix
Ñ Dotted decimal notation used, but...
Ñ I told you binary was important!
Ñ Examples:
Ñ Network: 140.192.9.0 Subnet mask: 255.255.255.0
Ñ Network: 140.192.9.0 Subnet mask: 255.255.255.128
Ñ Network and mask: 140.192.9.0/24
Autumn 2000
John Kristoff
26
More Subnet Examples
Ñ 63.85.18.5/22 - What is the network?
Ñ 32.152.6.1/26 - How many hosts possible?
Ñ 219.52.33.8/20 - What is the directed
broadcast address?
Ñ How might you allocate a 10.5.0.0/16 block
for an organization with 4 offices of 500
users each?
Autumn 2000
John Kristoff
27
Supernetting
Ñ Combine multiple smaller address classes
into a larger block
Ñ Class B was too big
Ñ Class C was too small
Ñ Combine contiguous Class C addresses
Ñ e.g. 199.242.64.0 to 199.242.67.255
Autumn 2000
John Kristoff
28
Classless InterDomain
Routing (CIDR)
Ñ Employ supernetting style information in
IP routers
Ñ Advertise smaller CIDR blocks
Ñ Decreases the routing table size
Advertise 199.242.64.0/22 instead of 199.242.64.0,199.242.65.0,
199.242.66.0 and 199.242.67.0
The CIDR Report: http://www.employees.org/~tbates/cidr-report.html
Autumn 2000
John Kristoff
29
Variable Length Subnet
Masks (VLSM)
Ñ Ability to use multiple subnet sizes in a single
autonomous system
Ñ Allows more efficient use of addresses
Ñ Routers must support subnets masks
Ñ e.g. RIPv1 did not support this!
Ñ For example:
Ñ May use /24 in most places, but may have a small office with only
10 users! May want to use a /28 for that network.
Autumn 2000
John Kristoff
30
IP Packet (datagram)
Format
Autumn 2000
John Kristoff
31
IP Datagrams
Ñ Can be delayed
Ñ Duplicated
Ñ Delivered out of order
Ñ Lost
Ñ Can change routes from packet to packet
Ñ Are connectionless
Autumn 2000
John Kristoff
32
Address Resolution
Protocol (ARP)
Ñ Resolves IP address to Layer 2 (MAC)
address
Ñ Node sends MAC broadcast looking for another node
Ñ IP src: 140.192.23.1 MAC src: 0x00:80:05:1A:F0
Ñ IP dst: 140.192.23.23 MAC dst: 0xFF:FF:FF:FF:FF
Ñ Node with that IP dst address replies with its MAC
Ñ 140.192.23.23 replies with 0x00:60:0A:34:AA:3C
Ñ ARP Table: contains records of learned
relationships.
Autumn 2000
John Kristoff
33
Configuration Protocol
(DHCP)
Ñ Standardized in RFC 1531
Ñ Allows hosts to obtain IP address
information upon startup from a server
Ñ Eliminates cumbersome manual
configuration
Ñ Grants IP addresses based on a
predefined "lease" period
Autumn 2000
John Kristoff
34
IP Routing
Ñ Performed by routers
Ñ Table-driven
Ñ Forwarding on a hop-by-hop basis
Ñ Destination address used for route
determination
Autumn 2000
John Kristoff
35
Example IP Routing Table
Ñ Table (b) is for center router in (a)
Autumn 2000
John Kristoff
36
Routing Table Size
Since each destination in a routing table
corresponds to a network, the number of
entries in a routing table is proportional to
the number of networks in the
internetwork. Caveat: you can use a
"default" route to forward to when route
is unknown or when no route specific
information is available.
Autumn 2000
John Kristoff
37
Routing/Forwarding
Overview
Ñ Given a datagram
Ñ Extract destination address field, D
Ñ Look up D in the routing table
Ñ Find next hop address, N
Ñ Send datagram to N
Autumn 2000
John Kristoff
38
Key Concept
The destination address in a datagram
header always refers to the ultimate
destination. When a router forwards the
datagram to another router, the address
of the next hop does not appear in the
datagram header.
Autumn 2000
John Kristoff
39
Routing/Forwarding
Overview
Ñ Strip off layer 2 information
Ñ Extract destination IP address field
Ñ Look up IP address in the routing table
Ñ Find next hop address to forward to
Ñ Send datagram to the next hop
Ñ Add on necessary layer 2 information
Autumn 2000
John Kristoff
40
Routing Protocol
Requirements
Ñ Efficient routing table size
Ñ Efficient routing control messages
Ñ Robustness and reliability
Ñprevent loops
Ñavoid black holes
Ñ reconvergence time is short
Autumn 2000
John Kristoff
41
Source of Route Table
Information
Ñ Manual
ÑTable created by hand
ÑUseful in small networks
ÑUseful if routes never change
Ñ Automatic
Ñsoftware creates/updates tables
ÑNeeded in large networks
ÑChanges routes when failures occur
Autumn 2000
John Kristoff
42
Compute Shortest/Best
Path
Ñ Possible metric
Ñ geographic distance
Ñ economic cost
Ñ capacity
Autumn 2000
John Kristoff
43
Algorithms for Computing
Shortest Path
Ñ Distance Vector
ÑExchange routing tables with neighboring
routers
Ñe.g., RIP, RIPv2
Ñ Link State
ÑRouters exchange link status information
Ñe.g., OSPF, IS-IS
Autumn 2000
John Kristoff
44
Distance Vector
Ñ Routers periodically advertise and learn
about IP networks
Ñ Cost of the route is based on hops to the
network (number of routers to pass)
Ñ Recalculation occurs when links fail
Autumn 2000
John Kristoff
45
Count to Infinity Problem
Ñ What happens when link 1<->5 goes down?
Ñ Does 5 think it can get to 1 through 2?
Autumn 2000
John Kristoff
46
Solving the Count to
Infinity Problem
Ñ Hold down
Ñ Wait for a period of time before switching paths. Advertise
route cost as infinity. Based on timers.
Ñ Report the entire path
Ñ Guarantees no loops, but expensive.
Ñ Split horizon
Ñ Do not advertise routes to neighbors if the route was received
from that neighbor. Not foolproof.
Autumn 2000
John Kristoff
47
Other Distance Vector
Improvements
Ñ Triggered updates
Ñ Advertise changes as soon as you learn of them. May help
convergence time. May create routing instability for flapping
routes.
Ñ Poison reverse
Ñ Used with split horizon. Report infinity rather than nothing at
all.
Ñ Diffusing Update ALgorithm (DUAL)
Ñ Somewhat like hold down, but routers are alerted of broken
paths. Complex. Not popular.
Autumn 2000
John Kristoff
48
Example Distance Vector
Protocol: RIP
Ñ Standardized in RFC 1058 and 2453
Ñ An interior gateway protocol (IGP)
Ñ Simple
Ñ RIPv2 includes subnet mask in updates
Ñ Hop count based (> 15 = unreachable)
Ñ Widely used in small to medium sized
organizations
Autumn 2000
John Kristoff
49
Link State
Ñ Routers distribute link cost and topology
information to all other routers in its area.
Ñ All routers have complete information
about the network.
Ñ Each router computes its own optimal
path to destinations.
Ñ Ensures loop free environments.
Autumn 2000
John Kristoff
50
Link State Procedure
Ñ
Ñ
Ñ
Ñ
Each router is responsible for meeting its
neighbors and learning their names.
Each router advertises LSPs which contain costs
to its neighbors.
Most current LSPs are stored by all routers.
Each router now computes routes.
Autumn 2000
John Kristoff
51
Dijkstra Algorithm:
Databases
Ñ
Link State Database
Ñ contains latest LSPs from all other routers
Ñ
PATH (permanent) Database
Ñ Consists of ID, path cost and forwarding direction
Ñ
TENT (tentative/temporary) Database
Ñ Consists of ID, path cost and forwarding direction
Ñ
Forwarding Database
Ñ Contains ID and forwarding direction
Autumn 2000
John Kristoff
52
Dijkstra Algorithm:
Procedure
Ñ
Ñ
Ñ
1. Each router starts with itself as root of the
tree by putting its ID and 0 cost and 0
forwarding direction in PATH
2. For each node placed in PATH, examine its
LSP and place those neighbors in TENT if not
already in PATH or TENT
3. If TENT is empty, terminate, otherwise find
the ID in TENT with the lowest cost and move it
to PATH
Autumn 2000
John Kristoff
53
Example Link State
Protocol: Open Shortest
Path First (OSPF)
Ñ Standardized in RFC 2328
Ñ An interior gateway protocol (IGP)
Ñ Used in medium to large organizations
Ñ Supports internal/external routes
Ñ Supports TOS based routing, but never
implemented in practice
Ñ Two-tier hierarchy for scalability
Autumn 2000
John Kristoff
54
Network Layer: Final
Notes
Ñ Basic IP requirements on an end host
Ñ IP address, mask, gateway, DNS
Ñ BOOTP
Ñ ICMP
Ñ BGP
Ñ IPX
Ñ AppleTalk
Ñ CLNP
Autumn 2000
John Kristoff
55