Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 4-1 資 管 Lesson 4 The IPv4&v6 Header. Lesson 4-2 資 管 Lesson Objectives Structure of an IPv6 packet IPv4 header IPv6 header IPv6 extension headers.

Similar presentations


Presentation on theme: "Lesson 4-1 資 管 Lesson 4 The IPv4&v6 Header. Lesson 4-2 資 管 Lesson Objectives Structure of an IPv6 packet IPv4 header IPv6 header IPv6 extension headers."— Presentation transcript:

1 Lesson 4-1 資 管 Lesson 4 The IPv4&v6 Header

2 Lesson 4-2 資 管 Lesson Objectives Structure of an IPv6 packet IPv4 header IPv6 header IPv6 extension headers IPv6 MTU Upper layer checksums

3 Lesson 4-3 資 管 IPv6 vs. IPv4 Packet Data Unit minimum 20 octets maximum 65535 octets Fixed 40 octets payload Maximum 65535 octets IPv6 PDU 0 or more IPv4 Header Data Field Transport-level PDU IPv6 Header Extension Header Extension Header Option Header Upto 40 octets Transport-level PDU payload IHL (Header length)

4 Lesson 4-4 Destination Address Source Address IdentificationFlagsOffset TTL ProtocolHeader Checksum Source Address Destination Address Options + Padding VerFlow Label Payload Length Next Header Hop Limit Traffic Class IPv4 vs. IPv6 Header IPv4 Packet Header IPv6 Packet Header 32 bits Ver IHL Total Length Service Type

5 Lesson 4-5 資 管 Version Internet Header Length Type of Service Total Length Identification Flags Fragment Offset Time to Live Protocol Header Checksum Source Address Destination Address Options... Structure of the IPv4 Header (5 to 15~ 5*4 to 15*4) (three bits Precedence + TOS bits) (~65536 bytes) (1, ICMP, 2, IGMP, 6,TCP, 17 UDP, 89, OSPF)

6 Lesson 4-6 資 管 Checksum: data integrity check: ◦ The packet is divided into k sections, each of n bits. (n=16) ◦ All sections are added together using one’s complement arithmetic. ◦ The final result is complemented to make the checksum. ◦ Question: Compare with parity check which is better?

7 Lesson 4-7 資 管 IP Packet Example with checksum 450 1 28 0 4 17 10.12.14.5 0 12.6.7.9 0 For Example; (For the following IP header without option)

8 Lesson 4-8 資 管 Fragmentation in IPv4 protocolMTU Hyperchannel65,535 Token ring (16Mbps) 17,914 Token ring (4Mbps)4,464 FDDI4,352 Ethernet1,500 X.25576 PPP296 IP datagram MTU in a frameHeaderTrailer Fields related to fragmentation (router to host) Identification: source host mark this fields Flags: three bits, xDM, D stands for don’t fragment (1), M stands for more fragments, 0 means the last or only fragment. fragmentation offset: 13-bit shows the relative position of this frament.

9 Lesson 4-9 資 管 Fragmentation example Offset = 0000/8 =0 Byte 0000 Byte 3999 Offset = 0000/8 =0 Byte 0000 Byte 1399 Offset = 1400/8 =175 Byte 1400 Byte 2799 Offset = 2800/8 =350 Byte 2800 Byte 3999 Assume: MTU equals 1400 bytes The value of offset is measured in units of eight bytes

10 Lesson 4-10 資 管 Detailed fragment example (without considering options and upper layer header) 14567 4020 000 0 14567 1420 000 1 14567 1420 175 1 14567 1220 350 0 14567 820 175 1 14567 620 275 1 Byte 0000~3,999 Original datagram Fragment 1 Fragment 2 Fragment 3 Fragment 2.1 Fragment 2.2

