Web Science/Part1: Foundations of the web/Ethernet/Ethernet header/script
How to build an Ethernet frame?
Ethernet frame consists of:
- Preamble -
- Sequence of 31 pairs of 1s and 0s followed by two 1s
- Synchronize time interval
The first thing that the preamble does is that it puts a sequence of 1s and 0s in the network. This is made to find out how long one bit should be. So when you have 64 bits put into preamble and you always do 1,0,1,0 and so on, you do it with your own clock and time. The recipient interface might have another clock running with another time scope. But it can figure out how long one time interval of 1 bit is coming from the sender. So different computers will receive data and synchronize their clock even though one of these computers might find out that this data is not for him.
- Ethernet Type II Frame-
Media Access Control Address
You put 2 Media Access Control Addresses on the frame: one for yourself (Source MAC Address) and one for the destination (Destination MAC Address). The interesting thing about Media Access Control Address is that it exists only once. The first 3 bytes classify the vendor and the last 3 – is the serial number of the device. This way you can identify device on the network and say who the data is for and who send the data.
It’s 2byte field where you can do different things:
Put in a specific number. There is RFC on the Internet that tells you which type of protocol is this. For example:
- if hex value is bigger than 06 00 it means that you do IP over the Ethernet (which is probably the most frequent Ethernet type)
- if hex is less than 06 00 it means that this number represents the length of the frame.
The length of such Ethernet frame can be between 46 and 1500 bytes.
Data and Payload
Even if you want to transfer 1 bit you have to have a payload of at least 46 bytes + additional Ethernet header that has to have a certain length. So in order to solve all the problems that Ethernet has to have the certain length.
It’s a sum calculated by the entire data on the frame. If you receive the data and you calculate checksum algorithm the result will always be 1. And if some things get wrong the frame will be dropped. The CRC algorithm can not only detect errors but also correct them. But this will hardly ever happen because if you’ll think about the situation where the cell phone might corrupt the data then probably the entire frame will be corrupted.
There is an interesting thing about the corrupted data. If the device detects an error it can’t do anything about it because it obviously doesn’t know where the data comes from. It can’t send something back to the source requesting the data again because the source doesn’t know that there was some error.
These kinds of things will handled by other protocols that are in a higher layer of the Internet protocol stack.
Ethernet frame design was created to:
- Synchronize the clocks of different devices in the network
- Sender and receiver of the data can identify themselves and data frames can be send to specific networks interfaces on network
- Detect some errors
- Send data of flexible length
But this design can’t stand along and fight the problem 2 devices send data simultaneously --Jane Kruch (discuss • contribs) 19:14, 26 October 2013 (UTC)