Download Introduction - DePaul University

Document related concepts
no text concepts found
Transcript
Network Layer
Computer Networks
John Ourada
Spring 2000
John Kristoff
1
Where are we?
Spring 2000
John Kristoff
2
Will Layer 2 Networking
Suffice?
Spring 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
Spring 2000
John Kristoff
4
Connecting Heterogeneous
Networks
Computer System used
Special purpose
Dedicated
Works with LAN or WAN technologies
Known as
router
gateway
Spring 2000
John Kristoff
5
Illustration of a Router
Cloud denotes an arbitrary network
One interface per network
Spring 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.
Spring 2000
John Kristoff
7
The Internet Concept
Spring 2000
John Kristoff
8
Key Functions of the
Network Layer
Global Addressing
Fragmentation
Routing
We’ll be primarily concerned with addressing and routing
Spring 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!
Spring 2000
John Kristoff
10
IP Addressing
Provides an abstraction
Independent of hardware (MAC)
addressing
Used by
higher layer protocols
applications
Spring 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
Spring 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.
Spring 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
Spring 2000
John Kristoff
14
Class of IP Addresses
(Historical)
 Initial bits determined the class
 The class determines the boundary between prefix and suffix
Spring 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
Spring 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
Spring 2000
John Kristoff
17
Classes and Network Size
(Historical)
Maximum size determined by class of address
Class A large
Class B medium
Class C small
Spring 2000
John Kristoff
18
Addressing Example
Spring 2000
John Kristoff
19
Illustration of Router
Addresses
Address prefix identifies the network
Need one address per router connection
Spring 2000
John Kristoff
20
Special Addresses
 Network Address not used in packets
 Loopback addresses never leave the local computer
Spring 2000
John Kristoff
21
IP Addressing: Problems
with Classes
Internet growth
Routing table size
Exhaustion of addresses
Administration overhead
Misappropriation of addresses
Spring 2000
John Kristoff
22
IP Addressing: Solutions
Subnetting
Variable Length Subnet Mask (VLSM)
Supernetting
Classless InterDomain Routing (CIDR)
Spring 2000
John Kristoff
23
Subnetting
Split the suffix into a local network portion and a
smaller host id portion
Subnet mask becomes 255.255.255.0 for an 8bit subnet mask
Spring 2000
John Kristoff
24
Subnetting
 Subnet boundaries fall between any of the 32 bits in an IP address
 Can be complex and confusing, know binary if not not on 8-bit
boundaries
Spring 2000
John Kristoff
25
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
140.192.56.45
140
192
56
45
1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 0
0 0 1 1 1 0 0 0
0 0 1 0 1 1 0 1
Subnet
Host
Network
IP Address
255
255
255
0
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
140
1 0 0 0 1 1 0 0
192
1 1 0 0 0 0 0 0
56
0 0 1 1 1 0 0 0
0
Network Address
0 0 0 0 0 0 0 0
192
1 1 0 0 0 0 0 0
56
0 0 1 1 1 0 0 0
45
IP Address
0 0 1 0 1 1 0 1
NetMask
140.192.56.0/24
24-bit mask
8-bit subnet mask
140.192.56.45
140
1 0 0 0 1 1 0 0
Network
Subnet
Host
255
1 1 1 1 1 1 1 1
255
1 1 1 1 1 1 1 1
240
1 1 1 1 0 0 0 0
0
0 0 0 0 0 0 0 0
140
192
48
0
1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0
NetMask
Network Address
140.192.48.0/20
20-bit mask
4-bit subnet mask
Spring 2000
John Kristoff
26
27
26
25
24
23
22
21
20
128
64
32
16
8
4
2
1
140.192.138.95
140
1 0 0 0 1 1 0 0
192
1 1 0 0 0 0 0 0
138
95
255
255
240
0
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0
140
192
1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 0
IP Address
NetMask
Network Address
140.192.138.95
140
1 0 0 0 1 1 0 0
192
1 1 0 0 0 0 0 0
138
95
255
1 1 1 1 1 1 1 1
255
1 1 1 1 1 1 1 1
255
252
140
192
1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 0
Spring 2000
John Kristoff
27
Subnet Mask Bits
Bits
Combo's
Class
B
Class
C
N/A
Net's
Hosts
Hosts
Class B
Subnet Masks
Class C
Subnet Masks
2
22
4
-2 =
2
16382
62
Bits
Networks
Hosts
Bits
Networks
Hosts
3
23
8
-2 =
6
8190
30
4
14
Hosts
4094
4
14
Hosts
14
4
24
16
-2 =
14
4094
14
7
126
14
Hosts
510
2
14
2
Hosts
62
5
25
32
-2 =
30
2046
6
12
4094
14
Hosts
62
3
14
Hosts
6
26
64
-2 =
62
1022
2
6
14
Hosts
6
14
Hosts
7
27
128
-2 =
126
510
10
14
Hosts
8
28
256
-2 =
254
254
9
29
512
-2 =
510
126
10
210
1024
-2 =
1022
62
11
211
2048
-2 =
2046
30
12
212
4096
-2 =
4094
14
13
213
8192
-2 =
8190
6
14
214
16384
-2 =
16382
2
Spring 2000
John Kristoff
28
VLSM
 Variable Length Subnet Mask
 Can be complex and confusing, know binary!
 Use addresses more efficiently.
