3. Internet Protocol: 3 Connectionless Datagram Delivery 최양희 서울대학교 컴퓨터공학부 MMlab 1 Introduction Internet architecture and philosophy Application Services Reliable Transport Service Connectionless Packet Delivery Service IP p packet delivery y service • • • • • Unreliable: lost, duplicated, delayed, or delivered out of order Best-effort Connectionless Variable size datagrams Data forwarding only (routing, error, and control by other protocols) MMlab 2 IP Features Interconnecting end systems across multiple networks Implemented everywhere (end system, router) High level protocol data encapsulated in IP Protocol Data Unit (PDU) IP version 4 (rfc 791 791, in 1981) IP version 6 (IPv6) (rfc 2460, in 1998) MMlab 3 Router Features Coping with the differences among networks • Addressing Add i schemes h • Maximum packet size • Hardware H d and d software ft iinterfaces t f • No assumption on network reliability MMlab 4 IP datagram HEADER DATA MMlab 5 IP encapsulation IP Header Frame Header IP Data Frame Data MMlab 6 Transmission across Internet MMlab 7 IP Datagram Forwarding Delivers datagrams to destination subnetwork Routers R t maintain i t i a routing ti ttable bl off nextt h hops Next hop field does not appear in the datagram Net 1 Table at R2 R1 Net 2 Destination Net 1 Net 2 Net 3 Net 4 R2 Net 3 R3 Net 4 Next Hop Forward to R1 Deliver Direct Deliver Direct Forward to R3 MMlab 8 Routing Table IF ((Mask[I] & Destination_Address) = Destination [I]) Forward to NextHop [I] 30.0.0.7 Net 1 30.0.0.0 40.0.0.8 R1 Net 2 40.0.0.0 40.0.0.7 Destination 30.0.0.0 40 0 0 0 40.0.0.0 128.1.0.0 192.4.10.0 R2 128.1.0.9 Net 3 128.1.0.0 128.1.0.8 Mask 255.0.0.0 255 0 0 0 255.0.0.0 255.255.0.0 255.255.255.0 MMlab R3 Net 4 192.4.0.0 192.4.10.9 Next Hop 40.0.0.7 Deliver Direct Deliver Direct 128.1.0.9 9 IPv4 Datagram Format 0 4 8 VERS HLEN 16 19 SERVICE TYPE 24 31 TOTAL LENGTH IDENTIFICATION FLAGS TIME TO LIVE PROTOCOL FRAGMENT OFFSET HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS (IF ANY) PADDING DATA ... MMlab 10 IP Format Version (4 bits) Internet Header Length (4 bits) : in 32-bit 32 bit words Min header is 5 words Type of Service (8 bits) Precedence delay Precedence, delay, reliability, reliability throughput Total Length (16 bits) header + data in bytes, less than 64KB Identifier (16 bits) uniquely identifies the datagram during its life Flags (3 bits) M More fl flag, N No ffragmentation t ti Fragment offset (13 bits) in units of 8 bytes Time to live ((8 bits)) in router hops p MMlab 11 IP Format (cont’d) Protocol (8 bits) Next level protocol to receive the data Header Checksum (16 bits) One’s complement sum of all 16-bit words in the header Source Address (32 bits) Original source. Does not change along the path Destination Address (32 bits) Final destination. destination Does not change among the path Options (variable) Padding (variable) M k h Makes header d llength th a multiple lti l off 4 b bytes, t zero iis iinserted t d Data (variable) Data + header < 65,535 bytes MMlab 12 Service Type 0 1 2 PRECEDENCE 3 4 5 D T R 6 7 UNUSED D low delay T high throughput R high reliability Precedence=importance of datagram ===> hint to routing algorithm MMlab 13 DiffServ 0 5 CODEPOINT 6 7 Unused 64 different services xxx000 for original definition precedence 6 or 7 for routing p g traffic MMlab 14 Fragmentation Datagram Size, Network MTU, and Fragmentation • MTU ((maximum Transfer Unit): ) fixed upper pp bound on the amount data that can be transferred in one physical frame e.g.) Ethernet: 1500 octets, FDDI: 4470 octets • Fragmentation: dividing large datagrams into smaller pieces when the datagram needs to traverse a network that has a small MTU • Fragments must be reassembled at the destination • If any fragments are lost, the datagram cannot be reassembled. • Reassembly timer : if expired, discard the received packets Fragmentation control • IDENTIFICATION : identical to the fragments • FLAGS: Don’t Fragment bit, More Fragments bit, • FRAGMENT OFFSET : by 8 octets No sequence number MMlab 15 Fragmentation HOST A HOST B Net 1 MTU=1500 R1 Net 2 MTU=620 MMlab R2 Net 3 MTU=1500 16 Fragments Datagram Header Data1 600 octets Data2 Data3 600 octets 200 octets Fragment 1 Data1 Header 600 octets Fragment 1 (offset 0) Fragment 2 Data2 Header 600 octets Fragment 2 (offset 600) Fragment 3 Data3 H d Header 200 octets t t Fragment g 3 ((offset 1200)) MMlab 17 Internet Datagram Options Included primarily for network testing or debugging Type(code)- Length-Value Option code (1 octet) 0 1 2 COPY OPTION CLASS 3 4 5 6 7 OPTION NUMBER Copy = 1 option copied to all fragments copied to the first fragment only =0 Class = 0 Datagram or network control =1 Resv’d Debugging and measurement =2 =3 Resv’d Option length (1 octet) Value V l : variable i bl llength th MMlab 18 IP Options Loose Source Routing Record R dR Route t Strict Source Routing Internet Timestamp etc. MMlab 19 Record Route Option 0 8 16 24 31 CODE LENGTH POINTER FIRST IP ADDRESS SECOND IP ADDRESS ……... MMlab 20 Strict Source Route Option 0 8 16 24 31 CODE LENGTH POINTER IP ADDRESS OF FIRST HOP IP ADDRESS OF SECOND HOP ……... Addresses overwritten by visited routers (= record route) MMlab 21 Timestamp Option 0 8 16 24 31 CODE LENGTH POINTER OFLOW FLAGS FIRST IP ADDRESS FIRST TIMESTAMP ……... In msec since midnight OFLOW : countt off routers t that th t couldn’t ld ’t supply l timestamps ti t because the option was too small FLAGS : record timestamps only (0) (0), etc etc. MMlab 22 IPv6 PDU General Form 40 octets IPv6 header 0 or more Extension header ….. MMlab Extension Transport-level header PDU 23 IPv6 Header 4 8 12 16 24 31 Flow label Version traffic class Payload length Next header Hop limit Source Address 40 octtets 0 Destination Address MMlab 24 IPv6 Header Version = 6 Traffic Class (8 bits) Flow Label (20 bits) Payload length (16 bits) : in octets except the IPv6 header N tH Next Header d (8 bit bits)) : identifies id tifi the th type t off header h d following f ll i the th IPv6 header Hop Limit (8 bits) : remaining number of allowable hops for this packet Source Address (128 bits) Destination Address ((128 bits)) : may y not be the ultimate destination, if routing header is present 40 octets in length MMlab 25 Flow Label A Flow is uniquely identified by source address and 20 bit flow label 20-bit label. A flow may comprise single or multiple TCP connections. connections A single application may generate a single or multiple flows (multimedia conferencing). At router, the same flow has the same path, resource allocation,, discard requirements, q , accounting, g, and security attributes. MMlab 26 Header Order IPv6 header : mandatory Hop-by-Hop Options header Destination Options header to be processed by destinations in the IPv6 header and Routing header Routing header : extended routing (source routing) Fragment header Authentication header Encapsulating Security Payload header Destination Options header to be processed by destination in the IPv6 header upper-layer header (TCP, application etc.) MMlab 27 IPv6 Fragmentation End-to-end Does D nott accommodate d t route t changes h Use Path MTU Discovery to determine minimum MTU in the path Minimum MTU is 1280 octets MMlab 28