Top Banner
ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2 Dan Ionescu
54

ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Nov 18, 2014

Download

Documents

scribdlrg
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

ELG 5369IP-Based Internetworking Technologies

Chap3

Networking Technology Layer 2

Dan Ionescu

Page 2: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Responsible for error-free transmission and for establishing logical connections between stations.

Achieved by:

• packaging raw bits from the physical layer into blocks of data called frames, and

•sending these frames with the necessary

• synchronization,

• error control and

• flow control.

Layer 2- The Data Link LayerLayer 2- The Data Link Layer

Page 3: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Functions:

• layer 2 or L_ 2 - is responsible for the transfer of data across one communications link.

• delimits the flow of bits from the physical layer. • provides for the identity of the bits.

• ensure that the data arrives safely at the receiving DTE (Data Term Equipment).

• provides for flow control to ensure that the DTE does not become overburdened with too much data at any one time.

• provides for the detection of transmission errors and• provides mechanisms to recover from lost, duplicated, or erroneous

data.

Layer 2- The Data Link LayerLayer 2- The Data Link Layer

Page 4: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Flow Control

Effect of propagation delay, speed, frame size

Error Detection

Error Control

HDLC - High-Level Data Link Control

Data Link Control

Page 5: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Flow Control = Sender does not flood the receiver, but maximizes throughput

Sender throttled until receiver grants permission

Methods:

Stop and wait

Sliding window

Flow Control

Page 6: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

CSMA/CD

• No slots• adapter doesn’t transmit if it senses that

some other adapter is transmitting, that is, carrier sense

• transmitting adapter aborts when it senses that another adapter is transmitting, that is, collision detection

• Before attempting a retransmission, adapter waits a random time, that is, random access

Page 7: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

CSMA/CD Algorithm

• 1. adaptor gets datagram from net-layer and creates frame• 2. adapter senses channel

– If idle, it starts to transmit frame.– If busy, waits until channel idle and then transmits

• 3. transmit frame– if adapter transmits entire frame without detecting another

transmission, the adapter is done with frame !– if adapter detects another transmission while transmitting, aborts

and sends jam signal• after aborting, adapter enters exponential backoff:• after the m-th collision, adapter chooses a K at random from• {0,1,2,…,2m-1}. Adapter waits K*512 bit times and returns to Step 2

Page 8: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Error Control

Error Control = Deliver frames without error, in the proper order to network layer

Error control Mechanisms:

Ack/Nak: Provide sender some feedback about other end

Time-out: for the case when entire packet or ack lost

Sequence numbers: to distinguish retransmissions from originals

ARQ (Automatic Repeat reQuest).

-A function that allows a modem to detect flawed data and request that it be retransmitted) :

-Stop and Wait,

-Selective Reject,

-Go-back n

Page 9: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

HDLC FamilySynchronous Data Link Control (SDLC): IBM

High-Level Data Link Control (HDLC): ISO

Link Access Procedure-Balanced (LAPB): X.25

Link Access Procedure for the D channel (LAPD): ISDN

Link Access Procedure for modems (LAPM): V.42

Link Access Procedure for half-duplex links (LAPX): Teletex

Point-to-Point Protocol (PPP): Internet

Logical Link Control (LLC): IEEE

Advanced Data Communications Control Procedures (ADCCP): ANSI

V.120 and Frame relay also use HDLC

Page 10: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Layer2

Protocols

Page 11: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

The MAC Address --- 48 bits in total—The IEEE assigns LAN addresses --- were known as block identifiers (Block IDs) for Ethernet addresses

Some history

The Xerox Ethernet Administration Office assigned these values, which were three octets (24 bits) in length. The organization that received this address was free to use the remaining 24 bits of the Ethernet address in any way it chose.

IEEE 802 project IEEE would assume the task of assigning these universal identifiers for all LANs, not just CSMA/CD (Carrier Sense Multiple Access/ Collision Detection) types of networks.

