summaryrefslogtreecommitdiffstats
path: root/networking/ethernet.page
blob: d455f212935bf79b7c95294ecc0abd3031a2b60d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
format: rst
categories: cs
toc: no
...

========
Ethernet
========
:Author: Bryan Newbold <bnewbold@mit.edu>

.. contents::

History
=======
Bob Metcalfe first described the ethernet system in a memo while working at the
Xerox Palo Alto Research Center in 1973 ([oreilly]_). It was based on the
earlier *Aloha* system developed by Norman Abramson at the University of
Hawaii. *Aloha* was a radio network for inter-island communications.

Structure
=========

Data Frames
~~~~~~~~~~~
The frame format is the same for ethernet systems of any speed.

====================       ===========
Section                    Size (bits)
====================       ===========
Preamble                   64
Destination Address        48
Source Address             48
Type Length                16
Data                       46 to 1500
Checksum                   32
====================       ===========

.. topic:: Preamble

    The preamble originally served as a "warm up" period for hardware to 
    stabilize and prepare for the rest of the frame.

    The last 8 bits are the preamble are a particular "start frame delimiter"
    pattern to help hardware notice the beginning of signal transmission.

.. topic:: Source and Destination addresses

    Manufacturers are given a 24 bit id (first half), and are expected to
    ensure the uniqueness of the second half of each device's address.

    If the first bit of the destination is high (1), the destination is
    multicast; if low (0), then unicast. Under IEEE, if the second bit is high,
    global administration rules should be followed, and if low, local
    administration rules should be followed.

    The IEEE-SA (Standards Association) delegates addresses.

.. topic:: Checksum

    The checksum (or Frame Check Sequence) is a Cyclic Redundancy Checksum.

Inter-Frame Gap
~~~~~~~~~~~~~~~~~
The Inter-Frame Gap (IFG) is a pause in between signal frames; it is 96
bit-times long.

.. _collision:

Collisions
=============
Collision management is the heart of Ethernet; a collision occurs when two
devices try to transmit at the same time and their signals overlap and the
transmission is unreadable. This problem is made worse the further apart
stations are because it takes longer for signal fronts to propagate, so there
is a longer overlap period when the first device has started transmitting but
the second hasn't noticed and may start transmitting on its own. The network
size (in distance, not nodes) is determined by the maximum collision period
(also called slot time). This period is 512 bit-times, so usually the faster a
network is, the smaller it should be (in distance); at gigabit speeds the
slot is expanded, see Speeds_.

Under Ethernet, if any device detects a collision, it sends out a 32 bit
"collision enforcement jam signal" to ensure that all devices notice the
collision. Then each device that wishes to transmit waits a random amount of
bit-times r before transmitting again. If there is another collision, a new
r is randomly chosen with a larger maximum; up to 15 retries are allowed before
the devices will give up and drop the frame. The constraints for the random
backoff time r are `$0\leq r \leq 2^k$`:latex:, where r is in bit times and
k is the number of retry attempts up to 10 (for 11th to 15th  retries, use 
k=10).

Speeds
=========
At 10mb, bit time is 100ns (nano-seconds); at 100mb, 10ns; at 1gb, 1ns.

At gigabit speeds, the slot time would limit network size to 20 meters, so
it gets padded with a null "carrier extension" signal to 4096 bits (512 bytes). 
On high speed half-duplex gigabit links (which are rare!), frame bursting is
a technique to allow several small data frames to be transmitted at the same
time: one frame is sent regularly to capture the channel, then up to 65536
bit times of short non-carrier extended (only IFG) frames are sent, then 
a single last regular frame is sent.

Phrases
=========

Auto-negotiation
    Optional protocol for direct links (eg, from switch to switch) to 
    determine network speed. Can be reinitiated by dropping and restarting
    the link.

802.1
    IEEE working group for higher level networking.

802.2
    IEEE working group for "logical link control" (LLC), which is related
    to the type/length frame field.

802.3
    For _`CSMA/CD` LANs

802.5
    For Token Ring LANs

CSMA/CD Protocol
    Stands for Carrier Sense Multiple Access/Collision Detect. The two main
    implementations are DIX (DEC-Intel-Xerox) and IEEE. (Can't remember how
    this works...)

VLAN
    Optional 4-byte field in between "source" and "type" fields. The first
    two bytes are a valid type field; this increases the max length to
    1522 bits. Only used by switches.

Channel Capture
    This phenomena is a result of _collision management. After a few 
    sequential collisions, the device that ultimately transmits first gets
    its backoff reset to zero, while all other devices retain a high backoff;
    this means the first device is much much more likely to retransmit again
    faster than any of the others, and if it has a lot of frames to send it
    will dominate the carrier until it is done transmitting.

Jabber
    When a broken station/device keeps a carrier open and prevents other
    transmissions.

PAUSE
    A PAUSE frame is a MAC control (higher level, type 0x8808) frame which
    causes switches to stop for up to 65536 slot times to allow a switch or
    station to clear its buffers.

.. [oreilly] `Ethernet: The Definitive Guide`:title:, by Charles Spurgeon.
              O'Reilly, 2000