FIT1047 – Week 8
Networks: Physical and Data Link layers
FIT1047
Goals for this week
• Understand how messages can be transmitted over physical media such as copper cables, optical fibers or radio waves
• Look at Media Access Control (Data Link layer): when is a device allowed to transmit?
• Study the basic structure of Ethernet and WiFi networks
FIT1047
2
Basic LAN components
Client computer Network interface
card (NIC) Switch
Network cable
Server
NIC
FIT1047
3
Network interface card (NIC)
Implements physical and data link layer
• includes unique data link layer address (MAC address)
• provides physical connection to the network (socket or antenna)
• implements protocols (error detection, construction of frames, modulation or encoding etc)
Connection to the computer
• often built into motherboards
• or connected via USB, PCI Express etc
FIT1047
4
Network interface card (NIC)
FIT1047
5
Flux Question Newest NIC?
1
34
2
FIT1047
6
Flux Question Most expensive NIC?
1
34
2
FIT1047
7
Network Cables
Physical connection between network devices
Different types:
• UTP (unshielded twisted pair, most common type for LAN)
• STP (shielded twisted pair)
• Optical fiber (not yet common in LANs)
• Coaxial (only old LANs) https://itel.com/understanding-network-cables/
FIT1047
8
Network Cables
Name
10BASE-T
100BASE-T
1000BASE-T
Data Rate
10Mbps
100Mbps
1Gbps
Cables
UTP cat 3 / cat 5
UTP cat 5
UTP cat 5e, 6
1000BASE-X 1Gbps
optic fiber (single mode or multi- mode)
10GbE
40GbE
10Gbps
40Gbps
UTP 6, 7, optic fiber
optic fiber
FIT1047
9
Physical layer
FIT1047
Physical media
• We transmit information using physical signals
• A signal travels through a medium:
• electrical signals through e.g. copper wires
• radio waves through “air” (or, really, space)
• light signals through space or optical fibres
FIT1047
11
Digital vs Analog
• Digital data:
• Discrete values (e.g. 0 and 1, or characters in the
alphabet)
• Discrete step from one symbol to the next
• Analog data:
• Range of possible values (e.g. temperature, air
pressure)
• Continuous variation over time
FIT1047
12
Digital vs Analog
• Digital signal:
• Waveform with limited number of discrete states
• Analog signal:
• Continuous, often sinusoidal wave
• E.g. sound (pressure wave in air), light and radio (electromagnetic waves)
FIT1047
13
Transmission types
• analog signals for analog data:
• e.g. analog AM, FM radio.. etc.
• digital signals for digital data:
• e.g. old Ethernet, USB, the bus in a computer
• analog signals for digital data
• e.g. modems, ADSL, Ethernet, WiFi, 4G, …
FIT1047
14
Digital transmission
FIT1047
Digital transmission
• Digital signals are typically transmitted through copper cables
• A digital signal encodes 0s and 1s into different voltage levels on the cable
• This results in a square wave
• Simplest encoding: unipolar
+3V
0V
101101
FIT1047
16
Digital transmission
+3V NRZ 0V -3V
+3V 0V -3V
10101
NRZI
FIT1047
17
0
0
1
0
0
1
FIT1047
18
Digital transmission
0
1
NRZ NRZI
Manchester
m
dm
mi
l
eh
l
o
0
o
id
w
w-
dd
M
nM
Mi
dl
id
d
–
B
”B
B
-t
t
le
i
i
n
o
o
–
eo
–
b
b
i
na
o
i
t
0
t
t
ar
-h
h
i
f
f
a
t
r
ry
i
g
y“
g
ab
ra
a
n
“
h
hi
bi
i
t
ns
1
1”
Bi
i
n
t
c
1
nt
si
i
c
t
ti
th
a
h
e
hi
al
i
o
o
n
Mi
l
l
l
e
ed
mi
1
0
0
i
d
ig
d
d
gh
d
id
h-
l
le
d-
–
in
t
t
o
eo
–
b
b
0
n
o
o
f
i
it
t
t
a
a
r
–
-l
r
lo
fa
a
b
tr
y
y“
o
ra
w
a
n
“
0
wi
b
i
1
0”
i
n
it
t
c
”
nt
c
t
h
a
he
al
ll
e
le
1
n
s
si
i
t
ti
i
o
o
n
n
ed
d
Digital transmission
Manchester
10101
0
l
e
lo
o
M
n
Mi
0
w
w-
m
t
m
i
i
d
d
–
B
“
B
–
i
d
t
i
i
n
to
o
dd
-b
n
a
d
bi
–
c
d
it
ar
-h
hi
l
l
e
ca
t
t
e
o
al
t
r
ry
l
l
r
y
“
ig
g
o
f
le
e
d
a
a
n
“
h
h
i
fa
d
M
1
1
”
in
”
h
n
t
ab
ns
s
i
bi
it
1
ti
th
i
t
he
io
t
c
on
e
m
n
0
hi
M
i
g
0
g
h
m
i
i
id
d
–
B
B
h-
id
-b
i
in
-t
dd
bi
na
to
o
d
a
r
l
l
e
ca
it
t
t
–
-l
al
t
r
r
lo
l
l
y
y
“
ow
eo
o
f
le
wi
fa
ed
ra
an
n
s
i
n
a
b
nt
si
bi
it
ti
1
0
0
”
”
t
h
i
t
he
io
o
n
FIT1047
19
Analog transmission
FIT1047
Sine Wave
A sine wave can be represented as: s(t) = A sin(2ft + )
t
where:
A – peak amplitude f – frequency
t – time
– phase angle
– phase = Degrees Radians 00 =0
450
900 1350
= /4
= /2 = 3/4
1800 =
00 =
Semester-2
10/4/2020 21
Wave characteristics
Amplitude
• Height of the wave
• Loudness, voltage level
Frequency
• Number of cycles per second, measured in Hertz
• Sound: pitch, light: color
Phase
• Initial angle at which the wave begins
y = A × sin(2π f x + φ)
FIT1047
22
Modulation
• Analog signals are waves
• Take a constant carrier wave (fixed frequency, amplitude, phase)
• Modify its characteristics to encode the bits
• Frequency Modulation or Frequency Shift Keying(FSK)
• Amplitude Modulation or Amplitude Shift Keying(ASK)
• Phase Modulation or Phase Shift Keying(PSK)
FIT1047
23
Frequency Modulation
100110
y = A× sin(2π f x + φ)
FIT1047
24
Amplitude Modulation
100110
y = A × sin(2π f x + φ)
FIT1047
25
Phase Modulation
100110
y = A× sin(2π f x + φ)
FIT1047
26
Combining AM+PM
4 different A amplitudes, 2 different φ phases: y = A × sin(2π f x + φ)
01234567
8 different symbols
3 times the data transmission rate!
FIT1047
27
FIT1047 – Week 8
Networks: Physical and Data Link layers
FIT1047
Data Link layer
FIT1047
Layers of Abstraction
Switch Router Switch
FIT1047
30
Data Link Layer
• Now we’ve seen how we can convert digital data into a signal and back
• The data link layer
• controls access to the physical layer
(MAC = Media Access Control)
• encodes/decodes between frames and signals
• implements error detection
• interfaces to the network layer
FIT1047
31
Contention-based MAC
Any device can transmit at any time
• “first come first served”
Collisions: two devices transmitting at the same time
• packets in a collision are damaged
• avoid collisions by carrier sensing (listening on the network for transmission)
• detect collisions and re-transmit Used in shared Ethernet ..
FIT1047
32
Shared Ethernet
FIT1047
Shared Ethernet
FIT1047
Ethernet
Dominant LAN technology
• Standardized as IEEE 802.3
• used by almost all LANs
• developed in 1973, standardized in 1980
Physical layer
• Originally 10Mbps over shared media coaxial cable
• Now mostly switched 100Mbps or 1Gbps over UTP
• Standards exist for optic fiber up to 100Gbps
FIT1047
35
Ethernet MAC
Media Access Control: CSMA/CD
• Carrier Sense (CS):
listen on bus, only transmit if no other signal is “sensed”
• Multiple Access (MA):
several devices access the same medium
• Collision Detection (CD):
when signal other than own is detected:
• transmit jam signal (so all other devices detect collision)
• both wait random time before re-transmitting
FIT1047
36
Ethernet
SH
h
he
S
S
E
HA
en
Et
H
A
n
HA
t
h
h
c
c
e
A
e
R
R
E
ED
ei
R
RE
er
rn
i
t
E
D
ne
D
ts
s
D
e
t
t
l
l
e
e
Topology:
shared bus (multi-point)
S
C
Co
o
a
a
x
x
i
i
a
al
lc
c
a
ab
b
FIT1047
37
Ethernet
E
Physical topology: star (point-to-point)
Hub
Logical topology: shared bus (multi-point)
E
o
bus
o
v
v
n
n
a
e
e
r
ry
on
al
y
s
ne
ll
l
o
si
ep
ot
i
g
gn
po
t
h
n
o
he
e
r
r
r
t
a
al
ti
l
r
rp
i
s
re
ec
ss
po
or
ce
s
rt
ei
e
en
ts
s
i
nt
v
ve
e
to
o
d
d
o
o
n
n
o
u
u
t
t
FIT1047
38
Problems with Shared Ethernet
Half-duplex
• only one device can send at a time
Broadcasting
• all frames are delivered to all devices, not just destination
Limited network size
• CSMA/CD limits size of collision domain
Solution: implement logical star topology!(switched Ethernet)
FIT1047
39
Switched Ethernet
FIT1047
Switched Ethernet
Network switch
• looks like hub
• 16 to 24 ports for UTP cables
• but: circuit no longer shared!
A switch is a layer 2 device
• reads MAC address of frame
• transmits only to destination port
How does the switch know the destination port?
FIT1047
41
Switch Forwarding Table
MAC
Port
A
0
B
1
C
2
AB
A
BB
At
to
oB
Bt
to
oA
A
When the table is empty, a switch acts like a hub!
01
A
A
A
A
t
t
t
t
o
o
o
oB
32
B
B
B
l Df
ll lC
fl
o
oo
od
p
po
df
or
r
t
s
A
fr
t
so
r
a
s
am
se
ou
me
ex
ur
r
c
x
c
e
t
c
ce
e
e
t
o
o
a
ep
p
t
t
C
al
Ct
t
o
oA
FIT1047
42
Switches and MAC
Full-duplex circuits
• point-to-point connection between computer and switch
• no collisions possible
But frames may still be sent at the same time
• e.g.AsendstoBwhileCsendstoD
• or A and B both send to C simultaneously
• switch has memory: stores second frame until transmission of first frame is finished, then forwards the second – store and forward
Switched Ethernet runs at up to 95% capacity, compared to 50% for shared Ethernet!
FIT1047
43
Rack-mounted switches
p
pa
a
t
tc
ch
h
c
ca
a
b
bl
l
e
es
s
s
sw
w
i
i
t
tc
ch
he
es
s
Monash communications cabinet, Caulfield, Bldg. H level 6
FIT1047
44
Rack-mounted switches
FIT1047
45
Rack-mounted switches
FIT1047
46
Wireless Local Area Networks (WLAN)
FIT1047
Why WiFi?
Wireless LANs
• eliminate cables (heritage buildings, rented apartments, …)
• allow for more flexible network access
• facilitate mobile workers (e.g. hospital)
Basic setup
• WLAN NICs connect to Access Points (APs) using radio frequencies
• APs are connected to wired LANs (or backbones)
FIT1047
48
WLAN Technology
Wi-Fi (or “Wireless Ethernet”)
• IEEE 802.11 family of standards
• Original standard from 1997-1999 (802.11a, 802.11b)
• Widely used: 802.11g (2003), 802.11n (2009)
• Latest: 802.11ac & ad
Other wireless LAN technologies
• WiMAX (802.16)
• Bluetooth (802.15), also called WPAN (Wireless Personal Area Network)
FIT1047
49
WLAN Radio Frequencies
Most WLANs use the 2.4GHz and/or 5GHz range
• high frequencies allow for large bandwidth
• but higher frequencies have stronger attenuation
WLAN channels
• Networks in the same area should not use the same frequencies
• WLAN spectrum is divided into channels, each network is set to a different channel
FIT1047
50
WLAN channels (802.11n)
channel 1 channel 6 channel 11
2.4GHZ band
• 2.4000-2.4835 GHz
• 13 channels, each 22 MHz wide
• But channels overlap! Only 5 MHz apart
FIT1047
51
Neighbors’ channels
Which neighbour needs to switch to a different channel?
2 12
1
channel 1
channel 6
4
4
3
3
channel 6
your house
channel 11
FIT1047
52
Neighbors’ channels
Which neighbour needs to switch to a different channel?
2 12
1
channel 1
channel 6
4
4
channel 11
your house
3
3
channel 6
channel 1
FIT1047
53
CSMA/CA Media Access Control
All devices in a WLAN share the medium
• use the same channel (frequency band)
• need to deal with collisions
CSMA/CA
• Carrier Sense, Multiple Access
• Collision Avoidance
• Compare to 802.3: Collision Detection
• Devices try to actively avoid collisions
FIT1047
54
Why is WLAN different?
s
s
e
en
ns
s
e
ec
c
a
a
r
r
r
r
i
ie
er
r-
–
d
d
o
on
n
‘
‘t
ts
se
en
n
d
d
FIT1047
55
Why is WLAN different?
“hidden node problem”
t
t
o
oo
s
s
o
f
e
e
n
f
ns
a
a
r
se
r
a
e
c
aw
ca
wa
ar
a
rr
r
y
y
t
i
ie
er
to
r
o
!
!
FIT1047
56
Why is WLAN different?
c
“hidden node problem”
co
ol
l
l
li
is
s
i
i
o
o
n
n!
!
t
to
oo
s
s
o
f
e
en
n
s
fa
ar
se
r
a
e
c
a
c
w
wa
a
ar
a
rr
ri
y
yt
ie
e
r
t
r
o
o
!
!
FIT1047
57
Two solutions: ARQ + Controlled Access
802.11 uses stop-and-wait ARQ
• ARQ = Automatic Repeat ReQuest
• AP sends ACK (acknowledgement) after receiving a frame
• devices only send next frame after receiving ACK for previous frame, otherwise re-send original
802.11 may use controlled access
• device can send “Request To Send” (RTS)
• only transmit frame if AP sends “Clear To Send” (CTS)
FIT1047
58
802.11 ARQ
Hidden node problem
• collision detection not reliable
• instead, receiver needs to ACK every frame
What if no ACK?
• we may not sense a carrier (too far away)
• re-sending immediately therefore might be bad idea
Solution: exponential back-off
• 1st collision: everybody waits 0 or 1 time unit
• 2nd: everybody waits between 0 and 3 time units
• 3rd: everybody waits between 0 and 7 time units…
FIT9135
59
WLAN Topology
FIT1047
Basic Service Set (BSS)
Independent BSS
• ad-hoc network
• devices communicate directly with each other
FIT1047
61
Basic Service Set (BSS)
Infrastructure BSS
• all devices communicate with one Access Point (AP)
• AP connects to LAN
• all devices communicate via the AP
FIT1047
62
Extended Service Set (ESS)
BSS1
BSS2
BSS3
AP1 AP2
AP3
15% overlap
n
r
ro
d
d
e
o
a
ev
v
i
am
m
b
i
c
ce
es
be
s
c
et
tw
ca
we
a
n
ee
e
n
n
d
di
if
ff
f
e
er
re
en
n
t
t
A
AP
P
s
s
FIT1047
63
Extended Service Set (ESS)
Extends range of mobility
• set of infrastructure BSSs
• APs communicate to forward traffic between BSSs
• APs communicate via distribution system (LAN)
• devices see a single layer 2 connection
Roaming between different ESSs
• not possible in 802.11 protocol
• requires higher-level protocol, e.g. Mobile IP
FIT1047
64
Extended Service Set (ESS)
https://www.netspotapp.com/
FIT1047
65
2.4 GHz & 5 GHz Channels
channel 1
channel 6
channel 11
z
https://en.wikipedia.org/wiki/List_of_WLAN_channels
s
C
C
C
2
2
.
Ch
h
ha
.
4
4
G
ha
a
an
G
H
n
nn
nn
n
H
n
z
e
e
l
e
z
el
l
ls
s
s
5
5G
GH
H
z
FIT1047
Planning Example
150m
6
1
11
100m
a
av
6
vo
o
i
id
di
in
nt
te
e
r
rf
11
ne
fe
e
e
r
re
l
l
s
e
st
n
nc
to
ce
e
6
a
a
a
ar
r
e
l
l
i
ig
o o
m
m
i
in
ni
g
n
ea
im
nc
as
st
mu
c
u
m
t
o
o
o
oe
m
o
v
v
v
e
e
e
n
r
r
a
ns
1
1
1
6
1
11
11
6
1
a
su
ve
e
g
ge
u
r
rl
e
r
re
la
e
a
p
p
6
1
11
s
se
el
le
e
c
c
t
t
c
c
h
ha
a
n
n
n
11
6
1
50m
FIT1047
channel 1 channel 6 channel 11
67
Attenuation
Walls can introduce significant attenuation.
• 3db means signal strength halves
• 6db means 1/4
• these values are for 2.4GHz, attenuation is even higher in 5GHz
Source: http://www.liveport.com/wifi-signal-attenuation
FIT1047
68
Summary
Physical layer:
• Media: copper cables, optical fibres or radio waves
• modulate digital data onto digital or analog signals
Data link layer:
• Media access control (Wired LAN=CSMA/CD and Wireless LAN=CSMA/CA)
• Ethernet as the dominant LAN technology
• Wireless LANs
FIT1047
69
FIT1047 Week 9
Networks: Network and Transport layers
FIT1047