OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 17, 2024 7:28 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: What "packet" does NE2000 actually use?
PostPosted: Wed Sep 30, 2015 6:07 am 
Offline
Member
Member

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 587
Yes, I know that the NE2000 sends and receives ethernet packets. However, loooking at wikipedia ( https://en.wikipedia.org/wiki/Ethernet_frame ) it talks about a specific format of an ethernet frame, which start with a preamable etc. However, looking at Linux code, I could only find one structure relating to Ethernet packets: this structure contains only the source MAC address, destination MAC address, and the EtherType.

This is where my confusion arises. Should an NE2000 driver pass payload within this header structure that Linux defines, or should it create a full Ethernet frame as given on that wikipedia article? (And, I assume, the format of received packets is exactly the same as the format of sent packets?)


Top
 Profile  
 
 Post subject: Re: What "packet" does NE2000 actually use?
PostPosted: Wed Sep 30, 2015 7:30 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Just create the ethernet frame and its contents. The rest is handled by the NIC.


Top
 Profile  
 
 Post subject: Re: What "packet" does NE2000 actually use?
PostPosted: Wed Sep 30, 2015 8:16 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

mariuszp wrote:
Yes, I know that the NE2000 sends and receives ethernet packets. However, loooking at wikipedia ( https://en.wikipedia.org/wiki/Ethernet_frame ) it talks about a specific format of an ethernet frame, which start with a preamable etc.


This is what you'd see if you connected some sort of measuring device (e.g. an oscilloscope) to the wire/s in the network cable. The ethernet card's hardware is responsible for the preamble, start of frame delimiter and interpacket gap.

The network card driver would need to provide source and destination MAC addresses, optional tag, ethertype/length, payload and CRC. The driver can calculate the CRC itself, so normal software doesn't/wouldn't provide that; although some ethernet cards (not NE2000) have hardware to calculate the CRC for the driver.

Normal software would only need to provide source and destination MAC addresses, optional tag, ethertype/length and payload.


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 138 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group