Spring 2000
John Kristoff
29
140
192
Host
1 0 0 0 1 1 0 0
1 1 0 0 0 0 0 0
Big Circles
10011
Little Circles
10011
10010
10010
00010
00010
01111
00001
10000
01111
10001 00011
10001 00011
01110
01100
00100
01011
01110
01100
00100
01011
00101
00110
00110
01000
01000
01010
01010
00111
00111
01001
01001
001 - 00001 --- 001 - 11110
Network 140.192.32.0/19
Networks 140.192.33.0/24 -140.192.63.0/24
011 - 00001 --- 011 - 11110
Network 140.192.96.0/19
Networks 140.192.97.0/24 -140.192.127.0/24
10011
10010
10010
00010
00010
01111
00001
10000
01111
01100
10001 00011
00100
01011
01110
01100
00101
01101
00110
00110
01000
00100
01011
00101
01101
01000
01010
01010
00111
01001
010 - 00001 --- 010 - 11110
Network 140.192.64.0/19
Networks 140.192.65.0/24 -140.192.95.0/24
Spring 2000
00001
10000
10001 00011
01110
00101
01101
01101
10011
00001
10000
00111
01001
100 - 00001 --- 100 - 11110
Network 140.192.128.0/19
Networks 140.192.129.0/24 -140.192.159.0/24
John Kristoff
00100000
00100001
00100010
00100011
00100100
00100101
00100110
00100111
00101000
00101001
00101010
00101011
00101100
00101101
00101110
00101111
00110000
00110001
00110010
00110011
00110100
00110101
00110110
00110111
00111000
00111001
00111010
00111011
00111100
00111101
00111110
00111111
= 32
= 33
= 34
= 35
= 36
= 37
= 38
= 39
= 40
= 41
= 42
= 43
= 44
= 45
= 46
= 47
= 48
= 49
= 50
= 51
= 52
= 53
= 54
= 55
= 56
= 57
= 58
= 59
= 60
= 61
= 62
= 63
30
Option 2
Variable length mask using 20-bits, 24-bits, and 30-bits
E 1/0
140.192.17.6
E 1/0
140.192.17.14
S 2/0
S 2/0
E 1/1
E 1/1
E 1/1
R2
R4
E 1/1
140.192.33.1
140.192.65.1
140.192.34.1
140.192.66.1
140.192.35.1
140.192.67.1
140.192.17.5
140.192.32.0/20
140.192.17.13
S 1/0
140.192.64.0/20
S 1/2
R1
140.192.17.9
140.192.17.17
S 1/1
S 1/3
E 1/0
E 1/0
R3
R5
E 1/1
E 1/1
140.192.17.10
E 1/1
140.192.16.0/20
S 2/0
140.192.17.18
S 2/0
E 1/1
140.192.49.1
140.192.81.1
140.192.50.1
140.192.82.1
140.192.51.1
140.192.83.1
140.192.80.0/20
140.192.48.0/20
Spring 2000
John Kristoff
31
Supernetting
Combine multiple smaller address classes
into a larger block
208
1 1 0 1 0 0 0 0
207
1 1 0 0 1 1 1 1
52
0 0 1 1 0 1 0 0
208
1 1 0 1 0 0 0 0
207
1 1 0 0 1 1 1 1
53
0 0 1 1 0 1 0 1
0 0 0 0 0 0 0 0
208
207
54
0
1 1 0 1 0 0 0 0
1 1 0 0 1 1 1 1
0 0 1 1 0 1 1 0
0 0 0 0 0 0 0 0
208
1 1 0 1 0 0 0 0
207
1 1 0 0 1 1 1 1
55
0 0 1 1 0 1 1 1
0
208
1 1 0 1 0 0 0 0
207
1 1 0 0 1 1 1 1
52
0 0 1 1 0 1 0 0
Spring 2000
John Kristoff
0
208.207.52.0/24
0 0 0 0 0 0 0 0
0
208.207.53.0/24
208.207.54.0/24
208.207.55.0/24
0 0 0 0 0 0 0 0
0
208.207.52.0/22
0 0 0 0 0 0 0 0
32
CIDR
Classless Inter-domain Routing
Employ supernetting information in IP
routers
Advertise smaller CIDR blocks
Decreases the routing table size
Spring 2000
John Kristoff
33
IP Packet (datagram)
Format
Spring 2000
John Kristoff
34
IP Datagrams
Can be delayed
Duplicated
Delivered out of order
Lost
Can change routes from packet to packet
Are connectionless
Spring 2000
John Kristoff
35
IP Routing
Performed by routers
Table-driven
Forwarding on a hop-by-hop basis
Destination address used for route
determination
Spring 2000
John Kristoff
36
Routing/Forwarding
Overview
Strip off layer 2 headers/trailers
Extract destination address field, D
Look up D in the routing table
Find next hop address, N
Send datagram to N
Add on layer 2 headers/trailers
Spring 2000
John Kristoff
37
Routing Basic Operation
Basic Routing
A.34
4321
A.24
3483
B.29
4923
A.1
D.1
D.3
3984
Spring 2000
B.56
4002
B.1
Router
D.90
1834
C.1
C.45
8732
John Kristoff
C.88
6202
38
Routing Basic Operation
Layer 2
DA
SA
Protocol
Layer 3
P. DA
Network
P. DA
Host
P. SA
Network
P. SA
Host
Data
P. DA
Network
P. DA
Host
P. SA
Network
P. SA
Host
Data
A
34
C
45
Data
A
34
C
45
Data
FCS
Layer 2
1234
Layer 3
Spring 2000
3256
JIP
John Kristoff
FCS
39
Basic Routing Operations
Routing Table
Spring 2000
Layer 2 <--> Layer 3 Table
Network
Interface
Network.Host
Layer 2
A
0
A.34
4321
B
1
A.24
3483
C
2
B.29
4923
D
3
B.56
4002
C.45
8732
C.88
6202
D.3
3948
D.90
1834
John Kristoff
40
Basic Routing Operations
Basic Routing
A.34
4321
A.24
3483
B.29
4923
A.1
2398
D.1
5890
Spring 2000
D.3
3984
D.90
1834
B.56
4002
B.1
8034
Router
John Kristoff
C.1
3012
C.45
8732
C.88
6202
41
From C.45 to A.34
C.45 knows that A.34 isn't on the same net and sends it to router at C.1
Note DA for layer 2
3012
8732
JIP
A
34
C
45
Data
FCS
Inside the router the Layer 2 headers and trailers are removed leaving only the
layer 3 packet.
The router looks up the packet's DA in the routing table and forwards to the
appropriate interface.
A
34
C
45
Data
45
Data
At the interface, layer 2 headers and trailers are added back.
DA is the address of the destination host.
SA is the address of the router.
FCS is recalculated.
4321
Spring 2000
2398
JIP
A
34
C
John Kristoff
FCS
42
TCP/IP Routing
IP Routing
140.192.10.5
0060CA23BE45
140.192.10.25
0060CA34CD29
140.192.100.34
0060CA4AD2EE
140.192.10.1
00C0C1AA3411
140.192.201.1
00C0C1AA3410
Spring 2000
140.192.201.22
0060CA3499CC
140.192.201.126
0060CA3499DE
140.192.100.8
0060CAAABBCC
140.192.100.1
00C0C1AA3412
Router
John Kristoff
140.192.34.1
00C0C1AA3413
140.192.34.34
0060CA114499
140.192.34.35
0060CA7819AA
43
TCP/IP Routing
Layer 2
DA
SA
Protocol
Layer 3
P. DA
P. DA
P. SA
P. SA
Data
FCS
Data
FCS
Data
Layer 2
00C0C1AA3413 0060CA114499
Layer 3
Spring 2000
IP
140.192.10.5 140.192.34.34
140.192.10.5 140.192.34.34
John Kristoff
Data
44
TCP/IP Routing
From 140.192.34.34 to 140.192.10.5
140.192.34.34 knows that 140.192.10.5 isn't on the same net and sends it to router at 140.192.34.1
Note DA for layer 2
00C0C1AA3413
0060CA114499
IP
140.192.10.5 140.192.34.34
Data
FCS
Inside the router the Layer 2 headers and trailers are removed leaving only the
layer 3 packet.
The router looks up the packet's DA in the routing table and forwards to the
appropriate interface.
140.192.10.5 140.192.34.34
Data
At the interface, layer 2 headers and trailers are added back.
DA is the address of the destination host.
SA is the address of the router.
FCS is recalculated.
0060CA23BE45
Spring 2000
00C0C1AA3411
IP
140.192.10.5 140.192.34.34
John Kristoff
Data
FCS
45
TCP/IP Routing
Layer 2 <--> Layer 3 Table
ARP Table
Routing Table
Network
Interface
Network.Host
Layer 2
140.192.10.0
0
140.192.10.5
0060CA23BE45
140.192.100.0
1
140.192.10.25
0060CA34CD29
140.192.201.0
2
140.192.100.34
0060CA4AD2EE
140.192.34.0
3
140.192.100.8
0060CAAABBCC
140.192.201.22
0060CA3499CC
140.192.201.126
0060CA3499DE
140.192.34.34
0060CA114499
140.192.34.35
0060CA7819AA
Spring 2000
John Kristoff
46
ARP Protocol
ARP: Address Resolution Protocol
Resolves IP address to MAC address
Node sends broadcast looking for another node
140.192.23.1 broadcasts looking for 140.192.23.23
Node replies with MAC address
140.192.23.23 replies with 00600A34AA3C
ARP Table: contains records of learned
relationships.
Spring 2000
John Kristoff
47
Example IP Routing Table
Table (b) is for center router in (a)
Spring 2000
John Kristoff
48
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.
Spring 2000
John Kristoff
49
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.
Spring 2000
John Kristoff
50
Routing Protocol
Requirements
Efficient routing table size
Efficient routing control messages
Robustness and reliability
prevent loops
avoid black holes
reconvergence time is short
Spring 2000
John Kristoff
51
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
Spring 2000
John Kristoff
52
Compute Shortest/Best
Path
 Possible metric
 geographic distance
 economic cost
 capacity
