question

dlwood-hp avatar image
dlwood-hp asked ksukesh edited

Easiest way to determine if streamblock is IPv4 or IPv6?

Spirent TestCenter (STC)apitcl script
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ksukesh avatar image
ksukesh answered ksukesh edited

Hi,

The below command should help.

% stc::get streamblock1 -children

ethernet:ethernetii1 ipv4:ipv41

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

udaya avatar image
udaya answered

The encapsulation of a streamblock says, it is of v4 or v6 (mostly)

lindex [split [stc::get streamblock1 -filter] ,] end
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dlwood-hp avatar image
dlwood-hp answered sreerag.parameswaran commented

Actually trying to do it via the STC API.

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sreerag.parameswaran avatar image sreerag.parameswaran ♦ commented ·

Could you try matching the "Ethertype" value from Ethernet header?

0 Likes 0 ·
sreerag.parameswaran avatar image
sreerag.parameswaran answered sreerag.parameswaran commented

We can try adding IPv4 source address and IPv6 source address to the Grid in Streamblock view.

Blank fields in one column show that its of the other version encapsulation


version.png (17.9 KiB)
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sreerag.parameswaran avatar image sreerag.parameswaran ♦ commented ·

Sorry, I misunderstood that the question was on GUI.

0 Likes 0 ·
dlwood-hp avatar image
dlwood-hp answered dlwood-hp rolled back

Is there an easier way to determine the IPvX pdu of a streamblock? Currently I use a proc to determine the PDU:

# Returns the IPvX PDU Version.
proc getIPvX {hStreamBlock} {
    set hPDUv4 [stc::get $hStreamBlock -children-ipv4:IPv4]

    if {$hPDUv4 != {}} {
        return 4
    }

    set hPDUv6 [stc::get $hStreamBlock -children-ipv6:IPv6]

    if {$hPDUv6 != {}} {
        return 6
    }

    # Unknown IP PDU.
    return -1
}

Trying to simplify this code so that I don't have to do additional stc::get(s) on a large volume of streamblocks.

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.