IEEE continues to honor the assignments made by the Ethernet administration office although it now calls the block ID an organization unique identifier (OUI).

Page 12: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Normal Ethernet Operation

A

B

D

Data

C

Address mismatchpacket discarded

Address mismatchpacket discarded

Address matchpacket processed

Send datato node D

Transmitted packet seenby all stations on the LAN

(broadcast medium)

Page 13: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Ethernet Frame• Types of Ethernet frames:

• The Ethernet Version 2 or Ethernet II frame, the so-called DIX frame (named after DEC, Intel and Xerox);

– most common today, used directly by the Internet

• Novell's non-standard variation of IEEE 802.3 ("raw 802.3 frame") without an IEEE 802.2 LLC header.

• IEEE 802.2 LLC frame

• IEEE 802.2 LLC/SNAP (Subnetwork Access Protocol) frame

• Frames types may optionally contain a IEEE 802.1Q tag to identify what VLAN it belongs to and its IEEE 802.1p priority (for QoS).

Page 14: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Ethernet Frame

I G

U L

. . . .

Byte 0

U L U

. . . .

Byte 1 Byte 5

Byte 0 Byte 1 Byte 5

7 bytes 1 byte 6 bytes 6 bytes 2 bytes 1 byte 1 byte 1 or 2 bytes < 1496 bytes 4 bytes

Source Address

Bit 0

Bit 0

Bit 7

Destination Address

Transmitted first

Bit 7

Transmitted first

*

PreambleData FCS

Optional IEEE 802.2 fields

PadStart ofFrame

Delimiter

Destinationaddress

Source address

Lengthfield

DestinationService AccessPoint

(DSAP)

SourceServiceAccessPoint

(SSAP)

Controlfields

FCS: Frame Check Sequence

I/G individual/Group if 1 MulticastU/L Universal/Local – usually 0 for a physical NIC i.e. globally unique

Page 15: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Ethernet Frame• Preamble:

– 7 bytes with pattern 10101010 followed by one byte with pattern– used to wakeup the receiver adaptor, synchronize the clock rates

with the sender • Destination or source addresses: MAC address

– if adapter receives frame with matching destination address, or with broadcast address (e.g. ARP packet), it passes data in frame to network-layer protocol

– otherwise, adapter discards frame• Type: indicates the higher layer protocol

– IP, Novell IPX, AppleTalk, ARP• Payload:

– 46 to 1500 bytes, the minimum length is to make sure the frame is long enough to detect a collision

• CRC:– CRC check is optional, if applied and the error is detected,

theframe will simply be dropped in most cases

Page 16: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

 Frame Part Minimum Size Frame

 Inter Frame Gap (9.6µs)  12 Bytes

MAC Preamble (+SFD) 8 Bytes

 MAC Destination Address  6 Bytes

 MAC Source Address  6 Bytes

 MAC Type (or Length)  2 Bytes

Payload (Network PDU)  46 Bytes

 Check Sequence (CRC)  4 Bytes

 Total Frame Physical Size  84 Bytes

Calculation of number of bit periods occupied by smallest size of Ethernet frame

 Frame Part Maximum Size Frame

 Inter Frame Gap (9.6µs)  12 Bytes

MAC Preamble (+SFD)   8 Bytes

 MAC Destination Address 6 Bytes

 MAC Source Address 6 Bytes

 MAC Type (or Length)   2 Bytes

Payload (Network PDU)   1500 Bytes

 Check Sequence (CRC)   4 Bytes

 Total Frame Physical Size   1538 Bytes

Calculation of number of bit periods occupied by largest size of Ethernet frame

Page 17: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• A LAN segment typically contains one IP network or sub-network. Thereis a difference between the two, but the term “subnet” is commonly used.–Two or more subnets residing on one LAN segment?

