1
play

1 Type of Service Version Header Total Length length TOS Why - PDF document

Internet Protocol (IP) Internet Protocol (IP) RFC 791 (1981) RFC 791 (1981) Lecture 11. Lecture 11. Connectionless datagram delivery service The Internet Layer The Internet Layer best-effort Unreliable no guarantees of


  1. Internet Protocol (IP) Internet Protocol (IP) RFC 791 (1981) RFC 791 (1981) Lecture 11. Lecture 11. � Connectionless � datagram delivery service The Internet Layer The Internet Layer � best-effort � Unreliable � no guarantees of reception & packet order IP (Internet Protocol) IP (Internet Protocol) & & � error-handling algorithm: throw away packet! ICMP (Internet Control Message Protocol) ICMP (Internet Control Message Protocol) � Upon buffer congestion � upon error check failed Giuseppe Bianchi Giuseppe Bianchi IP IP datagram datagram format format IP functions IP functions 20 bytes 20 bytes header header (minimum) (minimum) 0 3 7 15 31 � ��������������� Version Header Type of Service Total Length � �������������������������������������������� length TOS flags ��������� 16 bit identification 13 bit fragment offset 3 bit Time to Live � ������������������� ������ ��������������� Protocol Header checksum TTL � ����� ������� ��������� 32 bit source IP address � ���� �������� �� ����������������� 32 bit destination IP address � ������������� � �������������������������� ��������� Options (if any) Padding (0s) � ���� ������ � ������������������������������������������ Data (if any) � ��������������� ������� �������������������� ������� �� ������ ����� �������� Giuseppe Bianchi Giuseppe Bianchi Version Header Type of Service Version Header Type of Service Total Length Total Length length length TOS TOS flags flags 16 bit identification 13 bit fragment offset 16 bit identification 13 bit fragment offset 3 bit 3 bit Time to Live Time to Live Protocol Header checksum Protocol Header checksum TTL TTL 32 bit source IP address 32 bit source IP address 32 bit destination IP address 32 bit destination IP address � Version: 0100 (IPv4) � Total length: 16 bits � up to 65535 (including header) � allows to use multiple IP versions simultaneously… � Necessary, as you cannot rely on datalink for data size � Header length: in 32bit words � example: Ethernet has minimum payload size = 46 bytes � default: 0101 (5 x 32bit words = 20 bytes) � but you may send smaller IP datagram. � may extend header length up to 60 bytes � How to recognize how much of the 46 bytes is IP datagram? � SRC and DEST addresses � Protocol: specifies to which upper layer � obvious… protocol the datagram must be delivered � 1=ICMP; 2=IGMP, 6=TCP, 17=UDP Giuseppe Bianchi Giuseppe Bianchi 1

  2. Type of Service Version Header Total Length length TOS Why the protocol field? Why the protocol field? flags 16 bit identification 13 bit fragment offset 3 bit Demultiplexing Demultiplexing! ! Time to Live Protocol Header checksum TTL 32 bit source IP address TCP UDP ICMP … 32 bit destination IP address � TTL: max no. of hops the datagram can remain in the network ??????? � from 0 to 255; generally initially set to 64 Typical approach � each router decrements TTL of 1 (or every 1second latency) Adopted in most protocols � when TTL=0 (input datagram with TTL=1), packet thrown away IP (see e.g. datalink protocols) � sender notified via ICMP message � Prevents datagrams from traveling forever (e.g. captured in loops) � Header Checksum: header only Demultiplexing was also a TCP/UDP feature (versus application layer) � Same approach of TCP/UDP done by using full socket address <src IP, src Port, dest IP, dest Port> � efficient incremental computation at routers (RFC 1141), since only TTL changes (decrements) 8 bits: not too large (in principle the Internet is not doomed to TCP/UDP)! Giuseppe Bianchi Giuseppe Bianchi Version Header Type of Service Total Length TOS bits length TOS TOS bits flags 16 bit identification 13 bit fragment offset 3 bit � RFC 1340 & 1349 specify how these bits Time to Live Protocol Header checksum TTL should be set by standard apps. Examples: 32 bit source IP address � FTP data = max_thr 32 bit destination IP address � telnet = min_del � SNMP (simple network management protocol) = max_reliability � ������������������ TOS: 0 1 2 3 4 5 6 7 � NNTP (usenet news) = min_cost � ������������� Precedence � Routers may ignore TOS TOS bits 0 � � !�������"�#�$�%�� field � ����"��������&������� � TOS is just a suggestion � ����#����'���&������������ � ����(�� !������������������ � In practice, TOS field not set by hosts and ignored by routers � ����$����'���&������������� � ������������)�*��������������� until 1992-1993 � ����%��������&��������������� � ���������������� Today (from 1998), TOS field renascence: Differentiated Services Code Point (DSCP) Giuseppe Bianchi Giuseppe Bianchi Options Options Record Route Option details Record Route Option details Up to 40 extra bytes (10 x 32bit words) available for options. Common options: 39 bytes � Record Route Option (RRO) � 60 bytes header set with remaining options field empty code len ptr IPaddr 1 IPaddr 2 IPaddr 9 � each crossed router adds its IP address � maximum of 9 hops recordable - not practical today Ptr=8 Ptr=36 Ptr=4 Ptr=12 Ptr=40 � Timestamp Option � Code (1 byte): specifies option � like RRO, but routers also stamp crossing time instant � code for RRO = 7 � Source Route Option (Loose, Strict) � len (1 byte): specifies bytes reserved for option � allows sender to specify which routers must be crossed by � max=39bytes as extra header is at most 40 bytes, generally 39 � ptr (1 byte): tells where next address must be stored the datagram (i.e. bypasses network routing tables) � loose : cross the routers specified, in the order, plus � minimum ptr value = 4, others multiple (8, 12, 16, 20, 24, 28, 32, 36) � ptr=40 indicates that list is full others along the path (interconnecting specified ones) � strict : ALL routers specified, and no others! (may fail if Which router IP address recorded (there are two!)??? RFC791 says outgoing interface! routers not directly connected) Giuseppe Bianchi Giuseppe Bianchi 2

  3. Traceroute Traceroute Traceroute Traceroute idea (1) idea (1) � Send subsequent sets of 3 UDP packets to � Originally a debugging software program destination written by Van Jacobson � Start using TTL=1 � Test TTL field � after each set, increments TTL of 1 unit � Makes smart use of TTL � Listen for the response… � Allows to trace the route from source to destination host router router � Not limited to 9 hops as when RR option is used router � Does not require ANY specific router capability host router host router Giuseppe Bianchi Giuseppe Bianchi ICMP “Time exceeded” error ICMP “Time exceeded” error Traceroute idea (2) idea (2) Traceroute � When router decrements TTL to 0: ICMP header ICMP data part � throws away packet 8 bytes IP header � returns ICMP “time exceeded” message IP data carrying src IP = router IP � clearly containing router IP address � Transmitting host: 0 7 8 15 31 � records router (pretty print with reverse name lookup) Type (11) Code (0 or 1) Checksum � computes RTT to router 8 bytes Unused (must be all 0s) router router n RTT router IP Header (including options) + first 8 bytes of original IP data router host router host Code = 0: traceroute case (router detected a TTL decrement to 0) Code = 1: timed out while reassembling Giuseppe Bianchi Giuseppe Bianchi Router: which IP returned? Router: which IP returned? Traceroute Traceroute idea (3) idea (3) � !��� +�,������� �� ������������������ -�./�0120�� .��3+45�.!� Traceroute from 131.175.21.3: 131.175.21.3 � ���������+,�������������������������������������������� 131.175.21.8 131.175.12.42 �������164����������7����������������8 131.175.15.2 � 0������������������������������������������ 131.175.21.8 �����������9 Traceroute from 131.175.15.2: 131.175.12.32 131.175.15.1 131.175.12.32 router router n 131.175.12.42 131.175.21.3 router 131.175.15.1 router ICMP port 131.175.15.2 host router host unreachable Giuseppe Bianchi Giuseppe Bianchi 3

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend