Documente Academic
Documente Profesional
Documente Cultură
EE/CS 6713
Internetworking I
Simple Internetworking (IP)
Dr. Amir Qayyum
Internetworking
Outline
Best Effort Service Model Global Addressing Scheme
What we understand
Concepts of networking and network programming
Elements of networks: nodes and links Building a packet abstraction on a link
We also understand
How switches may provide indirect connectivity
Different ways to move through a network (forwarding) Bridge approach to extending LAN concept Example of a real virtual circuit network (ATM) How switches are built and contention within switches
Internetworking
Outline Best Effort Service Model Global Addressing Scheme
Internetworking
Reading: Peterson and Davie, Ch. 4 Basics of Internetworking Heterogeneity
The IP protocol, address resolution, control messages
Internetworking
Routing moving forward with IP
Building forwarding information
Basics of Internetworking
What is an internetwork?
Illusion of a single (direct link) network Built on a set of distributed, heterogeneous networks Abstraction typically supported by software
Properties
Supports heterogeneity: independent of architecture, operating system, network type and topology Scales to global connectivity
The Internet:
Specific global internetwork that grew out of ARPANET
9
TCP
UDP
IP
FDDI
Ethernet
ATM
10
IP Service Model
Provided to transport layer (TCP, UDP)
Global name space Host-to-host connectivity (connectionless) Best effort packet delivery (datagram-based)
Internetworks
Large scalable heterogeneous network of networks with efficient routing Collection of networks providing host-to-host packet delivery service A logical network built out of the physical networks connected by routers Internet Protocol (IP) runs on all nodes to make them function as a single logical internetwork
13
Internetwork
Concatenation of networks
H1 H6 R3 Network 2 Point -topoint R2 H4 H7
R1
Protocol stack
H1 TCP IP ETH ETH IP PPP PPP R1 IP FDDI FDDI R2 IP ETH R3 H8 TCP IP ETH
14
Global Addresses
Properties
32 bit long hierarchical addresses: network + host Globally unique, maps to interfaces rather than hosts Exception is service request splitting, as is done with large web servers, for example
IP Addresses
7 bits (126 nets) Class A: 0 Network 14 bits (16k nets) Class B: 1 0 Network 21 bits (2 million nets) Class C: 1 1 0 Network 24 bits (16 million hosts) Host 16 bits (64K hosts) Host 8 bits (256) Host
host in class A network (MIT) host in class B network (UIUC) host in class C network
Datagram Format
0 Version 4 HLen Ident TTL Protocol SourceAddr DestinationAddr Options (variable) Data Pad (variable) 8 TOS Flags 16 19 Length Offset Checksum 31
4-bit version (4 for IPv4, 6 for IPv6) 4-bit header length (in words, minimum of 5) 8-bit type of service (TOS); more or less unused 16-bit datagram length (in bytes) 8-bit protocol (e.g., TCP=6 or UDP=17)
17
Datagram Format
0 Version 4 HLen Ident TTL Protocol SourceAddr DestinationAddr Options (variable) Data Pad (variable) 8 TOS Flags 16 19 Length Offset Checksum 31
Fragmentation support
16-bit packet ID (identifies packet fragments) 3-bit flags; one bit marks last fragment 13-bit fragment offset into packet (in 8-byte words)
Datagram Format
16-bit IP checksum on header 32-bit source IP address 32-bit destination IP address Options and padding (variable length)
Source-based routing (typically disabled) 0 4 8 16 Record route TOS Version HLen Several others Ident Flags
TTL Protocol SourceAddr DestinationAddr Options (variable) Data Pad (variable) 19 Length Offset Checksum 31
19
ETH IP (1400)
FDDI IP (1400)
512 data bytes Start of header 1 Offset= 64 Rest of header 512 data bytes
Start of header Ident= x 0 Rest of header 1400 data bytes Offset= 0 Ident= x Start of header 0 Offset= 128 Rest of header 376 data bytes
22
Datagram Forwarding
Hosts and routers maintain forwarding tables Forwarding table maps network number to next hop
List of (network/host, next hop) pairs
Very simple (and static) table on hosts Complex (and dynamic) table on routers Network Number Next Hop Example (R2)
1 R3 2 R1 3 interface 1 4 interface 0
23
Datagram Forwarding
Network # 18.0.0.0 128.32.0.0 0.0.0.0
dest: 18.26.10.0 dest: 128.16.14.0
not matched mask with 255.0.0.0 mask with 255.255.0.0 not matched matched! send to port 3 mask with 0.0.0.0
24
Datagram Forwarding
Every datagram contains destinations address Network portion of address is compared with pairs in the forwarding table If directly connected to destination network, then forward to host If not directly connected to destination network, then forward to some (default) router In both the cases (sending directly or indirectly to host), use ARP to pass to physical layer
25
Address Translation
IP route can cross many physical networks Delivers to destinations physical network Hosts listen for packets marked with physical interface names
Each (next) hop along route Destination host
Fixed table
Centrally maintained Distributed to all hosts
ARP Details
Table entries are discarded if not refreshed; time out O(10) minutes Do not refresh table entries upon reference ARP packet format
HardwareType: type of physical network (e.g. ethernet) ProtocolType: type of higher layer protocol (e.g., IP) HLEN & PLEN: length of physical and protocol addresses Operation: request or response Source/Target-Physical/Protocol addresses
29
Operation 3) 1) 1)
30
ARP in ATM
LAN Emulation can be used to broadcast ARP messages
quite inefficient in large, wide area ATM network
ARP in ATM
In LIS model, large number of hosts and routers can be connected to a big ATM network Each LIS has an ARP server and each node in the LIS has ATM address of the server Hosts on different subnets communicate via router
10.0.0.2 H1 10.0.0.1 LIS 10 LIS 12 R 12.0.0.3 12.0.0.5 H2
ATM network
32
TCP
UDP
IP
ICMP
FDDI
Ethernet
ATM
33
ICMP Message
Sent to the source when a node is unable to process IP datagram successfully Error messages
Destination unreachable (protocol, port, or host) Reassembly failed IP Checksum failed; or invalid header TTL exceeded (so datagrams dont cycle forever) Cannot fragment
Control messages
Echo (ping) request and reply Redirect (from router to source host, to change route)
34
Host Configuration
Unlike Ethernet addresses, IP addresses are not fixed by the manufacturer
no guarantee of global uniqueness flexibility to reconfigure IP addresses
35
Dynamic Configuration
Plug new host into network
How much information must be known ? What new information must be assigned ? How can process be automated ?
Some answers
Host needs an IP address (must know it) Host must also Send packets out of physical (direct) network Thus needs physical address of router
36
Each host is not configured for DHCP server, it performs a DHCP server discovery
A broadcast discovery message is sent by the host and a unicast reply is sent by the server
38
DHCP Operation
New machine sends request to DHCP server for assignment and information Server receives
Directly if new machine given servers IP address Through broadcast if on same physical network Via DHCP relay nodes that forward requests onto the servers physical network
Server assigns IP address and provides other info Can be made secure (present signed request or just a valid physical address)
39
DHCP Server
A DHCP server is not required in each network
A DHCP relay agent is used to relay the DHCP request to the server
Unicast to server
Broadcast
DHCP relay
Other networks
DHCP server
Host
40
Controlled capacity
Change router drop and priority policies Provide guarantees on bandwidth, delay, etc.
41
42
L Physical links
M Virtual circuits
(b)
43
IP Tunneling
Allows gradual extension
e.g., multicast Develop multicast-capable switches and routers Install on 5-10 university campuses Routers between universities do not support multicasttoo bad!
IP Tunneling
data IP data IP IP
IP multicast IP multicast
da ta IP IP
IPv4
IP multicast IP multicast
CASE
UET
IP Tunnel in VPNs
Virtual point-to-point link between a pair of nodes separated by many networks
Network 1 R1 Internetwork R2 10.0.0.1 IP header, Destination = 2.x IP payload IP header, Destination = 10.0.0.1 IP header, Destination = 2.x IP payload
46
Network 2
47
Disadvantages of Tunneling
Increases packet size Adds processing delays (and requires processing power) Management overhead at tunnel entries and exits Of course
1 is attractive compared to 0 (not working) So lots of research extensions use tunneling
48
Routing
How do routers acquire information in their forwarding tables ?
Algorithms Scalability
Routing
Pir Wadhai Islamabad
Rawal Dam
What is Routing ?
Definition: task of constructing and maintaining forwarding information (in hosts or in switches) Goals for routing
Capture notion of best routes Propagate changes effectively Require limited information exchange Admit efficient implementation
Forwarding vs Routing
Forwarding: to select an output port based on destination address and routing table Routing: process by which routing table is built Forwarding table: enough information to accomplish the forwarding function; optimized for forwarding Routing table: built by routing algorithms to build forwarding table; optimized for topology changes Routing Table: Network # (10) - Next hop (171.69.245.10) Forwarding Table: Network # (10) - interface (if0) - MAC (8:0:2b:e4:b:1:2) 52
Routing Overview
Hierarchical routing infrastructure defines routing domains
Where all routers are under same administrative control
Network as a Graph
Nodes are routers Edges are links Each link has a cost
3 4 C B 9
A 1 1 1 D E
6 2 F
53
54
Routing Outline
Algorithms
Static shortest path algorithms Bellman-Fordall pairs shortest paths to destination Dijkstras algorithmsingle source shortest path Distributed, dynamic routing algorithms Distance vector routing (based on Bellman-Ford) Link state routing (Dijkstras algorithm at each node)
Bellman-Ford Algorithm
Static, centralized algorithm, (local iterations/dest) Requires: directed graph with edge weights (costs) Calculates: shortest paths for all directed pairs Check use of each node as successor in all paths For every node N
for each directed pair (B,C) is the path B N C better than B .C ? is cost BNdest smaller than previously known ?
For N nodes
Uses an NxN matrix of (distance, successor) values
57
Bellman-Ford Algorithm
infinity infinity infinity 8 8
source 6
C C
infinity infinity 3 3 3
A 2
B B B
infinity 1 1 1 1
B
Dest Dest Dest Dest
1
infinity infinity 7 7 6
1 2
E E E infinity 5 5 4 4
1 destination
Dest Dest A A
E 5
After n iterations, nodes at distance n hops along the shortest path have correct information
58
Dijkstras Algorithm
Static, centralized algorithm, build tree from source Requires directed graph with edge weights (distances) Calculates: shortest paths from one node to all others Greedily grow set S of known minimum paths From node N
Start with S = {N} and one-hop paths from N Loop n-1 times add closest outside node M to S for each node P not in S
is the path N .....M .P better than N.... P ?
59
Dijkstras Algorithm
1 2 2 3 4 10 6 8
1 2 3 4 5 6 7 8 9
3 9 7 1 2
3 4 7 2 2 6
1 3
10 11 12 13 14 15
60
Exchange updates of distance vector (Destination, Cost) with directly connected neighbors (known as advertising the routes)
periodically (on the order of several seconds to minutes) whenever vector changes (called triggered update)
61
Refresh existing routes; delete if they time out Local failure detection
Control message not ACKd Time out on periodic route update
Used in original ARPANET (until 1979) Early Internet: Routing Information Protocol (RIP) Early versions of DECnet and Novell IPX
62
63
64
65
B A
66
B C A D E
67
B C D E
68
69
Split Horizon
Avoid counting to infinity by solving mutual deception problem When sending an update to node X, do not include destinations that you would route through X
If X thinks route is not through you, no effect If X thinks route is through you, X will timeout route
C:2:B
D D
A A
C:2:B
B B
C:1:C C::-
C C
71
72
73
Reliable Flooding
X A X A
B (a)
B (b)
B (c)
B (d)
76
Used in
ARPANET: bad heuristics brought down network in 1981 Internet: Open Shortest Path First (OSPF) Intermediate System-Intermediate System (IS-IS)
Designed for DECnet Adopted by ISO for connectionless network layer protocol (CNLP) Used in NSFNET backbone (and others) some digital cellular systems Minor variant in Novell NetWare
77
Let
N denotes set of nodes in the graph l (i, j) denotes non-negative cost (weight) for edge (i, j) s denotes this node M denotes the set of nodes incorporated so far C(n) denotes cost of the path from s to node n
M = {s} for each n in N - {s} C(n) = l(s, n) // calculate cost to each node while (M != N) M = M union {w} such that C(w) is the minimum for all w in (N - M) for each n in (N - M) C(n) = MIN(C(n), C (w) + l(w, n ))
78
79
4.
If tentative is empty, stop. Otherwise pick entry from tentative with the lowest cost, move it to confirmed and return to step 2.
80
Route Calculation
At node D Confirmed list Tentative list 1. (D,0,-) 2. (D,0,-) (C,2,C), (B,11,B) 3. (D,0,-), (C,2,C) (B,11,B) 4. (D,0,-), (C,2,C) (B,5,C), (A,12,C) 5 5. (D,0,-), (C,2,C), (B,5,C) (A,12,C) 6. (D,0,-), (C,2,C), (B,5,C) (A,10,C) A 7. (D,0,-), (C,2,C), (B,5,C), (A,10,C)
B 3 10 11 D
81
C 2
Additional hierarchy
Domains are split into areas Routers only need to know how to reach every node in a domain Routers need to know how to get to the right area Load balancing Allows traffic to be distributed over multiple routes
82
hierarcical path
shortest path
84
Link State
Communicate information to entire network Exchange information about neighbors only
85
A few to discuss
Original ARPANET New ARPANET Revised ARPANET
86
Use queue length as distance (number of packets waiting to use a link) Problems
Uniform bandwidth assumption became invalid Latency comparable to 1kB transmission delay on 1.544 Mbps link
87
91
92
MN
MN
MN
93
One solution is to acquire new address via DHCP If host changes the network frequently, keeping a single address would be beneficial
Avoids termination of connection while in move
94
Mobile IP
Mobile-IP is a solution that works without any changes to non-mobile hosts (typical of IETF)
Supports both mobility and geographic aggregation
A router known as home agent (HA) is required at the home network of the mobile host Mobile host (MH) uses permanent home address, and remains connected as it roams A router known as foreign agent (FA) is required at the network to which the mobile host attaches
95
Mobile IP
Home & foreign agents send advertisement messages Mobile host attaches to a nearby foreign agent
Mobile host communicates home agent address Foreign agent contacts home agent to communicate care-of-address
Sending host Home agent (10.0.0.3) (network 10) Home network Internetwork
IP tunnel
96
Mobile IP - Features
Transparent routing of packets to a mobile host No modification of existing routers or non-mobility supporting hosts Mobile Host (MH) is assigned a unique home address within its home network Other hosts communicating with the MH always use MHs home address Foreign agent (FA) maintains a mapping of the MHs home address to its care-of-address
97
98
Mobile IP - Challenges
How does the MH get a local IP address ? How does the HA intercept a packet that is destined for the MH ? How does the HA then deliver the packet to the FA ? How does the FA deliver the packet to the MH ?
99
100
Mobile IP
Home agent is required to intercept all packets for the mobile host
it sends a gratuitous ARP to use proxy-ARP when mobile host registers with foreign agent
Home agent uses tunneling (IP-in-IP) to forward packets of mobile host to foreign agent Foreign agent strips the extra IP header and forwards the packet to the mobile host Mobile host can behave as foreign agent, if absent
101
Handoff between FA
Causes connection to be rerouted through HA
102
HA
104
Home Agent
FA2
MH
105
106
Reactive protocols
DSR (Dynamic Source Routing) AODV (Ad hoc On-demand Distance Vector) Routing