cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
957
Views
3
Helpful
5
Replies

frames and packets

carl_townshend
Spotlight
Spotlight

Hi all, I believe that layer 2 we use frames and layer 3 we use packets, my question is when 2 pc's on the same lan talk to each other, are only frames involved as its all layer 2 ??

5 Replies 5

mohammedmahmoud
Level 11
Level 11

Hi Carl,

As i told you in a previous post:

Frame = Layer 2 header + packet + layer 2 trailer. When talking about layer 2 devices we always refer to frames.

Thus frames are transported between these 2 PCs, and the frame encapsulates the packets inside it, and the packets encapsulates the user datagram inside it.

I hope that i've been informative, please don't hesitate to ask further questions.

HTH,

Mohammed Mahmoud.

so if 2 pc's had to talk over a wan, they would talk in frames, the packets would be inside the frame ? im still a little confused! what are we classing as layer 2 devices, and would we have packets being transported on there own at layer 3 or are they always inside a frame ?

many thanks

Hi,

Ok lets try another prospective in explaination, layer 2 devices do their decision based on the frame header (layer 2 header), layer 3 devices do their decision based on the packet header (layer 3 header).

According to the OSI model, the datagram is segmented, and then the segment is encapsulated into packet, and then a packet is encapsulated into a frame, and then a frame is converted into bits and sent over transmission media.

When networking devices in the path receives the stream it takes the decision according to the layer it is operating at, a layer 2 switch checks the frame header in order to take its decision, while a router needs to further decapsulates the frame, in order to check the packet header.

I hope that i've been informative, please feel free if you have further questions.

HTH,

Mohammed Mahmoud.

I think you need to understand how computers send and receive data. Here is some helpful info.

Scenario 1

PC1 192.168.10.120

PC2 192.168.10.130

PC1 wants to send a file to PC2

Both PC1 and PC2 are connected to the same layer 2 switch. Both PCs are in same vlan.

1. PC1 determines that PC2 is on same network.

2. PC1 sends arp for Mac Address of PC2.

3. Switch builds MAC Address table and adds PC1's Mac Address.

4. PC2 responds to the Arp Address with its MAc Address.

5. Switch builds MAC Address table and adds PC2's Mac Address.

6. PC1 now builds the FRAME with the destination MAC that it received from the arp request.

7. PC1 sends a unicast frame to PC2

Scenario 2 - Layer 3 switch

PC1 192.168.10.120

PC2 192.168.20.35

1. PC1 determines that PC2 is on another network reachable via the "Default gateway"

2. PC1 checks local arp cache or send arp request for MAC address of deafult gateway.

3. Switch builds mac table with PC1 Mac Address

4. Gateway replies with its MAC Address

5. PC1 builds frame Destination mac with Gateway's MAC Address.

6. PC1 sends unicast frame to Gateway(Router)

7. Router checks IP Packet in frame and does routing table lookup.

8. Router determines that IP Packet is destined for locally attached network.

9. Router checks arp cache or does an arp request for Destination Host's Mac Address.

10. Router strips of the destination mac and replaces it with the mac address of the host, it also changes the source mac of the frame to its own mac address.

11. Router Forwards the frame to host.

So As it moves down the OSI model, starting at layer 7 (Application) to layer 1 (Physical), the frame encapsulates the Packet.

Layer 2 devices dont use layer 3 information to move the frame.

When layer 2 is not an option due to destination being on another network which the layer 2 device cant route, it sends to a layer 3 device and the layer 3 device moves the frame using the IP information (Packet) inside the frame.

Hi

So does the frame always contain a packet with the ip info in, and devices strip the information out when needed ?

cheers

Carl

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: