490 likes | 514 Vues
Layer 3: Protocols. Honolulu Community College Cisco Academy Training Center Semester 1 Version 2.1.1. Overview. Router passes data packets between networks based on Layer 3 addresses. Make decisions regarding the best path for delivery of data on the network.
E N D
Layer 3: Protocols Honolulu Community College Cisco Academy Training Center Semester 1 Version 2.1.1
Overview • Router passes data packets between networks based on Layer 3 addresses. • Make decisions regarding the best path for delivery of data on the network. • How routers use a Layer 3 addressing scheme to make forwarding decisions. • ARP and RARP. • Routed vs Routing Protocols. • Distance-vector, link-state, and hybrid routing approaches.
Routers • Two addressing schemes used in networking: • MAC address, a data link (Layer 2) address; • Logical or network address (Layer 3); e.g. IP. • IP addresses are implemented in software. • Router use layer 3 addresses. • Path selection. • Routing updates (path information). • Switching function. • Routers are used to connect separate networks and to access the worldwide Internet.
Router Operation • Data (frames), from network A, reaches router. • Router strips off data link header. • Examines destination network address. • Checks routing table. • Encapsulate data in appropriate data link frame. • Sends data out interface B1.
Router Interface / Port • Router’s connection to a network is called an interface or port. • In IP routing, each interface has an address on a separate, unique network (or subnetwork). • Interface requires a valid address on the network it is connected to.
Assigning IP Addresses • Two general way to assign IP addresses: • static addressing. • dynamic addressing. • Static Addressing • Manually configure IP address for each device. • Dynamic Addressing • RARP - Reverse address resolution protocol. • BootP - BOOTstrap Protocol. • DHCP - Dynamic Host Configuration Protocol.
RARP - Reverse Address Resolution Protocol • Some devices don’t know their own IP address. • like diskless workstations, dummy terminals. • RARP - used to determine its own IP address knowing only its own MAC address. • RARP requires a RARP server. • Device sends RARP request (broadcast), and RARP server responds with correct IP address.
BOOTP - bootstrap protocol • Used by client at startup, to obtain IP address. • BOOTP uses UDP. • Client sends a broadcast using destination IP address of all 1s - 255.255.255.255. • BOOTP server responds with a broadcast. • Client checks MAC address of broadcast, if it matches, it takes IP address in the datagram. • Like RARP, but BOOTP datagrams can include IP address, default gateway, address of server, and a vendor-specific field. • Not designed to provide dynamic addresses.
DHCP - dynamic host configuration protocol • Successor to BOOTP; uses UDP. • DHCP allows a host to obtain an IP address quickly and dynamically. • Requires a defined range of IP addresses on a DHCP server. • As hosts come online they request an address from DHCP server. • DHCP server allocates address to host. • entire computer’s configuration can be obtained in one message (IP address and subnet mask).
DHCP Initialization Sequence To DHCP Server
DHCP Initialization Sequence • Client boots, enters an initialize state. • Sends DHCPDISCOVER broadcast. • UDP packets with BOOTP port number. • Enters into the select state. • collects DHCPOFFERs from DHCP server. • selects first response and negotiates lease time by sending a DHCPREQUEST. • DHCP server acknowledges with DHCPACK. • client enters bound state, begins using address.
Communications • For communications: need two addresses: • MAC and IP. • Devices maintain an ARP table or cache, which maps IP to MAC addresses for all devices on its LAN. • When a source knows IP address of destination, it consults its ARP table to find MAC address for the destination.
ARP- address resolution protocol • If IP address is known, but MAC address is unknown, communication cannot take place. • ARP is used to find the destination MAC address. • Source sends ARP Request.
ARP Request • A broadcast - to all nodes. • Has broadcast MAC address. • Contains source’s MAC and IP addresses (used by other devices to update ARP tables). • Device with specified IP address will respond (uni-cast) with its MAC address.
ARP Reply • A uni-cast - to only the workstation that sent ARP request. • Contains both workstations MAC and IP addresses. • When source has MAC & IP of destination, communications can occur.
Default Gateway • To communicate with a destination on another network, a device needs a default gateway. • IP address of router interface it is connected to. • With no default gateway, communication is possible only on the local network segment. • Source checks destination IP address and its own ARP table. • If no match, it needs a default IP address to use. • Without default gateway, source has no destination MAC address, and message is undeliverable.
Default Gateway (2) • With a default gateway defined, source host compares the destination IP address and its own IP address to determine if both are on the same segment. • If not on the same segment, the source host sends the data to the default gateway.
Proxy ARP (no default gateway set) • If unknown MAC is on another subnet or network, the ARP process must go thru a router. • Broadcasts are not forwarded by routers - so ARP request will not go to another network. • (Note: ARP is a local LAN operation.) • Then, a router (that knows how to get to the IP address) acts as a “proxy” and responds to the ARP request with its own (router’s) MAC. • Source will then send data packet with given IP address and the router’s MAC.
Routed Protocols • Protocols that provide support for the network layer are called routed or routableprotocols. • Define addressing scheme, and data format. • Routed protocols: IP, IPX, Appletalk. • There are non-routable protocols that do not support Layer 3. • Most common non-routable protocol is NetBEUI. • Limited to running on one segment, no logical addressing support. • Routed protocols must be able to assign a network number & host number, to each device.
Routing Protocols • Routing protocols are used to exchange ‘routing’ information, provide routing updates for maintaining routing tables. • Examples of routing protocols: RIP, IGRP, OSPF, EIGRP. • Routing protocols enable routers to create a map of other routers in the network. • this allows routing (i.e. selecting the best path, and switching) to occur. • Such maps become part of each router's routing table.
RIP - Routing Information Protocol • Most common protocol used to transfer routing information between routers on same network. • Interior Gateway Protocol (IGP). • Calculates distances to destination in hops (how many routers a packet must pass through). • Sends routing updates every 30 seconds. • Distance vector routing protocol. • Determines distance (hops) and which direction to destination.
Data Encapsulation • Router receives frame, strips off frame header. • Checks destination IP address (in IP header). • Router checks routing table for best path to destination. • Router re-encapsulates data in data link layer frame, and sends it out appropriate interface. • If there is no match in the routing table, packet is dropped.
Multi-protocol Routing • Routers can maintain routing tables for several routed protocols, concurrently. • allows delivery of packets from several routed protocols over the same data links. Routers pass traffic for all routed protocols over the internetwork.
Connectionless Network Services • In a connectionless system the destination is not contacted before a packet is sent. • Each packet handled separately, and is sent. • Packets may take different paths through the network, but are reassembled at destination.
Connection-oriented Network Services • A connection is established between sender and the receiver before data is transferred. • Like the telephone system. • Data sent sequentially, arrives in order.
Connectionless vs Connection-oriented • Connectionless is packet switched. • Packet is switched and may take different routes. • Packets may arrive out of sequence. • Connection-oriented is circuit switched. • Connection is established, then data is sent. • All packets travel sequentially across same (virtual) circuit, and arrive in order. • IP is connectionless, best effort delivery. • TCP adds connection-oriented services on top of IP to reliably deliver data.
IP and Transport Layer • IP is connectionless, treats each packets independently. • IP does not send files in one long data stream. • Packets arrive out of sequence, some may be lost. • Transport layer protocol must determine whether packets are lost, and request retransmission. • Transport layer is also responsible for reordering the packets.
Importance of ARP tables • If MAC addresses are not known, broadcast traffic occurs - less efficient use of network. • Current ARP tables minimizes broadcasts. • ARP entries are time stamped and “aged out” (deleted after some hold time). • Other devices update their ARP tables from any ARP request, helping to minimize broadcasts.
ARP Tables • Routers keep ARP tables to map IP to MAC. • Routers connect different networks: • They have ARP data for devices (particularly other routers) on other networks. • They also have interfaces in ARP table (to perform routing).
Router Tables • Routers connect more than one network. • Have ARP info (IP and MAC) of devices on other networks, particularly routers. • Have interfaces - to be able to route data.
Indirect Routing • When a source needs to communicate with a destination on another network, it must use the services of a router. • The router is called a default gateway. • The process is called indirect routing. • Source uses the final destination IP, and the MAC of the router. • Router will re-encapsulate and route data on.
Routed vs Routing Protocols • Routed protocols define data format so that data can be ‘routed’. • Used to direct traffic thru the network. • Examples of routed protocols: IP, IPX, Appletalk. • Routing protocols are used to exchange ‘routing’ table information (routing updates). • Examples of routing protocols: RIP, IGRP, OSPF, EIGRP.
Routed Protocols define format • Routed protocols define the fields, sizes of fields for the data packet, as well as the structure of the network address. • The structure of the data packet and network address allow packets to be routed thru the network. IP Datagram
Interior vs Exterior Gateway Protocols • Autonomous System - collection of networks under a common administration sharing a common routing strategy. • IGP - used to route data within an autonomous system. • Examples: RIP, IGRP, OSPF, EIGRP. • EGP - used to route data between autonomous systems. • Example: BGP.
RIP - routing information protocol • Most common interior gateway protocol. • Distance vector class of protocol - gets information from neighboring routers only. • RIP uses hop count to determine best path. • Hop - number of routers the packet goes thru. • ‘Best path’ may not be the fastest. • Limitation of 15 as maximum hop count. • Routing updates occur every 30 seconds. • Updates are broadcasts. • May cause problems of excessive traffic.
IGRP & EIGRP • Cisco’s proprietary routing protocols. • IGRP is a distance vector routing protocol (IGP). • Designed for large networks, 255 is max hop. • IGRP metrics (for best path selection): • Bandwidth, load, delay, reliability. • Usually selects ‘better’ routes than RIP. • IGRP routing updates - every 90 secs. • EIGRP - enhanced IGRP (also an IGP). • EIGRP is a balanced hybrid class of protocol. • Updates are event-triggered (link state). • Uses same metrics as IGRP (distance vector).
OSPF- open shortest path first • OSPF is a link-state routing protocol (IGP). • Updates are flooded to all nodes and link-state routers build a global view of the network. • Requires more computing power than distance vector class. • For best path selection, uses cost metric which factors in: route speed, traffic, reliability, security.
Routing Tables • Routing table contains best route to destinations networks. • Static routes, Dynamic routes, Default routes. • Static routes - manually entered by administator. • Dynamic routes - learned automatically from routing updates (routing protocols). • Default routes - used when no explicit route exists in routing table.
Why Static Routing? • Useful if you want to control which path a router will select. • to test a particular link in the network. • to conserve wide area bandwidth. • Static routing is preferred method for stub networks, only one path to stub network.
Dynamic Routing • Dynamic routing occurs when routers send automatic routing updates to each other. • Automatic recalculation of new best route. • Automatic update of routing table. • Routers can adjust dynamically to changing network conditions. • Works best when bandwidth and large amounts of network traffic are not issues.
RIP Routing • Sending packet from A to Z. • A uses Z’s IP, and router 1’s MAC, and sends packet. • Router 1 gets packet, removes MAC header, and sends up to network layer. It checks routing table, and re-encapsulates with MAC of router 2, and forwards out port to subnet 4. • Note: other workstations on Subnet 1 will discard the packet since it has Router 1’s MAC addr.
RIP Routing • Sending packet from A to Z. • Router 2 gets the packet, removes MAC header and sends it up to the network layer. Again the routing table is checked, and the data is re-encapsulated with MAC of router 3, and forwarded out port to Subnet 5. • Router 3 knows MAC of Z, re-encapsulates data and forwards to subnet 8 (where host Z is).
RIP Routing • How data is routed thru a network and the OSI model.
Summary • Network layer functions include network addressing and best path selection. • ARP • To find unknown MAC from known IP address. • ARP request is MAC broadcast. • Dynamically obtaining IP addresses. • RARP, BOOTP, DHCP. • All devices, even routers,build ARP tables that map IP addresses to MAC addresses.
Summary (2) • If source wants to communicate with a destination on a different network, it will use the router as a default gateway. • Proxy ARP. • Indirect routing. • Routed protocols allow traffic to be routed thru the network. • Routing protocols provide for routing updates to main routing tables. • Connection-oriented - circuit switched. • Link established, then data sent.
Summary (2) • Connectionless - packet switched. • Packets handled individually, may take different routes, arrive out of sequence. • No acknowlegements, no setting up of link. • Interior vs Exterior Gateway Protocols. • IGP - within autonomous system • EGP - between autonomous systems. • Static vs Dynamic routing. • Static - manually entered, good for stub networks. • Dynamic - learned automatically from routing protocols. The End