IEEE 802.3 乙太網絡 (Ethernet)
Introduction
- Connectionless: No handshaking between sending and receiving NICs(網路介面卡, Network Information Center).----->(不需要建立連線)
- Unreliable: receiving NIC doesn’t send ACKs or NACKs(Negative ACKnowledgment, 否定回答) to sending NIC.----->(不可靠)
- Ethernet’s MAC protocol: Carrier Sense Multiple Access with Collision Detection
Ethernet Topologies
Bus topology
Bus topology popular through mid 90s: all nodes in same collision domain (can collide with each other).
兩端需要終端器,來終結訊號。
Ethernet(10Base5): 10Mps and no longer than 500m.
- A transceiver(收發器, a small device directly attached to the tap) detects when the line is idle and drives signal when the host is transmitting.
- The transceiver is connected to an Ethernet adaptor which is plugged into the host. But now most are built in into the computers.
- The protocol is implemented on the adaptor.
Multiple Ethernet segments can be joined together by repeaters(中繼站). A repeater is a device that forwards digital signals and strengthen them. But no more than four repeaters
With 10BaseT, the common configuration is to have several point to point segments coming out of a multiway repeater, called Hub(集線器). (The cable is twisted pair and limited to 100m in length)
Star Topology
Today: Star topology prevails(盛行).
- active switch in center.
- each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other).
Ethernet Frame Format
7 | 1 | 6 | 6 | 2 | 4 | bytes | |
---|---|---|---|---|---|---|---|
Preamble | SFD | DA | SA | Type | LLC | PAD | FCS |
- Preamble (7 bytes): (101010…1010) for Synchronization.
- SFD (1 bytes): Start Frame Delimiter (10101011).
- DA (6 bytes): Destination MAC Address.
- SA (6 bytes): Source MAC Address.
- Packet type (2 bytes): acts as demux key to identify the higher level protocol.(識別更高層的協議)
- LLC-Frame: Up to 1500 bytes.
- PAD: Padding when LLC-Frame < 46 bytes.
- FCS (4 bytes): Frame Check Sequence (CRC-32).
- MAC-frame size – from DA to FCS.
- Min 64 bytes to distinguish from collision.
- Max 1518 bytes to prevent dominating(統治) bandwidth.
Ethernet Addresses
Every Ethernet host in the world has a unique Ethernet Address. And the address belongs to the adaptor, not the host. It is usually burnt into ROM.
To ensure that every adaptor gets a unique address, each manufacturer(製造商) of Ethernet devices is allocated(分配) a different prefix(字首) that must be prepended(預先) to the address on every adaptor they build. - Ex: AMD has been assigned the 24bit prefix 8:0:20.
- An Ethernet adaptor receives all frames and accepts:
- Frames addressed to its own address.
- Frames addressed to the broadcast address.
- Frames addressed to a multicast address if it has been instructed.
Ethernet MAC Protocol – CSMA/CD
Carrier Sense Multiple Access with Collision Detection (CSMA/CD):
- Carrier sense means that all nodes can distinguish between an idle(空閒的) and a busy link.
- Collision detection means that a node listens as it transmits and can therefore detect when a frame it is transmitting has collided with a frame transmitted by another node.
- At the moment an adaptor detects that its frameis colliding with another, it first makes sure to transmit a 32-bit jamming sequence and then stops transmission.
- Thus, a transmitter will minimally send 96 bits in the case of collision: 64-bit preamble + 32-bit jamming sequence. (只在兩個主機距離非常近時發生)
- The worst case scenario happens when the two hosts are at opposite ends of the Ethernet. To know for sure that the frame its just sent did not collide with another frame, the transmitter may need to send as many as 512 bits(64 bytes).
- Consider that a maximally configured Ethernet is 2500 m long, and there may be up to four repeaters between any two hosts, the round trip delay has been determined to be 51.2 μs. So in the 10 Mbps Ethernet: 10 Mbps X 51.2 μs = 512 bits.
Binary Exponential Backoff Algorithm(指數退避演算法)
Exponential Backoff: Once an adaptor has detected a collision, and stopped its transmission, it waits a certain amount of time and tries again. Each time the adaptor tries to transmit but fails, it doubles the amount of time it waits before trying again.
- Ex: k = 0, 1 in the first time, and will double to 0, ······2^n-1 when the Nth time, the k value will be selected at random, and the adaptor shall delay k x 51.2 μs. But the n should no more than 16 and the k should be Min(k, 10).
Disadvantage of BEBA: Last-in-First-out effect.
CSMA/CD Protocol
- Carrier Sense before transmission.
- Deference: Defers transmission if channel is sensed busy.
- Carrier Sense while transmission.
- When Collision: Two or more stations transmitting simultaneously(同時).
- For Backoff: Random delay after collision.
- Collision Window (Slot time, 時隙間隔): Round-trip propagation delay time plus some carrier sense time. In IEEE 802.3, this value is defined to be 51.2 μs.
Ethernet Performance
- Ethernets work best under lightly loaded conditions.
- Under heavy loads, too much of the network’s capacity is wasted by collisions.
802.3 Ethernet Standards
- MAC Protocol – CSMA/CD.
- Connection less, unreliable transmission.
- Topology from Bus to Star (switches).
- Half-duplex transmission in Bus topology
- Work best under lightly loaded conditions.
- Too much collision under heavy load.
- Full-duplex transmission in Switch topology (point-to-point)
- Though no more collisions, shall also implement the CSMA/CD potocol.
- Excellent performance (wired speed, 線速).