Internet Protocol Connectionless Datagram Delivery IPv 4 Chapter

  • Slides: 36
Download presentation
Internet Protocol: Connectionless Datagram Delivery (IPv 4) Chapter 6 1

Internet Protocol: Connectionless Datagram Delivery (IPv 4) Chapter 6 1

Have looked at HW & SW that make internet communication possible Now begin looking

Have looked at HW & SW that make internet communication possible Now begin looking at IP n n n Internet Protocol Provides connectionless delivery IP datagrams form basis for all internet communication 2

Internet Philosophy Focus: interface internet provides to users n Not on the interconnection technology

Internet Philosophy Focus: interface internet provides to users n Not on the interconnection technology User sees single virtual network n Underlying architecture is hidden and irrelevant Conceptually, TCP/IP provides three sets of services: Application Services Reliable Transport Service Connectionless Packet Delivery Service 3

Protocol SW can be associated with each n n Instead, consider them conceptual internet

Protocol SW can be associated with each n n Instead, consider them conceptual internet parts Embody philosophical underpinnings of design Internet SW designed around the conceptual services Surprisingly robust and adaptable architecture Adv of conceptual separation n Can replace one service without disturbing others R&D can proceed concurrently on all three 4

Connectionless Delivery System Most fundamental internet service: n Packet delivery system Technically, the service

Connectionless Delivery System Most fundamental internet service: n Packet delivery system Technically, the service is: n Unreliable Packet can be lost, duplicated, delayed, out-of-order No notification of such problems n Best-effort Makes earnest attempt to deliver n Connectionless Packets treated independently 5

Purpose of the IP IP: protocol that defines delivery service n Specifies basic unit

Purpose of the IP IP: protocol that defines delivery service n Specifies basic unit of transfer Exact format of data n Performs the routing function Chooses the paths for packets n Includes rules for unreliable packet delivery How hosts and routers process packets How and when error messages are generated When packets can be discarded 6

Internet Datagram Physical network: n Unit of transfer is frame Contains header and data

Internet Datagram Physical network: n Unit of transfer is frame Contains header and data Internet n Unit of transfer is Internet datagram IP datagram or datagram Contains header and data Header difference: n IP addresses versus physical addresses 7

IP Datagram Header Datagram Data Area Datagram format 0 VERS 4 8 HLEN 16

IP Datagram Header Datagram Data Area Datagram format 0 VERS 4 8 HLEN 16 Service Type 24 31 Total Length Identification Time to Live 19 Flags Protocol Fragment Offset Header Checksum Source IP Address Destination IP Address IP Options (if any) Padding Data. . . 8

Service Type field: n Originally 0 1 2 PRECEDENCE n 3 4 5 D

Service Type field: n Originally 0 1 2 PRECEDENCE n 3 4 5 D T R 6 7 UNUSED Precedence 0 -7 Routers use 6 or 7 (info goes thru during congestion) n n n D: low delay T: high throughput R: high reliability 9

n Later 0 1 2 3 CODEPOINT n n 4 5 6 7 UNUSED

n Later 0 1 2 3 CODEPOINT n n 4 5 6 7 UNUSED Differential Services interpretation Have 8 ordered classes when of form: xxx 000 Just like previous precedence 6 or 7 goes to high priority class of service n Codepoint values divided into 3 groups: xxxxx 0 : assigned by Standards organization xxxx 11 : local or experimental xxxx 01 : local or experimental for now 10

Regardless of the interpretation: n n Service type specification is a hint to the

Regardless of the interpretation: n n Service type specification is a hint to the routing algorithm Chose among various paths based on: Local policies Knowledge of technologies available on the paths n No guarantee to provide a type of service 11

