Presentation is loading. Please wait.

Presentation is loading. Please wait.

Univ. of TehranComputer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani.

Similar presentations


Presentation on theme: "Univ. of TehranComputer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani."— Presentation transcript:

1

2 Univ. of TehranComputer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 4: Packet forwarding

3 Univ. of TehranComputer Network2 Packet forwarding How do routers process IP packets How do they forward packets Assigned reading Section from “Computer Network: A System Approach”

4 Univ. of TehranComputer Network3 Forwarding vs. Routing Forwarding: the process of moving packets from input to output The forwarding table Lookup. How to populate the lookup table? Routing: process by which the forwarding table is built and maintained One or more routing protocols Procedures (algorithms) to convert routing into to forwarding table.

5 Univ. of TehranComputer Network4 Outline Alternative methods for packet forwarding IP packet routing

6 Univ. of TehranComputer Network5 Techniques for Forwarding Packets Source routing Packet carries path Table of virtual circuits Connection routed through network to setup state Packets forwarded using connection state Table of global addresses (IP) Routers keep next hop for destination Packets carry destination address

7 Univ. of TehranComputer Network6 Source Routing List entire path in packet Driving directions (north 3 hops, east, etc..) Router processing, one option Examine first step in directions Strip first step from packet Forward to step just stripped off Or the address can be implemented by a linked list in the packet header.

8 Univ. of TehranComputer Network7 Source Routing Example Receiver Packet 3,4,3 Sender 2 3 4 1 2 3 4 1 2 3 4 1 R1 R2 R1 4,33

9 Univ. of TehranComputer Network8 Source Routing Advantages Switches can be very simple and fast Disadvantages Variable (unbounded) header size Sources must know or discover topology (e.g., failures) Typical use Machine room networks (Myprinet) Debugging and management

10 Univ. of TehranComputer Network9 Virtual Circuits/Tag Switching Use the telephone model virtual circuits Each flow is identified by a Virtual Circuits Identifier (VCI). Connection setup phase, Signaling Use other means to route setup request Each router allocates flow ID on local link Creates mapping of inbound flow ID/port to outbound flow ID/port Each packet carries connection ID Sent from source with 1 st hop connection ID Router processing Lookup flow ID – simple table lookup Replace flow ID with outgoing flow ID Forward to output port

11 Univ. of TehranComputer Network10 Virtual Circuits Examples Receiver Packet 1,5  3,7 Sender 2 3 4 1 1,7  4,2 2 3 4 1 2 3 4 1 2,2  3,6 R2 R3 R1 5726 In-portIn-VCIOut-portOut-VCI 1537 41108 Lookup table for Switch R1

12 Univ. of TehranComputer Network11 Virtual Circuits Advantages More efficient lookup (simple table lookup) More flexible (different path for each flow) Can reserve bandwidth at connection setup Easier for hardware implementations Small per-packet header overhead small. Disadvantages Still need to route connection setup request More complex failure recovery – must recreate connection state Typical uses ATM – combined with fix sized cells MPLS – tag switching for IP networks

13 Univ. of TehranComputer Network12 IP Datagrams on Virtual Circuits Challenge – when to setup connections At bootup time – permanent virtual circuits (PVC) Large number of circuits For every packet transmission Connection setup is expensive For every connection What is a connection? How to route connectionless traffic?

14 Univ. of TehranComputer Network13 IP Datagrams on Virtual Circuits Traffic pattern Few long lived flows Flow – set of data packets from source to destination Large percentage of packet traffic Improving forwarding performance by using virtual circuits for these flows Other traffic uses normal IP forwarding

15 Univ. of TehranComputer Network14 Datagram Switching No connection setup phase since it is costly. Each packet is forwarded independently Sometimes called connectionless model Analogy: postal system Each switch maintains a forwarding (routing) table Receiver Packet R Sender 2 3 4 1 2 3 4 1 2 3 4 1 R1 R2 R1 RR R  3 R  4 R  3 R

16 Univ. of TehranComputer Network15 Datagram Model There is no round trip time delay waiting for connection setup; a host can send data as soon as it is ready. Source host has no way of knowing if the network is capable of delivering a packet or if the destination host is even up. Since packets are treated independently, it is possible to route around link and node failures. Since every packet must carry the full address of the destination, the overhead per packet is higher.

17 Univ. of TehranComputer Network16 Global Addresses (IP) Each packet has destination address Each switch has forwarding table of destination  next hop At v and x: destination  east At w and y: destination  south At z: destination  north Distributed routing algorithm for calculating forwarding tables

18 Univ. of TehranComputer Network17 Router Table Size One entry for every host on the Internet 100M entries, doubling every year One entry for every LAN Every host on LAN shares prefix Still too many, doubling every year One entry for every organization Every host in organization shares prefix Requires careful address allocation

