6727a9dfe538334a7104cc91dfd041bd.ppt
- Количество слайдов: 32
Announcements! • GUEST SPEAKER: 4 pm TODAY! PT 203 • April 17 EXAM – TCP – Today’s lecture – same format as last time • Bring questions and answers to class Thursday! – hint, hint. • April 19 th: router project assigned – due May 8 th • April 30 th: Thread Safe Queue due (7 bonus pts) – with two test cases and working against the posted test case CS 360 – Spring 2007 Pacific University
Network Layer Chapter 5 Section 5. 1, 5. 3, 5. 5, 5. 6 CS 360 – Spring 2007 Pacific University
Network with Routers zeus. cs. pacificu. edu your. ISP. com Router HTTP TCP IP Router CS 360 – Spring 2007 Pacific University TCP IP
Network Layer • What are the layers in the network model? • The layer that actually moves data from one computer to another • Finds a path from one computer to another • We call this routing • Routers may be standard computers running routing software – this was the standard for the early days of the ‘Net – http: //vyatta. com - open source software you can download and run on a PC • Routers may be specialized hardware – http: //www. cisco. com – on Safari: “Cisco IOS in a Nutshell, 2 nd Edition” CS 360 – Spring 2007 Pacific University
Connection vs Datagram • Just like TCP/UDP, some network layers are connection based, some are datagram based – for connection based networks each router keeps track of every connection running through it – for datagram based networks, no state for the connection is kept at the router • the Internet is datagram based (which is why implementing TCP is so much work!) – why might connection based networks be good? bad? ugly? – why might datagram based networks be good? bad? ugly? – mainly concerned with datagram based networks in this class CS 360 – Spring 2007 Pacific University
Network Service Models • The network layer may provide different levels of service – – – guaranteed delivery with bounded delay in order packet delivery guaranteed minimal bandwidth guaranteed maximum jitter • The Internet provides – – best effort service “Sure, I’ll try to get it there, but I’m not making any promises. ” why? layers: provide only what you need • you can build anything on top of it Internetworking! CS 360 – Spring 2007 Pacific University
Internet Protocol (v 4) (RFC 791) • Network layer for the Internet • Designed with internetworking in mind – many underlying datalink layers may be used – the IP header is what the router looks at to route the data Tanenbaum, Fig 5 -53, p 434 CS 360 – Spring 2007 Pacific University Not identical to the pseudo header in the UDP RFC
Network with Routers zeus. cs. pacificu. edu HTTP your. ISP. com Router TCP IP Internetworking: Each of the links may be a different underlying datalink layer. Ethernet, wireless, fiber optics, carrier pigeon, smoke signal, token ring, PPP, SLIP HTTP IP CS 360 – Spring 2007 Pacific University
Router Operations • Forwarding – router local operation – data arrives on the input port – sent to one of the output ports • • • based on final destination address decision based on a forwarding table look for longest common prefix tables created by routing algorithms what are some of the issues that may be involved with the design/implementation of the forwarding table? pacificu. edu 1 2 3 umd. edu mit. edu CS 360 – Spring 2007 Pacific University Forwarding Table Interf Destinatio ace n Address 1 pacificu. ed u Routers really use IP 2 addresses rather than umd. edu DNS addresses 3 mit. edu
Router Operations • Routing – – – network-wide process network layer determines the path to use between two computers uses routing algorithms builds forwarding tables at each router Internet routing protocols: • RIP • OSPF • BGP – Internet Control Message Protocol RFC 792 • used to transfer network-layer information • technically between IP and Transport layer Tanenbaum, Figure 5 -61, p 449 CS 360 – Spring 2007 Pacific University
IPv 4 Address • 32 bit addresses: 64. 59. 233. 197 – how many addresses? – every computer and router on the ‘Net has at least one IP address – more specific, left to right • Previously on The Internet. . . – – – Classful addresses were given out a. b. c. d Class A: a. x. x. x Class B: a. b. x. x Class C: a. b. c. x • first octet (a) denoted which class of address • U of Maryland: 128. 8. x. x -- Class B • MIT: 18. x. x. x -- Class A – how many addresses does each class of address contain? – why might this be a problem? CS 360 – Spring 2007 Pacific University
IPv 4 Addressing • Classless Inter. Domain Routing (CIDR) – 64. 59. 233. 0/24 • the 24 bits on the left are significant (to the outside world) • the 8 bits on the right are used to route internally 64. 59. 232. 1 router 64. 59. 233. 197 zeus 64. 59. 233. 204 circe 64. 59. 233. 205 homer 64. 59. 233. 194 laser printer Send me data for 64. 59. 233. 0/24 64. 59. 233. 1 router – 255. 0 subnet mask – clever way of organizing addresses helps in routing – we don’t need an entry in the forward table for each machine • just one for the subnet CS 360 – Spring 2007 Pacific University
Forwarding tables • Forwarding table works on the IP addresses • Only concerned with the significant bits • Look for longest prefix match pacificu. edu 1 2 umd. edu 3 mit. edu cs 360. edu Interf Destination Address ace 1 64. 59. 192. 0/18 (0100 0011 1011 11) Input Packet Output Interface 2 128. 8. 0. 0/16 (1000 0000 1000) 64. 59. 192. 1 3 18. 0. 0. 0/8 CS 360 – Spring 2007 0010) (0001 64. 59. 193. 2 Pacific University
Internet Protocol • Designed with internetworking in mind – places no restriction on the service provided by the lower layers – datalink/physical • Fragmentation – each type of datalink network may have a different MTU – maximum transfer unit (max frame size) • Ethernet: 1500 bytes • FDDI: 4500 bytes – data starting on a FDDI connection and going through an Ethernet connection causes problems • the FDDI IP packet is too big – router breaks up the IP packet and sends it in smaller chunks – reassembled at the final destination – all hosts must be able to handle packets of size 576 bytes CS 360 – Spring 2007 Pacific University
Network with Routers zeus. cs. pacificu. edu your. ISP. com Router HTTP Ethernet TCP IP HTTP FDDI TCP Ethernet IP PPP data 8000 bytes CS 360 – Spring 2007 Pacific University
Fragmentation • • Set the MF bit for each fragment but the last one Copy Identification number to each fragment Set the Fragment Offset If the destination does not receive one of the fragments, what should it do? • DF bit means ‘Don’t Fragment Me!’ Tanenbaum, Fig 5 -53, p 434 CS 360 – Spring 2007 Pacific University
Network Address Translation – IP addresses are scarce – present one IP address to the rest of the world via a firewall/router – assign your own IP addresses in your local network • these IP addresses are NOT visible to the rest of the world • map internal address: port to ISP assigned. Address: port • this mapping is not permanent – this is how the wireless router your ISP sends you works – some purists object to this. Why? When might this cause problems? 59. 64. 233. 1 zeus 9999 22 192. 168. 1. 1 Visible Port Internal Machine ssh zeus. cs. pacificu. edu 9999 naur NAT box 192. 168. 1. 1: 2034 9998 192. 168. 1. 2: 8972 59. 64. 233. 1 192. 168. 0. 1 CS 360 – Spring 2007 Pacific University ssh naur. cs. wvu. edu 192. 168. 1. 2
ARP • Address Resolution Protocol • Mapping IP address to Ethernet addresses – each Ethernet card has a unique 48 bit address hardwired in – MAC address • The link layer (Ethernet) only knows about these MAC addresses • When sending data to someone on your subnet you need to know their MAC address • ARP: Who owns IP address 192. 168. 1. 2? • Owner of that IP address responds with MAC address • Send the Ethernet Frame • Cache address mapping CS 360 – Spring 2007 Pacific University
DHCP • How do you get an IP address when you plug into the wall? • Dynamic Host Configuration Protocol (RFC 2131/2132) – formerly BOOTP – formerly RARP • Your wireless router at home does this as well http: //en. wikipedia. org/wiki/Image: DHCP_session_en. svg CS 360 – Spring 2007 Pacific University
Routing Algorithms Read section 5. 2 - 5. 2. 6 And 5. 6 - 5. 6. 6 zeus. cs. pacificu. edu your. ISP. com Router HTTP TCP IP First-hop Router Destination Router Source Router data 8000 bytes CS 360 – Spring 2007 Pacific University TCP IP
Routing Algorithms • View the network as a graph – routers are nodes – links are edges – what may weights indicate? • • • – find the least cost path (not necessarily the shortest) – what is the least cost path from A to H? – what is the shortest (fewest hops) from A to H? • Two types: – algorithms with global information – algorithms with local information – also: static vs dynamic, load sensitive vs load insensitive CS 360 – Spring 2007 Pacific University Tanenbaum, Figure 5 -7 a, p 354
Routing Algorithms • Link State Routing – – global (complete) information based on Dijkstra’s algorithm (read section 5. 2. 2) some use Prim’s algorithm both algorithms compute the least cost path from node X to all other nodes in the graph (one to all) – Example! CS 360 – Spring 2007 Pacific University
Routing Algorithms • Distance Vector Routing – – local information (decentralized) every node keeps a distance vector DV: for every node, what is the distance from here to there? based on the Bellman-Ford equation: • DV(x -> y) = min { c(x, v) + d(v -> y) }, for all v such that v is a neighbor of x – calculate your DV, then send it to your neighbors, if it changes – if you receive a new DV from a neighbor, recalculate yours – and so on. – Example! – Count to infinity problem: CS 360 – Spring 2007 Pacific University
Routing on the Internet • Hierarchical Routing: – break the network up into regions so the router’s forward table does not get too large – you know detailed information about your subnet – where to send data for other subnets • AS: Autonomous Systems – the regions mentioned above! • Intra-AS: RIP (not in your book) RFC 1058 • Intra-AS: OSPF RFC 2328 • Inter-AS: BGP RFC 1771 CS 360 – Spring 2007 Pacific University
Network with Routers Pacificu. edu umd. edu BGP RIP or OSPF AS AS mit. edu AS CS 360 – Spring 2007 Pacific University
Routing Information Protocol • Intra-AS: RIP (not in your book!) RFC 1058 – – – routing within an AS very close to the idealized DV algorithm hop count is the metric a “hop” is moving to another subnet. each edge has a weight of 1 maximum path length is 15 restricts size of the network DV updates are sent every 30 seconds runs on UDP! lower tier ISP (local ISPs ) enterprise networks (all of Pacific U’s internal routing, maybe) CS 360 – Spring 2007 Pacific University
Open Shortest Path First • Intra-AS: OSPF RFC 2328 – – – – routing within an AS link state based on Dijkstra’s algorithm each router constructs complete map of the AS runs Dijkstra’s algorithm to find shortest path tree to all subnets carried directly by IP (implements it own reliability!) upper tier ISP (AT&T, Verizon, Qwest) designed as a replacement/improvement of RIP improvements • • security/authentication multiple same cost path multicast & unicast hierarchical routing within single routing domain CS 360 – Spring 2007 Pacific University
Hierarchical Routing with OSPF This is ALL one AS! Backbone Router Boundary Router Area Border Routers Area 2 Internal Routers Area 1 CS 360 – Spring 2007 Pacific University Area 3
OSPF • Protocol – OSPF provides a protocol for determining the least cost path • does not define how to assigned edge weights – edge weights are set by the network administrator • all edges are 1 to find shortest number of hops • inversely proportional to bandwidth – router sends all link state information to all other routers • when the information changes • at least once every 30 minutes – sends HELLO message to neighbors keep in touch – can request neighbors routing database CS 360 – Spring 2007 Pacific University
Border Gateway Protocol • Inter-AS: BGP RFC 1771 – how to I get to that AS over there? – glues the Internet together CS 360 – Spring 2007 Pacific University
What’s in a Router? CS 360 – Spring 2007 Pacific University
Congestion Control CS 360 – Spring 2007 Pacific University


