Chapter 4.3
Chapter 4.3
Layer
Outline
1. Virtual circuit and Datagram networks
2. IP: Internet Protocol
datagram format
IPv4 addressing
ICMP
IPv6
3. routing algorithms
link state
distance vector
4. routing in the Internet
RIP
OSPF
BGP
5. broadcast and multicast routing
physical
network layer protocols in network
application
transport
every host, router network
data link
physical
network
data link
network
data link
physical
router examines header
data link physical
physical
value in arriving
packet’s header
0111 1
3 2
call setup, teardown for each call before data can flow
each packet carries VC identifier (not destination host address)
every router on source-dest path maintains “ state” for each
passing connection
link, router resources (bandwidth, buffers) may be allocated to
VC (dedicated resources = predictable service)
1 3
2
VC number
interface
forwarding table in number
northwest router:
Incoming interface Incoming VC # Outgoing interface Outgoing VC #
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
application application
5. data flow begins 6. receive data
transport transport
network 4. call connected 3. accept call
1. initiate call network
data link 2. incoming call
data link
physical physical
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
IP destination address in
arriving packet’s header
1
3 2
otherwise 3
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer 4-17
Datagram or VC network: why?
Internet (datagram) ATM (VC)
data exchange among evolved from telephony
computers human conversation:
“ elastic” service, no strict strict timing, reliability
timing req. requirements
need for guaranteed service
many link types “ dumb” end systems
different characteristics telephones
uniform service difficult complexity inside network
“ smart” end systems
(computers)
can adapt, perform control,
error recovery
simple inside network,
complexity at “edge”
20
Host-specific versus network-specific method
21
Default method
22
Simplified forwarding module in classless address
23
In classless addressing, we need at
least four columns in a routing table.
24
Example 1
Solution
Table 22.1 shows the corresponding table.
25
Figure 1 Configuration
26
Table .1 Routing table for router R1 in Figure 1
22.27
Example. 2
Solution
The router performs the following steps:
1. The first mask (/26) is applied to the destination
address. The result is 201.4.22.0, which does not
match the corresponding network address.
2. The second mask (/25) is applied to the destination
address. The result is 201.4.22.0, which does not
match the corresponding network address (row 2).
22.29
Example. 3 (continued)
22.30
Example .4
Solution
This time all masks are applied, one by one, to the
destination address, but no matching network address is
found. When it reaches the end of the table, the module
gives the next-hop address 180.70.65.200 and interface
number m2 to ARP. This is probably an outgoing
package that needs to be sent, via the default router, to
someplace else in the Internet.
31
Routing Table
32
Figure 22.10 Common fields in a routing table
22.33
The Internet network layer
host, router network layer functions:
link layer
physical layer
goal: allow host to dynamically obtain its IP address from network server when
it joins network
can renew its lease on address in use
allows reuse of addresses (only hold address while connected/“ on” )
support for mobile users who want to join network (more shortly)
DHCP overview:
host broadcasts “ DHCP discover” msg [optional]
DHCP server responds with “ DHCP offer” msg [optional]
host requests IP address: “ DHCP request” msg
DHCP server sends address: “ DHCP ack” msg
DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1
223.1.2.0/24
223.1.3.1 223.1.3.2
223.1.3.0/24
DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server! Here’s an IP
yiaddrr: 223.1.2.4
transaction
address youID:can
654use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll take
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
Broadcast: OK. You’ve
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
encapsulation of DHCP
DHCP DHCP server, frame forwarded
DHCP UDP to client, demuxing up to
DHCP IP DHCP at client
DHCP Eth router with DHCP
DHCP
Phy server built into client now knows its IP
router address, name and IP
address of DSN server,
IP address of its first-hop
router
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
42
A NAT implementation
43
Addresses in a NAT
44
NAT address translation
45
Five-column translation table
46
An ISP and NAT
47
Routing algorithm classification
Q: global or decentralized Q: static or dynamic?
information?
static:
global: routes change slowly over
all routers have complete
topology, link cost info
time
“ link state” algorithms dynamic:
routes change more
decentralized:
router knows physically- quickly
connected neighbors, link costs periodic update
to neighbors in response to link cost
iterative process of computation, changes
exchange of info with neighbors
“ distance vector” algorithms
50
Figure 3 Popular routing protocols
51
Figure 4 Distance vector routing tables
52
Figure 5 Initialization of tables in distance vector routing
53
In distance vector routing, each node
shares its routing table with its
immediate neighbors periodically and
when there is a change.
22.54
Figure 6 Updating in distance vector routing
55
link state routing
56
Figure 22.21 Link state knowledge
57
Figure 22.22 Dijkstra algorithm
58
Figure 22.23 Example of formation of shortest path tree
59
Comparison of LS and DV algorithms
message complexity robustness: what happens if
LS: with n nodes, E links, O(nE) router malfunctions?
msgs sent LS:
DV: exchange between neighbors node can advertise incorrect
only link cost
convergence time varies each node computes only its
own table
speed of convergence DV:
LS: O(n2) algorithm requires
O(nE) msgs DV node can advertise
incorrect path cost
may have oscillations
each node’s table used by
DV: convergence time varies others
may be routing loops • error propagate thru
count-to-infinity problem network
R3 R4 R3 R4
source in-network
duplication duplication