|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials


Introduction to Ethernet Frames : Part - 2


In part-2 , we will see a simple testplan for 10G Ethernet Frames.
For Part-1 , Click

TEST PLAN FOR MAC FRAME


MAC FRAME FORMAT



PREAMBLE

Discussion:

The frame begins with the 64-bit preamble field which allows 10G Ethernet interfaces on the network to synchronize themselves with the incoming data stream before the arrival of important data fields.

[Need for Synchronization: In LAN implementation, most of the physical layer components are allowed to provide valid output only after some number of bit times prior to the valid input signals. So this condition necessities a Preamble which is to be sent before the start of the data .This allows the PLS circuitry to reach its steady state with the received frame’s timing. So Preamble is used for physical medium stabilization and synchronization followed by SFD.]

Preamble is not used by the MAC layer, so the minimum amount of preamble required for a device to function properly depends up on which physical layer is implemented and not up on the MAC layer.

The preamble bits are transmitted in order from left to right and it should be noted that PRE ends with a ‘0’.

Up on the reception of a Frame Physical signal Decapsulation procedure discards every bit of preamble until a valid SFD.

IEEE Standard does not define the minimum PRE size, PRE size is handled depending up on the PHY as it is the function of physical medium. So min PRE size is considered as 1byte .Even though Standard defines as PRE as 7bytes,Mac should tolerate large amounts of Preamble

[The PRE is maintained in the fast Ethernet and gigabit systems to provide compatibility with the original Ethernet frame. However, both systems use more complex mechanisms for encoding the signals that avoid any signal startup losses, so they don’t need preamble to protect the frame signals]


Valid PRE

1) A frame with PRE of 7octets in PRE field with the bit pattern shown below and should always end with a ‘0’.
10101010 xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx10101010

2) A frame with variable PRE octets like 1, 2, 3,4,5,6 by using pattern shown in 1st case

Invalid PRE

1) A frame with variable PRE octets
Generate a frame with PRE octets greater than required i.e. 8, 9,10,12

2) A frame with variable PRE pattern

3) Generate a frame with varying bit pattern’s using following cases and observe the results.

(1st byte)...(7th byte)
00000000.....00000000
11111111.....11111111
10101111.....10101111
01010101.....11000011
10101011.....10101011


4) A frame consisting only PRE [i.e. Sop PRE Eop]

5) Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).

References:

IEEE STD 802.3,2005 Edition, subclasses 3.2.1, 4.2.5, 4.2.9
O’REILY-Ethernet Definitive Guide. PDF





START FRAME DELIMITER [SFD]


Discussion:

SFD field is the sequence 10101011 which immediately follows the PRE pattern and indicates the start of the frame.

The last two bits indicates the receiving interface that the end of the preamble and SFD has been reached and that the bits that follow are actual fields of the frame

Any successive bits following the transmission of SFD are recognized as data bits and are passed on to the LLC sub layer


Valid SFD

1) A frame of one octet size SFD with bit pattern 10101011 and placed after PRE.

2) Any frame with invalid SFD pattern is considered as Bad frame and discarded

Invalid SFD

1) A Frame with variable SFD bit pattern
Generate a frame with variable bit pattern’s using following cases
10101010
10101111
11111111
00000000
01010111
11000011


2) A Frame consisting only PRE and Good SFD [i.e. Sop PRE SFD Eop]

3) Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).


References:

IEEE STD 802.3,2005 Edition, subclasses 3.2.2, 4.2.6.
O’REILY-Ethernet Definitive Guide. PDF





FRAME CHECK SEQUENCE (FCS)

Discussion:

FCS field contains a 4-byte cyclical redundancy check (CRC) value used for error checking. CRC is a polynomial that is calculated using the contents of the destination, source, type (or length), and data fields except PRE, SFD and FCS. As the frame is generated by the transmitting station, the CRC value is simultaneously being calculated.

