CSE 30264 Computer Networks
description
Transcript of CSE 30264 Computer Networks
![Page 1: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/1.jpg)
CSE 30264
Computer Networks
Prof. Aaron StriegelDepartment of Computer Science & Engineering
University of Notre Dame
Lecture 11 – February 16, 2010
![Page 2: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/2.jpg)
CSE 30264 2
Today’s Lecture
• Internetworking– Local Network– NAT– ICMP
• Routing– Routing in the WAN
Spring 2010
Physical
Data
Network
Transport
Application
![Page 3: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/3.jpg)
Spring 2010 CSE30264 3
Internetworking
Outline Local Network Routing
![Page 4: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/4.jpg)
CSE 30264 4
Routing Table – netscale01
Spring 2010
Mask result
Local or next hop?
Interface to pass to
![Page 5: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/5.jpg)
Spring 2009 CSE30264 5
Datagram Forwarding • Strategy
– Always have dest address• In IP header
– Two choices• Local network (subnet)
– Pass it off directly• Not on my local network
– Pass to some router– Routing table
• Maps network to next hop• Routing entries• Default router How do I find that next hop?
Have IP, need Ethernet
![Page 6: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/6.jpg)
Spring 2009 CSE30264 6
Address Translation • Layer 3 -> Layer 2 Translation
– IP -> Ethernet– Destination host– Next hop router
• Techniques– Do nothing
• Make Layer 2 part of Layer 3 address
– Table• Convert Layer 3 to Layer 2
• ARP – Address Resolution Protocol– Broadcast, observe, refresh
![Page 7: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/7.jpg)
CSE 30264 7
Example – ARP Table
Spring 2010
![Page 8: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/8.jpg)
CSE 30264 8
ARP Key Concepts• Broadcast request
– Send to FF:FF:FF:FF:FF:FF– Who is 129.74.50.20?
• Says AA:BB:CC:DD:EE:FF of 129.74.153.157• Response
– Respond directly or broadcast– I am 01:34:57:AB:CD:EF, aka 129.74.50.20
• Interesting concepts– Broadcast locally only – not
beyond the router– Soft state
• Old entries periodically expire– Nosy neighbor
• Note ARP requests of others
Spring 2010
![Page 9: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/9.jpg)
Spring 2009 CSE30264 9
ARP Details
• Request Format– HardwareType: type of physical network (e.g., Ethernet)– ProtocolType: type of higher layer protocol (e.g., IP)– HLEN: Length of physical (hardware) address– PLEN: Length of protocol addresses– Operation: request or response – Source/Target-Physical/Protocol addresses
• Notes– Table entries timeout in about 15 minutes– Update table with source when you are the target – Update table if already have an entry– Do not refresh table entries upon reference
![Page 10: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/10.jpg)
Spring 2009 CSE30264 10
ARP Packet Format
TargetHardwareAddr (bytes 2 – 5) TargetProtocolAddr (bytes 0 – 3)
SourceProtocolAddr (bytes 2 - 3)
Hardware type = 1 ProtocolType = 0x0800
SourceHardwareAddr (bytes 4 – 5)TargetHardwareAddr (bytes 0 – 1)SourceProtocolAddr (bytes 0 – 1)
HLen = 48 PLen = 32 OperationSourceHardwareAddr (bytes 0 - 3)
0 8 16 31
![Page 11: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/11.jpg)
CSE 30264 11
Observe the Packets
Spring 2010
Wireshark
www.wireshark.org
![Page 12: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/12.jpg)
CSE 30264 12
Addressing
Spring 2010
• How do I get my initial IP address?• Static IP
• System Administrator• Private network space• Know IP, mask, subnet, gateway, DNS
• Dynamic IP BOOTP / DHCP• I don’t know my IP, please tell me• Two flavors
• Anybody can come in• Authenticated / MAC filtered
![Page 13: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/13.jpg)
Spring 2009 CSE30264 13
DHCP
• Dynamic Host Configuration Protocol
![Page 14: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/14.jpg)
Spring 2009 CSE30264 14
DHCP
![Page 15: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/15.jpg)
CSE 30264 15
More on DHCP
• Uses UDP– Why not TCP?
• Nearly all sites use DHCP– Static server only
• Other notes– Lease time for IP address– Variety of option fields
• Thin clients
Spring 2010
![Page 16: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/16.jpg)
CSE 30264 16
NAT – Network Address Translation
• Limited public IP space– Share addresses
Spring 2010
I’ll give you one IP address via DHCP
Xfinity The largerInternet
???
![Page 17: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/17.jpg)
CSE 30264 17
Enter the NAT• Translate private address to public
– Private network space• 10.*• 192.168.*
– Translate via table• Use connection tuple
– Src IP, Dst IP, Src Port, Dst Port
Spring 2010
67.56.43.2192.168.1.1
192.168.1.100
192.168.1.101
DHCP Server
![Page 18: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/18.jpg)
CSE 30264 18
NAT Table
• Must originate from inside– Map internal tuple to external tuple
Spring 2010
67.56.43.2192.168.1.1
S: 192.168.1.100D: 25.78.200.3TCPSP: 9876DP: 80
S: 67.56.43.2D: 25.78.200.3TCPSP: 42778DP: 80
Mapping Table Ext: 67.56.43.2:42778 25.78.200.3:80 Int: 192.168.1.100:9876 25.78.200.3.80
![Page 19: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/19.jpg)
CSE 30264 19
Mapping Table
• Maintain a list of all active connections– Map across the boundary– New connection
• Pick an unused external port• Issues
– Reach internal host from external (SSH)• DMZ – One host becomes a catch all
– Scalability– UDP– IPsec / VPN
Spring 2010
![Page 20: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/20.jpg)
Spring 2009 CSE30264 20
Internet Control Message Protocol (ICMP)
• Echo (ping)• Redirect (from router to source host)• Destination unreachable (protocol, port, or host)• TTL exceeded (so datagrams don’t cycle forever)• Checksum failed • Reassembly failed• Cannot fragment
![Page 21: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/21.jpg)
Spring 2009 CSE30264 21
Routing
OutlineDistance VectorLink State
![Page 22: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/22.jpg)
Spring 2009 CSE30264 22
Overview• Forwarding vs Routing
– forwarding: to select an output port based on destination address and routing table
– routing: process by which routing table is built• Network as a Graph
• Problem: Find lowest cost path between two nodes• Factors
– static– dynamic
![Page 23: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/23.jpg)
Spring 2009 CSE30264 23
Distance Vector• Each node maintains a set of triples
– (Destination, Cost, NextHop)• Directly connected neighbors exchange updates
– periodically (on the order of several seconds)– whenever table changes (called triggered update)
• Each update is a list of pairs:– (Destination, Cost)
• Update local table if receive a “better” route– smaller cost– came from next-hop
• Refresh existing routes; delete if they time out
![Page 24: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/24.jpg)
Spring 2009 CSE30264 24
Example
Destination Cost NextHop A 1 A
C 1 C D 2 C
E 2 A F 2 A G 3 A
![Page 25: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/25.jpg)
Spring 2009 CSE30264 25
Routing Loops• Example 1
– F detects that link to G has failed– F sets distance to G to infinity and sends update t o A– A sets distance to G to infinity since it uses F to reach G– A receives periodic update from C with 2-hop path to G– A sets distance to G to 3 and sends update to F– F decides it can reach G in 4 hops via A
• Example 2– link from A to E fails– A advertises distance of infinity to E– B and C advertise a distance of 2 to E– B decides it can reach E in 3 hops; advertises this to A– A decides it can read E in 4 hops; advertises this to C– C decides that it can reach E in 5 hops…
![Page 26: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/26.jpg)
Spring 2009 CSE30264 26
Loop-Breaking Heuristics
• Set infinity to 16• Split horizon• Split horizon with poison reverse
![Page 27: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/27.jpg)
Spring 2009 CSE30264 27
Routing Information Protocol (RIP)
• Distributed along with BSD Unix• Straightforward implementation of DV• Updates sent every 30 seconds• Link costs constant at 1 (16 = infinity)
![Page 28: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/28.jpg)
Spring 2009 CSE30264 28
Link State• Strategy
– send to all nodes (not just neighbors) information about directly connected links (not entire routing table)
• Link State Packet (LSP)– id of the node that created the LSP– cost of link to each directly connected neighbor– sequence number (SEQNO)– time-to-live (TTL) for this packet
![Page 29: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/29.jpg)
Spring 2009 CSE30264 29
Link State (cont)
• Reliable flooding– store most recent LSP from each node– forward LSP to all nodes but one that sent it– generate new LSP periodically
• increment SEQNO– start SEQNO at 0 when reboot– decrement TTL of each LSP
• discard when TTL=0
![Page 30: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/30.jpg)
Spring 2009 CSE30264 30
Link State (cont)
![Page 31: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/31.jpg)
Spring 2009 CSE30264 31
Route Calculation• Dijkstra’s shortest-path algorithm• 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)while (N != M)
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 ))
![Page 32: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/32.jpg)
Spring 2009 CSE30264 32
OSPF
• Open Shortest Path First Protocol• Authentication• Additional hierarchy• Load balancing
![Page 33: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/33.jpg)
Spring 2009 CSE30264 33
Metrics • Original ARPANET metric
– measures number of packets queued on each link– took neither latency or bandwidth into consideration
• New ARPANET metric– stamp each incoming packet with its arrival time (AT)– record 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
• Revised ARPANET metric– compressed dynamic range– replaced Delay with link utilization
• Practice– static metrics (e.g., 1/bandwidth)
![Page 34: CSE 30264 Computer Networks](https://reader035.fdocuments.net/reader035/viewer/2022062501/56816782550346895ddc8efd/html5/thumbnails/34.jpg)
Spring 2009 CSE30264 34
Routing for Mobile Hosts
• Mobile IP:– home agent, home address, foreign agent– triangle routing problem