0% found this document useful (0 votes)
7 views108 pages

Chapter 3 - Datalink Layer - 4.4m

Chapter 3 discusses the functionalities and responsibilities of the data link layer, including encapsulation, addressing, error detection and correction, flow control, and media access control. It also covers the architecture of the data link layer, types of network nodes and links, and various error control mechanisms such as parity codes, checksums, and cyclic redundancy checks (CRC). Additionally, the chapter outlines different media access control protocols and their classifications, including channel division and random access methods.

Uploaded by

Hưng Đinh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views108 pages

Chapter 3 - Datalink Layer - 4.4m

Chapter 3 discusses the functionalities and responsibilities of the data link layer, including encapsulation, addressing, error detection and correction, flow control, and media access control. It also covers the architecture of the data link layer, types of network nodes and links, and various error control mechanisms such as parity codes, checksums, and cyclic redundancy checks (CRC). Additionally, the chapter outlines different media access control protocols and their classifications, including channel division and random access methods.

Uploaded by

Hưng Đinh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 108

Chapter 3:

Datalink layer
• Functionalities:
• Encapsulation, addressing
• Error detection and
correction
• Flow control
• Media access control

1
Overview of Data link layer

2
Network nodes and links

“link”
• Network nodes:
• PCs, Laptop, Routers,
Server…
• Links:
• Communication chanel
between adjacent
nodes
• Wired link: Ethernet
LAN, ADSL, fiber
optic…
• Wireless link: Wi-fi,
FSO, Satellite,…
• Datalink layer
responsibility:
• Transmit data between
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

adjacent elements. 3
Datalink layer in Layer architecture

Application Media independent


sub-layer
Transport

Network LLC
(Logical Link Control)
Data-link
MAC
Physical (Media Access Control) Media dependent sub-
layer

802.2 LLC

802.3 802.4 802.5 802.11 ….. 802.16


Ethernet Token Bus Token Ring Wi-Fi Wi-Max

IEEE 802.x series


TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

4
Functionalities

Framing Flow control

Media Access Control

Addressing Error control

Datalink layer

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

5
Functionalities

• Framing:
• Sender: place the network layer packet into
the frame, add header, tail
• Receiver: Remove the header, tail for
extracting the network packet.

• Addressing:
• Physical address in the header of the frame
for identifying the source and the destination.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

6
Framing-Example of HDLC frame

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

7
Functionalities (2)

• Media access control:


• If the nodes in the network share common
media, a Media access control protocol is
required.
• Flow control:
• Control the transmission speed of the sender
so that the receiver does not overloaded.
• Error control:
• Detect and correct errors
• e.g. parity check, checksum, CRC check

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

8
Error control
• Error detection
• Error correction

9
Principle of error detection

EDC= Error Detection Code (redundancy)


EDC is added to data before sending to the destination.

Data Data
Y
Error
All bit in Data’
OK?
N

Data EDC Data’ EDC’

Link with bit errors

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

10
Principal of error detection

• Condition for all error detection


• fedc(Dsend) != fedc (Dreceive) ∀ Dsend != Dreceive
• Space of codes (number of possible codes)
must at least equals to space of data
(number of possible data)
•  code length (bits) >= data length (bits)
• Transmission efficiency <= %50

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

11
Parity code

A check bit is added to the original data to ensure that the


total number of bit 1 is even (even parity code) or odd (odd
parity code)
• Single code
• Able to detect single bit error

 Two-dimension code 101011 101011


 Detect and correct single bit error 111100 101100
011101 011101
001010 001010
 Application: mainly on hardware, ex: while sending data
on PCI and SCSI bus
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
12
Parity code

• Sent data with Odd code:


• 01010101 Code: 1
• Case 1: Received data 01110101 Received code: 1
•  Total number of 1 : 6 even number Code does not
match with data
•  Error
• Case 2: Received data 01110100 Received code: 1
• Total number of bit 1  5 code matches with data
•  No error
• Data of m bit long space of data is 2^m 
expected to have different code for different data
 codes must be >=m bit long.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