11 Lesson 4-11 資 管 IPv4 Header Option (40=60-20 bytes) Option format Code 8 bits Data Variable length Length 8 bits Copy 1 bit Number 5 bits Class 2 bits Number 00000 End of Option (one byte) 00001 No operation (one byte) 00011 Loose source route (multiple bytes) 00100 Timestamp (multiple bytes) 00111 Record route (multiple bytes) 01001 Strict source route (multiple bytes) Class 00 Datagram control 01 Reserved 10 Debugging and management 11 Reserved Copy (when fragmented) 0 Copy only in first fragment 1 Copy into all fragments Length: defines the total length of the option including the code field and itself. (not all present)

12 Lesson 4-12 資 管 Padding options No Operation: ◦ a one-byte option used as a filler between options; coded as 00000001 End of option: ◦ a one-byte option used for padding at the end of the option field. It can only be used as the last option. coded as 00000000. if more than one byte is needed to align the option field, some no operations must be used followed by an end of option.

13 Lesson 4-13 資 管 Record route concept (code(1 byte)+length(1 byte)+pointer(1 byte)+data field) First IP address (Empty when started) Second IP address (Empty when started) Last IP address (Empty when started) Code: 7 00000111 Length (Total length) Pointer

14 Lesson 4-14 資 管 Strict source route concept First IP address (filled when started) Second IP address (filled when started) Last IP address (filled when started) Code: 137 10001001 Length (Total length) Pointer

15 Lesson 4-15 資 管 Time Stamp Concept First IP address (filled when started) Timestamp 1 Last IP address (filled when started) Code: 137 10001001 Length (Total length) Pointer O-Flow 4 bits Flags 4 bits Timestamp last Flags: 0: add for each router the timestamp 1: add the timestamp and the outgoing IP address 3: the IP address is given, each router check IP address, if match, the same operation as in flag 1. O-Flow: Add the number of routers that could not add their timestamp due to no more fields available.

16 Lesson 4-16 資 管 Practice Quiz 4?0 1 28 0 4 17 10.12.14.5 0 12.6.7.9 ? For an the following IP header plus Record route option : Problem 1: What is the value of header length? Problem 2; What is the value of check sum? First IP address (Empty when started) Second IP address (Empty when started) Last IP address (Empty when started) Code: 7 00000111 15 4

17 Lesson 4-17 資 管 In IPv4, router perform the following: Checksum Verification [may skip it] Verify the version Decrement the value of TTL field. ◦ If it is less than 1, send an ICMPv4 Time Exceeded-Time to Live to source packet, if not, place the new value in the TTL field, Check for the presence of IPv4 header option, Determine a forwarding interface and a next-hop IPv4 address: ◦ Use the value of the destination address field and the contents of the local routing table to, MTU check: ◦ If MTU is less than the value of total length, perform IPv4 fragmentation. Recalculate the new header checksum,

18 Lesson 4-18 資 管 問題 電腦甲欲送 IP 封包到電腦乙,整個 MAC 內容為何 ? (with Time stamp option)

19 Lesson 4-19 資 管 Structure of the IPv6 Header Destination Address Source Address VerFlow Label Payload Length Next Header Hop Limit Traffic Class IPv6 Packet Header Ver: 4 bits (0110 for IPv6, 0100 for IPv4), Traffic Class: 8 bits with Service type in IPv4 Structure Flow Label: 20 bits with Label ID to attend the Qos Service Payload length: 16 bits length number exclude the 40 byte header. Next Header: 8 bits Hop Limit: 8 bits

20 Lesson 4-20 資 管 Values of the Next Header Field ValueHeader 0Hop-by-Hop Options Header 6TCP 17UDP 41Encapsulated IPv6 Header 43Routing Header 44Fragment Header 50Encapsulating Security Payload 51Authentication Header 58ICMPv6 59No next header 60Destination Options Header