• This subnet is 10.1.1.0 with subnet mask 255.255.255.0, which implies…•Host addresses are 10.1.1.1 through 10.1.1.254.•Broadcast address is 10.1.1.255, which is the IP address used to transmit to all hosts on the subnet.All hosts are “aware” of their individual subnet and mask, and what that implies.A single hub or switch is a physical LAN segment (“Ethernet segment”)An IP endpoint (PC, server, IP phone, etc.) is a host and has an IP address.In this diagram the hub or switch itself is also a host, with an IP address.

LANs

Page 18: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Two or more hubs or switches connected together still constitute one physical LAN segment.• The only differences between this diagram and the previous are…

– Having two hubs or switches increases the port density.– The up-link between the two devices may be a bottleneck.

• Note: It is not required that a hub or switch have an IP address. However, the device is

very likely to have an IP address if it is remotely manageable (ie, configure,

troubleshoot, view statistics, upgrade firmware, etc). Otherwise, the device must be

managed via a console port or not at all.

Page 19: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Here is a second LAN segment, which contains a different IP subnet.• All hosts on the second subnet have addresses pertaining to that subnet.• Hosts on one subnet cannot communicate with hosts on the other subnet.

– The obvious reason is that the two LAN segments are physically separated.

– However…

Page 20: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

ARP – Address Resolution Protocol

Page 21: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

IP addresses and MAC addresses IP addresses and MAC addresses

• An IP address is a 32-bit Network Layer (L3) address on the OSI model. It is configured on each IP host.

• A MAC address is a 48-bit Data Link Layer (L2) address on the OSI model. It is typically “burned in” to the network interface card or equivalent, and is a combination of the manufacturer ID and the board ID (serial number).

• An IP packet, with source and destination IP addresses, is encapsulated in an Ethernet frame, with source and destination MAC addresses. The Ethernet frame is then transmitted on the LAN segment.

• On a LAN segment, hosts communicate with one another using MAC addresses, even though applications use IP addresses.

– Therefore, each IP host must resolve the destination IP address to the destination MAC address before sending an IP packet.

– This is done using the Address Resolution Protocol (ARP).

Page 22: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

How ARP works

• Host X needs to send an IP packet to host Y but only knows Y’s IP address.

• X sends a broadcast ARP Request message containing Y’s IP address.

(Remember that hosts communicate with each other using MAC addresses).

– This broadcast is a MAC broadcast, which means that the destination MAC address is a L2 broadcast address (all 48 address bits are ones).

– The source MAC address of this ARP Request message is X’s MAC address.

Page 23: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

How ARP works -Ctnd

• All hosts on the LAN segment see the ARP Request broadcast, but only

Y recognizes the request as pertaining to its IP address.

– The ARP Request message also contains X’s MAC and IP addresses.

– Y makes an entry in its ARP cache with this information.

- Y sends a unicast ARP Reply message directly to X.

– The ARP Reply message contains Y’s MAC and IP addresses.

– X makes an entry in its ARP cache with this information.

• This ARP process occurs every time a host is contacted whose MAC address is not in the originating host’s ARP cache.

• Entries in ARP caches are designed to time out, typically after a few minutes.

Page 24: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Take the previous diagram and connect the two segments together to make one physical LAN segment (not recommended).

• Hosts on one subnet still could not communicate with hosts on the other subnet because…

– Hosts are “aware” of their subnet and will only ARP for addresses in their subnet. For example, 10.1.1.11 will not ARP for 10.1.2.11.

– To get to hosts on another subnet, an IP gateway is required.

• But broadcasts (including ARPs) would be seen by all hosts because…

– The broadcast is at the MAC layer (L2) and is seen by all hosts on the same

physical LAN segment.

Page 25: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• But wait! Each IP subnet has a broadcast IP address, so why doesn’t that limit the broadcast to just one subnet?

• Yes, the broadcast address for subnet 10.1.1.0 with mask 255.255.255.0 is 10.1.1.255. And the broadcast address for subnet 10.1.2.0 with mask 255.255.255.0 is 10.1.2.255.

• But hosts can’t communicate using IP addresses, so these IP broadcasts are converted to MAC broadcasts.

• The sequence is as follows…

– Host 10.1.1.11 sends a broadcast packet to 10.1.1.255.

– The IP packet with destination broadcast IP address 10.1.1.255 is encapsulated in an Ethernet frame with destination broadcast MAC address FFFFFFFFFFFF (hex for 48 binary ones).

– Every host on the LAN segment sees the MAC broadcast.

– Only hosts on subnet 10.1.1.0 dig deeper into the IP packet.

– Hosts on subnet 10.1.2.0 must examine the MAC broadcast, but ignore the IP broadcast because it pertains to a different subnet.

Page 26: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Now it should be clearer why a LAN segment typically has only one associated IP subnet.

• Why broadcast messages to hosts that don’t need to see them?

• In most cases it is preferable to maintain a 1-to-1 mapping of a L2 broadcast domain (physical LAN segment) to a L3 broadcast domain (logical IP subnet).

• Note: Having two different routers with different subnets on one LAN segment can also cause serious problems with routing in rare configurations.

Page 27: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Enter the router - the IP gateway. This is a L3 (network layer) device.

• Now when host 10.1.1.11 wants to send an IP packet to host 10.1.2.11, host 1.11 forwards the packet to the gateway (1.254 in this diagram).

• This router forwards the packet directly to the 2.11 host because the 10.1.2.0 subnet is directly connected. Otherwise, the packet would be forwarded to the next hop router en route to that subnet.

• The router, which is a L3 boundary, is a broadcast barrier.

– Broadcasts on one subnet are not transmitted across the router to the other subnet, unless specifically configured to do so.

Page 28: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• What if the two LAN segments were to be connected together? (again, not recommended, and might produce an error condition on the router)

– Hosts on one subnet would still require the router to communicate with hosts on the other subnet.

– But the broadcasts would “leak” from one subnet to the other, because this is now one LAN segment.