13
Checksum code

• Sender:
• Divides data into small parts of n bit
• Calculates binary sum of all parts. If there are some
overflow bit, add the overflow bit to the result.
• Alters all bits (two’s complement) to get the checksum
• Sends the checksum with data
• Receiver:
• Extracts data and checksum
• Divides data into block of n bits
• Calculates the sum as in the sender side including with
the checksum received
• If result contains at least one bit 0 error.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

14
Checksum: Example

Data: 0011 0110 1000


Calculate checksum 4 bit:
0011
+ 0110
1000
Overflow
10001
bit 1
0010
Alter bit -> checksum code: 1101
Bits to send: 0011 0110 1000 1101

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

15
Checksum: Processing on
receiver

Bits received: 0011 0110 1000 1101


Verification:
0011
0110
+ 1000
1101
11110
Overflow
bit
1
1111  no bit error

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

16
CRC: Cyclic Redundancy Check

• Data is considered as a binary string: D


• We wants to generate a error code with length r
• Choose another binary string of (r+1) bit, G (Generator)
• Find a string R with length r bits such that the concatenation of D
and R is a binary number that divides G (modulo 2)
• <D, R> divides G

D D
Y
N
<D’, R’> mod G = 0 ?
<D, R> mod G = 0

D R D’ R’

Link with bit errors


17

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
CRC: How to find R
 Ex: D= 10101001
• <D, R> = D.2r XOR R  r= 3 bits
• Since <D, R> divides G then  G=1001 G
• D.2 XOR R = n.G
r

•  D.2r = n.G XOR R 10101001000 1001


(associativity) 1001 D 1011110
1110
• This means, R is the
1001
remainder of the division D.2r
by G (division modulo 2) 1110
1001
1111
1001
R= D.2r mod G 1100
1001
R=110, the string to send is
1010
10101001110 1001
110
D R
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
R
18
CRC under polynomial form
• 1011 > x3 +x +1
• Example of some CRC generators using in the
pratice:
• CRC-8 = x8 + x2 + x + 1
• CRC-12 = x12+x11+x3+x2+x
• CRC-16-CCITT = x16 + x12 + x5 + 1
• CRC-32 = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 +
x8 + x7 + x5 + x4 + x2 + x + 1
• The longer G is, the more possible that CRC
detects errors.
• CRC is widely used in the practice
• Wi-fi, ATM, Ethernet…
• Operation XOR is implemented in hardware
• Capable to detect less than r+1 bits errors
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

19
Reaction when errors detected

• Objective: to assure that • Popular techniques:


data are received correctly • Error detection (as we seen)
even though the chanel is • Acknowledgement/
confirmation
not realiable.
• Retransmis after a clear
• Constraint confirmation that frame is
not arrived
• Data frame must be • Retransmis after timeout
correctly received
• Negligible transmission • ARQ technique: automatic
delay.
repeat request). There are 3
versions:
• Possible errors • Stop and Wait ARQ
• Whole frame loss • Go Back N ARQ
• Selective Reject ARQ
• Error frame
• Loss of error warning • Similar to techniques used in
message flow control.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

20
Stop-and-wait ARQ
Normal case
Sender Receiver

send pkt0 pkt0

pkt0 is OK
ACK
rcv ACK
send pkt1 pkt1
pkt1 is
NAK corrupted

rcv NAK pkt1


resend pkt1

