4b internet protocol


Published on

Published in: Education, Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

4b internet protocol

  1. 1. 9.1Network Layer:Internet ProtocolNetworking Fundamentals
  2. 2. 20.2INTERNETWORKINGINTERNETWORKINGWe now discuss internetworking _ connectingWe now discuss internetworking _ connectingnetworks together to make an internetwork or annetworks together to make an internetwork or aninternet.internet.
  3. 3. 20.3Links between two hosts
  4. 4. 20.4Network layer in an internetwork
  5. 5. 20.5Network layer at the source, router, and destination
  6. 6. 20.6Switching at the network layer in theInternet uses the datagram approach topacket switching. In a datagramnetwork, each packet is treatedindependently of others, even if it is apart of a multipacket transmission.Packets in this approach are normallyreferred to as datagrams.Note
  7. 7. 20.7Communication at the network layer inthe Internet is connectionless. Thereason for this is due to theheterogeneous nature of the Internet.Note
  8. 8. 20.8IPv4IPv4• The Internet Protocol version 4 (The Internet Protocol version 4 (IPv4IPv4) is the) is thedelivery mechanism used by the TCP/IP protocols.delivery mechanism used by the TCP/IP protocols.• It is an unreliable – aIt is an unreliable – a best-effort deliverybest-effort delivery service.service.• If reliability is important, then it must be pairedIf reliability is important, then it must be pairedwithwith TCP.TCP.
  9. 9. 20.9Position of IPv4 in TCP/IP protocol suite
  10. 10. 20.10IPv4 datagram formatVersion ? HLEN ?
  11. 11. 20.11Service type or differentiated services
  12. 12. 20.12• Differentiated Services or DiffServ is a computernetworking architecture that specifies a simple, scalableand coarse-grained mechanism for classifying, managingnetwork traffic and providing Quality of Service (QoS)guarantees on modern IP networks.• DiffServ can, for example, be used to provide low-latency, low-loss service to critical network traffic such asvoice or video while providing simple best-effort trafficguarantees to non-critical services such as web traffic orfile transfers.• DiffServ uses the 6-bit Differentiated Services CodePoint (DSCP) field in the header of IP packets for packetclassification purposes.
  13. 13. 20.13• In theory, a network could have up to 64 (i.e. 26)different traffic classes using different markings in theDSCP. The DiffServ RFCs recommend, but do not require,certain encodings.• This gives a network operator great flexibility indefining traffic classes. In practice, however, mostnetworks use the following commonly-defined Per-HopBehaviors:–Default PHB—which is typically best-effort traffic–Assured Forwarding (AF) PHB— which gives assurance ofdelivery under conditions–Expedited Forwarding (EF) PHB—dedicated to low-loss,low-latency traffic
  14. 14. 20.14The total length field defines the totallength of the datagram including theheader. Required such that candifferentiate from the padding.NoteWhat is this ?
  15. 15. 20.15Encapsulation of a small datagram in an Ethernet frame
  16. 16. 20.16• Time to live (TTL) (8 bits) - Limits the number ofrouters the datagram can pass through. Usuallyset to 32 or 64 (some even recommend 128).Every time the datagram passes through a routerthis value is decremented by a value of one ormore. This is to keep the datagram from circulatingin an infinite loop forever.• Protocol (8 bits) - It identifies the protocolwhose data is encapsulated in the datagram.• Source & Destination IP Address – Self-explanatory.
  17. 17. 20.17Protocol field and encapsulated data
  18. 18. 20.18An IPv4 packet has arrived with the first 8 bits as shown:01000010The receiver discards the packet. Why?SolutionThere is an error in this packet. The 4 leftmost bits (0100)show the version, which is correct. The next 4 bits (0010)show an invalid header length (2 × 4 = 8). The minimumnumber of bytes in the header must be 20. The packet hasbeen corrupted in transmission.Example 1
  19. 19. 20.19In an IPv4 packet, the value of HLEN is 1000 in binary.How many bytes of options are being carried by thispacket?SolutionThe HLEN value is 8, which means the total number ofbytes in the header is 8 × 4, or 32 bytes. The first 20 bytesare the base header, the next 12 bytes are the options.Example 2
  20. 20. 20.20In an IPv4 packet, the value of HLEN is 5, and the valueof the total length field is 0x0028. How many bytes ofdata are being carried by this packet?SolutionThe HLEN value is 5, which means the total number ofbytes in the header is 5 × 4, or 20 bytes (no options). Thetotal length is 40 bytes, which means the packet iscarrying 20 bytes of data (40 20).−Example 3
  21. 21. 20.21An IPv4 packet has arrived with the first few hexadecimaldigits as shown.0x45000028000100000102 . . .How many hops can this packet travel before beingdropped? The data belong to what upper-layer protocol?SolutionTo find the time-to-live field, we skip 8 bytes. The time-to-live field is the ninth byte, which is 01. This means thepacket can travel only one hop. The protocol field is thenext byte (02), which means that the upper-layer protocolis IGMP.Example 4
  22. 22. 20.22Maximum Transmission Unit (MTU)• IP packets larger than theMTU must go through IPfragmentation procedures.MTUs for some networks
  23. 23. 20.23• Fragmentation related fields:•Identification - Uniquely identifies each datagram. This is usedto re-assemble the datagram. Each fragment of the datagramcontains this same unique number.• Flags:— Bit 0 - reserved.— Bit 1 - The do not fragment bit. A value of 1 means the packetshould not be fragmented while a 0 means it may befragmented.— Bit 2 - The more fragment bit. This value is set on all fragmentsexcept the last one since a value of 0 means this is the lastfragment.• Fragment offset - The offset in 8 byte units of this fragmentfrom the beginning of the original datagram (8191 x 8 = 65528).
  24. 24. 20.24Fragmentation exampleNote. Fragmentation offsets are calculated from the data lengths and not the total lengths ofthe packet
  25. 25. 20.25Detailed fragmentation example
  26. 26. 20.26A packet has arrived with an M bit value of 0. Is this thefirst fragment, the last fragment, or a middle fragment?Do we know if the packet was fragmented?SolutionIf the M bit is 0, it means that there are no morefragments; the fragment is the last one. However, wecannot say if the original packet was fragmented or not. Anon-fragmented packet is considered the last fragment.Example 5
  27. 27. 20.27A packet has arrived with an M bit value of 1. Is this thefirst fragment, the last fragment, or a middle fragment?Do we know if the packet was fragmented?SolutionIf the M bit is 1, it means that there is at least one morefragment. This fragment can be the first one or a middleone, but not the last one. We don’t know if it is the firstone or a middle one; we need more information (thevalue of the fragmentation offset).Example 6
  28. 28. 20.28A packet has arrived with an M bit value of 1 and afragmentation offset value of 0. Is this the first fragment,the last fragment, or a middle fragment?SolutionBecause the M bit is 1, it is either the first fragment or amiddle one. Because the offset value is 0, it is the firstfragment.Example 7
  29. 29. 20.29A packet has arrived in which the offset value is 100.What is the number of the first byte? Do we know thenumber of the last byte?SolutionTo find the number of the first byte, we multiply the offsetvalue by 8. This means that the first byte number is 800.We cannot determine the number of the last byte unlesswe know the length.Example 8
  30. 30. 20.30A packet has arrived in which the offset value is 100, thevalue of HLEN is 5, and the value of the total length fieldis 100. What are the numbers of the first byte and the lastbyte?SolutionThe first byte number is 100 × 8 = 800. The total length is100 bytes, and the header length is 20 bytes (5 × 4), whichmeans that there are 80 bytes in this datagram. If the firstbyte number is 800, the last byte number must be 879.Example 9
  31. 31. 20.31Figure shows an example of a checksum calculation foran IPv4 header without options. The header is dividedinto 16-bit sections. All the sections are added and thesum is complemented. The result is inserted in thechecksum field.Example 10
  32. 32. 20.32Example of checksum calculation in IPv4
  33. 33. 20.33Taxonomy of options in IPv4
  34. 34. 20.34
  35. 35. 20.35