ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case...

34
ELEC6113: Wireless and Mobile Networks Session 5: Data Lin Protocols. Local Area Networks – C Study Ethernet (I).

Transcript of ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case...

Page 1: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

ELEC6113: Wireless and Mobile Networks

Session 5: Data Link Protocols.Local Area Networks – Case Study

Ethernet (I).

Page 2: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

At the end of this session you will be able to…… compare and evaluate the basic operation of several data link protocols under a given scenario

… calculate the overall efficiency of a link

… demonstrate knowledge and understanding of problems related to the use of a communication channel in broadcast networks (in particular, LANs)

… demonstrate knowledge and understanding of protocols devised to address such problems

Page 3: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

For “STOP-AND-WAIT” scheme, a one-bit sequence number is enough for FRAME and ACK

Tx sends:FRAME '0' until ACK '1' is received, thenFRAME '1' until ACK '0' is received, and so on

What does Rx do?Note the convention: the ACK number gives the NEXT frame to send

Review from last week

pp 206-211 (T.4e)pp 241-246 (T.5e)

Page 4: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Stop-and-Wait

Tx Rxtime

TIMEOUT

Tx Rxtime

ACK 1

Note the convention: the ACK number gives the NEXT frame to send

Tx Rxtime

TIMEOUT

FRAME 0

FRAME 1

FRAME 0

ACK 0 FRAME 0

FRAME 0

FRAME 0

FRAME 0

Page 5: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

How long should the timeout be?

Tx Rxtime

TIMEOUT

Tx Rxtime

TIMEOUT

ACK 1

ACK 1

FRAME 0

FRAME 0

FRAME 0

FRAME 0

FRAME 0

Too short –

inefficient asframes are

unnecessarily

retransmitted

Too long –

inefficient when

frame lost

TIMEOUT

Page 6: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

What now?

This scheme can be improved in various ways.

Several frames could be sent simultaneously

but then there is more overhead in the control.

Page 7: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Talking point

Before looking at improvements, first consider the

overall efficiency of a link.

Assume that a 2Mbps link connects A and B,

which are 200 km apart (approximately 124 miles).

What is the time to transmit a short frame?

A B2 Mbps link

200 Km

Page 8: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

(Hint)

The speed of the signal in the link is about 200x106 m/s(NOT ‘c’, the speed of light, 300 Km/s - in a wire or cable we

only achieve around 60% to 80% of ‘c’)

What is the time to transmit a short frame?

Page 9: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Overall efficiency of a link

The speed of the signal in the link is about 200x106 m/s(NOT ‘c’, the speed of light - in a wire or cable we only achieve

around 60% to 80% of ‘c’)

Hence the time to transmit a ‘short frame’ is

 

Page 10: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Overall efficiency of a link

The RTT (Round Trip Time) is thus 2ms (as acknowledgment needs to return and we consider

the processing time negligible).

Assume a ‘short’ frame of around 200 bits(approximately a 20 byte payload)

What is the maximum transfer rate?

Page 11: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Overall efficiency of a link

The transfer rate actually achieved before the ACK

returns to the Tx is

Only 5% of the capacity of the 2Mbps link!

This can improve with larger frame size, but gets worse

with longer distances, faster links, or delays on route.

 

Page 12: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Latency

When calculating the overall efficiency of a link, note the fundamental problem of latency (the efficiency can deteriorate with longer distances, faster links, and any delays on route).

This is a fundamental problem.

Page 13: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Where were we?

Recommended reading: ch 7 of Stallings, W. (2009) Data and Computer Communications. 8th ed. (TK5105.5 STA), especially pp 208-221

TIMEOUT

Tx Rxtime

ACK 1

Tx Rxtime

TIMEOUT

FRAME 0

FRAME 1

FRAME 0

ACK 0 FRAME 0

FRAME 0

FRAME 0

FRAME 0

Tx Rxtime

Stop-and-wait protocol

ACK 1

Page 14: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Talking point

How do we improve STOP-AND-WAIT?

Page 15: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Sliding Windows (I)

Allow multiple outstanding frames: sequence number

assigned to each frame (sent in the header)

e.g. a 3-bit field allows up to 7 “unacknowledged”

frames to be in transit (2n-1).

This is Go-back-N ARQ (Automatic Repeat Request).

Any failure to acknowledge a frame requires the

retransmission of that frame and all subsequent frames

(receiver discards any frames received that are not in

strict sequence).

pp 211 onwards (T.4e)pp 246 onwards (T.5e)

Page 16: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Sliding Windows (II)

Another alternative is Selective-Reject ARQ

(sometimes called “selective-repeat”),

where only lost frames are retransmitted.

Harder to implement and only 2n-1 frames can be allowed

to be in transit at any time

(e.g. 3-bit field allows for 4 frames in transit).

Note the possibility of piggybacking ACK and Frame when

bi-directional data is being sent.pp 211 onwards (T.4e)pp 246 onwards (T.5e)

