Download presentation
Presentation is loading. Please wait.
Published byKevin Horn Modified over 9 years ago
1
CPS-356- Computer Networks Class 9: IP-Continued Theophilus Benson Based partly on lecture notes by Rodrigo Fonseca, David Mazières, Phil Levis, John Jannotti
2
Administrivia Slides Updates – Class slides 08 updated – Class slides 06 updated – Class slides 07 uploaded – HW #1 put up on site Can we move exams?
3
Distance Vector Recap A B C 41 10 Neighbor information is preconfigured – The link cost to a neigh and the link to that neighbor Nodes exchange message with neighbors – (cost, dest) Pick the shortest paths A4A C1C A10A B1B B4B C1010 C
4
Distance Vector Recap A B C 41 10 Neighbor information is preconfigured – The link cost to a neigh and the link to that neighbor Nodes exchange message with neighbors – (cost, dest) Pick the shortest paths A4A C1C A10A B1B B4B C1010 C (B,4) (C,10) (A,10) (B,1) (A,4) (C,1)
5
Distance Vector Recap A B C 41 10 Pick the shortest paths A4A C1C A10A B1B B4B C1010 C From A (B,4), (C,10) From C (A,10), (B,1) From B (A,4), (C,1) From C (A,10), (B,1) From A (B,4), (C,10) From B (A,4), (C,1)
6
Distance Vector Recap A B C 41 10 Pick the shortest paths A4A C1C A10A B1B B4B C1010 C From A (B,4), (C,10) From C (A,10), (B,1) From B (A,4), (C,1) From C (A,10), (B,1) From A (B,4), (C,10) From B (A,4), (C,1)
7
Distance Vector Recap A B C 41 10 Pick the shortest paths A4A C1C A5B B1B B4B C5B From A (B,4), (C,10) From C (A,10), (B,1) From B (A,4), (C,1) From C (A,10), (B,1) From A (B,4), (C,10) From B (A,4), (C,1)
8
Distance Vector Recap A B C 41 10 Pick the shortest paths Update message are triggered by – Change in Routing Table – Or periodically every N seconds, by a timer A4A C1C A5B B1B B4B C5B (B,4) (C,5) (A,5) (B,1)
9
Good news travels fast A B C 41 10 1 A decrease in link cost has to be fresh information Network converges at most in O(diameter) steps A4A C1C A5B B1B B4B C5B
10
Good news travels fast A B C 41 10 1 A decrease in link cost has to be fresh information Network converges at most in O(diameter) steps A1A C1C A5B B1B B1B C5B (B,1) (C,10) (A,1) (C,1)
11
Good news travels fast A B C 41 1 A decrease in link cost has to be fresh information Network converges at most in O(diameter) steps A1A C1C A5B B1B B1B C5B (B,1) (C,10) (A,1) (C,1) 10
12
Good news travels fast A B C 41 1 A decrease in link cost has to be fresh information Network converges at most in O(diameter) steps A1A C1C A2B B1B B1B C5B (B,1) (C,10) (A,1) (C,1) 10
13
Good news travels fast A B C 41 1 A decrease in link cost has to be fresh information Network converges at most in O(diameter) steps A1A C1C A2B B1B B1B C2B 10 (A,2) (B,1) (C,2)
14
Bad news travels slowly A B C 41 10 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A1A C1C A5B B1B B1B C5B
15
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A6CA6C A4A C1C A5B B1B B1B C5B
16
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A12A C1C A5B B1B B1212 B C1313 B
17
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A12A C1C A5B B1B B1212 B C1313 B (A,5) (B,1)
18
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A6C C1C A5B B1B B1 C C1010 C (A,5) (B,1)
19
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A6C C1C A5B B1B B1 C C1010 C (A,6) (C,1)
20
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A6C C1C A7B B1B B1 C C1010 C (A,6) (C,1)
21
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A6C C1C A7B B1B B1 C C1010 C (A,7) (B,1)
22
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A8C C1C A7B B1B B1 C C1010 C (A,8) (C,1)
23
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A8C C1C A9B B1B B1 C C1010 C (A,9) (B,1)
24
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A10C C1C A9B B1B B1 C C1010 C (A,10) (C,1)
25
Bad news travels slowly A B C 41 10 12 An increase in cost may cause confusion with old information, may form loops Consider routes to A Initially, B:A,4,A; C:A,5,B Then B:A,12,A, selects C as next hop -> B:A,6,C C -> A,7,B; B -> A,8,C; C -> A,9,B; B -> A,10,C; C finally chooses C:A,10,A, and B -> A,11,C! A10C C1C A A B1B B1 C C1010 C (A,10) (C,1) (A,10) (B,1)
26
How to avoid loops IP TTL field prevents a packet from living forever – Does not repair a loop Simple approach: consider a small cost n (e.g., 16) to be infinity – After n rounds decide node is unavailable – But rounds can be long, this takes time Problem: distance vector based only on local information
27
Bad news travels slowly Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 12 A6C C1C A5B B1B B1 C C1010 C (A,6) (C,1) (A,5) (B,1)
28
Better loop avoidance Split Horizon – When sending updates to node A, don’t include routes you learned from A – Prevents B and C from sending cost 2 to A Split Horizon with Poison Reverse – Rather than not advertising routes learned from A, explicitly include cost of ∞. – Faster to break out of loops, but increases advertisement sizes
29
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A4A C1C A A B1B B4B C1010 C (B,4) (C,10) (A,10) (B,1) (A,4) (C,1)
30
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A4A C1C A5B B1B B4B C5B (B,4) (C,10) (A,10) (B,1) (A,5) (B,1) (B,4) (C,5)
31
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A12A C1C A5B B1B B1212 B C1313 B (B,4) (C,10) (A,10) (B,1) (A,5) (B,1) (B,4) (C,5) 12
32
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A12A C1C A5B B1B B1 C C1010 C (B,4) (C,10) (A,10) (B,1) (A,5) (B,1) (B,4) (C,5) 12
33
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A12A C1C A5B B1B B1 C C1010 C (A,10) (B,1) 12 (A,12) (C,1)
34
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A12A C1C A10B B1B B1 C C1010 C (A,10) (B,1) 12 (A,12) (C,1)
35
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A12A C1C A10B B1B B1 C C1010 C (A,10) (B,1) 12 (A,12) (C,1)
36
Split Horizon Why did it take a while to converge? – Nodes are unknowingly using each other A B C 41 10 A11A C1C A10B B1B B1 C C1010 C 12 (A,12) (C,1) (A,10) (B,1)
37
Warning Split horizon/split horizon with poison reverse only help between two nodes – Can still get loop with three nodes involved – Might need to delay advertising routes after changes, but affects convergence time
38
Other approaches DSDV: destination sequenced distance vector – Uses a ‘version’ number per destination message – Avoids loops by preventing nodes from using old information from descendants – But, you can only update when new version comes from root Path Vector: (BGP) – Replace ‘distance’ with ‘path’ – Avoids loops with extra cost
39
Link State Routing Strategy: – send to all nodes information about directly connected neighbors Link State Packet (LSP) – ID of the node that created the LSP – Cost of link to each directly connected neighbor – Sequence number (SEQNO) – TTL
40
Time 0: Generate LSP from Config File and Send out Updates A B C 4 1 10 D 5 6 Directly Connected Neighbors are pre- configured into the device B4 C1
41
Time 0: Generate LSP from Config File and Send out Updates A B C 4 1 10 D 5 6 Directly Connected Neighbors are pre- configured into the device B4 C1
42
Reliable Flooding Store most recent LSP from each node – Ignore earlier versions of the same LSP Forward LSP to all nodes but the one that sent it Generate new LSP periodically – Increment SEQNO Start at SEQNO=0 when reboot – If you hear your own packet with SEQNO=n, set your next SEQNO to n+1 Decrement TTL of each stored LSP – Discard when TTL=0
43
Time 1: Receive LSPs When a node gets an LSA, it floods it on all ports except the port it received it from. A B C 4 1 10 D 5 6 B4 C1 B4 C1
44
Time 1: Receive LSPs When a node gets an LSA, it floods it on all ports except the port it received it from. A B C 4 1 10 D 5 6 B4 C1 B4 C1
45
Time 10: Regenerate LSP and send out A B C 4 1 10 D 5 6 Generate new LSP periodically – Increment SEQNO
46
Calculating best path Djikstra’s single-source shortest path algorithm – Each node computes shortest paths from itself Let: – N denote set of nodes in the graph – l(i,j) denote the non-negative link between i,j ∞ if there is no direct link between i and j – C(n) denote the cost of path from s to n – s denotes yourself (node computing paths) Initialize variables – M = {s} (set of nodes incorporated thus far) – For each n in N-{s}, C(n) = l(s,n) – Next(n) = n if l(s,n) < ∞, – otherwise
47
Djikstra’s Algorithm While N≠M – Let w ∈ (N-M) be the node with lowest C(w) – M = M {w} – Foreach n ∈ (N-M), if C(w) + l(w,n) < C(n) then C(n) = C(w) + l(w,n), Next(n) = Next(w) Example: D: (D,0,-) (C,2,C) (B,5,C) (A,10,C)
48
Draw Backs of Link State Protocols
49
Scalability – A lot of Network packets (Flooding of LSPs) – A lot computation overhead, for each router: Router Memory: to store entire network Router CPU: to calculate Dijkstra
50
To Scale Add Areas (Hierarchy) A B C D Divide into backbone and other areas F E X Y Z Area 1 Area 2 Backbone (Area 0)
51
To Scale Add Areas (Hierarchy) A B C D Divide into backbone and other areas An area must know how to route within itself – LSPs are contained to an area: never flood outside of your area – This provides scaling properties To route between two areas, you must go through the backbone F E X Y Z Area 1 Area 2 Backbone (Area 0)
52
To Scale Add Areas (Hierarchy) A B C Divide into backbone and other areas An area must know how to route within itself – LSPs are contained to an area: never flood outside of your area – This provides scaling properties in all areas except Area 0 To route between two areas, you must go through the backbone Backbone know how to route between areas but not how to route within other areas. – Backbone views each area as one node – Allows scaling in the backbones Area 1 Area 2 Backbone (Area 0)
53
Distance Vector vs. Link State Distance VectorLink State # of MessagesO(d), where d is degree of node O(nd) for n nodes in system Computationconvergence time varies (e.g., count- to-infinity) O(n 2 ) with O(nd) messages Robustness: what happens with malfunctioning router? Nodes can advertise incorrect path cost Others can use the cost, propagates through network Nodes can advertise incorrect link cost May get correct link information from another node
54
Metrics Original ARPANET metric – measures number of packets enqueued in each link – neither latency nor bandwidth in consideration New ARPANET metric – Stamp arrival time (AT) and departure time (DT) – When link-level ACK arrives, compute Delay = (DT – AT) + Transmit + Latency – If timeout, reset DT to departure time for retransmission – Link cost = average delay over some time period Fine Tuning – Compressed dynamic range – Replaced Delay with link utilization Today: commonly set manually to achieve specific goals
55
Examples of Distance Vector & Link State Distance Vector: RIPv2 – Fairly simple implementation of DV – RFC 2453 (38 pages) Link State: OSPF (Open Shortest Path First) – More complex link-state protocol – Adds notion of areas for scalability – RFC 2328 (244 pages)
56
RIPv2: Default on Several Cisco Routers Runs on UDP port 520 Link cost = 1 Periodic updates every 30s, plus triggered updates Relies on count-to-infinity to resolve loops – Maximum diameter 15 (∞ = 16) – Supports split horizon, poison reverse Deletion – If you receive an entry with metric = 16 from parent OR – If a route times out
57
Packet format
58
RIPv2 Entry
59
Route Tag field Allows RIP nodes to distinguish internal and external routes Must persist across announcements E.g., encode AS
60
Next Hop field Allows one router to advertise routes for multiple routers on the same subnet Suppose only XR1 talks RIPv2:
61
OSPFv2: Costs more to activate on Several Cisco Routers Link state protocol Runs directly over IP (protocol 89) – Has to provide its own reliability All exchanges are authenticated Adds notion of areas for scalability
62
Other Routing Protocols Routing Protocol NameType of Protocol IS-IS (intermediate system –to- intermediate system)Link State Protocol IGRP (Interior Gateway Routing Protocol)Distance Vector Protocol BGP (border Gateway Protocol)Distance-Vector (with Paths) “Path-Vector”
63
Now You Have Your Routes, what next?
64
Bring it All Together: Ethernet + IP Step 0: Operator preconfigures routers with IP addresses Router B Router C G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24
65
Bring it All Together: Ethernet + IP Step 1: Router builds Routing Table using Routing Protocol Router B Router C G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24
66
Bring it All Together: Ethernet + IP Step 2: Get Your IP Address (DHCP) Router B Router C G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24
67
Bring it All Together: Ethernet + IP Step 2: Bonus Switch Learns (Learning Switch) Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
68
Bring it All Together: Ethernet + IP Step 2: Bonus Switch Learns (Learning Switch) Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
69
Bring it All Together: Ethernet + IP Step 3: Get Dest-IP Address (DNS) Source: MAC_A:128.35.7.2 Dest:UNKnown MAC: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
70
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
71
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y Compare your IP address with destination IP address Source IP: 128.35.7.2 You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255 Dest IP: 128.35.7.5 Destination is in your network range, so you have to send to the destination!!! So you ARP for the MAC address of the destination. Compare your IP address with destination IP address Source IP: 128.35.7.2 You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255 Dest IP: 128.35.7.5 Destination is in your network range, so you have to send to the destination!!! So you ARP for the MAC address of the destination.
72
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
73
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->B IP: A->B
74
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.35.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->B IP: A->B
76
Bring it All Together: Ethernet + IP Step 3: Get Dest-IP Address (DNS) Alice to Eve Source: MAC_A:128.35.7.2 Dest:UNKnown MAC: 128.35.9.9 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
77
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Alice to Eve Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.9.9 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
78
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Alice to Eve Source: MAC_A:128.35.7.2 Dest:UnKnown MAC: 128.35.9.9 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y Compare your IP address with destination IP address Source IP: 128.35.7.2 You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255 Dest IP: 128.35.9.9 Destination is not in your network range, so you have to send to router!!! So you ARP for the MAC address of the router. Compare your IP address with destination IP address Source IP: 128.35.7.2 You netmask is 128.35.7.*/24 so you network has: 128.35.7.0-128.35.7.255 Dest IP: 128.35.9.9 Destination is not in your network range, so you have to send to router!!! So you ARP for the MAC address of the router.
79
Bring it All Together: Ethernet + IP Step 4: Get Dest MAC Address (ARP) Source: MAC_A:128.35.7.2 Dest: MAC_Y: 128.35.9.9 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y
80
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5 Router Z MAC_Z Router Y MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->Y IP: A->E
81
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->Z IP: A->E
82
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->E IP: A->E
83
Bring it All Together: Ethernet + IP Step 5: Send packets Source: MAC_A:128.35.7.2 Dest: MAC_B: 128.357.5 Router B MAC_Z Router C MAC_Y G H G H 128.35.8.*/24 128.35.6.*/24 128.35.9.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 128.35.6.*/24 128.35.9.*/24 128.35.8.*/24 128.35.7.*/24 MAC_A: 128.35.7.2 MAC_B: 128.35.7.5 MAC_E: 128.35.9.9 MAC_A MAC_B MAC_Y MAC_E MAC_Z MAC_E MAC_Z MAC_A MAC_B MAC_Y MAC: A->Z IP: A->E
84
What Limitations Does Ethernet Have? Minimum Packet Size – 64Bytes (512 bits): To ensure that collisions are detected! – Bandwidth-Delay-Product*2 Maximum Ethernet LAN size – 2500 meters: Due to signal decay, any longer and packets would not be delivered
85
A Router Does Two Things Forwarding (per-node operation): – how to pass a packet from an input interface to the output interface of a router – Destination based forwarding Check destination IP and look it up in your forwarding table Routing (distributed algorithm): – how to find and setup a route? Implemented by dynamic routing protocols – OSPF, RIP
86
Forwarding Due to CIDR, Routers use longest prefix match From 128.35.6.0To: 123.35.6.255 From 128.35.0.0To: 123.35.255.255 From 128.35.6.3To: 123.35.6.3 From 128.35.7.0To: 128.35.7.255 Router Forwarding Table After OSPF or RIP 128.35.6.*/24, fwd port 1 128.35.*.*/16, fwd port 3 128.35.6.3/32, fwd port 6 128.35.7.*/24, fwd port 18
87
Forwarding Due to CIDR, Routers use longest prefix match 128.35.6.*/24, fwd port 1 128.35.*.*/16, fwd port 3 128.35.6.3/32, fwd port 6 128.35.7.*/24, fwd port 18 From 128.35.6.0To: 123.35.6.255 From 128.35.0.0To: 123.35.255.255 From 128.35.6.3To: 123.35.6.3 From 128.35.7.0To: 128.35.7.255 Router Forwarding Table After OSPF or RIP
88
Forwarding Due to CIDR, Routers use longest prefix match From 128.35.6.0To: 123.35.6.255 From 128.35.0.0To: 123.35.255.255 From 128.35.6.3To: 123.35.6.3 From 128.35.7.0To: 128.35.7.255 Router Forwarding Table After OSPF or RIP Packet with destination: 128.35.6.3. Which entry does it match? What port does it get forwarded on? 128.35.6.*/24, fwd port 1 128.35.*.*/16, fwd port 3 128.35.6.3/32, fwd port 6 128.35.7.*/24, fwd port 18
89
Forwarding Due to CIDR, Routers use longest prefix match From 128.35.6.0To: 123.35.6.255 From 128.35.0.0To: 123.35.255.255 From 128.35.6.3To: 123.35.6.3 From 128.35.7.0To: 128.35.7.255 Router Forwarding Table After OSPF or RIP Packet with destination: 128.35.6.8 Which entry does it match? What port does it get forwarded on? 128.35.6.*/24, fwd port 1 128.35.*.*/16, fwd port 3 128.35.6.3/32, fwd port 6 128.35.7.*/24, fwd port 18
90
Router Versus Switches Router Runs multiple switching protocols: Ethernet, ATM – Switches between techs Runs routing protocols Runs DHCP Needs a common address across techs: IP address – E.g. Ethernet addresses make no sense to ATM hosts Switches Runs one switching protocol – Can only work with same tech Dictates how bits become signals Dictates how bits becomes a packet/frame Needs hardware addresses to identify hosts/switches
91
Summary This Class – Link State protocols – Link State V. Distance Vector – Routing V Forwarding – How routing works within one ISP/AS Next Class – Inter-Domain routing – Routing over the Wide Area Network
92
Network Address Translation (NAT) Despite CIDR, it’s still difficult to allocate addresses (2 32 is only 4 billion) We’ll talk about IPv6 later NAT “hides” entire network behind one address Hosts are given private addresses Routers map outgoing packets to a free address/port Router reverse maps incoming packets Problems?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.