21 Lesson 4-21 資 管 Comparing the IPv4 and IPv6 Headers IPv4 Header FieldChange in IPv6 VersionNew value of 6 Internet Header LengthRemoved Type of ServiceTraffic Class field Total LengthPayload Length field IdentificationRemoved to Fragment header Fragmentation FlagsRemoved to Fragment header Fragment OffsetRemoved to Fragment header Time to LiveHop Limit field ProtocolNext Header field Header ChecksumRemoved Source AddressSame, new 128-bit length Destination AddressSame, new 128-bit length OptionsRemoved (extension headers) 增加 Flow Label 20 bits

22 Lesson 4-22 資 管 In IPv6, router perform the following: Verify the value of Version field Decrement the value of Hop Limit Field, ◦ if …send ICMPv6…, if not, place the new value Check the next Header field for a value of 0, ◦ if 0, process the Hop-by-Hop Options header Use the value of Dest. Address and the contents of routing table to determine a forwarding, ◦ If the link MTU of the forwarding is less than 40+payload, send an ICMPv6 TOO Big Forwarding

23 Lesson 4-23 資 管 IPv6 Extension Headers Hop-by-hop options header (NF=0) Routing header (NF=43) Fragment header (NF=44) Authentication header (NF=51) Encapsulating security payload header (NF=41) Destination options header (NF=60) Transport-level PDU IPv6 Header Extension Header Extension Header 40 octets0 or more

24 Lesson 4-24 資 管 IPv6 Header Next Header = 6 (TCP) TCP Segment (header + data) IPv6 Header Next Header = 43 (Routing) TCP Segment (header + data)Routing Header Next Header = 6 (TCP) Authentication Header Next Header = 6 (TCP) IPv6 Header Next Header = 43 (Routing) Routing Header Next Header = 51 (AH) TCP Segment (header + data) The Chain of Pointers Formed by the Next Header field

25 Lesson 4-25 資 管 IPv6 Extension Headers IPv6 specification recommended order: ◦ IPv6 header ◦ Hop-by-hop options header ◦ Destination options header(for intermediate dest. When the routing header is present) ◦ Routing header ◦ Fragment header ◦ Authentication header ◦ Encapsulation security payload header ◦ Destination options header IPv6 packet with all extension headers Octets: 40 Variable 8 20 (optional variable part) = Next header field IPv6 header Hop-by-hop options header Routing header Fragment header Authentication header Encap security payload header TCP header Application data Destination options header

26 Lesson 4-26 資 管 Next Header Header Extension Length Routing Type Segments Left Routing type-specific data... Structure of the Routing Header Routing header: specify a source route which is a list of intermediate dest. For the packet to travel to on its path to the final dest. The same as Record route, strict source, and loose source routing option in IPv4

27 Lesson 4-27 資 管 Next Header Header Extension Length Routing Type Segments Left Reserved Address 1 Address N... = 0 (loose source routing) Structure of the Routing Type 0 Header First IP address (filled when started) Second IP address (filled when started) Last IP address (filled when started) Code: 131 10000011 Length (Total length) Pointer

28 Lesson 4-28 資 管 When the IPv6 packet reaches an intermediate destination, the routing header is processed and: 1.The current destination address and the address in the (N-Segments Left +1) position in the list of addresses are swapped 2.The Segments Left field is decremented 3.The packet is forwarded

29 Lesson 4-29 資 管 Quiz(4_1)-loose source routing Example G4_1: Fill out the loose source with three intermediate destination address: 2001::C001, 2001::C010, 2001::C122 Next Header Header Extension Length Routing Type Segments Left Reserved Address 1 Address N... = 0 (loose source routing)

30 Lesson 4-30 資 管 Example Monitor Capture Ipv6: Routing ; Proto =ICMPv6: Len =40 Version =6, Traffic class =0, Flow Label=0, Payload Length=64, Next Header =43,…., Source address: fec0::2:2b0:d0ff:fee9:4143. Destination address: Fec2::2:260:97ff:fe02:6e8f IPv6: Routing Header IPv6:Next Header =58 (ICMPv6) IPv6: Length =2, IPv6: Type =0 IPv6: Segments Left =1 IPv6 : Reserved IPv6: Route IPv6: address = fec0::1:260:8ff:fe52:f9d8 IPv6: Payload: number of remaining =40