Time
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
21
Stop-and-wait ARQ
Error ACK/NAK
Sender Receiver
• ACK error, resend the
previous packet
• Duplicated packets send pkt0 pkt0
problem.
pkt0 is OK
• To eliminate repeated ACK
packet: Use Seq.# rcv ACK
send pkt1 pkt1
• All packets are
assigned Seq# before pkt1 is OK
sending out. Repeated ACK
packet has identical
Seq# rcv sth corrupted! pkt1
resend pkt1 rcv pkt1
duplicate,
Time discard it
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
22
Stop-and-wait ARQ
not using NAK
• ACK packet carries
Sender Receiver
#Seq of the packet
to be
send pkt0
pk t 0 acknowledged.
This number is
pkt0 is OK
ACK0 called
rcv ACK0
acknowledgment
pk t 1
send pkt1 number
ACK1 pkt1 is OK • An ACK with
acknowledgment
rcv ACK1 pk t 2 pkt2 is corrupted number n
send pkt2
implicitly confirms
ACK1 that all packet with
rcv ACK1 pk t 2
#seq number <
resend pkt2 =n have been well
received
Time
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

23
Stop-and-wait ARQ: When ACK is lost

• Data packet and ACK packet may be lost


• No ACK is received at sender side
• How a sender decides to resends data or not?
• Solution:
• After sending out a packet, sender starts a timer specifying
maximum waiting time (timeout) for an ACK of the packet.
• When timeout expired sender re-sends the packet
• How long a Timeout should be?
• At least 1 RTT (Round Trip Time)
• If a packet arrives at the destination but its ACK is lost,
the packet is still resent because associated timeout
expired.
• The duplicated packets are eliminated at the receiver side
according to repeated #seq.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
24
ARQ with timeout

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

25
ARQ with timeout

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

26
Media access control

27
Connection types

• Point-to-point
• ADSL
• Telephone modem
• Leased Line….
• Broadcast
• LAN using bus topology
• Wireless LAN
• HFC:
• …
• Broadcast networks need media access
control protocol in order to avoid collision
when nodes try to send data.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

28
Classification of MAC protocol
• Chanel division:
• Resources of the media is divided into small parts
(time - TDMA, frequency- FDMA, Code- CDMA)
• Distribute a part to each nodes
• Random access:
• Chanel is not divided; all nodes are allowed to
access simultaneously with collision possibility
• Need a mechanism to avoid collision
• e.g. Pure Aloha, Slotted Aloha, CSMA/CD, CSMA/CA…
• Sequent access:
• Nodes can send data one after the other.
• Token Ring, Token Bus….

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

29
Channel division

• FDMA: frequency division multiple access


• TDMA: time division multiple access
• CDMA: code division multiple access

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

30
TDMA và FDMA

example
4 stations
FDMA

frequency

time
TDMA:

frequency

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
time
31
CDMA

• Several senders can share the same frequency


on a single physical channel.
• Signals come from different senders are encoded
(multiplied) with different random code. Those
code must be orthogonal.
• Encoded signals are mixed and then transmit on
a common frequency.
• The signals are recovered at the receiver by
using finding the correlation with the same codes
as at sender side.
• CDMA shows a lot of advantages that other
technology cannot achieve. For example, the
same frequency can be used in adjacent mobile
cell without interference as if TDMA or FDMA are
used
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

32
CDMA

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

33
Random access: Pure Aloha

• Aloha is used in mobile network


of 1G, 2.5G, 3G using GSM
technology .
• Pure Aloha:
• When one sender has data to send,
just sends it
• If while sending, the senders
receive data from other stations 
there is collision. All stations need
to resend their data.
• There are possibility to have
collision when retransmit.
• Problem: Sender does not check to
see if the chanel is free before
sending data
• Grey package are having overlap in
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG

time causing collision


School of Information and Communication Technology

35
Random access: Slotted Aloha

• Times axe is divided into


equal slots.
• Each station sends data
only at the beginning of a
time slot.
•  Collision possibility is
reduced
• Still have collision in grey
package

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

36
Random access: CSMA

• CSMA: Carrier Sense Multiple Access


• CSMA idea is similar to what happens in a
meeting.
• CSMA:
• The sender “Listen before talk”
• If the channel is busy, wait
• If the chanel is free, transmit
blah
blah
blah blah

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

37
CSMA

• CSMA: Sender listens before transmission:


• If the channel is free, send all the data
• If the channel is busy, wait.
• Why there are still collision?
• Due to propagation delay

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

