Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

EE5150, Communication Networks

(January - May 2024, IIT Madras)

1. Introduction to Link Layer

• focus on nodes, link and frames


• a transmitting node encapsulates the network layer datagram in a link-layer
frame and transmits the frame over a link
• a transportation analogy: the tourist is a datagram, each transportation segment
is a link, the transportation mode is a link-layer protocol, and the travel agent
is the routing protocol

1
2. Services provided by the link layer

• framing
• addressing
• medium access or link access
• reliable delivery
• error detection and correction

3. Where is the link layer implemented?

• implemented on a chip called the network adapter or network interface controller


(NIC)
• NIC implements framing, link access, error detection, etc
• limited functionalities in the software at the host

2
4. Error detection and Error correction techniques

• bit level error detection and correction are implemented in link layer

• common techniques
– parity checks, checksumming methods, cyclic redundancy checks

3
• Parity checks

• The ability of a receiver to both detect and correct errors is known as forward
error correction (FEC)

4
• Cyclic redundancy check codes (Polynomial codes)

– can detect burst errors of fewer than r + 1 bits


GCRC−32 = 100000100110000010001110110110111

5
5. Multiple Access Links and Protocols

• a point-to-point link vs a broadcast link


• multiple access concerns coordinating the channel access of multiple sending and
receiving nodes to a shared broadcast channel
• a classroom analogy

• simultaneous transmissions leads to collisions, channel errors and frame loss


• multiple access techniques: channel partition protocols, random access protocols
and taking-turns protocols
• prefered MAC protocol: no overheads, decentralized and inexpensive to imple-
ment :-)

6
6. Channel Partitioning Protocols

• TDM, FDM, CDM


• inefficient in performance (bandwidth allocated as well as delay) - a traffic signal
analogy

7
7. Random access protocols

• nodes compete for access


• infer collisions and retransmit frames upon collision
• seek to minimize losses due to collisions (typically by a random delay)
• slotted ALOHA, ALOHA, CSMA, CSMA/CD, CSMA/CA are common proto-
cols

8. Slotted Aloha

• Assumptions
– all frames consists of exactly L bits
– time is divided into slots of size L/R bits
– nodes start to transmit only at the beginning of a slot
– all the nodes are synchronized
– if two or more nodes transmit in a slot, all transmissions fail and the nodes
detect the collision event

• Performance
– advantages: access to complete channel and lack of coordinator
– disadvantages: poor efficiency (ps = 1/e is the maximum efficiency of the
protocol)

8
9. Pure Aloha

• Assumptions
– unslotted, and fully decentralized medium access protocol
– transmit the frame as soon as the frame arrives
– upon collision, retransmit the frame with probability p with a frame trans-
mission waiting time

• Performance
– advantages: immediate access to channel and lack of synchronization
– disadvantages: poor efficiency compared to slotted Aloha protocol

9
10. Carrier Sense Multiple Access (CSMA)

• a human analogy : listen before speaking, avoid simultaneous conversations


• medium access protocol: carrier sense and collision detection
• collisions with CSMA

• collisions with CSMA/CD

• backoff shall be adapted based on contention


– exponential (random) backoff works well without contention information
– evaluation through Monte Carlo simulation
• random access protocols are inefficient but effective! How do you optimize them?

10
11. Taking-turns protocol

• polling protocols with master-slave architecture


– eliminates collisions and idle slots
– adds polling delay and overheads in scheduling users
– master node is a single point of failure
• token passing protocols
– decentralized unlike taking-turns protocol
– less efficient and has challenges with generating and circulating tokens
– e.g., FDDI, token-ring (IEEE 802.5)

11
12. Switched Local Area Networks

• link layer supports frame delivery, reliable communication, security, medium ac-
cess, etc
• switches operate at link layer

12
13. MAC addresses or LAN address or physical address

• all network adapters in a host/router have MAC addresses


• a host/router may have multiple adapters (and different MAC addresses)
• switches do not have MAC addresses as they are transparent
• Ethernet MAC addresses are 6 bytes long (expressed in hexadecimal format)
• MAC addresses of adapters are typically fixed and necessarily distinct (allocated
by IEEE)!
• MAC address does not change when the device is mobile
• frames are addressed with source/destination addresses for delivery
• frames may be unicast, multicast or broadcast with distinct addresses

13
14. Ethernet

• Ethernet has been a dominant technology since mid 1970s


• key details
– first widely deployed LAN protocol
– simple and inexpensive unlike token ring, FDDI, ATM
– adapted with increasing speeds and with backward compatibility (10 Mbps,
100 Mbps, 1 Gbps and more)
– success of switched LANs in comparison with broadcast hubs (switch was
collision less)
– Ethernet hardware commoditized
• Ethernet frame structure

– data: 46 bytes to 1500 bytes (MTU)


– source and destination address: 6 bytes;
– type: permits MAC layer to appreciate the higher layer protocol as well as
to support MAC services
– CRC: 4 bytes
– preamble: 8 bytes; 10101010 x 7 and 10101011;
• Ethernet service
– connection-less delivery of frames
– unreliable delivery with no acknowledgement (ethernet is simple and cheap)

14
• Ethernet technologies
– 10BASE-T, 10BASE-2, 100BASE-T, 1000BASE-LX, 10GBASE-T, 40GBASE-
T, etc
– Ethernet specifices the link layer as well as the physical layer (IEEE 802.3
standards)
– physical medium include coaxial cable, copper wire and fiber
– Ethernet was originally over a broadcast medium engaging CSMA/CD
– today’s Ethernet is switched, where nodes are connected to a switch in point-
to-point manner
– distances ranges from 100 meters to 500 meters
– backward compatibility is an important feature leading to the success of
Ethernet (MAC, frame format and handshakes)
– hubs had broadcast channels with CSMA/CD; switches are full duplex point-
to-point links not needing CSMA/CD;

15
• Link layer switches
– switches receive incoming link-layer frames and forwards them onto outgoing
links
– switches are transparent to hosts and routers
– switches use buffers to manage congestion in the LAN
– Functionalities
∗ forwarding
∗ filtering
∗ frames are queued at outgoing link interfaces
∗ actively maintains topology of switched network (to a spanning tree)
∗ functionalities enabled with a switch table and switch architecture

– How does a switch function? (switch smarter than hub)


∗ switch table is self-learning (plug-and-play)
– Properties
∗ no collisions
∗ heterogeneous links
∗ easy to manage network issues such as port failures, cable failures, etc
∗ operates at link layer with MAC addresses

16
• Virtual LANs
– VLAN support permits multiple virtual LANs over a single physical LAN
infrastructure
– VLAN support enables efficient traffic isolation and effective separation of
user groups

– hosts within a VLAN communicate as if they (and no other devices) are


connected via a switch
– for example, in port based VLANs, ports that are part of a VLAN form a
broadcast domain
– communication across VLANs enabled by a network layer routing function-
ality

17
– VLAN tag (802.1Q frame) and trunking functionality allows extension of
VLAN to more than one switch

18
1 Exercises
1. Why does collision occur in CSMA, if all nodes perform carrier sensing before trans-
mission? (R8)
2. Consider the generator, G = 1001, and suppose that D has the value 11000111010.
(a) What is the value of R? (P5)
(b) Why can it detect any single bit error in data D? (P7)
3. In Section 6.3, we provided an outline of the derivation of the efficiency of slotted
ALOHA. In this problem we’ll complete the derivation. (P8)
(a) Recall that when there are N active nodes, the efficiency of slotted ALOHA is
N p(1 − p)N −1 . Find the value of p that maximizes this expression.
(b) Using the value of p found in (a), find the efficiency of slotted ALOHA by letting
N approach infinity. Hint: (1 − 1/N )N approaches 1/e as N approaches infinity.
4. Consider two nodes, A and B, that use the slotted ALOHA protocol to con- tend for
a channel. Suppose node A has more data to transmit than node B, and node A’s
retransmission probability pA is greater than node B’s retrans- mission probability,
pB. (P10)
(a) Provide a formula for node A’s average throughput. What is the total efficiency
of the protocol with these two nodes?
(b) If pA = 2pB, is node A’s average throughput twice as large as that of node B?
Why or why not? If not, how can you choose pA and pB to make that happen?
(c) In general, suppose there are N nodes, among which node A has retrans- mission
probability 2p and all other nodes have retransmission probability p. Provide
expressions to compute the average throughputs of node A and of any other
node.
5. Suppose four active nodes—nodes A, B, C and D—are competing for access to a
channel using slotted ALOHA. Assume each node has an infinite number of packets
to send. Each node attempts to transmit in each slot with probability p. The first
slot is numbered slot 1, the second slot is numbered slot 2, and so on. (P11)
(a) What is the probability that node A succeeds for the first time in slot 4?
(b) What is the probability that some node (either A, B, C or D) succeeds in slot 5?
(c) What is the probability that the first success occurs in slot 4?
(d) What is the efficiency of this four-node system?
6. Consider a broadcast channel with N nodes and a transmission rate of R bps. Suppose
the broadcast channel uses polling (with an additional polling node) for multiple
access. Suppose the amount of time from when a node completes transmission until
the subsequent node is permitted to transmit (that is, the polling delay) is dpoll.
Suppose that within a polling round, a given node is allowed to transmit at most Q
bits. What is the maximum throughput of the broadcast channel? (P13)

19
7. Recall that with the CSMA/CD protocol, the network adapter waits K 512 bit times
after a collision, where K is drawn randomly. For K = 115, how long does the adapter
wait until returning to Step 2 for: (P17)

(a) a 10 Mbps broadcast channel?


(b) a 100 Mbps broadcast channel?

8. In this problem, we explore the use of small packets for Voice-over-IP appli- cations.
One of the drawbacks of a small packet size is that a large fraction of link bandwidth
is consumed by overhead bytes. To this end, suppose that the packet consists of P
bytes and 5 bytes of header. (P27)

(a) Consider sending a digitally encoded voice source directly. Suppose the source
is encoded at a constant rate of 128 kbps. Assume each packet is entirely filled
before the source sends the packet into the network. The time required to fill
a packet is the packetization delay. In terms of L, determine the packetization
delay in milliseconds.
(b) Packetization delays greater than 20 msec can cause a noticeable and unpleasant
echo. Determine the packetization delay for L = 1,500 bytes (roughly corre-
sponding to a maximum-sized Ethernet packet) and for L = 50 (corresponding
to an ATM packet).
(c) Calculate the store-and-forward delay at a single switch for a link rate of R =
622 Mbps for L = 1,500 bytes, and for L = 50 bytes.
(d) Comment on the advantages of using a small packet size.

2 Reference
1. Chapter 6 (The Link Layer and LANs) of Kurose and Ross, Computer networking: A
top-down approach

20

You might also like