ComputerNetwork C5-1 en
ComputerNetwork C5-1 en
ComputerNetwork C5-1 en
1-1
Chapter 4: outline
5.4 routing protocols
5.1 Overview of Network layer
– link state
– data plane
– distance vector
– control plane
5.5
5.2 intra-AS routing
What’s inside in the Internet: OSPF
a router
5.6
5.3 routing among
IP: Internet the ISPs: BGP
Protocol
5.7 The SDN control
– datagram formatplane
5.8 ICMP: The Internet Control Message Protocol
– fragmentation
5.9 Network management and SNMP
– IPv4 addressing
– network address
translation
– IPv6 Data Plane Control Plane
Network Layer: Data Plane 4-2
Network layer
application
it
Routing
Algorithm
control
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
routing, management
routing control plane (software)
processor operates in millisecond
time frame
forwarding data plane
(hardware) operttes in
nanosecond timeframe
high-seed
switching
fabric
lookup,
link forwarding
line layer switch
termination protocol fabric
(receive)
queueing
physical layer:
bit-level reception
data link layer: decentralized switching:
e.g., Ethernet • using header field values, 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: Data Plane 4-12
Input port functions
lookup,
link forwarding
line layer switch
termination protocol fabric
(receive)
queueing
physical layer:
bit-level reception
decentralized switching:
data link layer: • using header field values, lookup output port
e.g., Ethernet using forwarding table in input port memory
see chapter 5 (“match plus action”)
• destination-based forwarding: forward based
only on destination IP address (traditional)
• generalized forwarding: forward based on any
set of header field values
otherwise 3
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer: Data Plane 4-15
Longest prefix matching
• we’ll see why longest prefix matching is used shortly, when we
study addressing
• longest prefix matching: often performed using ternary content
addressable memories (TCAMs)
– content addressable: present address to TCAM: retrieve address in one
clock cycle, regardless of table size
– Cisco Catalyst: can up ~1M routing table entries in TCAM
memory
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
• fabric slower than input ports combined -> queueing may occur at
input queues
– queueing delay and loss due to input buffer overflow!
• Head-of-the-Line (HOL) blocking: queued datagram at front of
queue prevents others in queue from moving forward
switch switch
fabric fabric
datagram
switch buffer link
fabric layer line
protocol termination
queueing (send)
switch
switch
fabric
fabric
• buffering when arrival rate via switch exceeds output line speed
• queueing (delay) and loss due to output port buffer overflow!
RTT .C
N
packet packet
arrivals queue link departures
(waiting area) (server)
departures
1 3 2 4 5
packet in
service 1 3 2 4 5
departures
1 3 3 4 5
link layer
physical layer
…
– different link types, different in: one large datagram
out: 3 smaller datagrams
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: Data Plane 4-32
IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
4000 byte datagram
one large datagram becomes
MTU = 1500 bytes
several smaller datagrams
chapter 5, 6.
223.1.3.27
223.1.1.3
223.1.2.2
37
Special IP addresses
38
Net & Subnet
39
Subnet
• Borrow 2 bit
S S H H H H H H
– # of subnets = 22 = 4 = 00000100
– Subnet mask = 2 bits = 128 + 64 = 192 = 11000000
– Range of hosts = 26 = 64 = 01000000
Range Binary host
0 – 63 00 000000 – 00 111111 1 - 62
64 – 127 01 000000 – 01 111111 65 – 126
128 – 191 10 000000 – 10 111111 129 – 190
192 – 255 11 000000 – 11 111111 193 - 254
40
Subnet
• Borrow 3 bit
S S S H H H H H
– # of subnets
– Subnet mask
– Range of hosts
Range Binary Host
Net ID 0 – 31
32-63
64-95
96-127
128-159
160-191
192-223
Broadcast 224-255
41
Subnet
• Ex: Subnet for class C
42
Subnet
• All-zero subnet: broadcast of “parent”
• All-one subnet: network address of “parent”
before subnetting
• Not to use 2 above-mentioned subnets to avoid
confusion.
• No. of Subnets = 2n - 2
• However, some of latest network devices can
support to work for these subnets
43
Classless Inter-Domain Routing (CIDR)
• Classless Inter-Domain Routing (CIDR)
– Limitation of IP class
• Class A –16+ million hosts
• Class B – 65,535 hosts
• Lớp C – 254 hosts
44
Public/Private IP
45
IP addressing: CIDR
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 address
yiaddrr: 223.1.2.4
transaction
you canID:use654
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
dest: 255.255.255.255,
Broadcast: OK. You’ve 68 got
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs
Ethernet demuxed to IP
demuxed, UDP demuxed to
DHCP
encapsulation of DHCP
DHCP DHCP server, frame forwarded to
DHCP UDP 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
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
incoming datagrams: replace (NAT IP address, new port #) in dest fields of every
incoming datagram with corresponding (source IP address, port #) stored in NAT
table
data
32 bits
Network Layer: Data Plane 4-68
Other changes from IPv4
• checksum: removed entirely to reduce processing time at each hop
• options: allowed, but outside of header, indicated by “Next Header”
field
• ICMPv6: new version of ICMP
– additional message types, e.g. “Packet Too Big”
– multicast group management functions
IPv6 datagram
IPv4 datagram
Network Layer: Data Plane 4-70
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6 IPv6 IPv6
A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4 Network Layer: Data Plane 4-72
IPv6: adoption
• Google: 8% of clients access services via IPv6
• NIST: 1/3 of all US government domains are IPv6 capable
control plane
data plane
local flow table
headers counters actions
1
0100 1101
3 2
values in arriving
packet’s header
Network Layer: Data Plane 4-76
OpenFlow data plane abstraction
• flow: defined by header fields
• generalized forwarding: simple packet-handling rules
– Pattern: match values in packet header fields
– Actions: for matched packet: drop, forward, modify, matched packet or send
matched packet to controller
– Priority: disambiguate overlapping patterns
– Counters: #bytes and #packets
* : wildcard
1. src=1.2.*.*, dest=3.4.5.* drop
2. src = *.*.*.*, dest=3.4.*.* forward(2)
3. src=10.1.2.3, dest=*.*.*.* send to controller
OpenFlow: Flow Table Entries
3 4
Host h5
10.3.0.5
1 s1 1 s2
2 Host h4
4 2 4
Host h1 10.2.0.4
3 3
10.1.0.1
Host h2
10.1.0.2 match action
match action Host h3
ingress port = 2
10.2.0.3 forward(3)
ingress port = 1 IP Dst = 10.2.0.3
IP Src = 10.3.*.* forward(4) ingress port = 2
forward(4)
IP Dst = 10.2.*.* IP Dst = 10.2.0.4
Chapter 5: Summary!
4.1 Overview of Network layer: 4.4 Generalized Forward and
data plane and control plane SDN
4.2 What’s inside a router • match plus action
4.3 IP: Internet Protocol • OpenFlow example
• datagram format
• fragmentation
• IPv4 addressing Question: how do forwarding tables
• NAT (destination-based forwarding) or flow
• IPv6 tables (generalized forwarding) computed?
Answer: by the control plane (next section)