38
Collision in CSMA

• Assume that there are 4


nodes in the channel
• The propagation of the
signal from one node to
the other requires a
certain delay.
• Ex:
• Transmissions from B and
D cause collision

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

39
CSMA/CA (Collision Avoidance)

• CSMA/CA is used WIFI standard IEEE 802.11


• If two stations discover that the channel is
busy, and both wait then it is possible that
they will try to resend data in the same time.
•  collision
• Solution CSMA/CA.
• Each station wait for a random period  reduce the
collision possibility

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

40
CSMA/CD

• Used in Ethernet
• CSMA with Collision Detection:
• “Listen while talk”.
• A sender listen to the channel,
• If the channel is free then transmit data
• While a station transmit data, it listens to the channel. If it
detects a collision then transmits a short signal warning the
collision then stop
• Do not continue the transmission even in collision as CSMA
• If the channel is busy, wait then transmit with
probability p
• Retransmit after a random waiting time.
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

41
Comparison between channel division and random access

• Channel division
• Efficient, treat stations equally.
• Waste of resources if one station has much
smaller data to send than the others
• Random access
• When total load is small: Efficient since each
station can use the whole chanel
• When total load is large: Collision possibility
increases.
• Token control: compromise between the two
above methods.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

42
Token Ring

 A “token” is passed from


T
one node to the other in
a ring topo
 Only the token holder can
transmit data (nothing
 After finishing sending to send)
data, the token need to T
be passed to next nodes.
 Some problem
 Time consuming in passing
token
 Loss of token due to some
reasons data
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

43
Summary on Media access control mechanisms

• Channel division
• Random access
• Token
• What do you thinks about their
advantages and weaknesses ?

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

44
Point-to-Point
forwarding mechanism
Hub, Switch, Bridge

45
Devices of LAN

Repeater, Hub, bridge and switch


All are LAN devices with many ports
Repeater:
Repeats the bits received in one port to the
other port
One network with repeaters = one collision
domain
Repeater is a physical layer system.
Hub:
Receive the signal from one port (amplify )
and forward to the remaining ports
Do not offer services of datalink layer
Layer 1 intermediate system
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

46
Hub

Hub=Multiple port repeater


Single collision domain

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

47
Devices of LAN (cont.)

Bridge
More intelligent than hub
Can store and forward data (Ethernet frame)
according to MAC address.
Bridge breaks the network into two collision
domains.
Layer 2 intermediate system
Switch
More ports than bridge
Can store and forward data according
to MAC address
Receive full frame, check error, forward

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

48
Bridge

Two ports systems


- Forward frames from one port to the other based on MAC address
- Create two collision domains
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

49
Switch

• Allows multiple node pairs C’ B


sending data in the same
time 1 2
• E.g. A-to-A’ and B-to-B‘ 6 3
without collision 5 4
• Each link is an
independant collision C
domain
• Switch has a table of MAC B’ A’
addresses showing which
node connects to which port
• (MAC address of host, port
index, TTL)
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

50
Switch: Self learning mechanism
Source: A
Dest: A’

A A A’
Switch learns the MAC
addresses of all hosts C’ B
connected to the switch
Each time switch receive 1 2
6 3
a frame, it may update the
source MAC address of the 5 4
frame and corresponding
connected port C
• if the address is not in MAC
table
B’ A’
• If the address is in the MAC
table, but the corresponding pỏt
is different to that in the table
MAC addr interface TTL
Forwarding table
A 1 60

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

51
Switch: forwarding mechanism

When receiving a frame


1. The incoming port and MAC associated is learnt
2. Looking for outgoing port based on destination MAC and
forwarding table
3. if outgoing port is found
then {
if incomming port== outgoing port
then destroy the frame
else forward the frame to outgoing port
}
else broacast the frame

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

52
Source: A
Dest: A’
Ex: A A A’

C’ B

Outgoing port 1 2
unknown: Broadcast A6A’ 3
5 4
 Know A:
C
A’ A
Direct transfering
B’ A’

MAC addr interface TTL


A 1 60 Forwarding table
A’ 4 60 (empty initially)

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

53
Connecting switches in cascade
Switches could be connected to eachother

S4

S1
S3
A S2
F
D I
B C
G H
E

 Switches in cascade use also self learning


mechanism
● A sends a frame to I, S1 learns the address of A and connected
port, broadcasts the frame to: B, C, S4
● S4: learns A from S1, broadcasts the frame to: S2, S3
● S3: learns A from S4, broadcasts the frame to: G, H, I
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

54
A typical LAN

mail server
Connect to
outside
router web server

IP subnet

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

55
Flow control

56
What is flow control

• Goal: Make sure that the sender does not overload the
receiver
• Why overloading?
• The receiver stores data frame in buffer.
• Receiver performs some processing before deliver data to the
upper level.
• Buffer could be full, leaving no space for receiving more frame
 some data fram must be dropped.
• Problem of errors in transmission is excluded
• All frames are transmitted to correct receiver without error
• Propagation time is small and could be ignored
• Solution
• Stop-and-wait mechanism
• Sliding window mechanism

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

57
Stop-and-wait

• Principles
• Transmitter sends a single frame
• Receiver receives the fram, process and then
informs the transmitter that it is ready to
receives next frames by a clear
acknowledgement (ACK).
• Transmitter waits until reception of the ACK
before sending next frames.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

58
Stop-and-wait

transmitter receiver
Packet Packet

frame

frame

frame

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

59
Stop-and-wait

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

60
Stop-and-wait

• Advantage
• Simple, suitable for transmission of big
size frames
• Weakness
• When frames are small, the
transmission chanel are not used
efficiently.
• Cannot use often for big size frame
due to
• Limitation in buffer size
• Big size frame prones to bigger error
probability
• In shared medium, it is not convenient to
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG

leave one station using medium for long 61


School of Information and Communication Technology
Sliding window: principle
• Transmitter sends more than one frame without waiting in
order to reduce waiting time
• Transmitted frame without ACK stored in a buffer of the
transmitter.
• Frame arrives to receiver  put in buffered and get out
one by one for processing and send back ACK/NAK
• Buffer of transmitter = buffer of receiver
• Number of frames to be transmitted without ACK depends
on the size of free buffer
• When transmitter receives ACK, it realises the succesfully
transmitted frame from buffers
• Transmitter continues sending a number of frame
equivalent to the number of succesfully trasmitted
frames.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

62
Sliding window: principle

• Assume that A and B are two stations connected


by a full duplex media
• B has a buffer size of n frame.
• B can receives n frame without sending ACK
• Acknowledgement
• In order to keep track of ACKed frames. It is
neccessary to number frames.
• B acknowledge a frame by telling A which fram B is
waiting for (by number of frame), implicitely saying
that B receives well all other frame before that.
• One ACK frame serves for acknowledes several
frames.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

63
Sliding windows: principle

Window list the frames to transmit


TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
Window list the frames in waiting to receive
64
Sliding windows

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

65
Sliding windows

• Frame are numbered. The maximum number


must not be smaller than the size of the
window.
• Frame are ACKed by another message with
number
• Accumulated ACK: If frame 1,2,3,4 are well
receive, just send ACK 4
• ACK with number k means all frame k-1, k-2
…already well received.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

66
Sliding windows

• Transmitter needs to manage some


information:
• List of frames transmitted sucessfully
• List of frames transmitted without ACK
• List of frames to be sent immediatly
• List of frames NOT to be sent immediately
• Receiver keep tracks of
• List of frames well received
• List of frames expected to receive

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

67
Piggyback

• A and B transmit data in both sides


• When B needs to send an ACK while still
needs to send data, B attaches the ACK in
the Data frame Piggyback
• Otherwise, B can send an ACK frame
separately
• After ACK, if B sends some other data, it still
puts the ACK information in data frame.
• Sliding window is much more efficient than
Stop-and-Wait
• More complicated in management.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

