All Classes Namespaces Files Functions Pages
Layer2_5.Vlan Class Reference

Configure the VLAN tag on a ByteBlower Port. More...

Methods

 Description.Get
 Returns a textual description of the object.
 
 DropEligible.Get
 Returns the status of the Drop Eligible Indicator. More...
 
 DropEligible.Set bool
 Enable/Disable the Drop Eligible Indicator. More...
 
 ID.Get
 Get the VLANID. More...
 
 ID.Set id
 Configure the VLAN ID. More...
 
 Parent.Get
 Returns the parent object.
 
 Priority.Get
 Get the VLAN Priority. More...
 
 Priority.Set priority
 Set the VLAN Priority. More...
 
 Protocol.ID.Get
 Get the VLAN Protocol ID (TPID) More...
 
 Protocol.ID.Set
 Set the VLAN Protocol ID (TPID / EtherType) More...
 

Class overview

Configure the VLAN tag on a ByteBlower Port.

IEEE 802.1Q is the networking standard that supports Virtual LANs (VLANs) on an Ethernet network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in handling such frames

802.1Q does not actually encapsulate the original frame. Instead, for Ethernet frames, it adds a 32-bit field between the source MAC address and the EtherType/Length fields of the original frame

TPID
Tag Protocol Identifier - 16bits
TCI
Tag Control Information - 16bits
PCP
Priority Code Point - 3bits
DEI
Drop Eligible Indicator - 1bit
VID
VLAN Identifier - 12bits

Definition at line 5781 of file api.tcl.

Method documentation

Layer2_5.Vlan::DropEligible.Get

Returns the status of the Drop Eligible Indicator.

A 1-bit field. (formerly CFI) May be used separately or in conjunction with PCP to indicate frames eligible to be dropped in the presence of congestion.

Default value: Disabled
Returns
True if Drop Eligible Indicator is enabled, false if disabled.

Definition at line 5798 of file api.tcl.

Layer2_5.Vlan::DropEligible.Set   bool  

Enable/Disable the Drop Eligible Indicator.

A 1-bit field. (formerly CFI) May be used separately or in conjunction with PCP to indicate frames eligible to be dropped in the presence of congestion.

Parameters
bool
True or 1
will enable the automatic Layer3 checksum calculation.
False or 0
will disable the Drop Eligible Indicator.
Example
1 set Layer2_5VLAN [ $byteblowerPort Layer2_5.Vlan.Add ]

Returns:

<Layer2_5.Vlan object> 

Enable the Drop Eligible Indicator

1 $Layer2_5VLAN DropEligible.Set 1

Disbale the Drop Eligible Indicator

1 $Layer2_5VLAN DropEligible.Set 0

Definition at line 5812 of file api.tcl.

Layer2_5.Vlan::ID.Get

Get the VLANID.

A 12-bit field specifying the VLAN to which the frame belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other values may be used as VLAN identifiers, allowing up to 4,094 VLANs.

Default value: 0
Returns
Returns the configured VLAN ID installed on this ByteBlower port.
Example

Getting the vlanID of a ByteBlower port tagged with VLAN Id 107

1 $Layer2_5VLAN ID.Get

Returns:

107 

Definition at line 5828 of file api.tcl.

Layer2_5.Vlan::ID.Set   id  

Configure the VLAN ID.

A 12-bit field specifying the VLAN to which the frame belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other values may be used as VLAN identifiers, allowing up to 4,094 VLANs

Parameters
idYour VLAN ID
Example

Creating a VLAN tag on the your ByteBlower port

1 set Layer2_5VLAN [ $byteblowerPort Layer2_5.Vlan.Add ]

Returns:

<Layer2_5.Vlan object> 

Settings vlanID to 107

1 $Layer2_5VLAN ID.Set 107

Definition at line 5842 of file api.tcl.

Layer2_5.Vlan::Priority.Get

Get the VLAN Priority.

A 3-bit field which refers to the IEEE 802.1p priority. It indicates the frame priority level. Values are from 0 (best effort) to 7 (highest); 1 represents the lowest priority. These values can be used to prioritize different classes of traffic (voice, video, data, etc.).

Default value: 0
Returns
Returns the configured priority of the VLAN protocol

Definition at line 5859 of file api.tcl.

Layer2_5.Vlan::Priority.Set   priority  

Set the VLAN Priority.

A 3-bit field which refers to the IEEE 802.1p priority. It indicates the frame priority level. Values are from 0 (best effort) to 7 (highest); 1 represents the lowest priority. These values can be used to prioritize different classes of traffic (voice, video, data, etc.).

Parameters
priorityThe priority you want to configure: a number between 0 and 7.
Example
1 set Layer2_5VLAN [ $byteblowerPort Layer2_5.Vlan.Add ]

Returns:

<Layer2_5.Vlan object> 

Setting the vlan priority to 7 - highest priority

1 $Layer2_5VLAN Priority.Set 7

Definition at line 5873 of file api.tcl.

Layer2_5.Vlan::Protocol.ID.Get

Get the VLAN Protocol ID (TPID)

A 16-bit field specifying the VLAN Protocol ID used in the frames.

IEEE 802.1AD specifies the VLAN C-TAG (customer tag) and S-TAG (service-provider tag). The C-TAG (0x8100) is used on the innermost VLAN tag, while the S-TAG (0x88a8) is used on all other VLAN tags.

I.e. When a single VLAN is used on the ByteBlowerPort, the TPID will be 0x8100. When VLAN stacking is used, the innermost VLAN tag (closest to the Ethernet payload) will use the C-TAG (0x8100) while all other VLAN tags use the S-TAG (0x88a8).

Returns
Returns the used Protocol ID (TPID) for this VLAN tag.
Example

Getting the vlan TPID of a ByteBlower port tagged with a single VLAN (0x8100 == 33024)

1 $Layer2_5VLAN Protocol.ID.Get

Returns:

33024 

Getting the vlan TPID of a ByteBlower port tagged with a multiple VLANs (0x88a8 == 34984). Printing VLAN Protocol IDs from outermost to innermost VLAN tag:

1 foreach layer2_5VLAN [ $bbPort Layer2_5.Vlan.Get ] {
2  puts [ $Layer2_5VLAN Protocol.ID.Get ]
3  }

Returns:

34984 
  34984 
  ... 
  34984 
  33024 

Definition at line 5897 of file api.tcl.

Layer2_5.Vlan::Protocol.ID.Set

Set the VLAN Protocol ID (TPID / EtherType)

This sets the EtherType of the VLAN tag.

When creating a VLAN tag the EtherType will be 0x8100 (normal VLAN) for the innermost VLAN tag and 0x88a8 (IEEE 802.1AD / QinQ) for the additional (outer) tags. This method allows you to override the default value.

Example

Creating a VLAN tag on the your ByteBlower port

1 set vlan_tag [ $byteblowerPort Layer2_5.Vlan.Add ]

Returns:

<Layer2_5.Vlan object> 

Set the ether type to 0x8100 (normal VLAN)

1 $vlan_tag Protocol.ID.Set 0x8100

Set the ether type to 0x88a8 (QinQ outer VLAN)

1 $vlan_tag Protocol.ID.Set 0x88a8

Definition at line 5911 of file api.tcl.