Datagram Encapsulation How long can a datagram be? n n Handled by SW (not

Datagram Encapsulation How long can a datagram be? n n Handled by SW (not HW) Any length protocol designers want IPv 4 has 16 bits for total length field n Limit is 65, 535 octets But, want efficient transportation n Map abstract physical packet to real packet 12

Encapsulation: n n n Idea to carry 1 datagram in 1 network frame Underlying

Encapsulation: n n n Idea to carry 1 datagram in 1 network frame Underlying HW not concerned with datagram One machine to another: datagram is in the data portion of a frame Datagram Header Datagram Data Area Frame Header Frame Data Area 13

Ideal: entire IP datagram in one frame n n n Would need maximum datagram

Ideal: entire IP datagram in one frame n n n Would need maximum datagram size What would that be? Look at network hardware: MTU: maximum transfer unit n n n Ethernet: 1500 octet MTU FDDI: 4470 octet MTU Some hardware: 128 octets or less Limit to smallest: inefficient If bigger than MTU: need multiple frames 14

Design goal: convenience for user n Not worry about physical network constraints Solution: n

Design goal: convenience for user n Not worry about physical network constraints Solution: n n Pick convenient initial datagram size Have way to divide up for small MTU Pieces of divided datagram: fragments Process of dividing: fragmentation 15

Fragmentation usually occurs along the path Host A Host B Net 1 Net 3

Fragmentation usually occurs along the path Host A Host B Net 1 Net 3 MTU=1500 R 1 Net 2 MTU=62 0 R 2 16

Fragments sized for one per frame Size is a multiple of eight n Last

Fragments sized for one per frame Size is a multiple of eight n Last piece may be shorter than rest Fragments must be reassembled n Datagram must be rebuilt before processing IP does not limit datagrams to small size n n Source can choose any size Fragmentation and reassembly are automatic Routers must accept datagrams up to max size of MTU’s of attached networks Routers must handle datagrams up to 576 octets Each piece formatted like original datagram 17

Datagram Header (600 octets) Fragment 1 Header Data 1 Fragment 1 (offset 0) Fragment

Datagram Header (600 octets) Fragment 1 Header Data 1 Fragment 1 (offset 0) Fragment 2 Header Data 2 Fragment 2 (offset 600) Fragment 3 Header Data 1 Data 3 Data 2 (600 octets) Data 3 (200 octets) Fragment 3 (offset 1200) Fragment header mostly the same as datagram header n Bit in the FLAGS field; Value in TOTAL LENGTH field; checksum 18

Reassembly of Fragments Reassembly after each hop or at end? TCP/IP: once fragmented, stays

Reassembly of Fragments Reassembly after each hop or at end? TCP/IP: once fragmented, stays that way n Reassemble at ultimate destination (host) Two disadvantages: n n Inefficient if other networks have higher MTU Probability of datagram loss increases with more fragments Advantages: n n Fragments can be routed independently Intermediate routers do not have to store or reassemble 19

Fragmentation Control Three datagram header fields control fragmentation and reassembly: n Identification Unique integer

Fragmentation Control Three datagram header fields control fragmentation and reassembly: n Identification Unique integer to ID the datagram n Fragment Offset in original datagram of data being carried n Flags Use two low-order bits of 3 -bit field 1 st bit: if set, means do not fragment Low bit: more fragments bit 20

Time to Live (TTL) TTL specifies how long, in seconds, datagram is allowed to

Time to Live (TTL) TTL specifies how long, in seconds, datagram is allowed to remain in the internet system n n n Router & hosts that process must decrement TTL Remove when time expires Each router decrements TTL by 1 If long delay, decrement by number seconds there n When TTL = 0, discard and send error message Guarantees datagram not be around forever Mostly, TTL acts as hop limit n Rather than estimate of delay 21

Other Datagram Header Fields PROTOCOL n n Tells which high-level protocol used in creation

Other Datagram Header Fields PROTOCOL n n Tells which high-level protocol used in creation Specifies format of data area HEADER CHECKSUM n n Ensures integrity of header values Only applies to header, not data Adv: Header smaller; routers only worry about headers Higher level protocols choose own data checksum scheme Disadv: Higher level protocols must add their own data checksum 22

SOURCE IP ADDRESS DESTINATION IP ADDRESS n n Contain 32 -bit IP addresses of

SOURCE IP ADDRESS DESTINATION IP ADDRESS n n Contain 32 -bit IP addresses of sender & recipient Never change when going through routers IP OPTIONS n n Variable length PADDING field depends upon options selected 23

Datagram Options IP OPTIONS field not required n n Used mostly for network testing

Datagram Options IP OPTIONS field not required n n Used mostly for network testing and debugging Option processing is integral part of IP protocol Field length varies based on options selected n n Options appear contiguously; no separators Each option: Consists of single octet option code Followed by single octet length & set of data octets 24

Option code octet divided into three fields 0 Copy n 1 2 Option Class

Option code octet divided into three fields 0 Copy n 1 2 Option Class 3 4 5 6 7 Option Number COPY flag controls how routers treat options during fragmentation Set to 1: copy options to all fragments Set to 0: only copy into first fragment n CLASS & NUMBER fields specify general option class and a specific option in the class Class 0: datagram or network control Class 1: Reserved for future use Class 2: Debugging and measurement Class 3: Reserved for future use 25

26

26

Record Route Option Source creates empty list of IP addresses n Each router adds

Record Route Option Source creates empty list of IP addresses n Each router adds its IP address to the list Format: 0 8 Code (7) 16 Length 24 31 Pointer First IP Address Second IP Address. . . 27

Original source must allocate enough space for the addresses When a machine handles the

Original source must allocate enough space for the addresses When a machine handles the datagram: n Compare pointer and length fields Pointer > length: list full (not address) Otherwise: put 4 -octet IP address at pointer position and increment pointer Source and destination must agree to use n n Source enable option Destination agree to process resulting list 28

Source Route Option Sender can dictate path through the internet Format: 0 Code (137)

Source Route Option Sender can dictate path through the internet Format: 0 Code (137) 8 16 Length 24 31 Pointer IP Address of first hop IP Address of second hop. . . n n Test throughput over particular network Average user would not know topology 29

Strict source routing: n n Addresses specify exact path Path between addresses must be

Strict source routing: n n Addresses specify exact path Path between addresses must be a single network Loose source routing n n Datagram must follow sequence of IP addresses May be multiple hops between addresses Processing similar to record route option n When router follows an IP address, it replaces the IP address with its own address 30

Timestamp Option Initially empty list Each router adds: n n 32 -bit IP address

Timestamp Option Initially empty list Each router adds: n n 32 -bit IP address 32 -bit integer timestamp 0 8 Code (68) 16 Length 24 Pointer Oflow 31 Flags First IP Address First IP Timestamp. . . 31

Oflow (4 -bits) n Integer count of routers that could not timestamp Flags (4

Oflow (4 -bits) n Integer count of routers that could not timestamp Flags (4 -bits) n Controls format of the option 0: Record timestamp only; omit IP addresses 1: Precede each timestamp by an IP address 3: IP addresses are specified by sender; a router only records a timestamp if the next IP address in the list matches the router’s IP address 32

Timestamps tell when router handled the datagram n n Expressed as milliseconds since midnight

Timestamps tell when router handled the datagram n n Expressed as milliseconds since midnight Based on Universal Time (Greenwich Mean Time) All computer clocks not necessarily synchronized n n Local clocks may differ Should be treated as estimates Why not just use record route option? n n Eliminates ambiguity Receiver knows exactly which path the datagram followed 33

Processing Options During Fragmentation COPY bit in CODE field n n n Replicates some

Processing Options During Fragmentation COPY bit in CODE field n n n Replicates some options in all fragments Places some in only one fragment Ex: Recording the datagram route Not all fragments will follow the same route Reassembly would produce conflicting lists Only put in one fragment n Ex: Source route option Must be replicated for all fragments to follow same route 34

Summary Fundamental TCP/IP service is n n Connectionless Unreliable Best-effort Packet delivery IP formally

Summary Fundamental TCP/IP service is n n Connectionless Unreliable Best-effort Packet delivery IP formally specifies internet packet format n Called datagram 35

Like physical frame, datagram has header and data n Header contains: Source and destination

Like physical frame, datagram has header and data n Header contains: Source and destination IP addresses Fragmentation control Precedence Checksum Options field n Variable in length n Intended to help monitor and control an internet 36