68
Exercices

• Given a link with rate R=100Mbps


• We need to send a file over data link layer with file size
L=100KB
• Assume that the size of a frame is: 1KB, header size is
ignored
• Round trip time (RTT) between 2 ends of the link is 3ms
• An ACK message is sent back from receiver whenever a
frame is arrived. Size of ACK message is negligible
• What is the transmission time required if using Stop-and-
wait mechanism?
• Transmission time with sliding window if the window size is
=7?
• Which size of window allow to obtain the fastest
transmission?
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

69
Transmission time with Stop-
and-wait
transmitter receiver
Packet Packet

T transmit
frame

RTT

frame

frame

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

70
Transmission time with Stop-and-wait

• T total= Nb.frame * (T_transmit + RTT)


• T_transmit (F) = L(Frame)/ R
• Nb. frame = L/L(frame)

• With the given parametters


• Nb. frame =100 KB/1KB =100
• T_transmit (F) = 1KB/100 Mbps
=10^3*8/10^8 =8. 10^-5 (s)=0.08 (ms)

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

71
Transmission schema with Sliding windows

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

72
Trasmission time with window
size 7
• T fastest= (T transmit 7 frames+ wait) *
Nb. Waiting time.
• 1 waiting= (T transmit 1 frame+ RTT) – T
transmit 7 frames
• Nb. Waiting time= Nb frame /7

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

73
Fastest transmission time with sliding window

• Fastest transmission time


obtained if transmitter
receives ACK of the first
W gói frame when it finishes
ACK transmitting the last frame
of the sliding window.
• Window size:W
• T transmit(W fram) >= T
transmit first frame + RTT

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

74
Fastest transmission time with sliding window

• T transmit (W frame) = W * 1KB/R


• => (W-1)*1KB/R >= RTT
• => W >= RTT*R/1KB +1
• W>= 3ms * 100 Mbps/ 1KB + 1
• W>=38.5
• Smallest value of W = 39
• Time to transmit all data L = L/R + RTT
=8 ms +3ms =11 ms

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

75
LAN: Local Area Network
Reading: 4.3 Computer Networks,
Tanenbaum

76
LAN topology

WLAN

Traditional bus
topo

hub, switch

Ring
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology Star
77
LAN Standards

IEEE 802 contains many standards for


LAN technology.
802.3: Ethernet
802.4: Token bus
802.5: Token ring
802.11 a/b/g/n: Wireless LAN (Wifi)
802.16: WiMax.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

78
Ethernet LAN

• Layer 2 technology for communication in LAN, invented in


1976
• Standardized in IEEE 802.3
• Ethernet LAN could have different speeds: 3 Mbps – 10 Gbps
• Ethernet: 10BaseT, 10Base2…
• Fast Ethernet: 100BaseT
• Giga Ethernet

Metcalfe’s Ethernet
sketch

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

79
IEEE 802.3 and Ethernet Standards

Datalink & Physical Layers


Datalink= LLC + MAC
MAC: CSMA/CD in classical Ethernet
Several type of Ethernet
 Same MAC and frame structure
Different rate: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G
bps
Different cable: Optical fiber, coaxial, twisted pair

MAC protocol
application and frame format
transport
network 100BASE-TX 100BASE-T2 100BASE-FX
link 100BASE-T4 100BASE-SX 100BASE-BX
physical

copper (twister fiber physical layer


TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology pair) physical layer
80
Classical Ethernet

Bus topology was popular in the past


All nodes share the same communication medium. Could
used a central hub for connecting nodes.
Use CSMA/CD for media access control.
Use Manchester encoding at Physical layer
Use coaxial cable
Thick Ethernet: Max segment length 500m without
converter
Thin Ethernet: Max segment length 185m without
converter

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG

Ref: Computer Network, Tanenbaum


School of Information and Communication Technology

81
Structure of Ethernet frame

• Preamble: Marking the starting of a frame


