advanced networking hardware design lecture 2 wan and introduction to routing on the internet
DESCRIPTION
Advanced Networking Hardware Design Lecture 2 WAN and Introduction to Routing on the Internet. What is a WAN. A WAN is a data communications network that covers a relatively broad geographic area WAN technologies function at the lower three layers of the OSI reference model - PowerPoint PPT PresentationTRANSCRIPT
Advanced Networking Hardware Design
Lecture 2 WAN and Introduction to Routing on
the Internet
Kocak 2.2
What is a WAN
• A WAN is a data communications network that covers a relatively broad geographic area
• WAN technologies function at the lower three layers of the OSI reference model
• A point-to-point link provides a single, pre-established WAN communication path from the customer premises through a carrier network to a remote network. Point-to-point lines are also called leased lines.
Kocak 2.3
Circuit Switching
• The mechanism used in the public switched telephone network (PSTN)
• It consists of explicitly establishing a physical end-to-end connection that is dedicated to each pair of communicating devices
Kocak 2.4
Packet Switching
• Packet switching is a WAN technology in which users share common carrier resources
• By dividing data communications into packets, a number of concurrent communicating applications are statistically multiplexed on a link
Kocak 2.5
Routing basics
• Routing is the act of moving information across an internetwork from a source to a destination.
• Routing occurs at the network layer• Two activities
– Optimal path determination– Packet transportation
Kocak 2.6
Path determination
• Routing protocols use metric to evaluate what path will be the best for a packet to travel. (e.g., metric: path bandwidth)
• Routing algorithms initialize and maintain routing tables (aka. forwarding tables), which contain route information.
Kocak 2.7
Routing algorithms
• Use network topology and link state information to determine the nodes through which paths should flow, and load this information into the forwarding table
• In connectionless datagram network, the routing protocol operates asynchronously with individual flows to keep the table loaded with entries
• In connection-oriented networks, the routing algorithm runs at each connection setup to load the appropriate information into the forwarding table
Kocak 2.8
Routing algorithms (cont.)
• Design goals:– Optimality: capability of selecting the best route– Simplicity: minimum software and utilization
overhead– Robustness: perform correctly in unforeseen
conditions– Convergence: process of agreement, by all routers,
on optimal routes– Flexibility: adapt to a variety of network
circumstances
• Types:– Static vs dynamic– Single path vs multipath– Flat vs hierarchical– Host-intelligent vs router intelligent– Intradomain vs interdomain– Link-state vs distance vector
Kocak 2.9
Routing metrics
• Path length – is the sum of the costs associated with each link traversed. Also defined as hop count (number of nodes a packet must pass)
• Reliability – dependability of each network link. Usually described in terms of the bit-error rate
• Delay – the length of time required to move a packet from source to destination thru the network
• Bandwidth – available traffic capacity of a link• Load – refers to the degree to which a network
resource is busy• Communication cost
(c) Stanford Univ. (adapted from Mckeown's notes) 2.10
The Internet Protocol (IP)
• Characteristics of IP
CONNECTIONLESS: mis-sequencing
UNRELIABLE: may drop packets…
BEST EFFORT: … but only if necessary
DATAGRAM: individually routed
A
R1
R2
R4
R3
BSource Destination
D H
D H
•Architecture•Links•Topology
Transparent
(c) Stanford Univ. (adapted from Mckeown's notes) 2.11
The IP Datagram
Flags
vers
TTL
TOS
checksum
HLen Total Length
ID FRAG Offset
Protocol
SRC IP Address
DST IP Address
(OPTIONS) (PAD)
<=64 KBytes
Offset within original packet
Hop count
(c) Stanford Univ. (adapted from Mckeown's notes) 2.12
Fragmentation
A
EthernetMTU=1500 bytes
MTU=1500 bytes
B
Source Destination
MTU<1500 bytes
Problem: A router may receive a packet larger than the maximum transmission unit (MTU) of the outgoing link.
R1 R2
Solution: R1 fragments the IP datagram into mutiple, self-contained datagrams.
Data HDR (ID=x)
Data HDR (ID=x) Data HDR (ID=x) Data HDR (ID=x)
Offset>0More Frag=0
Offset=0More Frag=1
(c) Stanford Univ. (adapted from Mckeown's notes) 2.13
Fragmentation
• Fragments are re-assembled by the destination host; not by intermediate routers.
• To avoid fragmentation, hosts commonly use path MTU discovery to find the smallest MTU along the path.
• Path MTU discovery involves sending various size datagrams until they do not require fragmentation along the path.
• Most links use MTU>=1500bytes today. • Try: traceroute –f www.mit.edu 1500 and
traceroute –f www.mit.edu 1501• (DF=1 set in IP header; routers send “ICMP” error
message, which is shown as “!F”).• Can you find a destination for which the path MTU
< 1500 bytes?
(c) Stanford Univ. (adapted from Mckeown's notes) 2.14
IP AddressesOriginally there were 5 classes:
CLASS “A” 1 7
0 Net ID Host-ID
CLASS “B” 10 Net ID Host-ID
24
2 14 16
CLASS “C” 110
Net ID Host-ID
3 21 8
CLASS “D”
1110
Multicast Group ID
4 28
CLASS “E” 11110 Reserved
5 27
A B C D0 232-1
(c) Stanford Univ. (adapted from Mckeown's notes) 2.15
IP Addressing
Problem: Address classes were too “rigid”. For most
organizations, Class C were too small and Class B too big. Led to very inefficient use of address space, and a shortage of addresses.
Organizations with internal routers needed to have a separate (Class C) network ID for each link.
And then every other router in the Internet had to know about every network ID in every organization, which led to large address tables.
Small organizations wanted Class B in case they grew to more than 255 hosts. But there were only about 16,000 Class B network IDs.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.16
IP Addressing
Two solutions were introduced: Subnetting is used within an organization to subdivide
the organization’s network ID. Classless Interdomain Routing (CIDR) was introduced in
1993 to provide more efficient and flexible use of IP address space across the whole Internet.
CIDR is also known as “supernetting” because subnetting and CIDR are basically the same idea.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.17
Subnetting
CLASS “B”e.g.
Company
10 Net ID Host-ID
2 14 16
10 Net ID Host-ID
2 14 16
0000
Subnet ID (20) SubnetHost ID (12)
10 Net ID Host-ID
2 14 16
1111
Subnet ID (20) SubnetHost ID (12)
10 Net ID Host-ID
2 14 16
000000
Subnet ID (22) SubnetHost ID (10)
10 Net ID Host-ID
2 14 16
1111011011
Subnet ID (26) SubnetHost ID (6)
e.g. Site
e.g. Dept
(c) Stanford Univ. (adapted from Mckeown's notes) 2.18
Classless Interdomain Routing (CIDR)Addressing
The IP address space is broken into line segments. Each line segment is described by a prefix. A prefix is of the form x/y where x indicates the prefix of all
addresses in the line segment, and y indicates the length of the segment.
e.g. The prefix 128.9/16 represents the line segment containing addresses in the range: 128.9.0.0 … 128.9.255.255.
0 232-1
128.9/16
128.9.0.0
216
142.12/19
65/8
128.9.16.14
(c) Stanford Univ. (adapted from Mckeown's notes) 2.19
Classless Interdomain Routing (CIDR)Addressing
0 232-1
128.9/16
128.9.16.14
128.9.16/20128.9.176/20
128.9.19/24
128.9.25/24
Most specific route = “longest matching prefix”
(c) Stanford Univ. (adapted from Mckeown's notes) 2.20
Classless Interdomain Routing (CIDR)Addressing
Prefix aggregation: If a service provider serves two organizations
with prefixes, it can (sometimes) aggregate them to form a larger prefix. Other routers can refer to this larger prefix, and so reduce the size of their address table.
E.g. ISP serves 128.9.14.0/24 and 128.9.15.0/24, it can tell other routers to send it all packets belonging to the prefix 128.9.14.0/23.
ISP Choice: In principle, an organization can keep its
prefix if it changes service providers.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.21
Size of the Routing Table at the core of the Internet
Source: http://www.telstra.net/ops/bgptable.html
0
20000
40000
60000
80000
100000
120000
140000
Aug-87 May-90 J an-93 Oct-95 J ul-98 Apr-01 J an-04
Num
ber
of
prefi
xes
(c) Stanford Univ. (adapted from Mckeown's notes) 2.22
Prefix Length Distribution
0
10000
20000
30000
40000
50000
60000
70000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Prefix Length
Num
ber
of P
refi
xes
Source: Geoff Huston, Oct 2001
(c) Stanford Univ. (adapted from Mckeown's notes) 2.23
Mapping Computer Names to IP addressesThe Domain Naming System (DNS)
Names are hierarchical and belong to a domain:– e.g. elaine17.stanford.edu– Common domain names: .com, .edu, .gov, .org, .net, .uk
(or other country-specific domain).– Top-level names are assigned by the Internet Corporation
for Assigned Names and Numbers (ICANN).– A unique name is assigned to each organization.
DNS Client-Server Model– DNS maintains a hierarchical, distributed database of
names.– Servers are arranged in a hierarchy.– Each domain has a “root” server.– An application needing an IP address is a DNS client.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.24
Mapping Computer Names to IP addressesThe Domain Naming System (DNS)
A DNS Query1. Client asks local server.2. If local server does not have address, it asks the root
server for the requested domain.3. Addresses are cached in case they are requested
again.
E.g. www.eecs.berkeley.edu
.stanford.edu
.berkeley.edu .eecs.berkeley.edu.edu
“What is the IP address of www.eecs.berkeley.edu?”
e.g. gethostbyname()
Clientapplication
Example: On elaine machines, try “host www.mit.edu” or “nslookup www.mit.edu”Question: Why does “host gates-gateway” return multiple IP addresses?
(c) Stanford Univ. (adapted from Mckeown's notes) 2.25
How a Router Forwards Datagrams
128.9/16128.9.16/20
128.9.176/20
128.9.19/24128.9.25/24
142.12/19
65/8
Prefix Port
3227213
128.17.14.1128.17.14.1
128.17.20.1
128.17.10.1128.17.14.1
128.17.16.1
128.17.16.1
Next-hop
R1
R2
R3
R4
12
3
128.17.20.1
128.17.16.1
e.g. 128.9.16.14 => Port 2
Forwarding/routing table
(c) Stanford Univ. (adapted from Mckeown's notes) 2.26
How a Router Forwards Datagrams
Every datagram contains a destination address.
The router determines the prefix to which the address belongs, and routes it to the“Network ID” uniquely identifies a physical network.
All hosts and routers sharing a Network ID share same physical network.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.27
Forwarding Datagrams
Is the datagram for a host on directly attached network?
If no, consult forwarding table to find next-hop.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.28
Inside a Router
ForwardingDecision
ForwardingDecision
ForwardingDecision
ForwardingTable
ForwardingTable
ForwardingTable
Interconnect
OutputScheduling
1.
2.
3.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.29
Forwarding in an IP Router
• Lookup packet DA in forwarding table.– If known, forward to correct port.– If unknown, drop packet.
• Decrement TTL, update header Checksum.
• Forward packet to outgoing interface.• Transmit packet onto link.
Question: How is the address looked up in a real router?
(c) Stanford Univ. (adapted from Mckeown's notes) 2.30
Making a Forwarding DecisionClass-based addressing
Class A Class B Class C D
212.17.9.4
Class A
Class B
Class C212.17.9.0 Port 4
Exact Match
Routing Table:
IP Address Space
212.17.9.0
Exact Match: There are many well-known ways to find an exact match in a table.
(c) Stanford Univ. (adapted from Mckeown's notes) 2.31
Error Reporting (ICMP)
Internet Control Message Protocol:– Used by a router/end-host to report some types
of error:– E.g. Destination Unreachable: packet can’t be
forwarded to/towards its destination. – E.g. Time Exceeded: TTL reached zero, or
fragment didn’t arrive in time. Traceroute uses this error to its advantage.
– An ICMP message is an IP datagram, and is sent back to the source of the packet that caused the error.