Lecture 7 (Data Link Layer) Part 41
Lecture 7 (Data Link Layer) Part 41
◼ For t < Tc , some stations may find the channel is still idle and may
also transmit
◼ For t > Tc , all the stations find the channel is busy
Example: Determine Tc of the following links
200 m 20 m
A B A B
Ensure the frame is long enough so that the node can't finish transmitting the frame
before the collision occur. Thus Tf > 2Tc
If using IEEE 802.3 Ethernet, the bit rate is 10Mbps and the maximum length of the
medium in ethernet is 100m, you can know the minimum frame size for Ethernet is 64
bytes. If you want to send a 802.3 Ethernet frame, its minimum size is 64 bytes.
If you try to send something smaller, padding will be added to make it 64 bytes
1 𝑇𝑐
Link efficiency ≈ , 𝑎=
1+5𝑎 𝑇𝑓
⚫ If only one node attempts to transmit at any time. In this case, the NIC may saturate
the medium and efficiency is 100%.
⚫ When two or more NICs attempt to transmit at the same time, the performance of
Ethernet is less predictable. Some bandwidth is wasted by collisions.
We can conclude:
Tc/Tf = 0.193
What a node should do if it senses that another node is using the medium or collision is
detected?
⚫ wait and not send right away or that would cause a collision
The algorithm does not know how many nodes are waiting when the first collision
occurs. It assumes that there are 2 nodes after first time collision happen.
After the first time collision, each node could send right away with roughly probability of
1/2. Each one will wait zero or one frame time.
Frame time is the time required for a signal to traverse from one end of the network to
another, plus the time required to send the jam signal in case of collision.
For 10/100Mbps Ethernets, the frame time is 5.12 μs
If collide again, each node sending will be with probability 1/4. Each node picks up a
random number of frame times to wait 0 – 3 frame times
If collide again, the algorithm will double the number of frame times again. Each node
needs to wait a random number of frame times 0 – 7 times
Thus, binary exponential backoff is doubling the interval with each successive collision
Binary exponential Backoff
◼ Used for the scheduling of retransmissions
◼ A station involved in the collision chooses a random parameter K from a
delay set and schedules the retransmission after 𝑘 × frame time
◼ frame time = 2𝑇𝑐
◼ initial delay set = {0, 1}
◼ Station that generates the smallest 𝑘 will transmit first
◼ For m consecutive collisions, the random value 𝑘 is chosen from the
following delay set
Delay Set = {0, … , 2𝑚 − 1} if 𝑚 < 10
Delay Set = {0, … , 210 − 1} if 𝑚 ≥ 10
◼ After 16 consecutive collisions, gives up and reports systems error to the
network management
◼ Generation of the random number 𝒌
◼ Uniform Distribution function: 𝑛 = random(), 0 ≤ 𝑛 < 1
𝑘 = ⌊𝑛 × |delay set|⌋
◼ example
delay set = {0, 1}, |delay set|=2:
𝑛 = 0.345 → 𝑘 = 0
𝑛 = 0.711 → 𝑘 = 1
delay set = {0, 1, 2, 3, 4, 5, 6, 7}, |delay set|=8:
𝑛 = 0.345 → 𝑘 = 2
𝑛 = 0.711 → 𝑘 = 5
The back exponential backoff (one node sends a frame)
Each node makes their own decision following this algorithm
The back exponential backoff (multiple nodes send frames)
In this example, assume that A, B and C are willing to send at the same time. Collision
occurs.
At the end of successful transmission by C, both C and E attempt to transmit (C wants to transmit a new
frame. E wants to retransmit its frame). Will collision occur?
Yes, for the new frame by C, collision number N is set to 0. After collision, the delay set for C is {0,1} while
the delay set for E is {0, …… 15}.
Suppose C generated K is 0 and K generated K is 3, then C will transfer the frame before E.
Format of Classis Ethernet Header
It's often very helpful to look at the format so we can see the different functions that
are included for the link layer
Bit synchronization: the receiving end clock has been adjusted to the same as the
sending end clock, so the receiver receives the bitstream and is able to adjudicate in
the middle of each bit. Bit synchronization is intended to properly receive each bit sent
by the sending side. This is done at the right moment (usually in the middle of each
position) to judge the received level according to the pre-agreed rules. For example, a
level above a certain value is 1, otherwise 0.
⚫ But just a bit of synchronization is not enough. Data is to be sent in frames. If a
frame is wrong, the wrong frame will be re-transmitted later. Therefore, a frame
should have a definite boundary, there must be a frame delimiter.
⚫ After receiving a bitstream, the receiver must be able to correctly locate the frame
delimiter so that it knows which bits make up a frame.
• The last two bits “11” indicate the end of Start Frame Delimiter and marks the beginning of
the frame.
• No ending flag
3. Destination Address-
• It is a 6 byte field that contains the MAC address of the destination for which the data is
destined.
4. Source Address-
• It is a 6 byte field that contains the MAC address of the source which is sending the data.
5. Data-
• The length of this field lies in the range [ 46 bytes , 1500 bytes ].
• In a Ethernet frame, minimum data has to be 46 bytes and maximum data is 1500 bytes.
• Ethernet uses CSMA /CD as access control method to deal with collisions.
• The minimum length of the Ethernet frame has to be 64 bytes starting from the destination
address field to the CRC field.
• Therefore, minimum length of the data field has to be = 64 bytes – (6+6+2+4) bytes = 46
bytes
Maximum Length of Data Field
• The maximum amount of data that can be sent in a Ethernet frame is 1500 bytes.
• If Ethernet allows the frames of big sizes, then other stations may not get the fair chance to
send their data.
6. Length-
• It is a 2 byte field which specifies the length (number of bytes) of the data field.
• We can determine the number of padding added to the data if its size is less than 64 bytes .
⚫ If there are collisions, the collided frames will be retransmitted that will be handled
by CSMA/CD.
Nowadays we do not use this multiple access control protocol for LAN. Modern
Ethernet is really based on switches.
Switch-based Ethernet
A network switch forwards frames between devices. Switches send frames directly to
devices, rather than sending them to networks like a router does.