• Address: Physical addresses of source and
destination
• 6 bytes
• Type: Uppper layer protocol (IP, Novell IPX,
AppleTalk, …)
• Checksum: Error detection code. CRC

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

82
Switched Ethernet
Switched Ethernet (popular nowdays):
Star topology,
Use a central switch Ethernet
The switch outputs a frame only to the port linking to the
destination  independent connection for each pair of two
nodes
No collision
No media access control is needed.

switch

bus: coaxial cable


star
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

83
Wireless LAN

84
Overview of 802.11 LAN

 Include base station =


Internet access point) and
stations with wireless
network interfaces
hub, switch
 Base station mode
hay router  Basic Service Set (BSS)
AP
 wireless hosts

BSS 1  access point (AP): base

AP station
 Ad hoc mode:
 Stations pay also the

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG BSS 2


role of AP
School of Information and Communication Technology

85
Standards

802.11b 802.11g
Band 2.4-5 GHz Band 2.4-5 GHz
(unlicensed spectrum) Maximum speed 54
Maximum speed 11 Mbps Mbps
802.11a 802.11n: use multiple
Band 5-6 GHz antennas (MIMO)
Band 2.4-5 GHz
Maximum speed 54 Mbps
Maximum speed 200
Mbps

 Employ CSMA/CA for multiple access control


 Working in 2 modes : base-station and ad hoc
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

86
802.11: Chanel and connection

Band is divided into 14 chanels spaced


5MHz apart. Europe uses 13 channels,
America uses 11 channels, Japan uses 14
channels.
Admin chooses a working frequency for AP
(may leave AP to choose automatically)
Station: need to connect to an AP
Scan channels, listen to initial frames
(beacon frames) containing the ID (SSID) and
MAC address of the AP
Choose one AP.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

87
802.11: Chanel and connection

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

88
Scanning mechanism: active/passive

BBS 1 BBS 2 BBS 1 BBS 2

AP 1 AP 2 AP 1 1 AP 2
1 1 2 2
2 3
3 4

H1 H1

Passive Scanning: Active Scanning:


(1) Beacon frames are sent from APs (1) H1 broacast the request to find an
(2) H1 send a connection request to AP
AP2 (2) APs reply with their information
(3) AP2 accepts the request (3) H1 send a connection request to
AP2
(4) AP2 accepts the requests

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

89
IEEE 802.11: Multiple access
control

• 802.11: CSMA
• 802.11: CA – Collision Avoidance
• It is difficult to implement Collision detection (CD)
in wireless environment.
• In some cases, it is even impossible to detect the
collision : hidden terminal, fading

A B C
C
A’s signal C’s signal
B strength strength
A

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


space
School of Information and Communication Technology

90
IEEE 802.11 MAC Protocol:
CSMA/CA

Sender
1 If the channel is available during DIFS Sender Receiver
time then
Send the entire frame (no CD) DIFS
2 if channel is busy then
Starting random back-off (waiting)
data
At the end of back-off time, send data
If no ACK is received, double the back-
off time and try again.
SIFS
Receiver
ACK
- If receive well a frame then
reply by an ACK after SIFS

DIFS: Distributed Inter Frame Space


TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology Why need ACK?
SIFS: Short Inter Frame Space 91
Avoid Collision mechanism

Idea: Sender can reserve channel without random access


avoid collision for long frame
Sender send frame RTS (request-to-send) to BS using
CSMA
RTS may meet a collision (with low probability
because the frame is short)
BS broadcast the frame CTS (clear-to-send CTS) to answer
All stations receive CTS
Sender send data frame
All other stations has to cancel the intention to send
frames.

Avoid collision thanks to the reservation


made by small size control frames
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

92
Collision Avoidance using RTS-CTS

A B
AP

RTS(A) RTS(B)

reservation collision
RTS(A)

CTS(A) CTS(A)

DATA (A)
defer

time
ACK(A) ACK(A)

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

93
802.11 frame: Addressing

2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4

