1 of 74

CS 31204: Computer Networks – The Data Link Layer

INDIAN INSTITUTE OF TECHNOLOGY

KHARAGPUR

Sandip Chakraborty

sandipc@cse.iitkgp.ac.in

Department of Computer Science and Engineering

Abhijnan Chakraborty

abhijnan@cse.iitkgp.ac.in

2 of 74

What We Have Learnt So Far …

  • Protocol stack is implemented across different layers of the operating system

Software, Kernel

Firmware, Device Driver

Hardware

Physical

Data Link

Network

Transport

Application

Indian Institute of Technology Kharagpur

3 of 74

The Data Link Layer

Physical

Data Link

Network

Transport

Application

Logical Link Control

Medium Access Control

Indian Institute of Technology Kharagpur

4 of 74

Every Layer Adds Up Their Own Services

Data Link

Network

Addressing

Routing

Framing and Access Control

Error Control

Flow Control

Switching

Physical

AD/DA Conversion

Modulation

Coding

Analog Communication

MAC

LLC

Indian Institute of Technology Kharagpur

5 of 74

Data Link Layer Switching

  • Connect multiple LANs together

Do not send traffic onto ports where it is not needed

    • Each LAN can run at full speed

Indian Institute of Technology Kharagpur

6 of 74

Data Link Layer Switching

  • Data link layer switches (sometime called as bridge – the old name) should be completely transparent
    • Plug and Play – no address change
    • The operations of existing LANs should not be affected
    • The functionality of the devices should remain same even if they are part of the switched LAN
    • Easy to move stations over a switched LAN similar to a normal LAN

  • Step 1: Learning switches (backward learning algorithm) to stop traffic being sent where it is not needed

  • Step 2: Spanning tree algorithm to break loops

Indian Institute of Technology Kharagpur

7 of 74

Learning Switches / Bridges

Collision Domain - 1

Collision Domain - 2

The old topology – not used now a days

This topology is mostly used

- Single machine at every switch port

Indian Institute of Technology Kharagpur

8 of 74

Learning Switches / Bridges

  • Switch operates in promiscuous mode
    • Accepts every frame transmitted by stations attach to each of its ports

  • The switch decides whether to forward or discard each frame, and if forward which port to output the frame

  • Maintain a table (Output Port, MAC address) that maps at which port what machine / machines are connected

  • When the switches are first plugged in, the table is empty

Indian Institute of Technology Kharagpur

9 of 74

Learning Switches/ Bridges

  • Use flooding at the initialization – every incoming frame for an unknown destination is output on all the ports of the switch, except the one from where the frame has arrived

  • Every network interface (machine) connected on that receives that frame
    • Decode the frame
    • Check the destination MAC address at the frame header
    • If the address matches, accept the frame
    • Else, drop the frame

  • The switches starts learning about the (Output Port, MAC address) at this phase – called the backward learning

Indian Institute of Technology Kharagpur

10 of 74

Learning Switches / Bridges

  • For every incoming frame at a port, check the source MAC address
    • If the destination MAC is that one, then the frame needs to output at the same port

  • The (Output port, MAC address) table is populated gradually by applying this backward learning

Port A

Source = MAC1 Destination = MAC2

Indian Institute of Technology Kharagpur

11 of 74

Learning Switches / Bridges

  • For every incoming frame at a port, check the source MAC address
    • If the destination MAC is that one, then the frame needs to output at the same port

  • The (Output port, MAC address) table is populated gradually by applying this backward learning

Port A

Source = MAC1 Destination = MACx

Port A, MAC1

Indian Institute of Technology Kharagpur

12 of 74

Learning Switches / Bridges

  • For every incoming frame at a port, check the source MAC address
    • If the destination MAC is that one, then the frame needs to output at the same port

  • The (Output port, MAC address) table is populated gradually by applying this backward learning

Port A

Port A, MAC1

Source = MACx Destination = MAC1

Delete old entries if not used for some time

Indian Institute of Technology Kharagpur

13 of 74

Learning Switches / Bridges – The Rules / Mechanism

  1. If the port for the destination address is the same as the source port, discard the frame

  • If the port for the destination address and the source port are different, forward the frame on the destination port

  • If the destination port is unknown, use flooding and send the frame on all ports except the source port

Source: Computer Network, Tanenbaum, Wetherall, The Medium Access Control Sublayer, Section 8

Indian Institute of Technology Kharagpur

14 of 74

Cut Through Switching

  • The procedure needs to be very fast - switches are technically observing all the frames coming through

  • Implement in hardware

  • Once you start getting the bit stream, decode them immediately based on MAC frame structure
    • Observe the source MAC and destination MAC
    • Based on the destination MAC, if the switch does not need to forward the frame, do not process it further

  • Also known as wormhole routing

Indian Institute of Technology Kharagpur

15 of 74

Spanning Tree Switches

  • To increase reliability, redundant links may be deployed between the switches
  • Creates loop in the topology

  • Note that for unknown destination, switches flood the frames

  • Such frames can loop within the LAN

Indian Institute of Technology Kharagpur

16 of 74

Spanning Tree Switches

  • Construct a spanning tree across the switches

B1

B2

B3

B4

B5

B6

Indian Institute of Technology Kharagpur

17 of 74

Spanning Tree Protocol (STP)

  • Switches run a distributed algorithm to build the spanning tree

  • Each switch periodically broadcast a configuration message out all of its ports, processes the message it receives from other switches
    • Embedded in STP frames

  • To choose the root of the spanning tree, the switches include an identifier based on the MAC address in the configuration message, as well as the identifier they believe to be the root

  • The bridges choose the bridge with the lowest identifier to be the root

Indian Institute of Technology Kharagpur

18 of 74

Spanning Tree Protocol (STP)

  • A tree of shortest paths from the root to every switch is constructed
    • Include the distance from the root in the configuration messages

  • Each switch remembers the shortest path it finds to the root

  • The switches then turn off ports that are not part of the shortest path

  • The algorithm continues to run to detect any changes in the topology and update the tree

Indian Institute of Technology Kharagpur

19 of 74

Spanning Tree Protocol (STP)

  • Invented by Radia Perlman, 1985 (sometime called as “Mother of Internet”)

“I think that I shall never see�A graph more lovely than a tree.�A tree whose crucial property�Is loop-free connectivity.�A tree that must be sure to span�So packets can reach every LAN.�First, the root must be selected.�By ID, it is elected.�Least-cost paths from root are traced.�In the tree, these paths are placed.�A mesh is made by folks like me,�Then bridges find a spanning tree.”

-Radia Perlman

Indian Institute of Technology Kharagpur

20 of 74

Network Devices at Different Layers

Repeater, Hub

Bridge, Switch

Router

Transport Gateway

Application Gateway

Physical Layer

Data Link Layer

Network Layer

Transport Layer

Application Layer

Indian Institute of Technology Kharagpur

21 of 74

Error Detection and Correction

  • Bit errors can be introduced during transmission of the signal – more common for wireless networks

  • Add redundant information with the frame that is sent

  • Error detection: Include enough redundancy so that the receiver can separate out a correct frame and an erroneous frame (cannot identify the actual error)

  • Error correction: Include enough redundancy so that the receiver can correct errors up to some level (detect which bits are having an error)

Indian Institute of Technology Kharagpur

22 of 74

Error Detecting Codes - Parity Bit

  • Include a single parity bit with the data.

  • The parity bit is chosen so that the number of 1 bits in the codeword is even (or odd, depending on the setup)
    • 1101110011 is the data to transmit
    • Codeword is 11011100111 for even parity transmission

  • Can detect an odd numbers of bit errors – single bit error can be reliably detected
    • Difficult to detect for burst error

Indian Institute of Technology Kharagpur

23 of 74

Error Detecting Codes – Interleaving Parity

Source: Computer Network, Tanenbaum, Wetherall, The Data Link Layer, Section 2

Even parity

N parity bits are used for kN data bits

k bit errors will be reliably detected with at most one error per row

Indian Institute of Technology Kharagpur

24 of 74

Error Detecting Codes – Checksum

  • Let us look into the case for 16-bit Internet checksum

  • Divide the data bits into 16 bit words

  • Use 1’s complement arithmetic to compute the sum

  • Find out 1’s complement of the result - that’s the checksum

Indian Institute of Technology Kharagpur

25 of 74

Example – 8 bit Checksum

  • Say, we want to transmit 1101110011001110

  • Two 8 bit words – 11011100 and 11001110

  • 1’s complement addition - 00111100

  • 1’s complement of the result – 11000011 – that’s the checksum

  • More rigorous than parity check – two bit flipped remains undetected in parity check, but may be detected in checksum

Indian Institute of Technology Kharagpur

26 of 74

Error Detection Code – Cyclic Redundancy Check (CRC)

  • Also known as polynomial code – treat bit stream as a representation of polynomials with coefficient 0 and 1

  • For example, 1011001 can be treated as 1.x6 +0.x5 +1.x4 +1.x3 +0.x2 +0.x1 +1.x0, which is equivalent to x6+ x4+ x3+1

  • The sender and the receiver must agree upon a generator polynomial G(x)
    • Both the high and the low order bits for the generator polynomial must be 1

  • To compute CRC for a polynomial M(x) corresponds to a frame, the number of bits in the frame must be longer than the generator polynomial

Indian Institute of Technology Kharagpur

27 of 74

Error Detection Code – Cyclic Redundancy Check (CRC)

  • Append CRC at the end of the frame, such that the polynomial represented by the CRC included frame must be divisible by G(x)

  • The receiver checks whether the received frame is divisible by G(x), if no, then there has been a transmission error

Indian Institute of Technology Kharagpur

28 of 74

Error Detection Code – Cyclic Redundancy Check (CRC)

  1. Let r be the degree of G(x), append r zero bits to the low order end of the frame, so the frame contains m+r bits where m is the number of bits in the original frame. The polynomial corresponds to xrM(x)

  • Divide the bit string corresponds to xrM(x) by the bit string corresponding to G(x) using modulo 2 division

  • Subtract the remainder (which is always r bits or fewer) from the bit string corresponding to xrM(x) using modulo 2 subtraction. The result is the checksum frame to be transmitted
    • Subtraction is equivalent to XOR in modulo 2 arithmetic

Indian Institute of Technology Kharagpur

29 of 74

CRC – Example

A polynomial code with r check bits can detect all burst errors less than on equal to r

Indian Institute of Technology Kharagpur

30 of 74

Forward Error Correction (FEC)

  • Let a frame consists of m data bits and r check bits

  • Block codes: The r check bits are computed solely as a function of the m data bits

  • Linear codes: The r check bits are computed as a linear function of the m data bits, example: XOR with modulo 2 arithmetic

  • Error correcting codes – the r check bits that are sent with the data bits for correcting a single or multiple bit errors during the transmission

Indian Institute of Technology Kharagpur

31 of 74

Hamming Distance

  • The number of bit positions in which two codeword differs (Hamming, 1950)

  • Example

Codeword-1 11001101

Codeword-2 01001010

XOR 10000111

Hamming distance is 4

  • If two codewords are a Hamming distance d apart, it will require d single bit errors to convert one into another

Indian Institute of Technology Kharagpur

32 of 74

Hamming Distance for Error Detection

  • Number of possible m bit data messages 2m

  • Number of possible m+r codewords 2m+r – all the codewords are not valid codewords
    • We can have 2m different codewords corresponding to 2m different messages

  • To detect d bit errors, we need to ensure that the Hamming distance between two valid codewords is d+1

d

Indian Institute of Technology Kharagpur

33 of 74

Hamming Distance for Error Correction

  • We need to map every invalid codeword to a valid codeword

  • To correct d single-bit errors, the minimum Hamming distance between two codewords should be at least 2d+1

d

d

2d + 1

Indian Institute of Technology Kharagpur

34 of 74

Hamming Distance for Error Correction - Example

  • Consider the four codewords
    • 0000000000
    • 0000011111
    • 1111100000
    • 1111111111
  • The hamming distance is 5 – we can correct single and double bit errors

  • If the received codeword is 1010100000, we can expect the original codeword be 1111100000

  • Say you have received 1010000000, and there are maximum three bit errors, guess the original codeword

Indian Institute of Technology Kharagpur

35 of 74

Hamming Codes - Encoding

  • Say the data is 1000001

  • 11 = 1 + 2 + 8
  • 10 = 2 +8
  • 9 = 1 + 8
  • 7 = 1 + 2 + 4
  • 6 = 2 + 4
  • 5 = 1 + 4
  • 3 = 1 + 2

P1

P2

M3

P4

M5

M6

M7

P8

M9

M10

M11

0

0

1

0

0

0

0

1

0

0

1

2x positions are for parity bits, rest for data bits

Gives a code with Hamming distance of 3

One bit error can be corrected

Indian Institute of Technology Kharagpur

36 of 74

Hamming Codes – Decoding with Single Bit Error

  • Single bit error in data bit

  • 11 = 1 + 2 + 8
  • 10 = 2 +8
  • 9 = 1 + 8
  • 7 = 1 + 2 + 4
  • 6 = 2 + 4
  • 5 = 1 + 4
  • 3 = 1 + 2

P1

P2

M3

P4

M5

M6

M7

P8

M9

M10

M11

0

0

1

0

1

0

0

1

0

0

1

Check the parity bits

We can find out an error in M5

Indian Institute of Technology Kharagpur

37 of 74

Hamming Codes – Decoding with Single Bit Error

  • Single bit error in parity bit

  • 11 = 1 + 2 + 8
  • 10 = 2 +8
  • 9 = 1 + 8
  • 7 = 1 + 2 + 4
  • 6 = 2 + 4
  • 5 = 1 + 4
  • 3 = 1 + 2

Check the parity bits

We can find out a mismatch at M7, M6 and M5

We can correct at most one bit error

P4 is the common parity bit – so the error is there

P1

P2

M3

P4

M5

M6

M7

P8

M9

M10

M11

0

0

1

1

0

0

0

1

0

0

1

Indian Institute of Technology Kharagpur

38 of 74

Framing

  • Identify a frame from the received bits

  • How do you you identify which part of the bit stream is a single frame?

  • Can you use a length field in the header?

00110101000100010

Indian Institute of Technology Kharagpur

39 of 74

Flag bits at the Beginning of the Frame

  • Start frame delimiter (SFD) and end frame delimiter (EFD)

  • A special bit sequence indicating beginning of a frame

  • EFD is deprecated and is not used now a days

  • Ethernet SFD: 10101011

  • Preamble: Synchronize the sender and the receiver – sequence of 10101010

Indian Institute of Technology Kharagpur

40 of 74

Ethernet Frame Structure

Indian Institute of Technology Kharagpur

41 of 74

Byte Stuffing (PPPoE)

  • 10101011 can also be a part of the payload

  • Solution: Insert a special escape byte (ESC) if the SFD is part of the data – used in Point to Point Protocol (PPP)

  • ESC can be part of the data as well – insert another ESC before the ESC

A

SFD

B

A

ESC

SFD

B

A

ESC

B

A

ESC

ESC

B

Indian Institute of Technology Kharagpur

42 of 74

Bit Stuffing (HDLC)

  • Byte stuffing has the overhead of one byte per ESC character

  • Use bit stuffing instead of byte stuffing – implemented in High-level Data Link Control (HDLC) protocol

  • In HDLC, each frame begins and ends with 01111110 (called FLAG byte)

  • Six consecutive 1’s in the data can get confused with this FLAG byte

  • Stuff a 0 bit if there is 5 consecutive 1’s in the data bit – transmit 011111010 instead of 01111110

Indian Institute of Technology Kharagpur

43 of 74

Bit Stuffing Example

Indian Institute of Technology Kharagpur

44 of 74

The Channel Allocation Problem

  • Many of the times, the media is a broadcast media

Devices are connected to a hub

A wireless Network

A Cellular Network

Indian Institute of Technology Kharagpur

45 of 74

Multiple Access Protocols

  • Single shared broadcast channel
  • Two or more simultaneous transmissions by nodes: interference
    • collision if node receives two or more signals at the same time
  • Distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit
  • Communication about channel sharing must use channel itself!
    • no out-of-band channel for coordination

Multiple access protocol

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

46 of 74

Static Channel Allocation

  • Frequency Division Multiple Access (FDMA):

  • Time Division Multiple Access (TDMA):

Indian Institute of Technology Kharagpur

47 of 74

Time Division Multiple Access (TDMA)

  • Access to channel in “rounds”
  • Each station gets fixed length slot (length = packet transmission time) in each round
  • Unused slots go idle
  • Example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle

1

3

4

1

3

4

6-slot

frame

6-slot

frame

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

48 of 74

Frequency Division Multiple Access (FDMA)

  • Channel spectrum divided into frequency bands
  • Each station assigned fixed frequency band
  • Unused transmission time in frequency bands go idle
  • Example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle

frequency bands

time

FDM cable

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

49 of 74

Dynamic Channel Allocation

  • Static Channel Allocation has multiple problems:
    • Resource wastage when the user is idle
    • Strong synchronization is necessary

  • Dynamically allocate channels to the end users whenever required – multiple access protocols

  • Probabilistic scheduling among devices or users - contention based systems
    • Schedule the nodes such that contention can be minimized

Indian Institute of Technology Kharagpur

50 of 74

Slotted ALOHA

Assumptions:

  • all frames are of same size
  • time divided into equal size slots (time to transmit 1 frame)
  • nodes start to transmit only slot beginning
  • nodes are synchronized
  • if 2 or more nodes transmit in slot, all nodes detect collision

Operation:

  • when node obtains fresh frame, transmits in next slot
    • if no collision: node can send new frame in next slot
    • if collision: node retransmits frame in each subsequent slot with probability p until success

randomization why?

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

51 of 74

Slotted ALOHA

Pros:

  • single active node can continuously transmit at full rate of channel
  • highly decentralized: only slots in nodes need to be in sync
  • simple

Cons:

  • collisions, wasting slots
  • idle slots
  • nodes may be able to detect collision in less than time to transmit packet
  • clock synchronization

1

1

1

1

2

3

2

2

3

3

node 1

node 2

node 3

C

C

C

S

S

S

E

E

E

C: collision

S: success

E: empty

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

52 of 74

Slotted ALOHA: Throughput

  • Let T be the frame time, i.e., the time required for 1 frame to be transmitted.
  • The probability that 𝑘 frames are generated during the frame time is given by the Poisson distribution: P(k) = Gk e−G/k! where G is the expected number of frames (transmission attempts) per frame time.
  • The probability that 0 frames are generated ( 𝑘 = 0 ) during the frame time is e−G
  • For slotted ALOHA, the vulnerable time period for collision between two frames is the time duration of 1 slot = 1 frame time 𝑇.

Indian Institute of Technology Kharagpur

53 of 74

Slotted ALOHA: Throughput

  • The probability that 0 frames are initiated in the vulnerable time period will be P(0) = e−G
  • The throughput, 𝑆, is calculated as the number of transmission attempts per frame time, 𝐺, multiplied by the probability of success, P(0)
  • S = G.P(0) or S = Ge−G
  • Maximum throughput of Slotted ALOHA occurs when G = 1.
  • The maximum throughput is thus Smax = 1×e−1 = 1/e = 0.368

Indian Institute of Technology Kharagpur

54 of 74

Pure ALOHA

  • Unslotted Aloha: simpler, no synchronization
    • when frame first arrives, transmit immediately
  • Collision probability increases with no synchronization:
    • frame sent at t0 collides with other frames sent in [t0-1,t0+1]

t0 + 1

t0 - 1

t0

will overlap

with end of

i’s frame

will overlap

with start of

i’s frame

  • Pure Aloha efficiency: 18% !
  • Half the efficiency compared to pure Aloha – check the Tanenbaum book for details.

Indian Institute of Technology Kharagpur

55 of 74

Multiple Access Protocol

  • Pure Aloha: Transmit the frame whenever you have one
    • Results in collision
    • The hub rebroadcast the frame ( works as an acknowledgement)
    • If the sender does not hear its frame within a timeout, retransmission the frame again

  • Slotted Aloha: Divide time into discrete interval called slots. Transmit the frame at the beginning of the next slot
    • The users need to agree on slot boundaries
    • Collision can still happen, retransmit after timeout
    • Doubles up the efficiency compared to pure Aloha – check the Tanenbaum book for details !

  • Best channel utilization with slotted aloha is 1/e (e=2.71828), approx. 36.7%

Indian Institute of Technology Kharagpur

56 of 74

Carrier Sense Multiple Access (CSMA)

  • Physical carrier sensing (PCS): Sense the carrier to see whether there is any ongoing signal.

  • If PCS returns the channel to be idle, the station sends data

  • Otherwise wait until the channel becomes idle

  • If collision occurs, wait for random amount of time and repeat the process

  • We call this as 1-persistent CSMA

Indian Institute of Technology Kharagpur

57 of 74

CSMA: collisions

  • Why collisions occur despite physical carrier sensing?
  • Due to propagation delay, two nodes may not hear each other’s just-started transmission
  • Collision: entire packet transmission time wasted
  • Distance & propagation delay play role in determining collision probability

spatial layout of nodes

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

58 of 74