31 Lesson 4-31 資 管 Next Header Reserved Fragment Offset Reserved More Fragments Flag Identification Structure of the Fragment Header Used for IPv6 fragmentation and reassembly services

32 Lesson 4-32 資 管 Unfragmentable partFragmentable part Unfragmentable partFirst fragment Fragment header Unfragmentable partSecond fragment Fragment header Unfragmentable partThird fragment Fragment header Original IPv6 Packet IPv6 Fragmentation Process

33 Lesson 4-33 資 管 Unfragmentable partFragmentable part Unfragmentable partFragmentable part Fragment header Unfragmentable partFragmentable part Fragment header Unfragmentable part Fragmentable part Fragment header Original IPv6 Packet IPv6 Reassembly Process

34 Lesson 4-34 資 管 Quiz(4_2)-Example of fragment header Q4-2: For a TCP segment of 4000 bytes, find the fragment header of IPv6 with MTU=1280 bytes

35 Lesson 4-35 資 管 Next Header Header Extension Length Options... Structure of the Hop-by-Hop Options Header Header Extension Length describes the number of 8-byte blocks, not including the first 8 bytes. E.g., for an 8-byte Hop-by-Hop, the value is 0, padding options are used.

36 Lesson 4-36 資 管 Option Type Option Length Option data... Structure of an Option An option is a set of fields that either describes a specific characteristic of the packet delivery or provides padding. Options are sent in Hop-by-Hop and Destination Options headers. Each option is encoded in the type- length-value (TLV) format. Option type Field: option type field both identifies the option and determines the way it is handled. Two high-order bits indicate how the option is handled by the node, 00 skip the option, 01 silently Discard the packet, 10 discard the packet and send an ICMPv6.., 11 discard the packet and send an ICMPv6.for not a multicast address. Third high-order bit indicates the option data can (1) or can not be changed (0) in the path to the destination.

37 Lesson 4-37 資 管 Option Type = 0 Structure of the Pad1 Option Option type Field: [Two high-order bits indicate how the option is handled by the node, 00 skip the option, 01 silently Discard the packet, 10 discard the packet and send an ICMPv6.., 11 discard the packet and send an ICMPv6.for not a multicast address. Third high-order bit indicates the option data can (1) or can not be changed (0) in the path to the destination.] Option type of 0: mean skipped if not recognized, not be changed,

38 Lesson 4-38 資 管 Option Type Option Length Option data... = 1 Structure of the PadN Option Option type Field: [Two high-order bits indicate how the option is handled by the node, 00 skip the option, 01 silently Discard the packet, 10 discard the packet and send an ICMPv6.., 11 discard the packet and send an ICMPv6.for not a multicast address. Third high-order bit indicates the option data can (1) or can not be changed (0) in the path to the destination.] Option type of 1: mean skipped if not recognized, not be changed,

39 Lesson 4-39 資 管 Option Type Option Length Jumbo Payload Length = 194 = 4 Structure of the Jumbo Payload Option Option type Field: The size in the IPv6 header is invalid, instead the jumbo payload length is used. Option type of 194 (11000010): indicates an ICMPv6 parameter problem if the option is not recognized and the destination address is not a multicast address.

40 Lesson 4-40 資 管 Quiz (5_1) Quiz (5_1): fill the hop-by-hop extension header with Jumbo Payload Option (value of 35567 bytes). Fill out all the fields and draw block diagram i.e., structure between IPv6 header, extension header, and the Data.

41 Lesson 4-41 資 管 Option Type Option Length Router Alert Value = 5 = 2 = 0 Structure of the Router Alert Option This option Indicates to a router that the contents of the packet require additional processing. Router Alert Option is used for Multicast Listener Discovery (MLD) and the Resource ReSerVation Protocol (RSVP).

42 Lesson 4-42 資 管 Monitor Capture (5_2) Ipv6: Version =6, Traffic class =0, Flow Label=0, Payload Length=32, Next Header =0,…. IPv6: Hop-by-Hop Options Header IPv6:Next Header =58 (ICMPv6) IPv6: Length =0, IPv6:Router Alert Option IPv6: Type =5 IPv6: Length =2 IPv6 Router Alert Value=0 IPv6: padding (2 bytes) IPv6: Type=1 (PadN) IPv6: length =0 IPv6: Palyload: number of remaining =24

43 Lesson 4-43 資 管 Quiz (5_2) Quiz (5_2): fill the values in the network capture in 5_2 into the relative fields in the hop-by-hop option. and draw the values and relation within the IPv6 header, extension header, and the Data.

44 Lesson 4-44 資 管 Next Header Header Extension Length Options... Structure of the Destination Options Header Dest. Options Header specify delivery parameters for either intermediate dest. or The final dest. If a routing header is present, it specifies delivery or processing options at each Intermediate destination. If no routing header is present, it specifies delivery or processing options at the final destination. Dest. Options Header used to supports Mobility in IPV6

45 Lesson 4-45 資 管 Structure of the Binding Update Option Option Type Option Length Flags Reserved Prefix Length Sequence Number Lifetime Sub-Options = 198... Used by the mobile IPv6 node to update another node with its new care-of-address

46 Lesson 4-46 資 管 Structure of the Binding Acknowledgement Option Option Type Option Length Status Sequence Number Lifetime Refresh Sub-Options = 7... Used of acknowledge the receipt of a binding update

47 Lesson 4-47 資 管 Option Type Option Length Sub-Options = 8... Structure of the Binding Request Option Used to request the binding from a mobile node.

48 Lesson 4-48 資 管 Option Type Option Length Home Address Sub-Options = 201... Structure of the Home Address Option Used to indicate the home address of the mobile node.

49 Lesson 4-49 資 管 Next Header Payload Length Reserved Security Parameters Index Sequence Number Authentication Data... Structure of the Authentication Header

50 Lesson 4-50 資 管 Security Parameters Index Sequence Number Payload Data Padding Padding Length Next Header Authentication Data... Structure of the ESP Header and Trailer

51 Lesson 4-51 資 管 IPv6 MTU Link layer must support a 1280-byte MTU ◦ Otherwise, link layer must use a transparent fragmentation and reassembly scheme For configurable MTU link layers, MTU size of at least 1500 bytes ◦ Example: Maximum Receive Unit (MRU) of a Point- to-Point Protocol (PPP) link Path MTU Discovery process uses the ICMPv6 Packet Too Big message

52 Lesson 4-52 資 管 Source Address Destination Address Upper Layer Packet Length Zero Next Header = 0 Structure of the IPv6 Pseudo- Header

53 Lesson 4-53 資 管 Internet 封裝 網際層訊框包裝 (Ethernet II) ◦ Internet 封裝:網際層封包與 Ethernet 訊框包裝 ◦ Type 0800 : IP v4 封包 ◦ Type 86DD: IP v6 封包 ◦ Type 0806 : ARP 封包 ◦ Type 0835 : RARP 封包 53

54 Lesson 4-54 資 管 Internet 封裝 網際層訊框包裝 ( IP in in 802.2+802.3 LLC/SNAP) ◦ 區域網路封裝:網際層封包與 802.2/802.3 訊框包裝 54

55 Lesson 4-55 資 管 Ethernet II (DIX)Frame PreambleSFD Destination address Source address TypeDataCRC Preamble: 56 bits of alternating 0s and 1s that alert the receiving system to the coming frame. SFD: one-byte field(10101011) is used as a flag. Destination address: Source address: Data: 46 bytes to 1500 bytes CRC: CRC-32


Download ppt "Lesson 4-1 資 管 Lesson 4 The IPv4&v6 Header. Lesson 4-2 資 管 Lesson Objectives Structure of an IPv6 packet IPv4 header IPv6 header IPv6 extension headers."

Similar presentations


Ads by Google