0% found this document useful (0 votes)
16 views

Chapter 3 - Datalink Layer

Uploaded by

Seriyuu Hòa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Chapter 3 - Datalink Layer

Uploaded by

Seriyuu Hòa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as 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
adjacent elements.

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


School of Information and Communication Technology

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

l Two-dimension code 101011 101011


l Detect and correct single bit error 111100 101100
011101 011101
001010 001010

l 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
l Ex: D= 10101001
• <D, R> = D.2r XOR R l r= 3 bits
• Since <D, R> divides G then
l G=1001 G
• D.2r XOR R = n.G
• è D.2r = n.G XOR R 10101001000 1001
(associativity) 1001 D 1011110
• This means, R is the remainder of 1110
the division D.2r by G (division 1001
modulo 2) 1110
1001
1111
1001
R= D.2 mod G
r
1100
1001
R=110, the string to send is 1010
10101001110 1001
D R 110
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 data • Popular techniques:


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

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 p k t0

pkt0 is
AC K OK
rcv ACK
send pkt1 p k t1
pkt1 is
N AK corrupted

rcv NAK p k t1
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 p k t0
problem.
pkt0 is
• To eliminate repeated AC K OK
packet: Use Seq.# rcv ACK
send pkt1 p k t1
• All packets are assigned
Seq# before sending out. pkt1 is
Repeated packet has AC K OK
identical Seq#
rcv sth corrupted! p k t1
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
Sender Receiver • ACK packet carries
#Seq of the packet to
be acknowledged.
pkt0
send pkt0 This number is called
pkt0 is acknowledgment
ACK0 OK number
rcv ACK0
send pkt1
pkt1 • An ACK with
acknowledgment
ACK1 pkt1 is number n implicitly
OK
rcv ACK1 pkt2 pkt2 is corrupted
confirms that all
send pkt2 packet with #seq
number < =n have
ACK1
been well received
rcv ACK1 pkt2
resend pkt2

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/Taking turns:
• 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
timeà causing collision

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


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
b la h
blah
b la h b la h

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

l A “token” is passed from


one node to the other in T

a ring topo
l Only the token holder can
transmit data (nothing
l After finishing sending to send)
data, the token need to T
be passed to next nodes.
l Some problem
l Time consuming in passing
token
l 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

lRepeater, Hub, bridge and switch


lAll are LAN devices with many ports
lRepeater:
lRepeats the bits received in one port to the other
port
lOne network with repeaters = one collision domain
lRepeater is a physical layer system.
lHub:
lReceive the signal from one port (amplify ) and
forward to the remaining ports
lDo not offer services of datalink layer
lLayer 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.)

lBridge
lMore intelligent than hub
lCan store and forward data (Ethernet frame)
according to MAC address.
lBridge breaks the network into two collision
domains.
lLayer 2 intermediate system
lSwitch
lMore ports than bridge
lCan store and forward data according to
MAC address
l 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

Collision domains
bridge

hub hub

§ Bridges separate collision domains


§ a bridged LAN maybe much larger than a repeated LAN
Two§ ports
theresystems
may be several frames transmitted in parallel in a bridged
- Forward
LAN 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
• E.g. A-to-A’ and B-to- 1 2
B‘ without collision 6 3
• Each link is an independant 5 4
collision domain
• Switch has a table of MAC C
addresses showing which node
connects to which port B’ A’
• (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’
lSwitch learns the MAC
addresses of all hosts C’ B
connected to the switch
lEach time switch receive a 1 2
frame, it may update the 6 3
source MAC address of the frame 4
and corresponding connected 5
port
• if the address is not in MAC table C
• If the address is in the MAC table,
but the corresponding pỏt is B’
different to that in the table A’
lForwarding table
MAC addr interface TTL

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

lOutgoing port 1 2
unknown: Broadcast A6A’ 3
5 4
l 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

lSwitches could be connected to eachother

S4

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

l 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
e2

transmitter
Emetteur receiver
Récepteur
éter
eseau.donnerPaquet() Packet
Paquets Paquets
Packet
Trame(p)
ue.prendreTrame(t)
ue.attendreAquittement() frame
Trâme

Ack

éter
ysique.donnerTrame()
aquet(t) frame
Trâme
u.prendrePaquet(p)
ue.envoyerAcquittement()

frame
Trâme
Trâme

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


School of Information and Communication Technology

59
Conception et architectures des réseaux
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 leave
one station using medium for long time

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


School of Information and Communication Technology

61
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
e2 Transmission time with Stop-and-wait

transmitter
Emetteur receiver
Récepteur
éter
Packet
Paquets Packet
Paquets
eseau.donnerPaquet()
eTrame(p)
que.prendreTrame(t) T transmit
que.attendreAquittement() frame
Trâme

RTT Ack

éter
hysique.donnerTrame()
aquet(t) frame
Trâme
u.prendrePaquet(p)
que.envoyerAcquittement()

Trâme
frame
Trâme

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

Conception et architectures des réseaux


School of Information and Communication Technology
16
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

lIEEE 802 contains many standards for LAN


technology.
l802.3: Ethernet
l802.4: Token bus
l802.5: Token ring
l802.11 a/b/g/n: Wireless LAN (Wifi)
l802.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

l Datalink & Physical Layers


l Datalink= LLC + MAC
l MAC: CSMA/CD in classical Ethernet
l Several type of Ethernet
l Same MAC and frame structure
l Different rate: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps
l 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

l Bus topology was popular in the past


l All nodes share the same communication medium. Could used a
central hub for connecting nodes.
l Use CSMA/CD for media access control.
l Use Manchester encoding at Physical layer
lUse coaxial cable
lThick Ethernet: Max segment length 500m without
282
converter THE MEDIUM ACCESS CONTROL SUBLAYER CHAP. 4

lThin Ethernet: Max segment length 185m without converter

Transceiver
Interface
cable
Ether

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

Ref: Computer
Figure 4-13. Network,
Architecture ofTanenbaum
School of Information and Communication Technology
classic Ethernet.
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
l Switched Ethernet (popular nowdays):
l Star topology,
l Use a central switch Ethernet
l The switch outputs a frame only to the port linking to the
destination è independent connection for each pair of two nodes
l No collision
l 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

l Include base station =


Internet access point) and
stations with wireless
network interfaces
hub, switch l Base station mode
hay router l Basic Service Set (BSS)
AP
l wireless hosts
BSS 1 l access point (AP): base
AP station
l Ad hoc mode:
l Stations pay also the
TRƯỜNG CÔNG NGHỆ THÔNG TIN VÀ TRUYỀN THÔNG BSS 2
School of Information and Communication Technology
role of AP
85
Standards

l802.11b l802.11g
lBand 2.4-5 GHz (unlicensed lBand 2.4-5 GHz
spectrum) lMaximum speed 54
lMaximum speed 11 Mbps Mbps

l802.11a l802.11n: use multiple


antennas (MIMO)
lBand 5-6 GHz
lBand 2.4-5 GHz
lMaximum speed 54 Mbps
lMaximum speed 200
Mbps

l Employ CSMA/CA for multiple access control


l 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

lBand is divided into 14 chanels spaced 5MHz


apart. Europe uses 13 channels, America uses 11
channels, Japan uses 14 channels.
lAdmin chooses a working frequency for AP (may
leave AP to choose automatically)
lStation: need to connect to an AP
lScan channels, listen to initial frames (beacon frames)
containing the ID (SSID) and MAC address of the AP
lChoose 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
(2) H1 send a connection request to an 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 time then Sender Receiver
Send the entire frame (no CD)
2 if channel is busy then DIFS
Starting random back-off (waiting)
At the end of back-off time, send data
data
If no ACK is received, double the back-off
time and try again.
Receiver SIFS

- If receive well a frame then ACK


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
l Sender send frame RTS (request-to-send) to BS using CSMA
lRTS may meet a collision (with low probability because
the frame is short)
l BS broadcast the frame CTS (clear-to-send CTS) to answer
l All stations receive CTS
lSender send data frame
lAll 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)

C T S (A ) C T S (A )

DATA (A)
defer

time
A C K (A ) A C K (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 using • Data is transmitted in
the same frequency with different frequency than
voice à either data or voice, technology used in
voice communication 2000-2010
available • Technology using TV cable
• Obsolete technology, • FTTH technology:
used before 2000
• 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 serves
FTTC (Fiber To The Curb) / FTTB(Fiber To The Building);
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