1

So I'm trying to describe how data is transmitted over a layer 3 switch (within same Vlan and between Vlan) but I'm not sure if I have understood it correctly. Can anybody verify if this description is correct?

A marketing department has computers M1, M2, M3, and the service department has computers S1, S2, S3. If computer M1 wants to communicate with computer M3, the frames from M1 will be sent to the layer 3 switch, within the layer 3 switch it will handle the forwarding as a layer 2 switch, so it will forward the frames to M3 based on M3’s MAC address since they are both on the same Vlan. If computer M1 wants to communicate with computer S2, it will need S2’s IP address, then a packet will be sent over the network, the layer3 switch will handle the forwarding as a layer 3 router and forwards the packet to the S2 computer.

0

A layer-3 switch is the combination of a layer-2 switch and a (hardware) router. Generally, everything works exactly like with an L2 switch and a separate, connected router except that the L3 switch uses virtual interfaces (SVI) and a router uses physical interfaces (with subinterfaces in case of VLAN trunking).

In any case, the hosts are sending IP packets to each other. Each IP packet is always encapsulated in an L2 frame - that is always the same, just the frame addressing differs.

If M1 wants to communicate with M3, it can encapsulate the IP packet with a frame directly addressed to M3 - they share a subnet, so M1 can ARP M3's MAC address and send away. The switch forwards by MAC address within their VLAN, just like an L2 switch.

When M1 wants to send to S2 on another IP subnet and VLAN, it needs to use a gateway - the L3 switch. It encapsulates the IP packet with a frame addressed to the gateway's MAC address (the switch's SVI), ARPed from the gateway IP.

The L3 switch forwards the packet by IP address (just like a router), ARPs S2's MAC address (as they share a subnet) and addresses the new encapsulating frame to that.

2
  • So packets get packed into frames, not the other way around? I thought a frame is encapsulated with additional information to create an IP packet. Oct 14 '21 at 11:23
  • Data is encapsulated in descending layer order: L7 (application, e.g. HTTP request) -> L4 (transport, e.g. TCP segment) -> L3 (network, e.g. IPv4 packet) -> L2 (data link, e.g. Ethernet frame). L1 then actually encodes and transmits the bits.
    – Zac67
    Oct 14 '21 at 12:58
0

Frame and packet can be used interchangeably. But, frame would be talking about layer-2 traffic, while packet would be layer-3. In both cases, both are being used. In the first case, it's all done at layer-2 within the same subnet and vlan - so packets move as frames directly at layer-2 between hosts, aka switching. In the second, packets move as frames to the gateway to be routed out of the subnet/vlan to a different network.

I would say "traffic is switched" or "traffic is routed".

(Note: Not to confuse things, but subnets can overlap, so "M" and "S" could be in the same VLAN. Without additional configuration, routing would still happen between the two layer-3 subnets.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.