Chapter 7 Internet Protocol Version 4 (Ipv4)

Chapter 7 Internet Protocol Version 4 (Ipv4)

Chapter 7 Internet Protocol Version 4 (IPv4) Kyung Hee University 1 7.1 Introduction The transmission mechanism used by the TCP/IP Unreliable and connectionless datagram protocol Best-effort delivery service IP packets can be corrupted, lost, arrive out of order, or delayed and may create congestion for the network Each datagram is handled independently Each datagram can follow a different route to destination Datagram sent by the same source to the same destination could arrive out of order. Kyung Hee University 2 Position of IP in TCP/IP protocol suite Kyung Hee University 3 7.2 Datagrams Datagrams are packets in the network layer Datagram is a variable-length packet consisting of header and data. The header is 20 to 60 bytes, contains information essential to routing and delivery It is customary in TCP/IP to show the header in 4-byte section Field in Header Version(VER) – the version of IP protocol (4-bit) Header length(HLEN) – total length of the datagram header in 4-byte words. Kyung Hee University 4 IP Datagram Kyung Hee University 5 IP Datagram TOS(Type of Service) – 8-bit x x x 0 0 0 x x x x x 0 Precedence x x x x 1 1 interpretation x x x x 0 1 Differential service interpretation Category Codepoint Assigning Authority 1 XXXXX0 Internet : 24 services 2 XXXX11 Local 3 XXXX01 Temporary or experiment Kyung Hee University 6 IP Datagram Total Length 16-bit field (limited to 65,535 bytes) Define the total length of the IP datagram in bytes Length of data = total length – header length Encapsulation of a small datagram in an Ethernet frame Figure 7.4 Encapsulation of a small datagram in an Ethernet frame Kyung Hee University 7 IP Datagram Identification – used in fragmentation Flags – used in fragmentation Fragmentation offset – used in fragmentation Time to love – limited life time of datagram Protocol – the higher level protocol that uses the services of the IP layer Fig. 7.5 Multiplexing Kyung Hee University 8 IP Datagram Checksum – Check errors Source address – The IP address of source Destination address – The IP address of destination Kyung Hee University 9 Example 7.1 An IP packet has arrived with the first 8 bit shown: The receiver discards the packet. Why? Solution There is an error in this packet. The 4 left-most bit(0100) show the version, which is correct. The next 4 bit(0010) show the wrong header length(2 × 4 = 8). The minimum number of byte in the header must be 20. The packet has been corrupted in transmission. Kyung Hee University 10 Example 7.2 In an IP packet, the value of HLEN is 1000 in binary. How many byte of option are being carried by this packet? Solution The HLEN value is 8, which means the total number of bytes in the header is 8 × 4 or 32 bytes. The first 20 bytes are the base header, the next 12 bytes are the option. Kyung Hee University 11 Example 7.3 In an IP packet, the value of HLEN is 516 and the value of the total length field is 002816. How many bytes of data are being carried by this packet? Solution The HLEN value is 5, which mean the total number of bytes in the header is 5 × 4 or 20 bytes (no options). The total length is 40 bytes, which means the packet is carrying 20 bytes of data (40 − 20). Kyung Hee University 12 7.3 Fragmentation The format and size of the received frame depend on the protocol used by the physical network When a datagram encapsulated in a frame, the total size of the datagram must be less than MTU(Maximum Transfer Unit) size We must divide the datagram to make it possible to pass through the network; this is called fragmentation Kyung Hee University 13 MTU(Maximum Transfer Unit) IP datagram MTU Header Maximum length of data that can be encapsulated in a frame Trailer Frame Kyung Hee University 14 Fragmentation The value of the MTU differs from one physical network protocol to another Kyung Hee University 15 Fields Related to Fragmentation Identification – All fragments have the same identification value Flag – 3-bit field Fragmentation offset – 13-bit field, the relative position of this fragment with respect to the whole datagram Kyung Hee University 16 Fragmentation Example Offset = 0000/8 = 0 0000 1399 Offset = 1400/8 = 175 1400 2799 Offset = 2800/8 = 350 2800 3999 Kyung Hee University 17 Detailed Fragmentation Example 1420 14,567 1 000 Bytes 0000–1399 820 14,567 1 175 Fragment 1 4020 14,567 0 000 1420 Bytes 1400–2199 14,567 1 175 Fragment 2.1 Bytes 0000–3999 Bytes 1400–2799 Original datagram Fragment 2 1220 14,567 0 350 Bytes 2800–3999 Fragment 3 Kyung Hee University 18 Example 7.5 A packet has arrived with an M bit value of 0. Is this first fragment, or a middle fragment? Do we know if the packet was fragment? Solution If the M bit is 0, it means that there are no more fragment; the fragment is the last one. However, we cannot say if the original packet was fragment or not. A nonfragmented packet is considered the last fragment. Kyung Hee University 19 Example 7.9 A packet has arrived in which the offset value is 100, the value of HLEN is 5 and the value of the total length field is 100. What is the number of the first byte and the last byte? Solution The first byte number is 100 × 8 = 800. The total length is 100bytes and the header length is 20bytes (5 × 4), which means that there are 80 bytes in this datagram. If the first byte number is 800, the last byte number must be 879. Kyung Hee University 20 7.4 Options Type field (8-bit) : Fixed length Copy : Control the presence of the option in fragmentation Class : Define the general purpose of the option Number : Define the type of option Length field (8-bit) : Fixed length The total length of the option Value field : Variable length Contain the data that specific options require Kyung Hee University 21 Option Format 8 bits 8 bits Variable length Type Length Value Number Class 00000 End of option 00001 No operation Copy 00 Datagram control 00011 Loose source route 01 Reserved 00100 Timestamp 0 Copy only in first fragment 10 Debugging and management 00111 Record route 1 Copy into all fragments 11 Reserved 01001 Strict source route Kyung Hee University 22 Categories of Options Kyung Hee University 23 No Operation Option 1-byte option used as a filter between options Kyung Hee University 24 End-of-Option Option 1-byte option used for padding at the end of the option field Kyung Hee University 25 Record-Route Option Used to record the Internet routers that handle the datagram Kyung Hee University 26 Record-Route Concept 7 15 4 7 15 8 7 15 12 7 15 16 140.10.6.3 140.10.6.3 140.10.6.3 200.14.7.9 200.14.7.9 138.6.22.26 67.34.30.6 138.6.25.40 2 6 4 3 2 4 2 9 . 1 . 6 0 5 2 7 . 7 . 1 . 2 0 . 0 . 4 4 1 4 1 6 1 . 1 . 1 . 0 . 0 8 0 0 4 7 4 3 0 0 1 6 1 1 2 2 67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16 Network Network Network Network Kyung Hee University 27 Strict-Source-Route Option Used by source to predetermine a route for the datagram as it travels through the Internet All of routers defined in the option must be visited by the datagram Kyung Hee University 28 Strict-Source-Route Concept Source: 67.34.30.6 Source: 67.34.30.6 Source: 67.34.30.6 Source: 67.34.30.6 Destination: 67.14.10.22 Destination:140.10.5.4 Destination:200.14.7.14 Destination:138.6.25.40 137 15 4 137 15 8 137 15 12 137 15 16 140.10.5.4 67.14.10.22 67.14.10.22 67.14.10.22 200.14.7.14 200.14.7.14 140.10.5.4 140.10.5.4 138.6.25.40 138.6.25.40 138.6.25.40 200.14.7.14 67.34.30.6 138.6.25.40 2 6 4 3 2 4 2 9 . 1 . 6 0 5 2 7 . 7 . 1 . 2 0 . 0 . 4 4 1 4 1 6 1 . 1 . 1 . 0 . 0 8 0 0 4 7 4 3 0 0 1 6 1 1 2 2 67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16 Network Network Network Network Kyung Hee University 29 Loose-Source-Route Option Similar to the strict source route, but it is more relaxed. Each router in the list must be visited, but the datagram can visit other routers as well Kyung Hee University 30 Timestamp Option Used to record the time of datagram processing by a router The time is expressed in miliseconds from Universal Time Kyung Hee University 31 Use of Flag in Timestamp Flag 0 : each router adds only the timestamp in the provided field Flag 1 : each router must add its outgoing IP address and the timestamp Flag 3 : the IP addresses are given, and each router must check the given IP address with its own incoming IP address 1 0 Kyung Hee University 32 Timestamp Concept 68 28 5 0 1 68 28 13 0 1 68 28 21 0 1 68 28 29 0 1 140.10.6.3 140.10.6.3 140.10.6.3 36000000 36000000 36000000 200.14.7.9 200.14.7.9 36000012 36000012 138.6.22.26 36000020 67.34.30.6 2 6 4 3 2 4 2 9 .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    61 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us