Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual Local Area Networks A look at how the Intel 82573L nic supports IEEE standard 802.1q for ethernet VLANs.

Similar presentations


Presentation on theme: "Virtual Local Area Networks A look at how the Intel 82573L nic supports IEEE standard 802.1q for ethernet VLANs."— Presentation transcript:

1 Virtual Local Area Networks A look at how the Intel 82573L nic supports IEEE standard 802.1q for ethernet VLANs

2 What is a LAN? switched hub All the workstations and servers which are physically connected via switches and hubs would comprise the Local Area Network When a broadcast-packet gets transmitted by ANY station on the LAN, it gets received by ALL of the other stations on that LAN

3 Dividing the network traffic switched hub In order to physically segregate the network traffic -- and reduce the congestion caused by broadcast-packets going to all the stations -- the network manager needs to purchase a separate switched hub.

4 What is a ‘Virtual’ LAN? switched hub Different subsets of the stations belonging to the same physical LAN can remain logically interconnected, while at the same time being kept logically separate from stations which do not share membership in a designated subset – all without the need to buy another switch

5 IEEE 802.1q A standard way for implementing VLANs was promulgated by the IEEE in 1997, so nowadays most network controllers would provide optional built-in hardware support for VLAN controls based on this standard The mechanism involves ‘tagging’ packets with a small amount of extra information, then using that information to do ‘filtering’ of ‘tagged’ packets as they are received

6 Standard IEEE 802.3 Ethernet Frame format Ethernet-frame “tagging” preambleSFDDASAT/LdataCRC preambleSFDDASAT/LdataCRCTPIDTAG User priority CFI VLAN identifier delay TPID (Tag Protocol Identifier) = 0x8100 CFI (Canonical Format Indicator) = 0 (for ethernet) SFD (Start-of-Frame Deliniter) Extra information is inserted

7 User priority values (802.1p) User priorityTraffic Type 7 (highest)Network Management 6Voice (delay < 10ms) 5Video (delay < 100ms) 4Controlled Load 3Excellent Effort 2Undefined 1 (lowest)Background 0Best Effort

8 Elements for VLAN support Device Control register: bit 30 (VME) Receive Control register: bit 18 (VFE) VLAN Ether Type register: bits 15..0 (VET) VLAN Filter-Table Array: 0x5600 – 0x57FF Fields within the Tx Descriptors Fields within the Rx Descriptors

9 Device Control (0x0000) PHY RST VME R =0 TFCERFCE RST R =0 R =0 R =0 R =0 R =0 ADV D3 WUC R =0 D/UD status R =0 R =0 R =0 R =0 R =0 FRC DPLX FRC SPD R =0 SPEED R =0 SLUSLU R =0 R =0 R =1 0 FDFD 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 GIO M D R =0 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 FD = Full-DuplexSPEED (00=10Mbps, 01=100Mbps, 10=1000Mbps, 11=reserved) GIOMD = GIO Master DisableADVD3WUP = Advertise Cold Wake Up Capability SLU = Set Link UpD/UD = Dock/Undock statusRFCE = Rx Flow-Control Enable FRCSPD = Force SpeedRST = Device ResetTFCE = Tx Flow-Control Enable FRCDPLX = Force DuplexPHYRST = Phy ResetVME = VLAN Mode Enable 82573LWe must set bit 30 to enable our NIC’s “VLAN mode” operation

10 VLAN Ether Type (0x0038) 0 0 0 0 8 1 0 0 31 0 This lower 16-bits of this register specifies the value that our network controller will insert as the 2-byte Tag Protocol Identifier (TPID) field. (This standard value of 0x8100 will be recognized by other hardware as signifiying that an ethernet packet is “tagged” for VLAN delivery.)

11 Legacy Tx Descriptors BASE_ADDRESS LENGTHSPECIAL STATUS CMD CKSUM OFFSET CKSUM START The VLAN Tag goes here IDEIDE VLEVLE DEXTDEXT 0 RSRS ICIC IFCSIFCS EOPEOP 7 6 5 4 3 2 1 0 And the VLE-bit (VLAN Packet Enable) is set in the descriptor’s command-field

12 Receive Control (0x0100) R =0 00 FLXBUF SE CRC BSEX R =0 PMCF DPF R =0 CFI EN VFE BSIZE BAMBAM R =0 MODTYPRDMTS ILOSILOS SLUSLU LPEUPE 0 R =0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SBP ENEN 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 LBMMPE EN = Receive Enable DTYP = Descriptor TypeDPF = Discard Pause Frames SBP = Store Bad Packets MO = Multicast OffsetPMCF = Pass MAC Control Frames UPE = Unicast Promiscuous Enable BAM = Broadcast Accept ModeBSEX = Buffer Size Extension MPE = Multicast Promiscuous Enable BSIZE = Receive Buffer SizeSECRC = Strip Ethernet CRC LPE = Long Packet reception Enable VFE = VLAN Filter EnableFLXBUF = Flexible Buffer size LBM = Loopback ModeCFIEN = Canonical Form Indicator Enable RDMTS = Rx-Descriptor Minimum Threshold SizeCFI = Canonical Form Indicator bit-value We must set bit 18 to enable the receive-engine’s “VLAN Filtering” operation

13 Legacy Rx Descriptors BASE_ADDRESS LENGTHVLAN Tag STATUS CHECKSUM ERRORS PIFPIF IPCSIPCS TTPCSTTPCS UDPCSUDPCS VPVP IXSMIXSM EOPEOP DDDD 7 6 5 4 3 2 1 0 And the VLAN Tag will be placed here The VP-bit (VLAN Packet) will be set in the descriptor status byte if the received packet’s Type matched the VET register-value

14 VLAN Filter-Table Array (0x5600) The VLAN Filter-Table Array is a series of 128 consecutive 32-bit registers within the NIC’s i/o-memory address-space which is used to define a “packet-filtering” bitmap 00000100000000000…000000000000000000000000100000001000000 4095 0 ‘1’ means that a tagged packet will be accepted ‘0’ means that a tagged packet will be ‘dropped’ The VLAN-Identifier value selects a bit within this bitmap

15 The Filter-Table arithmetic The 12-bit VLAN Identifier in a packet’s receive-descriptor functions as a “table- lookup” index into this 4096-bit bitmap: register_offset = ( vlan_id / 32 ) * 4; bit_selection = ( vlan_id % 32 );

16 Our ‘tryvlan.c’ module Here’s a ‘drop in’ replacement for our prior ‘nic.c’ character-mode Linux device-driver It enables the controller’s VLAN mode for automatic ‘tagging’ and ‘filtering’ of all the packets being transmitted and/or received Most of the previous code is unmodified The relatively few lines that have changed or been added are marked by an askerick

17 In-class exercise #1 Adjust the values stored in the ‘special’ field of the Transmit Descriptors so that successive descriptors use two different 12-bit values alternately: 0x0234 0123401234 0x0567 0x0234 0x0567 0x0234...

18 Two ‘tryvlan.c’ versions Create two versions of our demo-module, using your two different ‘special’ values to setup the VFTA bitmaps, and install these distinct versions on four different ‘anchor’ machines, like this: anchor01anchor02anchor11anchor12 Version with 0x0234 as tagVersion with 0x0567 as tag The ‘red’ VLANThe ‘blue’ VLAN

19 In-class exercise #1 (continued) Use the Linux ‘echo’ and ‘cat’ commands to send a succession of broadcast-packets on the ‘red’ VLAN and on the ‘blue’ VLAN by writing to the ‘/dev/nic’ device-file with echo on the odd-numbed anchor-stations and simultaneously reading from ‘/dev/nic’ with cat on the even-numbered stations Which machines receive your broadcasts?

20 In-class exercise #2 What happens if you modify your code for the two ‘tryvlan.c’ revised versions so that in some of the Transmit Descriptors the command-byte’s VLE-bit (bit #6) is ‘clear’ rather than being ‘set’?

21 In-class exercise #3 What happens if you program the nic’s VET register with a value other than the standard VLAN Ether Type of 0x8100?


Download ppt "Virtual Local Area Networks A look at how the Intel 82573L nic supports IEEE standard 802.1q for ethernet VLANs."

Similar presentations


Ads by Google