Ethernet (Ieee 802

22
ETHERNET (IEEE 802.3)

description

embedded ethernet

Transcript of Ethernet (Ieee 802

Page 1: Ethernet (Ieee 802

ETHERNET (IEEE 802.3)

Page 2: Ethernet (Ieee 802

• Most popular LAN• Transmission medium is thick co-axial cable• Ethernet refers to the cable – the ether• Before transmitting, a computer first listen to the cable to

see if someone else was already transmitting. Wait until it is finished.

• A problem still arise – what happens if 2 or more computers are waiting?

• Solution – each computer listen during its own transmission and if it detects interference, jam the ether to alter all senders.

• Then back off and wait a random time before retrying. • If a second collision happens, the random waiting time is

doubled and so on…and give one of them a chance to go first .

Page 3: Ethernet (Ieee 802

• Advantages:– It is versatile- suit many applications– It is easy to use-no need to design the hardware interface or..– A wide selection of products is available-hardware, software, debugging

tools are available..– The hardware controls network access-hardware manages the network

traffic and no need for software to control network access– It is fast-supports from 10Mbps to 10Gbps– It can span long distances– Interfaces are electrically isolated– The cost id reasonable

• Limits:– Cost-if keeping the cost to an absolute minimum is essential, there are

cheaper interfaces that are suitable for some applications like RS-485..– Real-time limits-does not support real time transfers with minimum delay– Efficiency- not very efficient when transferring small amount of data. – to

transmit 1byte of data, 26 bytes-overhead, 45 bytes of padding..– Power consumption-at 5V, power consumption is around 50mA

Page 4: Ethernet (Ieee 802

• Ethernet is not the only LAN standard – token bus (802.4) and token ring (802.5)

• Wireless LAN standard – WiFi (802.11)• Four types of cabling are commonly used:

Name Cable Max.seg Nodes/seg. Advantages10Base5(thick Ethernet)

Thick coax 500m 100 Original cable, now obsolete

10Base2(thin Ethernet)

Thin coax 185m 30 No hub needed

10Base-T Twisted pair 100m 1024 Cheapest system

10Base-F Fiber optics 2000m 1024 Best between buildings

Page 5: Ethernet (Ieee 802

• Cable topologies – Linear, Spine, Tree, Segmented• 10Base5 – it operates at 10Mbps (speed), uses base band

signaling and can support segments upto 500meters. Connections are made using taps, in which a pin is very carefully forced halfway in to the coaxial cable’s core.

• 10Base2- connections to it are made using industry standard BNC(Bayonet Neill Concelman - a coaxial RF connector designed to work at radio frequencies in the multi-megahertz range.) connectors to form T junctions. BNC connectors are easier to use and more reliable. Thin Ethernet is much cheaper and easier to install, but it can run only 185 meters per segment, each can handle only 30 machines.

• Detecting cable breaks, excessive length, bad taps, or loose connectors can be a major problem with both the media.

• It is overcome by – all stations have a cable running to a central hub in which they are all connected electrically.

Page 6: Ethernet (Ieee 802

• 10Base-T- twisted pair cables, hubs do not buffer incoming traffic. There is no shared cable at all. A hub to which each station is connected by a dedicated cable. Adding or removing stations is simpler, cable breaks can be detected easily. Disadvantage – max cable length from hub is 100m.

• 10Base-F- use fiber optics. Expensive due to the cost of connectors and terminators, but has excellent noise immunity. It can run up to km.

• To allow larger networks, multiple cables can be connected by repeaters. It is a physical layer device.

Page 7: Ethernet (Ieee 802

Manchester encoding• None of the versions of Ethernet uses straight binary

encoding with 0 volts for 0 bit and 5volts for 1bit. • A way for receivers to unambiguously determine the start,

middle and end of a bit without reference to an external clock. • Two approaches –

Manchester encoding• Each bit period is divided into two equal intervals. A binary 1

bit is sent by having the voltage set low during the first interval and high in the second interval. A binary 0 is just the reverse – first high then low. This scheme ensures that every bit period has a transition in the middle, making it easier for the receiver to synchronize with the sender.

Page 8: Ethernet (Ieee 802

• Disadvantage – it requires twice as much bandwidth as straight binary encoding because the pulses are half the width.

• Eg. – to send data at 10Mbps, the signal has to change 20million times/sec.

Differential Manchester encoding• Here a 1 bit is indicated by the absence of a transition at

the start of the interval. A 0 bit is indicated by the presence of a transition at the start of the interval. There is a transition at the middle. It requires more complex equipment but offers better noise immunity.

• All Ethernet systems use Manchester encoding due to its simplicity.

Page 9: Ethernet (Ieee 802

Ethernet frame structure• IEEE 802.3 frame structure

• Each frame starts with a preamble of 7bytes, and I byte for a start of frame delimiter

• Preamble bits are required to synchronize the receiver’s clock with the sender’s.

• The frame contains two addresses, one for the destination and one for the source.

• For 10Mbps base band standard 6-byte address are used• The higher order bit of the destination address – 0 – ordinary address• -1 – group address. Multiple stations listen to a single address• Sending to a group of stations is called multicast. • Address consisting of all 1’s – broadcast. • The frame containing all 1’s in the destination field is accepted by all

stations on the network.

Preamble SOF destination add Source add Length data frame check sequence

Page 10: Ethernet (Ieee 802

• A multicast frame is sent to a selected group of stations on the Ethernet.

• A broadcast frame is sent to all stations on the Ethernet.• Multicast is more selective. But involves group management• Broadcasting is coarser but does not require any group management• Another feature of addressing – use of bit 46(adjacent to HO bit) to

distinguish local address from global address. • Local addresses are assigned by each network administrator and

have no significance outside the local network• Global addresses are assigned centrally by IEEE to ensure that no

two stations anywhere in the world have the same global address.• Length field – tells the receiver what to do with the frame. It specifies

which process to give the frame to. Any number lesser than or equal to 1500 can be a length field.

• Data – upto 1500bytes. Ethernet requires that valid frames must be at least 64bytes long, from destination address to check sum, including both.

• If the data portion of the frame is less than 46bytes, the pad field is used to fill out the frame to the minimum size

Page 11: Ethernet (Ieee 802

• Another reason for having a minimum length frame is to prevent a station from completing the transmission of a short frame before the first bit has even reached the far end of the cable, where it may collide with another frame

• If a station tries to transmit a very short frame, a collision occurs, but the transmission completes before the noise burst gets back at 2Τ. The sender will then incorrectly conclude that the frame was successfully sent. To prevent this situation, all frames must take more than 2T to send so that the transmission is still taking place when the noise burst gets back to the sender.

• For a 10Mbps LAN with a max. length of 2500meters and 4 repeaters, the round trip time has been determined to be nearly 50microsec in the worst case.

• At 10Mbps, a bit takes 100nsec, so 500bits or round off to 512 bits(64bytes) is the smallest frame that is guaranteed to work.

• As the network speed goes up, the min. frame length must go up or the max. cable length must come down proportionally.

• Check sum – it is effectively a 32-bit hash code of the data. If some data bits are erroneously received the check sum will almost be wrong and the error will be detected. It just does error detection, not error correction.

Page 12: Ethernet (Ieee 802

Ethernet frames• All data in an Ethernet network travels in structures

called frames. An Ethernet frame has defined fields for data and other information to help the data get to its destination and to help the destination computer determine whether the data has arrived intact.

• The Ethernet controller’s hardware places information to be sent in frames for transmitting, and extracts and stores the information in received frames.

Page 13: Ethernet (Ieee 802

Preamble and start Frame delimiter• The preamble and SOF fields function together. They provide a

predictable bit pattern that enables the interfaces on a 10Mbps network to synchronize to, or match the timing of a new frame being transmitted

• In any data link, the receiving interface needs to know when to read the bits in the transmitted data.

• Ethernet interfaces are asynchronous, means that the interfaces don’t share a clock.

• For a 10Mbps Ethernet, the solution is to begin each frame with a known bit pattern that contains many transitions. Receiving interfaces use the pattern to synchronize to or lock onto, the transmitted frame’s clock.

• The preamble and SOF delimiter fields provide this bit pattern. The preamble consists of 7 identical bytes, each of with the value 10101010.

• The SOF delimiter follows the preamble and consists of the byte 10101011.

• After detecting the first transition in the preamble, a receiving interface uses the transition of the following bits to synchronize to the timing of the transmitting interface.

• The final 2 bits in the SOF delimiter indicate the end of the preamble.

Page 14: Ethernet (Ieee 802

Destination address• Every Ethernet interface has a 48-bit physical or hardware address

that identifies the interface on the network. • The destination address field contains the physical address of the

intended receiver of the frame.• The receiver may be an individual interface or a group of interfaces

identified by a multicast address or a broadcast address.• Every interface in the network reads the destination address of a

received frame. If the address does not match the physical address or a multicast or broadcast address, the interface ignores the rest of the frame.

• The second bit of the destination address – 0 – address is assigned by the manufacturer of the interface

• - 1 – address is administered locally. Source address• 48-bit physical address of the transmitting interface.

Page 15: Ethernet (Ieee 802

Length/Type field• 16-bits that have one of two meanings.

– The field can indicate the number of bytes of valid data in the data field

– The protocol used by the data in the field that follows• If the value is less than or equal to

– 1500 decimal, the value indicates length. – 1536 decimal, the length/type field indicates the protocol that the

contents of the data field use.– Values from 1501 to 1535 decimal are undefined

• The DIX standard defines this field as – type• The original IEEE 802.3 defines this field as – lengthData• The data is the information that the transmitting interface wants to read• Data field must be between 46 and 1500 bytes• If the data bits are fewer than 46bytes, the field must include pad bytes

to increase the size to 46 bytes.• If the transmitting interface has more than 1500 bytes to send, it uses

multiple frames• An Ethernet frame must be at least 512 bits(64bytes) not including the

preamble and SOF bits.- size of the frame with min. 45 data bytes. Receiving interface ignore frames that are shorter than this min. size

Page 16: Ethernet (Ieee 802

Frame check sequence• FCS field enables the receiving interface to detect errors in

the received frame• Electrical noise or other problems in the network can

corrupt a frame’s content.• A receiving node can detect corrupted data by using the

32-bit CRC value in the frame check sequence field. • The transmitting interface performs a CRC on the bytes to

be sent and places the result in the FCS field. The receiving interface also performs the same calculation on the received bytes. If both the results match, the frame’s contents are almost certain to be identical to what was sent.

• The Ethernet controller’s hardware performs the CRC calculations on both the sides and on detecting an error in the received frame it sets a bit in the status register.

Page 17: Ethernet (Ieee 802

Media Access Control• Deciding when to transmit• In half duplex interfaces, only one interface can transmit at a time.• So the interface need a way of deciding when it is OK to transmit.• Ethernet uses a media access control method – Carrier Sense Multiple

Access with Collision Detection (CSMA/CD)• This method allows any interface to attempt to transmit any time the

network is idle. • If 2 or more interfaces try to transmit at the same time, both wait a bit,

then retry, a collision occurs.• Carrier sense – an interface that wants to transmit must monitor the

network and sense or detect when the network is idle (absence of a carrier)

• Multiple access – no single interface controls the network traffic. Any interface can attempt to transmit on a network that has been idle for the time defined by the interframe gap (IFG)

• In a 10Mbps network, IFG = 96 bit times or 9.6 microsecond.• Ethernet controller's hardware handles sending and receiving of

frames, collision detection and deciding when to re-transmit

Page 18: Ethernet (Ieee 802

Responding to collision• A collision results when two interfaces in the same collision domain

try to transmit at the same time.• All of the interfaces that connect via repeater hubs share a collision

domain or interfaces that connect directly via coaxial cable also share a collision domain.

• On detecting a collision, the transmitting interface does not stop immediately. It continues long enough to be sure that the other transmitting interfaces have time to detect collision.

• A transmitting interface that has detected a collision always finishes sending the 64bits of the preamble and SOF delimiter. Following these, the interface sends an additional 32 bits called jam signal, then stops transmitting.

Page 19: Ethernet (Ieee 802

Delaying before retransmission• After an interface stops transmitting due to collision, the next task is

deciding when to try again.• If two interfaces wait the same amount of time and then retry,

another collision will occur.• The Ethernet standard defines a back off process, where each

interface selects a randomly chosen delay time. This reduces the chance that two interfaces will retry at the same time

• Up to 10 retriesNetwork limits to ensure collision detection• To prevent an interface from trying to use a frame that has

experienced a collision, a transmitting interface must be able to detect the collision and abandon the frame before transmitting for one slot time.

• For 10Mbps and fast Ethernet, one slot time = time taken to transmit 512bits.

Page 20: Ethernet (Ieee 802

Ethernet controllers• An embedded system that supports Ethernet requires Ethernet

controller hardware to provide the Ethernet interface• Ethernet communications are typically handled by a combination of

an Ethernet controller chip and device-driver code that communicate with the controller.

• The controller chip handles many of the details of sending and receiving Ethernet frames. – Receives the message to send and destination address– Calculates Ethernet frame check sequences– Place data, address etc.. in the frame’s fields– Attempt to transmit the frame when the network is idle– Detects collision– Provide an indication of success or failure of a transmission and

so on……..

Page 21: Ethernet (Ieee 802

Ethernet Ethernet controllerrefers to a wired network is a network controller

is a technology or a agreed upon standard on how data is to be moved from place to place.

describes a device or piece of hardware. ie a NIC - Network interface controller.

The Ethernet protocol is the networking backbone for important networks

Ethernet controller provides a common and very reliable hardware resource with which anyone can easily set up and

use a networking environment. Ethernet delivers the network security, performance, and availability required to support applications

Ethernet controllers handle every aspect of network communications but does not

monitor network security

Most widely used LAN technology

Ethernet controllers are plug and play

compatible Only physical layer functions Integrate MAC and physical layer

functions

Page 22: Ethernet (Ieee 802

To conclude…..• The term Ethernet refers to the family of local-area network (LAN)

products covered by the IEEE 802.3 standard that defines what is commonly known as the CSMA/CD protocol. Four data rates are currently defined for operation over optical fiber and twisted-pair cables:

• 10 Mbps—10Base-T Ethernet• 100 Mbps—Fast Ethernet• 1,000 Mbps—Gigabit Ethernet• 10,000 Mbps—10 Gigabit Ethernet• Ethernet is currently used for approximately 85 percent of the world's

LAN-connected PCs and workstations. Ethernet is the major LAN technology because of the following characteristics:– Is easy to understand, implement, manage, and maintain– Allows low-cost network implementations– Provides extensive topological flexibility for network installation– Guarantees successful interconnection and operation of standards-

compliant products, regardless of manufacturer