Printer FriendlyEmail Article Link

Spirent TestCenter: How to send IPv4 fragments with raw streamblock?

Environment/Versions
  • Spirent TestCenter
  • IP Fragmentation using Raw streamblocks
Answer
  •  When trying to send fragment packets, the "fragment offset" value should be right, or else DUT or wireshark can't reassemble the packets.​
    • The unit of "Fragment offset" is 8 bytes.
  • So if the frame length of each fragment is 1514(without FCS), the data length in the IP packet is 1514 - 14(Ethernet Header) - 20(IP Header) =1480
    • "Fragment offset" of the second fragment should be 1480/8 = 185
  • So the value of "Fragment offset" be set in the STC should be 185 (For second fragment), 370(For the third fragment) and so on
  • Note :  All fragments must have the same Identification field value in the IP Header.
  • How to send IPv4 and IPv6 fragments on STC?
    • When trying to send fragment packets, the "fragment offset" value must be set correctly, or else DUT or wireshark can't reassemble the packets.?
    • We will use raw streamblocks to create these fragments.
    • IPv4 fragmented packets
      • In this example, a 4478 byte IPv4 datagram is being fragmented and we will assume a maximum fragment size of 1518.
        4478 byte IPv4 datagram = 14 byte Ethernet + 20 byte IPv4 + 4 byte FCS + 4440 byte Data
        1518 (with FCS), the data length in the IPv4 packet is:
             1518 - 14(Eth Hdr) - 20(IPv4 Hdr) - 4(FCS) =1480
        So we will have 3 fragments.
        Fragment 1 = 1518 (1480 data) (more fragment flag)
        Fragment 2 = 1518 (1480 data) (more fragment flag)
        Fragment 3 = 1518 (1480 data) (don't need more flag since this is last fragment)
        The unit of "Fragment offset" is 8 bytes.
            "Fragment offset" of the first fragment is zero since this is the first fragment.
            "Fragment offset" of the second fragment is 1480/8 = 185
            "Fragment offset" of the third fragment is 2960/8 = 370
        Note:  All fragments must have the same Identification field value in the IP Header.
    • IPv6 Fragmented packets
      • There is a term called Unfragmentable part and Fragmentable part.
        An IPv6 datagram could have additional headers that is considered as part of the data and thus is included in the fragmentable part.
        The Unfragmentable Part, begins each fragment, followed by the Fragment header. 
        Then, portions of the Fragmentable Part are placed into each fragment in sequence. 

        In this example, we can also use the 4478 byte with the IPv6 datagram althought we can't use the same fragment sizes due to the data must be in 8 byte increments.
        4478 byte IPv4 datagram = 14 byte Ethernet + 40 byte IPv6 + 8 byte Fragment Hdr + 4 byte FCS + 4412 Data
        1514 (with FCS), the data length in the IPv6 packet is:
            1514 - 14(Eth Hdr) - 40(IPv6 Hdr) - 8 (Frag Hdr) - 4(FCS) = 1448

        So again we need 4 fragments.
        Fragment 1= 1514 (1448 data) (more fragment flag)
        Fragment 2 = 1514 (1448 data) (more fragment flag)
        Fragment 3 = 1514 (1448 data) (more fragment flag)
        Fragment 4 = 134 (68 data) (don't need more flag since this is last fragment)
        The unit of "Fragment offset" is 8 bytes.
            "Fragment offset" of the first fragment is zero since this is the first fragment.
            "Fragment offset" of the second fragment is 1448/8 = 181
            "Fragment offset" of the third fragment is 1448/8 = 362
            "Fragment offset" of the third fragment is 1448/8 = 543
         
Attachments


Product : Spirent TestCenter,Spirent TestCenter,IP,PGA