Spring 2000
John Kristoff
53
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
Spring 2000
John Kristoff
54
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
Spring 2000
John Kristoff
55
Count to Infinity Problem
 What happens when link 1<->5 goes down?
 Does 5 think it can get to 1 through 2?
Spring 2000
John Kristoff
56
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.
Spring 2000
John Kristoff
57
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.
Spring 2000
John Kristoff
58
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.
Spring 2000
John Kristoff
59
Network Layer: Final
Notes
ICMP
ARP
Fragmentation
BOOTP/DHCP
Spring 2000
John Kristoff
60
BOOTP
BOOTP: boot protocol (RFC 951)
BOOTP is based on UDP so it uses IP for
transport and is routeable.
Spring 2000
John Kristoff
61
BOOTP: the way it works
Workstation broadcasts BOOTP request
containing its MAC address on power-up
BOOTP Server responds with:
Host IP address
File server address, Boot file name
DNS servers, subnet mask, router address
Routers may forward BOOTP requests,
depending on configuration.
Interface command: ip helper address 140.192.1.50
Spring 2000
John Kristoff
62
BOOTP: configuration
Network manager sets up a static table
mapping MAC addresses to IP addresses
in each BOOTP server
.loop.dummy:\
:sm=255.255.255.128:\
:bf=null:\
:ds=140.192.1.50,140.192.8.250:
# subnet 140.192.10.0 -- acs in ac350
.ac350.dummy:\
:tc=.loop.dummy:gw=140.192.10.120:
#:140.192.10.11--140.192.10.14 for Netware server in AC subnet
dept13.acs.depaul.edu:tc=.ac350.dummy:ht=ethernet:ha=00A024E281E0:ip=140.192.10.13:
dept16.acs.depaul.edu:tc=.ac350.dummy:ht=ethernet:ha=00608CEB7F0E:ip=140.192.10.16:
Spring 2000
John Kristoff
63
DHCP
DHCP: Dynamic Host Configuration
Protocol (RFC 1531)
Superset of BOOTP, provides the same
service with more options.
New servers are able to work with DNS
also.
Spring 2000
John Kristoff
64
DHCP: the way it works
IP Addresses bound to workstations
dynamically.
Workstation broadcasts DHCPDISCOVER
message on power-up.
Several DHCP Servers may respond with
DHCPOFFER messages containing:
IP address, subnet mask
Router address
Renewal Time
Spring 2000
John Kristoff
65
DHCP
Workstation responds to one offer with
DHCPREQUEST.
Request may include items like: DNS servers,
time servers, boot files,
DHCP Server now binds IP address and
replies with DHCPACK message with
requested options.
Spring 2000
John Kristoff
66
DHCP
Manager assigns multiple ranges of IP
addresses to each DHCP server and server
manages distribution to clients.
Client must renew IP address at regular
intervals indicated by Renewal Time.
Spring 2000
John Kristoff
67
DHCP: configuration
server-identifier 140.192.1.52;
# option definitions common to all supported networks...
option domain-name "depaul.edu";
option domain-name-servers 140.192.1.50,140.192.8.250;
option subnet-mask 255.255.255.128;
default-lease-time 43200;
max-lease-time 86400;
shared-network RESNET {
# option definitions common to this shared network.
option subnet-mask 255.255.255.128;
default-lease-time 6000;
max-lease-time 72000;
Spring 2000
John Kristoff
68
DHCP: configuration
# primary ip address for the interface
subnet 140.192.216.0 netmask 255.255.255.128 {
option broadcast-address 140.192.216.127;
option routers 140.192.216.1;
}
# The other subnet that shares this physical network
subnet 140.192.211.0 netmask 255.255.255.128 {
range 140.192.211.11 140.192.211.126;
option broadcast-address 140.192.211.127;
option routers 140.192.211.1;
}
# The other subnet that shares this physical network
subnet 140.192.211.128 netmask 255.255.255.128 {
range 140.192.211.130 140.192.211.254;
option broadcast-address 140.192.211.255;
option routers 140.192.211.129;
}
Spring }
2000
John Kristoff
69
Related documents