p-persistent CSMA

  • Divide the time to logical slots

  • When station is ready to send a frame, sense the channel (PCS)

  • If the channel is idle at the current slot, then transmit with probability p

  • With probability 1-p, target the next slot, and repeat the process

  • Non-persistent CSMA: If the channel is sensed busy through PCS, wait random amount of time, and then sense again

Indian Institute of Technology Kharagpur

59 of 74

Collision in CSMA (CSMA/CD)

  • Two stations may sense the channel idle at the same time, and starts transmission

  • A collision can happen in the channel – detect the collision
    • Collision signal will differ from the normal signal

  • Random Back-off: Wait for random amount of time if a collision is detected

  • Binary Exponential Back-off: At nth attempt, wait for time equivalent of random(0,2n-1) slots

Indian Institute of Technology Kharagpur

60 of 74

CSMA/CD

  • CSMA/CD reduces the amount of time wasted in collisions
  • Transmission aborted on collision detection

spatial layout of nodes

Source: Computer Networking: A Top-Down Approach (8th Ed) by Jim Kurose, Keith Ross

Indian Institute of Technology Kharagpur

61 of 74

Collision Detection and its Impact over MAC Frame Length

  • Worst case collision detection time = 2 x propagation delay

  • To detect a collision, the minimum frame transmission time should be equal to 2 x propagation delay (eg. Minimum Ethernet frame size = 64 bytes)

Indian Institute of Technology Kharagpur

62 of 74

Ethernet Performance - Contention Interval

  • Contention interval is the time when the channel bandwidth is not utilized due to collision

  • We need to estimate the probabilistic length of a contention interval

Indian Institute of Technology Kharagpur

63 of 74

Ethernet Performance

  •  

Indian Institute of Technology Kharagpur

64 of 74

Ethernet Performance

  •  

Indian Institute of Technology Kharagpur

65 of 74

Ethernet Performance

  •  

Image Source: Computer Networks, Tanenbaum

Indian Institute of Technology Kharagpur

66 of 74

Can You Detect Collision over Wireless?

  • Wireless Signal
    • Fading – Attenuation is high, Signal strength drops as the signal propagates
    • Shadowing – Gets affected by shadowed textures, like wall
    • Multipath Propagation – Reflected signals may come from different directions

  • Additive Interference: Signals from multiple sources gets added up and interfere with the communication of a third device
    • Individual signals may not enough for interference

  • Interference range is different from the transmission range

Indian Institute of Technology Kharagpur

67 of 74

Hidden Terminal Problem

Indian Institute of Technology Kharagpur

68 of 74

Exposed Terminal Problem

Indian Institute of Technology Kharagpur

69 of 74

Wireless Scenario

  • Collision detection is not feasible for wireless

  • How will detect a data loss due to interference?
    • Sender transmits a DATA
    • Receiver sends an ACK

  • Assume the frame to be lost, if ACK is not received within a predefined timeout.

Indian Institute of Technology Kharagpur

70 of 74

Virtual Carrier Sensing (VCS) – CSMA/CA

Image Source: Asymmetric RTS/CTS for Exposed Node Reduction in IEEE 802.11 Ad Hoc Networks

Request to Send (RTS)

Clear to Send (CTS)

Indian Institute of Technology Kharagpur

71 of 74

Setting up Network Allocation Vector (NAV)

Indian Institute of Technology Kharagpur

72 of 74

IEEE 802.11 Distributed Coordination Function (DCF)

  1. Set n = 0 /*n denotes the round number*/
  2. Use PCS (and VCS) to sense the channel
  3. If the channel is busy, repeat 2
  4. If the channel is idle for DIFS duration, transmit the frame, set timeout
  5. If ACK received within timeout, Go to 1
  6. If timeout, set CWmin = min (2xCWmin, CWmax)
  7. Set n = n+1
  8. Set CW = random (0, CWmin)
  9. Wait for CW number of slots and go to 2

Indian Institute of Technology Kharagpur

73 of 74

Virtual LAN (VLAN)

  • LAN is a broadcast domain
    • Every frame is a broadcast to all the machines connected in a switch port

  • VLAN
    • Construct a broadcast domain even if they are not a part of the switch port – use VLAN ID
    • Logical segmentation
    • Better security, Ex. Design policy such that only the nodes in a VLAN can communicate with each other

Image Source: https://www.cisco.com

Indian Institute of Technology Kharagpur

74 of 74

VLAN Support in 802.1Q

Indian Institute of Technology Kharagpur