19 Univ. of TehranComputer Network18 Outline Alternative methods for packet forwarding IP packet routing Variable prefix match Routing protocols – distance vector

20 Univ. of TehranComputer Network19 Original IP Route Lookup Address classes A: 0 | 7 bit network | 24 bit host (16M each) B: 10 | 14 bit network | 16 bit host (64K) C: 110 | 21 bit network | 8 bit host (255) We need to keep only network address, 2 21 entries. Address would specify prefix for forwarding table Simple lookup

21 Univ. of TehranComputer Network20 Original IP Route Lookup – Example www.cmu.edu address 128.2.11.43 www.cmu.edu Class B address – class + network is 128.2 Lookup 128.2 in forwarding table Prefix – part of address that really matters for routing Forwarding table contains List of class+network entries A few fixed prefix lengths (8/16/24) Large tables 2 Million class C networks

22 Univ. of TehranComputer Network21 CIDR Revisited Supernets Assign adjacent net addresses to same org Classless routing (CIDR) How does this help routing table? Combine routing table entries whenever all nodes with same prefix share same hop

23 Univ. of TehranComputer Network22 CIDR Illustration Provider is given 201.10.0.0/21 201.10.0.0/22201.10.4.0/24201.10.5.0/24201.10.6.0/23 Provider

24 Univ. of TehranComputer Network23 Classless Addressing CIDR ABCD 0 2 32 -1 0 128.9/16 128.9.0.0 2 16 142.12/19 65/8 Classless: Class-based: 128.9.16.14 Class A cover a large range of addresses Take part of address space for host addresses.

25 Univ. of TehranComputer Network24 Classless Addressing CIDR 0 2 32 -1 128.9/16 128.9.16.14 128.9.16/20128.9.176/20 128.9.19/24 128.9.25/24 Most specific route = “longest matching prefix”

26 Univ. of TehranComputer Network25 IP Lookup  Packets are forwarded to their destination based on their destination addresses.  Router must find the address of the next hop for each packet by finding the longest prefix matching with the packet destination address.

27 Univ. of TehranComputer Network26 Forwarding Datagrams “Network ID” uniquely identifies a physical network. All hosts and routers sharing a Network ID share the same physical network. Every network in Internet is connected to at least one router that can exchange packets with other routers

28 Univ. of TehranComputer Network27 Forwarding Algorithm If the datagram destination address is in the local network deliver packet over the interface else if the network address is in the forwarding table deliver packet to the corresponding next hop else deliver packet to the default router. For Class address there is exact matching For Classless address it is prefix matching.

29 Univ. of TehranComputer Network28 Forwarding Table 128.9/16 128.9.16/20 128.9.176/20 128.9.19/24 128.9.25/24 142.12/19 65/8 PrefixPort 3 2 2 7 2 1 3 128.17.14.1 128.17.20.1 128.17.10.1 128.17.14.1 128.17.16.1 Next-hop R1 R2 R3 R4 1 2 3 128.17.20.1 128.17.16.1 e.g. 128.9.16.14 => Port 2 It is prefix matching in the table.

30 Univ. of TehranComputer Network29 Default Routing R1 R2R3R4R5 Default Routing Requires Routing Table Default Routing

31 Univ. of TehranComputer Network30 Inside a Router Forwarding Decision Forwarding Decision Forwarding Decision Forwarding Table Forwarding Table Forwarding Table Interconnect Output Scheduling 1. 2. 3.

32 Univ. of TehranComputer Network31 Forwarding in an IP Router A higher level view from router perspective. Lookup packet DA in forwarding table. –If known, forward to correct port. –If unknown, drop packet. Decrement TTL, update header Checksum. Forward packet to outgoing interface. Transmit packet onto link.

33 Univ. of TehranComputer Network32 Global Addresses Advantages Stateless – simple error recovery Disadvantages Every switch knows about every destination Potentially large tables All packets to destination do not take same route

34 Univ. of TehranComputer Network33 Comparison Source RoutingGlobal Addresses Header SizeWorstOK – Large address Router Table SizeNone Number of networks (prefixes) Forward OverheadBest Prefix matching Virtual Circuits Best Number of circuits Pretty Good Setup OverheadNone Error RecoveryTell all hostsTell all routers Connection Setup Tell all routers and Tear down circuit and re-route

35 Univ. of TehranComputer Network34 Next Lecture: Routers How do you build a router Assigned reading [P+98] A 50 Gb/s IP Router


Download ppt "Univ. of TehranComputer Network1 Advanced topics in Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani."

Similar presentations


Ads by Google