Address 4: Using in
adhoc mode
Address 1: address of
the destination Address 3: MAC address of
the router attached to the
AP
Address 2: address of the source

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

94
802.11 frame: Addressing

Internet
H1 R1 router
AP

R1 MAC addr AP MAC addr


dest. address source address

802.3 frame

AP MAC addr H1 MAC addr R1 MAC addr


address 1 address 2 address 3

802.11 frame
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

95
802.11 frame
frame seq #
Duration of the reservation (RTS/CTS) (ACK)

2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4

2 2 4 1 1 1 1 1 1 1 1
Protocol To From More Power More
Type Subtype Retry WEP Rsvd
version AP AP frag mgt data

frame type
(RTS, CTS, ACK, data)
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology

96
Access networks using optical
fiber
Access networks

• Access networks gather data from users


to feed to core network
• Popular access networks for providing
services to users
– Public telephone network
– TV Cable network
– Internet to home network.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
Architecture of access network

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
Architecture of access network

• Hub
– Device on the service provider side
receiving data
• Network Interface Unit (NIU)
– Device on the user side connecting an
user or an organization
• Remote Node (RN)
– In broadcasting networks, RN distribute
data from Hub to NIUs
– In switched networks, RN receive data
from Hub and distribute different flows to
NIUs
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
Technologies for connecting to ISP using
cable

• Dial-up: • ADSL technology:


• speed 56kbps, • Speed few Mbps,
• Using telephone line • Using telephone line
• Data is transmitted • Data is transmitted in
using the same different frequency
frequency with voice than voice,
 either data or voice technology used in
communication 2000-2010
available • Technology using TV
• Obsolete technology, cable
used before 2000
• FTTH technology:
• Speed dozens Mbps,
• Using optical fiber
• Popular technology
nowadays

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

101
Optical access network: FTTx

• Data is distributed on the fiber cable in the


distribution network until ONU (Optical Network
Unit)
– Expectation: fiber approaches the customers
• FTTCab (Fiber To The Cabinet):
Optical fiber ends at a
cabinet in less than 1 km distance to the subscriber
using copper cable.
• ONU
FTTC (Fiber To The Curb) / FTTB(Fiber To The Building);
serves some subscribers (8 to 64); from ONU to NIU
using copper cable (< 100m)
• FTTH (Fiber To The Home); ONUs performs the
functionality of NIUs;

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
Optical access network: FTTx

An example of ONU: optical modem


Figure taken from book Optical Networks: A Practical Perspective, Rajiv Ramaswami, Kumar
Sivarajan
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG
School of Information and Communication Technology
Optical access networks: FTTx

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
AON vs. PON

Remote Note (Distribution nodes) distribute


data toward destinations.

AON: Active Optical Network


-Remote Node consume electricity
-Remote node analyse and forward packets to
destination according to addresses
-Cable distance can go up to 100 km.

PON: Passive Optical Network


-Remote Node does not consume electricity
-Remote node (Splitter) does not analyze but
repeat signal to all out ports
-Upstream: MUX from different sources using
TDM (TDM PON) or WDM (WDM PON)
-Cable distance is limited within 20km

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
EPON: Ethernet PON

• EPON: PON transport Ethernet frames


• Down stream
• Broadcast common data

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
EPON

• Upstream: Mux Ethernet frames


from users to the common link OLT-
RN using TDM

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology
GPON: Gigabit Capable PON

• GPON may be used to carry different


data: Ethernet, ATM, voice …
• Data from OLT to users share common
chanel between OLT or RN
• Downstream broadcast
• Upstream TDM
• Data are encapsulated in GPON frames with
ID of the receiver (downstream direction),
sender (upstream direction)

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

108
WPON (WDM PON)
• Developed by compagnies and has not been
standardized
• Each ONT use a wavelength to transmit data
• Remote note is AWG (arrayed waveguide grating). The
AWG is capable to MUX/DEMUX wavelengths from up and
down streams.

TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG


School of Information and Communication Technology

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy