Unit 4
Unit 4
172 16 0 0
N
16
15
10
14
13
12
11
9
8
7
6
5
4
3
2
1
10101100 00010000 00000000 00000000 1
00000000 00000001 2
00000000 00000011 3
...
...
...
11111111 11111101 65534
11111111 11111110 65535
11111111 11111111 65536
– 2
2N – 2 = 216 – 2 = 65534 65534
IP Address Classes Exercise
10.2.1.1
128.63.2.100
201.222.5.64
192.6.141.2
130.113.64.16
256.241.201.10
IP Address Classes Exercise Answers
256.241.201.10 Nonexistent
Addressing Without Subnets
…...
172.16.0.0
• Network 172.16.0.0
Addressing with Subnets
172.16.3.0
172.16.4.0
172.16.1.0 172.16.2.0
• Network 172.16.0.0
Subnet Mask Exercise
172.16.2.10 255.255.255.0
10.6.24.20 255.255.240.0
10.30.36.12 255.255.255.0
Subnet Mask Exercise Answers
172.16.3.0
172.16.4.0
172.16.1.0
172.16.3.255 172.16.2.0
(Directed Broadcast)
255.255.255.255
(Local Network Broadcast)
X
172.16.255.255
(All Subnets Broadcast)
Exercise
• 192.168.10.0
• /27
? – SNM
? – Block Size
?- Subnets
Exercise
• /27
? – SNM – 224
? – Block Size = 256-224 = 32
?- Subnets
? – SNM
? – Block Size
?- Subnets
Exercise
• /30
? – SNM – 252
? – Block Size = 256-252 = 4
?- Subnets
• 172.16.85.30/29
Find out Subnet and Broadcast Address
• 172.30.101.62/23
Find out Subnet and Broadcast Address
• 172.20.210.80/24
Class A
10.0.0.0 /10
Subnets ?
Hosts ?
Block Size ?
Class A
10.0.0.0 /10
Subnets 22 = 4
Hosts 222 -2 = 4194302
Block Size 256-192 = 64
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
forwarding table configured
by both intra- and inter-AS
routing algorithm
Intra-AS Inter-AS
Routing
algorithm
Routing
algorithm
intra-AS sets entries
Forwarding
for internal dests
table inter-AS & intra-AS
sets entries for
external dests
Inter-AS tasks
suppose router in AS1 AS1 must:
receives datagram 1. learn which dests are
destined outside of AS1: reachable through AS2,
router should which through AS3
forward packet to 2. propagate this
gateway router, but reachability info to all
routers in AS1
which one?
job of inter-AS routing!
3c
3a
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
Intra-AS Routing
also known as interior gateway protocols (IGP)
most common intra-AS routing protocols:
RIP: Routing Information Protocol
OSPF: Open Shortest Path First
IGRP: Interior Gateway Routing Protocol (Cisco
proprietary)
OSPF (Open Shortest Path First)
• “open”: publicly available
• uses link state algorithm
– route computation using Dijkstra’s algorithm
• OSPF advertisement carries one entry per
neighbor
• advertisements flooded to entire AS
– carried in OSPF messages directly over IP
OSPF Messages
• The hello message (type 1) is used by a router to
introduce itself to the neighbors and announce all
neighbors that it already knows.
• The database description message (type 2) is
normally sent in response to the hello message to
allow a newly joined router to acquire the full
LSDB.
• The linkstate request message (type 3) is sent by a
router that needs information about a specific LS.
• The link-state update message (type 4) is the
main OSPF message used for building the
LSDB.
• The link-state acknowledgment message (type
5) is used to create reliability in OSPF; each
router that receives a link-state update
message needs to acknowledge it.
Working
• When a router starts, it first initializes the
routing protocol
• It then uses the OSPF’s handshaking Hello
Protocol to learn about each other, exchange
information and later perform pings with
neighbor routers to make certain the link
and/or router is up.
• Now the peer routers are considered to be
merely adjacent (part of synchronization-not
complete).
• The routers exchange information describing
their knowledge of the routing domain. This
information is called database description and
is placed in LSA messages.
• Using LSA messages the receiving router
knows if its LSDB is consistent with its peer’s
databases. If all is consistent the neighbor is
now defined as fully adjacent.
• A router periodically advertises its state (link
state) to detect dead routers in a timely
fashion.
• From this database each router calculates a
shortest path tree with itself the root.
• This shortest path tree in turn yields a routing
table for the protocol.
OSPF “advanced” features (not in RIP)
3c
BGP
3a message
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
BGP basics: distributing path information
using eBGP session between 3a and 1c, AS3 sends prefix
reachability info to AS1.
1c can then use iBGP do distribute new prefix info to all routers in AS1
1b can then re-advertise new reachability info to AS2 over 1b-to-2a
eBGP session
when router learns of new prefix, it creates entry for prefix in
its forwarding table.
eBGP session
3a iBGP session
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
BGP Messages
• Uses four types of messages for communication:
• Open Message
– To create a neighborhood relationship, a router running BGP
opens a TCP connection with a neighbor and sends an open
message.
• Update Message
– Is used by a router to withdraw destinations that have been
advertised previously, to announce a route to a new
destination, or both.
– It can only advertise one new destination in a single update
message.
• Keepalive Message
– The BGP peers that are running exchange
keepalive messages regularly (before their hold
time expires) to tell each other that they are alive.
• Notification
– A notification message is sent by a router
whenever an error condition is detected or a
router wants to close the session.
IPv6: motivation
• initial motivation: 32-bit address space soon
to be completely allocated.
• additional motivation:
– header format helps speed processing/forwarding
– header changes to facilitate QoS
data
32 bits
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
Transition from IPv4 to IPv6
• not all routers can be upgraded simultaneously
– no “flag days”
– how will network operate with mixed IPv4 and IPv6
routers?
• tunneling: IPv6 datagram carried as payload in
IPv4 datagram among IPv4 routers
IPv4 header fields IPv6 header fields
IPv4 payload
IPv4 source, dest addr IPv6 source dest addr
UDP/TCP payload
IPv6 datagram
IPv4 datagram
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
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
data data
A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4
IPv6: adoption
• US National Institutes of Standards estimate
[2013]:
– ~3% of industry IP routers
– ~11% of US gov’t routers