Page 17: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Sliding Windows (III)

Sliding Windows algorithms ensure reliable delivery

over an unreliable link.

Also provide mechanisms for flow control,

essentially feedback mechanisms that enable the

receiver to “slow down” a fast transmitter

pp 211 onwards (T.4e)pp 246 onwards (T.5e)

Page 18: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

LAN Case Study – Ethernet

LAN = ‘Local Area Network’, a computer network designed to work at the local level (a building or group of buildings) rather than a Wide Area Network which works over an entire region.

Original Xerox Parc system developed into a standard by Xerox/Digital/Intel around 1979 – at the time, just one of many alternative LAN systems, all around 10 Mbit/sec

Very slow initial uptake, but after a number of changes to the design gradually became a market leader and then the market leader. As a result of this success, faster versions have been developed (100Mbit/sec, 1Gbit/sec and 10Gbit/sec).

Recommended reading: Tanenbaum & Wetherall 5th ed. pp 298-300

Page 19: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

CSMA/CD

Ethernet is an example of a CSMA/CD system (Carrier Sense Multiple Access, Collision Detect).

It was designed around the concept of a single (shared) data cable: only one system can use the channel (i.e. data cable) at any instant.

(Image taken from http://www.louiewong.com/archives/172 )

Page 20: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

CSMA/CD

The basic algorithm is exactly the same as a group of people holding a conversation:

listen to see if the channel is busy, if it is, wait until it is free

when the channel is free, transmit but continue to listen to detect a collision. If there is a collision, stop transmitting immediately and wait (discussed later) before trying again.

Page 21: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format

Recommended reading: Tanenbaum & Wetherall 5th ed. pp 300-302

Page 22: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format - Preamble

The function of the preamble (8 bytes of 0xCC) is to synchronize the Rx clock with the Tx clock (Manchester encoding is used).

Page 23: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – Addresses (I)

The ‘addresses’ are needed as a LAN is not a point-to-point data link. There will be a number of nodes in the network, so it is essential to identify the node that a message is being transmitted to.

Page 24: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – Addresses (II)

Ethernet addresses are built into the hardware at the manufacturing stage.

Sometimes known as ‘MAC’ (=Media Access Control) addresses.

The format is 12 hexadecimal characters, MM:MM:MM:SS:SS:SS where MM:MM:MM is the manufacturer ID and SS:SS:SS is the board serial number).

Page 25: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – Addresses (III)

There is a special broadcast address, hexadecimal FF:FF:FF:FF:FF:FF (i.e. all 1's), a transmission to this address will be received by every node in the network.

Page 26: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – Type/Length

The ‘Type’ field originally defined the protocol in use, but when Ethernet was standardized by the IEEE (resulting in the IEEE 802.3 standard) this became the ‘length’ field.

Page 27: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – Data

The ‘Data’ field has a minimum and maximum length. The max length is ~1500 bytes. (The minimum data size requirement will be discussed later)

– for now just note that if the data being sent is less than 46 bytes, it will have to be ‘padded out’ to this size with extra bytes.

Page 28: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Ethernet Frame Format – CRC

The ‘CRC’ field is designed to provide confidence that the data has not been corrupted. The 32 bit size provides much more confidence than the 16 bit CRCC used in HDLC as discussed in previous sessions.

Page 29: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Talking point

Why is there a Minimum Frame Size requirement in Ethernet?

Page 30: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Minimum Frame Size requirement (I)

This is necessary to guarantee detection of collisions .Assume two nodes, A & B, separated by a distance D.

Node A decides to transit a frame, and after a time t this frame has ‘almost’ reached node B.At this point node B decides to transmit a frame: it has been monitoring the Ethernet cable and knows that no oother node is transmitting.

Page 31: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Minimum Frame Size requirement (II)• However, as soon as transmission starts there is a collision with the frame from node A which has just reached node B.

• B will detect this immediately and cease transmission.

• In contrast, node A must now wait for the collision to reach it –

which will take another time t (i.e. the RTT is 2t).

• Once the collision reaches node A, it knows that its frame has been corrupted and it aborts transmission.

Page 32: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

Minimum Frame Size requirement (III)

• If a ‘too short’ frame was to be transmitted, there is a danger that node A could have completed the transmission before the collision returned.

• If this were to happen, node A would mistakenly assume that the transmission had been successful even though it

was corrupted by the frame from node B.

Page 33: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

At the end of this session you should be able to…… compare and evaluate the basic operation of several data link protocols under a given scenario

… calculate the overall efficiency of a link

… demonstrate knowledge and understanding of problems related to the use of a communication channel in broadcast networks (in particular, LANs)

… demonstrate knowledge and understanding of protocols devised to address such problems.

Page 34: ELEC6113: Wireless and Mobile Networks Session 5: Data Link Protocols. Local Area Networks – Case Study Ethernet (I).

For tomorrow

CSMA/CD efficiency

Ethernet Retransmission algorithm

Ethernet Switches