Printer FriendlyEmail Article Link

How to add TCP/UDP header to Spirent TestCenter raw-Streamblock using TCL API?

Answer

 

 
1.       Create a raw-streamBlock
2.       Add Ethernet header
3.       Add IPv4 Header
4.       Add TCP/UDP header as shown below in the example
Following Example shows adding TCP header
# Create a stream block.
  set hStreamBlock [stc::create streamBlock -under $hPortA -insertSig TRUE \
                                                -frameConfig "" -frameLengthMode FIXED  \
    -maxFrameLength 1200 -FixedFrameLength 128]
 
# Add an EthernetII Protocol Data Unit (PDU).
                  stc::create ethernet:EthernetII -under $hStreamBlock -name sb1_eth  \
-srcMac 00:00:00:00:00:00  -dstMac 00:00:00:00:00:00
# Add IP PDU
                stc::create ipv4:IPv4 -under $hStreamBlock -name sb1_ip \
 -sourceAddr 10.0.0.2 -destAddr 192.168.1.1
 
# Add TCP
                stc::create tcp:Tcp -under $hStreamBlock -name sb1_tcp -destPort 11

Product : Spirent TestCenter,L2-3,Automation,API