
Outline • IP Packet Format 15-441 Computer Networking • NAT Lecture 8 – IP Packets, Routers • IPv6 • Router Internals • Route Lookup Lecture 8: 9 -20-01 2 IPv4 Header – RFC791 (1981) IP Header Fields 32 bits 0 4 8 16 19 24 32 • Version à 4 for IPv4 type of • Header length (in 32 bit words) ver header length service length • Minimum value is 5 (header without any options) fragment 16-bit identifier flags offset • Length of entire IP packet in octets (including time to Protocol Header header) live checksum 32 bit source IP address • Identifier, flags, fragment offset à used primarily 32 bit destination IP address for fragmentation Options (if any) Padding (if any) • Time to live • Must be decremented at each router data (variable length, • Packets with TTL=0 are thrown away typically a TCP • Ensure packets exit the network or UDP segment) Lecture 8: 9 -20-01 3 Lecture 8: 9 -20-01 4 IP Header Fields IP Type of Service • Protocol • Typically ignored • Demultiplexing to higher layer protocols • TCP = 6, ICMP = 1, UDP = 17… • Values • Header checksum • 3 bits of precedence • Ensures some degree of header integrity • 1 bit of delay requirements • Relatively weak – 16 bit • 1 bit of throughput requirements • Source/Dest address • 1 bit of reliability requirements • Options • E.g. Source routing, record route, etc. • Replaced by DiffServ • Performance issues • Poorly supported Lecture 8: 9 -20-01 5 Lecture 8: 9 -20-01 6 1 ICMP: Internet Control Fragmentation Message Protocol • Used by hosts, routers, gateways to communication Type Code description • IP packets can be up to 64KB network-level information 0 0 echo reply (ping) 3 0 dest. network unreachable • Different link -layers have different MTUs • Error reporting: unreachable 3 1 dest host unreachable • Split IP packet into multiple fragments host, network, port, protocol 3 2 dest protocol unreachable • Echo request/reply (used by 3 3 dest port unreachable • IP header on each fragment ping) 3 6 dest network unknown 3 7 dest host unknown • Intermediate router may fragment as needed • Network-layer “above” IP: 4 0 source quench (congestion • ICMP msgs carried in IP control - not used) datagrams 8 0 echo request (ping) • ICMP message: type, code plus 9 0 route advertisement first 8 bytes of IP datagram 10 0 router discovery 11 0 TTL expired causing error 12 0 bad IP header Lecture 8: 9 -20-01 7 Lecture 8: 9 -20-01 8 IP Fragmentation & Reassembly Reassembly • Network links have MTU • Where to do reassembly? (max.transfer size) - largest possible link-level frame. fragmentation: • End nodes • different link types, in: one large datagram out: 3 smaller datagrams • Avoids unnecessary work where large packets different MTUs are fragmented multiple times • Large IP datagram divided (“fragmented”) within net • one datagram becomes reassembly • Dangerous to do at intermediate nodes several datagrams • IP header bits used to • How much buffer space required at routers? identify, order related • What if routes in network change? fragments • Multiple paths through network • All fragments only required to go through destination Lecture 8: 9 -20-01 9 Lecture 8: 9 -20-01 10 Fragmentation Related Fields IP Fragmentation and Reassembly • Length length ID fragflag offset • Length of IP fragment =4000 =x =0 =0 • Identification One large datagram becomes • To match up with other fragments several smaller datagrams • Flags length ID fragflag offset =1500 =x • Don’t fragment flag =1 =0 • More fragments flag length ID fragflag offset =1500 =x =1 =1480 • Fragment offset length ID fragflag offset • Where this fragment lies in entire IP datagram =1040 =x =0 =2960 • Measured in 8 octet units (13 bit field) Lecture 8: 9 -20-01 11 Lecture 8: 9 -20-01 12 2 Fragmentation is Harmful Path MTU Discovery • Uses resources poorly • Hosts dynamically discover minimum MTU of path • Forwarding costs per packet • Algorithm: • Best if we can send large chunks of data • Initialize MTU to MTU for first hop • Send datagrams with Don’t Fragment bit set • Worst case: packet just bigger than MTU • If ICMP “pkt too big” msg, decrease MTU • Poor end-to-end performance • What happens if path changes? • Loss of a fragment • Periodically (>5mins, or >1min after previous increase), • Reassembly is hard increase MTU • Buffering constraints • Some routers will return proper MTU • MTU values cached in routing table Lecture 8: 9 -20-01 13 Lecture 8: 9 -20-01 14 Outline IP Address Utilization (‘98) • IP Packet Format • Address space depletion • NAT • In danger of running out of classes A and B • 32-bit address space • IPv6 completely allocated by 2008 • Router Internals • Two solutions • NAT • Route Lookup • IPv6 Lecture 8: 9 -20-01 15 Lecture 8: 9 -20-01 16 Network Address Translation (NAT) NAT Illustration Pool of global IP • Possible solution to address space exhaustion Destination addresses Source • Kludge (but useful) G P • Sits between your network and the Internet Global Private Internet • Translates local network layer addresses to global Network IP addresses Dg Sg Data NAT Dg Sp Data • Has a pool of global IP addresses (less than number of hosts on your network) • Uses special unallocated addresses (RFC 1597) • Operation: Source (S) wants to talk to Destination (D): • Create S -S mapping locally g p • Replace Sp with Sg for outgoing packets • 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 • Replace Sg with Sp for incoming packets • How many hosts can have active transfers at one time? Lecture 8: 9 -20-01 17 Lecture 8: 9 -20-01 18 3 Problems with NAT Problems with NAT • What if we only have few (or just one) IP • Hides the internal network structure address? • Some consider this an advantage • Use Network Address & Port Translator (NAPT) • Some protocols carry addresses • NAPT translates: • E.g., FTP carries addresses in text • What is the problem? • Translates addrprivate + flow info to addrglobal + new flow info • Must update transport protocol headers • Uses TCP/UDP port numbers (port number & checksum) • Potentially thousands of simultaneous • Encryption connections with one global IP address • No inbound connections Lecture 8: 9 -20-01 19 Lecture 8: 9 -20-01 20 Outline IPv6 • IP Packet Format • Primary objective bigger addresses • Addresses are 128bit à What about header • NAT size!!! • Simplification • IPv6 • Header format helps speed processing/forwarding • Router Internals • Header changes to facilitate QoS • Removes infrequently used parts of header • Route Lookup • 40byte fixed size vs. 20+ byte variable Lecture 8: 9 -20-01 21 Lecture 8: 9 -20-01 22 IPv6 Changes IPv6 Header • IPv6 removes checksum • Relies on upper layer protocols to provide 0 4 12 16 19 24 32 integrity Version Class Flow Label • IPv6 eliminates fragmentation Payload Length Next Header Hop Limit • Requires path MTU discovery Source Address • Requires 1280 byte MTU Destination Address Lecture 8: 9 -20-01 23 Lecture 8: 9 -20-01 24 4 IPv6 Changes IPv6 Changes • TOS replaced with traffic class octet • Protocol field replaced by next header field • Flow label • Support for protocol demultiplexing as well as option processing • Identify datagrams in same “flow.” (concept of“flow” not well defined) • Option processing • Options are added using next header field • Help soft state systems • Options header does not need to be processed by • Maps well onto TCP connection or stream of every router UDP packets on host-port pair • Large performance improvement • Easy configuration • Makes options practical/useful • Additional requirements • Provides auto-configuration using hardware • Support for security MAC address to provide unique base • Support for mobility Lecture 8: 9 -20-01 25 Lecture 8: 9 -20-01 26 Transition From IPv4 To IPv6 Dual Stack Approach • Not all routers can be upgraded simultaneous • No “flag days” • How will the network operate with mixed IPv4 and IPv6 routers? • Two proposed approaches: • Dual Stack: some routers with dual stack (v6, v4) can “translate” between formats • Tunneling: IPv6 carried as payload n IPv4 datagram among IPv4 routers Lecture 8: 9 -20-01 27 Lecture 8: 9 -20-01 28 Tunneling Outline • IP Packet Format IPv6 inside IPv4 where needed • NAT • IPv6 • Router Internals • Route Lookup Lecture 8: 9 -20-01 29 Lecture 8: 9 -20-01 30 5 Router Architecture Overview What Does a Router Look Like? Two key router functions: • Line cards • Run routing algorithms/protocol (RIP, OSPF, BGP) • Network interface cards • Switching datagrams from incoming to outgoing link • Forwarding engine • Fast path routing (hardware vs. software) • Usually on line card • Backplane • Switch or bus interconnect • Processor • Handles routing protocols, error conditions Lecture 8: 9 -20-01 31 Lecture 8: 9 -20-01 32 Router Processing Network Processor • Packet arrives arrives at inbound line card • Runs routing protocol and downloads • Header processed by forwarding engine forwarding table to forwarding engines • Forwarding engine determines output line • Performs “slow” path processing card/destination • ICMP error messages • Checksum updated but not checked • IP option processing • Packet copied to outbound line card • Fragmentation • Odd situations sent to network processor • Packets destined to router Lecture 8: 9 -20-01 33 Lecture 8: 9 -20-01 34 Three Types of Switching Fabrics Switching Via Memory First generation routers: • Packet copied by system’s (single) CPU • Speed limited by memory bandwidth (2 bus crossings per datagram) Input Memory Output Port Port System Bus Modern routers: • Input port processor performs lookup, copy into memory • Cisco Catalyst 8500
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-