Network Layer - Part 2
Network Layer - Part 2
Chapter 4
Chapter 4: outline
4.1 Introduction 4.5 routing algorithms
4.2 Virtual circuit and link state
datagram networks distance vector
4.4 IP: Internet Protocol 4.6 routing in the Internet
datagram format RIP
IPv4 addressing OSPF
ICMP BGP
IPv6
passing through it
routing
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)
Network Layer 4-11
VC implementation
a VC consists of:
1. path from source to destination
2. VC numbers, one number for each link along path
3. entries in forwarding tables in routers along path
packet belonging to VC carries VC number
(rather than dest address)
VC number can be changed on each link.
new VC number comes from forwarding table
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 data 2. receive data network
data link data link
physical physical
IP destination address in
arriving packet’s header
1
3 2
4.17
Figure 4.4: Forwarding process in a router when used in a
connectionless network
SA DA Data SA DA Data
4.18
1.18
Consider the network below.
a. Suppose that this network is a datagram network. Show the forwarding table in router A,
such that all traffic destined to host H3 is forwarded through interface 3.
b. Suppose that this network is a datagram network. Can you write down a forwarding table in
router A, such that all traffic from H1 destined to host H3 is forwarded through interface 3, while
all traffic from H2 destined to host H3 is forwarded through interface 4? (Hint: this is a trick
question.)
c. Now suppose that this network is a virtual circuit network and that there is one ongoing call
between H1 and H3, and another ongoing call between H2 and H3. Write down a forwarding
table in router A, such that all traffic from H1 destined to host H3 is forwarded through interface
3, while all traffic from H2 destined to host H3 is forwarded through interface 4.
d. Assuming the same scenario as (c), write down the forwarding tables in nodes B, C, and D.
Suppose there are three routers between a source host and a destination host.
Ignoring fragmentation, an IP datagram sent from the source host to the
destination host will travel over how many interfaces? How many forwarding tables
will be indexed to move the datagram from the source to the destination?
Datagram forwarding table
Destination Address Range Link Interface
otherwise 3
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer 4-22
Consider a datagram network using 8-bit host addresses.
Suppose a router uses longest-prefix matching, and has the following forwarding table:
Provide a forwarding table that uses longest prefix matching, and forwards packets to the
correct link interfaces.
Describe how your forwarding table determines the appropriate link interface for
datagrams with destination addresses:
11001000 10010001 01010001 01010101
11100001 01000000 11000011 00111100
11100001 10000000 00010001 01110111
Consider a datagram network using 8-bit host addresses. Suppose a router
uses longest prefix matching and has the following forwarding table:
For each of the four interfaces, give the associated range of destination host
addresses and the number of addresses in the range.
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
requirements
timing req. need for guaranteed
many link types service
different characteristics “dumb” end systems
uniform service difficult telephones
complexity inside network
“smart” end systems
(computers)
can adapt, perform control,
error recovery
simple inside network,
complexity at “edge”
forwarding data
plane (hardware)
high-seed
switching
fabric
physical layer:
bit-level reception
data link layer: decentralized switching:
e.g., Ethernet given datagram dest., lookup output port
see chapter 5 using forwarding table in input port
memory (“match plus action”)
goal: complete input port processing at
‘line speed’
queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Network Layer 4-30
Switching fabrics
transfer packet from input buffer to appropriate
output buffer
switching rate: rate at which packets can be
transfer from inputs to outputs
often measured as multiple of input/output line rate
N inputs: switching rate N times line rate desirable
three types of switching fabrics
memory
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
datagram
switch buffer link
fabric layer line
protocol termination
queueing (send)
switch
switch
fabric
fabric
switch switch
fabric fabric
physical layer
…
frame in: one large datagram
different link types, out: 3 smaller datagrams
different MTUs
large IP datagram divided
(“fragmented”) within net reassembly
one datagram
becomes several
datagrams …
“reassembled” only at
final destination
IP header bits used to
identify, order related
fragments Network Layer 4-42
***IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
4000 byte
datagram one large datagram becomes
several smaller datagrams
MTU = 1500
bytes
1480 bytes in length ID fragflag offset
data field =1500 =x =1 =0
223 1 1 1
in chapter 5, 6.
223.1.3.27
223.1.1.3
223.1.2.2
bits 223.1.2.2
what’s a subnet ? 223.1.1.3 223.1.3.27
to determine the
223.1.1.2 223.1.2.1
subnets, detach each 223.1.1.4 223.1.2.9
is called a subnet
223.1.3.0/24
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
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
654 use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll
yiaddrr: 223.1.2.4
take that IPID:address!
transaction 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255,
Broadcast: 68
OK. You’ve
yiaddrr: 223.1.2.4
gottransaction
that IPID:address!
655
lifetime: 3600 secs
encapsulated in UDP,
DHCP DHCP 168.1.1.1 encapsulated in IP,
DHCP UDP encapsulated in 802.1
DHCP IP
DHCP Eth router with DHCP
Ethernet frame
Phy server built into broadcast (dest:
router FFFFFFFFFFFF) on LAN,
received at router
running DHCP
Ethernet server
demuxed to
IP demuxed, UDP
demuxed to DHCP
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
Organization 0
200.23.16.0/23
“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
2. connection
to 1. connection 10.0.0.1
relay initiated to
by client relay initiated
3. relaying by NATed host
client established
138.76.29.7 NAT
router
3 probes
Network Layer 4-74
IP Security
To communicate securely in the nonsecure public
Internet. E.g. VPN