views:

227

answers:

2

For a homework assignment, I was tasked with creating a "Ping Pong" layer that sits right above the Ethernet stack.

I was able to easily complete the task but when I tested my application over my wireless connection and tried communication with my desktop computer (ethernet) on the same network I found some odd behavior.

It seems like the packet is being padded with information I did not add. From wireless->ethernet I get something like the following (as a hex output of the data received, taking off the ethernet header, periods are unprintable characters).

3-468...lkin54g......$ 0Hl.........*../..2..

When my desktop responds to my laptop (ethernet->wireless) I get something like the following

3-468................ .....................

Is this expected behavior?

+2  A: 

Yes. Valid Ethernet frames have a minimum size of 64 bytes (including the Ethernet header and a 4-byte checksum at the end).

Matthew Slattery
This is so that frame collisions are detected by everyone on the link. With very short frames, because information doesn't travel instantaneously, a collision could alter data from one observer's point of view but not from the other's.
Tobu
A: 

When you send packets across the network, the data you are sending is wrapped up into successively larger data structures at each level of the OSI network layer model. When your operating system receives the packets of information, it unwraps the data as it goes up the layers. Reading more about the OSI model could be useful for better understanding.

Here is a picture that illustrates what is going on at each layer, from an ebook.

Andrew