(Read Forouzan Chapters 6 and 7)) IP Forwarding Procedure 172.16.96.165 172.16.96.129 B Example Network: 172.16.96.240/28 R A eth1 172.16.96.128/26 172.16.96.226 172.16.96.225 R C 172.16.96.224/28 172.16.96.67 R B 172.16.96.65 172.16.96.193 eth0 172.16.96.64/27 172.16.96.192/27 172.16.96.66 R D A 172.16.96.214 172.16.96.96/27 IP Addresses Identify an Interface not a machine (Reference : “ IP Fundamentals” by Maufer Part II)
In Sending An IP Packet From A to B STEP 1: Since B 172.16.96.165 [ 10101100.00010000.01100000.101]00101 and A’s network 172.16.96.192/27 [10101100.00010000.01100000.110]00000 do not match in masked off significant part (Prefix): A must send IP packet to a default gateway which A must know (by set up) to be RB A must send Address Resolution Protocol (ARP) request to find out RB MAC.
… … A then sends IP SA IP Destination Address IP Packet IPA IPB IP packet data … … MAC DA MAC SA FCS MAC Frame RB ( MAC) MACA 0X0800 Ether Type Frame Control Sequence ( CRC ) STEP 2: At RB IP frame is extracted and IP Destination Address is examined and compared for longest match in a forwarding table.
For Example: Known Prefixes Next – Hop Gateway Interface Metric 172.16.96.64/27 172.16.96.67 172.16.96.96/27 172.16.96.66 172.16.96.128/26 172.16.96.65 eth0 172.16.96.192/27 172.16.96.193 172.16.96.224/28 172.16.96.225 172.16.96.240/28 172.16.96.226 Later The destination prefix that has the most leading bits in common with the IP DA 172.16.96.165 is 172.16.96.128/26 172.16.96.165 = 10101100.00010000.01100000.10100101 172.16.96.128/26 = [10101100.00010000.01100000.10]000000 Prefix
STEP 2 : This means we need to forward the packet to whoever has 172.16.96.65 as an IP address. CAUTION: we want to forward at the MAC layer so need to use ARP to find MAC address for 172.16.96.65. DO NOT CHANGE IP DA!!!!! New time to live => new IP header check sum IP SA IP DA IP IPA IPB IP Packet Data Different value from step 1 MAC DA MAC SA MAC RC MAC RB MAC 0x0800 FCS ether Type Frame Control Sequence (CRC)
match in a forwarding table. STEP 3 : At RC IP frame is extracted and IP destination address is examined and compared for longest match in a forwarding table. For Example: Known Prefixes Next – Hop Gateway Interface Metric 172.16.96.64/27 172.16.96.65 172.16.96.96/27 172.16.96.66 172.16.96.128/26 172.16.96.165 eth1 172.16.96.192/27 172.16.96.67 172.16.96.224/27 172.16.96.67 Later Longest prefix match of same old IP DA is with 172.16.96.128/26 Difference from before - since RC is directly connected to destinations subnetwork, the subnetwork layer destination MAC address MACB and IP destination address ( IPB ) are for the same machine.
IP SA IP DA IP Packet Data IPA IPB MAC DA MAC SA FCS RC (MAC) MAC B 0X0800 Ether Type Aside: Routing protocols ( RIP or OSPF ) build forwarding tables (or can do by hand )
What is the difference between routing and switching? LAN interconnection devices operate a “ OSI ” (Open Systems Interconnection Reference Model) Layers: Layer 1 : Physical Layer Layer 2: Data Link Layer Layer 3: Network Layer Application Presentation Application Session Transport Transport Internet Network Subnetwork Data Link Physical Open Systems Interconnection Reference Model Internet Protocol Stack
Layer 1: Repeaters ( Not too common now) HUBS ( Very common ) HUB To Backbone Four HUB rule - only 4 hub hops allowed in a “ Collision Domain ” Hubs are physical layer devices that just “Repeat” what they see, errored frames and all. Endstation 1 -- TD+ 2 -- TD- 3 -- RD+ 4 5 6 -- RD- 7 8 Hub Side 1 -- TD+ 2 -- TD- 3 -- RD+ 4 5 6 -- RD- 7 8 Endstation 1 -- TD+ 2 -- TD- 3 -- RD+ 4 5 6 -- RD- 7 8 Endstation 1 TD+ 2 TD- 3 RD+ 4 5 6 RD- 7 8 10 Base-T pinout and Crossover cable HUB attachment Functionality
Layer 2: Bridges ( Not common now ) Switches ( What we call bridges now ) Layer - 2 switches ( Way cool marketing term) Forwarding decisions based only on data link layer header, that is the MAC DA. Use a table made from observing which addresses are seen on each port. No more than 7 bridges in diameter. Today’s ethernet environments use lots of ethernet switches, reducing the collision domain. Collision domain is the set of ethernet segments that can directly hear each others frames. Worst case is all inputs want to go out on the same output. Must have some buffering and some sort of fairness algorithm inside
Layer 3: routers ( Historically Called a Gateway When Different Protocols Were Involved ) Routers forward packets based on the destination address at network layer ( Layer 3 ) 3 2 LAN 1 LAN 2 1 May see “Layer - 3 switching” term this just means Routing !
Early Routing Initially called gateways ( Gateway From One Network To Another ) and later called routers. Used to connect different physical networks into larger unified network. Packets contain a destination address, router attempts to match with one of many possible entries in a table of destination networks, sends out appropriate interface. First generation router architecture: Processor Shared Bus Interface Interface Interface Processor runs routing protocols and maintains forwarding table of next HOP routers Packets flow from interface up to processor then back down to correct interface Performance limited by speed of the bus and processing capability of CPU. Second generation router: Distribute the forwarding computations out to the media interface adapters. Input adapter performs forwarding computation and directs the packet over bus to appropriate output adapter. Performance still limited by speed of the bus.
Third Generation Router: Replace bus with a switch. All ports connected by nonblocking switch fabric. Processor Forwarding Cache Forwarding Cache Adapter Adapter Forwarding Cache Forwarding Cache Adapter Adapter Reference: “IP switching protocols and architectures” by Metz Chapter 1