Title: Part I: Introduction
1??????
- ????? ????? ??? ???? ?????
- ???? 9-12
- ???? ????????? 111
2Last Week
- Basic Routing Schemes
- Link State
- broadcast link information
- Local computation on global topology
- Distance vector
- Exchange distance information with neighbors
- Local updates based on neighbors information
- Hierarchical Routing
- Broadcast and multicast
- Using a tree topology
3This week
- Hierarchical routing
- IP addresses
- Definition of network
- Network Address Translation (NAT)
- Routing algorithms implementations
4The Internet Network layer
- Host, router network layer functions
Transport layer TCP, UDP
Network layer
Link layer
physical layer
5Hierarchical Routing
- Our routing study thus far - idealization
- all routers identical
- network flat
- not true in practice
- scale with 50 million destinations
- cant store all dests in routing tables!
- routing table exchange would swamp links!
- administrative autonomy
- internet network of networks
- each network admin may want to control routing in
its own network
6Hierarchical Routing
- aggregate routers into regions, autonomous
systems (AS) - routers in same AS run same routing protocol
- intra-AS routing protocol
- routers in different AS can run different
intra-AS routing protocol
- special routers in AS
- run intra-AS routing protocol with all other
routers in AS - also responsible for routing to destinations
outside AS - run inter-AS routing protocol with other gateway
routers
7Intra-AS and Inter-AS routing
- Gateways
- perform inter-AS routing amongst themselves
- perform intra-AS routers with other routers in
their AS
b
a
a
C
B
d
A
network layer
inter-AS, intra-AS routing in gateway A.c
link layer
physical layer
8Intra-AS and Inter-AS routing
Host h2
Intra-AS routing within AS B
Intra-AS routing within AS A
- Well examine specific inter-AS and intra-AS
Internet routing protocols shortly
9Routing Example
d
E
d-gta2 I can reach hosts in D my path D
Export to E i-gte I can reach hosts in D path
IBCD
a2
a2-gta1 I can reach hosts in D path D
a1-gti I can reach hosts in D my path AD
a1
No Exportto F
i
F
AS C
choose BCD using i2
i2-gti I can reach hosts in D path BCD
b-gti I can reach hosts in D my path BCD
i2
b
b-gti2 I can reach hosts in D my path BCD
AS I
10Routing Example
d1
d
E
d2
a2
a1-gti I can reach hosts in D my path AD
i
F
AS C
a1
How to specify?
b
AS I
11IP Addressing Scheme
- We need an address to uniquely identify each
destination - Routing scalability needs flexibility in
aggregation of destination addresses - we should be able to aggregate a set of
destinations as a single routing unit - Preview the unit of routing in the Internet is a
network---the destinations in the routing
protocols are networks
12IP Addressing introduction
223.1.1.1
- IP address 32-bit identifier for host, router
interface - interface connection between host, router and
physical link - routers typically have multiple interfaces
- host may have multiple interfaces
- IP addresses associated with interface, not host,
or router
223.1.2.9
223.1.1.4
223.1.1.3
223.1.1.1 11011111 00000001 00000001 00000001
223
1
1
1
13IP Addressing
223.1.1.1
- IP address
- network part
- high order bits
- host part
- low order bits
- Whats a network ? (from IP address perspective)
- device interfaces with same network part of IP
address - can physically reach each other without
intervening router
223.1.2.1
223.1.1.2
223.1.2.9
223.1.1.4
223.1.2.2
223.1.1.3
223.1.3.27
LAN
223.1.3.2
223.1.3.1
network consisting of 3 IP networks (for IP
addresses starting with 223, first 24 bits are
network address)
14IP Addressing
223.1.1.2
- How to find the networks?
- Detach each interface from router, host
- create islands of isolated networks
223.1.1.1
223.1.1.4
223.1.1.3
223.1.7.0
223.1.9.2
223.1.9.1
223.1.7.1
223.1.8.0
223.1.8.1
223.1.2.6
223.1.3.27
Interconnected system consisting of six networks
223.1.2.1
223.1.2.2
223.1.3.2
223.1.3.1
15IP Addresses
- given notion of network, lets re-examine IP
addresses
class-full addressing
class
1.0.0.0 to 127.255.255.255
A
network
0
host
128.0.0.0 to 191.255.255.255
B
192.0.0.0 to 223.255.255.255
C
224.0.0.0 to 239.255.255.255
D
32 bits
16IP addressing CIDR
- classful addressing
- inefficient use of address space, address space
exhaustion - e.g., class B net allocated enough addresses for
65K hosts, even if only 2K hosts in that network - CIDR Classless InterDomain Routing
- network portion of address of arbitrary length
- address format a.b.c.d/x, where x is bits in
network portion of address
17CIDR Address Aggregation
d1
d
a2
130.132.1/24
i-gta1 I can reach 130.132/16 my path I
i
a1
intradomain routing uses /24
130.132.2/24
130.132.3/24
AS I
18CIDR Address Aggregation
B
x00/24 B
x/22 A
C
A
x01/24 C
x11/24 GF
x10/24 E
E
x11/24 F
x11/24 F
F
19IP addresses how to get one?
- Hosts (host portion)
- hard-coded by system admin in a file
- DHCP Dynamic Host Configuration Protocol
dynamically get address plug-and-play - host broadcasts DHCP discover msg
- DHCP server responds with DHCP offer msg
- host requests IP address DHCP request msg
- DHCP server sends address DHCP ack msg
- The common practice in LAN and home access (why?)
20IP addresses how to get one?
- Network (network portion)
- get allocated portion of ISPs address space
ISP's block 11001000 00010111 00010000
00000000 200.23.16.0/20 Organization 0
11001000 00010111 00010000 00000000
200.23.16.0/23 Organization 1 11001000
00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100
00000000 200.23.20.0/23 ...
..
. . Organization
7 11001000 00010111 00011110 00000000
200.23.30.0/23
21Hierarchical addressing route aggregation
Hierarchical addressing allows efficient
advertisement of routing information
Organization 0
Organization 1
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16
ISPs-R-Us
22Hierarchical addressing more specific routes
ISPs-R-Us has a more specific route to
Organization 1
Organization 0
Send me anything with addresses beginning
200.23.16.0/20
Organization 2
Fly-By-Night-ISP
Internet
Organization 7
Send me anything with addresses beginning
199.31.0.0/16 or 200.23.18.0/23
ISPs-R-Us
Organization 1
23Network Address Translation Motivation
- A local network uses just one public IP address
as far as outside world is concerned - Each device on the local network is assigned a
private IP address
rest of Internet
local network (e.g., home network) 192.168.1.0/24
192.168.1.2
192.168.1.1
192.168.1.3
138.76.29.7
192.168.1.4
All datagrams leaving local network have same
single source NAT IP address 138.76.29.7, differe
nt source port numbers
Datagrams with source or destination in this
network have 192.168.1/24 address for source,
destination (as usual)
24NAT Network Address Translation
- Implementation NAT router must
- outgoing datagrams replace (source IP address,
port ) of every outgoing datagram to (NAT IP
address, new port ) - . . . remote clients/servers will respond using
(NAT IP address, new port ) as destination
addr. - remember (in NAT translation table) every (source
IP address, port ) to (NAT IP address, new port
) translation pair - 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
25NAT Network Address Translation
NAT translation table WAN side addr LAN
side addr
138.76.29.7, 5001 192.168.1.2, 3345
192.168.1.2
192.168.1.1
192.168.1.3
138.76.29.7
192.168.1.4
4 NAT router changes datagram dest addr
from 138.76.29.7, 5001 to 192.168.1.2, 3345
3 Reply arrives dest. address 138.76.29.7,
5001
26Network Address Translation Advantages
- No need to be allocated range of addresses from
ISP - just one public IP address is used for all
devices - 16-bit port-number field allows 60,000
simultaneous connections with a single LAN-side
address ! - can change ISP without changing addresses of
devices in local network - can change addresses of devices in local network
without notifying outside world - Devices inside local net not explicitly
addressable, visible by outside world (a security
plus)
27NAT Network Address Translation
- If both hosts are behind different NAT, they will
have difficulty establishing connection - NAT is controversial
- routers should process up to only layer 3
- violates end-to-end argument
- NAT possibility must be taken into account by app
designers, e.g., P2P applications - address shortage should instead be solved by
having more addresses --- IPv6 !
28IP addressing the last word...
- Q How does an ISP get block of addresses?
- A ICANN Internet Corporation for Assigned
- Names and Numbers
- allocates addresses
- manages DNS
- assigns domain names, resolves disputes
29Getting a datagram from source to dest.
routing table in A
- datagram remains unchanged, as it travels source
to destination - addr fields of interest here
- mainly dest. IP addr
-
30Getting a datagram from source to dest.
misc fields
data
223.1.1.1
223.1.1.3
- Starting at A, given IP datagram addressed to B
- look up net. address of B
- find B is on same net. as A
- link layer will send datagram directly to B
inside link-layer frame - B and A are directly connected
-
31Getting a datagram from source to dest.
misc fields
data
223.1.1.1
223.1.2.2
- Starting at A, dest. E
- look up network address of E
- E on different network
- A, E not directly attached
- routing table next hop router to E is 223.1.1.4
- link layer sends datagram to router 223.1.1.4
inside link-layer frame - datagram arrives at 223.1.1.4
- continued..
32Getting a datagram from source to dest.
misc fields
data
223.1.1.1
223.1.2.2
- Arriving at 223.1.4, destined for 223.1.2.2
- look up network address of E
- E on same network as routers interface 223.1.2.9
- router, E directly attached
- link layer sends datagram to 223.1.2.2 inside
link-layer frame via interface 223.1.2.9 - datagram arrives at 223.1.2.2!!! (hooray!)
33IP datagram format
IP protocol version number
32 bits
total datagram length (bytes)
header length (bytes)
type of service
head. len
ver
length
for fragmentation/ reassembly
fragment offset
type of data
flgs
16-bit identifier
max number remaining hops (decremented at each
router)
upper layer
time to live
Internet checksum
32 bit source IP address
32 bit destination IP address
upper layer protocol to deliver payload to
E.g. timestamp, record route taken, specify list
of routers to visit.
Options (if any)
data (variable length, typically a TCP or UDP
segment)
34IP Fragmentation Reassembly
- network links have MTU (max.transfer size) -
largest possible link-level frame. - different link types, different MTUs
- large IP datagram divided (fragmented) within
net - one datagram becomes several datagrams
- reassembled only at final destination
- IP header bits used to identify, order related
fragments
fragmentation in one large datagram out 3
smaller datagrams
reassembly
35IP Fragmentation and Reassembly
- Example
- 4000 byte datagram
- MTU 1500 bytes
1480 bytes in data field
offset 1480/8
36Routing in the Internet
- The Global Internet consists of Autonomous
Systems (AS) interconnected with each other - Stub AS small corporation
- Multihomed AS large corporation (no transit)
- Transit AS provider
- Two-level routing
- Intra-AS administrator is responsible for choice
- Inter-AS unique standard
37Internet AS Hierarchy
Inter-AS border (exterior gateway) routers
Intra-AS interior (gateway) routers
38Intra-AS Routing
- Also known as Interior Gateway Protocols (IGP)
- Most common IGPs
- RIP Routing Information Protocol
- OSPF Open Shortest Path First
- IGRP Interior Gateway Routing Protocol (Cisco
propr.)
39RIP ( Routing Information Protocol)
- Distance vector algorithm
- Included in BSD-UNIX Distribution in 1982
- Distance metric of hops (max 15 hops)
- why?
- Distance vectors exchanged every 30 sec via
Response Message (also called advertisement) - Each advertisement route to up to 25 destination
nets
40RIP (Routing Information Protocol)
z
w
x
y
A
D
B
C
Destination Network Next Router Num. of
hops to dest. w A 2 y B 2
z B 7 x -- 1 . . ....
Routing table in D
41RIP Link Failure and Recovery
- If no advertisement heard after 180 sec --gt
neighbor/link declared dead - routes via neighbor invalidated
- new advertisements sent to neighbors
- neighbors in turn send out new advertisements (if
tables changed) - link failure info quickly propagates to entire
net - poison reverse used to prevent ping-pong loops
(infinite distance 16 hops)
42OSPF (Open Shortest Path First)
- open publicly available
- Uses Link State algorithm
- LS packet dissemination
- Topology map at each node
- Route computation using Dijkstras algorithm
- OSPF advertisement carries one entry per neighbor
router - Advertisements disseminated to entire AS (via
flooding)
43OSPF advanced features (not in RIP)
- Security all OSPF messages authenticated (to
prevent malicious intrusion) TCP connections
used - Multiple same-cost paths allowed
- only one path in RIP
- For each link, multiple cost metrics for
different ToS (eg, satellite link cost set low
for best effort high for real time) - Integrated uni- and multicast support
- Multicast OSPF (MOSPF) uses same topology data
base as OSPF - Hierarchical OSPF in large domains.
44Hierarchical OSPF
45Hierarchical OSPF
- Two-level hierarchy local area, backbone.
- Link-state advertisements only in area
- each nodes has detailed area topology only know
direction (shortest path) to nets in other areas. - Area border routers summarize distances to
nets in own area, advertise to other Area Border
routers. - Backbone routers run OSPF routing limited to
backbone. - Boundary routers connect to other ASs.
46IGRP (Interior Gateway Routing Protocol)
- CISCO proprietary successor of RIP (mid 80s)
- Distance Vector, like RIP
- several cost metrics (delay, bandwidth,
reliability, load etc) - uses TCP to exchange routing updates
- Loop-free routing via Distributed Updating Alg.
(DUAL) based on diffused computation
47Inter-AS routing
48Internet inter-AS routing BGP
- BGP (Border Gateway Protocol) the de facto
standard - Path Vector protocol
- similar to Distance Vector protocol
- each Border Gateway broadcast to neighbors
(peers) entire path (I.e, sequence of ASs) to
destination - E.g., Gateway X may send its path to dest. Z
- Path (X,Z) X,Y1,Y2,Y3,,Z
49Internet inter-AS routing BGP
- Suppose gateway X send its path to peer gateway
W - W may or may not select path offered by X
- cost, policy (dont route via competitors AS),
loop prevention reasons. - If W selects path advertised by X, then
- Path (W,Z) W, Path (X,Z)
- Note X can control incoming traffic by
controlling its route advertisements to peers - e.g., dont want to route traffic to Z -gt dont
advertise any routes to Z
50Internet inter-AS routing BGP
- BGP messages exchanged using TCP.
- BGP messages
- OPEN opens TCP connection to peer and
authenticates sender - UPDATE advertises new path (or withdraws old)
- KEEPALIVE keeps connection alive in absence of
UPDATES also ACKs OPEN request - NOTIFICATION reports errors in previous msg
also used to close connection
51Why different Intra- and Inter-AS routing ?
- Policy
- Inter-AS admin wants control over how its
traffic routed, who routes through its net. - Intra-AS single admin, so no policy decisions
needed - Scale
- hierarchical routing saves table size, reduced
update traffic - Performance
- Intra-AS can focus on performance
- Inter-AS policy may dominate over performance
52Extra
53ICMP Internet Control Message Protocol
- used by hosts routers to communicate
network-level information - error reporting unreachable host, network, port,
protocol - echo request/reply (used by ping)
- network-layer above IP
- ICMP msgs carried in IP datagrams
- ICMP message type, code plus first 8 bytes of IP
datagram causing error
Type Code description 0 0 echo
reply (ping) 3 0 dest. network
unreachable 3 1 dest host
unreachable 3 2 dest protocol
unreachable 3 3 dest port
unreachable 3 6 dest network
unknown 3 7 dest host unknown 4
0 source quench (congestion
control - not used) 8 0
echo request (ping) 9 0 route
advertisement 10 0 router
discovery 11 0 TTL expired 12 0
bad IP header
54Traceroute and ICMP
- Source sends series of UDP segments to dest
- First has TTL 1
- Second has TTL2, etc.
- Unlikely port number
- When nth datagram arrives to nth router
- Router discards datagram
- And sends to source an ICMP message (type 11,
code 0) - Message includes name of router IP address
- When ICMP message arrives, source calculates RTT
- Traceroute does this 3 times
- Stopping criterion
- UDP segment eventually arrives at destination
host - Destination returns ICMP dest port unreachable
packet (type 3, code 3) - When source gets this ICMP, stops.
55Example tracert www.yahoo.com
- Tracing route to www-real.wa1.b.yahoo.com
69.147.76.15 - over a maximum of 30 hops
- 1 lt1 ms lt1 ms lt1 ms 132.67.250.1
- 2 lt1 ms 1 ms lt1 ms
dmz-cc-gw.math.tau.ac.il 132.67.252.2 - 3 lt1 ms lt1 ms lt1 ms
tel-aviv.tau.ac.il 132.66.4.1 - 4 1 ms lt1 ms lt1 ms
gp1-tau-ge.ilan.net.il 128.139.191.70 - 5 1 ms 1 ms
gp0-gp1-te.ilan.net.il 128.139.188.2 - 6 87 ms 86 ms 87 ms
iucc.rt1.fra.de.geant2.net 62.40.125.121 - 7 87 ms 87 ms 87 ms
TenGigabitEthernet7-3.ar1.FRA4.gblx.net
207.138.144.45 - 8 177 ms 177 ms 177 ms 204.245.39.226
- 9 180 ms 177 ms 265 ms
ae1-p151.msr2.re1.yahoo.com 216.115.108.23 - 10 177 ms 177 ms 177 ms
te-9-4.bas-a2.re1.yahoo.com 66.196.112.203 - 11 177 ms 177 ms 177 ms
f1.www.vip.re1.yahoo.com 69.147.76.15 - Trace complete.
56IPv6
- Initial motivation 32-bit address space soon to
be completely allocated. - Additional motivation
- header format helps speed processing/forwarding
- header changes to facilitate QoS
- IPv6 datagram format
- fixed-length 40 byte header
- no fragmentation allowed
57IPv6 Header (Cont)
Priority identify priority among datagrams in
flow Flow Label identify datagrams in same
flow. (concept offlow
not well defined). Next header identify upper
layer protocol for data
58Other 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
59Transition From IPv4 To IPv6
- Not all routers can be upgraded simultaneous
- no flag days
- How will the network operate with mixed IPv4 and
IPv6 routers? - Tunneling IPv6 carried as payload in IPv4
datagram among IPv4 routers
60Tunneling
tunnel
Logical view
IPv6
IPv6
IPv6
IPv6
Physical view
IPv6
IPv6
IPv6
IPv6
IPv4
IPv4
A-to-B IPv6
E-to-F IPv6
B-to-C IPv6 inside IPv4
B-to-C IPv6 inside IPv4
61IPv6 status report
- Operating systems
- wide support early 2000
- Windows (2000, XP, Vista), BSD, Linux, Apple
- Networking infrastructure
- Cisco
- Deployment
- Slow
- Penetration
- Host - minor (less than 1)
- Used in 2008 in China Olympic games
- Motivation CIDR NAT