The source station stores 32 bits of the CRC value (x31 term is the most bit of the first octet and the x0term is the right most of the last octet) that are the result of this calculation in the FCS field and transmits it as a part of the frame. The x31 coefficient of the CRC polynomial is sent as the first bit of the field and the x0 coefficient as the last bit.

When the frame is received by the destination station, it performs an identical check. If the calculated value does not match the value in this field, the destination station assumes an error has occurred during transmission and discards the frame.

Valid CRC

1) The 32bit CRC value in FCS field of received frame should match the 32bit CRC value computed on received frame.

2) Frames with incorrect CRC(mismatch) values should be discarded

Invalid CRC

1) A frame with incorrect CRC value
a) Generate a frame by keeping incorrect CRC values in FCS field and observe the results
b) Repeat (a) for JUMBO,PAUSE and VLAN frames and observe the results Mac should discard the frames in both the cases as CRC error

2) Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).


References:
IEEE STD 802.3,2005 Edition, subclasses 3.2.8, 4.2.4.1.2.
O’REILY-Ethernet Definitive Guide. PDF







LENGTH/TYPE FIELD

Discussion:

10GB Ethernet supports the following frame sizes

a) In case of untagged
Maximum untagged frame size is 1518 bytes(from DA to FCS)
Minimum frame size is 64bytes(from DA to FCS)

b) In case of tag
Maximum tagged frame size is 1522bytes (Untagged size + tag prefix size)

If the value in the Length/type field is less than or equal to 1500 then the Value indicates the number of bytes in the subsequent MAC Client Data field. (Length Interpretation)

If the value in the length/type field is greater than or equal to 1536 then the value Indicates the nature of the MAC client protocol (protocol type like jumbo, pause etc) All other values are undefined. (Type Interpretation)

The minimum length of the Data/Pad field is 46 bytes, if the length of the frame in the length/type field is less than 46 then all extra bytes are considered as padded/appended in this field to bring the frame length up to its minimum size

The maximum length of the Data/pad field is 1500bytes, if the length of the frame in the length /type field is greater than 1500 and less than 1536, frame is discarded.

10GE supports the VLAN Tagging which is inserted in to the Ethernet frame between the source MAC address and Length/Type field. The first 2-bytes of the VLAN tag consist of the "802.1Q Tag Type" and are always set to the value of 0x8100.

a) VLAN tagged frames takes 64bytes as minimum size and 1522 bytes as maximum size (max size may vary depending up on VLAN count).
b) The 0x8100 value is actually a reserved Length/Type field assignment that indicates the presence of the VLAN tag.

Note: As the Standard does not define the min tagged frame size, it is considered as 64bytes which is common to all types of frames. This min size constraint may vary depending up on the Company, (CISCO defined the minimum size of the Ethernet frame with 802.1Q tagging is 68 bytes)

JUMBO frames are introduced in order to Increase the maximum size of the MAC Client Data field, larger frames would provide more efficient use of the network Bandwidth while reducing the number of frames that have to be processed.

a) JUMBO frames has the capacity to carry bytes from 64bytes (min size) to 9000bytes (max size)
b) The 8870 value is actually a reserved Length/Type field assignment that indicates frame as JUMBO.

Flow control operation known as "PAUSE" frames are included in 10GBE as it supports the full duplex mode.

a) The 8808 value is actually a reserved Length/Type field assignment that indicates frame as PAUSE. Length/Type field is followed by 2 bytes of MAC control Opcode (00-01) and 2bytes of MAC control Parameter (timer=00-00toFF-FF) with a unique DA (01-80-c2-00-00-01) in MAC DA field
b) PAUSE frame considers 64bytes as Minimum size and 1518bytes as Maximum size for Normal frame and 1522bytes when tagged.
c) Transmitter Mac should not transmit the frames once it receives Pause frames from receiver until the time duration specified in the Pause timer
d) Transmitter Mac should reset/replace the current pause timer with newly arrived pause time when a Pause frame arrives from receiver before the current Pause time expires.

Valid Frames

