Friday, July 22, 2011

Inter VLAN Routing


Modern Switches allow you create Virtual LANs to divide the network into segments to limit the size of broadcast domain, to enforce better security, and separate specialized traffic from mainstream traffic. But Switches do not forward frames between different VLANs. Inter VLAN routing mechanism is needed to allow communication between VLANs.
Since the Switch is layer 2 device, it cannot forward frames between VLAN, to allow communication between VLANs you need a Layer 3 device as described on the following diagram. So to allow Inter VLAN routinga router is used to forward frames between VLANs.
Inter VLAN Routing
Inter VLAN Routing
You can see in this example that there are three VLAN each corresponds to different subnet. The router needs an interface in each subnet to forward traffic between the subnets to allow Inter VLAN routing communication. Each router interface connects to each of the Switch interfaces that correspond to each VLAN1, VLAN2, and VLAN3. Each of hosts in each VLAN if they need to communicate to other VLANs, they have to send their packets to the router, which then forward them to another interface into the other VLAN.
Inter VLAN routing communication using the above method where each subnet / VLAN needs an interface connected to each router interface is wasteful. Therefore you need a router with Fast Ethernet port that supports trunking and use a single physical connection from the router to the switch.
Inter VLAN Routing Using Layer 3 Switch
Layer 3 Switches have the capability of routing features. So you don’t need a router for Inter VLAN routing to allow communication between VLANs. The only difference between routing using a router and a Layer 3 switch lies in the internal processing. L3 switches used specialized hardware to make the forwarding process run very fast. The actual receipt, changing of headers, and forwarding of the packets uses the same high-speed internal processing of the L2 switch. The L3 switch also includes the software used to run other processes, such as Inter VLAN routing protocols.
Inter VLAN Routing Using Layer 4 Switching
Layer 4 Switching considers the information in the Layer 4 headers when forwarding the packet. The forwarding decisions in some cases are based upon information inside the Layer 4 headers, and the other cases based on layer 3 headers, but the switch does accounting based on the Layer 4 headers. Inter VLAN Routing decision in Layer 4 Switching include the function of TCP and UDP port numbers.
The application process of the sender and the receiver of a packet are identified by the port numbers. Decision to where to forward the packet based on the information in the TCP or UDP header, typically the port numbers. Alternately, L4 Switch can also simply keep track of the numbers of packets and bytes sent per TCP port number, while still performing Layer 3 forwarding.
Inter VLAN routing using Layer 4 Switching can be described as in the following example diagram below where L4 switch making its forwarding decisions based on the TCP port number.
L4 Switching
L4 Switching
The figure shows a server farm, with two servers that have replicated web content, meaning that either server can be used to serve any user. The third server processes all FTP traffic—so when a user of the web server clicks something to start an FTP download, the download comes from SVR-3.
Suggested readings:
Source: Cisco.Com