– There is one L2 broadcast domain (LAN segment) with two L3 broadcast domains (IP subnet) :-(

Page 29: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Transition to VLANs

Page 30: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Every port belongs to at least one VLAN, which is the port/native VLAN.

– The 802.1Q standard and most switches call this the port VLAN, with an associated port VLAN ID (PVID).

– Although VLAN1 is the default port/native VLAN, this can be changed on a per port basis by configuration.

• What was once a physical LAN segment is now a logical VLAN.

• A “smart” L2 switch is required to implement VLANs, which are specified in the IEEE 802.1Q standard.

– Hubs no longer apply, because they are simply dumb repeaters that operate at L1.

– Simple switches with no 802.1Q intelligence also do not apply.

• A filtering database resident on the switch keeps track of which ports belong on which VLAN.

Page 31: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• To add a second VLAN, a second switch is not required.

– Simply create another VLAN on the same switch and assign the desired ports to that VLAN (change the port/native VLAN on the desired ports).

– The switch’s filtering database maintains the port-to-VLAN mapping.

– This diagram is analogous to having two separate switches or LAN segments.

• By default a host pertains to the port/native VLAN of the connected port, and must be configured with the proper IP address for that VLAN.

– In this diagram hosts on VLAN1 are on one IP subnet, and hosts on VLAN2 are on a different IP subnet, which is the correct implementation.

– In this diagram the switch itself is configured to be a host on VLAN1.

Page 32: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• What was before two separate LAN segments is now two VLANs, and all the same conditions apply.

– Hosts on VLAN1 cannot communicate with hosts on VLAN2 without an IP gateway. This would be true even if the two VLANs were physically connected together with a cross-over cable.

– Broadcasts on VLAN1 do not “leak” onto VLAN2, but they would if the two VLANs were connected together with a cross-over cable.

• If the two VLANs were connected together with a cross-over cable,

– In effect, this results in one VLAN (one L2 broadcast domain) with two subnets (two L3 broadcast domains), which is not desired.

– No different than connecting two physical LAN segments together.

Page 33: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• So how can the two subnets talk to each other?

• Again, an IP gateway is required. And as before with two LAN segments, an external router could be used to provide the gateway function.

• However, this is not how it is typically accomplished.

Page 34: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Today it is more common to see switches with both L2 and L3 functions (Cisco Catalyst, Foundry, and many others).

• The switching function (L2) continues to maintain a filtering database to keep track of VLANs and ports, just as before.

• The routing function (L3) resident on the switch fills the gateway role previously filled by an external router, and performs many of the other functions previously performed by an external router.

– Instead of physical router interfaces, there are now virtual router interfaces.

– Instead of physical connections between the router and switch(es), there are now logical connections.

Page 35: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• One major difference is the mapping between L2 and L3 domains.

• Remember before that it was possible for one LAN segment to have two connections from an external router to service two IP subnets, which was not recommended.

• In this case, we could not create another virtual router interface (L3) for VLAN1 or VLAN2 (L2), nor would we want to.

– Each L2 entity (VLAN) can have only one L3 (virtual router) interface with only one IP subnet.

– This maintains the 1-to-1 mapping between L2 and L3 broadcast domains.

– The only way to add a second IP subnet to a VLAN (not recommended) would be to use an external router.

Page 36: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

802.1q tagging/trunking

Page 37: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• This creates two VLANs that traverse multiple switches.

• Note: This scenario requires multiple instances of the Spanning Tree Protocol - one instance per VLAN on each switch. Otherwise, a single Spanning Tree process running on each switch would cause them to block one of these links to prevent a Spanning Tree loop. Most advanced switches implement per-VLAN Spanning Tree in a proprietary implementation, as it is not yet standard.

How to interconnect two or more of L2 switches together?

Physically connecting the VLANs together is one way, but it is not the recommended way.

Page 38: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• A simple wiring error through the closets could end up in this.

– This is a technically valid configuration.

– VLANs are local to the Ethernet switch and do not have to match across switches.

– But probably no one would intentionally do something like this.

How to interconnect two or more of L2 switches together?• But we don’t want to have to do this

• This creates five VLANs that traverse multiple switches.

BUT...

Page 39: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Trunk the VLANs.

– On each switch configure a trunk port (can be any Ethernet port) that is logically connected to multiple VLANs.

– Then connect the trunk ports together.

• The numbering is kept consistent through the use of 802.1Q tags.

How to connect two or more smart L2 switches together and maintain VLAN numbering consistency?

Page 40: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Terminology

• access port / link - 802.1Q terms to define a port with one or more untagged VLANs, and a link connecting two such ports.

• trunk port / link - 802.1Q term to define a port with multiple VLANs that are all tagged, and a link connecting two such ports.

• hybrid port / link - 802.1Q term to define a port with both untagged and tagged VLANs, and a link connecting two such ports.

• VID - 802.1Q acronym for VLAN ID

• PVID - 802.1Q acronym for port VLAN ID

• tagged frame - An Ethernet or 802.3 frame with the 802.1Q tag.

• clear frame - An Ethernet or 802.3 frame with no tag.

• VLAN trunking - a generic networking vernacular term to describe the process of forwarding multiple VLANs across a single link, whether via 802.1Q or proprietary protocols like Cisco’s ISL (Inter Switch Link).

Page 41: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

DSAP – Destination Service Access PointSSAP – Source Service Access PointCFI -Canonical Format Indicator –compatibility Between Ethernet and Token Ring

Page 42: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

802.1Q tag continued

• The preceding diagram shows the IEEE 802.1Q tag and its insertion point within the Ethernet and 802.3 frames. (The term “Ethernet” is sometimes used to describe both types of frames, although the two are different.)

• The 802.1Q tag contains the Tag Protocol Identifier (TPID) field with hex value x8100. This value indicates to a L2 device that the frame has an 802.1Q tag.

• The 802.1Q tag also contains 3 priority bits and 12 VLAN ID bits.

– The priority bits are the reason why 802.1Q is often referred to as 802.1p/Q.

– The VID bits make trunking possible.

• Ethernet switches and endpoints must be capable of interpreting the 802.1Q tag to make use of the tag.

• If an Ethernet switch or an endpoint cannot interpret the 802.1Q tag, the presence of the tag may cause problems.

Page 43: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

How VLAN trunking works w/ 802.1Q

• When one switch sends an Ethernet frame to the other, the transmitting switch inserts the 802.1Q tag with the appropriate VID (with the exception of the PVID/native VID in some cases).

• The receiving switch reads the VID and forwards the Ethernet frame to the appropriate VLAN.

Page 44: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

VLAN trunking is not the same as VLAN configuration.

• The VLANs must be configured independently on each switch, using any of the following methods.

… manually via the CLI or web interface.

… with a VLAN management tool provided by the vendor.

… automatically with a standard protocol like GVRP (GARP - VLAN Generic Attribute Registration Protocol), which works in conjunction with 802.1Q.

… automatically with a proprietary protocol like Cisco’s VTP (Virtual Trunking Protocol), which works in conjunction with Cisco’s proprietary ISL (Inter- Switch Link) trunking protocol.

• 802.1Q trunking simply matches VIDs across switches. It does not help if the VIDs cannot be matched…

Page 45: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

Default tagging behavior on most Catalyst switches

• Every port, including hybrid/trunk ports, has a native VLAN.

• By default, enabling 802.1Q trunking on most Catalyst switches results in a hybrid configuration.

– The transmitting switch does not tag frames originating from the native VLAN of the egress port, but tags all other VLANs.

– The receiving switch forwards all clear frames to the native VLAN of the ingress port, and all tagged frames to the appropriate VLAN.

• Because the native VLAN is not tagged, the native VIDs do not have to match. Both of the following scenarios are technically valid, but probably no one would intentionally implement the second scenario.

Page 46: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

VLAN ID zero (0) • VID 0 is the null VID.

– It is used when the 802.1Q tag contains only priority information.

– The VID field cannot be removed from the tag, so zero is used to indicate that there is no VID.

– Because there is no VID, it is treated like a clear frame and associated with the port/native VLAN of the ingress port.

– 802.1Q trunking may or may not be enabled when using the null VID, provided the receiving switch is capable of interpreting the tag.

• The null VID should be used to associate priority-tagged frames to the port/native VLAN of the ingress port.

– The point of the null VID is that the frame belongs on the port/native VLAN, regardless of what it may be.

– It should not be necessary to tag a frame with the PVID/native VID; the switch should associate VID zero with the port/native VLAN.

• This becomes critical for PCs with NICs that are capable of tagging the priority value but not the VID, and thus leave the field as zero.

– Although zero should be used, tagging with the PVID/native VID instead of zero typically does not hinder operation. Some Cisco switches actually require this because they don’t understand VID zero.

• Note: There is no null priority. Priority zero is a priority with value zero.

Page 47: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

To tag or not to tag

• To tag…

– Tag with the proper VID and desired priority when transmitting to a hybrid port and the frame belongs on a VLAN other than the port/native VLAN.

– Tag with VID 0 and the desired priority when transmitting to a hybrid port and the frame belongs on the port/native VLAN.

– Tag with VID 0 and the desired priority when transmitting to an access port.

• The switch should accept this and forward the frame to the port/native VLAN.

• This would only be done if the priority value is significant (non-zero). Otherwise, there should be no tag at all.

– On hybrid ports, a Catalyst switch tags the non-native-VLAN egress traffic with the proper VID and priority.

Page 48: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

To tag or not to tag

• Not to tag…

– Do not tag when transmitting to a hybrid port and the frame belongs on the port/native VLAN and has no special priority requirement.

– Do not tag when transmitting to an access port and the frame has no special priority requirement.

– By default, Catalyst switches do not tag native-VLAN egress traffic at all, even if the frame has a non-zero priority. Other switches do not tag port-VLAN egress traffic unless 802.1Q trunking is enabled.

• This is to accommodate devices that do not understand the tag, and would thus misinterpret or discard the tagged frame.

• To forward priority information from the port/native VLAN to another switch, the link must be a trunk link, meaning that the port/native VLAN must also be tagged.

• Pure speculation: The 802.1Q tag came after the Ethernet frame to facilitate VLAN trunking and L2 priority tagging. The tag is not integrated into the Ethernet frame but is added to it when necessary. As VLAN trunking and priority tagging become commonplace with the proliferation of 802.1Q-capable NICs and network devices, perhaps the 802.1Q tag may become integrated into the Ethernet frame.

Page 49: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Here are two variations of a common scenario.

• Routing between VLANs is performed by the L2/L3 switch.

– This is the distribution switch.

• Users connect to L2 switches.

– These are access switches that may or may not be VLAN-capable.

Page 50: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Here is another variation of the same scenario.

• Routing between VLANs is still performed by the L2/L3 distribution switch.

• But now the access switches have multiple VLANs, and the uplinks to the distribution switch are hybrid or trunk links.

• VLAN1 is the management VLAN in this setup.

– The access switches are hosts on VLAN1.

– Management stations, such as an SNMP server, are connected to VLAN1.

• VLANs 2-5 are user VLANs for devices such as user PCs.

Page 51: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Here is an IP telephony twist added.

• The even-numbered user VLANs are “data” VLANs.

• The odd-numbered user VLANs are “voice” VLANs.

• PCs are connected into the even VLANs and IP phones are connected into the odd VLANs.

• But some of the PCs must “piggyback” on the phones to share a common port.• So we make the shared ports hybrid or multi-VLAN ports, make the even VLAN the port/native VLAN, and tag the phone traffic with the odd VID.

– The clear PC traffic is forwarded to the port/native VLAN, and the tagged phone traffic is forwarded to the appropriate VLAN.

.

Page 52: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Here is a different scenario.

• Now the access switches are also L2/L3 switches.

• Each access switch routes its own user VLANs (101-104).

• The distribution switch routes between access switches and other external networks.

• VLANs 1-5 are uplink VLANs; there are no users on these VLANs.

– Each uplink VLAN connects a group of access switches to the distribution switch.

• VLANs 101-104 are user VLANs.

– These VLANs are local to their respective access switches.

– Broadcasts from these VLANs are not transmitted across the uplinks.

• In the previous scenario the user VLANs traverse the access and distribution switches, which results in broadcasts across the uplinks.

Page 53: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• At first the Ethernet LAN was a shared coax bus (thick-net, thin-net).

• The hub replaced the coax bus, but there were still collisions on the hub.

• The switch replaced the hub and removed the collisions, but the switch itself was one L2 broadcast domain.

• Then smart L2 switches came along that could create multiple VLANs (multiple L2 broadcast domains) on a single switch. IEEE 802.1Q is the standard that brought this about.

– The 802.1Q tag facilitates VLAN trunking between these switches.

– At some point L3 (routing) functionality was added to these switches to remove the need for an external router in many cases.

Conclusion

Page 54: ELG 5369 IP-Based Internetworking Technologies Chap3 Networking Technology Layer 2

• Real-time applications, such as IP telephony, have increased the practice of using the 802.1Q tag for priority tagging as well as VLAN trunking.

• NICs with priority-tagging capability are used

• PCs are able to assign different priority values to different applications and tag them accordingly.

• Endpoints can have the capability to tag different applications to different VLANs and source them from different IP addresses