1) A frame(untagged) size between 64 and 1518 bytes [Valid size Normal untagged frame]
Generate a frame with the following acceptable sizes and observe the results. Mac should accept these frames
64,65,67,100,512,1500,1516,1517,1518

2) A tagged frame size between 64 and 1522 bytes [Valid size Normal tagged frame]
Generate a frame with the following acceptable sizes and observe the results, Mac should accept these frames
64,65,67,100,512,1500,1516,1517,1518, 1520,1522

3) A frame less than min length (<46) with padded values [Length (<46) untagged padded Normal frame]
Generate a frame with the following lengths in length field along with proper
Padding and observe the results, Mac should accept the frames
1,2,3,4,5,6,7,40,42,44,45

4) A frame greater than min length (with out padding) but less than max length(1500bytes) [Length (>46) untagged Normal frame]
Generate a frame with the following lengths in length field and observe the results, Mac should accept the frames
47,50,100,512,1497,1498,1499,1500

5) A frame greater than or equal to1536 bytes i.e. Type interpretation Generate a frame with the following values in length/Type field and observe the results, Mac should interpret the frame as one of the following types

5.1) A frame with VLAN tag ( 8100/9100--VLAN tagged )
Generate a tagged frame by placing 8100/9100 in the first two bytes of tagged length/type field that indicates the presence of VLAN tag and replaces the normal "Length/Type" field repeat with 3. (a) & 4. (a) Valid frame cases. Mac should accept the frame as normal VLAN tagged frame [Length (<46) tagged padded Normal frame, Length (>46) tagged Normal frame]

5.2) JUMBO frame Type ( 8870 - JUMBO Type)

5.2.1 ) JUMBO frame of size >64 bytes with VLAN tag

Generate a Jumbo Tagged frame of size (>64) by placing8870 in regular Length/Type field and repeat with 2nd valid frame cases; Mac should accept the frame as JUMBO frame with VLAN tag. [JUMBO (size>64) tagged frame]

5.2.2) JUMBO frame of size (<=9k+22) with VLAN tag

Generate a Jumbo frame of size (< =9k+22); Mac should accept the frame as JUMBO frame with VLAN tag. [JUMBO (size<=9k+22) tagged frame]

5.2.3) JUMBO frame with out VLAN tag

a) Generate a frame of size (>64) by placing 8870 in the regular Length/type field and repeat with 1st valid frame case including 1519, 1520, 1522. Mac should accept the frame as JUMBO untagged frame. [JUMBO (size>64) untagged frame]

b) Generate a frame of size (<=9k+18) by placing 8870 in the regular Length/type field and repeat with 1st valid frame case; Mac should accept the frame as JUMBO untagged frame. [JUMBO (size<=9k+18) untagged frame]

5.3) PAUSE Frame Type (8808 - PAUSE Type)

5.3.1) PAUSE frame of size (>64) and (<1522) with VLAN tag

Generate a Tagged Pause frame by placing 8808 in the regular Length/type field and next 2bytes of opcode field with (00-01) and repeat with 2nd valid frame cases (64,65,67,100,512,1500,1516,1517,1518, 1520,1522) ; Mac should accept the frame as Pause frame with VLAN tag. [PAUSE (size>64) and (<1522) Tagged Frame]

5.3.2) PAUSE frame with out VLAN tag

Generate a untagged pause frame and repeat with 1st valid frame cases (64,65,67,100,512,1500,1516,1517,1518); Mac should accept the frame as Pause frame with out VLAN tag. [PAUSE (size>64) and (<1518) untagged Frame]

5.3.3) PAUSE frame with MAC control Parameters (zero & Non-zero Timer)

a) Generate a untagged Pause frame by placing (00-01) in opcode field and vary timer values from 00-00 to FF-FF(hex) [Untagged PAUSE with Zero & non-zero Timer]
b) Repeat (a) for tagged Pause frame [Tagged PAUSE with Zero & non-zero Timer]
c) Repeat (a),(b) with different pause times before the completion of current pause_timer [Multiple Pause frames with different timers]

Invalid Frames

1) A Frame which is less than min frame size (<64) with bad CRC(Runt frames) [Runt size (<64) common to Normal, JUMBO&VLAN tagged/untagged Runt frames]

a) Generate a frame (both tagged and untagged) with the following sizes which are less than min frame size (<64) and observe the results, MAC should discard these frames

(1) 1, 2,3,4,5,6,7,8,45,46,47
(2) 50, 61, 62, 63

b) Repeat (a) for PAUSE frame and observe the results, Mac should not accept the frame as VALID [PAUSE Runt frame]

2) Repeat (1) for SHORT frames [SHORT Frames]

3) A untagged Frame greater than max frame size (>1518) [Over size (>1518) untagged Normal frame]

3.1) Generate a frame with the following sizes which are greater than Max frame size
a) 1519, 1520, 1521, 1522
b) 1526, 1530, 1534,1535,1536,1537

3.2) Repeat (a) for untagged PAUSE frame [Over size (>1518) untagged PAUSE frame]

4) A tagged (VLAN) Frame greater than max frame size (>1522)

(a) Generate a frame using 3.A (b) Invalid frame cases [Over size (>1522) tagged Normal frame]
(b) Repeat (a) for tagged PAUSE frame [Over size (>1522) tagged PAUSE frame]

5) A frame less than min length (<46) without padding

a) Generate a frame with the following lengths in length field without padding and observe the results, Mac should discard the frames as
1,2,3,4,5,6,7,40,42,44,45 [Runt Length (<46) not padded Normal frame]
b) Repeat (a) with tagged frame [Runt Length (<46) not padded tagged Normal frame]

6) A frame greater than max length (>1500) and( <1536)
a) Generate a frame with the following lengths in length field and observe the results, Mac should discard the frames [Invalid Length (>1500&<1536) untagged Normal frame]
1501,1505,1518,1522,1526,1530,1535
b) Repeat (a) with tagged frame [Invalid Length (>1500&<1536) tagged Normal frame]

7) A frame with invalid value in Length/Type field( i.e. Type interpretation)
a) Generate a frame with the following values in length/Type field and observe the results, Mac should identify these frame types
1536,1537, 1540, 8000.8101,8110,8807,8809,8880 [Invalid Type (>1536) untagged Normal/Pause frame]
b) Repeat (a) with Tagged frame [Invalid Type (>1536) tagged Normal/Pause frame]

8) A JUMBO frame of size > (9k+18)
a) Generate a Jumbo frame of size (>9k+18); Mac should discard the frame as Invalid size JUMBO untagged frame [Over size JUMBO (size>9k+18) untagged frame]
b) Generate a Jumbo frame of size (>9k+22); Mac should discard the frame as Invalid size JUMBO tagged frame [Over size JUMBO (size>9k+22) tagged frame]

9) PAUSE frame with invalid value in opcode field
a) Generate an untagged Pause frame with invalid opcode (other than 00-01) values with following opcode values 00-10, 01-00, 00-02 to 00-07, 00-00, 00-FF,01-01 etc. [Invalid opcode PAUSE untagged frame]
b) Repeat (a) for Tagged PAUSE frame[Invalid opcode PAUSE tagged frame]

10) Multiple PAUSE frames
Generate a pause frame by varying Pause timer values such that Transmit MAC should not affect the Min IFG gap required between frames after the completion of PAUSE duration

[Example: suppose current pause timer is set to 8sec and if other frame arrives with pause time 0sec, then Mac should transmit the frames with out violating the min IFG]
Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).


References:
IEEE Std 802.3, 2002 Edition - subclasses 3.1.1, Figure 3-1 - MAC frame format,3.2.6, 3.5, Figure 3-3 Tagged MAC frame format, 4.4.2-allowable Implementations
IEEE STD 802.3-2005 - Subclasses 31.3 and 31B.3.3, 31B.3.7
IEEE STD 802.3-2005 - Subclasses 3.5, 31.4, 31.5.1, and 31.5.2
IEEE STD 802.3-2005 - Subclasses 4.2.9, and 4.2.4.2.2
O’REILY-Ethernet Definitive Guide. PDF





DESTINATION FIELD (DA)

Discussion:

The Destination MAC Address field identifies the station or stations that are to receive the frame. DA field follows the preamble and Each Ethernet interface is assigned a unique 48-bit address, called the interface's physical or hardware address.

The DA field contains the 48-bit Ethernet address that corresponds to the address of the interface in the station that is the destination of the frame.

The DA field may specify either an "Individual address" destined for a single station or "Multicast address" destined for a group of stations or the standard broadcast address

If the LSB(1st bit) is 0---indicates Individual address 1---indicates Multicast address (including Broadcast)
If the 2nd bit is 0---indicates globally administered 1---indicates locally administered (including Broadcast)

The IEEE 802.3 version of the frame adds significance to the second bit of the destination address, which is used to distinguish between locally and globally administered addresses.

1) A globally administered address is a physical address assigned to the interface by the manufacturer, which is indicated by setting the second bit to zero.

2) If the address of the Ethernet interface is administered locally for some reason, then the second bit is supposed to be set to a value of one. In the case of a broadcast address, the second bit is also a one.

Remaining 46bits are a uniquely assigned value that identifies a single station or group of stations or all stations on the network

[Locally administered addresses are very rarely used on Ethernet systems, since the vast majority of Ethernet interfaces are assigned their own unique 48-bit address. Locally administered addresses, However, have been commonly used on some Token Ring systems.]


Valid Frame

1) A Frame with 6bytes of DA [valid DA field Normal frame]
a) Generate a frame by placing 6 bytes of following valid address values
Unicast MAC address
Multicasting MAC address
Broadcasting MAC address

b) Repeat (a) for tagged normal frame

2) A Frame with PAUSE Multicast unique DA

a) Repeat 5.3.C (a), (b),(c) Valid paused Type frame cases by placing unique multicast address reserved for PAUSE transactions (01-80-C2-00-00-01) [Un tagged Pause with Unique (DA) reserved Multicast Address]

b) Repeat (a) for tagged PAUSE frame [Tagged Pause with Unique (DA) reserved Multicast Address]

Invalid Frame

1) A Frame with 6bytes of invalid DA [Invalid DA field Normal frame]
a) Generate a frame by placing following invalid address values(only when they are not valid MAC address)
All zeros (000000...)
All ones (1111111...)
SFD pattern(10101011)
Random value


b) Repeat (a) for tagged normal frame

2) A Frame with 6bytes of PAUSE Multicast DA [Invalid DA field Normal frame]

a) Generate a frame by placing Pause unique address (01-80-C2-00-00-01);
Mac should discard this frame (should not be a PAUSE frame type)

2) PAUSE frame with invalid DA (only when addresses are not valid )
a) Generate a Pause frame with DA other than pause unique Multicast address (01-80-C2-00-00-01) by placing following address values in DA field
[Invalid DA PAUSE tagged frame] All zeros(0000000000000)
All ones(11111111111111)
SFD or PRE pattern(10101011)
Random values

b) Repeat (a) for untagged PAUSE frame [Invalid DA PAUSE untagged frame]
Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).

References:

IEEE STD 802.3-2005 - Subclasses 3.2.3.1,3.2.4
O-REILY-Ethernet Definitive Guide. PDF





SOURCE ADDRESS (SA)

Discussion:

The Source MAC Address (6 bytes) identifies the station that originated the frame and it is always an individual address. The 1st bit (LSB) is reserved and always set to"0".

This is the physical address of the interface that sends the frame. The source address is not interpreted in any way by the Ethernet MAC protocol. Instead, it is provided for the use of high-level protocols. An Ethernet station uses its physical address as the source address in any frame it transmits.

[IEEE standard does not specifically state that an interface may have the ability to override the 48-bit physical address assigned by the manufacturer. However, all Ethernet interfaces in use these days appear to allow the physical address to be changed, which makes it possible for the network administrator or the high level network software to modify the Ethernet interface address]

Valid Frame

Generate a frame by placing valid 6bytes of source address ensuring first bit with "0"

Invalid Frame

1) A Frame with 6bytes of invalid SA(only when following are invalid addresses) [Invalid SA field Normal frame]
a) Generate a frame by placing following invalid address values
All zeros (000000...)
All ones (1111111...)
SFD or PRE pattern(10101011)
Random value

b) Repeat (a) for tagged normal frame

2) Repeat bad frames mentioned above with each frame followed and preceded by a Good Frame separated by required minimum Inter Frame Gap (96 bits).

3) A frame with invalid SA by making 0th bit as 1 ,Receiving MAC should discard packet



References:

IEEE STD 802.3-2005 - Subclasses 3.2.3,3.2.5
O-REILY-Ethernet Definitive Guide. PDF





DATA / PAD Field

Discussion:

Data Field contains the data transferred from the source station to the destination station or stations
The maximum size of this field is 1500 bytes
The minimum size of this field is 46bytes
The maximum size of the data field is determined by the maximum frame size and address size parameters of the particular implementation


PAD

If the size < 46 bytes, then use of the subsequent "Pad" field is necessary to bring the frame size up to the minimum length.
If necessary, extra data bytes are appended in this field to bring the frame length up to its minimum size.
The size of the pad, if any is determined by the size of the data field supplied by the MAC client and the minimum frame size and address size parameters.

Full data transparency is provided in the sense that any arbitrary sequence of octet values may appear in the data field up to a maximum number specified by the implementation of the standard that is used.

Length value indicated in Length/Type field is compared with the Data length in Data field
Length>Data length - Length error (loss of Data bits)
Length Length=Data length - no padding required

For a padded Frame of Length (<46) in Length/Type field then data length should be always greater than the value in length field.

Padding is always performed only using all zero values.

Valid Frame

1) A Frame with data length (>=46) and (<=1500)
Generate a frame with data range between min and max Data lengths by placing the following data in Data field
All zeros (000000...)
All ones (1111111...)
SFD or PRE pattern(10101011)
Random values

Invalid Frame

1) Generate a Tagged frame of length (<46) in Length/Type field but data field length shows value (<46) even after padding is performed by transmitter Mac. [Padded Tagged frame < min size]

2) A Frame with excess Padding [Frame with Excess Padding]
a) Generate a frame of length (<46) in Length/Type field but data field length shows value (>46-excess) even after padding is performed by transmitter Mac
b) Generate a frame of length (<46) in Length/Type but data field length shows value(>46-excess) and it has violated the maximam size
(Mac should discard the packet if excess padding violates the maximam size)

3) A Frame of length (>46) in Length/Type field but data field shows the length less than the length shown in Length field. [Frame with Length error(loss of Data bits)] {Suppose length field has 70 but data length is 60bytes then what about remaining 10bytes?}

4) A Frame with invalid padding
Generate a frame of length (<46 bytes) in Length field and pad with the following values
All ones (1111111...)
SFD or PRE pattern(10101011)
Random values

5) Repeat bad frames mentioned above with each frame followed and preceded by a
Good Frame separated by required minimum Inter Frame Gap (96 bits).

References:

IEEE STD 802.3-2005 - Subclasses 3.1.1,3.2.7 Mac Frame Format
O-REILY-Ethernet Definitive Guide. PDF




About the authors:

Bhavani shankar is VLSI engineer at Kacper Technologies Pvt. Ltd. Bhavani shankar is an master in VLSI-CAD from Manipal Centre for Information Science, Manipal.

Gopi Krishna He is the Author of testbench.in.




Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!


copyright © 2007 :: all rights reserved www.testbench.in::Disclaimer